/* Aspectul general: sobru (neutre reci, un singur accent), modern (colțuri rotunjite, umbre fine, stări de focus clare).
   Culorile sunt variabile: tema întunecată le redefinește mai jos. */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel2: #f7f9fb;
  --ink: #17202c;
  --ink-dim: #5a6778;
  --ink-faint: #8a96a6;
  --border: #e2e7ee;
  --border-strong: #cdd5df;
  --accent: #2459d6;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0fd;
  --accent-ring: rgba(36, 89, 214, .18);
  --ok: #17794a;
  --ok-soft: #e4f4eb;
  --warn: #93600a;
  --warn-soft: #fcf2dc;
  --danger: #c0352e;
  --danger-soft: #fcebea;
  --side: #121a26;
  --side-ink: #c3cedb;
  --side-dim: #6f7f94;
  --side-active: #1f2c3d;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 7px;
  --r-mare: 10px;
  --umbra: 0 1px 2px rgba(16, 24, 40, .05);
  --umbra-mare: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  /* „only”: tema light rămâne luminoasă și cu telefonul în modul întunecat (Chrome pe Android, mai ales aplicația
     instalată, ar închide altfel automat culorile paginii, care ar arăta gri) */
  color-scheme: only light;
}
:root[data-theme="dark"] {
  --bg: #0e141c;
  --panel: #151d28;
  --panel2: #1a2431;
  --ink: #dde5ef;
  --ink-dim: #96a3b5;
  --ink-faint: #6c7a8d;
  --border: #243041;
  --border-strong: #324155;
  --accent: #5b8ff9;
  --accent-soft: #1a2a44;
  --accent-ring: rgba(91, 143, 249, .25);
  --ok: #4cc38a;
  --ok-soft: #14301f;
  --warn: #e5a83b;
  --warn-soft: #33270f;
  --danger: #ff6b63;
  --danger-soft: #3a1a19;
  --side: #0a0f16;
  --side-active: #182335;
  --umbra: 0 1px 2px rgba(0, 0, 0, .3);
  --umbra-mare: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.005em; }
.num, td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dim { color: var(--ink-dim); }
.mic { font-size: 12px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* selecția: accentul la 32%, vizibilă și pe fundalurile deschise colorate cu accentul (ex. notele .mesaj.info) */
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }

/* ---------- cadrul aplicației ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 14px 10px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #2a3a50 transparent; }
/* antetul meniului: sigla companiei (PNG cu fundal transparent, img/logo-bursutech-mic.png) și numele aplicației */
.logo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 8px 14px; }
.logo .sigla { display: block; flex: 1; min-width: 0; line-height: 0; border-radius: 6px; }
.logo .sigla img { width: 100%; max-width: 190px; height: auto; }
/* linkul siglei nu ia stilul linkurilor din meniu (padding, fundal la survolare) */
.side .logo a.sigla, .side .logo a.sigla:hover { padding: 2px 0; margin: 0; background: none; box-shadow: none; }
.logo .sigla:hover { text-decoration: none; opacity: .9; }
.logo .numeErp { flex-basis: 100%; font-size: 11.5px; font-weight: 500; color: var(--side-dim); letter-spacing: .01em; padding-left: 2px; }
.side a { display: block; color: var(--side-ink); padding: 6px 10px 6px 12px; border-radius: 6px; font-size: 13.5px; margin: 1px 0;
  transition: background .12s, color .12s; }
.side a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.side a.activ { background: var(--side-active); color: #fff; font-weight: 500; box-shadow: inset 3px 0 0 var(--accent); }
/* fișa articolului: „+ Subtip nou” sub câmpul Subtip (deschide fereastra subtipurilor) */
/* comutator pornit / oprit (ex. „Arbore pe grupe” la articole): bifa ascunsă, pista cu buton rotund */
.comutatorSwitch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap; }
.comutatorSwitch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.comutatorSwitch .pista { position: relative; width: 34px; height: 19px; flex: 0 0 auto; border-radius: 10px; background: var(--border-strong); transition: background .15s; }
.comutatorSwitch .pista::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.comutatorSwitch input:checked + .pista { background: var(--accent); }
.comutatorSwitch input:checked + .pista::after { transform: translateX(15px); }
.comutatorSwitch input:focus-visible + .pista { outline: 2px solid var(--accent); outline-offset: 2px; }
.subtipNou { display: flex; margin-top: 4px; }
.subtipNou #subtipNou { align-self: flex-start; }
/* sub-pagină (ex. Subtipuri sub Articole): indentată, cu o linie de legătură */
.side a.subLink { position: relative; margin-left: 14px; padding-left: 16px; font-size: 13px; }
.side a.subLink::before { content: ''; position: absolute; left: 4px; top: 50%; width: 7px; border-top: 1px solid var(--side-dim); opacity: .7; }
/* categoriile meniului: capul grupului restrânge / extinde linkurile (starea se ține în browser) */
.grupMeniu { margin-top: 10px; }
.capGrup { display: flex; align-items: center; width: 100%; gap: 6px; background: none; border: 0; cursor: pointer; font: 600 11px var(--font);
  text-transform: uppercase; letter-spacing: .07em; color: var(--side-dim); padding: 6px 10px; border-radius: 6px; text-align: left; }
.capGrup:hover { color: var(--side-ink); background: var(--side-active); }
.capGrup .sageata { margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; opacity: .8; }
.grupMeniu.restrans .capGrup .sageata { transform: rotate(-45deg); }
.grupMeniu .linkuriGrup { overflow: hidden; }
.grupMeniu.restrans .linkuriGrup { display: none; }
.continut { min-width: 0; display: flex; flex-direction: column; }
.bara { display: flex; align-items: center; gap: 10px; padding: 10px 28px; min-height: 58px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.bara .titlu { flex: 1; min-width: 0; }
.bara select { max-width: 240px; }
.bara .user { font-size: 12.5px; color: var(--ink); display: flex; flex-direction: column; line-height: 1.25; text-align: right; font-weight: 500; }
.bara .user small { font-size: 11px; color: var(--ink-faint); font-weight: 400; }
/* numele din bară (și blocul din meniul de pe telefon): legături spre pagina „Contul meu” */
.bara a.user { padding: 4px 8px; border-radius: 6px; text-decoration: none; }
.bara a.user:hover, .bara a.user:focus-visible { background: var(--panel2); outline: none; }
a.userMeniu { text-decoration: none; }
a.userMeniu:hover, a.userMeniu:focus-visible { outline: 1px solid var(--side-dim); }
.bara .meniuBtn { display: none; }
.side .inchideMeniu { display: none; }
/* utilizatorul logat, sus în meniul lateral: doar pe ecranele înguste (pe telefon bara de sus nu are loc pentru el) */
.userMeniu { display: none; align-items: center; gap: 10px; margin: 0 4px 12px; padding: 10px; border-radius: 8px; background: var(--side-active); }
.userMeniu .date { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.userMeniu b { color: #fff; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userMeniu small { color: var(--side-dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }
/* banda modului local: mereu vizibilă, deasupra barei de titlu (care coboară sub ea: --h-local, din app.js) */
.local { background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 500; line-height: 1.4; padding: 9px 28px;
  border-bottom: 2px solid var(--warn); position: sticky; top: 0; z-index: 6; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.local ~ .bara { top: var(--h-local, 0px); }
/* telefonul întors (peisaj, ecran scund): bara de titlu compactă, pe un rând, iar la derularea în jos glisează în sus și
   dispare (clasa .ascunsa, din app.ts); revine la derularea în sus. Banda modului local nu mai stă fixată deasupra */
.bara { transition: transform .22s ease; }
@media (orientation: landscape) and (max-height: 500px) {
  /* .continut: mai specific decât regulile pentru ecranele înguste de mai jos (padding-ul barei și al paginii) */
  .continut .bara { min-height: 0; padding: 4px 12px; gap: 8px; flex-wrap: nowrap; }
  .bara .titlu h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bara .btn.mic { min-height: 26px; padding: 2px 8px; }
  .bara #firmaSel, .bara .firmaNume { order: 0; flex: 0 1 auto; max-width: 35%; font-size: 12.5px; }
  .bara .firmaNume { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bara #firmaSel { padding-top: 2px; padding-bottom: 2px; min-height: 26px; }
  .bara .user { display: none; }
  .bara.ascunsa { transform: translateY(-100%); box-shadow: none; }
  .local { position: static; padding: 4px 12px; font-size: 12.5px; }
  .local ~ .bara { top: 0; }
  .app { --h-local: 0px !important; }
  .continut main { padding-top: 12px; }
}
/* modul local pe server (cont real, date de test): mai vizibil, cu butonul de ieșire */
.local { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.local .btn { margin-left: auto; flex: none; }

/* ---------- componente ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 13.5px var(--font); padding: 7px 14px; min-height: 34px;
  border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--panel); color: var(--ink); cursor: pointer; white-space: nowrap;
  box-shadow: var(--umbra); transition: background .12s, border-color .12s, box-shadow .12s, filter .12s; }
.btn:not(:disabled):hover { border-color: var(--ink-faint); background: var(--panel2); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.btn.prim { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.prim:not(:disabled):hover { filter: brightness(1.07); background: var(--accent); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:not(:disabled):hover { filter: brightness(1.07); background: var(--ok); }
.btn.pericol { color: var(--danger); }
.btn.pericol:not(:disabled):hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.rosu { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.rosu:not(:disabled):hover { filter: brightness(1.07); background: var(--danger); }
.card.zona-pericol { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.card.zona-pericol h2 { color: var(--danger); }
.btn.mic { padding: 4px 10px; min-height: 28px; font-size: 12.5px; }
.btn.icon { padding: 4px 8px; min-height: 0; border-color: transparent; background: transparent; color: var(--ink-faint); box-shadow: none; }
.btn.icon:not(:disabled):hover { color: var(--danger); background: var(--danger-soft); }
/* butonul dezactivat nu reacționează la mouse (hover-ul de mai sus e doar pentru butoanele active) */
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

input, select, textarea { font: 13.5px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 7px 10px; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); box-shadow: none; }
input.num { text-align: right; }
input:disabled, select:disabled, input[readonly] { background: var(--panel2); color: var(--ink-dim); }
label.camp { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-dim); font-weight: 500; }
label.bifa { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
/* bifa nu se micșorează când textul de lângă ea trece pe mai multe rânduri */
label.bifa > input[type=checkbox], label.bifa > input[type=radio] { flex: 0 0 auto; }
.grila { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; }
.grila .lat { grid-column: span 2; }
/* două câmpuri scurte într-o singură celulă a grilei, pe jumătate fiecare (ex. Cod intern + Cod producător) */
.grila.doiPeRand { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 520px) { .grila.doiPeRand { grid-template-columns: 1fr; } }
.grila .perecheCampuri { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-mare); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--umbra); }
.antet { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.antet .spatiu { flex: 1; }
.filtre { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filtre label.camp { min-width: 140px; }
.filtre .cauta { min-width: 220px; }
/* rând nou în filtre (ex. bifele sub câmpuri): ocupă toată lățimea, fără înălțime; marginea negativă anulează al doilea spațiu dintre rânduri */
.filtre .randNou { flex-basis: 100%; height: 0; margin-top: -12px; }

.tabel { width: 100%; border-collapse: collapse; background: var(--panel); }
.tabel th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim);
  background: var(--panel2); border-bottom: 1px solid var(--border); padding: 10px 12px; white-space: nowrap; }
.tabel td:first-child { white-space: nowrap; }
/* capul de tabel nu se selectează la click; coloanele sortabile (aria-sort, din app.js) arată direcția */
.tabel th { user-select: none; -webkit-user-select: none; }
.tabel th[aria-sort] { cursor: pointer; }
.tabel th[aria-sort]:hover { color: var(--ink); }
.tabel th[aria-sort]::after { content: '↕'; margin-left: 5px; opacity: .3; font-size: 10px; }
.tabel th[aria-sort="ascending"]::after { content: '▲'; opacity: .8; color: var(--accent); }
.tabel th[aria-sort="descending"]::after { content: '▼'; opacity: .8; color: var(--accent); }
.tabel td { border-bottom: 1px solid var(--border); padding: 9px 12px; vertical-align: middle; }
.tabel tbody tr { transition: background .1s; }
.tabel tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tabel tbody tr.clic { cursor: pointer; }
.tabel tbody tr.clic:hover td { background: var(--accent-soft); }
/* rândurile care se desfac în tabel (bilanțul S1005) */
.sageataArbore { display: inline-block; width: 14px; color: var(--ink-faint); transition: transform .15s; }
tr[aria-expanded="true"] > td > .sageataArbore { transform: rotate(90deg); }
.tabel tbody tr[data-p] > td { background: var(--panel2); }
/* rândurile dintr-o formulă: adunate (verde), scăzute (roșu), totalul ales (contur) */
.tabel tbody tr.evPlus > td { background: var(--ok-soft); }
.tabel tbody tr.evPlus > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.tabel tbody tr.evMinus > td { background: var(--danger-soft); }
.tabel tbody tr.evMinus > td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tabel tbody tr.evSursa > td { background: var(--accent-soft); }
.tabel tbody tr.evSursa > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* situațiile financiare (F10, F20), declarațiile D300, D394 și închiderea lunii: o treaptă mai mare decât restul tabelelor */
#tSfBilant td, #tSfProfit td, #tSfInfo td, #tD300 td, #tD394 td, #tInchidere td, #tReevaluare td { font-size: 15px; }
tr.randInregistrari td td { font-size: 14px !important; }
#tSfBilant th, #tSfProfit th, #tSfInfo th, #tD300 th, #tD394 th, #tInchidere th, #tReevaluare th { font-size: 12px; }
.formulaRand { margin-left: 8px; font-style: italic; font-weight: 400; color: var(--accent); }
.tabel tbody tr.randInregistrari > td { padding-top: 6px; padding-bottom: 10px; }
.tabel tbody tr.randInregistrari .tabel { width: 100%; background: var(--panel); }
.camp input[readonly] { background: var(--panel2); color: var(--ink-dim); cursor: not-allowed; }
.tabel tfoot td { font-weight: 600; background: var(--panel2); border-top: 1px solid var(--border-strong); }
/* analiza pivot: coloana Total (valori agregate), în stilul rândului de totaluri de jos */
.tabel .totalPivot, .tabel tbody tr:hover td.totalPivot { font-weight: 600; background: var(--panel2); border-left: 1px solid var(--border-strong); }
.tabel.linii td { padding: 5px 6px; }
.tabel.linii input, .tabel.linii select { padding: 5px 8px; }
.tabel.linii tbody tr:hover td { background: transparent; }
.cutieTabel { border: 1px solid var(--border); border-radius: var(--r-mare); overflow: auto; background: var(--panel); box-shadow: var(--umbra); }
.cutieTabel .tabel tr:last-child td { border-bottom: 0; }
/* rândurile-link (tr[data-href], app.js): un link transparent peste fiecare celulă; ce e interactiv în celulă stă deasupra */
.tabel tr[data-href] > td { position: relative; }
.tabel a.linkRand { position: absolute; inset: 0; z-index: 1; }
.tabel a.linkRand:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.tabel tr[data-href] td :is(a:not(.linkRand), button, input, select, label) { position: relative; z-index: 2; }
/* „Afișate X din Y în total”, deasupra tabelelor cu filtre (numarRezultate, app.js); evidențiat când un filtru ascunde rânduri */
.numarRezultate { font-size: 12.5px; color: var(--ink-dim); margin: 0 2px 6px; text-align: right; }
.numarRezultate b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.numarRezultate.filtrat b:first-child { color: var(--accent); }
.card .cutieTabel { box-shadow: none; }
.gol { padding: 32px; text-align: center; color: var(--ink-dim); }

/* câmpul cu probleme la salvare (ex. oferta): chenar roșu; o celulă de tabel needitabilă, cu fundal roșu deschis */
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft); }
td.invalid { background: var(--danger-soft) !important; color: var(--danger); }
.eticheta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; line-height: 1.5; }
.e-ciorna { background: var(--warn-soft); color: var(--warn); }
.e-validat { background: var(--ok-soft); color: var(--ok); }
.e-stornat { background: var(--danger-soft); color: var(--danger); }
.e-neaprobat { background: var(--accent-soft); color: var(--accent); }
.e-comandat { background: var(--accent); color: var(--accent-ink); }
.e-storno { background: var(--danger-soft); color: var(--danger); }
tr.sub-minim td { background: var(--warn-soft); }
/* rândurile la care se referă alerta din panou (js/evidentiere.js): marcaj albastru, cu o pulsație la sosire */
.tabel tbody tr.evidentiat td, .tabel tbody tr.evidentiat:hover td { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.tabel tbody tr.evidentiat td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.tabel tbody tr.evidentiat { animation: pulsEvidentiat 1.4s ease-out 2; }
@keyframes pulsEvidentiat { 0% { outline: 2px solid var(--accent); outline-offset: -2px; } 100% { outline: 2px solid transparent; outline-offset: -2px; } }
.baraEvidentiere { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px;
  padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 13.5px; }
.negativ { color: var(--danger); }

/* taburile: pe ecranele înguste se derulează orizontal, fără bară de derulare vizibilă și fără derulare verticală;
   linia de jos e o umbră interioară, ca sublinierea tabului activ să stea peste ea fără să iasă din bandă */
.taburi { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.taburi::-webkit-scrollbar { display: none; }
.taburi a { padding: 9px 14px; color: var(--ink-dim); border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; flex: 0 0 auto;
  border-radius: 6px 6px 0 0; transition: color .12s, background .12s; }
.taburi a:hover { text-decoration: none; color: var(--ink); background: var(--panel2); }
.taburi a.activ { color: var(--accent); border-color: var(--accent); }

.carduri { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-mare); padding: 16px 18px; box-shadow: var(--umbra); }
.kpi .v { font: 600 21px var(--mono); margin-top: 6px; letter-spacing: -.02em; }
.kpi .t { font-size: 12px; color: var(--ink-dim); font-weight: 500; }
/* căsuță de total care deschide detaliul (ex. rezumatul SAF-T) */
button.kpiDetaliu { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; transition: border-color .12s, box-shadow .12s; }
button.kpiDetaliu:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
button.kpiDetaliu .delta { font-size: 12px; margin-top: 4px; color: var(--accent); }

.mesaj { padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; white-space: pre-line; font-size: 13.5px; border: 1px solid transparent; }
.mesaj.eroare { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.mesaj.info { background: var(--accent-soft); color: var(--ink); border-color: color-mix(in srgb, var(--accent) 18%, transparent); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--ink); color: var(--bg); padding: 11px 16px;
  border-radius: var(--r); font-size: 13.5px; box-shadow: var(--umbra-mare); max-width: 420px; white-space: pre-line; animation: apare .18s ease-out; }
.toast.eroare { background: var(--danger); color: #fff; }
@keyframes apare { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--panel); color: var(--ink);
  width: min(720px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(10, 20, 35, .28); }
dialog[open] { animation: apare .16s ease-out; }
dialog::backdrop { background: rgba(10, 20, 35, .42); backdrop-filter: blur(2px); }
dialog .cap { padding: 15px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
dialog .corp { padding: 20px; max-height: 70vh; overflow: auto; }
dialog .subsol { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--panel2);
  border-radius: 0 0 12px 12px; }

.totaluri { display: flex; justify-content: flex-end; gap: 28px; padding: 14px 6px 0; font-size: 13.5px; color: var(--ink-dim); }
.totaluri b { font-family: var(--mono); font-size: 15px; margin-left: 6px; color: var(--ink); }
.actiuni { display: flex; gap: 8px; flex-wrap: wrap; }

#print { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; width: 240px; left: -260px; transition: left .2s; }
  .side.deschis { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .bara .meniuBtn { display: inline-flex; }
  main { padding: 16px; }
  .bara { padding: 10px 16px; }
  .grila .lat { grid-column: auto; }
  /* meniul lateral: fundal întunecat dedesubt, se închide cu ✕, click în afară sau Escape */
  .fundalMeniu { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.45); }
  .userMeniu { display: flex; }
  .side .inchideMeniu { display: inline-flex; margin-left: auto; background: none; border: 0; color: var(--side-ink); font-size: 18px; cursor: pointer; padding: 2px 6px; }
}

/* telefon: titlul și butoanele pe primul rând, firma activă pe al doilea */
@media (max-width: 600px) {
  .bara { flex-wrap: wrap; gap: 8px; }
  .bara .titlu h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bara #firmaSel, .bara .firmaNume { order: 10; flex: 1 0 100%; max-width: none; }
  .bara .firmaNume { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
  .bara .user { display: none; }
  .local { padding: 8px 16px; font-size: 13.5px; }
}

/* ---------- tipărire ---------- */
@media print {
  /* marginea paginii 0: browserul nu mai are loc pentru antetul și subsolul lui (data, titlul, adresa, nr. paginii);
     marginea se face din #print, repetată pe fiecare pagină */
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; color: #000; font-size: 11px; }
  .app { display: none !important; }
  #print { display: block; padding: 12mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
}
#print h1 { text-align: center; font-size: 16px; margin: 10px 0 2px; }
#print .sub { text-align: center; margin-bottom: 12px; }
#print table { width: 100%; border-collapse: collapse; margin: 10px 0; }
#print th, #print td { border: 1px solid #000; padding: 3px 5px; }
#print th { background: #eee; font-size: 10px; }
/* tabelul S1005 tipărit cu rândurile desfăcute: rândurile adăugate pe gri, înregistrările ca tabel mic, culorile formulei */
#print .arboreTiparit tr[data-p] > td { background: #f4f4f4; }
#print .arboreTiparit table { margin: 2px 0; font-size: 9px; }
#print .arboreTiparit .formulaRand { font-style: italic; color: #333; margin-left: 6px; }
#print .arboreTiparit tr.evPlus > td { background: #e3f3e8; }
#print .arboreTiparit tr.evMinus > td { background: #f9e1df; }
#print .arboreTiparit tr.evSursa > td { background: #e6edfb; }
#print .arboreTiparit .cont-cod { font-weight: 600; }
#print .arboreTiparit, #print .arboreTiparit * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* documentele tipărite mai multe odată: fiecare de la pagină nouă */
#print .paginaNoua { break-before: page; height: 0; }
#print .cap2 { display: flex; justify-content: space-between; gap: 20px; }
#print .semn { display: flex; justify-content: space-around; margin-top: 30px; text-align: center; }
#print .semn div { min-width: 180px; }

/* ---------- ajutor ---------- */
dialog.ajutor { width: min(780px, calc(100vw - 32px)); }
dialog.ajutor .corp { line-height: 1.55; }
dialog.ajutor .corp > p:first-child { margin-top: 0; font-size: 14.5px; }
dialog.ajutor h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-dim); margin: 20px 0 8px; }
dialog.ajutor ol { margin: 0; padding-left: 20px; }
dialog.ajutor li { margin-bottom: 4px; }
dialog.ajutor .tabel td { padding: 5px 10px; }
dialog.ajutor .mono { font-family: var(--mono); font-size: 12.5px; }
dialog.ajutor dl { margin: 0; display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 6px 16px; }
dialog.ajutor dt { font-weight: 600; }
dialog.ajutor dd { margin: 0; color: var(--ink-dim); }
@media (max-width: 600px) { dialog.ajutor dl { grid-template-columns: 1fr; } dialog.ajutor dd { margin-bottom: 6px; } }
#ajutor { font-weight: 700; min-width: 30px; justify-content: center; }

/* butonul ✕ din antetul ferestrelor (adăugat de app.js) */
dialog .cap { display: flex; align-items: center; gap: 12px; }
dialog .cap .inchide { margin-left: auto; flex: 0 0 auto; border: 0; background: transparent; color: var(--ink-faint);
  font-size: 16px; line-height: 1; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
dialog .cap .inchide:hover { background: var(--panel2); color: var(--ink); }

/* rapoarte cu mai multe grupuri (ex. fișele de magazie ale tuturor articolelor) */
.tabel tr.grup td { background: var(--accent-soft); border-top: 2px solid var(--border-strong); padding-top: 9px; }
.tabel tr.subtotal td { font-weight: 600; background: var(--panel2); }
.tabel.fara-sortare > thead > tr > th[aria-sort] { cursor: default; }
.tabel.fara-sortare > thead > tr > th::after { content: none !important; }

/* fișele mai multor articole, ca arbore: rândul articolului se restrânge / extinde, rândurile lui sunt indentate */
.tabel tbody.nod tr.grup { cursor: pointer; }
.tabel tbody.nod tr.grup:hover td { filter: brightness(.97); }
.tabel tbody.nod tr:not(.grup) td:first-child { padding-left: 38px; position: relative; }
.tabel tbody.nod tr:not(.grup) td:first-child::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; border-left: 1px solid var(--border-strong); }
.tabel tbody.nod tr:last-child td:first-child::before { bottom: 50%; }
.tabel tbody.nod tr:not(.grup) td:first-child::after { content: ''; position: absolute; left: 20px; width: 10px; top: 50%; border-top: 1px solid var(--border-strong); }
.tabel tbody.nod.restrans tr:not(.grup) { display: none; }
.comuta { border: 0; background: transparent; color: var(--ink-dim); cursor: pointer; width: 22px; padding: 0; margin-right: 4px;
  font-size: 13px; transition: transform .15s; }
.comuta[aria-expanded="false"] { transform: rotate(-90deg); }

/* subsolul cu drepturile de autor (adăugat de app.js pe fiecare pagină) */
.continut { min-height: 100vh; }
.subsol-pagina { margin-top: auto; padding: 14px 24px; border-top: 1px solid var(--border); color: var(--ink-faint); font-size: 12px; text-align: center; }
@media print { .subsol-pagina { display: none; } }
/* tipărirea pornită dintr-o fereastră (ex. detaliile din Contabilitate): fereastra deschisă nu apare pe hârtie */
@media print { dialog { display: none !important; } }

/* la coloanele numerice (aliniate la dreapta) săgeata de sortare stă în fața titlului,
   ca titlul să se termine în aceeași linie cu valorile */
.tabel th.num[aria-sort]::after { content: none; }
.tabel th.num[aria-sort]::before { content: '↕'; margin-right: 5px; opacity: .3; font-size: 10px; }
.tabel th.num[aria-sort="ascending"]::before { content: '▲'; opacity: .8; color: var(--accent); }
.tabel th.num[aria-sort="descending"]::before { content: '▼'; opacity: .8; color: var(--accent); }
.tabel.fara-sortare > thead > tr > th::before { content: none !important; }
/* capul coloanelor numerice e aliniat la dreapta, ca valorile (regula .tabel th de mai sus îl punea la stânga) */
.tabel th.num { text-align: right; }

/* cursorul de text clipește doar în câmpurile în care se scrie; în rest (tabele, ferestre, text) e ascuns,
   chiar dacă în browser e pornită navigarea cu cursor (caret browsing, tasta F7) */
body { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }

/* atașamentele unui document */
.atasamente { border: 1px dashed transparent; border-radius: 8px; transition: border-color .15s, background .15s; }
.atas-peste .atasamente { border-color: var(--accent); background: var(--accent-soft); }
.atas { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.atas-icon { font: 600 10px var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 3px 5px; }
.atas-nume { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.atas-nume:hover { text-decoration: underline; }
.atas .btn.icon { margin-left: auto; }
.atas-zona { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; }

/* butoanele care depind de SPV (OAuth ANAF), cât timp SPV-ul nu e configurat / autorizat */
.btn.necesita-spv { border-style: dashed; color: var(--ink-dim); }
.alerta-spv { color: var(--warn); font-size: 13px; margin-right: 2px; }

/* roluri (RBA): pagina fără acces își ascunde conținutul; butoanele nepermise apar estompate */
main.fara-acces > *:not(#faraAcces) { display: none !important; }
[data-interzis] { opacity: .45; cursor: not-allowed !important; }
a.btn[aria-disabled="true"] { pointer-events: auto; }

/* istoricul unui articol (preț de vânzare, producător), în fereastra articolului */
.titluIstoric { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim); margin: 22px 0 8px; }
#istoric .schimbat { font-weight: 600; color: var(--accent); }

/* text doar pentru cititoarele de ecran (ex. gravitatea unei alerte, pe lângă icon și culoare) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bulina cu numărul de alerte de rezolvat, lângă utilizator (roșie când există alerte critice) */
.bulinaAlerte { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--warn); color: #fff; font: 600 12px/1 var(--font); text-decoration: none; box-shadow: 0 0 0 2px var(--panel); }
.bulinaAlerte.critic { background: var(--danger); }
.bulinaAlerte:hover { text-decoration: none; filter: brightness(1.08); }
:root[data-theme="dark"] .bulinaAlerte { color: #10161f; }
/* la salturile la o secțiune (ex. #cardAlerte), conținutul nu ajunge sub bara de sus, care rămâne fixă */
main [id] { scroll-margin-top: 96px; }

/* avertizarea dinaintea deconectării pentru inactivitate */
.avertizareInactiv { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 16px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 10px;
  box-shadow: var(--umbra-mare); padding: 12px 16px; width: min(520px, calc(100vw - 32px)); animation: apare .18s ease-out; }
.avertizareInactiv div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; flex: 1; }
.avertizareInactiv b { font-size: 14px; }

/* iconul de ștergere de pe fiecare rând al unui nomenclator */
.tabel td.coloanaSterge, .tabel th.coloanaSterge { width: 1%; text-align: right; padding-left: 4px; padding-right: 8px; }
.stergeRand { padding: 5px; border-radius: 6px; }

/* ---------- calendarul câmpurilor de dată (flatpickr, js/calendar.js), în culorile aplicației ---------- */
input.campData { font-family: var(--mono); font-variant-numeric: tabular-nums; padding-right: 32px; cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a96a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 10px center; }
input.campData:disabled { background-color: var(--panel2); cursor: default; }
.flatpickr-calendar { font-family: var(--font); background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--umbra-mare); width: 296px; padding: 6px; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-calendar.open { margin-top: 4px; }
.flatpickr-months { align-items: center; padding: 2px 0 6px; }
.flatpickr-months .flatpickr-month { color: var(--ink); fill: var(--ink); height: 36px; }
.flatpickr-current-month { font-size: 14px; font-weight: 600; padding-top: 8px; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; color: var(--ink); background: transparent; border: 0; border-radius: 6px; padding: 2px 4px; width: auto; }
.flatpickr-current-month .flatpickr-monthDropdown-months:hover, .flatpickr-current-month input.cur-year:hover { background: var(--accent-soft); }
.flatpickr-current-month .flatpickr-monthDropdown-months option { background: var(--panel); color: var(--ink); }
.flatpickr-current-month input.cur-year { font-weight: 600; color: var(--ink); font-family: var(--mono); border: 0; box-shadow: none; padding: 0 0 0 4px; }
.numInputWrapper span { border: 0; opacity: .6; }
.numInputWrapper span.arrowUp::after { border-bottom-color: var(--ink-dim); }
.numInputWrapper span.arrowDown::after { border-top-color: var(--ink-dim); }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { top: 8px; height: 32px; width: 32px; padding: 9px; border-radius: 8px;
  color: var(--ink-dim); fill: var(--ink-dim); margin: 0 4px; }
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { background: var(--accent-soft); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--accent); }
.flatpickr-weekdays { height: 30px; }
span.flatpickr-weekday { color: var(--ink-faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: transparent; }
.flatpickr-days, .dayContainer { width: 282px; min-width: 282px; max-width: 282px; }
.flatpickr-day { color: var(--ink); border: 0; border-radius: 8px; height: 36px; line-height: 36px; max-width: 40px; margin: 1px 0;
  font-variant-numeric: tabular-nums; transition: background .1s; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--accent-soft); color: var(--ink); border: 0; }
.flatpickr-day.today { border: 0; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 600; }
.flatpickr-day.today:hover { background: var(--accent-soft); color: var(--accent); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 600; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--ink-faint); opacity: .55; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: var(--ink-faint); opacity: .35; background: transparent; }

/* ---------- culorile categoriale ale graficelor (validate cu validate_palette.js: deschis pe #ffffff, închis pe #151d28) ---------- */
.serie-1 { --c: #2a78d6; } .serie-2 { --c: #eb6834; } .serie-3 { --c: #1baf7a; } .serie-4 { --c: #eda100; } .serie-5 { --c: #e87ba4; }
.serie-altii { --c: var(--ink-faint); }
:root[data-theme="dark"] .serie-1 { --c: #3987e5; } :root[data-theme="dark"] .serie-2 { --c: #d95926; }
:root[data-theme="dark"] .serie-3 { --c: #199e70; } :root[data-theme="dark"] .serie-4 { --c: #c98500; } :root[data-theme="dark"] .serie-5 { --c: #d55181; }

/* ---------- graficele analizei pivot (js/grafice.js): mărci subțiri, linie de bază la zero, grilă discretă ---------- */
.legendaGrafic { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 12px; }
.legendaGrafic span { display: inline-flex; align-items: center; gap: 6px; }
.legendaGrafic i, .tooltipGrafic i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.tooltipGrafic i { margin-right: 5px; vertical-align: -1px; }
.tooltipGrafic { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap; font-size: 12.5px; line-height: 1.5;
  background: var(--panel); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--umbra-mare); padding: 7px 10px; }
.tooltipGrafic b { font-family: var(--mono); font-weight: 600; }
/* bare orizontale */
.bareGrafic { position: relative; display: grid; gap: 10px; }
.bareGrafic .rb { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 12px; align-items: center; }
.bareGrafic .et { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bareGrafic .piste { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 10px; }
.bareGrafic .barH { position: relative; display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--c); min-width: 1px; transition: filter .12s; }
.bareGrafic .barH:hover { filter: brightness(1.12); }
.bareGrafic .gr, .bareGrafic .zero { position: absolute; top: -4px; bottom: -4px; border-left: 1px solid var(--border); }
.bareGrafic .zero { border-left-color: var(--border-strong); }
.bareGrafic .axa .piste { height: 14px; }
.bareGrafic .tick { position: absolute; transform: translateX(-50%); font: 11px var(--mono); color: var(--ink-faint); white-space: nowrap; }
/* coloane */
.coloaneGrafic { position: relative; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: 220px auto; gap: 6px 8px; }
.coloaneGrafic .axaYg { position: relative; }
.coloaneGrafic .axaYg span { position: absolute; right: 0; transform: translateY(50%); font: 11px var(--mono); color: var(--ink-faint); white-space: nowrap; }
.coloaneGrafic .zonaG { position: relative; }
.coloaneGrafic .gr, .coloaneGrafic .zero { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.coloaneGrafic .zero { border-top-color: var(--border-strong); }
.coloaneGrafic .grupuri { position: absolute; inset: 0; display: flex; }
.coloaneGrafic .grup { flex: 1; position: relative; }
/* coloanele unui grup, una lângă alta (poziția din js/grafice.js), cu 2px între ele */
.coloaneGrafic .col { position: absolute; width: var(--l, 14px); background: var(--c); border-radius: 4px 4px 0 0; }
.coloaneGrafic .col.neg { border-radius: 0 0 4px 4px; }
.coloaneGrafic .grup:hover .col { filter: brightness(1.12); }
.coloaneGrafic .axaXg { display: flex; }
.coloaneGrafic .axaXg span { flex: 1; text-align: center; font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; }
/* linie */
.linieGrafic { position: relative; }
.linieGrafic svg { width: 100%; height: auto; display: block; overflow: visible; }
.linieGrafic .gr { stroke: var(--border); stroke-width: 1; }
.linieGrafic .zero { stroke: var(--border-strong); stroke-width: 1; }
.linieGrafic .tick { font: 11px var(--mono); fill: var(--ink-faint); }
.linieGrafic polyline { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linieGrafic circle { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.linieGrafic .cruce { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.linieGrafic .tinta { fill: transparent; cursor: crosshair; }
/* cerc */
.cercGrafic { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 24px; align-items: center; }
@media (max-width: 640px) { .cercGrafic { grid-template-columns: 1fr; justify-items: center; } }
.cercGrafic .zonaC { position: relative; width: 100%; max-width: 220px; }
.cercGrafic svg { width: 100%; display: block; overflow: visible; }
.cercGrafic .felieG path, .cercGrafic .felieG circle { fill: var(--c); stroke: var(--panel); stroke-width: 2; stroke-linejoin: round; }
.cercGrafic .felieG:hover path { filter: brightness(1.1); }
.legendaCercG { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 7px 10px; align-items: center; font-size: 13px; }
.legendaCercG i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.legendaCercG b { font-family: var(--mono); font-weight: 500; text-align: right; }

/* „×” lângă câmpurile de articol (golire.js): apare doar când câmpul are text */
.campGolire { display: flex; align-items: center; gap: 4px; }
.campGolire > input { flex: 1; min-width: 0; }
.campGolire > .golesteArt { font-size: 17px; line-height: 1; color: var(--ink-dim); flex: 0 0 auto; }
.campGolire > input:placeholder-shown + .golesteArt { visibility: hidden; }
.campGolire > input:disabled + .golesteArt, .campGolire > input[readonly] + .golesteArt { display: none; }
/* filtrul de tip „search” are și „×”-ul lui, al browserului: rămâne unul singur */
.campGolire > input[type="search"]::-webkit-search-cancel-button { display: none; }

/* „i” cu explicație lângă titlul unui câmp: textul (data-info) apare la hover, la focus (tastatură) și la atingere (telefon).
   E un span, nu un buton: într-un <label>, un buton ar prelua clicul destinat câmpului. */
.infoTip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px;
  border-radius: 50%; border: 1px solid var(--ink-faint); color: var(--ink-dim); font-size: 10px; font-weight: 600; line-height: 1; font-style: normal;
  cursor: help; vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.infoTip:hover, .infoTip:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.infoTip::after { content: attr(data-info); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%);
  width: max-content; max-width: 240px; padding: 7px 10px; border-radius: 6px; background: var(--ink); color: var(--panel, #fff);
  font-size: 12px; font-weight: 400; line-height: 1.4; white-space: normal; text-align: left; box-shadow: 0 4px 14px rgb(0 0 0 / .18);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s; z-index: 30; }
.infoTip:hover::after, .infoTip:focus::after { opacity: 1; visibility: visible; }
.infoTip[hidden] { display: none; }
/* într-un tabel (.cutieTabel are overflow, care ar tăia textul ieșit în afară): textul se poziționează față de fereastră,
   deasupra iconiței sau, fără loc deasupra, dedesubt (coordonatele le pune app.js, la hover / focus) */
.infoTip.fix::after { position: fixed; left: var(--tip-x); top: var(--tip-y); bottom: auto; transform: translate(-50%, -100%); }
.infoTip.fix.jos::after { transform: translate(-50%, 0); }
/* în dialoguri, textul ascuns e tot fixat față de fereastră: altfel lățimea lui ar lărgi .corp (bară de derulare orizontală) */
dialog .corp .infoTip::after { position: fixed; left: var(--tip-x, 0); top: var(--tip-y, 0); bottom: auto; transform: translate(-50%, -100%); }
/* iconița fără text de tooltip (ex. un buton care desface o notă); nota desfăcută e text obișnuit, se poate selecta */
button.infoTip { background: none; padding: 0; font-family: inherit; }
.infoTip:not([data-info])::after { display: none; }
.infoTip[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.notaDetalii { margin-top: 8px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); white-space: normal; }
.notaDetalii ul { margin: 4px 0; padding-left: 20px; }

/* butoanele din antetul unei ferestre (ex. Export Excel, Tipărește): în dreapta, înaintea lui ✕ */
dialog .cap .capActiuni { margin-left: auto; display: flex; gap: 6px; font-weight: 400; }
dialog .cap .capActiuni ~ .inchide { margin-left: 0; }
/* pe telefon: titlul ia tot locul rămas lângă butoane (doar iconițe, vezi mai jos) și ✕ */
@media (max-width: 600px) {
  dialog .cap:has(.capActiuni) > :first-child { flex: 1 1 0; min-width: 0; }
}

/* „Export Excel” și „Tipărește” (iconite-butoane.ts): iconița doar pe telefon, unde textul rămâne doar pentru cititoarele
   de ecran și la apăsare lungă (title); pe calculator, doar textul, ca până acum. Telefonul întors (peisaj, ecran scund)
   e tot telefon, deși e mai lat de 600px */
.btn .iconitaBtn { display: none; flex: 0 0 auto; }
/* click-ul ajunge la buton, nu la iconiță / text: paginile citesc data-xls, data-print etc. direct din e.target */
.btn .iconitaBtn, .btn .etichetaBtn { pointer-events: none; }
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {
  .btn[data-iconita] { padding-left: 9px; padding-right: 9px; }
  .btn[data-iconita] .iconitaBtn { display: block; }
  .btn[data-iconita] .etichetaBtn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
