:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c2330;
  --muted: #5f6b7a;
  --border: #dde1e7;
  --primary: #1f4e79;
  --primary-hover: #173c5e;
  --accent-bg: #eef4fa;
  --ok: #1d7a46;
  --ok-bg: #e7f5ec;
  --warn: #8a5a00;
  --warn-bg: #fff5dc;
  --err: #a12a2a;
  --err-bg: #fdecec;
  --found: #fff8d6;
  --radius: 8px;
  --meniu-lat: 258px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* antet */
.topbar { background: var(--primary); color: #fff; }
.topbar .inner { max-width: 1200px; margin: 0 auto; padding: .7rem 16px; display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; color: #fff; text-decoration: none; margin-right: auto; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: #dce8f4; text-decoration: none; }
.topbar nav a:hover, .topbar nav a.activ { color: #fff; text-decoration: underline; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--accent-bg); color: var(--primary); }
.topbar .badge { background: rgba(255,255,255,.18); color: #fff; }
.link-btn { background: none; border: 0; color: #dce8f4; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* ——— Meniul, ca bară pe stânga ecranului ——— */
body.cu-meniu { display: flex; align-items: stretch; min-height: 100vh; }
body.cu-meniu > main { flex: 1 1 auto; min-width: 0; padding-left: 24px; padding-right: 24px; }
body.cu-meniu .topbar { flex: 0 0 var(--meniu-lat); width: var(--meniu-lat); align-self: flex-start;
  position: sticky; top: 0; height: 100vh; }
body.cu-meniu .topbar .inner { flex-direction: column; align-items: stretch; flex-wrap: nowrap;
  max-width: none; margin: 0; padding: 1rem .75rem 1.1rem; gap: .25rem; height: 100%; }
/* lista de pagini se derulează singură dacă nu încape, ca panoul contului să nu fie tăiat */
body.cu-meniu .topbar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
body.cu-meniu .cap-meniu { margin-bottom: .6rem; padding: .1rem .3rem .1rem .25rem; }
body.cu-meniu .brand { padding: .25rem; font-size: 1.05rem; }
body.cu-meniu .topbar nav { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .35rem; }

/* meniul pe grupuri: titlul grupului se apasă și strânge paginile de sub el */
.grup-meniu { border: 1px solid rgba(255,255,255,.07); border-radius: 11px; background: rgba(255,255,255,.03); }
.grup-meniu[open] { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.grup-meniu > summary { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; cursor: pointer;
  color: #c6d3e9; font-size: .68rem; font-weight: 700; letter-spacing: .07em; list-style: none; border-radius: 9px; }
.grup-meniu > summary::-webkit-details-marker { display: none; }
.grup-meniu > summary::after { content: "›"; margin-left: auto; font-size: 1.1rem; line-height: 1; color: #9cafcf;
  transform: rotate(0deg); transition: transform .15s; }
.grup-meniu[open] > summary::after { transform: rotate(90deg); }
.grup-meniu > summary:hover { background: rgba(255,255,255,.08); color: #fff; }
.grup-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px;
  font-size: .8rem; background: color-mix(in srgb, var(--grup) 22%, transparent);
  box-shadow: inset 2px 0 var(--grup); }
.grup-pagini { display: flex; flex-direction: column; gap: .1rem; margin: .1rem 0 .35rem .55rem;
  padding-left: .5rem; border-left: 1px solid rgba(255,255,255,.12); }
body.cu-meniu .grup-pagini a, .pagina-viitoare { display: flex; align-items: center; gap: .5rem;
  padding: .42rem .5rem; border-radius: 8px; font-size: .88rem; line-height: 1.25; }
body.cu-meniu .grup-pagini a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
body.cu-meniu .grup-pagini a.activ { background: color-mix(in srgb, var(--grup) 26%, transparent); color: #fff;
  text-decoration: none; box-shadow: inset 3px 0 var(--grup); }
.pagina-icon { width: 1.15rem; flex: none; text-align: center; }
.pagina-viitoare { color: rgba(220,232,244,.45); cursor: default; }
.pagina-viitoare em { margin-left: auto; font-size: .62rem; font-style: normal; letter-spacing: .04em;
  color: rgba(220,232,244,.4); }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* acțiuni scrise doar cu iconița, fără chenar (lista de tipizate) */
.ico-actiune { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  color: var(--muted); border-radius: var(--radius); text-decoration: none; vertical-align: middle; }
.ico-actiune:hover { color: var(--primary); background: var(--accent-bg); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* butoane */
.btn { display: inline-block; padding: .5rem .95rem; border-radius: 6px; border: 1px solid var(--primary); background: var(--primary); color: #fff; text-decoration: none; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { background: var(--primary-hover); }
.btn.secundar { background: #fff; color: var(--primary); }
.btn.secundar:hover { background: var(--accent-bg); }
.btn.pericol { background: #fff; color: var(--err); border-color: var(--err); }
.btn.mic { padding: .25rem .6rem; font-size: .85rem; }

/* tabele */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; }
.gol { text-align: center; color: var(--muted); padding: 2rem; }

/* formulare */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0e4; border-color: var(--primary); }
.campuri { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem 1rem; }
.camp.lat { grid-column: 1 / -1; }
.camp.gasit input, .camp.gasit textarea { background: var(--found); }
.camp .help { font-size: .8rem; color: var(--muted); }
.errorlist { color: var(--err); margin: .2rem 0 0; padding: 0; list-style: none; font-size: .85rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 700; font-size: 1rem; margin-bottom: .6rem; color: var(--primary); }
.checkbox-list { list-style: none; padding: 0; margin: 0; }
.checkbox-list li { padding: .25rem 0; }
.checkbox-list label, label.inline { display: inline; font-weight: normal; font-size: inherit; }

/* mesaje */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem .9rem; border-radius: 6px; margin-bottom: .5rem; background: var(--accent-bg); }
.messages .success { background: var(--ok-bg); color: var(--ok); }
.messages .warning { background: var(--warn-bg); color: var(--warn); }
.messages .error { background: var(--err-bg); color: var(--err); }

/* text OCR */
.ocr-text { white-space: pre-wrap; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; padding: .8rem; max-height: 70vh; overflow: auto; }
.legenda { display: inline-block; width: .9rem; height: .9rem; background: var(--found); border: 1px solid #e6d98a; vertical-align: middle; border-radius: 3px; }

/* date dosar */
dl.date { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.date dt { color: var(--muted); font-size: .88rem; }
dl.date dd { margin: 0; }

/* mapare tipizat */
.mapare td.context { font-size: .88rem; }
.mapare .ph { background: var(--found); padding: 0 .2rem; border-radius: 3px; font-weight: 700; }
.mapare select { min-width: 220px; }
.mapare tr.nemapat td { background: #fcfcfd; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { color: var(--primary); }
.roluri { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
.stack > * + * { margin-top: .9rem; }

.tipizate-list label { font-weight: normal; font-size: inherit; display: flex; gap: .5rem; align-items: flex-start; padding: .35rem 0; border-bottom: 1px solid var(--border); }
/* lista se derulează: caseta „Generează documente” rămâne scundă, ca să încapă și restul dosarului */
.tipizate-list { max-height: 138px; overflow: auto; margin-bottom: 1rem; }
code { background: var(--accent-bg); padding: .05rem .3rem; border-radius: 4px; font-size: .88em; }

/* etape dosar */
.stare { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #eef1f4; color: #3d4a57; }
.stare-nou { background: #fff1d6; color: #7a4d00; }
.stare-inregistrat { background: var(--accent-bg); color: var(--primary); }
.stare-incuviintare, .stare-incuviintat { background: #ece8fb; color: #4b3a99; }
.stare-executare { background: var(--ok-bg); color: var(--ok); }
.stare-suspendat { background: var(--err-bg); color: var(--err); }
.stare-incetat { background: #eceff1; color: #5f6b7a; }
.filtre { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filtru { text-decoration: none; color: var(--text); border: 1px solid var(--border); background: #fff; padding: .3rem .7rem; border-radius: 999px; font-size: .88rem; }
.filtru span { color: var(--muted); margin-left: .2rem; }
.filtru.activ { background: var(--primary); border-color: var(--primary); color: #fff; }
.filtru.activ span { color: #dce8f4; }

/* jurnal */
.jurnal { list-style: none; padding: 0; margin: 0; }
.jurnal li { padding: .5rem 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; }
.jurnal li:last-child { border-bottom: 0; }
.jurnal .cand { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.jurnal .cine { color: var(--muted); font-size: .82rem; }
.tip-stare { font-weight: 600; }

/* import */
.rand-eroare td { background: var(--err-bg); }
.rand-avert td { background: var(--warn-bg); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form > div { flex: 1 1 180px; }

/* selecție și generare în masă */
.bara-selectie { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem .75rem; margin-bottom: .75rem; background: var(--accent-bg); border-radius: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.optiuni { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem 1rem; }
.optiuni label { font-weight: normal; font-size: inherit; display: flex; gap: .45rem; align-items: baseline; }
.optiuni .muted { font-size: .82rem; }
.pas { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: .35rem; }
.rezumat-masa { font-size: 1.05rem; padding: .75rem 1rem; background: var(--ok-bg); border-radius: 6px; }
.stare-de_trimis { background: #fff1d6; color: #7a4d00; }
.stare-trimis { background: var(--accent-bg); color: var(--primary); }
.stare-comunicat { background: var(--ok-bg); color: var(--ok); }
.stare-returnat { background: var(--err-bg); color: var(--err); }
details.actualizare summary { cursor: pointer; color: var(--primary); font-size: .88rem; }
details.actualizare form { margin-top: .5rem; display: grid; gap: .4rem; min-width: 220px; }
input[type=file] { font-size: .85rem; max-width: 100%; }

/* termene */
.alerta-termene { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; text-decoration: none; color: var(--text); background: #fff; border: 1px solid #f0c9c9; border-left: 4px solid var(--err); border-radius: 6px; padding: .6rem .9rem; margin-bottom: 1rem; }
.alerta-termene.liniste { border-color: var(--border); border-left-color: var(--primary); }
.grup-depasit { border-left: 4px solid var(--err); }
.grup-azi { border-left: 4px solid #d99a00; }
tr.termen-depasit td:first-child strong { color: var(--err); }
tr.termen-rezolvat td { color: var(--muted); text-decoration: line-through; }
tr.termen-rezolvat td:last-child { text-decoration: none; }
table.calendar { table-layout: fixed; min-width: 760px; }
table.calendar td { height: 6.5rem; vertical-align: top; padding: .3rem; border: 1px solid var(--border); }
table.calendar td.alta-luna { background: #fafbfc; color: #b0b8c1; }
table.calendar td.nelucratoare { background-image: repeating-linear-gradient(135deg, transparent 0 6px, #f1f3f5 6px 8px); }
table.calendar td.azi { outline: 2px solid var(--primary); outline-offset: -2px; }
.nr-zi { font-weight: 700; font-size: .85rem; margin-bottom: .2rem; }
.ev { display: block; font-size: .72rem; line-height: 1.25; padding: .12rem .3rem; margin-bottom: .15rem; border-radius: 3px; background: var(--accent-bg); color: var(--primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.depasit { background: var(--err-bg); color: var(--err); }
.ev.rezolvat { background: #eef0f2; color: var(--muted); text-decoration: line-through; }

.carduri-import { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card-link { text-decoration: none; color: var(--text); display: block; transition: border-color .15s; }
.card-link:hover { border-color: var(--primary); }
.card-link h2 { color: var(--primary); }

/* financiar */
.cifre { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.cifre > div { display: flex; flex-direction: column; min-width: 7rem; }
.cifre span { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cifre strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.cifre .accent strong { color: var(--primary); }
.subtitlu { font-size: .95rem; margin: 1rem 0 .4rem; }
.imobil { border-top: 1px solid var(--border); padding: .6rem 0; }
.imobil:first-of-type { border-top: 0; }
.text-avert { color: var(--warn); font-weight: 600; }
.banner-cod { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; background: #fff1d6; border: 1px solid #f0d9a0; border-left: 4px solid #d99a00; border-radius: 6px; padding: .6rem .9rem; margin-bottom: 1rem; }
.qr { background: #fff; display: inline-block; padding: .5rem; border: 1px solid var(--border); border-radius: 6px; }
.qr svg { display: block; width: 220px; height: 220px; }
.cheie { word-break: break-all; letter-spacing: .05em; }
.coduri-rezerva { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; }
.coduri-rezerva code { font-size: 1.05rem; padding: .4rem .6rem; text-align: center; }
@media print { .topbar, .actions { display: none; } }
.linii-factura td { padding: .3rem; }
.linii-factura input { padding: .35rem .45rem; }

/* Ajutor */
.ajutor-text h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; color: var(--primary); }
.ajutor-text h2:first-child { margin-top: 0; }
.ajutor-text p, .ajutor-text li { line-height: 1.6; }
.ajutor-text ul, .ajutor-text ol { padding-left: 1.2rem; }
.ajutor-text li { margin: .25rem 0; }
.ajutor-text table { margin: .6rem 0 1rem; }
.ajutor-text code { background: var(--accent-bg); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
.ajutor-text .messages { margin: 1rem 0 0; }

/* Editarea notelor din jurnal */
.editare-nota { margin-top: .25rem; }
.editare-nota summary { cursor: pointer; font-size: .8rem; color: var(--primary); width: max-content; }
.editare-nota textarea { width: 100%; margin: .35rem 0; font: inherit; padding: .4rem .5rem;
  border: 1px solid var(--border); border-radius: 6px; }
.btn.sterge { background: var(--err-bg); color: var(--err); border-color: transparent; }
.btn.sterge:hover { background: var(--err); color: #fff; }

/* Sigla biroului */
.sigla-previzualizare { display: flex; justify-content: center; padding: .8rem; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: .6rem; }
.sigla-previzualizare img { max-height: 110px; max-width: 100%; }

/* antetul unui card: titlu în stânga, butoane în dreapta (se rupe pe rânduri când nu încap) */
.cap-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ——— Numele biroului și rolul, deasupra titlului din bara de meniu ——— */
.cont-antet { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem;
  padding: 0 .25rem; margin-bottom: .15rem; }
.cont-nume { font-weight: 600; font-size: .9rem; line-height: 1.3; }

/* ——— Butonul cu trei liniuțe, lângă titlu: contul, colegii, parola, ieșirea ——— */
.cap-meniu { display: flex; align-items: center; gap: .5rem; }
.cap-meniu .brand { margin-right: auto; }
.cont-meniu { position: relative; }
.cont-buton { display: inline-flex; align-items: center; justify-content: center; padding: .4rem .5rem;
  border: 0; border-radius: 6px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.cont-buton:hover, .cont-meniu.deschis .cont-buton { background: rgba(255,255,255,.3); }
.cont-buton svg { display: block; fill: currentColor; }
.user-box { display: none; position: absolute; top: calc(100% + .4rem); left: 0; z-index: 60;
  min-width: 200px; flex-direction: column; align-items: stretch; gap: .1rem; padding: .45rem;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16,32,52,.25); font-size: .92rem; }
.cont-meniu.deschis .user-box { display: flex; }
.user-box a, .user-box .link-btn { padding: .45rem .5rem; border-radius: 6px; color: var(--primary);
  text-decoration: none; font: inherit; text-align: left; width: 100%; }
.user-box a:hover, .user-box .link-btn:hover { background: var(--accent-bg); }
.user-box form { margin: 0; }
.user-box .link-btn { border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-top: .15rem;
  padding-top: .5rem; }

/* ——— Butonul de meniu: ascuns pe desktop, apare doar pe telefon ——— */
.meniu-buton { display: none; }

/* ——— Telefon (sub 768px). Desktopul rămâne neschimbat: totul e doar aici. ——— */
@media (max-width: 768px) {
  /* antet: bara laterală redevine bara de sus, cu meniul strâns sub buton */
  body.cu-meniu { display: block; }
  body.cu-meniu > main { padding-left: 14px; padding-right: 14px; }
  body.cu-meniu .topbar { flex: none; width: auto; height: auto; position: static; }
  body.cu-meniu .topbar .inner { height: auto; }
  body.cu-meniu .topbar nav { overflow: visible; }
  body.cu-meniu .topbar .inner { flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 0; }
  body.cu-meniu .cap-meniu { margin-bottom: 0; padding: 0; }
  body.cu-meniu .brand { padding: 0; }
  .topbar .inner { padding: .55rem 14px; gap: .5rem; }
  .brand { font-size: 1rem; }
  .are-js .meniu-buton { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.14);
    border: 0; border-radius: 6px; color: #fff; font: inherit; font-weight: 600; padding: .45rem .8rem; cursor: pointer; }
  .are-js .topbar nav { display: none; }
  .are-js .topbar.deschis nav { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: .3rem; }
  .topbar.deschis .grup-pagini a, .topbar.deschis .pagina-viitoare { padding: .6rem .5rem; text-align: left; }
  .grup-meniu > summary { padding: .55rem .5rem; }
  .cap-meniu { width: 100%; }
  .cont-antet { width: 100%; flex-direction: row; align-items: center; gap: .4rem; flex-wrap: wrap;
    padding: 0; margin-bottom: 0; }
  .cont-nume { font-size: .85rem; }
  .user-box { right: 0; left: auto; }

  /* conținut */
  main { padding: 1rem 14px 2.5rem; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.02rem; }
  .page-head { margin-bottom: .9rem; gap: .6rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; text-align: center; }
  .card { padding: .9rem; margin-bottom: .9rem; }

  /* ținte de atins cu degetul */
  .btn { padding: .6rem 1rem; }
  .btn.mic { padding: .45rem .75rem; font-size: .88rem; }
  .filtru { padding: .4rem .8rem; }
  /* 16px la câmpuri: altfel iPhone-ul mărește pagina la fiecare atingere */
  input[type=text], input[type=password], input[type=date], input[type=number], input[type=search],
  input[type=email], select, textarea { font-size: 16px; padding: .55rem .6rem; }

  /* nimic nu împinge pagina lateral: elementele din grile se pot strânge */
  .grid-2 > *, .campuri > *, .optiuni > *, .carduri-import > *, .cifre > * { min-width: 0; }
  .cap-card { align-items: flex-start; gap: .5rem; }
  .cap-card .actions { width: auto; }

  /* formulare pe o coloană */
  .campuri { grid-template-columns: 1fr; gap: .8rem; }
  .inline-form { flex-direction: column; align-items: stretch; }
  /* pe desktop „flex: 0 0 170px” e lățimea câmpului; pe o coloană ar deveni înălțime */
  .inline-form > * { flex: 0 0 auto !important; margin-left: 0 !important; }
  details.actualizare form { min-width: 0; }
  .mapare select { min-width: 0; }

  /* filtrele de etapă: o singură bandă, se trage lateral */
  .filtre { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; -webkit-overflow-scrolling: touch; }
  .filtru { white-space: nowrap; }

  /* tabelele lungi devin cartonașe, cu titlul coloanei lângă fiecare valoare */
  table.tabel-stivuit, table.tabel-stivuit tbody, table.tabel-stivuit tr, table.tabel-stivuit td { display: block; width: 100%; }
  table.tabel-stivuit thead { display: none; }
  table.tabel-stivuit tr { border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem;
    margin-bottom: .6rem; background: #fff; }
  table.tabel-stivuit tr:hover td { background: transparent; }
  table.tabel-stivuit td { border: 0; padding: .2rem 0; }
  table.tabel-stivuit td[data-eticheta] { display: grid; grid-template-columns: 7rem 1fr; gap: .7rem; align-items: start; }
  /* valoarea stă în coloana a doua, inclusiv rândurile ei suplimentare (CNP, referință…) */
  table.tabel-stivuit td[data-eticheta] > * { grid-column: 2; }
  table.tabel-stivuit td[data-eticheta]::before { content: attr(data-eticheta); color: var(--muted);
    font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; padding-top: .18rem; }
  table.tabel-stivuit td.fara-eticheta { padding: .3rem 0 0; }
  table.tabel-stivuit td[colspan] { padding: .3rem 0; }
  table.tabel-stivuit .gol { padding: 1.2rem; }
  /* tabele fără cap de tabel: rândurile se desfac, fără etichete de pus */
  table.tabel-simplu, table.tabel-simplu tbody, table.tabel-simplu tr, table.tabel-simplu td {
    display: block; width: 100%; }
  table.tabel-simplu tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  table.tabel-simplu tr:last-child { border-bottom: 0; }
  table.tabel-simplu tr:hover td { background: transparent; }
  table.tabel-simplu td { border: 0; padding: .12rem 0; text-align: left !important; white-space: normal !important; }
  table.tabel-simplu .gol { padding: 1rem 0; text-align: center !important; }

  /* tabelele rămase tabele se trag lateral */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table.calendar { min-width: 620px; }
  table.calendar td { height: 5rem; }

  /* liste de date */
  dl.date { grid-template-columns: 1fr; gap: .1rem; }
  dl.date dt { margin-top: .55rem; }
  .jurnal li { grid-template-columns: 1fr; gap: .15rem; }
  .cifre { gap: .7rem 1rem; }
  .cifre > div { min-width: 44%; }
  .bara-selectie { flex-direction: column; align-items: stretch; }
  .bara-selectie .btn { width: 100%; }

  /* diverse */
  .ocr-text { font-size: 12px; max-height: 50vh; }
  .qr svg { width: 180px; height: 180px; }
  .sigla-previzualizare img { max-height: 80px; }
  .tipizate-list { max-height: 150px; }
  .alerta-termene span[style] { margin-left: 0 !important; }
}
