/* ==========================================================================
   SERVICELL Facturare – sistem vizual
   Compact (13px), luminos, cu bleumarin pe meniu și albastrul brandului.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f1f4f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e4e8f0;
  --line-2: #eef1f6;

  --brand: #0b6bd3;
  --brand-600: #0959b0;
  --brand-700: #08478c;
  --brand-50: #eef5fe;
  --brand-100: #d9e9fd;
  --brand-ring: rgba(11, 107, 211, .22);

  --side: #0b1426;
  --side-2: #101d36;
  --side-ink: #a6b2c7;
  --side-ink-2: #e8edf6;
  --side-line: rgba(255, 255, 255, .07);

  --success: #059669;  --success-bg: #e9f9f1;  --success-ink: #047857;
  --warning: #d97706;  --warning-bg: #fff6e5;  --warning-ink: #a35a00;
  --danger: #e11d48;   --danger-bg: #ffeef1;   --danger-ink: #be123c;
  --info: #0b6bd3;     --info-bg: #eaf3fe;     --info-ink: #0959b0;
  --neutral: #64748b;  --neutral-bg: #eff2f6;  --neutral-ink: #475569;
  --violet: #7c3aed;   --violet-bg: #f3edff;   --violet-ink: #6d28d9;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);

  --side-w: 236px;
  --top-h: 56px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0f1c;
  --surface: #111827;
  --surface-2: #0f1626;
  --surface-3: #162034;
  --ink: #e6ebf5;
  --ink-2: #c3cddd;
  --muted: #8b98ad;
  --faint: #64728a;
  --line: #1f2a3d;
  --line-2: #1a2436;

  --brand: #3b8cf0;
  --brand-600: #5b9ff3;
  --brand-700: #8dbcf7;
  --brand-50: #10213b;
  --brand-100: #15305a;
  --brand-ring: rgba(59, 140, 240, .3);

  --side: #070c18;
  --side-2: #0e1729;

  --success-bg: #0c2a20;  --success-ink: #4ade80;
  --warning-bg: #2d2010;  --warning-ink: #fbbf24;
  --danger-bg: #2f1219;   --danger-ink: #fb7185;
  --info-bg: #10223d;     --info-ink: #7fb4f6;
  --neutral-bg: #1a2334;  --neutral-ink: #a3b0c4;
  --violet-bg: #221a3d;   --violet-ink: #b69cff;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ bază */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.5 var(--font);
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
p { margin: 0; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[x-cloak] { display: none !important; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* icon */
.i { width: 16px; height: 16px; flex: none; stroke-width: 1.9; vertical-align: -3px; }
.i-xs { width: 13px; height: 13px; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 18px; height: 18px; }
.i-xl { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- layout */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--side-w);
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(59, 140, 240, .16), transparent 60%),
    linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%);
  color: var(--side-ink);
  border-right: 1px solid var(--side-line);
  transition: transform .22s ease;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  height: var(--top-h); padding: 0 18px;
  border-bottom: 1px solid var(--side-line);
  color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: #fff;
  box-shadow: 0 6px 18px rgba(11, 107, 211, .45), 0 0 0 1px rgba(255, 255, 255, .5);
}
.brand-mark img { width: 22px; height: 22px; }
.brand-name { font-weight: 750; font-size: 14px; letter-spacing: .6px; line-height: 1.1; }
.brand-sub { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .3px; color: #7f8ca6; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 18px; scrollbar-width: thin; scrollbar-color: #24324c transparent; }
.nav-sec {
  padding: 16px 10px 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase;
  color: #5d6b85;
}
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 7.5px 10px; margin: 1px 0;
  border-radius: 8px;
  color: var(--side-ink); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a .i { opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: var(--side-ink-2); }
.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 140, 240, .24), rgba(59, 140, 240, .08));
}
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(#5fb6ff, #0b6bd3);
}
.nav a.active .i { opacity: 1; color: #8cc4ff; }
.nav .count {
  margin-left: auto; min-width: 20px; padding: 0 6px;
  border-radius: 999px; background: rgba(225, 29, 72, .9); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav .count.soft { background: rgba(255, 255, 255, .1); color: #c9d3e3; }

.side-foot { padding: 12px; border-top: 1px solid var(--side-line); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; color: #e6ebf5; font-weight: 600; font-size: 12.5px; }
.side-user .who span { display: block; color: #7f8ca6; font-size: 11px; }
.side-user .btn-icon { color: #8b98ad; }
.side-user .btn-icon:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 12.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faint); }
.crumbs b { color: var(--ink); font-weight: 600; }
.topbar .grow { flex: 1; }

.search-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 300px; height: 34px; padding: 0 10px 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--faint);
  font: inherit; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: #cdd5e2; color: var(--muted); }
.search-trigger > span:not(.kbd) { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger .kbd { flex: none; }
.kbd {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface-2); color: var(--muted);
  font-size: 10.5px; font-weight: 600; font-family: var(--font);
}

.content { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 22px 24px 48px; }
.foot { padding: 14px 24px 22px; color: var(--faint); font-size: 11.5px; text-align: center; }

.btn.burger { display: none; }
.scrim { display: none; }

/* --------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 700; letter-spacing: -.25px; }
.page-head .sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.back-link:hover { color: var(--ink); }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink-2);
  font: 600 12.5px/1 var(--font); white-space: nowrap;
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: #cfd7e4; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn .i { margin-left: -2px; }
.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(180deg, #1a7ae0, var(--brand));
  box-shadow: 0 1px 2px rgba(11, 107, 211, .3), 0 4px 12px rgba(11, 107, 211, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:hover { color: #fff; border-color: transparent; background: linear-gradient(180deg, #0f6fd6, var(--brand-600)); }
.btn-success { border-color: transparent; color: #fff; background: linear-gradient(180deg, #10a874, var(--success)); box-shadow: 0 4px 12px rgba(5, 150, 105, .22); }
.btn-success:hover { color: #fff; border-color: transparent; background: #047857; }
.btn-danger { color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger-bg); border-color: #fbc8d3; color: var(--danger-ink); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
[hidden] { display: none !important; }
.install-hint { display: inline-flex; align-items: center; gap: 2px; }
.install-x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.install-x:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { border-color: transparent; background: var(--brand-50); color: var(--brand-600); box-shadow: none; }
.btn-soft:hover { background: var(--brand-100); border-color: transparent; color: var(--brand-700); }
.btn-sm { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; gap: 6px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 50px; padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
}
.card-h h2, .card-h h3 { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h h2 .i, .card-h h3 .i { color: var(--muted); }
.card-h .hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.card-b { padding: 16px; }
.card-b.tight { padding: 10px 16px; }
.card-f { padding: 12px 16px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-flush { overflow: hidden; }

/* --------------------------------------------------------------- grids */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-main-wide { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

/* ----------------------------------------------------------------- KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  position: relative; overflow: hidden;
  padding: 15px 16px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 550; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand);
}
.kpi-ico.tone-success { background: var(--success-bg); color: var(--success); }
.kpi-ico.tone-warning { background: var(--warning-bg); color: var(--warning); }
.kpi-ico.tone-danger { background: var(--danger-bg); color: var(--danger); }
.kpi-ico.tone-violet { background: var(--violet-bg); color: var(--violet); }
.kpi-value { margin-top: 8px; font-size: 22px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 4px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 38px; opacity: .9; pointer-events: none; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-ink);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.no-dot::before { display: none; }
.badge.tone-success { background: var(--success-bg); color: var(--success-ink); }
.badge.tone-warning { background: var(--warning-bg); color: var(--warning-ink); }
.badge.tone-danger { background: var(--danger-bg); color: var(--danger-ink); }
.badge.tone-info { background: var(--info-bg); color: var(--info-ink); }
.badge.tone-violet { background: var(--violet-bg); color: var(--violet-ink); }
.badge.tone-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 5px; background: var(--surface-3); color: var(--ink-2);
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}

/* -------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 12px;
  background: var(--surface-2); color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; text-align: left; white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table .act { width: 1%; white-space: nowrap; text-align: right; }
.table tfoot td { padding: 10px 12px; background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 650; }
.table .sub-line { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.table .row-muted td { color: var(--faint); }
.table .row-muted td .strong { color: var(--muted); }
.table-compact td { padding-top: 7px; padding-bottom: 7px; }
.table tr.day-row td { background: var(--surface-3); padding-top: 7px; padding-bottom: 7px; font-size: 12px; border-bottom: 1px solid var(--line); }
.table tr.day-row:hover { background: transparent; }

.doc-no { font-weight: 650; color: var(--ink); white-space: nowrap; }
a.doc-no:hover { color: var(--brand); }
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.client-cell .who { min-width: 0; }
.client-cell .who b { display: block; font-weight: 600; color: var(--ink); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-cell .who span { display: block; color: var(--muted); font-size: 11.5px; }
/* Numărul facturii + starea e-Factura ca pictogramă (fără text) */
.only-sm { display: none !important; }
@media (max-width: 720px) { .only-sm { display: block !important; } .client-cell .who .only-sm .badge { display: inline-flex !important; max-width: none !important; } }
.doc-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ef-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid transparent; flex: none; }
.ef-dot svg { width: 12px; height: 12px; }
.ef-dot.ok { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.ef-dot.scheduled { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.ef-dot.error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.ef-dot.none { background: var(--surface-2); color: var(--faint); border-color: var(--danger); }
@media (max-width: 1440px) { .client-cell .who b { max-width: 260px; } }

/* avatar */
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: #fff; background: linear-gradient(140deg, #5aa5f5, #0b6bd3);
}
.avatar.round { border-radius: 50%; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; border-radius: 8px; }
.avatar.lg { width: 46px; height: 46px; font-size: 15px; border-radius: 13px; }
.avatar.c1 { background: linear-gradient(140deg, #5aa5f5, #0b6bd3); }
.avatar.c2 { background: linear-gradient(140deg, #34d399, #059669); }
.avatar.c3 { background: linear-gradient(140deg, #fbbf24, #d97706); }
.avatar.c4 { background: linear-gradient(140deg, #a78bfa, #7c3aed); }
.avatar.c5 { background: linear-gradient(140deg, #f472b6, #db2777); }
.avatar.c6 { background: linear-gradient(140deg, #22d3ee, #0891b2); }
.avatar.c7 { background: linear-gradient(140deg, #94a3b8, #475569); }

/* --------------------------------------------------------------- filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar .grow { flex: 1; }
.search-input { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-input .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-input .input { padding-left: 32px; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); overflow-x: auto; max-width: 100%; }
.segmented a, .segmented button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font: 600 12px/1 var(--font); white-space: nowrap; cursor: pointer;
}
.segmented a:hover, .segmented button:hover { color: var(--ink); }
.segmented .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }
.segmented .cnt { padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-size: 10.5px; line-height: 16px; font-variant-numeric: tabular-nums; }
.segmented .on .cnt { background: var(--brand-50); color: var(--brand-600); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 14px; }
.col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--danger); }
.label .opt { color: var(--faint); font-weight: 450; }
.help { font-size: 11.5px; color: var(--muted); }
.error-text { font-size: 11.5px; color: var(--danger-ink); font-weight: 550; }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font: 13px/1.4 var(--font);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #cbd3e1; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(225, 29, 72, .12); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input-sm { height: 30px; font-size: 12.5px; padding: 0 9px; border-radius: 7px; }
.textarea { height: auto; min-height: 74px; padding: 8px 11px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
}
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group .addon {
  display: grid; place-items: center; padding: 0 10px; min-width: 40px;
  border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600;
}
.input-group .btn { border-radius: 0 8px 8px 0; margin-left: -1px; height: 34px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: #cfd7e3; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--brand-ring); }

.form-section { padding: 18px 18px 20px; }
.form-section + .form-section { border-top: 1px solid var(--line-2); }
.form-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.form-section-title .step {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand); font-size: 11.5px; font-weight: 700;
}
.form-section-title h3 { font-size: 13.5px; font-weight: 650; }
.form-section-title p { color: var(--muted); font-size: 12px; }

.form-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 -6px 20px rgba(15, 23, 42, .06);
}
.form-actions .grow { flex: 1; }

/* ------------------------------------------------------- combobox (client) */
.combo { position: relative; }
.combo-panel {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 300px; overflow-y: auto; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.combo-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.combo-opt.hi, .combo-opt:hover { background: var(--brand-50); }
.combo-opt .meta { display: block; color: var(--muted); font-size: 11.5px; }
.combo-empty { padding: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.selected-client {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--brand-100); border-radius: 10px; background: var(--brand-50);
}
.selected-client .who { flex: 1; min-width: 0; }
.selected-client .who b { display: block; }
.selected-client .who span { display: block; color: var(--muted); font-size: 12px; }

/* --------------------------------------------------------- invoice lines */
.lines { width: 100%; border-collapse: separate; border-spacing: 0; }
.lines th { padding: 8px 6px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; text-align: left; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lines th:first-child { padding-left: 16px; } .lines th:last-child { padding-right: 16px; }
.lines td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.lines td:first-child { padding-left: 16px; } .lines td:last-child { padding-right: 16px; }
.lines .pos { width: 30px; padding-top: 14px; color: var(--faint); font-weight: 600; font-size: 12px; text-align: center; }
.lines .c-desc { min-width: 260px; }
.lines .c-unit { width: 58px; }
.lines .c-qty { width: 1%; white-space: nowrap; }
.lines .c-price { width: 88px; }
.lines .c-vat { width: 74px; }
/* Lista de produse din factură: fără scroll, meniul liniei trebuie să iasă din tabel. */
.table-wrap.lines-wrap { overflow: visible; }
.lines .c-unit .input { padding-left: 6px; padding-right: 6px; text-align: center; }
.lines td.c-vat .select.input-sm { -webkit-appearance: none; appearance: none; background-image: none; padding: 0 4px; text-align: center; text-align-last: center; }
.lines .c-price .input, .lines .c-qty .input { padding-left: 6px; padding-right: 8px; }
.lines .c-qty .input { width: 4ch; min-width: 3.4em; box-sizing: content-box; }
.lines .c-desc textarea.desc { width: 100%; resize: none; overflow: hidden; line-height: 1.35; padding-top: 7px; padding-bottom: 7px; min-height: 36px; }
.lines tbody tr:last-child td { border-bottom: 0; }
.lines .select.input-sm { padding-right: 26px; background-position: right 7px center; }
.lines .c-total { width: 92px; text-align: right; padding-top: 14px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines .c-del { width: 36px; padding-top: 10px; }
.lines tr:hover .btn-del { opacity: 1; }
.btn-del { opacity: .35; }
.lines .details-toggle { margin-top: 5px; font-size: 11.5px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 550; }
.lines .details-toggle:hover { color: var(--brand); }
.add-line { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 7px 28px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-weight: 600; }
.totals .grand { padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line); font-size: 17px; font-weight: 750; color: var(--ink); }
.totals .grand-l { padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line); color: var(--ink); font-weight: 650; align-self: end; }

/* ------------------------------------------------------- definition list */
.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 9px 14px; font-size: 12.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.dl-tight { gap: 6px 12px; }

/* -------------------------------------------------------- empty state */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-ico {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-50), var(--surface-3)); color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-100);
}
.empty h3 { font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 14px; font-size: 12.5px; }

/* -------------------------------------------------------------- alerts */
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; border: 1px solid transparent; font-size: 12.5px; }
.alert .i { margin-top: 1px; }
.alert b { font-weight: 650; }
.alert-info { background: var(--info-bg); color: var(--info-ink); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success-ink); border-color: color-mix(in srgb, var(--success) 18%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.alert-danger { background: var(--danger-bg); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }

/* -------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 32px); }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}
.toast .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast.success .ico { background: var(--success-bg); color: var(--success); }
.toast.error .ico { background: var(--danger-bg); color: var(--danger); }
.toast.warning .ico { background: var(--warning-bg); color: var(--warning); }
.toast.info .ico { background: var(--info-bg); color: var(--info); }
.toast .msg { flex: 1; padding-top: 3px; color: var(--ink-2); font-size: 12.5px; }
.toast .msg b { display: block; color: var(--ink); margin-bottom: 1px; }
.toast .x { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; }
.toast .x:hover { color: var(--ink); background: var(--surface-3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- modal */
.modal-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 16, 30, .45); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 10vh 16px 16px; overflow-y: auto; }
.modal {
  width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}
.modal-lg { max-width: 640px; }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.modal-h .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.modal-h .ico.danger { background: var(--danger-bg); color: var(--danger); }
.modal-h .ico.success { background: var(--success-bg); color: var(--success); }
.modal-h h3 { font-size: 15px; font-weight: 700; }
.modal-h p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.modal-b { padding: 12px 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- dropdown */
.dropdown { position: relative; display: inline-flex; }
.menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; min-width: 210px;
  padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg);
}
.menu.left { right: auto; left: 0; }
.menu.up { top: auto; bottom: calc(100% + 6px); }
.menu a, .menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--ink-2); font: 500 12.5px/1.3 var(--font); text-align: left; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--ink); }
.menu .i { color: var(--muted); }
.menu .danger, .menu .danger .i { color: var(--danger-ink); }
.menu .danger:hover { background: var(--danger-bg); }
.menu .sep { height: 1px; margin: 5px 4px; background: var(--line-2); }
.menu .menu-label { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); }

/* ------------------------------------------------------ command palette */
.palette { max-width: 620px; padding: 0; overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input .i { color: var(--faint); }
.palette-input input { flex: 1; height: 52px; border: 0; outline: none; background: transparent; color: var(--ink); font: 15px var(--font); }
.palette-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--faint); }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); cursor: pointer; }
.palette-item .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.palette-item .t { flex: 1; min-width: 0; }
.palette-item .t b { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .t span { display: block; color: var(--muted); font-size: 11.5px; }
.palette-item.hi { background: var(--brand-50); }
.palette-item.hi .ico { background: var(--brand); color: #fff; }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 11.5px; }

/* --------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 10px; border: 0; background: none;
  color: var(--muted); font: 600 12.5px var(--font); white-space: nowrap; cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); }
.tabs .on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand); }
.tabs .cnt { padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10.5px; line-height: 17px; }

/* ----------------------------------------------------------- timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -22px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.tl-dot.tone-success { border-color: var(--success); background: var(--success-bg); }
.tl-dot.tone-info { border-color: var(--brand); background: var(--brand-50); }
.tl-dot.tone-danger { border-color: var(--danger); background: var(--danger-bg); }
.tl-dot.tone-warning { border-color: var(--warning); background: var(--warning-bg); }
.tl-item .t { font-weight: 550; color: var(--ink); font-size: 12.5px; }
.tl-item .m { color: var(--muted); font-size: 11.5px; margin-top: 1px; }

/* -------------------------------------------------- invoice "paper" view */
.paper {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px 28px;
}
.paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, #3ab0f5, #0b6bd3 55%, #08478c); }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.paper-logo { height: 34px; width: auto; }
.paper-title { text-align: right; }
.paper-title .kind { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.paper-title .no { font-size: 22px; font-weight: 750; letter-spacing: -.3px; margin-top: 2px; }
.paper-title .dates { margin-top: 6px; color: var(--muted); font-size: 12px; }
.paper-title .dates b { color: var(--ink-2); font-weight: 600; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.party { padding: 14px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; line-height: 1.6; }
.party .role { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.party .name { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.party .ln { color: var(--ink-2); }
.party .ln span { color: var(--muted); }
.paper .table th { background: transparent; border-bottom: 1.5px solid var(--ink-2); color: var(--ink-2); }
.paper .table td { border-bottom-color: var(--line-2); }
.paper .table th:first-child, .paper .table td:first-child { padding-left: 4px; }
.paper .table th:last-child, .paper .table td:last-child { padding-right: 4px; }
.paper .table tbody tr:hover { background: transparent; }
.paper-foot { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin-top: 18px; align-items: start; }
.paper-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.stamp-cancel {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  padding: 8px 26px; border: 4px solid rgba(225, 29, 72, .55); border-radius: 12px;
  color: rgba(225, 29, 72, .6); font-size: 40px; font-weight: 800; letter-spacing: 6px; pointer-events: none;
}

/* ------------------------------------------------------------ charts */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart .bar { fill: url(#barGrad); transition: opacity .15s; }
.chart .bar-paid { fill: var(--success); opacity: .85; }
.chart .bar-bg { fill: var(--surface-3); }
.chart .bar:hover { opacity: .8; }
.chart .val { fill: var(--ink-2); font-size: 10.5px; font-weight: 600; font-family: var(--font); }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11.5px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d399, var(--success)); }
.progress.warn > span { background: linear-gradient(90deg, #fbbf24, var(--warning)); }

/* list rows (dashboard widgets) */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .grow span { display: block; font-size: 11.5px; color: var(--muted); }
.list .amt { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .amt span { display: block; font-size: 11px; font-weight: 500; }
.date-chip {
  width: 40px; flex: none; text-align: center; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
}
.date-chip .m { display: block; background: var(--brand); color: #fff; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 1px 0; }
.date-chip .d { display: block; font-size: 15px; font-weight: 750; padding: 2px 0 3px; color: var(--ink); }
.date-chip.late .m { background: var(--danger); }
.date-chip.soon .m { background: var(--warning); }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager .pages a:hover { border-color: #cbd3e1; color: var(--ink); }
.pager .pages .on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .pages .off { color: var(--faint); background: var(--surface-2); }

/* ---------------------------------------------------------- auth page */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; padding: 44px 52px; color: #dce7f7;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(70% 60% at 85% 10%, rgba(58, 176, 245, .35), transparent 60%),
    radial-gradient(60% 70% at 0% 100%, rgba(11, 107, 211, .45), transparent 60%),
    linear-gradient(160deg, #0b1426 0%, #0d1f3d 60%, #0a2a57 100%);
}
.auth-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(80% 80% at 50% 40%, #000, transparent);
}
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { color: #fff; font-size: 30px; font-weight: 750; letter-spacing: -.6px; line-height: 1.2; max-width: 460px; }
.auth-art p { color: #9fb2cf; font-size: 14px; max-width: 420px; margin-top: 12px; line-height: 1.6; }
.auth-feats { display: grid; gap: 12px; margin-top: 30px; }
.auth-feat { display: flex; align-items: center; gap: 12px; color: #c9d7ec; font-size: 13px; }
.auth-feat .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #8cc4ff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.auth-glass {
  margin-top: 30px; max-width: 380px; padding: 16px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); backdrop-filter: blur(6px);
}
.auth-glass .row-between span { color: #9fb2cf; font-size: 12px; }
.auth-glass .big { color: #fff; font-size: 24px; font-weight: 750; letter-spacing: -.4px; margin-top: 4px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 360px; }
.auth-box h1 { font-size: 22px; font-weight: 750; letter-spacing: -.3px; }
.auth-box .lead { color: var(--muted); margin-top: 6px; margin-bottom: 24px; }
.auth-box .field + .field { margin-top: 14px; }
.auth-logo { height: 30px; margin-bottom: 30px; }

/* ------------------------------------------------------------ misc */
.divider-label { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; margin: 18px 0 12px; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.info-tile { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.info-tile .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.stat-inline { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-inline > div span { display: block; color: var(--muted); font-size: 11.5px; }
.stat-inline > div b { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
/* calendar */
.cal { overflow: hidden; }
.cal.is-loading { opacity: .7; }
.cal-week { display: flex; flex-direction: column; max-height: 76vh; overflow-y: auto; }
.cal-head, .cal-body { display: grid; grid-template-columns: 58px repeat(5, minmax(0, 1fr)); }
.cal-head { position: sticky; top: 0; z-index: 6; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-dayhead { padding: 8px 6px; text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 600; border-left: 1px solid var(--line-2); }
.cal-dayhead b { display: block; margin: 2px auto 0; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; font-size: 15px; color: var(--ink); }
.cal-dayhead.today { color: var(--brand); }
.cal-dayhead.today b { background: var(--brand); color: #fff; }
.cal-gutter { font-size: 10.5px; color: var(--faint); text-align: right; padding-right: 8px; }
.cal-body { position: relative; }
.cal-hour-label { height: 56px; padding-top: 3px; }
.cal-col { position: relative; border-left: 1px solid var(--line-2); }
.cal-col.today { background: color-mix(in srgb, var(--brand) 3%, transparent); }
.cal-slot { height: 56px; border-bottom: 1px solid var(--line-2); }
.cal-slot:hover { background: var(--surface-2); }
.cal-event {
  position: absolute; left: 3px; right: 3px; padding: 3px 7px; border-radius: 7px; overflow: hidden;
  font-size: 11px; line-height: 1.3; color: var(--ink); border-left: 3px solid var(--brand);
  background: var(--brand-50); box-shadow: var(--shadow-xs); cursor: grab; z-index: 2;
}
.cal-event:hover { color: var(--ink); filter: brightness(.98); z-index: 3; }
.cal-event b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.cal-chip {
  display: block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); background: var(--brand-50);
  border-left: 3px solid var(--brand);
}
.cal-chip:hover { color: var(--ink); }
.t-maint { background: var(--violet-bg) !important; border-left-color: var(--violet) !important; }
.t-bill { background: var(--success-bg) !important; border-left-color: var(--success) !important; }
.t-exp { background: var(--warning-bg) !important; border-left-color: var(--warning) !important; }
.t-late { background: var(--danger-bg) !important; border-left-color: var(--danger) !important; }
.t-done { opacity: .55; text-decoration: line-through; }
.t-p-urgent { border-left-color: var(--danger) !important; }
.t-p-high { border-left-color: var(--warning) !important; }
.cal-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-month-head div { padding: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 112px; padding: 5px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-cell-n { color: var(--faint); }
.cal-cell-n { font-size: 12px; font-weight: 650; color: var(--ink-2); padding: 1px 3px; }
.cal-cell.today .cal-cell-n { display: inline-block; align-self: flex-start; background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 8px; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; border: 0; background: none; text-align: left; cursor: pointer; font-weight: 600; }
.cal-more:hover { color: var(--brand); }
@media (max-width: 720px) {
  .cal-head, .cal-body { grid-template-columns: 40px repeat(5, minmax(56px, 1fr)); }
  .cal-week { overflow-x: auto; }
  .cal-cell { min-height: 74px; }
  .cal-cell .cal-chip span:first-child { display: none; }
}

/* proces-verbal */
.check-group { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.check-line { display: flex; padding: 5px 0; border-bottom: 1px dashed var(--line-2); }
.check-line:last-child { border-bottom: 0; }

/* sarcini */
.timer { font-size: 34px; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line-2); cursor: pointer; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }
.comment { padding: 10px 16px; border-top: 1px solid var(--line-2); }
.comment .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }

.chip-toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 6px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2);
  font: 600 12.5px var(--font); cursor: pointer; transition: all .15s;
}
.chip-toggle:hover { border-color: #cbd3e1; }
.chip-toggle.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); box-shadow: 0 0 0 3px var(--brand-ring); }
.copyable { cursor: copy; border-bottom: 1px dashed var(--line); }
.copyable:hover { border-bottom-color: var(--brand); }
.upload-tile { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.upload-tile .preview { width: 96px; height: 56px; border-radius: 8px; background: var(--surface) center/contain no-repeat; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--faint); flex: none; }
.upload-tile .preview img { max-width: 90%; max-height: 90%; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-main-wide { grid-template-columns: minmax(0, 1fr); }
  .search-trigger { width: 230px; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 16, 30, .45); }
  .main { margin-left: 0; }
  .btn.burger { display: inline-flex; }
  .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 40px; }
  .search-trigger { width: 40px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .crumbs { display: none; }
  .kpis, .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid > [class*="col-"] { grid-column: span 12; }
  .page-head h1 { font-size: 18px; }
  .paper { padding: 22px 18px; }
  .parties, .paper-foot { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 110px minmax(0, 1fr); }
  .hide-sm { display: none !important; }
  .toolbar .search-input { max-width: none; }
  .client-cell .who b, .client-cell .who span { max-width: 128px !important; }
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
  .table th:first-child, .table td:first-child { padding-left: 12px; }
  .table .act { display: none; }
}

/* ------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .page-head .actions, .no-print, .toasts, .foot { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .paper { box-shadow: none; border: 0; }
}

/* ------------------------------------------------ fluxul lucrării */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 14px 10px; margin-bottom: 16px; }
.flow-step { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 4px 10px; }
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; top: 17px; left: calc(10px + 30px + 8px); right: -2px; height: 2px;
  background: var(--line); z-index: 0;
}
.flow-step.done:not(:last-child)::after { background: linear-gradient(90deg, var(--success), color-mix(in srgb, var(--success) 40%, var(--line))); }
.flow-ico {
  position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--surface-3); color: var(--faint); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.flow-step.done .flow-ico { background: var(--success); color: #fff; box-shadow: 0 0 0 1px var(--success); }
.flow-step.current .flow-ico { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-ring); }
.flow-body { position: relative; z-index: 1; min-width: 0; padding-top: 1px; background: var(--surface); padding-right: 6px; }
.flow-label { font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.flow-step.done .flow-label, .flow-step.current .flow-label { color: var(--ink); }
.flow-doc { display: block; font-weight: 650; font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-date { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
@media (max-width: 1100px) {
  .flow { grid-template-columns: 1fr; gap: 8px; }
  .flow-step:not(:last-child)::after { top: 34px; bottom: -10px; left: 24px; right: auto; width: 2px; height: auto; }
}
.flow-step.skipped .flow-ico { background: var(--surface-2); color: var(--faint); box-shadow: 0 0 0 1px var(--line-2); }
.flow-step.skipped:not(:last-child)::after { background: var(--line); }

/* ------------------------------------------------ vizualizator PDF */
.pv-body { margin: 0; height: 100vh; background: #3a3f47; overflow: hidden; }
.pv-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 5; height: 54px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; padding-top: env(safe-area-inset-top); background: #0b1426; color: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.pv-bar .t { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-bar .btn:not(.btn-primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.pv-bar .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .16); }
.pv-frame { position: fixed; inset: 54px 0 0 0; }
.pv-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pv-mobile { display: none; position: fixed; inset: 54px 0 0 0; padding: 48px 22px; text-align: center; background: linear-gradient(180deg, #0d1f3d, #0b1426); }
.pv-mobile .pv-big { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); }
.pv-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); }
@media (max-width: 760px), (pointer: coarse) {
  .pv-frame { display: none; }
  .pv-mobile { display: block; }
  .pv-bar .btn span { display: none; }
  .pv-bar .btn { width: 36px; padding: 0; }
}

/* ------------------------------------------------------------ telefon */
.tabbar { display: none; }
@media (max-width: 1024px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(15, 23, 42, .06);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%;
    border: 0; background: none; color: var(--muted); font: 600 10.5px var(--font); cursor: pointer;
  }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar .on { color: var(--brand); }
  .tabbar .tab-add { width: 50px; height: 50px; margin: 0 auto; border-radius: 16px; color: #fff; background: linear-gradient(140deg, #3b8cf0, #0b6bd3); box-shadow: 0 8px 20px rgba(11, 107, 211, .4); }
  .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .form-actions { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .foot { display: none; }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
  .sidebar { padding-top: env(safe-area-inset-top); }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 18px; }
  .kpi-foot { font-size: 11px; }
  .kpi-ico { display: none; }
  .page-head { margin-bottom: 14px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > .btn, .page-head .actions > form, .page-head .actions > a { flex: 1 1 auto; }
  .page-head .actions > form .btn { width: 100%; }
  .card-h { padding: 10px 14px; min-height: 44px; }
  .card-b { padding: 14px; }
  .form-section { padding: 16px 14px; }
  .input, .select { height: 42px; font-size: 16px; } /* 16px: iOS nu mai face zoom la atingere */
  .textarea { font-size: 16px; }
  .btn { height: 40px; }
  .btn-sm { height: 34px; }
  .segmented { width: 100%; }
  .segmented a, .segmented button { flex: 1; justify-content: center; height: 32px; }
  .toolbar { padding: 10px 12px; }
  .toolbar > .select, .toolbar > form { flex: 1 1 140px; }

  /* sarcini – butoanele cronometrului rămân la îndemână */
  .task-actions { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 6; background: var(--surface); }
  .timer { font-size: 40px; }
}
.task-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.task-quick .btn { height: 52px; flex-direction: column; gap: 3px; font-size: 11.5px; }
.gps-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--success-bg); color: var(--success-ink); font-size: 11.5px; font-weight: 600; }
.gps-chip:hover { color: var(--success-ink); text-decoration: underline; }
/* GPS pornire/oprire: doar pictograma; verde = pornire, roșu = oprire, gri tăiat = fără poziție */
.gps-ico { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid transparent; }
.gps-ico svg { width: 17px; height: 17px; }
.gps-ico.start { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.gps-ico.stop { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.gps-ico.start:hover, .gps-ico.stop:hover { transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.gps-ico.off { background: var(--surface-2); color: var(--faint); border-color: var(--line); }
.gps-ico.off::after { content: ""; position: absolute; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); box-shadow: 0 0 0 1.5px var(--surface-2); }
@media (max-width: 720px) { .m-order-1 { order: 1; } .m-order-2 { order: 2; } }

/* calendar – agendă */
.agenda-h { display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); font-weight: 650; font-size: 12.5px; text-transform: capitalize; }
.agenda-h.today { color: var(--brand); }
.agenda-h .cnt { font-size: 11px; color: var(--muted); }
.agenda-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid var(--line-2); border-left: 4px solid var(--brand); color: var(--ink); }
.agenda-item:hover { background: var(--surface-2); color: var(--ink); }
.agenda-time { width: 64px; flex: none; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.agenda-t { min-width: 0; }
.agenda-t b { display: block; font-weight: 600; }
.agenda-t span { display: block; font-size: 12px; color: var(--muted); }
.agenda-empty { padding: 10px 16px; color: var(--faint); font-size: 12px; border-bottom: 1px solid var(--line-2); }
/* ------------------------------------------- graficul de facturare al abonamentului */
.sched-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sched-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sched-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1.5px solid var(--line); background: var(--surface-2); }
.sched-year { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; margin-bottom: 10px; }
.sched-y { font-weight: 700; color: var(--muted); font-size: 12px; padding-top: 8px; }
.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.sched-grid.monthly { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.sched-cell { border-radius: 10px; padding: 7px 8px; min-height: 64px; border: 1.5px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sched-m { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.sched-doc { font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-assoc button { margin-top: 3px; border: 1px dashed var(--brand); background: var(--brand-50); color: var(--brand-600); border-radius: 6px; font-size: 10.5px; font-weight: 600; padding: 1px 5px; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; max-width: 100%; }
.s-paid { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.s-paid .sched-m, .s-paid .sched-doc { color: var(--success-ink); }
.s-invoiced { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.s-invoiced .sched-m, .s-invoiced .sched-doc { color: var(--brand-600); }
.s-draft { background: color-mix(in srgb, var(--violet) 12%, var(--surface)); border-color: color-mix(in srgb, var(--violet) 45%, transparent); border-style: dashed; }
.s-draft .sched-m, .s-draft .sched-doc { color: var(--violet); }
.s-missing { background: var(--danger-bg); border-color: var(--danger); }
.s-missing .sched-m, .s-missing .sched-doc { color: var(--danger-ink); }
.s-current { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
.s-current .sched-m { color: var(--warning-ink); }
.s-future { background: transparent; border-style: dashed; opacity: .75; }
.s-empty { background: transparent; opacity: .6; }
.sched-dot.s-paid, .sched-dot.s-invoiced, .sched-dot.s-draft, .sched-dot.s-missing, .sched-dot.s-current, .sched-dot.s-future { opacity: 1; }
@media (max-width: 1100px) { .sched-grid.monthly { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .sched-year { grid-template-columns: 1fr; gap: 4px; }
  .sched-y { padding-top: 0; }
  .sched-grid.monthly, .sched-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.sched-dot.s-future { border-style: dashed; border-color: var(--faint); background: transparent; }
@media (min-width: 1101px) { .sched-grid.monthly .sched-cell:first-child { grid-column-start: var(--m, 1); } }

/* ------------------------------------------------------- setări cu tab-uri */
.settings-top { margin: -4px 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-xs); }
.settings-title { display: flex; align-items: center; gap: 8px; padding: 12px 18px 2px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.settings-title .i { width: 15px; height: 15px; }
.settings-tabs { border-bottom: 0; padding: 0 10px; overflow-y: hidden; }
.settings-tabs .on::after { bottom: 0; }
.settings-tabs a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.swatch-input { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
/* e-mailuri trimise: deschis / nedeschis */
.ico-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.ico-dot.ok { background: var(--success-bg); color: var(--success); }
.ico-dot.wait { background: var(--surface-2); color: var(--faint); }

/* ------------------------------------------- KPI: mereu pe un singur rând */
.kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.kpi-top { min-width: 0; }
.kpi-label, .kpi-value, .kpi-foot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kpi-foot > * { flex: none; }
@media (max-width: 1280px) {
  .kpis { grid-template-columns: none; gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 19px; margin-top: 6px; }
  .kpi-ico { width: 26px; height: 26px; border-radius: 8px; }
  .kpi-ico .i { width: 15px; height: 15px; }
}
@media (max-width: 1024px) {
  .kpi-ico { display: none; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 11.5px; }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: none; grid-auto-columns: minmax(150px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px 14px; padding: 0 16px 4px; scroll-padding-inline: 16px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { scroll-snap-align: start; }
}

/* căsuța unei luni lipsă: se apasă pentru a crea factura */
.sched-make { all: unset; display: flex; flex-direction: column; gap: 1px; cursor: pointer; min-width: 0; }
.sched-cta { margin-top: 3px; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--danger-ink); opacity: .75; }
.s-missing:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 35%, transparent); }
.s-missing:hover .sched-cta { opacity: 1; text-decoration: underline; }
.sched-make:focus-visible { outline: 2px solid var(--danger); outline-offset: 3px; border-radius: 6px; }

/* Antetul paginii pe calculator: butoanele rămân mereu în dreapta, pe un rând, în aceeași ordine;
   dacă nu e loc, titlul se împarte pe mai multe rânduri – butoanele nu se mută sub el. */
@media (min-width: 721px) {
  .page-head { flex-wrap: nowrap; align-items: flex-start; }
  .page-head > :first-child { flex: 1 1 auto; min-width: 0; }
  .page-head h1 { overflow-wrap: anywhere; }
  .page-head .actions { flex: none; flex-wrap: nowrap; }
}

/* Două coloane (conținut + panou lateral) până la 1100 px, ca pe laptopurile de 1280 px panoul să nu coboare sub conținut. */
@media (max-width: 1280px) and (min-width: 1101px) {
  .g-main { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); }
  .g-main-wide { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); }
}

/* Tabele care încap mereu în pagină: coloana marcată „fill” (clientul) preia doar spațiul rămas și se
   scurtează cu „…”; celelalte coloane rămân întregi, pe un rând. */
.table.fit { font-size: 12.5px; }
.table.fit th, .table.fit td { padding: 8px 9px; white-space: nowrap; }
.table.fit th:first-child, .table.fit td:first-child { padding-left: 14px; }
.table.fit th:last-child, .table.fit td:last-child { padding-right: 12px; }
.table.fit th { font-size: 10.5px; }
.table.fit td.fill { width: 100%; max-width: 0; white-space: normal; }
.table.fit td.fill .client-cell, .table.fit td.fill .who { min-width: 0; }
.table.fit td.fill .who b, .table.fit td.fill .who span, .table.fit td.fill .truncate { display: block; max-width: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.fit .doc-no { font-size: 12.5px; }
.table.fit .badge { font-size: 11px; padding: 2px 8px; }
.table.fit .sub-line { font-size: 11px; }
@media (max-width: 1400px) {
  .table.fit th, .table.fit td { padding-left: 7px; padding-right: 7px; }
  .table.fit .avatar.sm { display: none; }
}
@media (max-width: 1024px) {
  /* telefon/tabletă: coloana Client primește lățime proprie, iar numele se rupe pe două rânduri */
  .table.fit td.fill { width: auto; max-width: none; min-width: 150px; }
  .table.fit td.fill .who b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
  .table.fit td.fill .who span { white-space: normal; }
}
@media (max-width: 720px) {
  .table.fit .only-sm .badge { display: inline-flex !important; }
  .table.fit td.fill { min-width: 140px; }
}
/* ------------------------------------------------ formulare compacte (instalări, service GSM, facturi SER) */
.form-compact .form-section { padding: 12px 16px 14px; }
.form-compact .form-section-title { margin-bottom: 8px; gap: 8px; }
.form-compact .form-section-title .step { display: none; }
.form-compact .form-section-title h3 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-compact .form-section-title p { font-size: 11.5px; }
.form-compact .form-grid { gap: 8px 10px; }
.form-compact .field { gap: 3px; }
.form-compact .label { font-size: 11.5px; font-weight: 550; color: var(--muted); }
.form-compact .input, .form-compact .select { height: 30px; padding: 0 9px; border-radius: 7px; }
.form-compact .select { padding-right: 26px; }
.form-compact .textarea { min-height: 30px; padding: 5px 9px; border-radius: 7px; line-height: 1.4; }
.form-compact .help { font-size: 11px; }
.lines-title { padding: 18px 18px 4px; }
.form-compact .lines-title { padding: 12px 16px 2px; margin-bottom: 4px; }
.form-compact .card-h { min-height: 40px; padding: 8px 14px; }
.form-compact .card-b { padding: 12px 14px; }
.form-compact .card-f { padding: 10px 14px; }
.form-compact .check.small { font-size: 12.5px; }
.form-compact .search-input .input { padding-left: 32px; }
.form-compact .stack { gap: 12px; }
@media (max-width: 720px) {
  .form-compact .input, .form-compact .select { height: 38px; font-size: 16px; }
  .form-compact .textarea { font-size: 16px; }
}

/* Registrul special: toate cele 7 coloane pe ecran, fără derulare orizontală */
.table.reg { table-layout: fixed; width: 100%; font-size: 12px; }
.table.reg th, .table.reg td { padding: 7px 8px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; line-height: 1.35; }
.table.reg th { font-size: 10px; letter-spacing: .3px; line-height: 1.25; vertical-align: bottom; }
.table.reg th:first-child, .table.reg td:first-child { padding-left: 12px; }
.table.reg th:last-child, .table.reg td:last-child { padding-right: 12px; }
.table.reg td.nowrap { white-space: nowrap; }
.table.reg td .tag { white-space: nowrap; font-size: 10.5px; padding: 2px 6px; }

/* ------------------------------------------------ șabloane de documente: editor, markeri, previzualizare */
.card.is-off, .sablon-list li.is-off { opacity: .62; }
.sablon-list li { align-items: center; }
.ed-lateral { position: sticky; top: calc(var(--top-h) + 14px); max-height: calc(100vh - var(--top-h) - 28px); overflow-y: auto; padding-right: 2px; align-self: start; }
.ed-bara { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: var(--top-h); z-index: 6; }
.ed-grup { display: flex; align-items: center; gap: 2px; padding-right: 10px; border-right: 1px solid var(--line-2); }
.ed-grup:last-child { border-right: 0; padding-right: 0; }
.ed-btn { min-width: 30px; height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink-2); font: 600 12.5px/1 var(--font); cursor: pointer; }
.ed-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.ed-btn.on { background: var(--brand-50); color: var(--brand); border-color: var(--brand-ring); }
.ed-btn.lat { padding: 0 9px; font-weight: 550; }
.ed-tabel { position: absolute; top: 36px; left: 0; z-index: 20; display: flex; align-items: flex-end; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg, 0 10px 30px rgba(15, 23, 42, .18)); }
.ed-tabel label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); }
.ed-tabel .input { width: 64px; }
.ed-fundal { background: color-mix(in srgb, var(--ink) 7%, var(--surface-2)); padding: 22px 14px; min-height: 60vh; }
.foaie-a4 {
  background: #fff; color: #1b2433; max-width: 794px; min-height: 1000px; margin: 0 auto; padding: 44px 52px 56px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12), 0 10px 30px rgba(15, 23, 42, .12); border-radius: 3px;
  font: 14px/1.55 var(--font); outline: none; overflow-wrap: anywhere;
}
.foaie-a4:focus { box-shadow: 0 0 0 3px var(--brand-ring), 0 10px 30px rgba(15, 23, 42, .12); }
.foaie-a4 h1 { font-size: 21px; margin: 4px 0 8px; line-height: 1.3; }
.foaie-a4 h2 { font-size: 17px; margin: 16px 0 5px; }
.foaie-a4 h3, .foaie-a4 h4 { font-size: 14.5px; margin: 14px 0 4px; }
.foaie-a4 p { margin: 0 0 8px; }
.foaie-a4 ul, .foaie-a4 ol { margin: 0 0 10px; padding-left: 24px; }
.foaie-a4 table { border-collapse: collapse; width: 100%; margin: 8px 0 10px; }
.foaie-a4 th, .foaie-a4 td { border: 1px solid #b9c2d0; padding: 4px 8px; vertical-align: top; text-align: left; min-width: 24px; }
.foaie-a4 th { background: #eef2f7; }
.foaie-a4 table.sig th, .foaie-a4 table.sig td, .foaie-a4 table.no-border th, .foaie-a4 table.no-border td { border: 1px dashed #d5dbe5; background: transparent; }
.foaie-a4 hr { border: 0; border-top: 1px solid #b9c2d0; margin: 10px 0; }
.foaie-a4 .page-break { border-top: 2px dashed #98a2b3; margin: 22px 0; height: 0; position: relative; }
.foaie-a4 .page-break::after { content: "pagină nouă"; position: absolute; right: 0; top: -9px; background: #fff; padding: 0 6px; font-size: 10px; color: #8591a5; }
.ed-cod { width: 100%; min-height: 70vh; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; line-height: 1.5; resize: vertical; }
.marker-panou { display: grid; gap: 12px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.marker-titlu { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.marker-lista { display: flex; flex-wrap: wrap; gap: 5px; }
.marker-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2); font: 600 11px/1 var(--font-mono, ui-monospace, monospace); cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.marker-chip:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.marker-chip.stat { cursor: default; background: var(--surface-2); }
.marker-chip.stat:hover { border-color: var(--line); color: var(--ink-2); background: var(--surface-2); }
.marker-chip.liber { background: #fff6c8; border-color: #e3c25a; color: #7a5b00; }
.ed-previz { position: fixed; inset: 0; z-index: 90; background: rgba(10, 16, 30, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 3vh 16px; }
.ed-previz-cutie { width: min(980px, 100%); height: 94vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.ed-previz-cap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ed-previz-corp { flex: 1; min-height: 0; background: #dfe5ee; }
.ed-previz-cadru { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 1100px) { .ed-lateral { position: static; max-height: none; overflow: visible; } .ed-bara { top: 0; } }
@media (max-width: 720px) { .foaie-a4 { padding: 24px 18px 30px; min-height: 600px; } .ed-fundal { padding: 12px 6px; } }

/* formularul unui document pe contract: câmpurile în stânga, previzualizarea vie în dreapta */
.doc-formular { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-formular .doc-previz { position: sticky; top: calc(var(--top-h) + 14px); height: calc(100vh - var(--top-h) - 28px); min-height: 520px; display: flex; flex-direction: column; background: #dfe5ee; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.doc-previz-cap { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.doc-previz iframe { flex: 1; width: 100%; border: 0; background: #dfe5ee; transition: opacity .15s; }
.doc-previz.se-incarca iframe { opacity: .55; }
.doc-lista { display: grid; gap: 10px; }
.doc-camp-auto { display: grid; grid-template-columns: 1fr; gap: 8px; }
details.doc-detalii > summary { cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
details.doc-detalii > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.doc-detalii[open] > summary::before { transform: rotate(90deg); }
@media (max-width: 1100px) { .doc-formular { grid-template-columns: 1fr; } .doc-formular .doc-previz { position: static; height: 80vh; } }

/* documentele de pe contract */
.menu-documente { min-width: 320px; max-height: 60vh; overflow-y: auto; right: 0; left: auto; }
.menu-titlu { padding: 8px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.menu-titlu:not(:first-child) { border-top: 1px solid var(--line-2); margin-top: 4px; }
.doc-titlu-lista { padding: 10px 16px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line-2); }
.doc-titlu-lista:first-of-type { border-top: 0; }
.list li.rand-nou { animation: rand-nou 2.4s ease-out 1; }
@keyframes rand-nou { 0% { background: var(--brand-50); } 100% { background: transparent; } }
.ed-card { overflow: visible; }
.ed-card .ed-bara { border-radius: var(--radius) var(--radius) 0 0; }
.ed-card .ed-fundal { border-radius: 0 0 var(--radius) var(--radius); }
.foaie-a4 h1, .foaie-a4 h2, .foaie-a4 h3, .foaie-a4 h4, .foaie-a4 p, .foaie-a4 li, .foaie-a4 td, .foaie-a4 th, .foaie-a4 b, .foaie-a4 span { color: inherit; }
.foaie-a4 h1, .foaie-a4 h2, .foaie-a4 h3, .foaie-a4 h4 { color: #1b2433; }
details.doc-detalii > summary { display: block; }
details.doc-detalii > summary::before { display: inline-block; margin-right: 6px; }

/* fereastra de scanare a etichetei */
body.modal-deschis { overflow: hidden; }
.sc-fond { position: fixed; inset: 0; z-index: 400; background: rgba(8, 14, 28, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sc-fereastra { width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.sc-cap { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.sc-cap h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex: 1; }
.sc-corp { padding: 14px 16px; overflow-y: auto; flex: 1; }
.sc-camera { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.sc-camera video { width: 100%; height: 100%; object-fit: cover; }
.sc-cadru { position: absolute; inset: 14% 8%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.sc-indiciu { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: #fff; font-size: 12px; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.sc-fara-camera { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; text-align: center; padding: 24px; font-size: 13px; }
.sc-jos { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 14px; }
.sc-declansator { width: 62px; height: 62px; border-radius: 50%; border: 4px solid var(--brand-100); background: var(--brand); box-shadow: 0 0 0 2px var(--brand); cursor: pointer; transition: transform .1s; }
.sc-declansator:active { transform: scale(.92); }
.sc-declansator:disabled { opacity: .4; }
.sc-coduri { justify-self: end; font-size: 12px; font-weight: 600; color: var(--success-ink); background: var(--success-bg); padding: 3px 9px; border-radius: 999px; }
.sc-citire { text-align: center; padding: 40px 10px; color: var(--muted); }
.sc-spinner { width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: sc-roteste .8s linear infinite; }
@keyframes sc-roteste { to { transform: rotate(360deg); } }
.sc-rez-cap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sc-rez-cap img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.sc-rez-cap small { color: var(--muted); display: block; }
.sc-doua { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-camp { display: block; margin-bottom: 10px; }
.sc-camp > span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.sc-similare { border: 1px solid var(--line); border-radius: 10px; margin: 4px 0 12px; overflow: hidden; }
.sc-similare h4 { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.sc-similar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.sc-similar input { accent-color: var(--brand); flex: none; }
.sc-similar .t { flex: 1; min-width: 0; font-size: 13px; }
.sc-similar small { display: block; color: var(--muted); font-size: 11.5px; }
.sc-similar strong { font-size: 12.5px; white-space: nowrap; }
.sc-cant { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.sc-cant button { width: 38px; height: 36px; border: 0; background: var(--surface-2); font-size: 18px; cursor: pointer; color: var(--ink-2); }
.sc-cant input { width: 60px; height: 36px; border: 0; text-align: center; font: inherit; font-weight: 650; background: var(--surface); color: var(--ink); }
.sc-subsol { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.sc-subsol .btn-primary { margin-left: auto; }
.sc-eroare { margin-bottom: 12px; }
.sc-info dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.sc-info dt { color: var(--muted); }
.sc-info dd { margin: 0; word-break: break-word; }
.sc-info pre { white-space: pre-wrap; font: inherit; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 8px; margin: 4px 0 0; }

@media (max-width: 720px) {
  .sc-fond { padding: 0; align-items: flex-end; }
  .sc-fereastra { max-width: none; max-height: 96dvh; border-radius: 16px 16px 0 0; }
}

@media (max-width: 760px) { .table-wrap.lines-wrap { overflow-x: auto; } }

/* preț de vânzare editabil direct din listă */
.pret-btn { border: 0; background: transparent; font: inherit; font-weight: 700; color: inherit; cursor: text; padding: 3px 6px; margin: -3px -6px; border-radius: 6px; border-bottom: 1px dashed var(--line); }
.pret-btn:hover { background: var(--brand-50); color: var(--brand); }

/* contract: alegerea devizelor */
.deviz-lista { border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow-y: auto; background: var(--surface); }
.deviz-rand { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.deviz-rand:last-child { border-bottom: 0; }
.deviz-rand:hover { background: var(--surface-2); }
.deviz-rand.on { background: var(--brand-50); }
.deviz-rand input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.deviz-rand .grow { flex: 1; min-width: 0; }

/* lista de șabloane care se deschide în interiorul cardului (fișa facturii), nu peste el */
.menu.menu-inline { position: static; min-width: 0; max-height: none; margin-top: 6px; box-shadow: none; background: var(--surface-2); }
.menu.menu-inline a { white-space: normal; text-align: left; justify-content: flex-start; }
.menu.menu-inline a .i { flex: none; }
.doc-alege { display: block; }
.doc-alege .btn-block { justify-content: center; }

/* factură: căutarea produselor din stoc în câmpul „Descriere” */
.sug-produse { position: fixed; z-index: 80; max-height: 320px; overflow-y: auto; margin: 0; }
.sug-produse .combo-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.sug-produse .sug-nume { flex: 1; min-width: 0; }
.sug-produse .sug-nume > span:first-child { display: block; white-space: normal; }
.sug-produse .sug-pret { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stoc-linie { display: block; margin-top: 3px; font-size: 11px; color: var(--success-ink); }
.stoc-linie.lipsa { color: var(--warning-ink); }

/* U.M. pe factură: fără săgeata listei, ca să se vadă toate cele 3 caractere; lista se deschide la apăsare */
.lines .c-unit .input::-webkit-calendar-picker-indicator { display: none !important; opacity: 0; width: 0; margin: 0; }
.lines .c-unit .input { padding-left: 4px; padding-right: 4px; }

/* ==========================================================================
   Sarcini – componentele standard ale aplicației (tabel, card, listă)
   ========================================================================== */
.table.sarcini .sarcina-titlu { display: block; color: var(--ink); font-weight: 600; font-size: 13px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.table.sarcini .sarcina-titlu:hover { color: var(--brand); }
.table.fit.sarcini td.fill .sub-line { white-space: normal; overflow-wrap: anywhere; }
.table.sarcini .sarcina-meta { margin-top: 5px; display: none; gap: 5px; flex-wrap: wrap; }
.table.sarcini tr.row-muted .sarcina-titlu { color: var(--muted); }
.list .grow b.txt-wrap { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.list li.is-done .grow b { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.text-pre { white-space: pre-line; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.timer-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.timer-btns form { flex: 1 1 120px; min-width: 0; }
.g-panou { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; }
/* materialele sarcinii: tabelul încape pe ecran, fără derulare laterală (lista de produse nu se taie) */
.table-wrap.mat-wrap { overflow: visible !important; }
.lines.mat { table-layout: fixed; }
.lines.mat .c-desc { min-width: 0; }
.lines.mat th.c-unit, .lines.mat td.c-unit { width: 66px; }
.lines.mat th.c-qty, .lines.mat td.c-qty { width: 78px; }
.lines.mat .c-qty .input { width: 100%; min-width: 0; box-sizing: border-box; }
.lines.mat th.c-del, .lines.mat td.c-del { width: 44px; }
@media (max-width: 720px) {
  .table.sarcini .sarcina-meta { display: flex !important; }
  .table.sarcini .sarcina-titlu { font-size: 14px; }
  .task-quick.only-sm { display: grid !important; }
  .lines.mat th:first-child, .lines.mat td:first-child { padding-left: 10px; }
  .lines.mat th:last-child, .lines.mat td:last-child { padding-right: 8px; }
  .lines.mat th.c-unit, .lines.mat td.c-unit { width: 54px; }
  .lines.mat th.c-qty, .lines.mat td.c-qty { width: 62px; }
  .lines.mat th.c-del, .lines.mat td.c-del { width: 38px; }
}

/* pe telefon și tabletă pagina nu se lărgește peste ecran: textele lungi se rup în cadru */
.main { min-width: 0; overflow-x: clip; }
.content { min-width: 0; }
.page-head > div { min-width: 0; }
.page-head h1 { overflow-wrap: anywhere; }
.grid > *, .stack > * { min-width: 0; }
.card { max-width: 100%; }
.dl dd, .list .grow span { overflow-wrap: anywhere; }

/* File picker: same surfaces, buttons and focus treatment as application forms. */
.file-picker { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.file-picker-body { display: flex; align-items: center; gap: 14px; padding: 18px; }
.file-picker-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.file-picker-copy { display: grid; gap: 5px; flex: 1; min-width: 0; }
.file-picker-copy b { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.file-picker-trigger { position: relative; flex: none; cursor: pointer; overflow: hidden; }
.file-picker-trigger input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker-trigger:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.file-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.site-document-list { display: grid; gap: 8px; }
.site-document { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); background: var(--surface); transition: border-color .15s, background .15s; }
.site-document span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.site-document > .i { flex: none; color: var(--brand); }
.site-document:hover { border-color: var(--brand); background: var(--brand-50); }
@media (max-width: 640px) {
  .file-picker-body { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .file-picker-copy { flex-basis: calc(100% - 56px); }
  .file-picker-trigger { width: 100%; }
  .file-picker-footer { align-items: stretch; flex-direction: column; padding: 14px; gap: 12px; }
}

/* Cartoane compacte, restrânse implicit, în stilul aplicației. */
.carton-restrans > summary { list-style: none; cursor: pointer; }
.carton-restrans > summary::-webkit-details-marker { display: none; }
.carton-restrans:not([open]) > summary { border-bottom: none; }
.titlu-carton { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.titlu-carton > span { overflow-wrap: anywhere; }
.sageata-carton { flex: none; color: var(--muted); transition: transform .15s; }
.carton-restrans[open] > summary .sageata-carton { transform: rotate(90deg); }
.carton-restrans > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; border-radius: var(--radius); }
.actiuni-sistem { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 2px; }
.actiuni-sistem > .btn { flex: none; white-space: nowrap; }
.carton-restrans > summary .tag { flex: none; }
@media (max-width: 480px) {
  .carton-restrans > summary { flex-wrap: wrap; }
  .carton-restrans > summary .tag { margin-left: 25px; }
}

/* Redenumirea se deschide discret din pictograma de lângă titlul punctului. */
.titlu-punct { display: flex; align-items: center; gap: 8px; }
.titlu-punct h1 { min-width: 0; overflow-wrap: anywhere; }
.titlu-punct .pictograma-redenumire { flex: none; width: 28px; height: 28px; color: var(--muted); }
.titlu-punct .pictograma-redenumire:hover { color: var(--brand); background: var(--brand-50); }
.redenumire-punct { max-width: 480px; }

/* Sistemele punctului sunt alăturate; revizia este sub denumire. */
.sisteme-punct { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding: 3px; }
.sisteme-punct > .card { margin-top: 0; min-width: 0; }
.sisteme-punct .card-h { min-height: 70px; }
.nume-sistem { display: grid; gap: 6px; }
.scadenta-sistem { display: block; font-size: 11px; font-weight: 450; color: var(--muted); }
@media (max-width: 640px) {
  .sisteme-punct { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(280px, 85%); overflow-x: auto; padding: 3px; scroll-snap-type: x proximity; }
  .sisteme-punct > .card { scroll-snap-align: start; }
}

/* Video și antiefracție pe primul rând; controlul accesului dedesubt. */
.verificari-sisteme .verificare-access { grid-column: 1; }

/* Filtrele pontajului, intervalul și selecția rămân pe același rând. */
.bara-filtre-pontaj { flex-wrap: nowrap; overflow-x: auto; gap: 8px; }
.bara-filtre-pontaj .search-input { flex: 1 0 150px; min-width: 150px; max-width: 210px; }
.bara-filtre-pontaj > .select { flex: 1 0 110px; min-width: 110px; width: 110px; max-width: 150px; text-overflow: ellipsis; }
.bara-filtre-pontaj > .filtru-punct { flex-basis: 140px; min-width: 140px; max-width: 180px; }
.bara-filtre-pontaj > .btn, .selectie-nefacturate { flex: none; white-space: nowrap; }
.interval-pontaj { display: flex; flex: none; align-items: center; gap: 6px; }
/* Datele goale ocupă numai spațiul pictogramei; alegerea datei extinde câmpul. */
.control-data-pontaj { position: relative; display: block; flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-xs); cursor: pointer; }
.control-data-pontaj.completata { width: 128px; }
.interval-pontaj .control-data-pontaj .input { width: 100%; min-width: 0; height: 32px; padding: 0 6px; font-size: 11.5px; border: none; box-shadow: none; background: transparent; border-radius: inherit; }
.control-data-pontaj:not(.completata) .input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.control-data-pontaj .pictograma-data { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.control-data-pontaj.completata .pictograma-data { display: none; }
.control-data-pontaj:hover { border-color: var(--brand); }
.control-data-pontaj:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.actiuni-pontaj .btn-group { flex: none; }

/* Formularul punctului de lucru ocupă lățimea cartonului lateral. */
.puncte-contract .form-grid > * { grid-column: 1 / -1; }
.puncte-contract .list .revizie-depasita { color: var(--danger-ink); }

/* Programarea sarcinii păstrează două câmpuri pe rând inclusiv pe telefon. */
.programare-sarcina { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.programare-sarcina > .col-6 { grid-column: span 1; min-width: 0; }
.programare-sarcina > .col-12 { grid-column: 1 / -1; }
.programare-sarcina .input, .programare-sarcina .select { min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 12px; }
.programare-sarcina input[type="datetime-local"]::-webkit-datetime-edit { padding: 0; }
.punct-sarcina .row-between { flex-wrap: wrap; gap: 8px; }
@media (max-width: 1024px) { .filtru-punct-sarcini { display: none; } }

/* Facturile încap pe telefon: număr, client și total, fără coloană goală pentru PDF. */
@media (max-width: 720px) {
  .table.facturi-compacte { table-layout: fixed; width: 100%; margin-inline: auto; }
  .table.facturi-compacte th, .table.facturi-compacte td { padding: 7px 6px; font-size: 12px; }
  .table.facturi-compacte th:first-child, .table.facturi-compacte td:first-child { padding-left: 9px; }
  .table.facturi-compacte th:first-child { width: 86px; }
  .table.facturi-compacte th:nth-child(6) { width: 102px; }
  .table.facturi-compacte td.fill { width: auto; min-width: 0; max-width: none; }
  .table.facturi-compacte .client-cell, .table.facturi-compacte .who { width: 100%; min-width: 0; }
  .table.facturi-compacte td.fill .who b { font-size: 11.5px; line-height: 1.3; }
  .table.facturi-compacte .doc-cell { display: flex; flex-wrap: wrap; gap: 4px; }
  .table.facturi-compacte .doc-no { font-size: 11.5px; }
  .table.facturi-compacte .ef-dot { width: 18px; height: 18px; }
  .table.facturi-compacte .ef-dot svg { width: 10px; height: 10px; }
  .table.facturi-compacte .only-sm .badge { max-width: 100% !important; padding: 2px 5px; font-size: 10px; white-space: normal; gap: 4px; line-height: 1.25; }
  .table.facturi-compacte .act, .table.facturi-compacte tfoot td:last-child { display: none; }
  .table.facturi-compacte tfoot td:first-child { white-space: normal; font-size: 11px; line-height: 1.3; }
  .table.facturi-compacte tfoot td:first-child .muted { display: block; font-size: 10px; }
}

/* Bara unică a listei Facturi: filtre compacte înaintea taburilor. */
.bara-facturi { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.bara-facturi > .search-input { flex: 0 1 190px; min-width: 120px; max-width: 210px; }
.bara-facturi > .perioada-facturi { flex: none; width: 130px; min-width: 0; }
.bara-facturi > .taburi-facturi { flex: 1 1 0; min-width: 60px; overflow-y: hidden; }
.bara-facturi .taburi-facturi a { flex: none; }
.bara-facturi > .btn { flex: none; }
.bara-facturi .input, .bara-facturi .select { height: 36px; font-size: 12px; }
.interval-facturi .control-data-pontaj.completata { width: 118px; }
@media (max-width: 720px) {
  .bara-facturi { padding: 10px; gap: 6px; }
  .bara-facturi > .search-input { flex: 0 1 96px; min-width: 78px; max-width: 110px; }
  .bara-facturi > .perioada-facturi { width: 88px; padding-left: 8px; padding-right: 24px; }
  .bara-facturi .search-input .input { padding-left: 29px; padding-right: 6px; }
  .bara-facturi .search-input > .i { left: 9px; }
  .bara-facturi > .taburi-facturi { min-width: 48px; }
  .bara-facturi .taburi-facturi a { padding: 5px 8px; font-size: 11px; }
  .bara-facturi > .btn-icon { width: 28px; height: 30px; }
}

.detalii-chitanta { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.detalii-chitanta .form-grid { gap: 10px; }
.detalii-chitanta .i { vertical-align: middle; }
@media (max-width: 720px) {
 .table.lista-chitante { table-layout: fixed; }
 .table.lista-chitante th:first-child { width: 88px; }
 .table.lista-chitante th:nth-child(4) { width: 92px; }
 .table.lista-chitante td.fill { min-width: 0; }
 .table.lista-chitante th, .table.lista-chitante td { padding: 8px 6px; font-size: 11.5px; }
 .table.lista-chitante .doc-no { font-size: 11.5px; }
 .detalii-chitanta .form-grid > .col-6 { grid-column: span 6; min-width: 0; }
 .detalii-chitanta .input, .detalii-chitanta .select { min-width: 0; font-size: 12px; }
}

@media (max-width: 720px) {
 .formular-chitanta .form-grid > .col-6 { grid-column: span 6; min-width: 0; }
 .formular-chitanta .input, .formular-chitanta .select { min-width: 0; font-size: 12px; }
}

/* Indicatorul tabului activ rămâne în bară, fără depășire verticală. */
.taburi-incasari { overflow-y: hidden; }
.taburi-incasari .on::after { bottom: 0; }

/* Coloane comune pentru toate punctele, indiferent de lungimea denumirii. */
.revizii-scadente { display: grid; gap: 16px; }
.revizie-scadenta { display: grid; grid-template-columns: minmax(0, 1fr) 120px 180px; align-items: center; gap: 20px; }
.revizie-scadenta > :first-child { min-width: 0; overflow-wrap: anywhere; }
.revizie-scadenta > :last-child { justify-self: end; }
.scadenta-reviziei { white-space: nowrap; }
@media (max-width: 620px) {
  .revizie-antet { display: none; }
  .revizie-scadenta { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .revizie-scadenta > :first-child { grid-column: 1 / -1; }
}
