:root {
    --bg: #f4f2ec;
    --card: #fffdf8;
    --fg: #1a1d1b;
    --muted: #66706a;
    --line: #e2ddd2;
    --line-strong: #cfc8b9;
    --side: #12241d;
    --side-fg: #cfe0d6;
    --accent: #0d6b4f;
    --accent-soft: #e2f1ea;
    --ok: #12734a;
    --ok-soft: #e3f3ea;
    --warn: #a15c07;
    --warn-soft: #fcf0d9;
    --bad: #b42318;
    --bad-soft: #fde8e6;
    --info: #1d5fbf;
    --info-soft: #e5eefb;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 "Inter", "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6rem; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
code { font: 12.5px ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.txt-bad { color: var(--bad); font-weight: 600; }
.txt-warn { color: var(--warn); font-weight: 600; }
.grow { flex: 1; }

/* ---------- layout */
#app { display: flex; min-height: 100vh; }
.side { width: 228px; flex: none; background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; padding: 16px 10px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand b { display: block; color: #fff; font-size: 14px; }
.brand small { display: block; color: #8fb3a2; font-size: 11.5px; line-height: 1.3; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2bb07f, #0d6b4f); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.brand-mark.big { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; margin-bottom: 18px; }
.side a { color: var(--side-fg); display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; margin: 1px 0; }
.side a i { font-style: normal; width: 18px; text-align: center; opacity: .7; }
.side a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.side a.active { background: rgba(43, 176, 127, .18); color: #fff; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.side-foot small { color: #8fb3a2; display: block; }
.side-foot .link { color: #8fb3a2; padding: 6px 0 0; }
.content { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px 14px; gap: 16px; position: sticky; top: 0; background: var(--bg); z-index: 5; border-bottom: 1px solid var(--line); }
.top-tools { display: flex; gap: 8px; align-items: center; }
main { padding: 20px 28px 60px; max-width: 1400px; }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- controls */
.btn { font: inherit; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg); border-radius: 8px; padding: 7px 13px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0a5a42; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: rgba(0, 0, 0, .04); }
.btn.danger:hover { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.icon-btn { border: 1px solid var(--line-strong); background: var(--card); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 17px; line-height: 1; color: var(--fg); }
.period-picker { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.period-picker .icon-btn { border: 0; }
.period-label { min-width: 120px; text-align: center; font-weight: 600; }
input, select, textarea { font: inherit; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--fg); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(13, 107, 79, .25); border-color: var(--accent); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span2 { grid-column: span 2; }
.search { max-width: 320px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.segs { display: inline-flex; background: #ebe7dd; border-radius: 9px; padding: 3px; gap: 2px; }
.seg { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--muted); }
a.seg:hover { text-decoration: none; }
.seg.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- cards & tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 0 8px; }
.card.flush .card-head { padding: 14px 18px 6px; }
.card.notice { background: var(--warn-soft); border-color: #f2d7a6; }
.card.error, .error { color: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two > .card { margin-bottom: 16px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.tile b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0; }
.tile span { color: var(--muted); font-size: 12px; }
.tile-ok::before { background: var(--ok); }
.tile-bad::before { background: var(--bad); }
.tile-bad b { color: var(--bad); }
.tile-warn::before { background: var(--warn); }
.tile-accent::before { background: var(--accent); }
.empty { color: var(--muted); padding: 28px; text-align: center; background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- tables */
table.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #faf8f3; position: sticky; top: 0; white-space: nowrap; }
table.grid td { padding: 8px 10px; font-size: 13.5px; border-bottom: 1px solid #efebe2; vertical-align: top; white-space: nowrap; }
table.grid td.wrap { white-space: normal; max-width: 420px; min-width: 160px; }
table.grid tbody tr:hover { background: #faf7f0; }
table.grid.clickable tbody tr { cursor: pointer; }
table.grid tfoot td { font-weight: 650; background: #faf8f3; border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; }
tr.row-bad td { background: #fff6f5; }
tr.row-new td:nth-child(2) b::after { content: " •"; color: var(--warn); }
.cell-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.risk { width: 8px; height: 8px; border-radius: 50%; flex: none; background: hsl(calc(140 - var(--r) * 1.4), 65%, 42%); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: #ece8de; color: #4c554f; }
.chip-own { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-muted { background: #ece8de; color: var(--muted); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; margin-right: 4px; }
.badge-bad { background: var(--bad); color: #fff; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.ok-mark { color: var(--ok); font-weight: 700; }

/* ---------- issues */
.issue-list { display: flex; flex-direction: column; gap: 8px; }
.issue { display: flex; gap: 14px; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 11px 14px; }
.issue.sev-high { border-left-color: var(--bad); }
.issue.sev-medium { border-left-color: var(--warn); }
.issue.sev-low { border-left-color: var(--info); }
.issue p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.issue-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.issue-client { font-weight: 600; }
.issue-actions { display: flex; gap: 6px; align-items: flex-start; flex: none; }
.issue-list.compact .issue { padding: 8px 12px; border-top: 0; border-right: 0; border-bottom: 1px solid #efebe2; border-radius: 0; }

/* ---------- client page */
.client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.client-head .btns { margin: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 11px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.bulk { display: flex; gap: 8px; align-items: center; background: var(--side); color: #fff; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; position: sticky; top: 64px; z-index: 4; }
.bulk-count { font-weight: 600; margin-right: 8px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #efebe2; }
.checklist li small { display: block; color: var(--muted); font-size: 12px; }
.checklist .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; margin-top: 1px; }
.checklist li.ok .mark { background: var(--ok); color: #fff; }
.checklist li.todo .mark { background: var(--warn-soft); color: var(--warn); }
.checklist li.ok > div > span { color: var(--muted); }
.progress { height: 8px; background: #ece8de; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #2bb07f, var(--accent)); }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.kind { text-align: left; font: inherit; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.kind:hover { border-color: var(--accent); }
.kind span { color: var(--muted); font-size: 12.5px; }
.kind em { color: var(--accent); font-style: normal; font-size: 12px; font-weight: 600; }
.source .card-head { padding-bottom: 2px; }
.ingest { background: #faf8f3; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px; margin-top: 8px; }
.ingest .row { display: flex; gap: 8px; margin-bottom: 6px; }
.ingest .row select { width: auto; }
.copybox { display: flex; gap: 8px; align-items: center; background: #f6f3ec; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 8px 0; }
.copybox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
pre.code { background: var(--side); color: #d6eadf; padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; }

/* ---------- kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kcol { background: #ece8de; border-radius: 12px; padding: 10px; min-height: 200px; }
.kcol h3 { display: flex; justify-content: space-between; padding: 4px 6px 8px; margin: 0; }
.kcol .count { background: var(--card); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.kcol-closed { background: #e2efe7; }
.kcol-review { background: #f5ead2; }
.kcard { display: block; background: var(--card); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; color: var(--fg); box-shadow: var(--shadow); border: 1px solid transparent; }
.kcard:hover { border-color: var(--accent); text-decoration: none; }
.kcard-title { font-weight: 650; margin-bottom: 6px; }
.kcard-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 20px; }
.kcard-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; }
.kcol .empty { background: transparent; border: 0; }

/* ---------- partner */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; }
.bar { background: #ece8de; height: 10px; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #b9b2a2; }
.bar i.own { background: var(--accent); }

/* ---------- modal & toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 25, 20, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--card); border-radius: 14px; width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--side); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; transition: .25s; z-index: 60; max-width: 420px; }
.toast.show { transform: none; opacity: 1; }
.toast-bad { background: var(--bad); }
.toast-warn { background: var(--warn); }

/* ---------- auth */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; width: 100%; }
.auth-pitch { background: var(--side); color: var(--side-fg); padding: 12vh 8vw; }
.auth-pitch h1 { color: #fff; font-size: 2.1rem; line-height: 1.15; margin-bottom: 14px; }
.auth-pitch p { font-size: 1.05rem; max-width: 34rem; }
.auth-pitch ul { padding-left: 18px; line-height: 1.9; color: #a9c8b9; }
.auth-box { align-self: center; justify-self: center; width: min(400px, 90%); padding: 26px; }
.auth-form .link { display: block; margin: 12px auto 0; }

/* ---------- client portal */
.portal { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.portal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.portal-req textarea { margin: 8px 0; }

@media (max-width: 1000px) {
    .two, .kanban { grid-template-columns: 1fr; }
    .side { display: none; }
    .auth { grid-template-columns: 1fr; }
    .auth-pitch { padding: 40px 24px; }
    main, .top { padding-left: 16px; padding-right: 16px; }
}

/* ---------- additions: ledger, bank, deadlines */
input.ledger { width: 90px; padding: 3px 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
input.ledger.suggested { border-style: dashed; border-color: var(--accent); }
input.ledger.suggested::placeholder { color: var(--accent); opacity: .8; }
.row-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-inline input[type=file] { width: auto; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field.check span { font-weight: 500; color: var(--fg); font-size: 13.5px; }
.dl-day { padding: 0; overflow: hidden; }
.dl-day .dl-date { display: flex; justify-content: space-between; padding: 10px 14px; background: #faf8f3; border-bottom: 1px solid var(--line); }
.dl-day.soon .dl-date { background: var(--bad-soft); }
.dl-day table.grid td { border-bottom: 1px solid #efebe2; }
.portal-section { margin-top: 26px; }

/* ---------- bevallások, megfelelés, bér, munkaidő */
.row-done td { color: var(--muted); }
.row-done td b, .row-done td a { color: inherit; }
.form-code { margin-left: 6px; font-size: 11.5px; background: #efebe1; border-radius: 5px; padding: 1px 5px; color: #4b544f; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 4px; }
.txt-ok { color: var(--ok); font-weight: 600; }
.card.notice.bad { background: var(--bad-soft); border-color: #f5c2bd; color: #7a1d14; }
.tile-link, .tile-link:hover { text-decoration: none; color: inherit; display: block; }
.tile-link .tile { height: 100%; }
.tile-link:hover .tile { border-color: var(--line-strong); }
select.inline { width: auto; min-width: 160px; }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }
.inline-row { display: flex; gap: 10px; align-items: center; }
.inline-row input[type=date] { flex: 1; }
.inline-row .check { display: flex; gap: 5px; align-items: center; white-space: nowrap; color: var(--muted); }
.form-grid h3 { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.form-grid h3:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.finding { padding: 3px 0; }
.portal-pay { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.portal-pay b.amount { font-size: 18px; }
.portal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portal-form .span2 { grid-column: span 2; }
@media (max-width: 700px) { .portal-form { grid-template-columns: 1fr; } .portal-form .span2 { grid-column: auto; } }

/* ---------- súgó panel (jobb oldali) */
.help-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(18, 36, 29, .35); }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--card); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(20, 30, 25, .14); animation: help-in .16s ease-out; }
@keyframes help-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.help-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.help-eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.help-title { margin: 0; font-size: 18px; }
.help-search { position: relative; display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.help-search-ic { position: absolute; left: 32px; color: var(--muted); font-size: 18px; pointer-events: none; }
.help-search input { height: 40px; padding: 0 36px 0 36px; font-size: 15px; }
.help-search input::-webkit-search-cancel-button { display: none; }
.help-clear { position: absolute; right: 28px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.help-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 30px; }
.help-scroll p, .help-section p { margin: 0 0 10px; }
.help-intro { font-weight: 600; }
details .help-intro { font-weight: 400; }
.help-scroll ul, .help-section ul { margin: 0 0 14px; padding-left: 20px; }
.help-scroll li, .help-section li { margin: 0 0 7px; }
.help-scroll details, .help-section details { border-bottom: 1px solid var(--line); }
.help-scroll summary, .help-section summary { padding: 10px 2px; font-weight: 600; cursor: pointer; }
.help-scroll details[open] summary, .help-section details[open] summary { color: var(--accent); }
.help-others { margin-top: 18px; border-top: 1px solid var(--line); }
.help-others h3 { margin: 14px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.help-more { padding-top: 4px; }
.help-count { color: var(--muted); font-size: 13px; }
.help-tag { display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; vertical-align: middle; }
mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.help-btn .help-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.kbd-btn { color: var(--muted); }
kbd { font: 11px ui-monospace, Consolas, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; margin-left: 6px; background: #fff; color: var(--muted); }
.side a.side-help { margin-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; border-radius: 0 0 8px 8px; }
.help-page-search { max-width: 640px; height: 42px; font-size: 15px; }
.help-section h2 { margin-bottom: 4px; }
.help-section dl.facts { margin: 6px 0 12px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.help-card { display: block; color: inherit; }
.help-card:hover { text-decoration: none; border-color: var(--accent); }
.help-card b { display: block; color: var(--accent); }
.help-card span { color: var(--muted); font-size: 13px; }
@media print { .help-panel, .help-overlay, .palette-wrap { display: none !important; } }

/* ---------- gyorskereső */
.palette-wrap { position: fixed; inset: 0; z-index: 95; background: rgba(18, 36, 29, .35); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: min(620px, 94vw); background: var(--card); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 18px; }
.palette-input input { border: 0; outline: 0; font-size: 16px; padding: 6px 0; box-shadow: none; }
.palette-input input:focus { outline: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette-group { padding: 8px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.palette-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.palette-item.on { background: var(--accent-soft); color: var(--accent); }
.palette-empty { padding: 16px; color: var(--muted); }
.palette-foot { padding: 8px 16px; border-top: 1px solid var(--line); }

/* ---------- Teendőim */
.work-group h2 { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.work-group h2 .count { background: var(--line); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.work-group h2 small { font-weight: 400; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.sev-high { background: var(--bad); } .dot.sev-medium { background: var(--warn); } .dot.sev-low { background: var(--info); }
.work-item { display: flex; gap: 14px; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.work-item.sev-high { border-left-color: var(--bad); } .work-item.sev-medium { border-left-color: var(--warn); } .work-item.sev-low { border-left-color: var(--info); }
.work-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.work-client { font-weight: 600; }
.work-title { display: block; color: var(--fg); font-weight: 600; margin: 2px 0; }
.work-actions { display: flex; gap: 6px; flex: none; }
.segs.wrap { flex-wrap: wrap; }

/* ---------- Első lépések, jegyzetek, sablonok */
.onboarding .bar { margin: 4px 0 12px; }
.onboarding .bar i.own { background: var(--accent); }
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px; }
ol.steps li { display: flex; gap: 10px; align-items: flex-start; }
ol.steps .step-check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; color: #fff; }
ol.steps li.done .step-check { background: var(--ok); border-color: var(--ok); }
ol.steps li.done b { color: var(--muted); text-decoration: line-through; }
.pinned-notes > div { margin-bottom: 4px; }
.timeline .note { margin-bottom: 10px; }
.note.pinned { border-color: #f2d7a6; background: #fffaf0; }
.note-head { display: flex; gap: 8px; align-items: center; }
.template-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.template-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-strong); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; background: #fff; }
.template-chip.own { border-color: var(--accent); background: var(--accent-soft); }
label.check { display: inline-flex; gap: 6px; align-items: center; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.bulk .btn.ghost { color: #cfe0d6; }

/* ---------------------------------------------------------------- Tudástár */
.kb-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 18px; align-items: end; }
.kb-hero h2 { font-size: 1.15rem; margin: 2px 0 6px; }
.kb-hero p { margin: 0; }
.kb-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin: 0; }
.kb-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px 10px; }
.kb-search:focus-within { outline: 2px solid rgba(13, 107, 79, .25); border-color: var(--accent); }
.kb-search input { border: 0; outline: 0; padding: 8px 0; }
.kb-section { margin: 22px 0 6px; }
.kb-section-head h2 { font-size: 1.05rem; margin-bottom: 2px; }
.kb-section-head p { margin: 0 0 10px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-card { display: flex; flex-direction: column; gap: 6px; color: var(--fg); margin: 0; }
.kb-card:hover { border-color: var(--accent); text-decoration: none; }
.kb-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.kb-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kb-card .kb-card-top { flex-direction: column-reverse; gap: 6px; }
.kb-card .kb-card-top b { font-size: 15px; }
.kb-results .kb-result { margin-bottom: 10px; }
.kb-hits { list-style: none; padding: 0; margin: 8px 0 0; }
.kb-hits li { border-top: 1px solid var(--line); padding: 7px 0; }
.kb-hits li p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
mark { background: #fbe7a1; color: inherit; border-radius: 2px; padding: 0 1px; }

.kb-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.kb-toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; font-size: 13px; padding-right: 4px; }
.kb-toc-title { font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: .05em; margin: 4px 0 6px; cursor: pointer; list-style: none; }
.kb-toc-title::-webkit-details-marker { display: none; }
@media (min-width: 901px) { .kb-toc > summary { pointer-events: none; } }
@media (max-width: 900px) { .kb-toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; } .kb-toc-title::after { content: " ▾"; } }
.kb-toc ol { list-style: none; padding: 0; margin: 0; }
.kb-toc li a { display: block; padding: 4px 8px; border-left: 2px solid transparent; color: var(--fg); border-radius: 0 6px 6px 0; }
.kb-toc li.lvl3 a { padding-left: 20px; color: var(--muted); font-size: 12.5px; }
.kb-toc li a:hover { background: rgba(0, 0, 0, .04); text-decoration: none; }
.kb-toc li a.on { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.kb-article { padding: 22px 30px 28px; max-width: 920px; line-height: 1.6; }
.kb-back { font-size: 13px; }
.kb-title { font-size: 1.6rem; margin: 6px 0 8px; }
.kb-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.kb-summary { font-size: 15px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.kb-block { scroll-margin-top: 80px; border-radius: 8px; transition: background .6s; }
.kb-block.flash { background: var(--accent-soft); }
.kb-block h2.kb-h { font-size: 1.2rem; margin: 26px 0 8px; padding-top: 6px; }
.kb-block h3.kb-h { font-size: 1.02rem; margin: 18px 0 6px; }
.kb-h .kb-anchor { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 6px; }
.kb-h:hover .kb-anchor, .kb-anchor:focus { opacity: 1; }
.kb-article p, .kb-article li { max-width: 78ch; }
.kb-article ul, .kb-article ol { padding-left: 22px; }
.kb-article li { margin: 3px 0; }
.kb-article code { background: #efece4; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.kb-note { background: var(--info-soft); border-left: 3px solid var(--info); padding: 9px 13px; border-radius: 0 8px 8px 0; margin: 10px 0; }
.kb-note.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.kb-table { margin: 8px 0 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.kb-table table.grid th { white-space: normal; position: static; }
.kb-table table.grid td { white-space: normal; line-height: 1.45; min-width: 90px; }
.kb-table table.grid tbody tr:last-child td { border-bottom: 0; }
.kb-sources, .kb-related { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 6px; font-size: 13.5px; }
.kb-sources h2, .kb-related h2 { font-size: 1rem; }
.help-kb h3 { margin-top: 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.help-kb-list { list-style: none; padding: 0; margin: 0; }
.help-kb-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.help-kb-list p { margin: 2px 0 0; }

/* ---------------------------------------------------------------- Adótervező */
.tools-intro p { margin: 0 0 4px; }
.tool-form { align-items: start; }
.tool-summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.tool-headline { font-size: 15px; font-weight: 600; margin: 2px 0 0; }
.tool-actions { display: flex; gap: 8px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.tool-option { margin: 0; }
.tool-option.best { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok), var(--shadow); }
.tool-option.na { opacity: .75; }
.tool-option h3 { margin: 0; }
.tool-total { font-size: 1.5rem; font-weight: 700; margin: 6px 0 10px; }
.tool-warn { background: var(--warn-soft); border-radius: 8px; padding: 8px 12px 8px 28px; font-size: 13px; margin: 10px 0; }
.tool-steps { margin: 8px 0; font-size: 13px; }
.tool-steps summary { cursor: pointer; color: var(--accent); }
.tool-steps ol { padding-left: 20px; }

/* ---------------------------------------------------------------- főkönyv, nyilvántartás */
.ledger-nav { margin-right: 6px; }
.export-opts { display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 8px; }
.row-inline input[type=month] { width: auto; }
.toolbar > .row-inline { flex-wrap: wrap; }
table.ledger-entries tbody { border-bottom: 2px solid var(--line); }
table.ledger-entries tr.entry-head td { background: #fbfaf6; border-bottom: 0; padding-top: 10px; }
table.ledger-entries tr.entry-line td { border-bottom: 0; padding-top: 3px; padding-bottom: 3px; font-size: 13px; }
table.ledger-entries tr.entry-line:last-child td { padding-bottom: 10px; }
table.ledger-entries code, table.tb code { font-size: 12.5px; }
table.grid tr.tb-class td { background: #f3f0e7; font-weight: 650; font-size: 12.5px; color: #3d453f; }
table.grid tr.tb-total td { border-top: 2px solid #d8d3c4; background: #faf8f2; }
table.grid tr.row-warn td { background: var(--warn-soft); }
.card .pad { padding: 10px 16px 14px; }
.card .pad p { margin: 4px 0; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: var(--accent-soft); }
table.manual-lines td { vertical-align: top; }
table.manual-lines input { width: 100%; min-width: 80px; }
table.manual-lines input.ledger { width: 100px; }
table.grid.cashbook td.num { min-width: 90px; }
.modal table.manual-lines { margin: 10px 0; }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; }
button.chip:hover { background: var(--accent-soft); color: var(--accent); }
h2.print-title { font-size: 1rem; margin: 0 0 10px; color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
    .kb-hero { grid-template-columns: 1fr; }
    .kb-layout { grid-template-columns: 1fr; }
    .kb-toc { position: static; max-height: none; }
    .kb-article { padding: 16px; }
}

@media print {
    .side, .top, .kb-toc, .kb-meta button, .kb-back, .kb-anchor, .toolbar, .tool-actions, .tools-intro a, form, .toast, .tabs, .client-head .btns, td.actions { display: none !important; }
    table.grid th { position: static; }
    table.grid td { white-space: normal; }
    body, html { background: #fff; }
    .content { margin: 0 !important; padding: 0 !important; }
    .kb-layout { display: block; }
    .card, .kb-article { box-shadow: none; border: 0; max-width: none; padding: 0; }
    .kb-block { break-inside: auto; }
    .kb-block h2.kb-h, .kb-block h3.kb-h { break-after: avoid; }
    .kb-table tr { break-inside: avoid; }
    .tool-steps { display: block; }
    .tool-steps[open] summary, .tool-steps summary { display: none; }
    a { color: inherit; }
}

/* főkönyv 3–4. ütem: folyószámla, tárgyi eszközök, árfolyamok, év vége */
.hidden { display: none !important; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 16px; align-items: start; }
.num-input { width: 9em; text-align: right; }
table.grid.inner { background: #fbfaf6; margin: 4px 0 6px; }
table.grid.inner th, table.grid.inner td { font-size: 12.5px; padding: 5px 8px; }
.checklist li.warn { color: #7a4a00; }
ol.year-steps { margin: 0 0 8px; padding-left: 20px; }
ol.year-steps li { margin: 8px 0; line-height: 1.9; }
ol.year-steps input { margin: 0 4px; }
table.stmt tr.lvl0 td { font-weight: 650; background: #f3f0e7; }
table.stmt tr.lvl1 td:nth-child(2) { padding-left: 18px; }
table.stmt tr.lvl2 td:nth-child(2) { padding-left: 36px; color: #3d453f; }
.split-modal .split-results { max-height: 220px; overflow: auto; margin: 6px 0 12px; }
.split-modal h4 { margin: 10px 0 4px; }
@media print { .no-print { display: none !important; } .grid2 { display: block; } }
.toolbar select, .toolbar input[type=date] { width: auto; }
.toolbar label.row-inline { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.split-modal .row-inline { display: flex; gap: 8px; }
.split-modal .row-inline input { flex: 1; }
.rate-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.rate-row input { width: auto; flex: 0 1 auto; }
.rate-row input[type=number] { width: 10em; }
.ref-tag { color: var(--accent); font-weight: 600; }
