/* Alocare Benefit — direcția „fintech calm”: alb-cald, verde-pin, cifre serif. */

@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Fraunces'; src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --surface-2: #F2F1EC;
  --ink: #1C1E21;
  --ink-2: #4A4E55;
  --muted: #62666E;
  --faint: #8B8F96;
  --line: #E6E4DF;
  --line-2: #EFEDE8;
  --accent: #2F5D50;
  --accent-strong: #1F433A;
  --accent-text: #1F433A;
  --accent-soft: #E3EEE9;
  --accent-ink: #FFFFFF;
  --hero-sub: #CFE3DA;
  --warn: #C2410C;
  --warn-soft: #FBF1DC;
  --warn-ink: #8A5A12;
  --danger: #B42318;
  --danger-soft: #FCEBE2;
  --danger-ink: #8A2E0A;
  --info-soft: #E8F0FA;
  --info-ink: #1E4A7A;
  --holiday: #9A3F17;
  --holiday-soft: #FBEBDF;
  --c-masa: #E07A3F;
  --c-cultura: #7C5CC4;
  --c-cadou: #C2477F;
  --c-pensie: #3170B8;
  --c-vacanta: #1E9A8A;
  --off-concediu: #3170B8;
  --off-medical: #B54A6B;
  --off-firma: #6B7380;
  --off-altul: #A0712B;
  --radius: 20px;
  --radius-sm: 12px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', Cantarell, system-ui, sans-serif;
}

/* Tema întunecată: automat după sistem, sau forțată din selectorul de temă. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141618;
    --surface: #1D2023;
    --surface-2: #262A2E;
    --ink: #ECEDEE;
    --ink-2: #C5C8CC;
    --muted: #A1A6AD;
    --faint: #7E838A;
    --line: #30353A;
    --line-2: #2A2E33;
    --accent: #6FB59E;
    --accent-strong: #234A3F;
    --accent-soft: #22332D;
    --accent-ink: #0F1A16;
    --hero-sub: #B6D3C7;
    --warn: #F28B4B;
    --warn-soft: #3A2E17;
    --warn-ink: #F3C77A;
    --danger: #F2806B;
    --danger-soft: #3A211B;
    --danger-ink: #F6B3A3;
    --info-soft: #1C2A3A;
    --info-ink: #A9C8EE;
    --holiday: #F0A27A;
    --holiday-soft: #3A2A20;
    --c-masa: #F08F57;
    --c-cultura: #9D82E0;
    --c-cadou: #DE6A9D;
    --c-pensie: #5B95D6;
    --c-vacanta: #3CB8A6;
    --off-concediu: #4C88CF;
    --off-medical: #CB6886;
    --off-firma: #7D8593;
    --off-altul: #BD8E45;
    --accent-text: #6FB59E;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141618;
  --surface: #1D2023;
  --surface-2: #262A2E;
  --ink: #ECEDEE;
  --ink-2: #C5C8CC;
  --muted: #A1A6AD;
  --faint: #7E838A;
  --line: #30353A;
  --line-2: #2A2E33;
  --accent: #6FB59E;
  --accent-strong: #234A3F;
  --accent-soft: #22332D;
  --accent-ink: #0F1A16;
  --hero-sub: #B6D3C7;
  --warn: #F28B4B;
  --warn-soft: #3A2E17;
  --warn-ink: #F3C77A;
  --danger: #F2806B;
  --danger-soft: #3A211B;
  --danger-ink: #F6B3A3;
  --info-soft: #1C2A3A;
  --info-ink: #A9C8EE;
  --holiday: #F0A27A;
  --holiday-soft: #3A2A20;
  --c-masa: #F08F57;
  --c-cultura: #9D82E0;
  --c-cadou: #DE6A9D;
  --c-pensie: #5B95D6;
  --c-vacanta: #3CB8A6;
  --off-concediu: #4C88CF;
  --off-medical: #CB6886;
  --off-firma: #7D8593;
  --off-altul: #BD8E45;
  --accent-text: #6FB59E;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
.icon { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1 1 auto; }
.danger-text { color: var(--danger) !important; }
.warn-text { color: var(--warn); font-weight: 600; }
.off-text { color: var(--off-concediu); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Structură ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 12px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); }
.theme-switch button { width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.topbar-end { display: flex; align-items: center; gap: 16px; }
.save-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.save-status .icon { color: var(--accent); }
.save-status[data-state="saving"] .icon { opacity: 0.3; }
.save-status[data-state="error"] { color: var(--danger); font-weight: 600; }
.save-status[data-state="error"] .icon { color: var(--danger); }

.main { max-width: 1240px; margin: 0 auto; padding: 32px 32px 80px; }
.page { display: flex; flex-direction: column; gap: 24px; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head > div:not(.legend) { display: flex; flex-direction: column; gap: 8px; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 44px; letter-spacing: -0.02em; line-height: 1.05; font-variation-settings: 'opsz' 96; }
.muted-title { color: var(--faint); }
h2 { font-size: 18px; font-weight: 600; }

.title-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 9px; }

/* ---------- Butoane, chipuri ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; border-color: var(--line); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link { background: none; border: 0; padding: 0 0 0 8px; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; font-weight: 500; }

.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip-sm { padding: 3px 9px; font-size: 12px; gap: 5px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-open { background: var(--accent); color: var(--accent-ink); }
.chip-closed { background: var(--surface-2); color: var(--ink-2); }
.chip-planned { border: 1px dashed var(--faint); color: var(--ink-2); }
.chip-planned .chip-dot { background: transparent; border: 1.5px solid currentColor; }
.chip-overdue { background: var(--warn-soft); color: var(--warn-ink); }

.tag { font-size: 12px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.tag-holiday { color: var(--holiday); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-masa, .bar-masa { background: var(--c-masa); fill: var(--c-masa); }
.dot-cultura, .bar-cultura { background: var(--c-cultura); fill: var(--c-cultura); }
.dot-cadou, .bar-cadou { background: var(--c-cadou); fill: var(--c-cadou); }
.dot-pensie, .bar-pensie { background: var(--c-pensie); fill: var(--c-pensie); }
.dot-vacanta, .bar-vacanta { background: var(--c-vacanta); fill: var(--c-vacanta); }
.dot-holiday { background: var(--holiday); }
.dot-undated { background: transparent; border: 2px dashed var(--off-concediu); }

/* ---------- Carduri ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head > div:not(.legend) { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Luna ---------- */
.month-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 20px; }
.month-title { display: flex; flex-direction: column; gap: 10px; }
.window-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 300px; }
.window-top { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.segs { display: flex; gap: 3px; }
.seg { flex: 1 1 0; height: 8px; border-radius: 3px; background: var(--line); }
.seg.done { background: var(--accent); }
.seg.now { background: var(--warn); }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; flex-wrap: wrap; }
.banner > div { flex: 1 1 300px; }
.banner-closed { background: var(--surface-2); color: var(--ink-2); }
.banner-warn { background: var(--warn-soft); color: var(--warn-ink); }
.banner-info { background: var(--info-soft); color: var(--info-ink); }

.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.hero-main, .hero-card { border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.hero-main { background: var(--accent-strong); color: #fff; }
.hero-card { background: var(--surface); border: 1px solid var(--line); }
.hero-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.hero-main .hero-label, .hero-main .hero-sub, .hero-main small { color: var(--hero-sub); }
.hero-value { font-family: var(--serif); font-size: 36px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums lining-nums; }
.hero-main .hero-value { font-size: 42px; }
.hero-value small { font-size: 0.5em; color: var(--muted); letter-spacing: 0; }
.hero-sub { font-size: 13px; color: var(--muted); }

.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .card { flex: 1 1 360px; }
.split > .card-wide { flex: 999 1 560px; }

.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat-accent { background: var(--accent-soft); }
.stat-accent strong, .stat-accent span { color: var(--accent-text); }

/* grila de zile */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mgrid-sm { gap: 3px; }
.dow { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.d {
  height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 0; padding: 0;
  font-size: 14px; font-variant-numeric: tabular-nums; background: transparent; color: var(--ink);
}
.mgrid-sm .d { height: 30px; border-radius: 7px; font-size: 12px; }
.mgrid-sm .dow { font-size: 11px; }
.d.work { background: var(--surface-2); }
.d.weekend { color: var(--faint); }
.d.holiday { background: var(--holiday-soft); color: var(--holiday); font-weight: 600; }
.d.off { color: #fff; font-weight: 600; }
.d.click { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.d.click:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.d.click:active { transform: scale(0.94); }
.d.today { box-shadow: inset 0 0 0 2px var(--ink); }
.off-concediu { background: var(--off-concediu); }
.off-medical { background: var(--off-medical); }
.off-firma { background: var(--off-firma); }
.off-altul { background: var(--off-altul); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex-shrink: 0; }
.sw-work { background: var(--surface-2); border: 1px solid var(--line); }
.sw-holiday { background: var(--holiday-soft); border: 1px solid var(--holiday); }
.sw-today { box-shadow: inset 0 0 0 2px var(--ink); }
.sw-line { height: 3px; border-radius: 2px; background: var(--ink); }

.list { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.list-title { font-size: 13px; font-weight: 600; }
.list-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.list-row .dot { width: 8px; height: 8px; }
.list-row.undated { color: var(--muted); font-size: 13px; }
.list-row.undated .dot { width: 10px; height: 10px; }

/* împărțire */
.ledger { display: flex; flex-direction: column; background: var(--bg); border-radius: 14px; padding: 6px 16px; }
.ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.ledger-row + .ledger-row { border-top: 1px solid var(--line-2); }
.ledger-row label { display: flex; flex-direction: column; }
.ledger-row small { font-size: 12px; color: var(--muted); }
.ledger-sum { font-weight: 600; }
.amount { font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); padding: 0 0 8px; }

.money-field { display: inline-flex; align-items: center; gap: 8px; }
.unit { font-size: 13px; color: var(--muted); white-space: nowrap; }
.num-input {
  width: 120px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px; text-align: right; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.num-input::placeholder { color: var(--faint); font-weight: 400; }
.num-input:hover:not(:disabled) { border-color: var(--faint); }
.num-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.num-input:disabled { background: var(--surface-2); color: var(--ink-2); }

.alloc-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.alloc-bar > span { transition: width 0.35s cubic-bezier(.2,.8,.2,1); }
.alloc-list { display: flex; flex-direction: column; }
.alloc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.alloc-row.empty .alloc-total { color: var(--faint); }
.alloc-info { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; }
.alloc-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tax { font-size: 12px; color: var(--muted); font-weight: 500; }
.tax-zero { color: var(--accent); font-weight: 600; }
.alloc-calc { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.alloc-note { font-size: 12px; font-weight: 600; color: var(--muted); }
.alloc-note.ok { color: var(--accent); }
.alloc-note.refund { color: var(--off-concediu); }
.alloc-note.warn { color: var(--warn); }
.alloc-total { min-width: 120px; text-align: right; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper-input.num-input { width: 64px; text-align: center; font-size: 20px; }

.rest { background: var(--bg); border-radius: 14px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rest-text { flex: 1 1 240px; font-size: 14px; }
.rest-text strong { font-variant-numeric: tabular-nums; }
.rest-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rest-foot { flex-basis: 100%; }
.chip-btn { min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.chip-btn:hover { background: var(--surface-2); }
.chip-cadou { border-color: var(--c-cadou); }
.chip-cultura { border-color: var(--c-cultura); }
.chip-pensie { border-color: var(--c-pensie); }
.chip-vacanta { border-color: var(--c-vacanta); }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14px; }
.callout .icon { margin-top: 1px; }
.callout-refund, .callout-info { background: var(--info-soft); color: var(--info-ink); }
.callout-danger { background: var(--danger-soft); color: var(--danger-ink); }

/* comanda */
.order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.order-box { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; font-variant-numeric: tabular-nums; }
.order-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.order-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.order-row > span:first-child { color: var(--muted); }
.order-total { font-size: 15px; border-top: 1px dashed var(--line); padding-top: 10px; }
.order-total > span { font-weight: 700; color: var(--ink) !important; }
.order-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; }
.tip { max-width: 420px; }

.check { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.check > span { display: flex; flex-direction: column; }
.check small { font-size: 13px; color: var(--muted); }

/* banda cu luni */
.strip-wrap { display: flex; flex-direction: column; gap: 12px; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.strip-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.strip-item:hover { border-color: var(--faint); }
.strip-name { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
.strip-sub { font-size: 12px; color: var(--muted); }
.strip-item.s-closed { background: var(--surface-2); color: var(--ink-2); }
.strip-item.s-open { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.strip-item.s-open .strip-sub { color: inherit; opacity: 0.85; }
.strip-item.s-planned { border-style: dashed; border-color: var(--faint); }
.strip-item.s-overdue { background: var(--warn-soft); border-color: var(--warn); }
.strip-item.current { box-shadow: 0 0 0 2px var(--ink); }

.notes { width: 100%; min-height: 80px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); padding: 12px 14px; resize: vertical; }
.notes:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Calendar ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.kpi-value { font-family: var(--serif); font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; order: -1; letter-spacing: -0.01em; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-holiday .kpi-value { color: var(--holiday); }
.kpi-off .kpi-value { color: var(--off-concediu); }
.kpi-accent { background: var(--accent-soft); border-color: transparent; }
.kpi-accent .kpi-value, .kpi-accent .kpi-label, .kpi-accent .kpi-sub { color: var(--accent-text); }

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.cal-month { padding: 16px; gap: 12px; border-radius: 18px; }
.cal-month.is-open { border: 2px solid var(--accent); }
.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal-name { font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none; }
.cal-name:hover { text-decoration: underline; }
.cal-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 10px; font-variant-numeric: tabular-nums; }
.cal-foot strong { color: var(--ink); }
.cal-note { font-size: 12px; color: var(--warn-ink); background: var(--warn-soft); border-radius: 8px; padding: 6px 8px; }
.holiday-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 24px; }
.holiday-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }

/* ---------- Anul ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.chart rect { rx: 3px; }
.avail-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.avail-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }

.table-wrap { overflow-x: auto; margin: 0 -8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table .num { text-align: right; }
.table tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line); }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--bg); }
.row-link a { color: var(--ink); font-weight: 600; text-decoration: none; }
.verified { color: var(--accent); font-weight: 700; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cat-box { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.cat-net { font-family: var(--serif); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Setări ---------- */
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.set-row + .set-row { border-top: 1px solid var(--line-2); padding-top: 12px; }
.set-row > div { display: flex; flex-direction: column; }
.set-label { font-weight: 500; }
.range-fields { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.range-fields .num-input { width: 72px; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.budget-grid .num-input { width: 100%; }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 22, 24, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade 0.15s ease; }
.dialog { background: var(--surface); border-radius: 22px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); animation: rise 0.18s cubic-bezier(.2,.8,.2,1); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input[type="text"], .field input[type="date"], .field input[type="password"], .field input[type="email"] { height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); padding: 0 12px; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-weight: 500; }
.seg-btn.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); font-weight: 600; }
.effect { background: var(--bg); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.effect-refund, .effect-ok { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.effect-refund { color: var(--off-concediu); }
.effect-ok { color: var(--accent); }
.effect .icon { margin-top: 2px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; z-index: 60; animation: rise 0.2s ease; }

.fatal { max-width: 560px; margin: 15vh auto; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.fatal code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast { animation-name: toast-rise; }
@keyframes toast-rise { from { opacity: 0; transform: translate(-50%, 8px); } }

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

@media (max-width: 640px) {
  .topbar-inner, .main { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 34px; }
  .window-card { min-width: 0; width: 100%; }
  .hero-main .hero-value { font-size: 34px; }
  .card { padding: 18px; }
  .alloc-total { min-width: 0; }
  .d { height: 38px; }
}

/* ---------- Bife „comandat” ---------- */
.head-side { display: flex; flex-direction: column; gap: 10px; min-width: 300px; }
.head-side .window-card { min-width: 0; }
.todo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.todo-card.all-done { background: var(--accent-soft); border-color: transparent; }
.todo-top { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; padding: 0 4px; }
.ok-text { color: var(--accent-text); font-weight: 600; }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.todo-item {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left; font-size: 14px;
}
.todo-item:hover { background: var(--surface-2); }
.todo-name { flex: 1 1 auto; font-weight: 600; }
.todo-sum { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.todo-box {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--faint); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--accent-ink); transition: background 0.15s ease, border-color 0.15s ease;
}
.todo-item.is-done .todo-box, .done-toggle.on .todo-box { background: var(--accent); border-color: var(--accent); }
.todo-item.is-done .todo-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.todo-item.is-done .dot { opacity: 0.4; }

.alloc-row.is-done > :not(.alloc-info), .alloc-row.is-done .alloc-calc, .alloc-row.is-done .alloc-name { opacity: 0.45; }
.alloc-row.is-done .alloc-name { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.alloc-row.priority .alloc-name::after { content: 'prioritar'; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--c-cadou); border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; }
.done-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.done-badge .link { font-size: 12px; }

.order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.done-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer;
}
.done-toggle:hover { border-color: var(--accent); }
.done-toggle.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.order-box.is-done { background: var(--surface-2); border-color: transparent; }
.order-box.is-done .order-row, .order-box.is-done .order-name { opacity: 0.5; }
.order-box.is-done .order-name { text-decoration: line-through; }
.done-when { font-size: 12px; color: var(--accent-text); font-weight: 600; margin-top: -4px; }
.callout-warn { background: var(--warn-soft); color: var(--warn-ink); }
.callout .btn { flex-shrink: 0; }
.priority-wrap { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 640px) { .head-side { min-width: 0; width: 100%; } }

/* ---------- Focus pe carduri: bifa pe rând, soldul compact ---------- */
.alloc-row { gap: 12px 18px; padding: 18px 0; }
.alloc-name { font-size: 17px; }
.alloc-total { font-size: 20px; }
.row-check {
  width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 12px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.row-check:hover { background: var(--surface-2); }
.row-check .todo-box { width: 26px; height: 26px; border-radius: 8px; }
.row-check.on .todo-box { background: var(--accent); border-color: var(--accent); }
.row-check-pad { width: 44px; flex-shrink: 0; }
.alloc-row.is-done > .row-check { opacity: 1; }

.ledger-compact { padding: 2px 12px; font-size: 13px; color: var(--muted); background: transparent; border: 1px solid var(--line-2); }
.ledger-compact .ledger-row { padding: 4px 0; }
.ledger-compact .ledger-sum { font-weight: 600; color: var(--ink-2); }
.ledger-compact .num-input { height: 34px; width: 104px; font-size: 13px; border-radius: 9px; }
.ledger-compact .unit, .ledger-compact small { font-size: 12px; }
.ledger-compact .hint { font-size: 12px; padding-bottom: 4px; }
.alloc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.alloc-foot p { flex: 1 1 260px; }

/* ---------- Sold live ---------- */
.balance { border-radius: 16px; background: var(--bg); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.balance.all-done { background: var(--accent-soft); }
.bal-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bal-label { display: flex; flex-direction: column; font-weight: 600; }
.bal-label small { font-weight: 400; font-size: 12px; color: var(--muted); }
.bal-value { font-family: var(--serif); font-size: 36px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.bal-value small { font-size: 0.5em; color: var(--muted); }
.bal-steps { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.bal-step { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.bal-step > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.bal-step.is-done { color: var(--accent-text); font-weight: 600; }
.bal-step.is-pending { color: var(--muted); }
.bal-total { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 8px; font-weight: 700; }
.todo-box.mini { width: 14px; height: 14px; border-radius: 4px; border-width: 1.5px; }
.balance .rest { background: var(--surface); }
.todo-balance { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 4px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.todo-balance strong { font-variant-numeric: tabular-nums; }

/* ---------- Luna: totul important sus ---------- */
.page-tight { gap: 16px; }
.month-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.month-bar h1 { font-size: 36px; }
.month-bar .icon-btn { width: 40px; height: 40px; }
.window-pill {
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.window-pill .segs { width: 150px; }
.window-pill .seg { height: 6px; border-radius: 2px; }
.split-top { margin-top: 4px; }
.split-top > .card { padding: 20px; gap: 14px; }
.split-top .stat { padding: 8px 12px; }
.split-top .stat strong { font-size: 22px; }
.split-top .d { height: 40px; }
.now-chip { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 14px; border-radius: 14px; background: var(--accent-strong); color: #fff; }
.now-chip span { font-size: 12px; color: var(--hero-sub); }
.now-chip strong { font-family: var(--serif); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; line-height: 1.1; }
.split-top .alloc-row { padding: 14px 0; }

.fold { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  font-weight: 600; font-size: 15px; color: var(--ink-2); border-radius: 16px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary .icon { transition: transform 0.15s ease; color: var(--muted); }
.fold[open] > summary .icon { transform: rotate(90deg); }
.fold-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.card .fold { border-color: var(--line-2); }
.card .fold > summary { min-height: 40px; font-size: 13px; padding: 0 12px; }
.card .fold-body { padding: 0 8px 8px; }
.card .fold .ledger-compact { border: 0; }
.grid-hint { margin-top: -4px; }

/* ---------- Istoric ---------- */
.paste { font-family: ui-monospace, 'SF Mono', monospace; font-size: 13px; }
.small-name { font-size: 14px; }
.table tr.month-first td { border-top: 1px solid var(--line); }
.order-lines { display: flex; flex-direction: column; }
.order-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; flex-wrap: wrap; }
