:root {
    --ink: #15221c;
    --muted: #65736b;
    --line: #dce5df;
    --paper: #f4f7f4;
    --lime: #b9ff3e;
    --white: #fff;
    --red: #a83232;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font:
        15px/1.5 Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        sans-serif;
}
header {
    height: 76px;
    padding: 0 max(24px, calc((100% - 1240px) / 2));
    display: flex;
    align-items: center;
    gap: 42px;
    background: var(--ink);
    color: white;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 750;
    letter-spacing: 0.06em;
}
.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border-radius: 2px;
}
.brand small {
    display: block;
    font-size: 8px;
    color: #b7c2bc;
}
nav {
    display: flex;
    gap: 28px;
    flex: 1;
}
nav a {
    color: #cbd5cf;
    text-decoration: none;
    font-size: 14px;
}
header form {
    margin: 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
[hidden] {
    display: none !important;
}
.fiscal-item,
.expense-item-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.fiscal-item small,
.expense-item-list span {
    color: var(--muted);
    text-align: right;
}
.expense-item-list {
    margin: 8px 0 12px;
    padding: 0;
    list-style: none;
}
main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 42px 24px 80px;
}
footer {
    text-align: center;
    padding: 25px;
    color: var(--muted);
    font-size: 12px;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 28px;
}
.page-head h1,
.login h1 {
    font-size: 42px;
    line-height: 1.08;
    margin: 3px 0 8px;
    letter-spacing: -0.04em;
}
.page-head p {
    margin: 0;
    color: var(--muted);
}
.eyebrow {
    font-weight: 800;
    letter-spacing: 0.18em;
    font-size: 11px;
    color: #4d6e18;
}
.card {
    background: white;
    border: 1px solid var(--line);
    padding: 24px;
    border-radius: 3px;
    box-shadow: 0 12px 32px rgba(17, 33, 24, 0.04);
}
.card h2 {
    margin: 0 0 18px;
}
.narrow {
    max-width: 410px;
}
.login {
    min-height: 65vh;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 80px;
    align-items: center;
}
.login > div > p:last-child {
    font-size: 18px;
    color: var(--muted);
    max-width: 600px;
}
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stat {
    background: var(--ink);
    color: white;
    padding: 22px;
    border-left: 5px solid var(--lime);
}
.stat span,
.stat small {
    display: block;
    color: #b9c5be;
}
.stat strong {
    display: block;
    font-size: 32px;
}
.stat strong.word {
    font-size: 22px;
    text-transform: capitalize;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.span2 {
    grid-column: span 2;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title span {
    color: var(--muted);
    font-size: 12px;
}
label {
    display: block;
    margin: 12px 0;
    color: #4d5c54;
    font-size: 13px;
    font-weight: 650;
}
input,
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    border: 1px solid #cbd6cf;
    background: #fbfcfb;
    padding: 11px 12px;
    border-radius: 2px;
    font: inherit;
    color: var(--ink);
}
textarea {
    resize: vertical;
}
button,
.button {
    display: inline-block;
    border: 0;
    background: var(--lime);
    color: var(--ink);
    padding: 11px 16px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    border-radius: 2px;
    min-height: 44px;
}
.secondary {
    background: white;
    border: 1px solid var(--ink);
}
.ghost {
    background: transparent;
    color: white;
    border: 1px solid #516158;
}
.small {
    padding: 8px 10px;
    font-size: 12px;
}
.cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-wide {
    max-width: 820px;
}
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.actions form {
    margin: 0;
}
.check {
    display: flex;
    gap: 7px;
    align-items: center;
}
.check input {
    width: auto;
    margin: 0;
}
.hint,
small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}
.notice {
    padding: 12px 16px;
    margin-bottom: 20px;
}
.notice.ok {
    background: #e9ffd0;
    border-left: 4px solid #6b9b21;
}
.notice.error,
.alert {
    background: #fff0f0;
    color: var(--red);
    padding: 9px;
    border-left: 4px solid var(--red);
}
.notice.lock {
    background: #fff7dc;
    border-left: 4px solid #b88912;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 12px 8px;
}
th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}
td a {
    color: var(--ink);
}
.pill {
    display: inline-block;
    background: #e8eee9;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    text-transform: capitalize;
}
.pill.approved {
    background: #e6f6ff;
}
.pill.paid {
    background: #e9ffd0;
}
.pill.warn {
    background: #ffe4aa;
}
.bar-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.bar-row strong {
    float: right;
}
.bar-row i {
    height: 3px;
    background: var(--lime);
    display: block;
    margin-top: 7px;
}
.expense {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.expense h3 {
    margin: 7px 0 0;
}
.expense p {
    margin: 3px 0 8px;
    color: var(--muted);
}
.review-complete {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding-top: 4px;
}
.capture-hub {
    margin-bottom: 20px;
    border-left: 5px solid var(--lime);
}
.capture-hub form[data-capture-form] {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.capture-button {
    margin: 0;
    padding: 12px 16px;
    background: var(--ink);
    color: white;
    cursor: pointer;
    border-radius: 2px;
}
.capture-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.receipt-queue {
    margin-top: 20px;
    border-top: 1px solid var(--line);
}
.receipt-queue-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.receipt-preview {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #edf2ee;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}
.receipt-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.queue-actions,
.selected-receipt,
.input-action {
    display: flex;
    align-items: center;
    gap: 8px;
}
.queue-actions form { margin: 0; }
.selected-receipt {
    padding: 10px;
    background: #e9ffd0;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.selected-receipt button { margin-left: auto; }
.optional-fields {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: #f8faf8;
}
.optional-fields summary {
    cursor: pointer;
    font-weight: 750;
}
.input-action input { flex: 1; }
.input-action button { margin-top: 5px; white-space: nowrap; }
.qr-dialog {
    width: min(560px, calc(100% - 24px));
    padding: 0;
    border: 0;
    border-radius: 4px;
}
.qr-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.qr-shell { padding: 20px; }
.qr-shell video {
    width: 100%;
    max-height: 55vh;
    background: #0b110e;
}
.version {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.simple {
    padding: 0;
    list-style: none;
}
.simple li {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}
hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 24px 0;
}
.offline-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--ink);
}
.offline-shell {
    width: min(560px, calc(100% - 32px));
    margin: 24px auto;
    padding: 42px;
    background: var(--white);
    border-left: 6px solid var(--lime);
}
.offline-shell img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.offline-shell h1 {
    margin-bottom: 8px;
    font-size: 36px;
}
.offline-shell p:not(.eyebrow) {
    color: var(--muted);
}
@media (max-width: 800px) {
    header {
        height: auto;
        padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left));
        flex-wrap: wrap;
        gap: 18px;
    }
    nav {
        order: 3;
        width: 100%;
        overflow: auto;
        gap: 8px;
        scrollbar-width: none;
    }
    nav a {
        min-height: 44px;
        padding: 11px 12px;
        white-space: nowrap;
        border: 1px solid #3b4c43;
    }
    .header-actions {
        margin-left: auto;
    }
    .login,
    .grid,
    .stats {
        grid-template-columns: 1fr;
    }
    .span2 {
        grid-column: auto;
    }
    .page-head {
        flex-direction: column;
        align-items: start;
        gap: 20px;
    }
    .page-head h1,
    .login h1 {
        font-size: 32px;
    }
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    .expense {
        grid-template-columns: 1fr;
    }
    .receipt-queue-item {
        grid-template-columns: 56px 1fr;
    }
    .queue-actions {
        grid-column: 1 / -1;
    }
    .queue-actions > button,
    .queue-actions form,
    .queue-actions form button {
        flex: 1;
        width: 100%;
    }
    .capture-hub form[data-capture-form] > * {
        width: 100%;
        text-align: center;
    }
    .fiscal-item {
        flex-direction: column;
        gap: 4px;
    }
    .fiscal-item small {
        text-align: left;
        font-size: 13px;
        line-height: 1.45;
    }
    [data-fiscal-checks],
    [data-fiscal-result] {
        font-size: 14px;
        line-height: 1.5;
    }
    .three {
        grid-template-columns: 1fr;
    }
    .table-wrap {
        overflow: auto;
    }
    main {
        padding: 28px 16px 64px;
    }
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
    }
    .card {
        padding: 18px;
    }
    footer {
        padding-bottom: max(25px, env(safe-area-inset-bottom));
    }
}
@media (max-width: 560px) {
    .cols {
        grid-template-columns: 1fr;
    }
    .brand span {
        font-size: 13px;
    }
    .header-actions .ghost {
        padding-inline: 10px;
    }
    .offline-shell {
        padding: 28px 22px;
    }
}
