/* Budget – felület */
@font-face { font-family: 'Geist'; src: url('fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F4F5F2;
  --side: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --sunken: #F1F2EE;
  --line: #E3E5DF;
  --line-2: #ECEEE9;
  --field: #D9DCD5;
  --ink: #15171A;
  --ink-2: #3D434B;
  --muted: #5A616B;
  --faint: #8A9099;
  --inverse: #15171A;
  --on-inverse: #FFFFFF;
  --on-inverse-muted: #B9BEC6;
  --accent: #2F54D6;
  --accent-ink: #1E3A9E;
  --accent-soft: #EEF2FD;
  --accent-line: #D3DDFA;
  --pos: #0B7A5E;
  --pos-soft: #E3F3EC;
  --neg: #C2410C;
  --neg-soft: #FBE9DD;
  --warn-ink: #8A4507;
  --warn-soft: #FEF3C7;
  --warn-line: #F5DDAA;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --danger-line: #F3B7B0;
  --pos-line: #A8DCC6;
  --late-row: #FFF7F6;
  --shadow: 0 1px 2px rgba(16, 18, 20, .04), 0 4px 16px rgba(16, 18, 20, .04);
  --shadow-lg: 0 24px 48px rgba(16, 18, 20, .18);
  --r: 16px;
  --r-sm: 10px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; /* számokhoz: táblázatos számjegyek */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --side: #15171A; --surface: #1A1C20; --surface-2: #1E2025; --sunken: #23262B;
    --line: #2B2E34; --line-2: #262930; --field: #3A3E46; --ink: #EEF0F2; --ink-2: #C9CDD3; --muted: #9AA1AB; --faint: #747B85;
    --inverse: #EEF0F2; --on-inverse: #15171A; --on-inverse-muted: #4A5059;
    --accent: #8FA8FF; --accent-ink: #B9C8FF; --accent-soft: #1D2540; --accent-line: #2C3A66;
    --pos: #5FD0A8; --pos-soft: #14302A; --neg: #F59E6B; --neg-soft: #3A2318;
    --warn-ink: #F5C46B; --warn-soft: #33270F; --warn-line: #5A4416; --danger: #FF8A80; --danger-soft: #3A1A18; --danger-line: #6B2C27; --pos-line: #23584A; --late-row: #241615;
    --shadow: none; --shadow-lg: 0 24px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --side: #15171A; --surface: #1A1C20; --surface-2: #1E2025; --sunken: #23262B;
  --line: #2B2E34; --line-2: #262930; --field: #3A3E46; --ink: #EEF0F2; --ink-2: #C9CDD3; --muted: #9AA1AB; --faint: #747B85;
  --inverse: #EEF0F2; --on-inverse: #15171A; --on-inverse-muted: #4A5059;
  --accent: #8FA8FF; --accent-ink: #B9C8FF; --accent-soft: #1D2540; --accent-line: #2C3A66;
  --pos: #5FD0A8; --pos-soft: #14302A; --neg: #F59E6B; --neg-soft: #3A2318;
  --warn-ink: #F5C46B; --warn-soft: #33270F; --warn-line: #5A4416; --danger: #FF8A80; --danger-soft: #3A1A18; --danger-line: #6B2C27; --pos-line: #23584A; --late-row: #241615;
  --shadow: none; --shadow-lg: 0 24px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; letter-spacing: -0.01em; white-space: nowrap; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.sr, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.ic { flex-shrink: 0; }
[hidden] { display: none !important; }

/* ---------- Váz ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 256px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; color: var(--ink); text-decoration: none; }
.brand b { display: block; font-size: 16px; line-height: 1.1; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--inverse); color: var(--on-inverse); display: grid; place-items: center; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 44px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav:hover { background: var(--sunken); color: var(--ink); }
.nav.is-active { background: var(--inverse); color: var(--on-inverse); }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 20px 12px 6px; }
.side-foot .icon-btn { width: 34px; height: 36px; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; padding: 4px; border-radius: 8px; }
.me:hover { background: var(--sunken); color: var(--ink); }
.me-txt { min-width: 0; }
.me-txt b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { display: block; font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}

.main { flex: 1; min-width: 0; padding: 32px 40px 64px; display: flex; flex-direction: column; gap: 24px; max-width: 1280px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Gombok ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--field); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); color: var(--ink); }
.btn-primary { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.btn-primary:hover { opacity: .9; color: var(--on-inverse); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.month-nav { display: flex; align-items: center; height: 44px; border: 1px solid var(--field); border-radius: var(--r-sm); background: var(--surface); }
.month-nav a { width: 44px; height: 42px; display: grid; place-items: center; color: var(--ink-2); }
.month-nav span { font-size: 14px; font-weight: 600; padding: 0 4px; min-width: 76px; text-align: center; }
.lock-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12px; font-weight: 600; vertical-align: middle; margin-left: 10px; }

/* ---------- Kártyák ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 18px 20px 12px; }
.card-head h2, .card-pad > h2 { font-size: 16px; font-weight: 600; }
.card-head .hint, .hint { font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; }
.grid-main { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 1180px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }

.kpi { padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.kpi-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; letter-spacing: -0.03em; font-size: 28px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.kpi-value small { font-size: 14px; color: var(--muted); font-family: var(--font); letter-spacing: 0; }
.kpi-foot { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-dark { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.kpi-dark .kpi-label, .kpi-dark .kpi-foot, .kpi-dark .kpi-value small { color: var(--on-inverse-muted); }
.kpi-blue { background: var(--accent-soft); border-color: var(--accent-line); }
.kpi-blue .kpi-label { color: var(--accent); }
.quick-save { display: flex; gap: 6px; }
.quick-save input { flex: 1; min-width: 0; height: 36px; border-radius: 8px; border: 1px solid var(--accent-line); background: var(--surface); padding: 0 10px; font-family: var(--mono); font-size: 13px; }
.quick-save button { height: 36px; width: 40px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
:root[data-theme="dark"] .quick-save button { color: #111; }

.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; max-width: 100%; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.bar-top span:first-child { font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; opacity: .35; }
.bar > b { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }

.acct { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.acct:first-of-type { border-top: 0; }
.acct-badge { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; color: #fff; }
.acct-main { flex: 1; min-width: 0; }
.acct-main b { display: block; font-size: 14px; font-weight: 600; }
.acct-main small { font-size: 12px; color: var(--muted); }
.acct-val { font-size: 18px; font-weight: 600; text-align: right; }

.notice { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 13px; }
.notice > span { flex: 1; }
.notice a { font-weight: 600; }
.notice-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

/* ---------- Listák ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); min-width: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.row-main small { display: block; font-size: 12px; color: var(--muted); }
.row-amount { font-size: 15px; font-weight: 600; text-align: right; }
.row-icon { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0; }
.row-icon.in { background: var(--pos-soft); color: var(--pos); }
.row.is-click { cursor: pointer; }
.row.is-click:hover, .tbl tr.is-click:hover td { background: var(--surface-2); }
.dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.dot-lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex-shrink: 0; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .name b { font-weight: 600; display: block; }
.tbl .name small, .tbl .sub { display: block; font-size: 12px; color: var(--muted); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: var(--surface-2); }
.tag-rec { display: inline-flex; vertical-align: middle; color: var(--muted); margin-left: 4px; }

.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill { gap: 4px; }
.pill-done { background: var(--pos-soft); color: var(--pos); border-color: var(--pos-line); }
.pill-plan { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }
.pill-dark { background: var(--inverse); color: var(--on-inverse); }
.pill-income { background: var(--pos-soft); color: var(--pos); }
.pill-soon { background: var(--warn-soft); color: var(--warn-ink); }
.pill-ok { background: var(--pos-soft); color: var(--pos); }
.pill-late { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
button.pill-done:hover { background: var(--pos); color: #fff; }
button.pill-plan:hover, button.pill-late:hover { background: var(--pos-soft); color: var(--pos); border-color: var(--pos-line); filter: none; }

/* Kiadás állapota: összeg színe és sorjelölés */
.amt-done { color: var(--pos); }
.amt-plan { color: var(--warn-ink); }
.amt-late { color: var(--danger); }
.tbl tr.st-late td { background: var(--late-row); }
.tbl tr.st-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tbl tr.st-plan td:first-child { box-shadow: inset 3px 0 0 var(--warn-line); }
.tbl tr.st-done td:first-child { box-shadow: inset 3px 0 0 var(--pos-line); }
.progress-done > span { background: var(--pos); }
.chip svg { flex-shrink: 0; }
.chip-plan { color: var(--warn-ink); }
.chip-late { color: var(--danger); border-color: var(--danger-line); }
.chip-done { color: var(--pos); }
.chip.is-on.chip-plan { background: var(--warn-ink); border-color: var(--warn-ink); color: #fff; }
.chip.is-on.chip-late { background: var(--danger); border-color: var(--danger); color: #fff; }
.chip.is-on.chip-done { background: var(--pos); border-color: var(--pos); color: #fff; }
.kpi-dark .on-dark-plan { color: #F5C46B; }
.kpi-dark .on-dark-done { color: #7FD8B6; }
:root[data-theme="dark"] .kpi-dark .on-dark-plan { color: #8A4507; }
:root[data-theme="dark"] .kpi-dark .on-dark-done { color: #0B6B52; }
:root[data-theme="dark"] .chip.is-on.chip-plan, :root[data-theme="dark"] .chip.is-on.chip-late, :root[data-theme="dark"] .chip.is-on.chip-done { color: #111214; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kpi-dark .on-dark-plan { color: #8A4507; }
  :root:not([data-theme="light"]) .kpi-dark .on-dark-done { color: #0B6B52; }
  :root:not([data-theme="light"]) .chip.is-on.chip-plan, :root:not([data-theme="light"]) .chip.is-on.chip-late, :root:not([data-theme="light"]) .chip.is-on.chip-done { color: #111214; }
}
.pill-role { background: var(--sunken); color: var(--ink-2); }
.pill-admin { background: var(--inverse); color: var(--on-inverse); }
button.pill { cursor: pointer; font-family: var(--font); }
button.pill:hover { filter: brightness(1.08); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.chip:hover { color: var(--ink); border-color: var(--faint); }
.chip.is-on { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; border-radius: 4px; }
.th-sort:hover { color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-arrow { width: 10px; display: inline-block; opacity: .35; }
.th-arrow::after { content: '↕'; }
th.is-sorted .th-sort { color: var(--ink); }
th.is-sorted .th-arrow { opacity: 1; }
th.is-sorted .th-arrow::after { content: '↑'; }
th.is-sorted.is-desc .th-arrow::after { content: '↓'; }
.sortsel { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 12px; border-radius: 999px; border: 1px solid var(--field); color: var(--muted); background: var(--surface); }
.sortsel select { border: 0; outline: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink-2); height: 32px; padding-right: 6px; cursor: pointer; }
.sortsel:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); color: var(--muted); background: var(--surface); }
.search input { border: 0; outline: 0; background: transparent; width: 120px; font-size: 13px; color: var(--ink); }

.empty { padding: 32px 20px; text-align: center; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; }
.empty b { color: var(--ink); font-weight: 600; }

/* ---------- Űrlapok ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.field .help { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, .select, .textarea { height: 44px; width: 100%; border: 1px solid var(--field); border-radius: var(--r-sm); padding: 0 12px; font-size: 14px; font-weight: 500; background: var(--surface); color: var(--ink); }
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A616B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input-money { position: relative; }
.input-money .input { padding-right: 36px; font-family: var(--mono); }
.input-money::after { content: 'Ft'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--sunken); }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.seg .t-expense input:checked + span { color: var(--neg); }
.seg .t-income input:checked + span { color: var(--pos); }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chips input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chips input + span { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--field); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; background: var(--surface); }
.radio-chips input:checked + span { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.radio-chips input:focus-visible + span { outline: 2px solid var(--accent); }
.toggles { border: 1px solid var(--line-2); border-radius: 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 14px; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line-2); }
.toggle b { font-weight: 600; display: block; }
.toggle small { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--field); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 99px; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); }
:root[data-theme="dark"] .switch input:checked + span::after { background: #15171A; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch input { position: absolute; opacity: 0; }
.swatch span[aria-hidden] { display: block; width: 28px; height: 28px; border-radius: 8px; background: var(--c); cursor: pointer; border: 2px solid transparent; }
.swatch input:checked + span { border-color: var(--surface); box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Oldalpanel, párbeszéd ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.drawer-bg { position: absolute; inset: 0; background: rgba(21, 23, 26, .45); animation: fade .15s; }
.drawer-panel { position: relative; width: 100%; max-width: 480px; height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--line-2); }
.drawer-head h2 { font-size: 22px; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer-foot { display: flex; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--line-2); }
.drawer-foot .btn { height: 48px; flex: 1; }
.drawer-foot .btn-primary { flex: 2; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-panel { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; gap: 18px; animation: pop .15s ease-out; }
.modal-panel h2 { font-size: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
body.no-scroll { overflow: hidden; }

/* ---------- Üzenetek ---------- */
.flash { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); }
.flash-success { background: var(--pos-soft); border-color: transparent; color: var(--pos); }
.flash-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.flash-info { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.flash-x { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; color: inherit; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }

/* ---------- Fülek ---------- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; height: 44px; border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a:hover { color: var(--ink); }

/* ---------- Diagramok ---------- */
.timeline { display: grid; grid-template-columns: repeat(12, minmax(36px, 1fr)); gap: 6px; align-items: end; height: 150px; }
.timeline-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; gap: 6px; text-align: center; }
.timeline-col i { display: block; border-radius: 6px; background: var(--neg); opacity: .55; min-height: 4px; }
.timeline-col.is-now i { opacity: 1; }
.timeline-col.is-zero i { background: var(--line-2); opacity: 1; }
.timeline-col small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.timeline-col em { font-style: normal; font-size: 10px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }

.ychart { display: grid; grid-template-columns: repeat(12, minmax(44px, 1fr)); gap: 8px; align-items: end; height: 220px; }
.ychart-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; }
.ychart-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.ychart-bars i { width: 40%; max-width: 18px; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.ychart-bars .in { background: var(--pos); }
.ychart-bars .out { background: var(--neg); }
.ychart-col small { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.matrix { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); font-size: 13px; }
.matrix > span { padding: 10px 0; border-top: 1px solid var(--line-2); }
.matrix > span.h { font-weight: 600; border-top: 0; padding-top: 0; }
.matrix .c { text-align: center; }
.matrix .yes { color: var(--pos); font-weight: 700; }
.matrix .no { color: var(--faint); }

/* ---------- Bejelentkezés ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-form { flex: 1 1 420px; padding: 48px 24px; display: flex; align-items: center; justify-content: center; }
.auth-form form, .auth-form .auth-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h1 { font-size: 30px; letter-spacing: -0.03em; }
.auth-form p { margin: 0; color: var(--muted); }
.auth-art { flex: 1 1 520px; padding: 24px; display: flex; }
.auth-art-inner { flex: 1; border-radius: 24px; background: #15171A; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-art .k { font-size: 13px; font-weight: 600; color: #B9BEC6; letter-spacing: .08em; }
.auth-art .big { font-size: 22px; line-height: 1.4; font-weight: 500; max-width: 440px; margin: 0; }
.auth-art .mini { background: #fff; color: #15171A; border-radius: 16px; padding: 22px; max-width: 420px; }
.auth-art .mini small { color: #5A616B; font-size: 12px; font-weight: 600; }
.auth-art .mini .num { font-size: 32px; font-weight: 600; margin: 6px 0 14px; }
.auth-art .mini .progress { background: #ECEEE9; }
.auth-art .mini .progress > span { background: #15171A; }
@media (max-width: 900px) { .auth-art { display: none; } }

/* ---------- Mobil ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .side { display: none; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); gap: 18px; }
  .page-head h1 { font-size: 26px; }
  .head-actions { width: 100%; }
  .head-actions .btn span.lbl { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 8px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a.is-active { color: var(--ink); }
  .kpi-value { font-size: 21px; }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-kpi > .kpi { padding: 14px; gap: 6px; }
  .grid-kpi > .kpi-dark, .grid-kpi > .kpi-blue, .grid-kpi > .kpi:nth-child(3):not(:last-child) { grid-column: 1 / -1; }
  .grid-kpi > .kpi:only-child, .grid-kpi > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .head-actions .hide-m { display: none; }
  .month-nav { flex: 1; justify-content: space-between; }
  .card-head .chips { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .card-head .chips .sortsel, .card-head .chips .search { flex: 1 1 140px; min-width: 0; }
  .sortsel select { width: 100%; }
  .card-pad { padding: 18px; }
  .row { padding: 12px 16px; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 18px; padding-right: 18px; }

  /* táblázatok kártyaként */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tfoot { display: block; }
  .tbl.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl.stack td { display: block; padding: 0 !important; border: 0; }
  .tbl.stack td[data-m="main"] { grid-column: 1; grid-row: 1; }
  .tbl.stack td[data-m="amt"] { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  .tbl.stack td[data-m="sub"] { grid-column: 1; font-size: 12px; color: var(--muted); }
  .tbl.stack td[data-m="side"] { grid-column: 2; text-align: right; }
  .tbl.stack td[data-m="hide"] { display: none; }
  .tbl.stack tfoot tr { background: var(--surface-2); }
  .tbl.stack tr.st-late td { background: transparent; }
  .tbl.stack tr td:first-child { box-shadow: none; }
  .tbl.stack tr.st-late { background: var(--late-row); box-shadow: inset 3px 0 0 var(--danger); }
  .tbl.stack tr.st-plan { box-shadow: inset 3px 0 0 var(--warn-line); }
  .tbl.stack tr.st-done { box-shadow: inset 3px 0 0 var(--pos-line); }
  .fab { display: grid !important; }
}
/* ---------- Áttekintés: elosztás, lejártak, 14 nap ---------- */
.grid-flow { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }
.grid-flow.is-single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1180px) { .grid-flow { grid-template-columns: minmax(0, 1fr); } }
.flowbar { display: flex; gap: 3px; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.flowbar span { display: block; min-width: 4px; }
.fb-done { background: var(--pos); }
.fb-late { background: var(--danger); }
.fb-plan { background: var(--warn-line); }
.fb-free { background: var(--fb-free, #C9CED6); }
.flow-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.flow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.flow-legend b { color: var(--ink); font-weight: 600; }
.flow-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.fl-done i { background: var(--pos); } .fl-late i { background: var(--danger); } .fl-plan i { background: var(--warn-line); } .fl-free i { background: var(--fb-free, #C9CED6); }
.flow-legend .is-zero { opacity: .55; }
.late-box { margin-top: 18px; border-radius: 12px; background: var(--danger-soft); border: 1px solid var(--danger-line); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; color: var(--danger); }
.late-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.late-head .num { margin-left: auto; font-weight: 700; font-size: 16px; }
.late-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.late-btn { align-self: flex-start; margin-top: 6px; border-color: var(--danger-line); color: var(--danger); background: var(--surface); }
.late-btn:hover { border-color: var(--danger); color: var(--danger); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 6px; border-radius: 10px; font-size: 13px; }
.day small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.day b { font-weight: 600; font-variant-numeric: tabular-nums; }
.day.is-today { background: var(--inverse); color: var(--on-inverse); }
.day.is-today small { color: var(--on-inverse-muted); }
.day.has-due:not(.is-today) { background: var(--warn-soft); color: var(--warn-ink); }
.day-dots { display: flex; gap: 2px; height: 6px; margin-top: 3px; }
.day-dots i { width: 5px; height: 5px; border-radius: 9px; background: var(--warn-ink); display: block; }
.day.is-today .day-dots i { background: var(--on-inverse); }
.up-list { margin-top: 14px; display: flex; flex-direction: column; }
.up-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.up-date { color: var(--muted); font-size: 13px; width: 44px; flex-shrink: 0; }
.up-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-amt { font-weight: 600; color: var(--warn-ink); }

/* ---------- Mobil felső sáv, kompakt admin menüpont ---------- */
.mtop { display: none; }
.nav-admin-compact { display: none; }

/* ---------- Felületválasztó ---------- */
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt > span { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; height: 100%; }
.theme-opt > span > b { font-size: 14px; font-weight: 600; margin-top: 8px; }
.theme-opt > span > small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.theme-opt input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.theme-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp { display: grid; grid-template-columns: 28% 1fr; grid-template-rows: 1fr 1fr; gap: 5px; height: 76px; padding: 7px; border-radius: 9px; }
.tp b { display: block; border-radius: 4px; }
.tp b:first-child { grid-row: 1 / 3; }
.tp-classic { background: #F4F5F2; border: 1px solid #E3E5DF; } .tp-classic b { background: #fff; border: 1px solid #E3E5DF; } .tp-classic b:nth-child(2) { background: #15171A; border: 0; }
.tp-ejfel { background: #0B0F14; } .tp-ejfel b { background: #121821; border: 1px solid #232D3A; } .tp-ejfel b:nth-child(2) { background: linear-gradient(90deg, #C6F36B 40%, #121821 40%); border: 0; }
.tp-papir { background: #F6F2EA; border: 1px solid #CFC7B8; } .tp-papir b { background: transparent; border-top: 2px solid #1B1A17; border-radius: 0; } .tp-papir b:first-child { border: 0; background: repeating-linear-gradient(#1B1A17 0 2px, transparent 2px 9px); opacity: .5; } .tp-papir b:nth-child(2) { border-top-color: #B23A0B; }
.tp-bento { background: #ECEEF3; } .tp-bento b { background: #fff; border-radius: 8px; } .tp-bento b:first-child { background: #2140E8; } .tp-bento b:nth-child(3) { background: #FF8A3D; }
.tp-auto { background: repeating-linear-gradient(135deg, var(--sunken) 0 8px, var(--surface) 8px 16px); border: 1px dashed var(--field); } .tp-auto b { background: transparent; }

.fab { display: none; position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 41; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--inverse); color: var(--on-inverse); place-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.25); cursor: pointer; }

@media print {
  .side, .tabbar, .fab, .head-actions, .flash { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
}
:root[data-theme="dark"] { --fb-free: #4A505A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fb-free: #4A505A; } }

@media (max-width: 900px) {
  .mtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 -6px; }
  .mtop .brand { padding: 0; }
  .mtop-me { display: inline-flex; border-radius: 99px; text-decoration: none; }
}

/* ---------- Számlafigyelő (2.5) ---------- */
.inv-todo { display: flex; flex-direction: column; }
.inv-todo-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.6fr); gap: 16px 24px; padding: 16px 20px; border-top: 1px solid var(--line-2); align-items: start; }
.inv-todo-row:first-child { border-top: 0; }
.inv-todo-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inv-todo-what b { font-size: 15px; }
.inv-todo-what small { color: var(--ink-2); overflow-wrap: anywhere; }
.inv-todo-what .num { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.inv-todo-how { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.inv-new { display: flex; flex-direction: column; gap: 10px; }
.inv-new[hidden] { display: none; }
.inv-todo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-more { display: inline-block; position: relative; vertical-align: middle; }
.inv-more > summary { list-style: none; cursor: pointer; }
.inv-more > summary::-webkit-details-marker { display: none; }
.inv-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; gap: 6px; padding: 8px; min-width: 160px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.inv-menu form, .inv-menu .btn { width: 100%; }
.inv-log small { overflow-wrap: anywhere; }
.code-box { display: block; padding: 10px 12px; border-radius: 8px; background: var(--sunken); font-size: 12px; overflow-wrap: anywhere; font-weight: 500; user-select: all; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 760px) {
  .inv-todo-row { grid-template-columns: 1fr; padding: 14px 16px; }
}
