/* Buget familie — un singur sistem vizual, temă luminoasă și întunecată.
   Tema se alege din html[data-appearance] (setat de partials/appearance). */

:root {
    color-scheme: light;
    --bg: #F3F4F6; --surface: #FFFFFF; --ink: #0B0D12; --sub: #5C6270; --faint: #8A909B;
    --line: #E4E6EB; --row: #EEF0F3; --field: #F7F8FA; --chip: #F1F2F4;
    --empty: #DDE0E5; --dash: #C9CDD4; --blank: #ECEDF0; --past: #E9EAED;
    --act-bg: #0B0D12; --act-fg: #FFFFFF; --nav-bg: #0B0D12; --nav-border: transparent; --nav-fg: #B8BDC7;
    --green: #15803D; --green-tint: #E7F6EC; --green-text: #166534; --green-cell: #14532D;
    --red: #D92D20; --red-tint: #FDE7E5; --red-text: #B42318; --red-cell: #9F1D14;
    --amber-bg: #FEF3C7; --amber-fg: #78350F; --over-cell: #FFFFFF;
    --today-cell: #FFFFFF; --today-cell-fg: #0B0D12;
    --shadow: 0 12px 30px rgba(11, 13, 18, .14);
    --accent: var(--ink); --accent-text: var(--sub);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-appearance="dark"] {
    color-scheme: dark;
    --bg: #000000; --surface: #141416; --ink: #F4F5F2; --sub: #A3A8A5; --faint: #7D827F;
    --line: rgba(255, 255, 255, .1); --row: rgba(255, 255, 255, .07); --field: #1F1F22; --chip: rgba(255, 255, 255, .08);
    --empty: rgba(255, 255, 255, .12); --dash: rgba(255, 255, 255, .2); --blank: rgba(255, 255, 255, .03); --past: rgba(255, 255, 255, .06);
    --act-bg: #F4F5F2; --act-fg: #000000; --nav-bg: rgba(28, 28, 30, .92); --nav-border: rgba(255, 255, 255, .1);
    --green: #15803D; --green-tint: rgba(34, 197, 94, .16); --green-text: #6EE7A0; --green-cell: #86EFAC;
    --red: #DC2626; --red-tint: rgba(239, 68, 68, .15); --red-text: #FF8A80; --red-cell: #FF9A9A;
    --amber-bg: rgba(245, 158, 11, .14); --amber-fg: #FCD34D; --over-cell: rgba(0, 0, 0, .35);
    --today-cell: rgba(255, 255, 255, .2); --today-cell-fg: #FFFFFF;
    --shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

.page-budget { --accent: var(--green); --accent-text: var(--green-text); }
.page-kitchen { --accent: var(--red); --accent-text: var(--red-text); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: var(--font); font-size: 15px; line-height: 1.4;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent, var(--green)); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- Structură ---------- */
.app {
    max-width: 560px; margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) 18px calc(118px + var(--safe-bottom));
    display: flex; flex-direction: column; gap: 22px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--sub); }

.top { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.top-actions { display: flex; gap: 8px; }

.icon-btn {
    width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-current="page"] { background: var(--act-bg); color: var(--act-fg); border-color: var(--act-bg); }
.icon-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
:root[data-appearance="dark"] .icon-moon, :root:not([data-appearance="dark"]) .icon-sun { display: none; }

.head-label { font-size: 15px; font-weight: 500; color: var(--sub); }
.head-label.is-accent { color: var(--accent-text); font-weight: 600; }
.h-big {
    margin: 0; font-family: var(--font-display); font-size: 54px; font-weight: 700;
    letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.h-big small { font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--sub); }
.h-big.is-bad { color: var(--red-text); }
.h-title { margin: 0; font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.h-section { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.link { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--accent-text); }

/* ---------- Navigare perioade ---------- */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-nav-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.period-nav-title strong { font-size: 16px; }
.period-nav-title span { font-size: 12px; font-weight: 600; color: var(--sub); }
.period-nav-title span.is-current { color: var(--accent-text); }

.strip { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 6px; }
.strip a {
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
    padding: 8px 0; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.strip a span { font-size: 11px; font-weight: 600; }
.strip a strong { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.strip a i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.strip a i.is-over { background: var(--red); }
.strip a i.is-current { background: var(--faint); }
.strip a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.strip a[aria-current="page"] i { background: #FFFFFF; }

.segments { display: flex; gap: 3px; height: 12px; align-items: center; }
.segments span { flex: 1; height: 6px; border-radius: 2px; background: var(--empty); }
.segments .is-filled { background: var(--accent); }
.segments .is-over { background: var(--red); }
.segments .is-pace { height: 12px; background: var(--ink); }

.banner { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 10px 12px; font-size: 13.5px; }
.banner svg { width: 16px; height: 16px; flex: 0 0 auto; }
.banner-warn { background: var(--amber-bg); color: var(--amber-fg); }
.banner-good { background: var(--green-tint); color: var(--green-text); }
.banner-bad { background: var(--red-tint); color: var(--red-text); }

.seg { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg > a, .seg > label > span {
    min-height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--sub); text-decoration: none; cursor: pointer;
}
.seg > label { display: block; }
.seg > label > input { position: absolute; opacity: 0; pointer-events: none; }
.seg > a[aria-current="page"], .seg > label > input:checked + span { background: var(--act-bg); color: var(--act-fg); }
.seg > label > input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg.is-field { background: var(--field); border-color: transparent; }
.seg.is-field > label > input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Grila buget (categorii × săptămâni) ---------- */
.bgrid { display: flex; flex-direction: column; gap: 8px; }
.bgrid-line { display: grid; grid-template-columns: 96px repeat(var(--cols, 5), minmax(0, 1fr)); gap: 6px; padding: 0 6px; align-items: stretch; }
.bgrid-head { padding-bottom: 2px; }
.bgrid-col { display: flex; flex-direction: column; align-items: center; color: var(--sub); }
.bgrid-col span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bgrid-col small { font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bgrid-col.is-current { color: var(--accent-text); }
.bgrid-row { padding: 6px; border-radius: 18px; }
.bgrid-row.is-over { background: var(--red-tint); }
.bgrid-name { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; }
.bgrid-name .name { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.bgrid-name .name .dot { margin-top: 3px; }
.bgrid-name .name > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bgrid-name small { font-size: 11px; font-weight: 600; color: var(--sub); font-variant-numeric: tabular-nums; }
.bgrid-row.is-over .name, .bgrid-row.is-over small { color: var(--red-text); }
.bgrid-row.is-plain .name { color: var(--sub); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--faint); }
.cell {
    min-height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--green-tint); color: var(--green-cell);
}
.cell.is-zero { background: var(--surface); color: var(--faint); font-weight: 500; }
.cell.is-current { background: var(--green); color: #FFFFFF; }
.cell.is-future { background: transparent; border: 1.5px dashed var(--dash); }
.bgrid-row.is-over .cell.is-past:not(.is-zero) { background: var(--over-cell); color: var(--red-text); }
.bgrid-row.is-plain .cell.is-past:not(.is-zero) { background: var(--surface); color: var(--sub); }
.bgrid.is-dense .cell { font-size: 10.5px; min-height: 40px; border-radius: 9px; }
.bgrid.is-dense .bgrid-line { gap: 4px; grid-template-columns: 84px repeat(var(--cols, 7), minmax(0, 1fr)); }
.bgrid-total { padding-top: 8px; border-top: 1px solid var(--line); }
.bgrid-total span { font-size: 12.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.bgrid-total span:first-child { text-align: left; }
.bgrid-total .is-current { color: var(--accent-text); }

/* ---------- Carduri, liste, chipuri ---------- */
.card { background: var(--surface); border-radius: 22px; padding: 18px 16px; }
.card-list { background: var(--surface); border-radius: 22px; padding: 4px 16px; }
.card-list > * + * { border-top: 1px solid var(--row); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; }
.list-row-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.list-row-main > :first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.list-row-main small { font-size: 12.5px; color: var(--sub); }
.list-row-end { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-row.is-done .list-row-main > :first-child { text-decoration: line-through; color: var(--faint); }
.list-row.is-done .list-row-end, .list-row.is-done small { color: var(--faint); }
.list-row small.is-late { color: var(--red-text); font-weight: 600; }
.check { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.empty-note { font-size: 14px; color: var(--sub); padding: 14px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
label.chip { cursor: pointer; }
label.chip input { position: absolute; opacity: 0; pointer-events: none; }
label.chip:has(input:checked) { background: var(--chip-on, var(--act-bg)); border-color: var(--chip-on, var(--act-bg)); color: var(--chip-on-fg, var(--act-fg)); }
label.chip:has(input:checked) .dot { background: currentColor !important; }
label.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
button.chip[aria-pressed="true"] { background: var(--act-bg); border-color: var(--act-bg); color: var(--act-fg); }
.chip.is-dashed { border-style: dashed; background: transparent; color: var(--accent-text); }

.tag { font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; white-space: nowrap; background: var(--chip); color: var(--sub); }
.tag-green { background: var(--green-tint); color: var(--green-text); }
.tag-red { background: var(--red-tint); color: var(--red-text); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; }
.input, .select, .field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .field select {
    width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--field);
    color: var(--ink); padding: 0 14px; font-size: 16px;
}
.select, .field select { appearance: none; -webkit-appearance: none; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238A909B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 11px; }
.input::placeholder, .field input::placeholder { color: var(--faint); }
.hint { font-size: 12.5px; color: var(--sub); margin: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }

.btn {
    min-height: 48px; padding: 0 18px; border: none; border-radius: 14px; background: var(--act-bg); color: var(--act-fg);
    font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; border-radius: 16px; font-size: 16px; }
.btn-accent { background: var(--accent); color: #FFFFFF; }
.btn-green { background: var(--green); color: #FFFFFF; }
.btn-red { background: var(--red); color: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--red-text); border: 1px solid var(--line); }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }

.switch { position: relative; flex: 0 0 auto; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--dash); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.amount-field { display: flex; align-items: baseline; gap: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--field); padding: 6px 14px; }
.amount-field input {
    flex: 1; min-width: 0; border: none; background: transparent; color: var(--ink); padding: 0;
    font-family: var(--font-display); font-size: 38px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.amount-field input:focus { outline: none; }
.amount-field:focus-within { border-color: var(--accent); }
.amount-field span { font-size: 18px; font-weight: 600; color: var(--sub); }
.amount-field input::-webkit-outer-spin-button, .amount-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-field input[type=number] { -moz-appearance: textfield; }

/* ---------- Mesaje ---------- */
.status, .alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.status { background: var(--green-tint); color: var(--green-text); }
.alert { background: var(--red-tint); color: var(--red-text); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Bara de jos ---------- */
.bottom-nav {
    position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + var(--safe-bottom)); width: min(524px, calc(100% - 36px));
    display: flex; align-items: center; gap: 8px; padding: 7px;
    background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 24px; box-shadow: var(--shadow);
}
.bottom-nav a:not(.fab), .bottom-nav button:not(.fab) {
    flex: 1; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 17px; color: var(--nav-fg); text-decoration: none; font-weight: 600; font-size: 14px;
}
.bottom-nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #FFFFFF; }
.bottom-nav svg { width: 20px; height: 20px; }
.fab {
    width: 58px; height: 50px; flex: 0 0 auto; border: none; border-radius: 17px; background: var(--accent);
    color: #FFFFFF; display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.page-settings .fab, .page-expenses .fab { background: var(--green); }
.fab svg { width: 22px; height: 22px; }

/* ---------- Foi de jos (dialog) ---------- */
dialog.sheet {
    border: none; padding: 0; margin: 0; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
    position: fixed; inset: auto 0 0 0; margin-inline: auto; border-radius: 24px 24px 0 0;
    background: var(--bg); color: var(--ink); overflow-y: auto;
}
dialog.sheet::backdrop { background: rgba(5, 6, 8, .55); }
.sheet-body { padding: 16px 18px calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--dash); margin: 0 auto -4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.sheet-sub { font-size: 13.5px; color: var(--sub); margin-top: 2px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (min-width: 640px) {
    dialog.sheet { inset: 0; margin: auto; width: min(480px, 92vw); border-radius: 24px; max-height: 86vh; }
}

/* ---------- Bucătărie ---------- */
.kgrid { display: flex; flex-direction: column; gap: 8px; }
.kgrid-line { display: grid; grid-template-columns: 44px repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 6px; }
.kgrid-head span { font-size: 11px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.kgrid-row { padding: 6px; border-radius: 18px; }
.kgrid-row.is-today { background: var(--red); }
.kgrid-day { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); }
.kgrid-day span { font-size: 11px; font-weight: 700; }
.kgrid-day strong { font-family: var(--font-display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kgrid-row.is-past .kgrid-day { color: var(--faint); }
.kgrid-row.is-today .kgrid-day { color: #FFFFFF; }
.kslot { min-height: 58px; display: flex; flex-direction: column; gap: 4px; }
.kmeal {
    flex: 1; border: none; border-radius: 12px; background: var(--red-tint); color: var(--red-cell);
    padding: 8px; font-size: 12.5px; font-weight: 600; line-height: 1.25; text-align: left;
    display: flex; align-items: flex-end; overflow-wrap: anywhere;
}
.kgrid-row.is-past .kmeal { background: var(--past); color: var(--sub); }
.kgrid-row.is-today .kmeal { background: var(--today-cell); color: var(--today-cell-fg); }
.kadd {
    flex: 1; border-radius: 12px; border: 1.5px dashed var(--dash); background: transparent; color: var(--faint);
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.kadd svg { width: 14px; height: 14px; }
.kgrid-row.is-today .kadd { border-color: rgba(255, 255, 255, .6); color: #FFFFFF; }
.kblank { flex: 1; border-radius: 12px; background: var(--blank); color: var(--faint); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.kgrid-extra { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.kgrid-extra .kmeal { flex: 0 0 auto; min-height: 32px; align-items: center; }
.fill { display: flex; gap: 3px; }
.fill span { flex: 1; height: 6px; border-radius: 2px; background: var(--empty); }
.fill .is-on { background: var(--accent); }
.fill.is-past .is-on { background: var(--sub); }

.ingredient-row { display: flex; flex-direction: column; gap: 8px; }
.ingredient-main { display: flex; gap: 8px; }
.ingredient-main .input { flex: 1; min-width: 0; }
.ingredient-amount { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--accent-text); }
details.disclosure[open] > summary::after { content: "−"; }

/* ---------- Setări ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.tabs a { min-height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 2px; font-size: 12.5px; letter-spacing: -.01em; white-space: nowrap; font-weight: 700; color: var(--sub); text-decoration: none; }
.tabs a i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.tabs a.t-budget i { background: var(--green); opacity: 1; }
.tabs a.t-kitchen i { background: var(--red); opacity: 1; }
.tabs a[aria-current="page"] { background: var(--act-bg); color: var(--act-fg); }
.theme-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-pick button { border: 2px solid var(--line); border-radius: 18px; background: transparent; color: var(--ink); padding: 8px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.theme-pick button[aria-pressed="true"] { border-color: var(--green); }
.theme-pick .pv { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 12px; }
.theme-pick .pv b { height: 22px; border-radius: 7px; background: #15803D; }
.theme-pick .pv span { display: flex; gap: 4px; }
.theme-pick .pv span i { flex: 1; height: 14px; border-radius: 4px; }
.theme-pick .pv-light { background: #F3F4F6; } .theme-pick .pv-light i { background: #FFFFFF; } .theme-pick .pv-light i:last-child { background: #D92D20; }
.theme-pick .pv-dark { background: #0D0F10; } .theme-pick .pv-dark i { background: #1E2123; } .theme-pick .pv-dark i:last-child { background: #DC2626; }
.theme-pick strong { font-size: 14px; padding: 0 4px; }
.theme-pick small { font-size: 12.5px; color: var(--sub); padding: 0 4px 4px; margin-top: -8px; }
.invite { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--field); border: 1px dashed var(--line); border-radius: 16px; padding: 12px 14px; }
.invite strong { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.avatar { width: 40px; height: 40px; border-radius: 13px; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.cat-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 0; }
.cat-row .cat-name { flex: 1; font-weight: 600; min-width: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cat-row select { width: auto; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); padding: 0 8px; font-size: 13px; }
.cat-row input.cat-amount { width: 84px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); text-align: right; padding: 0 8px; font-weight: 700; font-size: 15px; }
.swatch { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; border: none; padding: 0; overflow: hidden; cursor: pointer; background: none; }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: none; border-radius: 10px; }
.swatch::-moz-color-swatch { border: none; border-radius: 10px; }

/* ---------- Tranzacții ---------- */
.tx-day { font-size: 12.5px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 -6px 2px; }
.tx-actions { display: flex; gap: 6px; }
.tx-actions .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
.tx-actions .icon-btn svg { width: 16px; height: 16px; }

/* ---------- Autentificare ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-card .card { display: flex; flex-direction: column; gap: 14px; }

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

/* Câmpul mare de sumă nu preia chenarul câmpurilor obișnuite. */
.field .amount-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]) { min-height: 0; border: none; border-radius: 0; background: transparent; padding: 0; font-size: 38px; }

/* Numele categoriei din Setări e un buton care deschide editarea. */
.cat-edit { border: none; background: none; color: var(--ink); padding: 6px 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--dash); text-underline-offset: 4px; }
.cat-edit:hover { text-decoration-color: currentColor; }
.cat-row { gap: 8px; }
.cat-row .cat-edit { font-size: 14.5px; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.cat-row select { padding: 0 4px; font-size: 13px; }
.cat-row input.cat-amount { width: 70px; }

/* Temă întunecată pe negru (OLED): foile de jos și bara de navigare se ridică puțin deasupra fundalului. */
:root[data-appearance="dark"] dialog.sheet { background: #141416; border-top: 1px solid var(--line); }
:root[data-appearance="dark"] dialog.sheet .chip,
:root[data-appearance="dark"] dialog.sheet .icon-btn { background: var(--field); }
:root[data-appearance="dark"] dialog.sheet .card-list,
:root[data-appearance="dark"] dialog.sheet .card { background: var(--field); }
:root[data-appearance="dark"] .bottom-nav { -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

/* Login / cont nou: butonul devine albastru când formularul e completat corect. */
.btn-auth { background: var(--empty); color: var(--sub); transition: background .2s, color .2s; }
/* Culorile iconiței: turcoaz → albastru (închise suficient pentru text alb lizibil). */
.auth form:valid .btn-auth { background: linear-gradient(135deg, #0B7896, #1D63D6); color: #FFFFFF; box-shadow: 0 6px 16px rgba(29, 99, 214, .28); }
.auth form:valid .btn-auth:active { background: linear-gradient(135deg, #09647D, #1852B3); }
.auth input:focus-visible { outline-color: #1D63D6; }
