:root {
    color-scheme: light;
    --ink: #142743;
    --muted: #536783;
    --green: #1e56ce;
    --green-dark: #163e96;
    --background: #eff5ff;
    --stroke: #dbe6f8;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
.workspace { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: #102c63;
    color: #fff;
    padding: 30px 19px;
    display: flex;
    flex-direction: column;
    gap: 42px;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; font-weight: 700; line-height: 1.25; text-decoration: none; }
.mark {
    border-radius: 11px;
    background: #ddecff;
    color: #194cae;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: none;
}
nav { display: grid; gap: 6px; }
nav a { padding: 11px 12px; color: #dae7ff; text-decoration: none; border-radius: 8px; }
nav a:hover, nav [aria-current] { color: #fff; background: #234a92; }
.signout { margin-top: auto; }
main { width: 100%; max-width: 1500px; padding: 36px clamp(18px, 4vw, 55px); }
.guest main { margin: 7vh auto; max-width: 560px; }
.guest .brand { margin-bottom: 30px; }
.top, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.top, .spread { justify-content: space-between; }
.top { margin-bottom: 24px; }
h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.14rem; }
h3 { margin: 0 0 6px; font-size: 1rem; }
p { margin: 0; line-height: 1.45; color: var(--muted); }
p + p { margin-top: 7px; }
a { color: var(--green-dark); }
.panel { background: #fff; padding: clamp(15px, 2.4vw, 26px); border: 1px solid var(--stroke); border-radius: 14px; margin-bottom: 18px; }
.stack { display: grid; gap: 16px; }
.stack > button { justify-self: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cards .panel { margin: 0; }
.metric { display: grid; gap: 7px; }
.metric span { color: var(--muted); font-size: .9rem; }
.metric strong { font-size: clamp(1.1rem, 2vw, 1.55rem); overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
.scanner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; background: #eaf3ff; border-color: #d2e4ff; }
.scanner h2 { margin-bottom: 8px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.check { display: flex; align-items: flex-start; gap: 8px; }
.check input { width: auto; min-height: auto; margin-top: 3px; }
small, .muted { color: var(--muted); font-size: .83rem; font-weight: 400; }
td small { display: block; }
input, textarea, select, button, .button, .secondary { font: inherit; border-radius: 8px; }
input, textarea, select { background: #fff; border: 1px solid #b7ccef; color: inherit; min-width: 0; min-height: 38px; padding: 8px 10px; width: 100%; }
input[readonly] { background: var(--background); }
button, .button, .secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    padding: 9px 14px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    background: var(--green);
    color: white;
}
button:hover, .button:hover { background: var(--green-dark); }
.secondary { border-color: #b3c9ef; color: var(--green-dark); background: #fff; }
.secondary:hover { background: #e8f1ff; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #3069da; outline-offset: 2px; }
.actions input { width: min(290px, 100%); }
.alert, .notice { padding: 13px 16px; border-radius: 8px; background: #fff1d6; color: #683e00; }
.alert { margin-bottom: 17px; background: #ffe7e4; color: #8e291e; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 11px; border-bottom: 1px solid var(--stroke); vertical-align: top; overflow-wrap: anywhere; }
th { background: #f0f5ff; color: #32537f; font-size: .84rem; white-space: nowrap; }
.entry { min-width: 820px; table-layout: fixed; }
.entry th:nth-child(2) { width: 24%; }
.entry th:last-child { width: 58px; }
.entry td { padding: 7px 5px; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 10px; background: #ffefd0; color: #654600; white-space: nowrap; }
.totals { margin: 0 0 0 auto; width: min(100%, 330px); }
.totals div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--stroke); }
.totals dd { margin: 0; font-weight: 650; }
.address { white-space: pre-line; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 780px) {
    .workspace { display: block; }
    .sidebar { padding: 13px 17px; gap: 13px; }
    nav { display: flex; flex-wrap: wrap; }
    .signout { margin: 0; }
    .scanner { grid-template-columns: 1fr; }
    main { padding-top: 22px; }
}
@media print {
    :root { background: white; font-size: 11px; }
    .workspace { display: block; }
    .sidebar, .top, .no-print, .alert { display: none; }
    main, .panel { margin: 0; padding: 0; border: none; }
    .table-wrap { overflow: visible; }
    th, td { padding: 5px; }
    th { white-space: normal; }
    tr, .totals { break-inside: avoid; }
}

.workspace { grid-template-columns: 235px minmax(0, 1fr); }
.sidebar { gap: 25px; }
.sidebar .mark { letter-spacing: -.07em; font-weight: 850; }
.guest {
    min-height: 100vh;
    background: #f5f8ff;
    display: grid;
    grid-template-columns: minmax(0,1.13fr) minmax(0,1fr);
}
.guest main {
    align-self: center;
    max-width: 560px;
    margin: 0 auto;
    padding: 40px clamp(24px,5vw,68px);
}
.landing-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100vh;
    background: radial-gradient(ellipse at 48% 53%, #1d5dcd 0%, #123673 60%, #0d2553 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 50px 20px;
}
.landing-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(128deg, transparent 0 42px, #77adff14 43px 44px);
    mask-image: radial-gradient(ellipse, transparent 25%, black 95%);
    z-index: -1;
}
.landing-orbit {
    display: grid;
    place-items: center;
    width: clamp(205px,32vw,405px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid #91bdff66;
    box-shadow: 0 0 0 23px #73aaff15, 0 0 0 55px #73aaff0a, inset 0 0 50px #bfd9ff24;
}
.landing-monogram {
    color: #f9fbff;
    font-size: clamp(5rem,15vw,13rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.115em;
    padding-inline-end: .115em;
    text-shadow: 0 10px 30px #07265f90;
}
.landing-name { text-align: center; font-size: clamp(1.05rem,2.25vw,1.7rem); font-weight: 720; letter-spacing: -.025em; }
.login-panel { box-shadow: 0 14px 36px #173f8710; }
.login-panel button { justify-self: stretch; }
#ocr-text { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 780px) {
    .guest { display: block; }
    .landing-brand { min-height: 0; padding: 24px; gap: 14px; }
    .landing-orbit { width: 118px; box-shadow: 0 0 0 12px #73aaff15; }
    .landing-monogram { font-size: 3.7rem; }
    .guest main { padding: 24px; }
}
[hidden] { display: none !important; }
