/* Modern theme (data-skin="paper") over billentyu.css: "Billentyű on paper". Every document is a sheet of paper on
   a desk, the system's warnings are red tabs, scheduled and sent ones graphite tabs, primary keys are graphite.
   Light tokens sit under :not([data-bs-theme=dark]) so the Életút dark neutrals of invoicer.css still win in dark mode.
   Tokens from the "Billentyu Paper App" design. */

/* ---------- Tokens */
:root[data-skin=paper] {
    --iv-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    --bs-font-monospace: var(--iv-mono);
}
:root[data-skin=paper]:not([data-bs-theme=dark]) {
    --iv-app: oklch(0.945 0.005 85);
    --iv-surface: oklch(0.945 0.005 85);
    --iv-raised: oklch(0.995 0.002 95);
    --iv-field: oklch(0.995 0.002 95);
    --iv-line: oklch(0.88 0.004 90);
    --iv-line-soft: oklch(0.92 0.004 90);
    --iv-ink3: oklch(0.4 0.008 90);
    --iv-ink4: oklch(0.5 0.006 90);
    --iv-mute-bg: oklch(0.95 0.004 90);

    --iv-ok-fg: oklch(0.46 0.12 150); --iv-ok-solid: oklch(0.46 0.12 150);
    --iv-bad-fg: oklch(0.5 0.18 28); --iv-bad-bg: oklch(0.95 0.03 28);
    --iv-bad-solid: oklch(0.52 0.18 28); --iv-bad-solid-ink: oklch(0.99 0.005 30);

    --iv-accent: oklch(0.27 0.01 80);
    --iv-accent-skirt: oklch(0.12 0.01 80);
    --iv-accent-ink: oklch(0.98 0.003 95);
    --iv-ring: oklch(0.2 0.01 80 / .35);
    --key-skirt: oklch(0.8 0.006 90);

    --pp-bar: oklch(0.975 0.003 95);
    --pp-graphite: oklch(0.27 0.01 80);
    --pp-graphite-ink: oklch(0.98 0.003 95);
    --pp-sheet-shadow: 0 1px 4px oklch(0.3 0.01 80 / .14), 0 18px 36px -18px oklch(0.3 0.01 80 / .3);
    --pp-pop-shadow: 0 18px 40px -16px oklch(0.2 0.01 80 / .35);
}
/* Dark: a light key on a grey skirt; sheets are raised Életút cards with a line instead of a shadow. */
:root[data-skin=paper][data-bs-theme=dark] {
    --iv-accent: oklch(0.92 0.004 90);
    --iv-accent-skirt: oklch(0.68 0.006 90);
    --iv-accent-ink: oklch(0.2 0.01 80);
    --iv-ring: oklch(0.68 0.006 90 / .6);

    --pp-bar: #131313;
    --pp-graphite: #474747;
    --pp-graphite-ink: #dedede;
    --pp-sheet-shadow: none;
    --pp-pop-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
}

/* ---------- Sheets: no frame in light, a hairline in dark */
:root[data-skin=paper] .box,
:root[data-skin=paper] .table-wrap,
:root[data-skin=paper] .summary,
:root[data-skin=paper] .tab-box,
:root[data-skin=paper] .login-card,
:root[data-skin=paper] .paper {
    border-radius: 4px; border-color: transparent; box-shadow: var(--pp-sheet-shadow);
}
:root[data-skin=paper][data-bs-theme=dark] .box,
:root[data-skin=paper][data-bs-theme=dark] .table-wrap,
:root[data-skin=paper][data-bs-theme=dark] .summary,
:root[data-skin=paper][data-bs-theme=dark] .tab-box,
:root[data-skin=paper][data-bs-theme=dark] .login-card,
:root[data-skin=paper][data-bs-theme=dark] .paper { border-color: var(--iv-line); }
:root[data-skin=paper] .paper-form { box-shadow: var(--pp-sheet-shadow); }
:root[data-skin=paper] .card { --bs-card-border-radius: 4px; --bs-card-border-color: transparent; box-shadow: var(--pp-sheet-shadow); }
:root[data-skin=paper] .dropdown-menu { --bs-dropdown-border-radius: 12px; box-shadow: var(--pp-pop-shadow); }
:root[data-skin=paper] .modal { --bs-modal-border-radius: 4px; --bs-modal-box-shadow: var(--pp-pop-shadow); }

/* ---------- Top bar: a lighter strip over the desk */
:root[data-skin=paper] .topbar { height: 64px; background: var(--pp-bar); }
:root[data-skin=paper] .topbar-collapse { background: var(--pp-bar); }
:root[data-skin=paper] .topnav { gap: 26px; }

/* ---------- Tabs: the system needs you (red), scheduled or on its way (graphite) */
:root[data-skin=paper] .chip { border-radius: 4px; }
:root[data-skin=paper] .chip-bad { background: var(--iv-bad-solid); color: var(--iv-bad-solid-ink); border-color: var(--iv-bad-solid); }
:root[data-skin=paper] .chip-info { background: var(--pp-graphite); color: var(--pp-graphite-ink); border-color: var(--pp-graphite); }
:root[data-skin=paper] .chip-pair .tone-bad,
:root[data-skin=paper] .stepper .tone-bad { background: var(--iv-bad-solid); color: var(--iv-bad-solid-ink); border-color: var(--iv-bad-solid); }
:root[data-skin=paper] .chip-pair .tone-info,
:root[data-skin=paper] .stepper .tone-info { background: var(--pp-graphite); color: var(--pp-graphite-ink); border-color: var(--pp-graphite); }
:root[data-skin=paper] .chip-pair > span:first-child,
:root[data-skin=paper] .stepper > span:first-child { border-radius: 4px 0 0 4px; }
:root[data-skin=paper] .chip-pair > span:last-child,
:root[data-skin=paper] .stepper > span:last-child { border-radius: 0 4px 4px 0; }

/* ---------- Stamps on the sheet */
:root[data-skin=paper] .stamp-paid {
    transform: rotate(-10deg); border: 3px solid var(--iv-ok-fg); border-radius: 6px; padding: 4px 16px 6px; letter-spacing: .12em;
}
:root[data-skin=paper] .stamp-paid span { font-family: var(--bs-font-sans-serif); font-weight: 600; letter-spacing: 0; text-transform: none; }
:root[data-skin=paper] .watermark { transform: rotate(-16deg); font-weight: 700; letter-spacing: .12em; }

/* ---------- Top bar (ui/paper_bar): the classic menu on a computer, a tab bar on phones */
:root[data-skin=paper] .pbar { gap: 24px; }
.pbar-nav { display: flex; gap: 22px; align-self: stretch; align-items: stretch; min-width: 0; }
.pbar-nav > a {
    display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--iv-ink3); text-decoration: none; white-space: nowrap;
    border-top: 2px solid transparent; border-bottom: 2px solid transparent;
}
.pbar-nav > a:hover { color: var(--iv-ink); }
.pbar-nav > a.active { color: var(--iv-ink); font-weight: 600; border-bottom-color: var(--iv-ink); }
.pbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.pbar-right .narrow { display: none; }
.pbar-user { display: flex; align-items: center; gap: 12px; margin-left: 6px; font-size: 14px; white-space: nowrap; }
.pbar-user a { color: var(--iv-ink3); text-decoration: none; }
.pbar-user a:hover { color: var(--iv-ink); text-decoration: underline; }
.pdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--iv-bad-solid); flex: none; }
.todo-key { display: inline-flex; align-items: center; gap: 8px; }
.todo-key .pdot { width: 8px; height: 8px; }
.todo-key.none .pdot { display: none; }
.pmenu { min-width: 250px; padding: 6px; }
.pmenu .dropdown-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.pmenu .dropdown-item.active { background: var(--iv-inverse-bg); color: var(--iv-inverse-ink); }
.pmenu form { margin: 0; }
.pmenu .badge-n { font-size: 13px; font-weight: 600; color: var(--iv-bad-fg); }
.pmenu .dropdown-item.active .badge-n { color: inherit; }
.ptabs { display: none; }
@media (max-width: 1439.98px) {
    :root[data-skin=paper] .pbar { gap: 16px; padding: 0 24px; }
    .pbar-nav { gap: 16px; }
    .pbar-nav > a { font-size: 14px; }
    :root .pbar .brand .brand-logo { display: none; }
    :root .pbar .brand .brand-keycap { display: block; }
}
@media (max-width: 1199.98px) {
    :root[data-skin=paper] .pbar { padding: 0 14px; gap: 12px; height: 60px; }
    .pbar-nav, .pbar-user { display: none; }
    .pbar-right .wide { display: none; }
    .pbar-right .narrow { display: inline; }
    .ptabs {
        display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: var(--pp-bar); border-top: 1px solid var(--iv-line); padding-bottom: env(safe-area-inset-bottom);
    }
    .ptabs > a, .ptabs > button {
        display: flex; align-items: center; justify-content: center; gap: 6px; height: 56px; font-size: 14px; font-weight: 600;
        color: var(--iv-ink4); text-decoration: none; border: 0; background: none; border-top: 2px solid transparent;
    }
    .ptabs > .active { color: var(--iv-ink); border-top-color: var(--iv-ink); }
    :root[data-skin=paper] body { padding-bottom: 64px; }
}

/* ---------- Selected key (month, grid / feed): graphite */
:root[data-skin=paper] .btn.on,
:root[data-skin=paper] .todo-key.on {
    --skirt: var(--iv-accent-skirt);
    --bs-btn-color: var(--iv-accent-ink); --bs-btn-bg: var(--iv-accent); --bs-btn-hover-color: var(--iv-accent-ink); --bs-btn-hover-bg: var(--iv-accent);
}
.tone-text-ok { color: var(--iv-ok-fg); }
.tone-text-bad { color: var(--iv-bad-fg); }
.tone-text-warn { color: var(--iv-warn-fg); }
.tone-text-info, .tone-text-mute { color: var(--iv-ink4); }

/* ---------- The sheet (element/paper/sheet): sized in em, the sheet's width sets the em (width / 30) */
.psheet { position: relative; display: block; color: var(--iv-ink); text-decoration: none; container-type: inline-size; font-variant-numeric: tabular-nums; }
.psheet:hover { color: var(--iv-ink); }
.psheet > * { font-size: calc(100cqi / 30); }
.psheet-page {
    background: var(--iv-raised); border-radius: .25em; box-shadow: var(--pp-sheet-shadow); padding: 2.6em 2.6em 2.2em;
    display: flex; flex-direction: column; aspect-ratio: 1 / 1.414; overflow: hidden; line-height: 1.3;
}
:root[data-bs-theme=dark] .psheet-page { border: 1px solid var(--iv-line); }
a.psheet { transition: transform 160ms ease; }
a.psheet:hover { transform: translateY(-3px); }
.psheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; }
.psheet-seller { display: flex; flex-direction: column; gap: .25em; min-width: 0; }
.psheet-seller b { font-size: 1.15em; font-weight: 700; letter-spacing: -0.02em; }
.psheet-seller .addr { font-size: .7em; color: var(--iv-ink4); }
.psheet-no { display: flex; flex-direction: column; gap: .25em; align-items: flex-end; flex: none; text-align: right; }
.psheet-no .kind { font-size: .72em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--iv-ink3); }
.psheet-no b { font-size: .9em; font-weight: 600; }
.psheet-to { margin-top: 2.6em; display: flex; flex-direction: column; gap: .35em; }
.psheet-to span { font-size: .75em; color: var(--iv-ink4); }
.psheet-to b { font-size: 1.5em; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.psheet-dates { margin-top: 1.6em; display: grid; grid-template-columns: 1fr 1fr; gap: 1em; font-size: .8em; }
.psheet-dates > div { display: flex; flex-direction: column; gap: .2em; }
.psheet-dates span { color: var(--iv-ink4); }
.psheet-dates b { font-weight: 600; }
.psheet-lines { margin-top: 2.2em; display: flex; flex-direction: column; border-top: .1em solid var(--iv-ink); }
.psheet-lines > div { display: flex; justify-content: space-between; gap: 1em; padding: .8em 0; border-bottom: .06em solid var(--iv-line); font-size: .85em; }
.psheet-lines > div b { font-weight: 600; white-space: nowrap; }
.psheet-lines > .more { color: var(--iv-ink4); border-bottom: 0; }
.psheet-lines small { display: block; margin-top: .2em; font-size: .85em; color: var(--iv-ink4); }
.psheet-lines > .sub { border-bottom: 0; padding: .35em 0; color: var(--iv-ink3); }
.psheet-lines > .sub:first-of-type, .psheet-lines > div:not(.sub) + .sub { padding-top: .9em; }
.psheet-extra { margin-top: 1.4em; display: flex; flex-direction: column; gap: .3em; font-size: .8em; color: var(--iv-ink3); }
.psheet-total { margin-top: auto; padding-top: 1.4em; display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; }
.psheet-total span { font-size: .8em; color: var(--iv-ink4); }
.psheet-total b { font-size: 2.1em; font-weight: 700; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.psheet-foot { margin-top: 1.4em; padding-top: .9em; border-top: .06em solid var(--iv-line); font-size: .62em; color: var(--iv-ink4); min-height: 1.3em; }
.psheet-stamp {
    position: absolute; right: 2.2em; top: 40%; transform: rotate(-10deg); border: .16em solid var(--iv-ok-fg); color: var(--iv-ok-fg);
    border-radius: .35em; padding: .35em .8em .4em; display: flex; flex-direction: column; align-items: center; opacity: .85; pointer-events: none;
}
.psheet-stamp span { font-size: 1.5em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.1; }
.psheet-stamp small { font-size: .72em; font-weight: 600; }
.psheet-stamp.tone-mute { border-color: var(--iv-ink4); color: var(--iv-ink4); }
.psheet-draft {
    position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: calc(100cqi / 30 * 3); font-weight: 700; letter-spacing: .12em;
    color: var(--iv-line); transform: rotate(-16deg); pointer-events: none; user-select: none;
}
.psheet-tab {
    position: absolute; left: 2em; top: -1.55em; height: 1.6em; display: flex; align-items: center; gap: .4em; padding: 0 .9em;
    background: var(--iv-bad-solid); color: var(--iv-bad-solid-ink); border-radius: .4em .4em 0 0; font-size: calc(100cqi / 30 * .95); font-weight: 700; white-space: nowrap;
}
.psheet-tab i { width: .45em; height: .45em; border-radius: 50%; background: currentColor; }
.psheet-tab.tone-info { background: var(--pp-graphite); color: var(--pp-graphite-ink); }
.psheet-tab.tone-mute { background: var(--iv-ink4); color: var(--iv-raised); }
.psheet-note {
    position: absolute; top: -1.2em; right: 1.2em; max-width: 52%; transform: rotate(3.5deg); background: oklch(0.92 0.11 95 / .93);
    padding: .5em .9em .6em; font-family: 'Kalam', cursive; font-size: calc(100cqi / 30 * 1.1); line-height: 1.15; color: oklch(0.32 0.05 75);
    box-shadow: 0 .12em .3em oklch(0.3 0.02 80 / .2);
}
.psheet.paused .psheet-page { opacity: .6; }
.psheet [data-hl] { background: oklch(0.92 0.11 95 / .8); border-radius: .2em; }
.psheet-full > * { font-size: 15px; }
.psheet-full > .psheet-tab { font-size: 14px; }
.psheet-full > .psheet-note { font-size: 17px; }
.psheet-full > .psheet-draft { font-size: 46px; }
.psheet-full .psheet-page { aspect-ratio: auto; min-height: 58em; }
@media (max-width: 575.98px) { .psheet-full > *, .psheet-full > .psheet-tab { font-size: 12px; } .psheet-full .psheet-page { padding: 2em 1.4em 1.6em; } }

/* ---------- Számlák: piles, grid, feed */
.psearch .form-control { width: 260px; }
.pempty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 80px 16px; text-align: center; }
.pempty b { font-size: 28px; font-weight: 700; }
.pempty span { font-size: 16px; color: var(--iv-ink3); }
.piles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 48px 40px; padding: 30px 0 20px; justify-items: center; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 26px; color: var(--iv-ink); text-decoration: none; transition: transform 180ms ease; }
.pile:hover { color: var(--iv-ink); transform: translateY(-6px); }
.pile-stack { position: relative; display: block; width: 270px; height: 380px; }
.pile-sheet { position: absolute; left: 15px; top: 24px; width: 240px; }
.pile-sheet:nth-last-child(2) { transform: rotate(-3deg) translate(-4px, 4px); }
.pile-sheet:nth-last-child(3) { transform: rotate(3.5deg) translate(6px, -2px); }
.pile-label { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pile-label b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.pile-label span { font-size: 15px; color: var(--iv-ink3); }
@media (max-width: 575.98px) {
    .piles { grid-template-columns: 1fr; gap: 20px; justify-items: stretch; padding-top: 16px; }
    .pile { flex-direction: row; gap: 18px; }
    .pile-stack { width: 170px; height: 250px; flex: none; }
    .pile-sheet { width: 150px; left: 10px; top: 20px; }
    .pile-label { align-items: flex-start; }
}
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 40px 28px; padding-top: 22px; }
.pgrid-item { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pcap { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 15px; }
.pcap b { grid-column: 1 / -1; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcap .tone-text-ok, .pcap .tone-text-bad, .pcap .tone-text-warn, .pcap .tone-text-mute, .pcap .tone-text-info { font-weight: 600; text-align: right; }
.pfeed { display: flex; flex-direction: column; gap: 56px; padding: 30px 0; max-width: 1000px; margin: 0 auto; width: 100%; }
.pfeed-item { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 44px; align-items: start; }
.pside { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; }
.pside h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.pside .meta { font-size: 15px; color: var(--iv-ink3); }
.pside .amount { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 4px; }
@media (max-width: 767.98px) {
    .pfeed-item { grid-template-columns: 1fr; gap: 18px; }
    .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 16px; }
        .psearch .form-control { width: 100%; }
}

/* ---------- Invoice page: leafing, the sticky note form */
.pnav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pnote { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.pnote textarea {
    width: 100%; border: 0; border-radius: 2px; padding: 10px 12px; resize: vertical; min-height: 64px;
    background: oklch(0.92 0.11 95 / .55); color: oklch(0.32 0.05 75); font-family: 'Kalam', cursive; font-size: 18px; line-height: 1.2;
}
.pnote textarea::placeholder { color: oklch(0.32 0.05 75 / .55); }
.pnote textarea:focus { outline: 2px solid var(--iv-ring); }
:root[data-skin=paper] .split { grid-template-columns: minmax(0, 680px) minmax(0, 1fr); gap: 44px; }
:root[data-skin=paper] .split > .psheet { margin-top: 22px; }
@media (max-width: 1199.98px) { :root[data-skin=paper] .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Ismétlődő: the next copy with the later ones stacked behind, dashed */
.pstacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 48px 40px; padding-top: 30px; }
.pstack-item { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pstack { position: relative; margin: 0 16px 16px 0; }
.pstack::before, .pstack::after {
    content: ''; position: absolute; inset: 0; border: 1px dashed var(--iv-line2); border-radius: 4px; background: var(--iv-raised); opacity: .7;
}
.pstack::before { transform: translate(8px, 8px); }
.pstack::after { transform: translate(16px, 16px); z-index: -1; }
.pstack::before { z-index: 0; }
.pstack { z-index: 0; isolation: isolate; }
.pstack .psheet { position: relative; z-index: 1; }
.pstack.paused::before, .pstack.paused::after { display: none; }
.pcap-lg { display: flex; flex-direction: column; gap: 3px; font-size: 15px; min-width: 0; }
.pcap-lg b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- Partnerek: a pile per partner */
.ppartners { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 44px 30px; padding-top: 26px; }
.ppartner { display: flex; flex-direction: column; gap: 16px; color: var(--iv-ink); text-decoration: none; min-width: 0; }
.ppartner:hover { color: var(--iv-ink); }
.ppartner:hover .pile-stack { transform: translateY(-4px); }
.pile-stack.sm { width: 100%; height: auto; aspect-ratio: 1 / 1.5; transition: transform 160ms ease; }
.pile-stack.sm .pile-sheet { left: 6%; top: 6%; width: 82%; }
.pile-stack.empty { border: 1px dashed var(--iv-line2); border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.pile-blank { color: var(--iv-ink4); font-size: 14px; }
.ppartner .pcap-lg b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pwarn { margin-top: 10px; padding: 10px 14px; border-left: 4px solid var(--iv-bad-solid); background: var(--iv-bad-bg); color: var(--iv-bad-fg); border-radius: 4px; max-width: 560px; }
.ptotals { display: flex; gap: 30px; }
.ptotals > div { display: flex; flex-direction: column; gap: 4px; }
.ptotals span { font-size: 14px; color: var(--iv-ink4); }
.ptotals b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
@media (max-width: 767.98px) {
    .ppartners { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 16px; }
        .ptotals { flex-wrap: wrap; gap: 18px; }
}

/* ---------- Utalások: bank slips next to the paper they pay */
.psection { margin: 18px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.pslips { display: flex; flex-direction: column; }
.pslip-row { display: grid; grid-template-columns: 300px 40px minmax(0, 1fr); gap: 16px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--iv-line); }
.pslip {
    display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: 6px; text-decoration: none;
    background: oklch(0.965 0.018 240); color: var(--iv-ink); box-shadow: 0 1px 3px oklch(0.3 0.02 240 / .15); font-family: var(--iv-mono);
}
:root[data-bs-theme=dark] .pslip { background: #172538; box-shadow: none; }
.pslip:hover { color: var(--iv-ink); }
.pslip .top { display: flex; justify-content: space-between; font-size: 13px; color: var(--iv-ink3); letter-spacing: .06em; }
.pslip .who { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pslip .amt { font-family: var(--bs-font-sans-serif); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.pslip .ref { font-size: 13px; color: var(--iv-ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pslip-arrow { font-size: 24px; color: var(--iv-ink4); text-align: center; }
.pslip-match { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: center; }
.pslip-match .pside { padding-top: 0; }
.pdone { display: flex; flex-direction: column; }
.pdone a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--iv-line-soft); color: var(--iv-ink); text-decoration: none; font-size: 15px; }
@media (max-width: 767.98px) {
    .pslip-row { grid-template-columns: 1fr; gap: 10px; }
    .pslip-arrow { transform: rotate(90deg); }
    .pdone a { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Nyugták: till slips by day */
.pday h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 14px; font-size: 15px; font-weight: 400; color: var(--iv-ink3); }
.pday h2 b { font-size: 21px; font-weight: 700; color: var(--iv-ink); letter-spacing: -0.015em; }
.ptill { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; align-items: start; }
.pslip-till {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 24px; background: var(--iv-raised); color: var(--iv-ink);
    text-decoration: none; font-family: var(--iv-mono); font-size: 13px; box-shadow: var(--pp-sheet-shadow);
    --tooth: 6px;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
}
:root[data-bs-theme=dark] .pslip-till { border: 1px solid var(--iv-line); }
.pslip-till:hover { color: var(--iv-ink); }
.pslip-till .head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 10px; border-bottom: 1px dashed var(--iv-line2); }
.pslip-till .head b { font-weight: 700; letter-spacing: .04em; text-align: center; }
.pslip-till .head span { color: var(--iv-ink3); }
.pslip-till .items { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--iv-line2); }
.pslip-till .items > span, .pslip-till .total { display: flex; justify-content: space-between; gap: 10px; }
.pslip-till .items > span > span:last-child { white-space: nowrap; }
.pslip-till .total b { white-space: nowrap; }
.pslip-till .foot { color: var(--iv-ink4); }

/* ---------- Eladó adatai: the form next to its paper */
.psettings { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 460px); gap: 56px; justify-content: start; padding-top: 8px; }
.psettings-preview { position: sticky; top: 20px; align-self: start; display: flex; flex-direction: column; gap: 10px; }
.pfold { border-top: 1px solid var(--iv-line); padding-top: 12px; }
.pfold summary { font-weight: 600; cursor: pointer; }
.psellers .psheet-to, .psellers .psheet-dates, .psellers .psheet-lines, .psellers .psheet-total { visibility: hidden; }
@media (max-width: 991.98px) { .psettings { grid-template-columns: 1fr; } .psettings-preview { position: static; } }

/* ---------- Új számla: a blank sheet to fill in (Invoices/paper/add) */
.ped { display: grid; grid-template-columns: 210px minmax(0, 720px) 280px; gap: 40px; justify-content: start; align-items: start; padding-top: 10px; }
.ped-copies { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.ped-copy { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--iv-ink); text-decoration: none; font-size: 15px; }
.ped-copy:hover { color: var(--iv-ink); }
.ped-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-thumb { display: block; width: 58px; }
.ped-paper {
    background: var(--iv-raised); border-radius: 4px; box-shadow: var(--pp-sheet-shadow); padding: 44px 48px 40px;
    display: flex; flex-direction: column; gap: 26px; min-height: 980px; font-size: 15px;
}
:root[data-bs-theme=dark] .ped-paper { border: 1px solid var(--iv-line); }
/* Fields on the paper: the app's field boxes, with room inside them. */
.ped .ped-input { width: 100%; min-width: 0; padding: 7px 11px; border: 1px solid var(--iv-line); border-radius: 8px; background-color: var(--iv-field); color: var(--iv-ink); font: inherit; }
.ped select.ped-input { padding-right: 32px; }
.ped .ped-input:focus { border-color: var(--iv-ink3); box-shadow: 0 0 0 3px var(--iv-ring); outline: none; }
.ped .ped-input::placeholder { color: var(--iv-ink4); }
.ped-strong { font-weight: 600; }
.ped-small { font-size: 14px; }
.ped-cap { display: block; font-size: 13px; color: var(--iv-ink4); }
.ped-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.ped-seller { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; }
.ped-seller b, .ped-seller select { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--iv-ink); }
.ped-no { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.ped-no b { font-size: 16px; font-weight: 600; }
.ped-to { display: flex; flex-direction: column; gap: 8px; }
.ped .ped-buyer { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; padding: 9px 13px; }
.ped-more > summary { cursor: pointer; font-size: 14px; color: var(--iv-ink3); }
.ped-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ped-lines { border-top: 1.5px solid var(--iv-ink); }
.ped .lined-grid { grid-template-columns: 64px 76px minmax(110px, 1fr) 132px minmax(90px, auto) 18px; gap: 8px 10px; }
.ped .lined-grid > .ped-desc { grid-column: 1 / -1; }
.ped .lined-grid > .ped-desc .ped-input { font-size: 15px; }
.ped .line-item { padding: 12px 0 10px; border-bottom: 1px solid var(--iv-line); }
.ped .line-item .ped-input { font-size: 14px; padding: 6px 9px; }
.ped .line-item select.ped-input, .ped .line-extra select.ped-input { padding-right: 32px; }
.ped-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--iv-ink3); }
.ped-inline select.ped-input { width: auto; font-size: 14px; padding-top: 5px; padding-bottom: 5px; }
.ped .line-item .lnet { font-size: 15px; }
.ped .line-extra { margin: 0 0 8px; }
.ped-add { margin-top: 12px; border: 0; background: none; padding: 0; font-weight: 600; color: var(--iv-ink); }
.ped-add:hover { text-decoration: underline; }
.ped-total { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.ped-sub { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; font-size: 14px; color: var(--iv-ink3); max-width: 300px; margin-left: auto; width: 100%; }
.ped-sub > span:nth-child(even) { text-align: right; }
.ped-grand { display: flex; justify-content: space-between; align-items: flex-end; }
.ped-grand span { font-size: 14px; color: var(--iv-ink4); }
.ped-grand b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.ped-notes textarea { min-height: 60px; resize: vertical; }
.ped-side { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.ped-side-total { display: flex; flex-direction: column; gap: 4px; }
.ped-side-total b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
@media (max-width: 1399.98px) { .ped { grid-template-columns: minmax(0, 720px) 280px; } .ped-copies { display: none; } }
@media (max-width: 991.98px) {
    .ped { grid-template-columns: 1fr; gap: 20px; }
    .ped-paper { padding: 26px 18px; min-height: 0; }
    .ped .lined-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ped-dates { grid-template-columns: 1fr; }
}

/* ---------- One header on every page: crumb, title, subtitle under it, keys on the right */
:root[data-skin=paper] .page-head { align-items: flex-end; gap: 16px 24px; padding-bottom: 8px; }
:root[data-skin=paper] .page-head h1, :root[data-skin=paper] .page-head h1.lg { font-size: 36px; }
:root[data-skin=paper] .page-head .crumb { font-size: 14px; margin-bottom: 2px; }
:root[data-skin=paper] .page-head .sub { margin-top: 4px; font-size: 15px; color: var(--iv-ink3); }
:root[data-skin=paper] .page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pkeys .sep { width: 1px; height: 26px; background: var(--iv-line); }
@media (max-width: 767.98px) { :root[data-skin=paper] .page-head h1, :root[data-skin=paper] .page-head h1.lg { font-size: 28px; } }
/* Second-level titles: sections, piles, captions, the side of a feed item */
.psection, .pday h2 b, .pile-label b, .pcap-lg b, .pside h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.ptotals { display: flex; gap: 32px; flex-wrap: wrap; }
.pwarn { margin: 0; }

/* Sablon (invoice content templates) */
.tpl-box { display: flex; flex-direction: column; gap: 8px; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 14rem; overflow: auto; }
.tpl-load { display: flex; justify-content: space-between; gap: 8px; color: var(--iv-ink); text-decoration: none; padding: 6px 8px; border: 1px solid var(--iv-line, #ddd); border-radius: 8px; }
.tpl-load:hover { background: color-mix(in srgb, var(--iv-raised) 92%, var(--iv-ink)); }
.tpl-msg { font-size: 14px; margin-top: 4px; }
.tpl-dialog { border: 1px solid var(--iv-line2); border-radius: 12px; padding: 20px; max-width: 28rem; width: calc(100% - 2rem); background: var(--iv-raised); color: var(--iv-ink); }
.tpl-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.tpl-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.tpl-error { min-height: 1.2em; margin-top: 6px; font-size: 14px; }
