/* style.css – Cash Flow ICC. Pornește din stilul aplicației de oferte (identic până la secțiunea CASH FLOW de la final). */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ================= TEMĂ LUMINOASĂ (Implicit) ================= */
  color-scheme: light;
  
  /* Brand */
  --navy: #1F3864;
  --navy-2: #2c4a80;
  --navy-hover: #172a4d;
  
  /* Fundaluri și Suprafețe */
  --bg: #f3f6f9;
  --card: #ffffff;
  --card-hover: #fcfdfd;
  --topbar-bg: var(--navy);
  
  /* Linii și Borduri */
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  
  /* Text */
  --text: #0f172a;
  --muted: #64748b;
  --placeholder: #94a3b8;
  
  /* Status - Text */
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
  --blue: #1d4ed8;
  --purple: #6d28d9;
  --teal: #0f766e;
  --gray: #475569;
  
  /* Status - Fundaluri Pastel */
  --green-bg: #dcfce7;
  --red-bg: #fee2e2;
  --amber-bg: #fef3c7;
  --blue-bg: #dbeafe;
  --purple-bg: #ede9fe;
  --teal-bg: #ccfbf1;
  --gray-bg: #f1f5f9;
  
  /* Forme și UI */
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-focus-ring: rgba(31, 56, 100, 0.15);
  
  /* Umbre */
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.06), 0 4px 8px rgba(15, 23, 42, 0.03);
  --shadow-modal: 0 24px 48px rgba(15, 23, 42, 0.1);
  
  /* Dimensiuni */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  
  --trans: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  /* ================= TEMĂ ÎNTUNECATĂ ================= */
  color-scheme: dark;
  
  /* Fundaluri și Suprafețe */
  --bg: #0b1120;
  --card: #151e32;
  --card-hover: #1a243b;
  --topbar-bg: #0b1120;
  
  /* Linii și Borduri */
  --line: #27354f;
  --line-light: #1c273d;
  
  /* Text */
  --text: #f8fafc;
  --muted: #94a3b8;
  --placeholder: #475569;
  
  /* Status - Text (mai luminoase pt contrast) */
  --green: #4ade80;
  --red: #f87171;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --teal: #2dd4bf;
  --gray: #94a3b8;
  
  /* Status - Fundaluri Pastel (translucide) */
  --green-bg: rgba(74, 222, 128, 0.15);
  --red-bg: rgba(248, 113, 113, 0.15);
  --amber-bg: rgba(251, 191, 36, 0.15);
  --blue-bg: rgba(96, 165, 250, 0.15);
  --purple-bg: rgba(167, 139, 250, 0.15);
  --teal-bg: rgba(45, 212, 191, 0.15);
  --gray-bg: rgba(148, 163, 184, 0.15);
  
  /* Forme și UI */
  --input-bg: #0f172a;
  --input-border: #334155;
  --input-focus-ring: rgba(96, 165, 250, 0.25);
  
  /* Umbre */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ================= BAZĂ ================= */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  transition: background-color var(--trans), color var(--trans);
}
body { overflow-x: clip; }
a { color: var(--blue); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--navy-2); }
.boot { padding: 40px; text-align: center; color: var(--muted); font-weight: 500; }

/* Accesibilitate */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; } /* handled below */

/* ================= LAYOUT ================= */
.topbar {
  background: var(--topbar-bg);
  color: #fff;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; position: sticky; top: 0; z-index: 10;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: #fff; letter-spacing: -0.02em; }
.topbar .brand img { height: 32px; background: #fff; border-radius: 8px; padding: 4px 8px; }
.topbar nav { display: flex; gap: 4px; margin-left: 20px; }
.topbar nav a { color: rgba(255,255,255,0.7); padding: 8px 14px; border-radius: var(--radius-pill); font-weight: 600; font-size: 14px; transition: all var(--trans); }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.topbar .user { margin-left: auto; font-size: 13px; color: rgba(255,255,255,0.8); display: flex; gap: 14px; align-items: center; font-weight: 500; }

/* Buton Toggla Temă */
.theme-toggle {
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans); font-size: 16px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }
.theme-ico { line-height: 1; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h1 { font-size: 24px; font-weight: 800; margin: 0 0 20px; color: var(--text); letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 16px; color: var(--text); }
h3.ch { margin: 0 0 12px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ================= CARDURI & DASHBOARD ================= */
.card, .stat, .help-sec, .maint-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--trans), border-color var(--trans);
}
.card { padding: 24px; }

/* Dashboard KPI Grid */
.stats, .dash-body, .ckps, .cgrid { display: grid; gap: 16px; margin-bottom: 24px; }
.stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stats.six { grid-template-columns: repeat(6, minmax(0,1fr)); margin-bottom: 0; }
.stat, .ckp, .cpn { padding: 20px; display: flex; flex-direction: column; justify-content: center; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
.stat .label, .ckp .l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat .value, .ckp .v { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.stat .sub, .ckp .s, .cpn .s { font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 500; }

/* Status KPI Colors */
.stat.ok .value, .ckp.ok .v { color: var(--green); }
.stat.bad .value, .ckp.bad .v { color: var(--red); }
.stat.wait .value, .ckp.wait .v { color: var(--amber); }
.ckp.mt .v { color: var(--teal); }
.ckp.dr .v { color: var(--gray); }

/* Modern Dashboard Header */
.dash { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-md); }
.dash-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line-light); }
.dash-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dash-range { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 4px; }
.dash-ctrl { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }

/* Segmente (Pill buttons) */
.seg { display: inline-flex; background: var(--line-light); border-radius: var(--radius-pill); padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; transition: all var(--trans); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card); color: var(--navy); box-shadow: var(--shadow-sm); }

/* Dashboard body (Sectiunea de jos din registru) */
.dash-body { grid-template-columns: 1.25fr 1fr 1fr; align-items: stretch; gap: 20px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); display: flex; flex-direction: column; justify-content: center; }
.kpi.acc { background: var(--green-bg); border-color: transparent; } .kpi.acc .k-val { color: var(--green); }
.kpi.ref { background: var(--red-bg); border-color: transparent; } .kpi.ref .k-val { color: var(--red); }
.kpi.pen { background: var(--blue-bg); border-color: transparent; } .kpi.pen .k-val { color: var(--blue); }
.k-label { font-size: 13px; color: var(--text); opacity: 0.8; font-weight: 700; margin-bottom: 8px; }
.k-val { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.k-sub { font-size: 12px; font-weight: 600; color: var(--text); opacity: 0.6; margin-top: 6px; }

/* Grafic */
.chart { display: flex; align-items: center; gap: 20px; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 16px; }
.donut { width: 140px; height: 140px; flex: none; }
.donut circle { transition: stroke-dasharray .6s ease; }
:root[data-theme="dark"] .donut circle:first-of-type { stroke: var(--line) !important; }
.donut-big { font-size: 28px; font-weight: 800; fill: var(--text); }
.donut-sub { font-size: 11px; font-weight: 600; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; font-weight: 500; min-width: 130px; }
.legend li { display: flex; align-items: center; gap: 10px; color: var(--text); }
.legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }

.money { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 20px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.m-val { font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.m-val.acc { color: var(--green); }
.m-val small { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.bar, .hb { height: 10px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.bar div, .hb div { height: 100%; border-radius: var(--radius-pill); transition: width .6s ease; }
.bar div { background: linear-gradient(90deg, var(--green), #34d399); }
.dash-empty { margin-top: 16px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 500; }

/* ================= FORMULARE & BUTOANE ================= */
input, select, textarea, button { font: inherit; }
input, select, textarea { 
  border: 1px solid var(--input-border); border-radius: var(--radius-sm); padding: 10px 14px; 
  background: var(--input-bg); color: var(--text); transition: all var(--trans);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--input-focus-ring); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; background: var(--line-light); cursor: not-allowed; }

.btn { 
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--input-border); background: var(--card); color: var(--text); 
  padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; 
  white-space: nowrap; box-shadow: var(--shadow-sm); transition: all var(--trans); 
}
.btn:hover:not(:disabled) { background: var(--line-light); border-color: var(--line); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 4px 10px rgba(31,56,100,0.2); }
.btn.primary:hover:not(:disabled) { background: var(--navy-hover); border-color: var(--navy-hover); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(31,56,100,0.25); }
:root[data-theme="dark"] .btn.primary { background: var(--blue); border-color: var(--blue); box-shadow: 0 4px 10px rgba(96,165,250,0.2); }
:root[data-theme="dark"] .btn.primary:hover:not(:disabled) { background: #3b82f6; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--red); border-color: var(--red-bg); background: var(--red-bg); box-shadow: none; }
.btn.danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.fld { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.fld .val { color: var(--text); padding-top: 8px; font-weight: 500; font-size: 14.5px; }
.fld .hint { font-size: 12px; font-weight: 500; color: var(--placeholder); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.dates { display: flex; gap: 12px; flex-wrap: wrap; }
.dates label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; margin: 4px 0; cursor: pointer; color: var(--text); }

/* ================= TABELE & GRID-URI ================= */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.table-wrap.flat { box-shadow: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line-light); vertical-align: middle; }
th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg); position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); }
tr.row { cursor: pointer; transition: background var(--trans); }
tr.row:hover td { background: var(--line-light); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
td.nr { font-weight: 700; white-space: nowrap; color: var(--text); }
.empty { padding: 40px; text-align: center; color: var(--muted); font-weight: 500; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.period-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 16px; }
.head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head h1 { margin: 0; }
.spacer { flex: 1; }

/* ================= BADGE-URI STATUS ================= */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1; border: 1px solid transparent; }
/* Oferte */
.st-ciorna { background: var(--gray-bg); color: var(--gray); }
.st-gata { background: var(--amber-bg); color: var(--amber); }
.st-trimisa { background: var(--blue-bg); color: var(--blue); }
.st-acceptata { background: var(--green-bg); color: var(--green); }
.st-contractata { background: var(--teal-bg); color: var(--teal); }
.st-executata { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.st-refuzata { background: var(--red-bg); color: var(--red); }
.st-revizuita { background: var(--purple-bg); color: var(--purple); }
.st-anulata { background: var(--gray-bg); color: var(--muted); text-decoration: line-through; opacity: 0.7; }
/* Contracte */
.cst-ciorna { background: var(--gray-bg); color: var(--gray); }
.cst-trimis { background: var(--blue-bg); color: var(--blue); }
.cst-semnat { background: var(--green-bg); color: var(--green); }
.cst-anulat { background: var(--red-bg); color: var(--red); }
.cst-finalizat { background: var(--purple-bg); color: var(--purple); }
/* Alte */
.tpl-badge { background: var(--amber-bg); color: var(--amber); }
.type-badge { background: var(--blue-bg); color: var(--blue); }
.chosen-badge { background: var(--green); color: #fff; }
.warn { display: inline-block; background: var(--amber-bg); color: var(--amber); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; margin-top: 4px; }
.pill { white-space: nowrap; font-size: 11px; font-weight: 700; border-radius: var(--radius-pill); padding: 3px 8px; background: var(--line-light); color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; background: var(--line-light); color: var(--text); border-radius: 6px; padding: 2px 8px; margin-left: 6px; }
.kind-PF { background: var(--gray-bg); color: var(--gray); }
.kind-PJ { background: var(--blue-bg); color: var(--blue); }
.kind-mt { background: var(--teal-bg); color: var(--teal); }

/* ================= MODALE, MENIURI & MESAJE ================= */
.modal-bg { position: fixed; inset: 0; background: rgba(11,17,32,0.6); backdrop-filter: blur(4px); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--card); border-radius: var(--radius-lg); width: 100%; max-width: 640px; padding: 24px; box-shadow: var(--shadow-modal); border: 1px solid var(--line); }
.ac-list, .ur-menu {
  position: absolute; z-index: 30; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); overflow-y: auto;
}
.ac-list { top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; }
.ac-item, .ur-item { padding: 10px 14px; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 500; transition: background var(--trans); }
.ac-item span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.ac-item:hover, .ac-item.on, .ur-item:hover, .ur-item.on { background: var(--line-light); }
.ur-item { display: flex !important; justify-content: space-between; gap: 12px; width: 100%; text-align: left; }
.ur-item small { color: var(--muted); white-space: nowrap; }

.msg, .toast { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.msg { margin-bottom: 16px; }
.msg.err { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.info { background: var(--blue-bg); color: var(--blue); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--text); color: var(--bg); max-width: 420px; box-shadow: var(--shadow-lg); z-index: 50; }
.toast.err { background: var(--red); color: #fff; }

.login { max-width: 400px; margin: 8vh auto; }
.login img { display: block; height: 80px; margin: 0 auto 24px; }
.login h1 { text-align: center; font-size: 20px; margin-bottom: 24px; }
.login form { display: grid; gap: 16px; }
.login .switch { text-align: center; margin-top: 16px; font-size: 14px; font-weight: 500; }

/* ================= EDITOR OFERTĂ & COMPONENTE ================= */
.chapter { margin-bottom: 24px; }
.ch-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ch-title { font-size: 18px; font-weight: 800; color: var(--text); flex: 1 1 260px; background: transparent; border: none; padding: 0; }
.ch-title:focus { outline: none; border-bottom: 2px solid var(--blue); border-radius: 0; box-shadow: none; }
table.items th, table.items td { padding: 10px 12px; }
table.items input, table.items select { padding: 8px 10px; font-size: 14px; }
table.items input.w100 { width: 100%; }
table.items th.r, table.items td.r, input.r { text-align: right; font-variant-numeric: tabular-nums; }
table.items tfoot td { background: var(--line-light); border-bottom: none; font-weight: 600; }
tr.disc td { background: var(--amber-bg); }
tr.disc td.num { color: var(--red); }
.disc-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.disc-edit input, .disc-edit select { width: auto; }
textarea.item-details { display: block; width: 100%; margin-top: 8px; padding: 8px 12px; font-size: 13.5px; color: var(--text); resize: vertical; min-height: 36px; background: var(--bg); }
.item-details-view { font-size: 13px; color: var(--muted); white-space: pre-line; margin-top: 4px; font-weight: 500; }
td.acts { white-space: nowrap; text-align: right; }

.icon { border: 1px solid var(--input-border); background: var(--card); border-radius: var(--radius-sm); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); transition: all var(--trans); }
.icon:hover:not(:disabled) { background: var(--line-light); color: var(--text); }
.icon.del:hover:not(:disabled) { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.icon:disabled { opacity: 0.4; cursor: not-allowed; }

.bottom { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; margin-top: 24px; }
.totals .tl { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-light); font-variant-numeric: tabular-nums; font-weight: 600; }
.totals .tl.sub { border-top: 1px dashed var(--line); padding-top: 10px; }
.totals .tl.grand { border-bottom: none; font-size: 20px; font-weight: 800; color: var(--text); padding-top: 16px; }
.totals .disc-row b { color: var(--red); }

/* VTabs (Variante Standard/Premium) */
.type-bar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; margin-bottom: 20px; padding: 20px; }
.type-bar select { min-width: 280px; }
.type-bar .type-info { flex: 1 1 100%; font-size: 13.5px; font-weight: 500; }
.vtabs { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.vtab { 
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; 
  border: 2px solid var(--line); background: var(--card); border-radius: var(--radius); 
  padding: 12px 20px; cursor: pointer; min-width: 180px; transition: all var(--trans);
}
.vtab b { font-size: 16px; font-weight: 800; color: var(--text); } 
.vtab span { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.vtab:hover { border-color: var(--placeholder); }
.vtab.on { border-color: var(--blue); box-shadow: 0 4px 12px var(--input-focus-ring); background: var(--blue-bg); }
.vtab.chosen b::after { content: ' ✔'; color: var(--green); }
.vcompare { margin-top: 16px; border-top: 1px solid var(--line-light); padding-top: 12px; }
.vcompare > div { display: flex; justify-content: space-between; font-size: 14.5px; font-weight: 600; padding: 4px 0; }
.vcompare > div.chosen { color: var(--green); font-weight: 800; }

.mult-edit { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); margin-left: 12px; }
.mult-edit input { padding: 6px 10px; width: 60px; text-align: center; }
.mult-view { font-size: 14.5px; font-weight: 700; }
.mult-row td { background: var(--blue-bg); }
.lump-row td { background: var(--amber-bg); }
input.lump { font-weight: 800; }
.luc-memo { font-size: 12px; font-weight: 500; margin-top: 4px; }
table.items.t-deviz input { padding-left: 6px; padding-right: 6px; }

/* ================= TRIMITERE & ISTORIC ================= */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; font-size: 14px; transition: all var(--trans); margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.send-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-light); flex-wrap: wrap; font-size: 14.5px; font-weight: 500; }
.send-row:last-child { border-bottom: 0; }

.ur-bar { display: inline-flex; gap: 8px; align-items: center; }
.ur { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow-sm); }
.ur button { border: 0; background: none; cursor: pointer; color: var(--text); font-weight: 700; transition: background var(--trans); }
.ur .ur-main { font-size: 18px; line-height: 1; padding: 6px 10px; }
.ur .ur-arrow { font-size: 12px; padding: 6px 8px; border-left: 1px solid var(--line); }
.ur button:hover:not(:disabled) { background: var(--line-light); }
.ur button:disabled { color: var(--placeholder); cursor: not-allowed; }
.ur-foot { border-top: 1px solid var(--line); padding: 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }

.hist { display: flex; flex-direction: column; margin-top: 12px; max-height: 480px; overflow-y: auto; }
.hist-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; padding: 10px 8px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.hist-ic { color: var(--blue); text-align: center; font-size: 16px; }
.hist-row.a-status .hist-ic, .hist-row.a-send .hist-ic { color: var(--green); }
.hist-row.a-undo .hist-ic, .hist-row.a-redo .hist-ic { color: var(--amber); }
.hist-body ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; font-weight: 500; }
.hist-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hist-meta b { color: var(--text); font-weight: 700; }

/* ================= SARCINI & NOTE ================= */
.tasks-card { margin-bottom: 20px; padding: 16px 24px; }
.task { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-light); transition: opacity var(--trans); }
.task:last-child { border-bottom: 0; }
[data-open] > .task:last-child { border-bottom: 1px solid var(--line-light); }
.task-chk { width: 20px; height: 20px; margin-top: 2px; cursor: pointer; flex: none; accent-color: var(--blue); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 15px; color: var(--text); }
.task-notes { font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: pre-wrap; margin-top: 4px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.task-acts { display: flex; gap: 6px; flex: none; }
.task.fresh { background: var(--red-bg); border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--red-bg); }
.task-newb { background: var(--red); color: #fff; margin-right: 8px; }
.task-auto { background: var(--blue-bg); color: var(--blue); margin-right: 8px; }
.task-of { background: var(--amber-bg); color: var(--amber); margin-right: 8px; }
.task-fact { background: var(--green-bg); color: var(--green); margin-right: 8px; }
.task-tt { margin-left: 8px; font-size: 11px; font-weight: 800; color: var(--blue); white-space: nowrap; }
.task-tabs button { display: inline-flex; align-items: center; gap: 8px; }
.task-cnt { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--line); color: var(--text); font-size: 11px; font-weight: 800; text-align: center; }
.task-tabs button.on .task-cnt { background: var(--blue); color: #fff; }
.task-cnt.new, .task-tabs button.on .task-cnt.new { background: var(--red); color: #fff; }
.task-link { display: inline-flex !important; align-items: center; gap: 8px; }
.task-w { display: inline-block; min-width: 22px; text-align: center; border-radius: var(--radius-pill); padding: 0 8px; font-size: 12px; font-weight: 800; background: rgba(255,255,255,0.2); color: #fff; }
.task-w.has { background: var(--blue-bg); color: var(--blue); }
.task-w.new { background: var(--red); color: #fff; animation: taskpulse 2s infinite; }
@keyframes taskpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }

.drag-h { cursor: grab; touch-action: none; user-select: none; color: var(--placeholder); font-size: 20px; padding: 0 4px; }
.drag-h:hover { color: var(--text); }
.dragging-list, .dragging-list * { cursor: grabbing !important; user-select: none; }
.task.dragging { opacity: 0.4; }
.task.drop-above { box-shadow: inset 0 3px 0 var(--blue); }
.task.drop-below { box-shadow: inset 0 -3px 0 var(--blue); }
.due.overdue { color: var(--red); font-weight: 800; } .due.today { color: var(--amber); font-weight: 800; } .due.soon { color: var(--amber); }
.task.done { opacity: 0.5; } .task.done .task-title, .task.done .task-notes { text-decoration: line-through; }
.done-sec h2 { margin-bottom: 8px; }
.clickable { cursor: pointer; user-select: none; transition: color var(--trans); }
.clickable:hover { color: var(--blue); }
.task-new { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.task-new.compact { margin-bottom: 16px; }

.notes-list { display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; margin-bottom: 16px; padding-right: 6px; }
.note { background: var(--line-light); border-radius: var(--radius); padding: 12px 16px; max-width: 85%; font-weight: 500; }
.note.me { background: var(--blue-bg); align-self: flex-end; }
.note .meta { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.note .meta b { color: var(--text); font-weight: 700; }
.note .body { white-space: pre-wrap; font-size: 14px; }
.note .body b.mention { color: var(--blue); background: var(--card); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.note .del { border: 0; background: none; color: var(--placeholder); cursor: pointer; font-size: 12px; padding: 0; margin-left: auto; transition: color var(--trans); }
.note .del:hover { color: var(--red); }
.note-form { display: flex; gap: 10px; align-items: flex-end; }
.note-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.mention-list { top: auto; bottom: 100%; margin-bottom: 8px; }

/* ================= CONTRACTE ================= */
.c-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 24px; align-items: start; }
.c-form { display: flex; flex-direction: column; gap: 16px; }
.c-form .card { padding: 20px; }
.c-preview { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* DOAR Foaia de contract RĂMÂNE ALBĂ și pe Dark Mode */
.c-paper { 
  background: #ffffff !important; border: none; 
  padding: 40px; color: #0f172a !important; 
  font-family: 'Times New Roman', Times, serif; /* Aspect de document tipărit */
  line-height: 1.4;
}
:root[data-theme="dark"] .c-paper { color-scheme: light; }
:root[data-theme="dark"] .c-paper * { color: #0f172a !important; border-color: #cbd5e1 !important; }
:root[data-theme="dark"] .c-paper .warn { background: #fef3c7 !important; color: #b45309 !important; }
.cdoc { font-size: 15px; }

.ctype-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ctype { text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; color: var(--text); font-weight: 600; transition: all var(--trans); }
.ctype span { font-size: 12.5px; font-weight: 500; color: var(--muted); } 
.ctype em { font-size: 11px; color: var(--purple); font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.ctype:hover { border-color: var(--placeholder); }
.ctype.on { border-color: var(--blue); background: var(--blue-bg); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.offer-pick { max-height: 260px; overflow-y: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.offer-pick label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14.5px; font-weight: 500; transition: background var(--trans); }
.offer-pick label.on, .offer-pick label:hover { background: var(--line-light); }

.money-sum { margin-top: 12px; padding: 12px 16px; background: var(--line-light); border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 600; }
.pay-sum { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; font-weight: 500; }
.pay-sum div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.pay-sum div.neg b { color: var(--red); }
.tr-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
table.mini th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 6px; border-bottom: 1px solid var(--line); }
table.mini td { padding: 6px; border-bottom: 1px solid var(--line-light); }
table.mini td input { width: 100%; padding: 6px 10px; font-size: 13.5px; } table.mini .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.mini tr.late td { background: var(--amber-bg); }
.opt-sub { margin: 8px 0 12px 28px; }
.gz-row { margin-bottom: 4px; }
.tpl-art { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 12px 0; background: var(--card); }
.tpl-art-h { display: flex; gap: 10px; align-items: center; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.tpl-art-h input { flex: 1; font-weight: 800; font-size: 15px; }
.tpl-cl { margin: 8px 0; } .tpl-cl textarea { width: 100%; font-size: 14px; min-height: 44px; } .tpl-cl textarea.sub { background: var(--bg); margin-top: 6px; border-color: transparent; }
.dept-pick button { padding: 6px 12px; font-size: 12.5px; }
.lib-cat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px; background: var(--card); }
.lib-cat-h { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-weight: 700; color: var(--text); }
table.tbl-plain { width: 100%; border-collapse: collapse; background: none; }
table.tbl-plain td { border-bottom: 1px solid var(--line-light); padding: 10px 8px; font-size: 14px; font-weight: 500; background: none; }
table.tbl-plain td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl-plain tr.click { cursor: pointer; transition: background var(--trans); } 
table.tbl-plain tr.click:hover td { background: var(--line-light); }
i.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }

/* ================= INFORMAȚII INTERNE / CATALOG ================= */
.sup-badge { border: 1px dashed var(--placeholder); background: var(--bg); color: var(--muted); border-radius: var(--radius-pill); padding: 2px 10px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--trans); }
.sup-badge:hover, .sup-badge.open { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); border-style: solid; }
.sup-badge.stoc { border-style: solid; background: var(--green-bg); color: var(--green); border-color: transparent; }
.sup-badge.comanda { border-style: solid; background: var(--amber-bg); color: var(--amber); border-color: transparent; }
tr.int-row td { background: var(--card); border-top: 0; padding-top: 0; }
.internal { border-left: 4px solid var(--amber); padding: 12px 16px; background: var(--amber-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.internal-h { font-weight: 800; color: var(--amber); margin-bottom: 10px; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.internal .link-view { font-size: 13.5px; font-weight: 600; margin: -4px 0 10px; }
.files { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.files .file { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 8px 4px 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }
.ol-group { margin-top: 16px; }
.ol-h { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
table.ol tr.done td { color: var(--placeholder); text-decoration: line-through; }
table.ol tr.done td:first-child { text-decoration: none; }
.file-link { font-size: 12.5px; font-weight: 600; margin-right: 8px; white-space: nowrap; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill); padding: 8px 16px; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer; transition: all var(--trans); box-shadow: var(--shadow-sm); }
.chip span { display: inline-block; margin-left: 6px; background: var(--line-light); color: var(--muted); border-radius: var(--radius-pill); padding: 2px 8px; font-size: 12px; font-weight: 800; }
.chip:hover { border-color: var(--placeholder); transform: translateY(-1px); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip.on { background: var(--blue); border-color: var(--blue); }
.chip.on span { background: rgba(255,255,255,0.2); color: #fff; }
table.catalog td { font-size: 14.5px; font-weight: 500; }
.c-name { font-weight: 700; font-size: 15px; color: var(--text); }
.c-code { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; display: inline-block; }
.c-det { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-line; }
.cat-tag { display: inline-block; background: var(--line-light); color: var(--text); border-radius: 6px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.up { color: var(--red); font-size: 12.5px; font-weight: 700; } .down { color: var(--green); font-size: 12.5px; font-weight: 700; }

/* ================= CLIENȚI ================= */
.chead { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.cav { width: 64px; height: 64px; border-radius: var(--radius); background: var(--navy); color: #fff; font-weight: 800; font-size: 24px; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .cav { background: var(--blue); }
.cinfo { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 24px; font-size: 14px; font-weight: 500; margin-top: 12px; } 
.cinfo b { color: var(--muted); font-weight: 700; margin-right: 6px; }
.cl-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }

/* ================= ȘABLOANE & AJUTOR ================= */
.tpl-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.folders { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 80px; box-shadow: var(--shadow-sm); }
.folders button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--text); transition: all var(--trans); }
.folders button span { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--line-light); border-radius: var(--radius-pill); padding: 2px 8px; }
.folders button:hover { background: var(--line-light); }
.folders button.on { background: var(--blue-bg); color: var(--blue); }
.folders button.on span { background: rgba(29,78,216,0.15); color: var(--blue); }
:root[data-theme="dark"] .folders button.on span { background: rgba(96,165,250,0.2); color: var(--blue); }
.tpl-group { margin-bottom: 24px; }
.tpl-h { font-size: 16px; font-weight: 800; margin: 8px 0 12px; display: flex; gap: 10px; align-items: center; color: var(--text); }
select.move { padding: 6px 10px; font-size: 13px; font-weight: 600; max-width: 160px; }

.help { display: grid; gap: 12px; }
.help-h { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; background: none; padding: 16px 20px; font: inherit; font-size: 16px; font-weight: 800; color: var(--text); cursor: pointer; text-align: left; transition: background var(--trans); }
.help-h:hover { background: var(--line-light); }
.help-sec.on .help-h { border-bottom: 1px solid var(--line-light); }
.chev { font-size: 20px; color: var(--placeholder); font-weight: 400; transition: transform var(--trans); }
.help-sec.on .chev { transform: rotate(180deg); }
.help-b { padding: 8px 20px 20px; line-height: 1.6; font-weight: 500; }
.help-b h4 { margin: 16px 0 8px; color: var(--text); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.help-b li { margin: 6px 0; }
.help-b .tip { background: var(--amber-bg); border-left: 4px solid var(--amber); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 16px 0 8px; font-size: 14.5px; color: var(--text); }
.help-t { border-collapse: collapse; margin: 10px 0; font-size: 14.5px; }
.help-t td { padding: 6px 12px 6px 0; vertical-align: top; }

/* ================= ALTELE ================= */
.dl, .edit, .pbar, .tpl-main { /* Păstrate pt JS, necesită un minim vizual dacă se cere */ }
.guest-clock { font-size: 12px; font-weight: 700; background: var(--amber-bg); color: var(--amber); border-radius: var(--radius-sm); padding: 4px 10px; white-space: nowrap; }
.guest-cred code { font-size: 18px; font-weight: 800; letter-spacing: 0.05em; background: var(--card); padding: 4px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--placeholder); user-select: all; color: var(--text); display: inline-block; }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Rol Vizitator */
html.ro button:not([data-ro], [data-ro] button), html.ro label.btn:not([data-ro]),
html.ro .drag-h, html.ro .ur-bar, html.ro .note-form, html.ro .task-new { display: none !important; }
html.ro :is(input, select, textarea):not([data-ro], [data-ro] *) { pointer-events: none; background: var(--line-light); border-color: transparent; }

/* ================= RESPONSIVE ================= */
.menu-btn { display: none; }

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-sm); background: rgba(255,255,255,0.1); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0; transition: all var(--trans); }
  .menu-btn:hover { background: rgba(255,255,255,0.2); }
  .topbar nav, .topbar .user { display: none; }
  .topbar.open nav { display: flex; flex-direction: column; width: 100%; margin: 8px 0 0; gap: 4px; max-height: calc(100vh - 140px); overflow-y: auto; }
  .topbar.open nav a { padding: 12px 16px; font-size: 16px; }
  .topbar.open .user { display: flex; width: 100%; margin: 0; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 4px 8px; font-size: 14.5px; }
  .stats.six { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .ckps { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .c-layout { grid-template-columns: 1fr; } 
  .c-preview { position: static; max-height: none; } 
  .ctype-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) { 
  .cl-grid { grid-template-columns: 1fr; } 
  .cinfo { grid-template-columns: 1fr 1fr; } 
}

@media (max-width: 800px) {
  /* Prevenire zoom pe iOS */
  input, select, textarea, .dates input, table.items input, table.items select, table.mini td input, select.move { font-size: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  main { padding: 16px; }
  .hide-sm { display: none; }
  .btn, .btn.small { min-height: 44px; } /* Touch targets */
  .icon { width: 40px; height: 40px; }
  .type-bar select { min-width: 0; width: 100%; }
  .type-bar > * { flex: 1 1 100%; }
  .vtab { min-width: 0; flex: 1 1 140px; padding: 12px; }
  .modal { padding: 20px; border-radius: var(--radius); }
  .modal-bg { padding: 4vh 12px; }
  .head h1 { font-size: 22px; }
  .bottom, .grid2 { grid-template-columns: 1fr; }
  .task-new { grid-template-columns: 1fr; }
  .head .btn { white-space: normal; }
  a.btn { display: inline-flex; align-items: center; justify-content: center; }
  .folders { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 8px; flex-direction: row; position: static; border-radius: var(--radius-sm); }
  .folders button { white-space: nowrap; flex: 0 0 auto; border: 1px solid var(--line); }
  .tpl-layout { grid-template-columns: 1fr; }
  table.tpl-table thead { display: none; }
  table.tpl-table, table.tpl-table tbody, table.tpl-table tr, table.tpl-table td:not(.hide-sm) { display: block; width: 100%; }
  table.tpl-table tr { padding: 16px; border-bottom: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); margin-bottom: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
  table.tpl-table tr:last-child { margin-bottom: 0; }
  table.tpl-table td { border: 0; padding: 4px 0; text-align: left; }
  table.tpl-table td.num { text-align: left; color: var(--muted); font-size: 14px; }
  table.tpl-table .row-actions { flex-wrap: wrap !important; justify-content: flex-start !important; margin-top: 12px; }
  table.tpl-table select.move { max-width: none; flex: 1 1 150px; }
}

@media (max-width: 760px) { 
  .ckps { grid-template-columns: repeat(2, minmax(0,1fr)); } 
  .cgrid { grid-template-columns: 1fr; } 
}

@media (max-width: 680px) {
  .dash { padding: 16px; border-radius: var(--radius); } 
  .dash-body { grid-template-columns: 1fr; } 
  .dash-ctrl { align-items: stretch; width: 100%; }
  .seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; } 
  .seg button { padding: 10px 8px; }
  .dates label { flex: 1 1 140px; } .dates input { flex: 1; }
  .hist-row { grid-template-columns: 20px 1fr; gap: 10px; } 
  .hist-meta { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 12px; flex-wrap: wrap; }
}

@media (max-width: 560px) { 
  .stats.six { grid-template-columns: repeat(2, minmax(0,1fr)); } 
  .ctype-grid { grid-template-columns: 1fr; } 
  .c-paper { padding: 20px; } 
}

/* Protecție overflow pt grile */
.tpl-layout > *, .cl-grid > *, .bottom > *, .grid2 > *, .grid3 > *, .dash-body > *, .cgrid > *, .c-layout > * { min-width: 0; }

/* ================= PRINT ================= */
@media print {
  .topbar, .head .btn, .msg, .dash-ctrl, .theme-toggle, .menu-btn { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card, .dash, .kpi, .stat { box-shadow: none !important; border-color: #ddd !important; break-inside: avoid; }
  .help-sec { break-inside: avoid; border: 0; }
  .help-h { padding: 8px 0; }
  .chev { display: none; }
}
/* ================= COMPLETĂRI (reguli structurale lipsă din varianta Gemini) ================= */
.fld.ac { position: relative; }                       /* ancoră pentru lista de sugestii */
.form { display: grid; gap: 6px; }
.form textarea { width: 100%; resize: vertical; }
.period { margin-bottom: 16px; }
.stat.next .value { color: var(--navy); }
:root[data-theme="dark"] .stat.next .value { color: var(--blue); }
table.registry td { font-size: 14px; }
.ics-badge { background: var(--purple-bg); color: var(--purple); font-size: 11px; padding: 2px 8px; }
.ckps { grid-template-columns: repeat(6, minmax(0,1fr)); }
.ckp .m { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cgrid { grid-template-columns: 1fr 1fr; }
.cpn { display: block; }
.cpn h3 { margin: 0 0 2px; font-size: 16px; font-weight: 800; color: var(--text); }
.cpn .hs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
@media (max-width: 1100px) { .ckps { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 760px) { .ckps { grid-template-columns: repeat(2, minmax(0,1fr)); } .cgrid { grid-template-columns: 1fr; } }
.msg { display: block; }                               /* mesajele conțin text + linkuri pe un singur flux */
.c-form h3.ch { display: flex; align-items: center; gap: 8px; }
table.registry th, table.registry td { padding: 12px 10px; }
:root[data-theme="dark"] .seg button.on { background: var(--card-hover); color: var(--blue); }
:root[data-theme="dark"] .btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 4px 10px rgba(37,99,235,0.25); }
:root[data-theme="dark"] .btn.primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
:root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .cav { background: #2563eb; border-color: #2563eb; }

/* ================= DASHBOARD REGISTRU – variantă compactă ================= */
.dash { padding: 16px 20px; margin-bottom: 16px; }
.dash-top { padding-bottom: 12px; margin-bottom: 14px; gap: 10px; }
.dash-range { font-size: 19px; margin-top: 2px; }
.dash-ctrl { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.seg button { padding: 5px 12px; }
.dates input { padding: 6px 10px; }
.dash-body { gap: 14px; margin-bottom: 0; }
.kpis { gap: 10px; }
.kpi { padding: 10px 14px; border-radius: 12px; }
.k-label { font-size: 12px; margin-bottom: 4px; }
.k-val { font-size: 24px; }
.k-sub { font-size: 11.5px; margin-top: 3px; }
.chart { padding: 10px 14px; gap: 14px; border-radius: 12px; }
.donut { width: 116px; height: 116px; }
.legend { gap: 5px; }
.money { padding: 12px 16px; gap: 8px; border-radius: 12px; }
.m-val { font-size: 21px; }
.m-val small { display: inline; margin: 0 0 0 4px; }
.dash-empty { margin-top: 10px; }
@media (max-width: 680px) {
  .dash { padding: 14px; }
  .dash-ctrl { flex-direction: column; align-items: stretch; }
  .seg button { padding: 8px 6px; }
}

/* ================= REGISTRU – filtru status cu bife (28.09) ================= */
.msel { position: relative; }
.msel-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 14px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.msel-btn.on { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.msel-car { font-size: 11px; color: var(--muted); }
.msel-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 350px; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 10px; }
.msel-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line-light); }
.msel-quick button { border: 1px solid var(--line); background: var(--line-light); color: var(--muted); border-radius: var(--radius-pill); padding: 5px 10px; font: inherit; font-size: 12.5px; white-space: nowrap; font-weight: 700; cursor: pointer; }
.msel-quick button.on { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.filters label.msel-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; color: var(--text); }
.filters label.msel-row:hover { background: var(--line-light); }
.msel-row input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.msel-n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.msel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line-light); font-size: 12.5px; }
@media (max-width: 800px) {
  .filters .msel { flex: 1 1 100%; }
  .msel-btn { width: 100%; justify-content: space-between; min-height: 44px; font-size: 16px; }
  .msel-pop { width: 100%; }
  .filters label.msel-row { padding: 10px 6px; }
  .msel-row input { width: 22px; height: 22px; }
}

/* ===== Ciorne fără număr, oferte de test, ștergere definitivă (28.09) ===== */
.test-badge { background: var(--purple-bg); color: var(--purple); text-transform: uppercase; letter-spacing: .04em; }
.nr-draft { color: var(--muted); font-style: italic; font-weight: 600; }
.nr-hint { font-size: 13px; }
table.registry tr.is-test td { background: var(--purple-bg); }
table.registry tr.is-test:hover td { background: var(--purple-bg); filter: brightness(.98); }
.hard-list { margin: 10px 0 8px; padding-left: 18px; line-height: 1.6; }
.hard-list li b { color: var(--text); }
.modal.hard-del .msg { margin-bottom: 6px; }

/* ---------- Sarcini → tab-ul „Echipă” (29.09) ---------- */
.team { margin-bottom: 8px; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 14px; }
.team-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: border-color var(--trans), box-shadow var(--trans); min-width: 0; }
.team-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.team-card.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-bg); background: var(--blue-bg); }
.tc-name { font-weight: 800; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-main { font-size: 13px; color: var(--muted); font-weight: 600; margin: 4px 0 8px; }
.tc-main b { font-size: 24px; font-weight: 800; color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chip { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--line-light); color: var(--muted); white-space: nowrap; }
.tc-chip.late { background: var(--red-bg); color: var(--red); }
.tc-chip.unseen { background: var(--amber-bg); color: var(--amber); }
.tc-chip.ok { background: var(--green-bg); color: var(--green); }
.tc-gave { margin-top: 10px; border: 0; background: transparent; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--blue); cursor: pointer; font-family: inherit; }
.tc-gave:hover { text-decoration: underline; }
.team-mx-box { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--card); }
.team-mx-box summary { cursor: pointer; font-weight: 800; font-size: 14px; color: var(--text); }
.team-mx-box summary .muted { font-weight: 600; font-size: 12px; }
.team-mx-wrap { overflow-x: auto; margin-top: 10px; }
table.team-mx { border-collapse: collapse; font-size: 13px; min-width: 100%; }
table.team-mx th, table.team-mx td { padding: 6px 10px; text-align: center; border-bottom: 1px solid var(--line-light); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.team-mx thead th { font-size: 12px; font-weight: 700; color: var(--muted); }
table.team-mx th.c0 { text-align: left; font-weight: 700; color: var(--text); }
table.team-mx thead th.c0 { color: var(--muted); }
table.team-mx td { color: var(--muted); }
table.team-mx td.has { color: var(--text); font-weight: 800; cursor: pointer; }
table.team-mx td.has:hover { background: var(--blue-bg); }
table.team-mx td.diag { background: var(--line-light); }
table.team-mx td.sel { background: var(--blue); color: #fff; }
table.team-mx td.tot, table.team-mx tfoot td { font-weight: 800; color: var(--text); }
.team-f select { min-width: 0; }
.team-count { font-size: 12px; font-weight: 700; margin: 4px 0 2px; }
.task-own { color: var(--teal); }
.task-unseen { background: var(--amber-bg); color: var(--amber); padding: 0 8px; border-radius: var(--radius-pill); }
@media (max-width: 800px) {
  .team-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .team-card { padding: 10px; }
  .tc-main b { font-size: 20px; }
  .team-f label { flex: 1 1 45%; }
  .team-f select { flex: 1; }
}
@media (max-width: 340px) { .team-cards { grid-template-columns: 1fr; } }

/* poziții opționale (cantitate 0): prețul cu TVA pentru 1 buc, doar afișare (29.09 → 30.09) */
input.gross.opt { font-style: italic; color: var(--muted, #5d6879); }
.opt-g { font-style: italic; color: var(--muted, #5d6879); }
.opt-g small { font-size: 0.85em; white-space: nowrap; }

/* ================= DASHBOARD REGISTRU – valori pe 3 rânduri (01.10) ================= */
.money { gap: 6px; }
.m-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 10px; row-gap: 0; min-width: 0; }
.m-line .k-label { margin: 0; white-space: nowrap; }
.m-line .m-val { font-size: 19px; line-height: 1.25; white-space: nowrap; text-align: right; margin-left: auto; }
.m-line .m-val small { display: inline; margin: 0 0 0 3px; font-size: 12px; }
.m-line.draft .m-val { font-size: 16px; color: var(--muted); }
.m-pct { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--green-bg); color: var(--green); font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.money .bar { height: 8px; margin-top: 2px; }
.money .k-sub { margin-top: 0; line-height: 1.35; }
@media (min-width: 1101px) and (max-width: 1250px) { .m-line .m-val { font-size: 17px; } .m-line.draft .m-val { font-size: 15px; } }
@media (max-width: 380px) { .m-line .m-val { font-size: 17px; } }

/* 📱 Telegram (Sarcini) */
.tg-modal { max-width: 560px; }
.tg-modal p { margin: 0 0 12px; }
.tg-modal .msg.ok-msg { background: var(--green-bg); color: var(--green); }
.tg-modal .msg.warn-msg { background: var(--amber-bg); color: var(--amber); }
.tg-modal .msg.info-msg { background: var(--blue-bg); color: var(--blue); display: block; }
.tg-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-light); cursor: pointer; font-size: 14px; }
.tg-opt input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.tg-cmds { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.tg-cmds summary { cursor: pointer; font-weight: 700; }
.tg-cmds ul { margin: 8px 0; padding-left: 18px; font-size: 13.5px; }
.tg-cmds li { margin-bottom: 4px; }
.tg-cmds code { background: var(--gray-bg); padding: 1px 5px; border-radius: var(--radius-sm); font-size: 12.5px; overflow-wrap: anywhere; }
.tg-group { cursor: default; }

/* ===== Catalog: prețuri pe surse, filtre pe coloane, paginare (01.10) ===== */
.cat-acts .btn { white-space: nowrap; }
.cat-tabs { margin-bottom: 16px; }
.cat-tabs .muted { font-weight: 700; margin-left: 4px; }
.cat-filters .cat-arch { white-space: nowrap; }
.cat-alerts { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.cat-alerts button { cursor: pointer; font: inherit; font-size: 12.5px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.q-chip { border: 1px solid var(--blue); background: var(--blue-bg); color: var(--blue); border-radius: var(--radius-pill); padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.cf-bar-l { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.cf-bar .cf { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill); padding: 3px 5px 3px 11px; font-size: 13px; font-weight: 700; color: var(--text); }
.cf-bar .cf-btn { width: 26px; height: 26px; }
.cf-mob { display: none; }
table.cat2 td:first-child { min-width: 220px; }
table.cat2 th, table.cat2 td { padding-left: 12px; padding-right: 12px; }
table.cat2 .nw { white-space: nowrap; }
table.cat2 td.acts { width: 1%; }
table.cat2 td.acts .row-actions { flex-wrap: wrap !important; width: 168px; gap: 6px; }
table.cat2 td.acts .btn.small { padding: 5px 9px; }
.c-vat { font-size: 12px; margin-top: 2px; }
table.cat2 th { white-space: nowrap; vertical-align: bottom; }
table.cat2 td { vertical-align: top; }
table.cat2 th.num .cf { justify-content: flex-end; }
table.cat2 tr.arch td { opacity: .72; }
.cf { display: inline-flex; align-items: center; gap: 2px; }
.cf-sort, .cf-lbl { border: 0; background: transparent; font: inherit; color: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 2px 2px; }
.cf-lbl { cursor: default; }
.cf-sort.on { color: var(--blue); }
.cf-btn { border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 6px; width: 22px; height: 22px; line-height: 1; font-size: 11px; cursor: pointer; padding: 0; }
.cf-btn:hover { border-color: var(--line); background: var(--line-light); }
.cf-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.cf-pop { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 10px; overflow-y: auto; text-align: left; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); white-space: normal; }
.cf-h { font-size: 12px; font-weight: 700; color: var(--muted); margin: 4px 2px 6px; }
.cf-h:not(:first-child) { margin-top: 12px; }
.cf-list { display: grid; gap: 2px; }
.cf-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text); }
.cf-row:hover { background: var(--line-light); }
.cf-row input { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.cf-n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-q { width: 100%; margin-bottom: 6px; }
.cf-clear { border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 6px 4px 0; }
.cf-range { display: flex; align-items: center; gap: 6px; }
.cf-range input { width: 90px; min-width: 0; flex: 1 1 0; }
.cf-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--line-light); margin-top: 8px; padding-top: 8px; }
.pc { line-height: 1.25; }
.pc b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-sub { display: flex; flex-wrap: wrap; gap: 2px 6px; justify-content: flex-end; align-items: center; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.pc-sub > * { white-space: nowrap; }
table.cat2 td.num { white-space: normal; }
table.cat2 td.num b { white-space: nowrap; }
.pc-sup { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.pc-sub a { text-decoration: none; font-weight: 700; color: var(--blue); }
.pc.st-exp b { color: var(--muted); text-decoration: line-through; }
.pc-exp { display: inline-block; border-radius: 6px; padding: 1px 6px; font-size: 11.5px; font-weight: 700; background: var(--green-bg); color: var(--green); border: 0; }
.pc-exp.soon { background: var(--amber-bg); color: var(--amber); }
.pc-exp.exp { background: var(--red-bg); color: var(--red); }
.c-sale { font-size: 15px; font-variant-numeric: tabular-nums; }
.src-pill { display: inline-block; border-radius: 6px; padding: 2px 7px; font-size: 11px; font-weight: 800; letter-spacing: .02em; vertical-align: 1px; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.src-pill.s-oferta { background: var(--purple-bg); color: var(--purple); }
.src-pill.s-fgo { background: var(--teal-bg); color: var(--teal); }
.src-pill.s-net { background: var(--blue-bg); color: var(--blue); }
.src-pill.s-manual { background: var(--amber-bg); color: var(--amber); }
.src-pill.ok { background: var(--green-bg); color: var(--green); }
.src-pill.muted { background: var(--line-light); color: var(--muted); }
.mt-warn { margin-top: 4px; font-size: 11.5px; font-weight: 700; color: var(--amber); }
.arch-tag { display: inline-block; background: var(--line-light); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.show-sm { display: none; }
.c-meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 500; }
.c-meta .cat-tag { padding: 2px 8px; font-size: 11.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btns .btn { min-width: 36px; justify-content: center; }
.pager-size { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cat-modal.wide { max-width: 1040px; }
.chk-fld span { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; padding-top: 28px; }
.chk-fld input { width: 18px; height: 18px; accent-color: var(--blue); }
.pd-now { background: var(--line-light); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.pd-l { font-size: 12px; font-weight: 700; }
.pd-v { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.pd-v small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pd-mode { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 2px; margin-bottom: 8px; }
.pd-h { font-size: 15px; margin: 16px 0 8px; }
table.pd-table tr.pd-cur td { background: var(--blue-bg); }
.mk-list { display: grid; gap: 6px; }
.mk-row { display: grid; grid-template-columns: 1fr 110px 20px; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.src-seg { margin-bottom: 14px; }
table.src-table tr.src-old td { opacity: .7; }
/* tabelul de potrivire la import */
.mt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mt-tabs button { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: var(--radius-pill); padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.mt-tabs button.on { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.mt-tabs button span { margin-left: 4px; }
.mt-bulk { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mt-wrap { max-height: 56vh; overflow: auto; }
table.mt-table td { vertical-align: top; font-size: 13.5px; }
.mt-name { font-weight: 600; color: var(--text); }
.mt-code { font-size: 11.5px; }
tr.mt-group td { background: var(--line-light); font-size: 13px; }
tr.mt-row.s-ign td:not(.mt-act) { opacity: .55; }
tr.mt-row.s-chk { box-shadow: inset 3px 0 0 var(--amber); }
tr.mt-row.s-new { box-shadow: inset 3px 0 0 var(--purple); }
tr.mt-row.s-ok { box-shadow: inset 3px 0 0 var(--green); }
tr.mt-row.s-none { box-shadow: inset 3px 0 0 var(--red); }
.mt-act { min-width: 300px; }
.mt-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.mt-seg button { border: 0; background: var(--card); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 10px; cursor: pointer; }
.mt-seg button + button { border-left: 1px solid var(--line); }
.mt-seg button.on { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .mt-seg button.on { background: var(--blue); }
.mt-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mt-conf { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: var(--green-bg); color: var(--green); }
.mt-conf.c-nume { background: var(--amber-bg); color: var(--amber); }
.mt-conf.ok { background: var(--green-bg); color: var(--green); }
.mt-new { display: grid; grid-template-columns: 1fr 160px; gap: 6px; }
.ipick { width: 100%; margin-top: 4px; }
.ipick input { width: 100%; }
.ipick-list { display: grid; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; max-height: 220px; overflow-y: auto; background: var(--card); }
.ipick-list button { text-align: left; border: 0; border-bottom: 1px solid var(--line-light); background: transparent; color: var(--text); font: inherit; font-size: 13px; padding: 7px 9px; cursor: pointer; }
.ipick-list button:hover, .ipick-list button.on { background: var(--blue-bg); }
@media (max-width: 800px) {
  .cf-mob { display: contents; }
  .cf-bar .cf-btn { width: 32px; height: 32px; }
  table.cat2 td:first-child { min-width: 0; }
  table.cat2 thead { display: none; }
  table.cat2, table.cat2 tbody, table.cat2 tr, table.cat2 td:not(.hide-sm):not(.hide-md) { display: block; width: 100%; }
  table.cat2 tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.cat2 td { border: 0; padding: 2px 0; text-align: left; }
  table.cat2 td.num { text-align: left; }
  table.cat2 td.acts .row-actions { justify-content: flex-start !important; flex-wrap: wrap !important; margin-top: 8px; width: auto; }
  .mt-act { min-width: 0; }
  .mt-new { grid-template-columns: 1fr; }
  .chk-fld span { padding-top: 0; }
  .pager { justify-content: center; }
}
.mt-sale { display: grid; gap: 2px; margin-top: 6px; }
.mt-sale label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); flex-wrap: wrap; }
.mt-sale input { width: 130px; }
.mk-help { font-size: 13px; padding-left: 18px; margin: 0 0 12px; display: grid; gap: 4px; }
table.mk-table td { padding-top: 8px; padding-bottom: 8px; }
table.mk-table input[inputmode] { width: 110px; }
table.mk-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }

/* ---------- Telegram pachet 2 (01.10): coloana Telegram în Utilizatori, linkul pentru colegi ---------- */
.tg-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13px; min-width: 150px; }
.tg-on { color: var(--green); font-weight: 600; }
textarea.tg-text { width: 100%; box-sizing: border-box; font-size: 13px; line-height: 1.4; resize: vertical; background: var(--gray-bg); color: var(--text, inherit); border: 1px solid var(--line-light); border-radius: 10px; padding: 10px; }
@media (max-width: 800px) {
  .tg-cell { min-width: 0; }
  .tg-modal .row-actions .btn { flex: 1 1 auto; }
}

/* =====================================================================
   CASH FLOW ICC – completări (orice culoare nouă e variabilă în ambele teme)
   ===================================================================== */
:root {
  --s-a: #1d4ed8; --s-b: #0d9488; --grid: #e8edf3; --tick: #64748b;   /* serii grafice validate (CVD) */
  --sel-bg: #eef4ff;
}
:root[data-theme="dark"] {
  --s-a: #4f8ff7; --s-b: #0ea5a0; --grid: #22304a; --tick: #94a3b8;
  --sel-bg: rgba(96, 165, 250, 0.10);
}

/* topbar */
.topbar nav a.ext { color: rgba(255,255,255,0.5); }
.topbar .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.btn.topadd { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); color: #fff; box-shadow: none; padding: 7px 14px; font-size: 13.5px; }
.btn.topadd:hover:not(:disabled) { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--line-light); color: var(--text); }
.icon.xs { width: 26px; height: 26px; font-size: 12px; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 500; padding: 8px 16px 28px; }
.login-app { text-align: center; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-size: 12px; margin: -12px 0 8px; }
.login-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.login .row-actions { margin-top: 8px; }
.login .msg { display: block; }

/* titluri de pagină */
.page-title { display: flex; align-items: center; gap: 12px 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title h1 { margin: 0; }
.page-title .spacer { flex: 1; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.card-head h3.ch { margin: 0; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 12px; font-weight: 500; line-height: 1.55; }
.note b { color: var(--text); }
.neg { color: var(--red); }
.empty.sm { padding: 18px; font-size: 13.5px; }
.grid2b { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid2b > * { min-width: 0; }

/* ---- dashboard: antet ---- */
.dash { position: relative; z-index: 3; }
.dash-top { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; align-items: flex-start; }
.dash-title { min-width: 0; }
.dash-range span { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.dash-ctrl { gap: 10px; min-width: 0; max-width: 100%; }
.dash-tools { display: flex; gap: 8px; align-items: center; position: relative; flex-wrap: wrap; justify-content: flex-end; }
.src { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.src i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: inline-block; flex: none; }
.src i.ok { background: var(--green); }
.dash-msg { margin: 16px 0 0; }
.big-alert { display: block; text-decoration: none; }
.big-alert:hover { filter: brightness(0.97); }
.big-alert span { font-weight: 500; }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.fieldsel { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fieldsel select { padding: 5px 28px 5px 10px; font-size: 13px; font-weight: 700; border-radius: var(--radius-pill); }
.linkbtn { background: none; border: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-pill); transition: all var(--trans); }
.linkbtn:hover { background: var(--line-light); color: var(--text); }
.pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px; min-width: 260px; max-width: calc(100vw - 32px); z-index: 20; display: grid; gap: 6px; }
.pop h4 { margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pop label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pop .hint { font-size: 12px; color: var(--muted); font-weight: 500; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.pop input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); }
.pop-item { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; color: var(--text); cursor: pointer; }
.pop-item:hover, .pop-item.on { background: var(--line-light); }
.pop-item.on { color: var(--blue); }
.pop-dates { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.pop-dates label { justify-content: space-between; }
.pop-dates input { padding: 6px 10px; }
.pop-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pop-card .ord { display: inline-flex; gap: 4px; }
.money { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; font-weight: 600; color: var(--muted); }
.money label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.money b { color: var(--text); }
input.num { width: 130px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; padding: 7px 10px; }

/* ---- dashboard: grilă de carduri cu drag & drop ---- */
.dgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.dcard { grid-column: span var(--span, 12); position: relative; min-width: 0; }
.dcard.card { padding: 22px 24px; }
.dcard.bare { padding: 0; }
.dcard.dragging { opacity: 0.45; }
.dcard.over { outline: 2px dashed var(--blue); outline-offset: 4px; border-radius: var(--radius); }
.drag-h { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--placeholder); cursor: grab; font-size: 14px; letter-spacing: -2px; opacity: 0; transition: opacity var(--trans), background var(--trans); user-select: none; z-index: 3; background: var(--card); }
.dcard:hover .drag-h { opacity: 1; }
.drag-h:hover { background: var(--line-light); color: var(--muted); }
.drag-h:active { cursor: grabbing; }
.dcard.card .card-head { padding-right: 26px; }

/* KPI */
.stats.kp6 { grid-template-columns: repeat(6, minmax(0,1fr)); margin-bottom: 0; }
.kp6 .stat { padding: 18px 20px; position: relative; overflow: hidden; min-width: 0; color: inherit; }
.kp6 .stat.link { cursor: pointer; transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans); }
.kp6 .stat.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--placeholder); }
.kp6 .stat .value { font-size: 24px; line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kp6 .stat .value small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kp6 .stat .sub { font-size: 12.5px; margin-top: 8px; }
.stat.info .value { color: var(--blue); } .stat.mt .value { color: var(--teal); }
.stat .sp { position: absolute; right: 12px; bottom: 12px; width: 56px; height: 24px; opacity: 0.9; }
.stat.has-sp .sub { padding-right: 62px; }

/* grafice */
.chart-wrap { position: relative; height: 290px; width: 100%; }
.chart-wrap.tall { height: 340px; }
.chart-wrap canvas { width: 100% !important; }
.chart-load { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; font-weight: 600; background: var(--line-light); border-radius: var(--radius-sm); }
.lg { list-style: none; margin: -4px 0 10px; padding: 0; display: flex; gap: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.card-head .lg { margin: 4px 0 0; }
.lg li { display: flex; align-items: center; gap: 7px; }
.lg i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.lg i.a { background: var(--s-a); } .lg i.b { background: var(--s-b); } .lg i.c { background: var(--amber); } .lg i.r { background: var(--red); } .lg i.p { background: var(--purple); }
.cf-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px 14px; font-size: 13px; min-width: 170px; max-width: 280px; opacity: 0; transform: translate(-50%, calc(-100% - 14px)) scale(0.96); transition: opacity 160ms ease, transform 160ms cubic-bezier(0.2,0.8,0.2,1); }
.cf-tip.show { opacity: 1; transform: translate(-50%, calc(-100% - 14px)) scale(1); }
.cf-tip .t { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.cf-tip .r { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 2px 0; font-weight: 600; }
.cf-tip .r i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 7px; vertical-align: -1px; }
.cf-tip .r b { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.cf-tip .n { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 500; border-top: 1px dashed var(--line); padding-top: 6px; }
.cf-tip::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }

/* liste cu bare (top furnizori, departamente, facturi mari) */
.flist { display: grid; gap: 12px; }
.frow { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; align-items: center; color: inherit; }
a.frow:hover .n { color: var(--blue); }
.frow .n { font-weight: 700; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.frow .doc { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.frow .v { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; text-align: right; white-space: nowrap; }
.frow .s { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 500; }
.frow .bar { grid-column: 1 / -1; height: 8px; background: var(--line-light); border-radius: var(--radius-pill); overflow: hidden; }
.frow .bar div { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--s-a), var(--navy-2)); transition: width .6s ease; }
.frow .btn.small { padding: 3px 10px; font-size: 12px; margin-left: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.aging { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.ag { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; color: inherit; transition: transform var(--trans); }
.ag:hover { transform: translateY(-2px); color: inherit; }
.ag .l { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.ag .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -0.02em; white-space: nowrap; }
.ag .v small { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.ag .s { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.ag.r { background: var(--red-bg); border-color: transparent; } .ag.r .v { color: var(--red); }
.ag.a { background: var(--amber-bg); border-color: transparent; } .ag.a .v { color: var(--amber); }
.ag.b { background: var(--blue-bg); border-color: transparent; } .ag.b .v { color: var(--blue); }
.ag.g { background: var(--gray-bg); border-color: transparent; } .ag.g .v { color: var(--gray); }

/* ---- tabele Cash Flow ---- */
.table-wrap { max-height: 70vh; overflow: auto; }
.table-wrap.flat { box-shadow: none; }
.cf-table { min-width: 640px; }
.cf-table th, .cf-table td { padding: 11px 14px; }
.cf-table th.r { text-align: right; }
.cf-table tr.day td { background: var(--line-light); font-weight: 800; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 14px; }
.cf-table tr.day td b { color: var(--text); font-variant-numeric: tabular-nums; float: right; letter-spacing: 0; text-transform: none; }
.cf-table tr.sel td { background: var(--sel-bg); }
.cf-table td.num.neg, .cf-table .num.neg { color: var(--red); }
.cf-table td .firma { font-weight: 700; }
.cf-table td .doc { font-size: 12px; color: var(--muted); font-weight: 500; }
.cf-table td.ck, .cf-table th.ck { width: 36px; padding-right: 0; }
.cf-table td.ck input, .cf-table th.ck input { width: 17px; height: 17px; accent-color: var(--navy); }
.cf-table td.acts { white-space: nowrap; text-align: right; }
.cf-table td.acts .btn { margin-left: 4px; }
.cf-table tfoot td { background: var(--line-light); font-weight: 800; border-bottom: none; position: sticky; bottom: 0; }
.cf-table select { padding: 6px 10px; }

/* insigne: stări și tipuri */
.st-over { background: var(--red-bg); color: var(--red); }
.st-today { background: var(--amber-bg); color: var(--amber); }
.st-soon { background: var(--blue-bg); color: var(--blue); }
.st-sched { background: var(--gray-bg); color: var(--gray); }
.st-paid { background: var(--green-bg); color: var(--green); }
.st-cec { background: var(--purple-bg); color: var(--purple); }
.st-canc { background: var(--gray-bg); color: var(--muted); text-decoration: line-through; }
.st-disp { background: var(--amber-bg); color: var(--amber); }
.k-inv { background: var(--line-light); color: var(--muted); }
.k-cn { background: var(--amber-bg); color: var(--amber); }
.k-rec { background: var(--teal-bg); color: var(--teal); }
.k-adv { background: var(--blue-bg); color: var(--blue); }
.k-cec { background: var(--purple-bg); color: var(--purple); }
.pill.big { background: var(--amber-bg); color: var(--amber); }
.pill.vbig { background: var(--red-bg); color: var(--red); }
.pill.manual { background: var(--blue-bg); color: var(--blue); }

/* scadențar */
.view-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.view-chips .chip { box-shadow: none; padding: 6px 14px; font-size: 13px; color: var(--text); }
.view-chips .chip.on { color: #fff; }
.filters .dates { align-items: center; }
.filters .dates input { padding: 8px 10px; }
.filters select { max-width: 100%; }
.bulk { position: sticky; top: 70px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; box-shadow: var(--shadow-md); font-size: 14px; }
.bulk .spacer { flex: 1; }
.bulk .btn.ghost { color: rgba(255,255,255,0.85); }
.bulk .btn.ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.bulk .btn.primary { background: #fff; color: var(--navy); border-color: #fff; box-shadow: none; }
:root[data-theme="dark"] .bulk { background: var(--blue-bg); color: var(--text); border: 1px solid var(--blue); }
:root[data-theme="dark"] .bulk .btn.primary { background: var(--blue); color: #0b1120; border-color: var(--blue); }
:root[data-theme="dark"] .bulk .btn.ghost { color: var(--muted); }

/* formulare / modale */
.modal { max-width: 640px; }
.modal.wide { max-width: 920px; }
.m-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.m-head h2 { margin: 0 0 2px; }
.m-head .sub { font-size: 13px; color: var(--muted); font-weight: 500; }
body.modal-open { overflow: hidden; }
fieldset.form { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset.form .fld { margin: 0; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld input, .fld select, .fld textarea { width: 100%; font-weight: 500; color: var(--text); }
.fld .calc { font-size: 12px; font-weight: 600; color: var(--blue); }
.fld.chkf { display: flex; align-items: center; gap: 10px; }
.fld.chkf input { width: 18px; height: 18px; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.form-foot .warn { margin: 0 auto 0 0; font-size: 12.5px; font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 6px 10px; border-radius: 8px; }
.form-foot .hint-foot { margin-right: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.pay-list { display: grid; gap: 4px; max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 14px; }
.pay-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; }
.pay-list small { color: var(--muted); font-weight: 500; }
.pay-list b { font-variant-numeric: tabular-nums; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.mini-stats div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.mini-stats span { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.mini-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.kv { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13.5px; }
.kv span { display: inline-block; min-width: 80px; color: var(--muted); font-weight: 600; }
.kv code { font-size: 12.5px; background: var(--line-light); padding: 2px 6px; border-radius: 6px; }

/* CEC – cronologie */
.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl li { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 0 12px; align-items: start; position: relative; padding: 9px 0; }
.tl li::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl li:first-child::before { top: 18px; } .tl li:last-child::before { bottom: calc(100% - 18px); }
.tl .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--purple); border: 2px solid var(--card); margin: 7px 0 0 2px; box-shadow: 0 0 0 2px var(--purple-bg); position: relative; z-index: 1; }
.tl .dot.done { background: var(--green); box-shadow: 0 0 0 2px var(--green-bg); }
.tl .dot.off { background: var(--gray); box-shadow: 0 0 0 2px var(--gray-bg); }
.tl .b { font-weight: 700; font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tl .d { font-size: 12px; color: var(--muted); font-weight: 500; }
.tl .v { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.tl-act { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.tl-act .btn.small { padding: 3px 10px; font-size: 12px; }

/* setări */
.tabs a.tab { display: inline-block; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sgrid > * { min-width: 0; }
.thr { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 12px 14px; align-items: center; }
.thr label { font-size: 13.5px; font-weight: 600; }
.thr label small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.thr input[type=number], .thr input[type=time] { width: 100%; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.sw { position: relative; width: 40px; height: 22px; flex: none; justify-self: end; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background var(--trans); }
.sw span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--trans); box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.sw input:checked + span { background: var(--green); }
.sw input:checked + span::after { transform: translateX(18px); }
.sw input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.sw input:disabled { cursor: not-allowed; }
.acc { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1.4fr) 150px 150px 40px; gap: 10px; align-items: center; margin-bottom: 10px; }
.acc input { width: 100%; }
.acc .num, .acc span.r { text-align: right; }
.acc-h { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px; }
.acc .when { font-size: 12px; color: var(--muted); font-weight: 600; display: grid; }
.acc .when small { font-size: 10.5px; color: var(--placeholder); font-weight: 800; letter-spacing: 0.05em; }
.acc input[type=checkbox] { width: 18px; height: 18px; justify-self: center; }
.acc-tot { display: flex; justify-content: space-between; font-weight: 800; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dep-list { display: grid; gap: 10px; }
.dep { display: grid; grid-template-columns: minmax(0, 280px) auto auto; gap: 12px; align-items: center; justify-content: start; }
.add-member .row-actions select { max-width: 100%; }
.users .chk { font-size: 13px; margin-right: 10px; }
.roadmap { display: grid; gap: 10px; }
.rm { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 13.5px; }
.rm i { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; font-style: normal; background: var(--gray-bg); color: var(--gray); }
.rm i.on { background: var(--green-bg); color: var(--green); } .rm i.next { background: var(--blue-bg); color: var(--blue); }
.rm b { display: block; } .rm span { color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* ---- responsive Cash Flow ---- */
@media (max-width: 1100px) {
  .stats.kp6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .topbar.open .user { flex-wrap: wrap; gap: 10px; }
  .topbar .who { max-width: none; }
}
@media (max-width: 900px) {
  .dcard { grid-column: span 12 !important; }
  .drag-h { display: none; }
  .dcard.card .card-head { padding-right: 0; }
  .grid2b, .sgrid { grid-template-columns: 1fr; }
  .dash-top { flex-direction: column; }
  .dash-ctrl { align-items: stretch; width: 100%; }
  .dash-tools { justify-content: flex-start; }
  .money label { justify-content: flex-start; }
}
@media (max-width: 800px) {
  .dcard.card { padding: 18px 16px; }
  .chart-wrap { height: 250px; } .chart-wrap.tall { height: 280px; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .acc { grid-template-columns: 1fr 1fr; }
  .acc-h { display: none; }
  .acc .when { grid-column: 1 / 2; }
  .dep { grid-template-columns: 1fr; }
  /* tabelele mari devin rânduri-card */
  .table-wrap { max-height: none; overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .cf-table { min-width: 0; }
  .cf-table thead { display: none; }
  .cf-table, .cf-table tbody, .cf-table tfoot, .cf-table tr, .cf-table td { display: block; width: 100%; }
  .cf-table tr.row, .cf-table tbody tr:not(.day) { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 12px 14px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; position: relative; }
  .cf-table td { border: 0; padding: 0; text-align: left; }
  .cf-table td.num { text-align: right; }
  .cf-table td[data-l]:not([data-l=""])::before { content: attr(data-l) ' '; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 6px; }
  .cf-table td.num[data-l]::before { display: none; }
  .cf-table td.who { grid-column: 1 / -1; order: -1; }
  .cf-table td.ck { position: absolute; top: 12px; right: 12px; width: auto; }
  .cf-table.sc td.who { padding-right: 34px; }
  .cf-table td.acts { grid-column: 1 / -1; text-align: left; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  .cf-table td.acts .btn { margin-left: 0; flex: 1 1 auto; }
  .cf-table tr.day td { border-radius: var(--radius-sm); margin: 14px 0 8px; }
  .cf-table tfoot tr { display: flex; justify-content: space-between; background: var(--line-light); border-radius: var(--radius-sm); padding: 10px 14px; }
  .cf-table tfoot td { position: static; background: transparent; width: auto; }
  .cf-table tfoot td:empty { display: none; }
  .bulk { top: 64px; }
  fieldset.form { grid-template-columns: 1fr; }
  .thr { grid-template-columns: minmax(0,1fr) 130px; }
  .tl li { grid-template-columns: 18px minmax(0,1fr); }
  .tl .v { grid-column: 2; }
}
@media (max-width: 680px) {
  .dash .seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .dash .seg.sm { width: auto; display: inline-flex; }
  .aging { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats.kp6 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kp6 .stat { padding: 14px 14px; }
  .kp6 .stat .value { font-size: 19px; }
  .stat .sp { display: none; } .stat.has-sp .sub { padding-right: 0; }
  .pop { left: 0; right: auto; }
  .dash-range span { display: block; margin: 4px 0 0; }
  .page-title h1 { font-size: 22px; }
  .filters .dates { width: 100%; }
}
@media print {
  .drag-h, .dash-tools, .money, .bulk, .foot, .view-chips, .filters { display: none !important; }
}
@media (max-width: 680px) {
  .seg.sm { width: auto; display: inline-flex; }
  .filters .dates label { white-space: nowrap; flex: 1 1 140px; }
  .filters .dates select { flex: 1 1 100%; }
  .filters > select { flex: 1 1 100%; }
}
fieldset.form .fld { align-content: start; }
fieldset.form .fld select, fieldset.form .fld input { height: 44px; }
.form-foot .warn { flex: 1 1 100%; margin: 0; }
.form-foot .hint-foot { flex: 1 1 100%; margin: 0; }
