@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); }
.pill.tag-service { background: var(--blue-bg); color: var(--blue); }
.pill.tag-instalari { background: var(--green-bg); color: var(--green); }
.pill.tag-vanzari { background: var(--amber-bg); color: var(--amber); }
.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); }
.msg.warn { background: var(--amber-bg); color: var(--text); border-left: 4px solid var(--amber); }
.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-int { background: var(--teal-bg); color: var(--teal); margin-right: 8px; }
.task-rec { background: var(--purple-bg); color: var(--purple); 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; }
}

/* sarcini recurente (07.10.2026) */
.rec-prev { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--purple-bg); color: var(--text, inherit); line-height: 1.5; }
.rec-row .rec-ico { font-size: 18px; line-height: 1; padding-top: 2px; }
/* ===== Registru pe desktop: fără scroll orizontal (08.10) =====
   Emailul clientului nu mai are coloană (rămâne în ofertă, în DB și în căutare).
   table-layout: fixed → lățimile vin din <colgroup>, nu din conținut; Obiectivul ia restul spațiului. */
@media (min-width: 801px) {
  table.registry { table-layout: fixed; width: 100%; }
  table.registry col.c-nr { width: 150px; }
  table.registry col.c-dt { width: 100px; }
  table.registry col.c-cl { width: 15%; }
  table.registry col.c-tel { width: 120px; }
  table.registry col.c-obj { width: auto; }
  table.registry col.c-resp { width: 13%; }
  table.registry col.c-st { width: 124px; }
  table.registry col.c-tot { width: 124px; }
  table.registry td { overflow-wrap: break-word; }
  table.registry td.nr { white-space: normal; }
  table.registry td:nth-child(7) { white-space: normal !important; }
}
@media (min-width: 801px) and (max-width: 1250px) {
  table.registry th, table.registry td { padding: 10px 6px; }
  table.registry td { font-size: 13px; }
  table.registry th { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
  table.registry col.c-nr { width: 11%; }
  table.registry col.c-dt { width: 9%; }
  table.registry col.c-cl { width: 12%; }
  table.registry col.c-tel { width: 12%; }
  table.registry col.c-resp { width: 10%; }
  table.registry col.c-st { width: 10%; }
  table.registry col.c-tot { width: 12%; }
  table.registry td.num { font-size: 12.5px; }
}

/* ---------- ofertă: salvare produs liber în catalog (09.10) ---------- */
.cat-save { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 12px; color: var(--muted); cursor: pointer; vertical-align: middle; white-space: nowrap; }
.cat-save input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.cat-save:hover { color: var(--text); }
.cat-in { display: inline-block; margin-left: 8px; font-size: 12px; color: var(--green); vertical-align: middle; white-space: nowrap; }
.cat-save-modal { max-width: 640px; }
@media (max-width: 800px) {
  .cat-save, .cat-in { margin-left: 0; margin-top: 6px; display: flex; }
  .cat-save input { width: 20px; height: 20px; }
}
.c-added { font-size: 11.5px; margin-top: 2px; }

/* ===== Catalog v2 (20.10.2026): cod de ofertare, prețul pieței, stoc FGO, butoane cu notă, lista de pregătire ===== */
.oc-code { display: inline-block; font: 600 11.5px ui-monospace, Menlo, Consolas, monospace; background: var(--blue-bg); color: var(--navy); border-radius: 5px; padding: 1px 6px; letter-spacing: .2px; }
:root[data-theme="dark"] .oc-code { color: var(--blue); }
.c-codes { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; margin-top: 2px; }
.mk-cell b { font-size: 14px; }
.mk-diff { display: inline-block; font-size: 11px; font-weight: 700; border-radius: var(--radius-pill); padding: 0 6px; margin-left: 4px; }
.mk-diff.ok { background: var(--green-bg); color: var(--green); }
.mk-diff.warn { background: var(--amber-bg); color: var(--amber); }
.mk-diff.bad { background: var(--red-bg); color: var(--red); }
.linkish { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; }
.mk-pop { position: fixed; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; text-align: left; max-height: 70vh; overflow: auto; }
.mk-pop-h { font-weight: 700; margin-bottom: 6px; }
.mk-pop-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mk-pop-t td { padding: 5px 4px; border-top: 1px solid var(--line-light); font-size: 13px; }
.mk-pop-t td.mk-site { width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mk-pop-t td:nth-child(2) { width: 16%; white-space: nowrap; } .mk-pop-t td:nth-child(3) { width: 22%; text-align: right; } .mk-pop-t td:nth-child(4) { width: 24%; text-align: right; }
.mk-pop-t tr.dim td { color: var(--muted); } .mk-pop-t tr.dim td b { font-weight: 500; }
.mk-pop-f { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.mk-tag { display: inline-block; font-size: 11px; font-weight: 600; border-radius: var(--radius-pill); padding: 0 7px; background: var(--gray-bg); color: var(--gray); }
.mk-tag.ok { background: var(--green-bg); color: var(--green); }
.stk-neg { color: var(--red); }
.mt-warn.cheap { color: var(--blue); background: var(--blue-bg); }
/* căutarea din ofertă */
.ac-nums { display: flex !important; gap: 10px; flex-wrap: wrap; }
.ac-nums b { color: var(--text); }
.ac-ok { color: var(--green) !important; } .ac-bad { color: var(--red) !important; }
/* butoanele de pe rândul ofertei */
td.acts.acts5 { white-space: nowrap; }
td.acts.acts5 .icon { width: 26px; height: 30px; margin-left: 2px; }
td.acts.acts5 .tipw { display: inline-block; }
.icon.pm-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.icon.al-btn { font-weight: 700; }
.icon.al-btn.on { background: #93370d; border-color: #93370d; color: #fff; }
.icon.al-btn.warn { border-color: var(--amber); color: var(--amber); }
.tipbox { position: fixed; z-index: 80; background: #18223a; color: #fff; font-size: 12.5px; line-height: 1.45; border-radius: 8px; padding: 9px 11px; box-shadow: 0 8px 24px rgba(0,0,0,.25); text-align: left; white-space: normal; font-weight: 500; pointer-events: none; }
.tipbox b { color: #fff; } .tipbox .m { color: #b9c3d8; }
.al-chip { display: inline-block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: #93370d; background: #fdebd8; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
:root[data-theme="dark"] .al-chip { color: #fdba74; background: rgba(253, 186, 116, .15); }
.al-sub { font-size: 11px; }
.pm-tag { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--navy); background: var(--blue-bg); border-radius: var(--radius-pill); padding: 1px 8px; margin-left: 6px; }
:root[data-theme="dark"] .pm-tag { color: var(--blue); }
/* lista de pregătire */
.prep-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.prep-page .card { margin-bottom: 16px; }
table.prep-t th, table.prep-t td { vertical-align: top; }
table.prep-t tr.done td { opacity: .55; }
table.prep-t .c { text-align: center; }
.prep-st { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 1px 8px; }
.prep-st.ok { background: var(--green-bg); color: var(--green); }
.prep-st.warn { background: var(--amber-bg); color: var(--amber); }
.prep-st.bad { background: var(--red-bg); color: var(--red); }
/* ghidul codurilor */
.codes-page .card { margin-bottom: 16px; }
.codes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
table.codes-t { width: 100%; border-collapse: collapse; }
table.codes-t td, table.codes-t th { border-bottom: 1px solid var(--line-light); padding: 5px 8px; text-align: left; font-size: 13.5px; }
.codes-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 20px; }
.codes-cats ul { margin: 4px 0 10px 18px; padding: 0; font-size: 13px; }
@media print {
  .topbar, .row-actions, .head .btn, [data-ro].btn { display: none !important; }
  .prep-page .card, .codes-page .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body { background: #fff; }
}
@media (max-width: 800px) {
  td.acts.acts5 .icon { width: 34px; height: 34px; }
}

/* listă de pregătire: legarea pozițiilor scrise liber de catalog (20.10.2026) */
.prep-link { display: flex; flex-direction: column; gap: 4px; position: relative; min-width: 220px; }
.prep-link .btn.small { padding: 2px 8px; min-height: 0; font-size: 12px; }
.prep-link .link-btn { align-self: flex-start; }
.prep-q { width: 100%; font-size: 13px; padding: 4px 8px; }
.prep-res { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.prep-ri { padding: 5px 8px; cursor: pointer; font-size: 12.5px; color: var(--text); border-bottom: 1px solid var(--line); }
.prep-ri:hover { background: var(--blue-bg); }
@media print { .prep-link .btn, .prep-q, .prep-res { display: none; } }

/* verificare denumiri catalog (#/verificare-catalog) */
.rv-page .card { margin-bottom: 12px; }
.rv-intro p { margin: 8px 0; }
.rv-stat { margin: 8px 0 12px; }
.rv-row { padding: 16px 18px; border-left: 4px solid var(--amber, #d89614); }
.rv-row.done { border-left-color: var(--green, #2e8b57); }
.rv-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rv-q { font-weight: 600; margin: 6px 0; }
.rv-src { font-size: 13px; margin-bottom: 8px; line-height: 1.45; }
.rv-ok { color: var(--green, #2e8b57); font-size: 13px; font-weight: 600; }
.rv-todo { color: var(--amber, #b07a10); font-size: 13px; font-weight: 600; }
.rv-bottom { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.rv-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.rv-note { flex: 1 1 220px; min-width: 0; }
@media (max-width: 640px) { .rv-bottom { flex-direction: column; align-items: stretch; } .rv-note { flex: none; } }
.rv-name { width: 100%; resize: vertical; min-height: 44px; font: inherit; }

/* ---------- informări tip pop-up (noutati.js, din 21.10) ---------- */
.news-modal { max-width: 680px; }
.news-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.news-h h2 { margin: 0; font-size: 19px; flex: 1; }
.news-tag { background: var(--blue-bg); color: var(--blue); font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.news-list { margin: 0 0 14px; padding-left: 22px; }
.news-list li { margin: 0 0 9px; line-height: 1.5; font-size: 14.5px; }
.news-list code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.msg.warn-news { background: var(--amber-bg); color: var(--text); border-left: 4px solid var(--amber); font-weight: 500; display: block; margin: 0; }
.news-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 800px) { .news-foot .btn { flex: 1 1 100%; } .news-h h2 { font-size: 17px; } }
