/* ===== Tütü számlák – megjelenés =====
   Semleges, meleg alap + egyetlen hangsúlyszín. Az adatszínek (bevétel/kiadás/eredmény/ÁFA)
   validált kategória-színek, mindenhol ugyanazt jelentik. */
:root {
  color-scheme: light;
  --page: #f4f4f1;  --surface: #fcfcfb;  --surface-2: #f4f4f1;
  --ink: #0b0b0b;   --ink-2: #52514e;    --muted: #898781;
  --line: #e1e0d9;  --line-2: #ecebe5;   --baseline: #c3c2b7;
  --accent: #256abf; --accent-soft: #e9f1fb;
  --btn: #0b0b0b; --btn-ink: #ffffff;
  --good: #006300; --bad: #d03b3b;
  --income: #2a78d6; --expense: #eb6834; --profit: #1baf7a; --vat: #6250d6;
  --seq-1:#86b6ef; --seq-2:#5598e7; --seq-3:#2a78d6; --seq-4:#256abf; --seq-5:#184f95; --seq-6:#0d366b;
  --shadow: 0 1px 2px rgba(11,11,11,.04), 0 6px 20px rgba(11,11,11,.05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;  --surface: #1a1a19;  --surface-2: #232321;
    --ink: #f0efec;   --ink-2: #c3c2b7;    --muted: #898781;
    --line: #2c2c2a;  --line-2: #242422;   --baseline: #383835;
    --accent: #6da7ec; --accent-soft: #1d2a3a;
    --btn: #f0efec; --btn-ink: #0b0b0b;
    --good: #0ca30c; --bad: #ec6b6b;
    --income: #3987e5; --expense: #d95926; --profit: #199e70; --vat: #9085e9;
    --seq-1:#184f95; --seq-2:#1c5cab; --seq-3:#256abf; --seq-4:#3987e5; --seq-5:#6da7ec; --seq-6:#9ec5f4;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin:0; background:var(--page); color:var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
h1 { font-size:1.65rem; letter-spacing:-.02em; margin:6px 0 18px; font-weight:700; }
h2 { font-size:1rem; margin:0 0 14px; font-weight:650; letter-spacing:-.005em; }
code { background:var(--surface-2); padding:1px 6px; border-radius:6px; font-size:.9em; }
main { max-width:1240px; margin:0 auto; padding:22px 20px 60px; }
.muted { color:var(--muted); font-size:.92em; }

/* --- fejléc --- */
.top { position:sticky; top:0; z-index:10; display:flex; flex-wrap:wrap; align-items:center; gap:10px 28px;
  padding:10px 24px; background:color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:-.01em; color:var(--ink); }
.brand:hover { text-decoration:none; }
.logo { width:28px; height:28px; border-radius:8px; display:grid; place-items:center; color:#fff; font-weight:800;
  background:linear-gradient(135deg, var(--income), var(--vat)); box-shadow:0 2px 8px rgba(98,80,214,.35); }
.top nav { display:flex; gap:4px; flex:1; overflow-x:auto; }
.top nav a { color:var(--ink-2); padding:6px 13px; border-radius:999px; font-weight:550; white-space:nowrap; }
.top nav a:hover { background:var(--surface-2); text-decoration:none; color:var(--ink); }
.top nav a.active { background:var(--accent-soft); color:var(--accent); }
.logout { display:flex; gap:12px; align-items:center; margin:0; }

/* --- kártyák, KPI --- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px 20px; margin-bottom:16px; box-shadow:var(--shadow); }
.cols { display:grid; grid-template-columns:repeat(auto-fit, minmax(440px,1fr)); gap:16px; }
.cols > .card { margin-bottom:0; } .cols { margin-bottom:16px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(225px,1fr)); gap:14px; margin-bottom:16px; }
.kpis .card { margin:0; padding:16px 18px; }
.kpi-label { display:flex; align-items:center; gap:8px; color:var(--ink-2); font-size:.85rem; font-weight:550; }
.dot { width:9px; height:9px; border-radius:50%; flex:none; }
.dot.income { background:var(--income); } .dot.expense { background:var(--expense); }
.dot.profit { background:var(--profit); } .dot.vat { background:var(--vat); } .dot.count { background:var(--baseline); }
.big { font-size:clamp(1.15rem, 1.9vw, 1.5rem); white-space:nowrap; font-weight:700; letter-spacing:-.02em; margin-top:6px; font-variant-numeric:tabular-nums; }
.kpis.small .big { font-size:1.2rem; }
.badge { display:inline-flex; align-items:center; gap:4px; font-size:.78rem; font-weight:650; margin-top:4px; }
.badge.up { color:var(--good); } .badge.down { color:var(--bad); }

/* --- szűrősáv --- */
.filterbar { display:flex; flex-direction:column; gap:12px; }
.frow { display:flex; flex-wrap:wrap; gap:12px 14px; align-items:flex-end; }
.frow label { display:flex; flex-direction:column; gap:4px; font-size:.78rem; color:var(--muted); font-weight:550; }
.frow .pair { display:flex; gap:6px; } .frow .pair input { width:9.6rem; }
.frow input[type=search], .frow input[type=text] { min-width:13rem; }
.frow.actions { align-items:center; gap:10px; }
details.more > summary { cursor:pointer; color:var(--accent); font-size:.88rem; font-weight:550; list-style:none; }
details.more > summary::-webkit-details-marker { display:none; }
details.more > summary::before { content:"▸ "; } details.more[open] > summary::before { content:"▾ "; }
details.more[open] > summary { margin-bottom:12px; }
input, select { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line);
  border-radius:9px; padding:8px 11px; transition:border-color .12s, box-shadow .12s; }
input:focus, select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
button, .btn { font:inherit; font-weight:600; cursor:pointer; display:inline-block; padding:8px 16px; border-radius:9px;
  background:var(--btn); color:var(--btn-ink); border:1px solid var(--btn); transition:opacity .12s, transform .05s; }
button:hover, .btn:hover { opacity:.88; text-decoration:none; } button:active, .btn:active { transform:translateY(1px); }
.btn.secondary { background:transparent; color:var(--ink); border-color:var(--line); }
.btn.secondary:hover { background:var(--surface-2); opacity:1; }
button.link { background:none; border:none; color:var(--accent); padding:0; font-weight:550; }

/* --- morzsasáv, eszköztár --- */
.crumbs { margin:2px 0 14px; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; color:var(--muted); }
.crumbs strong { color:var(--ink); } .crumbs a { font-weight:550; }
.toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; margin:4px 0 12px; }
.toolbar a.on { color:var(--ink); font-weight:700; }
.hint { font-weight:400; margin-left:10px; font-size:.8rem; color:var(--muted); }

/* --- diagram --- */
.chart { position:relative; height:340px; } .chart.sm { height:230px; } .chart.tall { height:370px; }
details.table-view { margin-top:12px; } details.table-view summary { cursor:pointer; color:var(--ink-2); font-size:.85rem; font-weight:550; }
details.table-view[open] summary { margin-bottom:10px; }

/* --- táblázat --- */
.scroll { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
th, td { padding:10px 12px; border-bottom:1px solid var(--line-2); text-align:left; vertical-align:middle; }
thead th, tr:first-child > th { color:var(--muted); font-weight:600; font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; }
tbody tr:hover td, table tr:hover > td { background:var(--surface-2); }
table tr:last-child > td { border-bottom:none; }
.r { text-align:right; white-space:nowrap; }
th.sortable a { color:var(--muted); white-space:nowrap; } th.sortable a:hover { color:var(--ink); text-decoration:none; }
th.sortable .arrow { color:var(--accent); }
.dir { display:inline-flex; align-items:center; gap:7px; }
.chip { display:inline-block; padding:1px 9px; border-radius:999px; background:var(--surface-2); color:var(--ink-2);
  border:1px solid var(--line); font-size:.74rem; font-weight:600; }
.chip.ok { background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.chip.error { color:var(--bad); border-color:var(--bad); background:transparent; }
.pager { display:flex; gap:18px; justify-content:center; align-items:center; margin-top:14px; }
.grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px,1fr)); gap:18px; }
.grid .muted { font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; font-weight:600; }

/* --- üzenetek, belépés --- */
.flash { padding:11px 15px; border-radius:10px; margin-bottom:14px; background:var(--surface); border:1px solid var(--line); }
.flash.error { border-color:var(--bad); color:var(--bad); }
.login-wrap { min-height:calc(100vh - 80px); display:grid; place-items:center; }
.login { width:100%; max-width:380px; padding:30px 28px; display:flex; flex-direction:column; gap:14px; margin:0; }
.login .brand { justify-content:center; margin-bottom:4px; } .login h1 { text-align:center; font-size:1.3rem; margin:0 0 6px; }
.login label { display:flex; flex-direction:column; gap:5px; font-size:.82rem; color:var(--muted); font-weight:550; }
.login button { padding:11px; margin-top:6px; }

@media (max-width:600px) {
  main { padding:14px 12px 40px; } .top { padding:10px 12px; } .cols { grid-template-columns:1fr; }
  .chart, .chart.tall { height:300px; } .frow .pair input { width:8.4rem; } h1 { font-size:1.4rem; }
}

/* --- bontás-kapcsoló --- */
.chart-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; margin-bottom:2px; }
.chart-head h2 { margin:0; }
.hint-line { margin:2px 0 10px; color:var(--muted); font-size:.82rem; }
.seg { display:inline-flex; align-items:center; gap:2px; padding:3px; background:var(--surface-2); border:1px solid var(--line); border-radius:11px; }
.seg-label { padding:0 10px 0 8px; font-size:.74rem; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.seg-btn { padding:5px 13px; border-radius:8px; color:var(--ink-2); font-size:.88rem; font-weight:600; white-space:nowrap; }
a.seg-btn:hover { background:var(--surface); text-decoration:none; color:var(--ink); }
.seg-btn.active { background:var(--surface); color:var(--ink); box-shadow:0 1px 3px rgba(11,11,11,.12), 0 0 0 1px var(--line); }
.seg-btn.disabled { opacity:.4; cursor:not-allowed; }
