/* ============================================================
   Struk Pertamini
   Arah visual: "papan loket / meteran pompa"
   - ink hitam + kertas hangat, satu aksen bara
   - judul condensed kapital, angka monospace tabular
   - garis rambut 1px, sudut siku, tanpa gradien/bayangan lembut
   ============================================================ */

@font-face {
    font-family: 'Barlow';
    src: url('fonts/barlow-400.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('fonts/barlow-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('fonts/barlow-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Barlow Condensed';
    src: url('fonts/barlow-condensed-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Barlow Condensed';
    src: url('fonts/barlow-condensed-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Mono';
    src: url('fonts/ibm-plex-mono-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Mono';
    src: url('fonts/ibm-plex-mono-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}

:root {
    --ink:        #14161a;
    --ink-soft:   #23272d;
    --ink-line:   #3a3f47;
    --paper:      #efece4;
    --card:       #fffdf8;
    --line:       #d8d1c3;
    --line-soft:  #e9e3d6;
    --muted:      #6f6859;
    --muted-2:    #8b8372;
    --accent:     #c33d18;
    --accent-dk:  #9b2f11;
    --ok:         #1f6b4f;
    --danger:     #a3271b;
    --mono:       'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --sans:       'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --disp:       'Barlow Condensed', 'Barlow', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 600; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------- tipografi inti */

.eyebrow {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
}

.mono, .num, .cell-value, .clock, .rail-nav i, .tag, .summary-line b {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ------------------------------------------------------------------- kontrol */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 0;
    font-family: var(--sans);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent-dk);
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dk); }
.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: #fff; }
.btn-danger { background: var(--danger); border-color: #7d1d14; color: #fff; }
.btn-danger:hover { background: #7d1d14; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 10.5px; }
.btn-block { width: 100%; }

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    cursor: pointer;
}
.link-btn:hover { color: var(--accent); }

.icon-btn {
    display: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.icon-btn span { display: block; width: 16px; height: 1px; background: var(--ink); }

/* ------------------------------------------------------------------ form */

label {
    display: block;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

input, select, textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 9px 10px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                      linear-gradient(135deg, var(--ink) 50%, transparent 50%);
    background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
}
input[readonly] { background: #f4f0e6; color: var(--muted); }

.checkline {
    display: flex;
    align-items: center;
    gap: 9px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}
.checkline input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.opt { color: var(--muted-2); text-transform: none; letter-spacing: 0; font-weight: 400; }

.fgrid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.fgrid-3 { display: grid; grid-template-columns: 1.15fr .7fr .95fr; gap: 0 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-actions-left { justify-content: flex-start; }
.hint { margin-top: 10px; font-size: 12px; color: var(--muted); }

.form-error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-left: 3px solid var(--danger);
    background: #fbeae6;
    color: var(--danger);
    font-size: 12.5px;
}

/* ------------------------------------------------------------------ login */

.auth { background: var(--paper); }

.auth-split {
    display: grid;
    grid-template-columns: 46% 54%;
    min-height: 100vh;
}

.auth-side {
    background: var(--ink);
    color: #e9e4d8;
    padding: 44px 44px 36px;
    display: flex;
    flex-direction: column;
    gap: 34px;
    position: relative;
    overflow: hidden;
}
.auth-side::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 26px);
    pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }

.auth-side-top { display: flex; align-items: center; gap: 12px; }

.stamp {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-family: var(--disp);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.auth-kicker {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #9aa0a8;
}

.auth-headline { margin-top: 72px; }
.auth-headline h1 {
    font-family: var(--disp);
    font-size: clamp(40px, 5vw, 62px);
    font-weight: 700;
    line-height: .95;
    letter-spacing: .01em;
    text-transform: uppercase;
    color: #f6f2e8;
}
.auth-headline p {
    margin-top: 14px;
    max-width: 34ch;
    font-size: 13.5px;
    color: #a9aeb5;
}

.auth-stub {
    border-top: 1px dashed #4a4f57;
    border-bottom: 1px dashed #4a4f57;
    padding: 12px 0;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .04em;
    color: #b9bec5;
    max-width: 300px;
}
.stub-row { display: flex; justify-content: space-between; padding: 2px 0; }
.stub-rule { border-top: 1px dashed #4a4f57; margin: 6px 0; }
.stub-total { color: #f6f2e8; font-weight: 600; }

.auth-facts {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    font-size: 12px;
    color: #9aa0a8;
}
.auth-facts b { font-family: var(--mono); font-weight: 500; color: var(--accent); margin-right: 10px; }

.auth-main {
    display: grid;
    place-items: center;
    padding: 40px 28px;
}

.auth-form { width: 100%; max-width: 356px; }
.auth-form h2 {
    margin: 10px 0 8px;
    font-family: var(--disp);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
    line-height: 1.05;
}
.auth-note { margin-bottom: 26px; font-size: 12.5px; color: var(--muted); }

.auth-main label { color: var(--muted); }
.auth-main input {
    height: 44px;
    margin-top: 4px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #c9c1b2;
    background: transparent;
    font-size: 15px;
}
.auth-main input:focus {
    outline: none;
    border-bottom-color: var(--ink);
    box-shadow: inset 0 -1px 0 var(--ink);
}
.auth-main .btn { margin-top: 10px; height: 44px; }
.auth-foot {
    margin-top: 30px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-2);
}

/* ------------------------------------------------------------------ shell */

.app { display: flex; min-height: 100vh; }

.rail {
    width: 212px;
    flex: 0 0 212px;
    background: var(--ink);
    color: #c8ccd2;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.rail-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid #2a2e34;
}
.rail-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; padding: 3px; }
.rail-title strong {
    display: block;
    font-family: var(--disp);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #f4f0e6;
    line-height: 1.15;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail-title em {
    font-family: var(--mono);
    font-style: normal;
    font-size: 9px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8b929b;
}

.rail-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-left: 2px solid transparent;
    background: none;
    color: #aeb4bc;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.nav-item i {
    font-style: normal;
    font-size: 9.5px;
    color: #6c747e;
    letter-spacing: .06em;
}
.nav-item:hover { background: rgba(255,255,255,.045); color: #eef0f3; }
.nav-item.active {
    border-left-color: var(--accent);
    background: rgba(255,255,255,.05);
    color: #fff;
}
.nav-item.active i { color: var(--accent); }

.rail-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #2a2e34;
}
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who-mark {
    width: 28px; height: 28px; flex: 0 0 28px;
    display: grid; place-items: center;
    border: 1px solid #3c424a;
    font-family: var(--mono);
    font-size: 11px;
    color: #e7e9ec;
}
.who strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #eef0f3;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.who em {
    font-family: var(--mono);
    font-style: normal;
    font-size: 8.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7f8791;
}
.rail-out {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #8b929b;
    text-decoration: none;
}
.rail-out:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 58px;
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.topbar h1 {
    flex: 1;
    font-family: var(--disp);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.clock {
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.content { padding: 22px 26px 44px; }

.page { display: none; }
.page.active { display: block; }

/* ------------------------------------------------------------------ panel */

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    margin-bottom: 16px;
    padding: 18px 18px 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -2px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 {
    font-family: var(--disp);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.panel-head-left { display: flex; align-items: center; gap: 10px; }
.live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.live i {
    width: 5px;
    height: 5px;
    background: var(--accent);
    display: inline-block;
}

.panel-meta {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.cols-form { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- ledger */

.ledger {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--card);
    border: 1px solid var(--line);
    margin-bottom: 16px;
}
.ledger-cell {
    padding: 16px 18px 14px;
    border-left: 1px solid var(--line-soft);
    min-width: 0;
}
.ledger-cell:first-child { border-left: 0; }
.cell-label {
    display: block;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 8px;
}
.cell-value {
    display: block;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ledger-cell small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ----------------------------------------------------------------- chart */

.bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 168px;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 4px;
}
.bar-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.bar-track { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill {
    width: 60%;
    max-width: 26px;
    background: var(--ink);
    min-height: 0;
    transition: height .3s ease, background-color .15s;
}
.bar-fill:hover { background: var(--accent); }
.bar-label { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); }

.rank { display: flex; flex-direction: column; gap: 13px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; }
.rank-name { font-size: 13px; font-weight: 600; }
.rank-val { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.rank-track { grid-column: 1 / -1; height: 3px; background: var(--line-soft); }
.rank-fill { height: 100%; background: var(--accent); }

/* ----------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    padding: 0 10px 9px;
    text-align: left;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
    border-bottom: 1px solid var(--ink);
    white-space: nowrap;
}
.table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbf8f0; }
.table .mono { font-size: 12px; letter-spacing: .02em; }
.table .num { text-align: right; }
.table .empty {
    padding: 30px 10px;
    text-align: center;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.table td .btn + .btn { margin-left: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { width: auto; margin: 0; flex: 1 1 140px; min-width: 118px; }
.filters .btn { flex: 0 0 auto; }
.summary-line {
    margin-bottom: 14px;
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: .02em;
}
.summary-line b { color: var(--ink); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* ----------------------------------------------------------------- input */

.amount {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    background: var(--ink);
    color: #f4f0e6;
    padding: 14px 16px 13px;
    margin: 4px 0 16px;
}
.amount-main { flex: 1; min-width: 0; }
.amount label {
    display: block;
    margin: 0;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .16em;
    color: #9ba2ab;
}
.amount input {
    width: 100%;
    height: auto;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-family: var(--mono);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.01em;
}
.amount input:focus { outline: none; box-shadow: none; color: #fff; }
.amount input::placeholder { color: #5c636c; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chips button {
    height: 28px;
    padding: 0 9px;
    border: 1px solid #454b53;
    background: transparent;
    color: #d9dde2;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .04em;
    cursor: pointer;
}
.chips button:hover { border-color: var(--accent); color: #fff; }

.tag {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid var(--line);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.tag.ok { border-color: #b7d3c6; color: var(--ok); background: #f0f7f3; }

/* --------------------------------------------------------------- receipt */

.receipt-panel { position: sticky; top: 74px; }
.receipt-stage {
    background: #e7e1d4;
    padding: 22px 16px;
    display: grid;
    place-items: center;
    min-height: 320px;
    border: 1px solid var(--line-soft);
}
.paper {
    width: 58mm;
    background: #fff;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10.5px;
    line-height: 1.32;
    padding: 3mm 2.5mm;
    border-top: 1px dashed #b9b1a1;
    border-bottom: 1px dashed #b9b1a1;
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .8);
}
.paper .rc-logo { display: block; max-width: 34mm; margin: 0 auto 5px; }
.paper .rc-center { text-align: center; }
.paper .rc-strong { font-weight: 700; }
.paper .rc-small { font-size: 9.5px; }
.paper .rc-gap { height: 5px; }
.rc-row { display: flex; justify-content: space-between; gap: 8px; }
.rc-row span:last-child { text-align: right; }
.rc-line { border-top: 1px dashed #000; margin: 4px 0; }

/* ----------------------------------------------------------------- misc */

.specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    margin-bottom: 14px;
}
.specs > div {
    padding: 10px 12px;
    border-top: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
}
.specs > div:nth-child(1), .specs > div:nth-child(2) { border-top: 0; }
.specs > div:nth-child(odd) { border-left: 0; }
.specs span {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 4px;
}
.specs strong { font-size: 13px; font-weight: 600; }

.bt-status {
    display: inline-block;
    padding: 8px 12px;
    margin-bottom: 16px;
    border-left: 3px solid var(--danger);
    background: #fbeae6;
    color: var(--danger);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.bt-status.ok { border-left-color: var(--ok); background: #eef6f1; color: var(--ok); }

.logo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }

.file-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
    cursor: pointer;
    position: relative;
}
.file-field input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}
.file-btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.file-field:hover .file-btn { border-color: var(--ink); }
.file-name {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .04em;
    color: var(--muted-2);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-field input:focus-visible + .file-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-row img {
    width: 108px;
    height: 72px;
    object-fit: contain;
    background: #f6f2e8;
    border: 1px solid var(--line);
    padding: 6px;
}
.logo-row input { margin: 0; }

.checks { margin-bottom: 4px; }

/* --------------------------------------------------------------- dialog */

.dialog {
    margin: auto;
    width: min(430px, calc(100vw - 28px));
    padding: 24px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--card);
    color: var(--ink);
    box-shadow: 10px 10px 0 rgba(20, 22, 26, .12);
}
.dialog::backdrop { background: rgba(20, 22, 26, .55); }
.dialog h2 {
    margin: 8px 0 10px;
    font-family: var(--disp);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.dialog-note { margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    max-width: 330px;
    padding: 11px 14px;
    border-left: 3px solid var(--accent);
    background: var(--ink);
    color: #f0ede5;
    font-size: 12.5px;
    box-shadow: 6px 6px 0 rgba(20, 22, 26, .12);
}
.toast.ok { border-left-color: #4fae8a; }
.toast.err { border-left-color: #e2463a; }

.loading {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    background: rgba(239, 236, 228, .72);
}
.spinner {
    width: 30px;
    height: 30px;
    border: 2px solid #cfc7b7;
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1120px) {
    .cols, .cols-form { grid-template-columns: 1fr; }
    .receipt-panel { position: static; }
    .ledger { grid-template-columns: 1fr 1fr; }
    .ledger-cell:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
    .ledger-cell:nth-child(4) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
    .auth-side { padding: 22px 22px 20px; gap: 16px; }
    .auth-headline h1 { font-size: 34px; }
    .auth-headline p, .auth-stub, .auth-facts { display: none; }
    .auth-main { padding: 28px 22px 40px; place-items: start center; }
}

@media (max-width: 860px) {
    .rail {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 0 1px rgba(0,0,0,.2);
    }
    .rail.open { transform: none; }
    .icon-btn { display: inline-flex; }
    .topbar { padding: 0 14px; }
    .content { padding: 16px 14px 40px; }
    .clock { display: none; }
    .fgrid-2, .fgrid-3 { grid-template-columns: 1fr; }
    .ledger { grid-template-columns: 1fr 1fr; }
    .ledger-cell { padding: 13px 14px 12px; }
    .cell-value { font-size: 19px; letter-spacing: 0; }
    .amount { flex-direction: column; align-items: stretch; }
    .chips { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------------ print */

@media print {
    html, body { background: #fff !important; }
    body * { visibility: hidden; }
    .receipt-panel, .receipt-stage, .cols, .panel, .page, .content, .main, .app { position: static !important; }
    #receipt, #receipt * { visibility: visible; }
    #receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 58mm;
        margin: 0;
        padding: 2mm;
        border: 0;
        box-shadow: none;
        font-size: 10px;
        line-height: 1.3;
    }
    @page { margin: 0; size: 58mm auto; }
}
