/* ── Ресурсы: аналитика, сверка со счётом, ссылки на счётчики (12.11.2026) ──
   Отдельным файлом, чтобы не раздувать app.css. Подключён в index.html после app.css. */

/* Ссылка на счётчик/точку внутри таблиц и списков — как текст, а не синяя подчёркнутая. */
.ra-link, .eb-table a, .ebc a {
  color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer;
  border-bottom: 1px dashed transparent; transition: color .15s, border-color .15s;
}
.ra-link:hover, .eb-table a:hover, .ebc a:hover { color: var(--primary); border-bottom-color: currentColor; }
.ra-coef {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: var(--bg-muted); color: var(--text-muted); font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums; vertical-align: 1px;
}
.ra-muted { color: var(--text-muted); font-weight: 400; }

/* Заголовки блоков */
.ra-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-secondary); margin: 0 0 10px; }
.ra-sec { margin-top: 26px; }
.ra-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ra-sec-head .ra-h { margin: 0; }
.ra-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

/* Плитки */
.ra-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.ra-tile { background: var(--bg); border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ra-tile-k { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.ra-tile-v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-tile-v small { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-left: 3px; }
.ra-tile-s { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.ra-tile.is-warn { border-color: #fecaca; background: #fef2f2; }
.ra-tile.is-warn .ra-tile-v { color: #b91c1c; }

/* График */
.ra-chart { background: var(--bg); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px 16px 12px; }
.ra-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ra-chart-grid { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 8px;
  background: repeating-linear-gradient(to top, transparent 0, transparent 39px, var(--border-light) 39px, var(--border-light) 40px); }
.ra-col { flex: 1; min-width: 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.ra-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.ra-bar { width: 14px; border-radius: 4px 4px 0 0; }
.ra-bar.bill { background: #94a3b8; }
.ra-bar.ours { background: var(--primary, #2f6b3a); }
.ra-col-l { font-size: 11px; color: var(--text-muted); }
.ra-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.ra-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Доля */
.ra-share { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.ra-share-bar { flex: 1; height: 6px; background: var(--bg-muted); border-radius: 3px; overflow: hidden; }
.ra-share-bar i { display: block; height: 100%; background: var(--primary, #2f6b3a); border-radius: inherit; }
.ra-share span { font-size: 12px; color: var(--text-muted); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* «Требует внимания» — группами */
.ra-issues { display: grid; gap: 10px; }
.ra-issue { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.ra-issue-h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.ra-issue-h .ra-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ra-issue-h .ra-cnt { color: var(--text-muted); font-weight: 500; }
.ra-issue-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ra-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-muted); font-size: 12px; color: var(--text); text-decoration: none; cursor: pointer; }
.ra-chip:hover { background: var(--primary-light, #e7f2ea); color: var(--primary); }
.ra-chip em { font-style: normal; color: var(--text-muted); }

/* Сверка за месяц (окно) */
.ebc .eb-table td { vertical-align: middle; }
.ebc-pt { display: flex; align-items: flex-start; gap: 8px; cursor: default; }
.ebc-pt.has { cursor: pointer; }
.ebc-tg { flex: none; width: 18px; height: 18px; border-radius: 4px; background: var(--bg-muted); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; margin-top: 1px; transition: transform .15s; }
.ebc-pt.open .ebc-tg { transform: rotate(90deg); }
.ebc-name { font-weight: 600; line-height: 1.3; }
.ebc-addr { font-size: 11px; color: var(--text-muted); line-height: 1.35; margin-top: 2px; }
.ebc-sub td { background: var(--bg-muted); font-size: 12px; }
.ebc-sub td:first-child { padding-left: 36px; }
.ebc-st { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ebc-st.warn { color: #b91c1c; font-weight: 600; }
.ebc-st.part { color: #b45309; font-weight: 600; }
.ebc-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }

@media (max-width: 640px) {
  .ra-tile-v { font-size: 20px; }
  .ra-tiles { grid-template-columns: 1fr 1fr; }
}

/* ── Раздел «Ресурсы»: плитки и счётчики строками (12.11.2026) ── */
.rr-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.rr-tiles .ra-tile[role=button] { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rr-tiles .ra-tile[role=button]:hover { border-color: var(--green-600, #16a34a); }
.rr-tiles .ra-tile.is-warn { border-color: #fde68a; background: #fffbeb; }
.rr-tiles .ra-tile.is-warn .ra-tile-v { color: #b45309; }
.rr-tiles .ra-tile.is-on { box-shadow: 0 0 0 2px var(--green-600, #16a34a) inset; }
.rr-card { padding: 4px 0; margin-bottom: 14px; overflow: hidden; }
.rr-head, .rr-row { display: grid; grid-template-columns: 34px minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.1fr) 64px 92px;
  gap: 14px; align-items: center; padding: 0 16px; }
.rr-head { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 10px; padding-bottom: 6px; }
.rr-row { min-height: 58px; padding-top: 8px; padding-bottom: 8px; cursor: pointer; border-top: 1px solid var(--border-light); }
.rr-row:hover { background: var(--bg-secondary); }
.rr-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.rr-t { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-t .res-tenant-badge { margin-left: 6px; vertical-align: 1px; }
.rr-s { font-size: 12px; color: var(--text-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); white-space: nowrap; }
.rr-u { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.rr-muted { color: var(--text-muted); }
.rr-warn { color: #b45309; font-weight: 600; }
.rr-btn { display: inline-flex; align-items: center; gap: 5px; justify-self: end; }
.rr-btn svg { width: 14px; height: 14px; }
.rr-inline { padding: 4px 16px 12px 64px; }
.rr-group-h { display: flex; align-items: baseline; gap: 7px; padding: 16px 16px 8px; font-size: 13px; font-weight: 700;
  color: var(--text-primary); border-top: 1px solid var(--border-light); background: var(--bg-secondary); }
.rr-group-h .rr-gi { align-self: center; }
.rr-card > .rr-group:first-of-type .rr-group-h { border-top: 0; }
.rr-group-h > span:not(.rr-gi) { color: var(--text-muted); font-weight: 600; }
.rr-group-h em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rr-group-h + .rr-item .rr-row { border-top-color: transparent; }
.rr-gi { display: inline-flex; font-size: 14px; }
.rr-tenants .rr-group-h { border-top: 0; }

@media (max-width: 900px) {
  .rr-tiles { grid-template-columns: 1fr 1fr; }
  .rr-head { display: none; }
  .rr-row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "ic name btn" "ic val per";
    row-gap: 4px; column-gap: 12px; }
  .rr-ic { grid-area: ic; align-self: start; margin-top: 2px; }
  .rr-name { grid-area: name; min-width: 0; }
  .rr-val { grid-area: val; min-width: 0; }
  .rr-per { grid-area: per; text-align: right; min-width: 0; }
  .rr-spark { display: none; }
  .rr-btn { grid-area: btn; }
  .rr-inline { padding-left: 16px; }
}
@media (max-width: 640px) {
  .rr-card { margin-left: -4px; margin-right: -4px; }
  .rr-row, .rr-group-h { padding-left: 12px; padding-right: 12px; }
  .rr-v { font-size: 14px; }
}

/* Группировка списка и страница точки поставки (14.11.2026) */
.rr-toggle{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 10px;font-size:13px;color:var(--text-muted)}
.rr-tg{border:1px solid var(--border-light);background:var(--bg-card);border-radius:999px;padding:7px 12px;font-size:13px;color:var(--text-secondary)}
.rr-tg.on{background:var(--primary);border-color:var(--primary);color:#fff}
.rr-plink{margin-left:8px;font-style:normal;white-space:nowrap}
.rp-req{font-size:13px;color:var(--text-muted);margin-bottom:12px;line-height:1.5}
.rp-h{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);margin:16px 0 8px}
.rp-warn{color:#b45309}.rp-ok{color:#15803d}
.rp-m{display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--border-light);cursor:pointer}
.rp-m:first-child{border-top:0}.rp-m b{display:block;font-size:14px}.rp-m small{color:var(--text-muted);font-size:12px}
.rp-m .sh{margin-left:auto;text-align:right;white-space:nowrap;font-size:13px}

/* ссылки раздела — в цвет приложения, без подчёркивания по умолчанию */
.rr-plink,.eb-point a{color:var(--primary);text-decoration:none;font-weight:600}
.rr-plink:hover,.eb-point a:hover{text-decoration:underline}

/* Просмотр точки на карте (app-geo-view.js) */
.geo-view-foot { padding: 12px 16px 14px; border-top: 1px solid var(--border-light); }
.geo-view-note { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.geo-view-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.geo-view-coords { font-size: 12px; color: var(--text-muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.geo-view-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); line-height: 1.5; }
.geo-view-link { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--primary); background: var(--bg-card, #fff); cursor: pointer; text-decoration: none; }
@media (max-width: 640px) { .geo-view-coords { margin-left: 0; width: 100%; } }
.geo-view-actions a.btn { text-decoration: none; }

/* Общая карта хозяйства (app-geo-map.js) */
.geo-map-modal { max-width: 1100px; width: 97%; }
#geo-map-canvas { height: 66vh; min-height: 360px; width: 100%; }
.geo-map-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border-light); }
.geo-map-site { width: auto; min-width: 180px; max-width: 100%; height: 36px; font-size: 13px; }
.geo-map-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.geo-map-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-card, #fff); color: var(--text-muted); font-size: 13px; cursor: pointer; }
.geo-map-chip i, .geo-map-list a i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.geo-map-chip.on { color: var(--text); border-color: var(--text-muted); font-weight: 600; }
.geo-map-chip:not(.on) i { opacity: .35; }
.geo-map-note { padding: 10px 16px 12px; font-size: 12px; color: var(--text-muted); line-height: 1.45; border-top: 1px solid var(--border-light); }
.geo-map-site-ico { display: flex !important; align-items: center; gap: 6px; width: auto !important; height: auto !important; white-space: nowrap;
  transform: translate(-16px, -16px); cursor: pointer; }
.geo-map-site-ico b { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px;
  background: #166534; color: #fff; font-size: 13px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.geo-map-site-ico span { background: rgba(255,255,255,.94); color: #0f172a; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.geo-map-approx-ico b { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: #f59e0b; color: #fff; font-size: 12px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.geo-map-pop { font-size: 13px; min-width: 190px; }
.geo-map-pop > div { color: #64748b; font-size: 12px; margin: 2px 0 8px; }
.geo-map-pop .btn { width: 100%; }
.geo-map-list { max-height: 190px; overflow-y: auto; margin: 0 !important; }
.geo-map-list a { display: flex; align-items: center; gap: 7px; padding: 6px 0; color: #0f172a; text-decoration: none; font-size: 13px; border-top: 1px solid #f1f5f9; }
.geo-map-more { color: #94a3b8; font-size: 12px; padding-top: 6px; }
@media (max-width: 640px) { #geo-map-canvas { height: 58vh; } .geo-map-site { width: 100%; } .geo-map-bar { padding: 8px 12px; } }
.geo-map-warn { color: #b45309; } .geo-map-warn a { color: #b45309; font-weight: 600; }

/* Ресурсы: баланс «ввод — счётчики за ним» (app-resources-balance.js) */
.rb-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.rb-box.rb-ok { background: #F0FDF4; border-color: #BBF7D0; }
.rb-box.rb-warn { background: #FFFBEB; border-color: #FDE68A; }
.rb-box.rb-wait { background: var(--bg-secondary); color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.rb-period { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.rb-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.rb-list i { font-style: normal; font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; margin-left: 4px; }
.rb-list .rb-sum { border-top: 1px solid rgba(15,23,42,.12); margin-top: 4px; padding-top: 8px; }
.rb-list .rb-diff { font-weight: 700; }
.rb-wait .rb-list { margin-top: 8px; }
.rb-verdict { font-size: 13px; margin-top: 8px; line-height: 1.45; }
.rr-tiles .ra-tile.is-second .ra-tile-v { font-size: 18px; color: var(--text-secondary); }
