/* Cordia Electric – interfață v2
   Paleta vine din meserie: gri de tablou electric, albastru de nul, verde-galben de conductor PE
   (folosit doar ca bandă de identitate). Elementul distinctiv: scadențarul ca scală de aparat de măsură. */
:root {
  color-scheme: light;
  --bg: #e7eae8; --surface: #ffffff; --surface-2: #f3f5f4; --sunken: #dde2df;
  --ink: #17222c; --ink-2: #3a4752; --muted: #5a6772; --line: #cfd5d2; --line-2: #e3e7e5;
  --side: #17222c; --side-ink: #c7d1d8; --side-muted: #8797a3;
  --blue: #1d5aa6; --blue-soft: #e3ecf7; --blue-ink: #ffffff;
  --red-doc: #b4322a; --red-soft: #f9e4e2;
  --pe-green: #2f8a3b; --pe-yellow: #e5b80b;
  --ok: #1f6f37; --ok-bg: #e1f0e4; --warn: #8a5a00; --warn-bg: #fbeecb; --err: #a8231b; --err-bg: #fae1df;
  --r: 6px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pe-stripe: repeating-linear-gradient(-45deg, var(--pe-green) 0 10px, var(--pe-yellow) 10px 20px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #10161b; --surface: #182128; --surface-2: #1e2830; --sunken: #0c1115;
    --ink: #e3e9ed; --ink-2: #c3ccd3; --muted: #97a5b0; --line: #2e3b45; --line-2: #25313a;
    --side: #0b1014; --blue: #5b95db; --blue-soft: #1b2c40; --blue-ink: #0b1622; --red-doc: #f0857b; --red-soft: #3a1b19;
    --ok: #7fd295; --ok-bg: #163222; --warn: #f0c565; --warn-bg: #382c11; --err: #f29b93; --err-bg: #3c1917;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: 32px; font-weight: 750; font-stretch: 72%; letter-spacing: -.005em; }
h2 { font-size: 17px; font-weight: 700; font-stretch: 85%; }
h3 { font-size: 15px; font-weight: 700; font-stretch: 90%; margin-top: 1.2em; }
p { margin: 0 0 .75em; max-width: 75ch; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.d-block { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.txt-err { color: var(--err); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { top: 8px; }

/* ---------- Structură ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--side); color: var(--side-ink); padding: 20px 12px 16px;
  border-right: 6px solid transparent; border-image: var(--pe-stripe) 6; }
.brand { display: block; padding: 0 10px 18px; text-decoration: none; }
.brand-name { display: block; font-size: 20px; font-weight: 750; font-stretch: 72%; color: #fff; letter-spacing: .01em; line-height: 1.15; }
.brand-sub { font-size: 12.5px; color: var(--side-muted); }
.side ul { list-style: none; margin: 0; padding: 0; }
.nav-group + .nav-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .08); }
.nav-group h2 { font-size: 12px; font-weight: 600; font-stretch: 100%; color: var(--side-muted); padding: 0 10px 6px; margin: 0; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; color: var(--side-ink); text-decoration: none; font-weight: 500; }
.side nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.side nav a[aria-current="page"] { background: rgb(255 255 255 / .09); color: #fff; box-shadow: inset 3px 0 0 var(--pe-yellow); }
.count { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #a8231b; color: #fff; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; background: rgb(255 255 255 / .05); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.side-user div { line-height: 1.25; min-width: 0; }
.side-user b { display: block; color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user a { color: var(--side-muted); font-size: 12.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 36px); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-brand { display: none; font-weight: 750; font-stretch: 72%; font-size: 19px; color: var(--ink); text-decoration: none; }
.search { flex: 1; max-width: 540px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--muted); }
.search:focus-within { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: -1px; }
.search input[type="search"] { border: 0; background: none; outline: 0; flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; color: var(--ink); }
.search kbd { font: 600 11px var(--font); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--surface); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 26px clamp(16px, 3vw, 36px) 90px; max-width: 1280px; width: 100%; }
.content:focus { outline: none; }
.bottom-nav { display: none; }

@media (width < 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { flex-wrap: wrap; border-bottom: 0; background: var(--side); padding: 12px 14px; border-bottom: 5px solid transparent; border-image: var(--pe-stripe) 5; }
  .topbar-brand { display: block; color: #fff; }
  .topbar-actions { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); color: var(--side-muted); }
  .search input[type="search"] { color: #fff; }
  .search kbd { display: none; }
  .content { padding: 18px 14px 100px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav a { position: relative; display: grid; justify-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); text-decoration: none; font-weight: 600; }
  .bottom-nav a[aria-current="page"] { color: var(--blue); }
  .bottom-nav .dot { position: absolute; top: 0; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--err); }
  .fab { width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px -6px var(--blue); }
  .fab svg.i { width: 22px; height: 22px; }
  h1 { font-size: 27px; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
@media (width < 1000px) { .cols { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; }
.grid-2 > .panel, .stack > .panel, .cols > .panel, .cols > .stack > .panel { margin-bottom: 0; }
.panel.flush { padding: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel.flush > .panel-head { padding: 14px 20px; margin: 0; border-bottom: 1px solid var(--line-2); }
.panel.flush > .panel-body { padding: 16px 20px; }

/* ---------- Butoane ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--blue); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--err); border-color: currentColor; background: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 34px; min-height: 34px; padding: 0; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--err); }
.push-end { margin-left: auto; }
form.inline { display: inline; }

/* ---------- Mesaje ---------- */
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 14px; border-left: 4px solid var(--ok); background: var(--ok-bg); }
.flash-err { border-left-color: var(--err); background: var(--err-bg); }
.empty { padding: 32px 20px; text-align: center; background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.empty p { margin: 0 auto 12px; }
.note { background: var(--surface-2); padding: 10px 12px; border-radius: var(--r); margin: 12px 0 0; }

/* ---------- Chip-uri de stare (cu punct colorat) ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip-valabil, .chip-expira, .chip-expirat, .chip-st-activ, .chip-st-lead { padding-left: 8px; }
.chip-valabil::before, .chip-expira::before, .chip-expirat::before, .chip-st-activ::before, .chip-st-lead::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-valabil, .chip-st-activ { background: var(--ok-bg); color: var(--ok); }
.chip-expira, .chip-st-lead { background: var(--warn-bg); color: var(--warn); }
.chip-expirat { background: var(--err-bg); color: var(--err); }
.chip-act { background: var(--surface-2); color: var(--ink-2); }

/* ---------- Panou: bandă de cifre ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; overflow: hidden; }
.stat-strip a { padding: 16px 20px; text-decoration: none; color: inherit; border-left: 1px solid var(--line-2); display: grid; gap: 2px; }
.stat-strip a:first-child { border-left: 0; }
.stat-strip a:hover { background: var(--surface-2); }
.stat-strip strong { font-size: 34px; font-weight: 750; font-stretch: 65%; line-height: 1; }
.stat-strip span { font-size: 13.5px; color: var(--muted); }
.stat-strip .is-err strong { color: var(--err); }
.stat-strip .is-warn strong { color: var(--warn); }
@media (width < 700px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip a:nth-child(3) { border-left: 0; }
  .stat-strip a:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .stat-strip strong { font-size: 28px; }
}

/* ---------- Scadențarul ca scală gradată ---------- */
.scale-track { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; height: 150px; border-bottom: 2px solid var(--ink); margin-top: 26px; }
.scale-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-decoration: none; color: inherit; border-radius: 3px 3px 0 0; }
.scale-col:hover { background: var(--surface-2); }
.scale-col:hover .bar { background: var(--blue); }
.scale-col .n { font-weight: 700; font-size: 14px; margin-bottom: 4px; min-height: 1.3em; }
.scale-col .bar { width: 46%; height: var(--h); min-height: 3px; background: var(--ink-2); border-radius: 2px 2px 0 0; }
.scale-col.peak .bar { background: var(--warn); }
.ticks { display: grid; grid-template-columns: repeat(12, 1fr); height: 28px; }
.ticks span { position: relative; text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 9px; }
.ticks span::before { content: ""; position: absolute; left: 50%; top: 0; width: 1.5px; height: 7px; background: var(--ink); }
.ticks span::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 4px; background: var(--muted); }
.needle { position: absolute; top: -10px; bottom: -28px; width: 2px; background: var(--err); left: var(--azi); pointer-events: none; }
.needle b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--err); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .scale-col .bar { transform-origin: bottom; animation: rise .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 35ms); }
  @keyframes rise { from { transform: scaleY(0); } }
}
@media (width < 600px) { .scale-track { height: 110px; } .ticks span { font-size: 10.5px; } .scale-col .n { font-size: 12px; } }

/* ---------- Liste ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.list > li:first-child { border-top: 0; }
.panel.flush .list > li { padding: 12px 20px; }
.list > li > div:first-of-type { display: grid; min-width: 0; }
.list-end { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.list > li > div:first-of-type > a { color: var(--ink); text-decoration: none; }
.list > li > div:first-of-type > a:hover { color: var(--blue); text-decoration: underline; }
.tasks > li { justify-content: flex-start; flex-wrap: nowrap; }
.tasks > li .list-end { margin-left: auto; }
.tasks .done strong { text-decoration: line-through; color: var(--muted); }
.tick { width: 22px; height: 22px; flex: none; border: 2px solid var(--muted); border-radius: 4px; background: var(--surface); cursor: pointer; padding: 0; }
.tick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.timeline li { padding: 10px 0 10px 14px; border-left: 2px solid var(--line); }
.timeline li p { margin: 4px 0; }
.tl-meta { font-size: 13px; color: var(--muted); }
.dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ---------- File (tabs) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a, .tabs button { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs a[aria-current="page"], .tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); }
.tabs .n { margin-left: 5px; font-weight: 700; color: var(--muted); }

/* ---------- Formulare ---------- */
.form label, .filters label { display: grid; gap: 5px; align-content: start; font-size: 13.5px; font-weight: 600; color: var(--ink); }
input, select, textarea { font: 400 15px/1.4 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; min-height: 40px; width: 100%; }
textarea { resize: vertical; }
/* aceeași înălțime pentru toate câmpurile pe un rând (datele calendaristice ies altfel mai înalte în unele browsere) */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 42px; }
input[type="date"] { padding-block: 0; }
.tbl-mas input, .tbl-mas select { height: 36px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--err); background: var(--err-bg); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--blue); }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; align-items: start; }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
@media (width < 720px) { .fields, .fields-3, .fields-4 { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; } }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: 6px; }
fieldset.row { display: flex; flex-wrap: wrap; gap: 16px; }
.check { display: flex !important; flex-direction: row; align-items: center; gap: 8px; font-weight: 500 !important; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 3; }
@media (width < 900px) { .sticky-actions { bottom: 64px; } }
.form.compact .fields { margin-bottom: 10px; }
.row-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.tip-box { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 2px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 16px; }
.filters .grow { flex: 1 1 260px; }
.filters select { min-width: 180px; }
.code { background: var(--surface-2); padding: 10px 12px; border-radius: var(--r); overflow-x: auto; font-size: 13.5px; }
details summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; }
.input-btn { display: flex; gap: 8px; }
.input-btn input { flex: 1; min-width: 0; }
.anaf-row { display: grid; gap: 4px; }
.anaf-row .hint { margin: 0; max-width: none; }
.step { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--surface); display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 700; font-stretch: 100%; flex: none; }
.step-head { display: flex; align-items: center; gap: 10px; }

/* ---------- Tabele (antet fix, mod card pe ecrane înguste) ---------- */
.table-wrap { overflow: auto; max-inline-size: 100%; container-type: inline-size; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel .table-wrap { border-radius: 4px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl thead { position: sticky; inset-block-start: 0; z-index: 1; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl thead th { background: var(--surface-2); font-size: 12.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.tbl tbody th { font-weight: 600; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody tr:hover > * { background: var(--surface-2); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.is-old > * { color: var(--muted); }
.cell-actions { text-align: right; white-space: nowrap; }
@container (width < 640px) {
  .tbl, .tbl thead, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl th, .tbl td { border: 0; padding: 4px 14px; }
  .tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .tbl .num, .cell-actions { text-align: left; }
}
.tbl-mas td { padding: 6px; vertical-align: middle; }
.tbl-mas input, .tbl-mas select { min-height: 36px; padding: 6px 8px; }
.tbl-mas td:nth-child(1), .tbl-mas td:nth-child(2) { min-width: 190px; }
.tbl-mas td:nth-child(3) { min-width: 150px; }
.tbl-mas .num { width: 90px; text-align: right; }
.tbl-mas .m-um { width: 56px; }
.tbl-mas .m-k { width: 60px; }
.tbl-mas .m-k:disabled { background: var(--surface-2); border-color: transparent; }
.lim { display: flex; gap: 4px; }
.lim select { width: 52px; padding: 6px 4px; }
.m-rez { min-width: 82px; }
/* Pe lățimi medii (ex. lângă rezumatul din dreapta), fiecare măsurătoare devine un rând dublu cu etichete mici */
@container (640px <= width < 1040px) {
  .tbl-mas, .tbl-mas tbody { display: block; }
  .tbl-mas thead { display: none; }
  .tbl-mas tr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 8px; padding: 12px 12px 14px; border-bottom: 1px solid var(--line-2); }
  .tbl-mas tbody tr:last-child { border-bottom: 0; }
  .tbl-mas td { display: grid; gap: 3px; padding: 0; border: 0; min-width: 0 !important; align-content: start; }
  .tbl-mas td[data-label]::before { content: attr(data-label); font-size: 11.5px; font-weight: 600; color: var(--muted); }
  .tbl-mas td:nth-child(1) { grid-column: span 5; }
  .tbl-mas td:nth-child(2) { grid-column: span 4; }
  .tbl-mas td:nth-child(3) { grid-column: span 3; }
  .tbl-mas td:nth-child(4) { grid-column: span 3; }
  .tbl-mas td:nth-child(5) { grid-column: span 2; }
  .tbl-mas td:nth-child(6) { grid-column: span 3; }
  .tbl-mas td:nth-child(7) { grid-column: span 1; }
  .tbl-mas td:nth-child(8) { grid-column: span 2; align-self: end; padding-bottom: 6px; }
  .tbl-mas td:nth-child(9) { grid-column: span 1; align-self: end; justify-items: end; }
  .tbl-mas .num, .tbl-mas .m-um, .tbl-mas .m-k { width: 100%; }
  .tbl-mas tbody tr:hover > * { background: none; }
}
@container (width < 640px) {
  .tbl-mas td { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; }
  .tbl-mas .num { width: 100%; font-size: 18px; font-weight: 700; min-height: 46px; }
}
.mas-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------- Formularul de buletin: rezumat fix ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.form-grid > div > .panel:last-child { margin-bottom: 0; }
.summary { position: sticky; top: 84px; padding: 0; overflow: hidden; }
.summary .verdict { padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.summary .verdict b { display: block; font-size: 26px; font-weight: 750; font-stretch: 72%; line-height: 1.1; margin: 2px 0 4px; }
.summary .verdict.ok b { color: var(--ok); }
.summary .verdict.err b { color: var(--err); }
.summary .verdict small { color: var(--muted); font-size: 13px; display: block; }
.meter { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 10px; background: var(--sunken); }
.meter i { display: block; transition: width .3s; }
.summary dl { margin: 0; padding: 12px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.summary .acts { display: grid; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line-2); }
.summary .check { align-items: flex-start; font-size: 13.5px; }
@media (width < 1050px) {
  .form-grid { grid-template-columns: 1fr; }
  .summary { position: sticky; top: auto; bottom: 64px; z-index: 5; display: grid; grid-template-columns: 1fr auto; }
  .summary dl, .summary .check { display: none !important; }
  .summary .verdict { border: 0; padding: 10px 14px; }
  .summary .verdict b { font-size: 20px; }
  .summary .meter, .summary .verdict small:last-of-type { display: none; }
  .summary .acts { border: 0; padding: 10px 14px; grid-auto-flow: column; }
}
@media (width >= 900px) and (width < 1050px) { .summary { bottom: 0; } }
.d-ingust { display: none; }
@media (width < 600px) {
  .d-lat { display: none; } .d-ingust { display: inline; }
  .summary .verdict { padding: 8px 12px; } .summary .verdict b { font-size: 18px; }
  .summary .acts { padding: 8px 10px; gap: 6px; } .summary .acts .btn { padding: 0 12px; }
  .ticks span { font-size: 10px; }
}

/* ---------- Fișa clientului ---------- */
.client-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (width < 1000px) { .client-grid { grid-template-columns: 1fr; } }
.facts dl { margin: 0; }
.facts dt { font-size: 13px; color: var(--muted); margin-top: 12px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.client-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 14px; }
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.site { margin: 0; display: grid; gap: 8px; align-content: start; border-left: 4px solid var(--line); }
.site.st-valabil { border-left-color: var(--ok); }
.site.st-expira { border-left-color: var(--pe-yellow); }
.site.st-expirat { border-left-color: var(--err); }
.site h3 { margin: 0; font-size: 17px; font-stretch: 85%; }
.site address { font-style: normal; color: var(--muted); font-size: 13.5px; }
.site .line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 8px; font-size: 13.5px; align-items: center; }
.site .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.site-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; border: 1.5px dashed var(--line); border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 600; }
.site-add:hover { border-color: var(--blue); color: var(--blue); }
.tab-panel + .tab-panel { margin-top: 0; }

/* ---------- Căutare globală ---------- */
.result-group h2 { font-size: 15px; color: var(--muted); font-stretch: 100%; margin: 0 0 8px; }

/* ---------- Autentificare ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth > div { width: min(400px, 100%); }
.auth-card { position: relative; overflow: hidden; display: grid; gap: 14px; background: var(--surface); padding: 34px 28px 28px; border-radius: var(--r); border: 1px solid var(--line); }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--pe-stripe); }
.auth-card label { display: grid; gap: 5px; font-weight: 600; font-size: 13.5px; }
.auth-card h1 { margin: 0; font-size: 28px; }
.auth-card p { margin: 0; }

/* ---------- Setări: imagini, semnătură ---------- */
.imagini-firma { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 12px 0 16px; }
.imagine-box { display: grid; gap: 8px; align-content: start; }
.imagine-box h3 { margin: 0; }
.imagine-preview { display: grid; place-items: center; min-height: 120px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r);
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.imagine-preview img { max-width: 100%; max-height: 140px; object-fit: contain; }
.semnatura-pad { display: grid; gap: 8px; margin-top: 8px; }
.semnatura-pad canvas { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; background: #fff; border: 1px dashed var(--line); border-radius: var(--r); touch-action: none; cursor: crosshair; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print {
  .side, .topbar, .bottom-nav, .actions, .form-actions, .filters, .tabs { display: none !important; }
  .shell { display: block; } body { background: #fff; }
}

/* ---------- Rapoarte: alegerea sistemului, lista de verificări, componente ---------- */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.form .seg label { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.seg input { grid-row: span 2; margin-top: 3px; accent-color: var(--red-doc); }
.seg label:has(input:checked) { border-color: var(--red-doc); background: var(--red-soft); }
.seg b { font-weight: 650; } .seg small { color: var(--muted); font-size: 13px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-2); }
.checklist li:first-child { border-top: 0; }
.checklist .t b { font-weight: 600; } .checklist .t small { display: block; color: var(--muted); font-size: 13px; }
.tri { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.form .tri label { display: block; padding: 6px 11px; font-size: 13px; font-weight: 650; cursor: pointer; color: var(--muted); border-left: 1px solid var(--line); }
.form .tri label:first-child { border-left: 0; }
.tri input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tri label:has(input:checked).conform { background: var(--ok-bg); color: var(--ok); }
.tri label:has(input:checked).neconform { background: var(--err-bg); color: var(--err); }
.tri label:has(input:checked).na { background: var(--surface-2); color: var(--ink); }
.tri label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: -3px; }
.checklist .obs { grid-column: 1 / -1; }
.checklist .obs input { height: 38px; }
.checklist li:has(input[value="neconform"]:checked) .obs input { border-color: var(--err); background: var(--err-bg); }
.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.count-box { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: grid; gap: 4px; }
.count-box .count-nume { border: 0; padding: 0; height: auto; min-height: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; background: none; }
.count-box .count-nume.static { display: block; }
.count-vals { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.count-vals input { height: 36px !important; width: 64px; text-align: right; font-size: 17px; font-weight: 700; padding: 0 8px; }
.tbl-raport td { padding: 6px; vertical-align: middle; }
.tbl-raport input, .tbl-raport select { height: 36px !important; }
.tbl-raport td:first-child { min-width: 220px; }
.tbl-raport .num { width: 90px; text-align: right; }
.tbl-raport .m-um { width: 56px; }
@media (width < 600px) { .checklist li { grid-template-columns: 1fr; } }
.serie { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px; font-size: 12px; font-weight: 800; margin-right: 6px; vertical-align: 1px; }
.serie-B { background: var(--blue-soft); color: var(--blue); }
.serie-R { background: var(--red-soft); color: var(--red-doc); }
/* meniul „Document nou” */
.nou { position: relative; }
.nou > summary { list-style: none; }
.nou > summary::-webkit-details-marker { display: none; }
.nou-meniu { position: absolute; right: 0; top: calc(100% + 8px); width: 350px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 40px -18px rgb(0 0 0 / .35); padding: 6px; z-index: 40; }
.nou-meniu a { display: grid; grid-template-columns: auto 1fr; gap: 1px 12px; padding: 11px 12px; border-radius: 6px; text-decoration: none; color: inherit; }
.nou-meniu a:hover, .nou-meniu a:focus-visible { background: var(--surface-2); }
.nou-meniu .serie { grid-row: span 2; width: 42px; height: 36px; font-size: 13px; margin: 0; border-radius: 8px; }
.nou-meniu b { font-weight: 650; } .nou-meniu small { color: var(--muted); font-size: 13px; }
.nou-meniu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 6px; }
.alege-doc { display: grid; gap: 12px; max-width: 560px; }
.alege-doc a { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; }
.alege-doc .serie { grid-row: span 2; width: 48px; height: 42px; font-size: 15px; margin: 0; border-radius: 8px; }
.alege-doc small { color: var(--muted); }
.rol { display: inline-flex; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.rol-buletin { background: var(--blue-soft); color: var(--blue); }
.rol-raport { background: var(--red-soft); color: var(--red-doc); }
.select-pers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.select-pers .lbl { grid-column: 1 / -1; font-size: 13.5px; font-weight: 600; }
.select-pers .hint { grid-column: 1 / -1; }
.form .select-pers .opt { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-content: start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.select-pers .opt input { grid-row: span 3; margin-top: 2px; }
.select-pers .opt .rol { justify-self: start; }
.select-pers .opt small { color: var(--muted); font-size: 12.5px; }
.select-pers .opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.select-pers .opt.exp small { color: var(--err); }
.subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.form .subs label { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.subs input { grid-row: span 2; margin-top: 3px; accent-color: var(--red-doc); }
.subs label:has(input:checked) { border-color: var(--red-doc); background: var(--red-soft); }
.subs b { font-weight: 650; } .subs small { color: var(--muted); font-size: 13px; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sub-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.sub-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--red-soft); color: var(--red-doc); }
.sub-panel .checklist { margin-top: 6px; }
.sum-subs { list-style: none; margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--line-2); display: grid; gap: 6px; font-size: 14px; }
.sum-subs:empty { display: none; }
.sum-subs li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.note-warn { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 8px 12px; font-size: 13.5px; }
.jurnal-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; margin: 0; }
.jurnal-box legend { font-weight: 650; font-size: 14px; padding: 0 6px; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks legend { font-size: 13.5px; font-weight: 600; padding: 0; margin-bottom: 6px; width: 100%; }
.nou-meniu a.sub-item { padding-top: 0; margin-top: -8px; }
.nou-meniu a.sub-item small { text-decoration: underline; text-underline-offset: 2px; }
.nou-meniu a.sub-item > span:first-child { width: 42px; }

/* ---------- Devize ---------- */
.serie-D { background: #e6f2e8; color: #1f6f37; }
@media (prefers-color-scheme: dark) { .serie-D { background: #163222; color: #7fd295; } }
.cap-head { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 4px; }
.cap-head:first-of-type { margin-top: 0; }
.cap-head h3 { font-size: 14.5px; margin: 0; }
.cap-head span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.tbl-dev { width: 100%; border-collapse: collapse; }
.tbl-dev th { font-size: 12.5px; color: var(--muted); font-weight: 650; text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
.tbl-dev th.r { text-align: right; }
.tbl-dev td { padding: 5px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl-dev input { height: 36px !important; }
.tbl-dev .num { text-align: right; }
.tbl-dev td.val { text-align: right; font-weight: 650; white-space: nowrap; min-width: 90px; }
.tbl-dev .w-um { width: 72px; } .tbl-dev .w-n { width: 92px; } .tbl-dev .w-p { width: 112px; }
.tbl-dev tbody:empty::after { content: "–"; color: var(--muted); display: block; padding: 6px; }
.mic-check { font-size: 12px !important; font-weight: 400 !important; color: var(--muted); margin-top: 3px; display: flex !important; gap: 5px; align-items: center; }
.tot-dev { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; font-size: 14px; }
.tot-dev dt { color: var(--muted); } .tot-dev dd { margin: 0; text-align: right; font-weight: 650; }
.tot-dev .mare { font-size: 19px; font-weight: 800; color: var(--ink); margin-top: 6px; }
.flux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.form .flux label { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.flux label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.flux input { grid-row: span 2; margin-top: 3px; } .flux small { color: var(--muted); font-size: 12.5px; }
.pasi { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pasi > li { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.pasi > li.gata { border-color: var(--ok); background: var(--ok-bg); }
.pasi > li h3 { margin: 0 0 6px; font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.copy-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; overflow-x: auto; font-size: 13px; }
.copy-box table { width: 100%; border-collapse: collapse; } .copy-box td, .copy-box th { padding: 3px 8px; text-align: left; white-space: nowrap; }
.copy-box td.r, .copy-box th.r { text-align: right; }
@media (width < 700px) { .flux { grid-template-columns: 1fr; } }
.mic-check[hidden] { display: none !important; }
.tot-dev dd { white-space: nowrap; }
.tot-dev .mare { font-size: 17px; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; font-size: 12.5px; }
.side .link-btn { color: var(--side-muted); }

/* ---------- Telefon: navigare și formulare ---------- */
.doc-switch { display: none; }
@media (width < 900px) {
  /* comutator Buletine / Rapoarte / Devize */
  .doc-switch { display: flex; gap: 4px; padding: 4px; margin: -4px 0 16px; background: var(--sunken); border-radius: 10px; }
  .doc-switch a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 7px; font-weight: 650; font-size: 14px; color: var(--muted); text-decoration: none; }
  .doc-switch a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
  /* filele se derulează orizontal, pe un singur rând */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; }
  .client-grid > *, .form-grid > *, .grid-2 > * { min-width: 0; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { flex: none; white-space: nowrap; padding: 10px 11px; }
  /* butoanele din antet: mai compacte, pe toată lățimea */
  .page-head { margin-bottom: 16px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .page-head .actions details.nou { flex: 1 1 auto; } .page-head .actions details.nou > summary { width: 100%; }
  .page-head .actions .nou-meniu { left: 0 !important; right: auto !important; width: min(380px, calc(100vw - 28px)) !important; }
  .filters { gap: 8px; }
  /* loc pentru bara de rezumat și meniul de jos, ca să nu acopere ultimele câmpuri */
  .form-grid { padding-bottom: 76px; }
  .content:has(.form-grid) { padding-bottom: 170px; }
}
@media (width < 1050px) {
  /* bara de rezumat de jos: doar ce încape */
  .summary .sum-subs, .summary .acts .hint, .summary .status { display: none !important; }
  .summary .tot-dev { grid-template-columns: auto auto; }
  .summary .tot-dev dt:not(.mare), .summary .tot-dev dd:not(.mare) { display: none; }
  .summary .tot-dev .mare { margin: 0; font-size: 18px; }
  .summary > div:first-child:has(.tot-dev) { padding: 10px 14px !important; align-self: center; }
}
@media (width < 420px) {
  .content { padding-inline: 12px; }
  h1 { font-size: 25px; }
  .summary .acts .btn { font-size: 13.5px; }
}
.pasi { grid-template-columns: minmax(0, 1fr); } .pasi > li { min-width: 0; } .copy-box { max-width: 100%; }
@media (width < 1050px) { .summary dl.tot-dev { display: grid !important; padding: 0; gap: 0 10px; } }
/* ---------- Buletin fotovoltaic: tabelul pe stringuri ---------- */
.pv-strings { width: 100%; border-collapse: collapse; font-size: 14px; }
.pv-strings th { font-size: 12px; color: var(--muted); font-weight: 650; text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.pv-strings th.pv-nr { color: var(--ink); font-size: 13.5px; white-space: nowrap; vertical-align: middle; }
.pv-strings td { padding: 5px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.pv-strings input, .pv-strings select { height: 36px !important; min-width: 70px; }
.pv-strings input { text-align: right; }
.pv-strings .calc { color: var(--muted); font-size: 13px; white-space: nowrap; text-align: right; }
.dev-ok { color: var(--ok); font-weight: 650; } .dev-err { color: var(--err); font-weight: 650; }
/* Buletin fotovoltaic: grupuri și tabel aliniat */
.pv-sub { font-size: 14.5px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
#pv-sectiune .step-head + .pv-sub { margin-top: 4px; padding-top: 0; border-top: 0; }
.pv-sub span { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 4px; }
.pv-strings { table-layout: fixed; }
.pv-strings th { white-space: nowrap; }
.pv-strings th.grp { text-align: center; border-bottom: 2px solid var(--line); }
.pv-strings thead tr:last-child th { text-align: center; }
.pv-strings input, .pv-strings select { width: 100%; min-width: 0; }
.pv-strings .calc { text-align: left; white-space: normal; line-height: 1.25; }
.pv-strings td.pv-rez { text-align: center; }
#pv-sectiune .hint { max-width: none; }

/* Secțiunea PV se adaptează la lățimea ei, nu a ecranului (formularul are și bara de rezumat alături) */
#pv-sectiune { container-type: inline-size; }
#pv-sectiune .fields { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
@container (width < 560px) { #pv-sectiune .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#pv-sectiune .fields .span-2 { grid-column: span 2; }
@container (width < 360px) { #pv-sectiune .fields { grid-template-columns: 1fr; } #pv-sectiune .fields .span-2 { grid-column: auto; } }
@container (width < 900px) {
  /* fiecare string devine o fișă cu câmpuri etichetate */
  .pv-strings { table-layout: auto; }
  .pv-strings colgroup, .pv-strings thead { display: none; }
  .pv-strings, .pv-strings tbody { display: block; }
  .pv-strings tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
  .pv-strings th.pv-nr { grid-column: 1 / -1; border: 0; padding: 0; font-size: 14.5px; }
  .pv-strings td { display: grid; gap: 3px; border: 0; padding: 0; align-content: start; }
  .pv-strings td::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; }
  .pv-strings td.pv-rez { text-align: left; }
}
@container (width < 520px) { .pv-strings tr { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (width < 900px) {
  /* ordinea în fișă: titlu + rezultat, apoi Voc/Isc cu valorile așteptate alături, apoi panouri, polaritate, izolație */
  .pv-strings th.pv-nr { grid-column: 1 / -2; order: 0; align-self: center; }
  .pv-strings td.pv-rez { order: 1; justify-self: end; align-self: center; }
  .pv-strings td.pv-rez::before { display: none; }
  .pv-strings td:has([data-n="voc"]) { order: 2; } .pv-strings td[data-c="voc"] { order: 3; align-self: center; }
  .pv-strings td:has([data-n="isc"]) { order: 4; } .pv-strings td[data-c="isc"] { order: 5; align-self: center; }
  .pv-strings td:has([data-n="panouri"]) { order: 6; } .pv-strings td:has([data-n="polaritate"]) { order: 7; }
  .pv-strings td:has([data-n="riso_plus"]) { order: 8; } .pv-strings td:has([data-n="riso_minus"]) { order: 9; }
}
@container (width < 900px) { #pv-sectiune .table-wrap { border: 0; overflow: visible; } }
.manual-alt { margin-top: 10px; } .manual-alt > summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.api-emite .check { margin: 6px 0; }
