/* altnet billing — stiluri
   Paletă: hârtie #F6F8F7 · cerneală #17242B · verde altnet #1EB14B (exact, din logo)
           verde închis #0F6B2E (linkuri, sold pozitiv) · roșu datorie #B8321A · linie #DCE3DF */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #F6F8F7;
  --surface: #FFFFFF;
  --ink: #17242B;
  --ink-2: #4A5A62;
  --ink-3: #6B7A81;
  --brand: #1EB14B;
  --brand-deep: #0F6B2E;
  --brand-wash: #E6F6EB;
  --debt: #B8321A;
  --debt-wash: #FBECE8;
  --frozen: #2A5F9E;
  --frozen-wash: #E8F0FA;
  --critical: #D9480F;          /* semnal ONU critic (portocaliu) */
  --line: #DCE3DF;
  --line-2: #EBF0ED;
  --surface-2: #FAFBFA;         /* capul tabelelor */
  --hover: #FAFCFB;
  --dot: #D5DED8;

  --bs-body-font-family: "IBM Plex Sans", system-ui, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-body-font-size: 0.9375rem;
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand-deep);
  --bs-link-color-rgb: 15, 107, 46;
  --bs-link-hover-color: #0A4D21;
  --bs-primary: var(--brand);
  --bs-primary-rgb: 30, 177, 75;
  --bs-focus-ring-color: rgba(30, 177, 75, .35);
  --bs-border-radius: .375rem;
}

body { -webkit-font-smoothing: antialiased; }
.num, .table td.num, .table th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
h1, .h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2, .h2 { font-size: 1.0625rem; font-weight: 600; margin: 0 0 .75rem; }
.text-muted, .muted { color: var(--ink-3) !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Butoane: verde altnet cu text închis (contrast 7:1) ---------- */
.btn { font-weight: 500; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #0B1F12;
  --bs-btn-hover-bg: #19983F; --bs-btn-hover-border-color: #19983F; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #158536; --bs-btn-active-border-color: #158536; --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-disabled-color: #0B1F12;
  --bs-btn-focus-shadow-rgb: 30, 177, 75;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-deep); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-wash); --bs-btn-hover-color: var(--brand-deep); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-wash); --bs-btn-active-color: var(--brand-deep); --bs-btn-active-border-color: var(--brand);
}
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-color: var(--ink); --bs-btn-hover-color: var(--ink); --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--line-2); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--line-2); --bs-btn-hover-border-color: var(--line); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(30,177,75,.2); }
.form-label { font-weight: 500; font-size: .875rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Schelet: bară laterală + conținut ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; } }
.sidebar .brand { display: flex; align-items: center; gap: .55rem; padding: 1.1rem 1.25rem 1rem; text-decoration: none; }
.sidebar .brand img { height: 30px; width: auto; }
.wordmark { font-weight: 700; font-size: 1.45rem; color: var(--brand); letter-spacing: -0.02em; line-height: 1; }
.sidebar .brand small { display: block; color: var(--ink-3); font-size: .75rem; font-weight: 500; margin-top: 2px; }
.nav-side { padding: .25rem .75rem 1rem; overflow-y: auto; flex: 1; }
.nav-side .group { color: var(--ink-3); font-size: .78rem; font-weight: 500; padding: 1rem .6rem .35rem; }
.nav-side a {
  display: flex; align-items: center; gap: .65rem; padding: .45rem .6rem; border-radius: .375rem;
  color: var(--ink-2); text-decoration: none; font-weight: 500; position: relative;
}
.nav-side a i { font-size: 1.05rem; color: var(--ink-3); width: 1.1rem; text-align: center; }
.nav-side a:hover { background: var(--line-2); color: var(--ink); }
.nav-side a.active { background: var(--brand-wash); color: var(--ink); }
.nav-side a.active i { color: var(--brand-deep); }
.nav-side a.active::before { content: ""; position: absolute; left: -.75rem; top: .3rem; bottom: .3rem; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.sidebar-foot { padding: .8rem 1.25rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .7rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020;
}
.quicksearch { flex: 1; max-width: 640px; position: relative; }
.quicksearch i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.quicksearch input { padding-left: 2.4rem; height: 2.5rem; background: var(--paper); border-color: var(--line); }
.quicksearch input:focus { background: var(--surface); }
.quicksearch kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: var(--surface); color: var(--ink-3); border: 1px solid var(--line); font-size: .72rem; padding: .1rem .35rem; }
.content { padding: 1.5rem; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .sub { color: var(--ink-3); font-size: .875rem; margin-top: .2rem; }

/* ---------- Panouri ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; }
.panel-body { padding: 1.1rem 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }
.panel > .table-responsive > .table, .panel > .table { margin: 0; }

/* ---------- Tabele ---------- */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line-2); font-size: .9rem; }
.table > thead th { color: var(--ink-3); font-weight: 500; font-size: .8125rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; padding-top: .6rem; padding-bottom: .6rem; }
.table > thead th a { color: inherit; text-decoration: none; }
.table > thead th a:hover { color: var(--ink); }
.table td, .table th { padding: .55rem .75rem; vertical-align: middle; }
.table tbody tr:hover { background: var(--hover); }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--surface-2); }
.row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.row-link:hover { color: var(--brand-deep); text-decoration: underline; }

/* ---------- Sume și stări ---------- */
.amt-pos { color: var(--brand-deep); }
.amt-neg { color: var(--debt); }
.state { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.state::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.state-active { color: var(--brand-deep); }
.state-frozen { color: var(--frozen); }
.state-disabled { color: var(--ink); }
.state-debt { color: var(--debt); }
.tag { display: inline-block; font-size: .75rem; font-weight: 500; padding: .1rem .45rem; border-radius: .25rem; background: var(--line-2); color: var(--ink-2); }
.tag-ok { background: var(--brand-wash); color: var(--brand-deep); }
.tag-bad { background: var(--debt-wash); color: var(--debt); }
.tag-info { background: var(--frozen-wash); color: var(--frozen); }

/* ---------- PON: semnal și stări ONU ---------- */
.sig { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.sig-ok { color: var(--brand-deep); }
.sig-warn { color: #8A5A00; }
.sig-bad, .sig-high { color: var(--critical); }
.crit, .table td.crit { color: var(--critical); }
.sig-none { color: var(--ink-3); font-weight: 400; }
.pst { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.pst::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pst-working { color: var(--brand-deep); }
.pst-los { color: var(--debt); }
.pst-dyinggasp { color: #8A5A00; }
.pst-offline, .pst-unknown, .pst-logging, .pst-syncmib, .pst-authfailed { color: var(--ink-3); }
.port-row.is-outage { background: var(--debt-wash); }
.olt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.meter { display: inline-block; width: 64px; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: .4rem; }
.meter > span { display: block; height: 100%; background: var(--brand); }

/* ---------- Harta rețelei ---------- */
.map-wrap { position: relative; }
.netmap { height: calc(100vh - 210px); min-height: 480px; border-radius: .5rem; border: 1px solid var(--line); }
.map-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.map-tools .btn.active { background: var(--brand-wash); border-color: var(--brand); }
.map-status { position: absolute; z-index: 500; left: 50%; top: .75rem; transform: translateX(-50%); background: #17242B; color: #fff;
  padding: .45rem .8rem; border-radius: .375rem; font-size: .85rem; max-width: 90%; }
.map-bld { background: #fff; border: 2px solid var(--brand-deep); color: var(--ink); font-size: 11px; font-weight: 600; min-width: 22px; height: 18px;
  line-height: 14px; text-align: center; border-radius: 3px; padding: 0 3px; transform: translate(-50%, -50%); font-variant-numeric: tabular-nums; }
.map-bld.has-down { border-color: var(--debt); color: var(--debt); }
.map-handle { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed #17242B; background: rgba(30,177,75,.25); cursor: move; }
/* desenarea cablurilor: blocurile și pinii abonaților nu prind clicul (devine punct de traseu) */
.net-drawing .leaflet-marker-icon:not(.route-vertex) { pointer-events: none; }
.route-vertex { background: #fff; border: 2px solid #E8590C; border-radius: 50%; cursor: move; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.route-vertex.is-end { background: #E8590C; cursor: default; }
.map-legend { font-size: .8rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--ink-2); }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; border: 1px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.map-legend b { display: inline-block; width: 18px; height: 0; border-top: 3px solid; margin-right: .3rem; vertical-align: 3px; }
.minimap { height: 260px; border-radius: .5rem; border: 1px solid var(--line); }

/* ---------- Fibre pe culori ---------- */
.fib { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 9px; font-weight: 700; color: #fff; border: 2px solid transparent; font-variant-numeric: tabular-nums; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.fib.free { background: var(--surface) !important; color: var(--ink-3); border-style: dashed; border-color: var(--ink-3) !important; text-shadow: none; }
.fib-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tube-sep { width: 1px; background: var(--line); margin: 0 4px; align-self: stretch; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-right: .3rem; border: 1px solid rgba(0,0,0,.25); }
.trace { list-style: none; padding: 0; margin: 0; position: relative; }
.trace li { position: relative; padding: .55rem 0 .55rem 2rem; border-left: 2px solid var(--line); margin-left: .6rem; }
.trace li::before { content: ""; position: absolute; left: -7px; top: .95rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.trace li.t-olt::before { background: #17242B; border-color: #17242B; }
.trace li.t-link::before { background: #F28C28; border-color: #F28C28; }
.trace li.t-splitter::before { background: #7A3FB0; border-color: #7A3FB0; }
.trace li.t-cable { color: var(--ink-2); }
.trace li.t-cable::before { width: 8px; height: 8px; left: -5px; top: 1.1rem; background: var(--line); border-color: var(--line); }
.trace li.t-end::before, .trace li.t-sub::before { background: var(--brand); border-color: var(--brand); }

/* ---------- Cifre pe panou ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); overflow: hidden; }
.stat { padding: 1rem 1.25rem; border-right: 1px solid var(--line-2); text-decoration: none; color: inherit; display: block; }
.stat:last-child { border-right: 0; }
a.stat:hover { background: var(--hover); }
.stat .label { color: var(--ink-3); font-size: .8125rem; font-weight: 500; }
.stat .value { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: .15rem; line-height: 1.2; }
.stat .hint { font-size: .78rem; color: var(--ink-3); margin-top: .15rem; }

/* ---------- Fișa abonatului: soldul e elementul principal ---------- */
.ledger { border-radius: .5rem; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.ledger-top { padding: 1.25rem 1.4rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.ledger .caption { font-size: .8125rem; color: var(--ink-3); font-weight: 500; }
.ledger .balance { font-size: 2.6rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: .2rem 0 .35rem; }
.ledger .balance .cur { font-size: 1.1rem; font-weight: 500; color: var(--ink-3); margin-left: .3rem; letter-spacing: 0; }
.ledger.is-debt { border-color: #EBC2B8; }
.ledger.is-debt .ledger-top { background: linear-gradient(var(--debt-wash), var(--debt-wash)); }
.ledger.is-debt .balance { color: var(--debt); }
.ledger.is-ok .ledger-top { background: var(--brand-wash); }
.ledger.is-ok .balance { color: var(--brand-deep); }
.ledger dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; padding: 1rem 1.4rem; font-size: .9rem; }
.ledger dt { color: var(--ink-3); font-weight: 400; }
.ledger dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.ledger .actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0 1.4rem 1.25rem; }
.ledger .actions .btn-primary { grid-column: 1 / -1; padding: .6rem; }

.facts { display: grid; grid-template-columns: 9.5rem 1fr; gap: .55rem 1rem; margin: 0; font-size: .9rem; }
.facts dt { color: var(--ink-3); font-weight: 400; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; }
.filters .form-control, .filters .form-select { min-width: 9rem; width: auto; }
.page-head > .d-flex { align-items: center; }
.pill-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.pill-tabs a { padding: .35rem .75rem; border-radius: 2rem; font-size: .85rem; font-weight: 600; text-decoration: none;
  background: var(--brand-wash); color: var(--brand-deep); border: 1px solid transparent; }
.pill-tabs a:hover { background: #CDEFD7; color: var(--brand-deep); }
/* fila aleasă: ca butonul principal (verde, text închis); celelalte: ca meniul activ (verde deschis) */
.pill-tabs a.active { background: var(--brand); border-color: var(--brand); color: #0B1F12; }
.pill-tabs a.active:hover { background: #19983F; border-color: #19983F; color: #fff; }
.pill-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pill-tabs a .n { color: inherit; opacity: .75; font-weight: 400; margin-left: .2rem; font-variant-numeric: tabular-nums; }
/* file colorate după stare (lista Abonați): datornici roșu, înghețați albastru, deconectați negru */
.pill-tabs a.tab-debt { background: var(--debt-wash); color: var(--debt); }
.pill-tabs a.tab-debt:hover { background: #F6D9D1; color: var(--debt); }
.pill-tabs a.tab-debt.active, .pill-tabs a.tab-debt.active:hover { background: var(--debt); border-color: var(--debt); color: #fff; }
.pill-tabs a.tab-frozen { background: var(--frozen-wash); color: var(--frozen); }
.pill-tabs a.tab-frozen:hover { background: #D3E2F4; color: var(--frozen); }
.pill-tabs a.tab-frozen.active, .pill-tabs a.tab-frozen.active:hover { background: var(--frozen); border-color: var(--frozen); color: #fff; }
.pill-tabs a.tab-off { background: #E9ECED; color: var(--ink); }
.pill-tabs a.tab-off:hover { background: #DADFE1; color: var(--ink); }
.pill-tabs a.tab-off.active, .pill-tabs a.tab-off.active:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-active-color: #0B1F12; --bs-pagination-color: var(--brand-deep); margin: 0; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: .25rem; }

.alert { border-radius: .5rem; }
.alert-success { --bs-alert-bg: var(--brand-wash); --bs-alert-border-color: #BFE6CB; --bs-alert-color: #0A4D21; }

/* ---------- Login și pagina publică ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0) 0 0 / 22px 22px,
    var(--paper); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 2rem; }
.auth-card .wordmark { font-size: 2rem; }

.public-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.public-head .inner, .public-main { max-width: 560px; margin: 0 auto; padding: 1rem 1.25rem; }
.public-main { padding-top: 2rem; padding-bottom: 3rem; }
.pay-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pay-amounts .btn { font-variant-numeric: tabular-nums; }

@media (max-width: 991.98px) {
  .sidebar { width: 260px; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}
@media (max-width: 575.98px) {
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .5rem; }
  .ledger .balance { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
/* stratul Abonați pe hartă */
.sub-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; font-size: .8rem; color: var(--ink-2); }
.sub-filter { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; margin: 0; }
.sub-filter.is-empty { opacity: .5; }
.sub-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); vertical-align: -1px; margin-right: .2rem; }
.sub-pin { background: none; border: 0; }
.sub-pin svg { display: block; filter: drop-shadow(1px 2px 1.5px rgba(0,0,0,.35)); }
.sub-pin.is-inactive { opacity: .45; }
.leaflet-tooltip.sub-tip { font-weight: 600; font-size: .8rem; padding: 2px 6px; }
.sub-pop { font-size: .82rem; }
.sub-pop-title { font-weight: 700; font-size: .95rem; color: var(--ink); padding-right: .75rem; }
.sub-pop-rx { font-size: 1.05rem; font-weight: 600; margin-top: .1rem; }
.sub-pop-rx span { font-size: .75rem; font-weight: 400; color: var(--ink-3); }
.sub-pop-icons { display: flex; gap: .55rem; margin: .3rem 0 .4rem; font-size: 1.05rem; }
.sub-pop-icons a { color: #1F5FBF; text-decoration: none; }
.sub-pop-table td { padding: 2px 0; vertical-align: top; }
.sub-pop-table td:first-child { color: var(--ink-3); padding-right: .6rem; white-space: nowrap; }
.sub-pop-table .text-muted { font-size: .75rem; }
.sub-tools { display: flex; flex-direction: column; align-items: flex-end; background: var(--surface); }
.sub-tools .sub-tool { width: 34px; height: 34px; line-height: 34px; text-align: center; color: var(--ink-2); font-size: 1rem; }
.sub-tools .sub-tool-input { width: 15rem; max-width: 70vw; margin: 3px; }
.map-wrap.is-fullscreen { position: fixed; inset: 0; z-index: 1050; background: var(--surface); }
.map-wrap.is-fullscreen .netmap { height: 100vh; border-radius: 0; border: 0; }
body.map-fullscreen-open { overflow: hidden; }

/* Starea serverului: bara de ocupare (verde / galben / roșu după prag) */
.usage { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin: .5rem 0 .35rem; }
.usage > span { display: block; height: 100%; background: var(--ink-3); border-radius: 3px; transition: width .4s ease; }
.usage-ok > span { background: var(--brand); }
.usage-warn > span { background: #C98A00; }
.usage-bad > span { background: var(--debt); }
.usage-inline { display: inline-block; width: 64px; margin: 0 .5rem 0 0; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .usage > span { transition: none; } }

/* Deranjamente: starea (deschis = roșu, în lucru = albastru, rezolvat = verde, anulat = gri) */
.fst { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.fst::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.fst-open { color: var(--debt); }
.fst-progress { color: var(--frozen); }
.fst-resolved { color: var(--brand-deep); }
.fst-cancelled { color: var(--ink-3); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .7rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: .78rem; color: var(--ink-3); }
.timeline .text { white-space: pre-line; overflow-wrap: anywhere; }

/* Lucrări: pozele și casetele de montori */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .375rem; border: 1px solid var(--line); background: var(--line-2); display: block; }
.photo-grid figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .75rem; color: var(--ink-3); margin-top: .25rem; }
.photo-grid figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .15rem 1rem; }
.worker-checks details, .worker-checks > div { grid-column: 1 / -1; }
.worker-checks details .form-check { display: inline-block; min-width: 190px; margin-right: 1rem; }
.worker-checks .form-check { cursor: pointer; }

/* Fișa lucrării */
.sheet-table input.qty { width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; margin-left: auto; background: #FFFBEF; }
.sheet-table td { vertical-align: middle; }
.sheet-totals { grid-template-columns: 1fr auto; }

/* Wizard de conectare */
.wizard-steps { display: flex; gap: .25rem; list-style: none; margin: 0 0 1.25rem; padding: 0; overflow-x: auto; }
.wizard-steps li { flex: 1 0 auto; min-width: 7.5rem; }
.wizard-steps a, .wizard-steps span.s { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-radius: .5rem; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .875rem; font-weight: 500; white-space: nowrap; height: 100%; }
.wizard-steps a:hover { border-color: var(--brand); }
.wizard-steps .num { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--line-2); color: var(--ink-2); font-size: .78rem; font-weight: 600; }
.wizard-steps .done .num { background: var(--brand); color: #fff; }
.wizard-steps .current a, .wizard-steps .current span.s { border-color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); color: var(--ink); }
.wizard-steps .todo-warn .num { background: var(--debt-wash); color: var(--debt); }
.wizard-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.wizard-check { list-style: none; margin: 0; padding: 0; }
.wizard-check li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); }
.wizard-check li:last-child { border-bottom: 0; }
.wizard-check .bi-check-circle-fill { color: var(--brand); } .wizard-check .bi-exclamation-circle { color: var(--debt); }

/* Tipul lucrării: o bulină în culoarea tipului (ca în planificatorul Ubilling) */
.jt { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500; white-space: nowrap; }
.jt::before { content: ""; width: .55rem; height: .55rem; border-radius: 2px; background: var(--jt, var(--ink-3)); flex: none; }

/* „Adaugă poze”: câmpul de fișier ascuns vizual, eticheta e butonul; focusul de la tastatură se vede pe buton */
.file-pick { cursor: pointer; position: relative; }
.file-pick:focus-within { box-shadow: 0 0 0 .2rem rgba(30, 177, 75, .35); }

/* Panou: deranjamentele deschise cu roșu, conectările cu albastru */
.stat .value.v-fault { color: var(--debt); }
.stat .value.v-connect { color: var(--frozen); }

/* ---------- Tema întunecată (data-bs-theme="dark" pe <html>: aleasă sau „automată” după sistem) ---------- */
[data-bs-theme="dark"] {
  --paper: #0E1417;
  --surface: #151D21;
  --surface-2: #1A2328;
  --hover: #1C262B;
  --dot: #26323A;
  --ink: #E2E8EA;
  --ink-2: #B3BFC4;
  --ink-3: #8D9BA1;
  --brand-deep: #5CD08A;
  --brand-wash: #133122;
  --debt: #FF8A70;
  --debt-wash: #3A1D17;
  --frozen: #8AB6EE;
  --frozen-wash: #182A42;
  --critical: #FF9A5C;
  --line: #2A363C;
  --line-2: #212B30;
  --bs-link-color: var(--brand-deep);
  --bs-link-color-rgb: 92, 208, 138;
  --bs-link-hover-color: #8BE0AC;
  --bs-link-hover-color-rgb: 139, 224, 172;
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-emphasis-color: #F3F6F7;
  color-scheme: dark;
}
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: var(--paper); color: var(--ink); border-color: var(--line); }
[data-bs-theme="dark"] .form-control::placeholder { color: #6E7D83; }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-select:disabled { background-color: var(--surface-2); }
[data-bs-theme="dark"] .dropdown-menu, [data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .offcanvas { background: var(--surface); color: var(--ink); border-color: var(--line); }
[data-bs-theme="dark"] .alert-success { --bs-alert-bg: var(--brand-wash); --bs-alert-border-color: #1F5A36; --bs-alert-color: #B9EBCB; }
[data-bs-theme="dark"] .pill-tabs a:hover { background: #1B4A2D; color: #B9EBCB; }
[data-bs-theme="dark"] .pill-tabs a.tab-debt:hover { background: #4A2219; }
[data-bs-theme="dark"] .pill-tabs a.tab-frozen:hover { background: #1F3554; }
[data-bs-theme="dark"] .pill-tabs a.tab-off { background: #222C31; color: var(--ink); }
[data-bs-theme="dark"] .pill-tabs a.tab-off:hover { background: #2A363C; }
[data-bs-theme="dark"] .pill-tabs a.tab-off.active { background: var(--ink); color: #0E1417; }
[data-bs-theme="dark"] .ledger.is-debt { border-color: #5A2A20; }
[data-bs-theme="dark"] .sig-warn, [data-bs-theme="dark"] .pst-dyinggasp { color: #E0B24A; }
[data-bs-theme="dark"] .sheet-table input.qty { background: #2A2614; }
[data-bs-theme="dark"] .st-proiectat { background: #182A42; color: #A9C8F0; }
[data-bs-theme="dark"] .st-neverificat { background: #3A3016; color: #F0CF7A; }
[data-bs-theme="dark"] .mtable tr.sel td { background: #3A3016; }
[data-bs-theme="dark"] .rep { --c-work-wash: #133122; --c-conn-wash: #10261A; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] kbd { background: var(--surface-2); color: var(--ink-2); }
/* harta: plăcile se întunecă, punctele și liniile rămân în culorile lor */
[data-bs-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
[data-bs-theme="dark"] .leaflet-container { background: #1A2226; }
[data-bs-theme="dark"] .leaflet-popup-content-wrapper, [data-bs-theme="dark"] .leaflet-popup-tip,
[data-bs-theme="dark"] .leaflet-tooltip { background: var(--surface); color: var(--ink); border-color: var(--line); }
[data-bs-theme="dark"] .leaflet-bar a, [data-bs-theme="dark"] .leaflet-control-layers { background: var(--surface); color: var(--ink); border-color: var(--line); }
[data-bs-theme="dark"] .leaflet-control-attribution { background: rgba(21, 29, 33, .8); color: var(--ink-3); }
[data-bs-theme="dark"] .leaflet-control-attribution a { color: var(--ink-2); }
@media print { [data-bs-theme="dark"] { --paper: #fff; --surface: #fff; --ink: #17242B; --ink-2: #4A5A62; --ink-3: #6B7A81; --line: #DCE3DF; --line-2: #EBF0ED; } }
