:root {
    color-scheme: dark;
    --canvas: #11161c;
    --surface: #191f27;
    --input: #11171e;
    --sidebar: #10151b;
    --ink: #e3e8ef;
    --muted: #96a2b3;
    --border: #2d3642;
    --green: #9bd7b2;
    --red: #f0aaa9;
    --yellow: #dfcc91;
    --blue: #b1cce9;
    --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --mono: Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, .table-scroll:focus-visible { outline: 2px solid #8faec7; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.35; }
h3 { font-size: 15px; font-weight: 600; }
.muted, .small-muted, .field-help { color: var(--muted); }
.small-muted, .field-help { font-size: 12px; line-height: 1.6; }
.mono { font-family: var(--mono); font-size: 12px; }
.money, .numeric { font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 10px 16px; background: var(--ink); color: var(--canvas); }
.skip-link:focus { top: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #445365; border-radius: 5px; background: #283440; color: #dce7f0; font-size: 13px; font-weight: 700; }
.brand-copy { font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: .03em; }
.brand-copy small { display: block; font-size: 9px; color: var(--muted); font-weight: 400; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 38px; padding: 8px 15px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.button-primary { background: #d6e0ea; color: #13202d; border-color: #d6e0ea; }
.button-primary:hover { background: #eef3f7; border-color: #eef3f7; }
.button-secondary { background: #222b36; color: var(--ink); }
.button-secondary:hover { background: #2c3744; }
.button-wide { width: 100%; }
.text-link, .back-link { display: inline-flex; gap: 8px; font-size: 12px; color: #bbcee1; }
.text-link:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-link { margin-bottom: 14px; }
.badge { display: inline-block; border-radius: 4px; padding: 3px 8px; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.badge-neutral { background: #2b333e; color: #b9c2ce; }
.badge-positive { background: #21382e; color: var(--green); }
.badge-negative { background: #422b2e; color: var(--red); }
.badge-warning { background: #3d3829; color: var(--yellow); }
.badge-blue { background: #273c50; color: var(--blue); }
.badge-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.notice { border: 1px solid var(--border); background: #202b37; color: #c0cfdf; border-radius: 5px; padding: 12px 15px; margin-bottom: 20px; font-size: 12px; overflow-wrap: anywhere; }
.notice-success { background: #21382e; color: var(--green); border-color: #355645; }
.notice-error { background: #422b2e; color: var(--red); border-color: #634044; }
.notice-warning { background: #3d3829; color: var(--yellow); border-color: #5d533a; }
.form-stack { display: flex; flex-direction: column; gap: 17px; }
.form-stack > .button { align-self: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .filter-form label { font-size: 12px; font-weight: 600; }
input:not([type="checkbox"]):not([type="hidden"]), textarea, select { width: 100%; background: var(--input); color: var(--ink); border: 1px solid #35404d; border-radius: 5px; padding: 9px 11px; min-height: 39px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #738297; font-size: 12px; }
input:hover, textarea:hover, select:hover { border-color: #54677c; }
textarea { resize: vertical; }
input[type="checkbox"] { margin: 2px 0 0; width: 16px; height: 16px; accent-color: #bfd1df; flex-shrink: 0; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
fieldset { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 0; margin: 0; border: 0; }
legend { font-size: 12px; font-weight: 600; padding-bottom: 12px; }
.check-field { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; cursor: pointer; }
.check-field strong { font-weight: 500; }
.check-field small { display: block; color: var(--muted); font-size: 11px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.price-field { max-width: 350px; }
.form-bottom-row { display: flex; align-items: center; gap: 25px; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.input-affix input:not([type="hidden"]) { padding-left: 36px; }
.custom-fields { border: 1px solid var(--border); border-radius: 5px; padding: 11px 13px; }
.custom-fields summary, .bulk-stock > summary { color: #bdcbd9; cursor: pointer; font-size: 12px; font-weight: 600; }
.custom-fields .field { margin-top: 16px; }
code { font-family: var(--mono); color: #bfccda; font-size: 11px; overflow-wrap: anywhere; }
.login-page { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-layout { width: 100%; max-width: 400px; }
.login-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 28px; }
.login-form-card .brand { margin-bottom: 26px; }
.login-form-card h1 { font-size: 23px; margin-bottom: 7px; }
.login-form-card > .muted { font-size: 12px; margin-bottom: 24px; }
.login-form-card .button-wide { align-self: stretch; margin-top: 4px; }
.login-security { margin-top: 19px; font-size: 11px; color: var(--muted); }
.login-footnote { font-size: 10px; color: #7f8d9f; text-align: center; margin-top: 18px; }
.app-shell { display: grid; grid-template-columns: 215px minmax(0, 1fr); min-height: 100svh; }
.sidebar { background: var(--sidebar); padding: 24px 16px 18px; border-right: 1px solid var(--border); position: sticky; top: 0; align-self: start; height: 100svh; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 6px; }
.navigation { display: flex; flex-direction: column; gap: 5px; margin-top: 30px; }
.nav-link { padding: 9px 12px; border-radius: 5px; font-size: 12px; color: #98a6b8; }
.nav-link:hover { background: #1d2733; color: var(--ink); }
.nav-link.is-active { background: #263342; color: #d6e1ed; }
.sidebar-bottom { margin-top: auto; padding: 17px 6px 0; }
.account { border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 12px; }
.account strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.account small { display: block; font-size: 11px; color: var(--muted); }
.logout-button { padding: 0; background: none; border: 0; color: #aab7c9; font-size: 12px; }
.logout-button:hover { color: var(--ink); text-decoration: underline; }
.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 57px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--border); background: #141a22; color: var(--muted); font-size: 11px; }
.topbar-meta { font-size: 10px; color: #748396; }
.breadcrumb-divider { margin: 0 10px; color: #596779; }
.main-content { padding: 27px 28px 42px; width: 100%; max-width: 1430px; margin: 0 auto; flex: 1; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 23px; }
.page-heading p { color: var(--muted); font-size: 12px; margin-top: 7px; }
.gateway-status { display: inline-block; padding: 5px 9px; border: 1px solid #4a4335; border-radius: 5px; color: #cdbd8f; font-size: 10px; white-space: nowrap; }
.workspace-footer { padding: 17px 28px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 15px; color: #7f8d9e; font-size: 10px; }
.surface, .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.surface { margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.stat-card { padding: 17px 18px; }
.stat-card:hover { border-color: #596c82; }
.stat-label { display: block; color: var(--muted); font-size: 11px; }
.stat-value { display: block; font-size: 23px; font-weight: 600; line-height: 1.3; margin-top: 10px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.section-heading { padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.form-surface { padding: 21px; }
.form-surface > .section-heading { padding: 0 0 19px; }
.table-surface { overflow: hidden; }
.table-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #516174 #191f27; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 12px; text-align: left; }
th { background: #161c24; color: #8f9eb1; font-size: 11px; font-weight: 500; padding: 12px 17px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 17px; border-bottom: 1px solid var(--border); vertical-align: middle; }
td:first-child { min-width: 130px; }
td strong { font-size: 12px; font-weight: 600; }
td small { display: block; color: #8392a6; font-size: 11px; margin-top: 4px; }
td a { color: #b5cbe0; }
td a:hover { text-decoration: underline; text-underline-offset: 3px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1d2631; }
.table-meta { display: block; color: #718196; font-size: 10px; margin-top: 4px; }
.table-actions { display: flex; justify-content: flex-end; gap: 14px; white-space: nowrap; }
.align-right { text-align: right; }
.date { white-space: nowrap; font-size: 11px; color: #96a5b8; }
.row-button { border: 0; background: none; color: #d5b6b4; padding: 4px 0; font-size: 11px; }
.row-button:hover { color: #f0aaa9; text-decoration: underline; }
.table-footer { border-top: 1px solid var(--border); padding: 11px 17px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 34px 24px; text-align: center; }
.empty-state p { color: var(--muted); font-size: 12px; max-width: 430px; margin: 9px auto 0; }
.context-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 21px; }
.context-card h2 { font-size: 20px; }
.context-card .back-link { margin-bottom: 7px; }
.context-card p { margin-top: 7px; }
.bulk-stock { padding: 0; }
.bulk-stock > summary { padding: 17px 21px; }
.bulk-content { padding: 0 21px 21px; }
.bulk-content > p { margin-bottom: 17px; }
.search-form, .filter-form { display: flex; gap: 9px; align-items: center; }
.search-form { width: min(100%, 400px); }
.search-form input:not([type="hidden"]) { font-size: 12px; }
.user-summary { padding: 21px; }
.user-identity h2 { font-size: 20px; margin-bottom: 5px; overflow-wrap: anywhere; }
.user-metrics { display: grid; grid-template-columns: 1fr .5fr .6fr 1.2fr; gap: 20px; margin: 19px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.user-metrics dt { color: var(--muted); font-size: 11px; }
.user-metrics dd { margin: 5px 0 0; font-size: 14px; }
.user-metrics dd.date { font-size: 11px; }
.user-form-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
.user-form-grid .surface { align-self: start; }
.group-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 23px 0 15px; }
.filter-surface { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 21px; }
.filter-form select { width: 165px; font-size: 12px; }
.filter-form label { color: var(--muted); font-size: 11px; }
.reason-cell { min-width: 190px; max-width: 320px; overflow-wrap: anywhere; }
.text-positive { color: var(--green); }
.text-negative { color: var(--red); }
.audit-detail { min-width: 90px; max-width: 320px; }
.audit-detail summary { color: #acbdd0; font-size: 11px; cursor: pointer; }
.audit-detail pre { font: 11px/1.7 var(--mono); background: var(--input); border: 1px solid var(--border); border-radius: 5px; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 230px; overflow: auto; }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .page-heading { flex-wrap: wrap; } .section-heading { flex-wrap: wrap; } .user-metrics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .app-shell { grid-template-columns: 190px minmax(0, 1fr); } .sidebar { padding-left: 11px; padding-right: 11px; } .main-content, .topbar, .workspace-footer { padding-left: 22px; padding-right: 22px; } .user-form-grid { grid-template-columns: 1fr; gap: 0; } .filter-surface { align-items: flex-start; flex-direction: column; } .filter-form { width: 100%; } .filter-form select { flex: 1; } }
@media (max-width: 700px) {
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 18px 18px 0; }
    .sidebar .brand { margin: 0; }
    .sidebar-bottom { position: absolute; top: 26px; right: 20px; margin: 0; padding: 0; }
    .account { display: none; }
    .navigation { flex-direction: row; overflow-x: auto; margin: 18px -3px 0; padding: 0 0 14px; gap: 5px; scrollbar-width: none; }
    .navigation::-webkit-scrollbar { display: none; }
    .nav-link { flex-shrink: 0; font-size: 11px; padding: 7px 10px; }
    .topbar { height: 45px; padding: 0 19px; }
    .topbar-meta { display: none; }
    .main-content { padding: 23px 18px 32px; }
    .page-heading { gap: 13px; }
    h1 { font-size: 23px; }
    .gateway-status { font-size: 9px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .stats-grid .stat-card:last-child { grid-column: 1 / -1; }
    .form-columns { grid-template-columns: 1fr; gap: 17px; }
    .form-surface, .user-summary { padding: 18px; }
    .section-heading { padding: 17px 18px; gap: 14px; }
    .form-actions { flex-direction: column; align-items: flex-start; gap: 15px; }
    .form-actions .small-muted { font-size: 11px; }
    .search-form { width: 100%; }
    .context-card { align-items: flex-start; flex-wrap: wrap; gap: 13px; }
    .context-card h2 { font-size: 18px; }
    .bulk-stock > summary { padding: 17px 18px; }
    .bulk-content { padding: 0 18px 18px; }
    .filter-surface { padding: 17px 18px; }
    .filter-form label { display: none; }
    .user-metrics { gap: 16px; }
    .user-metrics dd.money { font-size: 13px; }
    .user-metrics dd.date { white-space: normal; }
    .workspace-footer { padding: 16px 19px; flex-direction: column; gap: 4px; }
    .group-heading { flex-wrap: wrap; gap: 9px; }
    .login-page { padding: 20px; }
    .login-form-card { padding: 23px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }