:root {
  color-scheme: light;
  --ink: #142037;
  --ink-deep: #101d31;
  --muted: #515e71;
  --neutral: #e2e8f0;
  --canvas: #f3f6fa;
  --surface: #fff;
  --blue: #2056b6;
  --rail: #102137;
  --rail-muted: #afc3da;
  --line-rail: #324a64;
  --signal: #a8d1ff;
  --radius: .86rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); }
:where(a,button,summary,input,select,[tabindex]):focus-visible { outline: 3px solid #3074dd; outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline-offset: 1px; }
img { max-width: 100%; height: auto; display: block; }
svg { flex: none; }
p { line-height: 1.55; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem,4.6vw,3.15rem); letter-spacing: -.06em; line-height: 1.05; }
h2 { font-size: 1.1rem; letter-spacing: -.025em; }
small { font-size: .78rem; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button[hidden] { display: none; }
.skip { position: fixed; z-index: 3; top: .5rem; left: .5rem; transform: translateY(-180%); padding: .7rem 1rem; border-radius: .4rem; background: var(--surface); }
.skip:focus { transform: translateY(0); }
.mono, .id-link { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }
.workspace { display: grid; grid-template-columns: 15.5rem minmax(0,1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; align-self: start; display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem .92rem; background: var(--rail); color: white; overflow-y: auto; }
.rail-brand { display: flex; align-items: center; gap: .65rem; min-height: 2.8rem; color: white; font-size: 1.23rem; text-decoration: none; letter-spacing: -.045em; padding-inline: .42rem; }
.rail-brand strong { color: var(--signal); }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid #89b4ed; border-radius: .54rem; color: #cae3ff; background: #203a59; font-size: 1rem; font-weight: 820; }
.rail-nav { display: grid; gap: .28rem; }
.rail-nav a { display: flex; align-items: center; gap: .68rem; min-height: 2.75rem; padding: .5rem .68rem; border: 1px solid transparent; border-radius: .5rem; color: #d5e3f1; text-decoration: none; font-size: .92rem; font-weight: 610; white-space: nowrap; }
.rail-nav a svg { color: #8eaff0; }
.rail-nav a[aria-current="page"] { color: white; background: #213b57; border-color: #3b6387; }
.rail-nav a[aria-current="page"] svg { color: var(--signal); }
.rail-nav a:hover { background: #20364e; }
.rail :where(a,button):focus-visible { outline-color: #9bc9ff; }
.rail-account { margin-top: auto; border-top: 1px solid var(--line-rail); padding: .9rem .16rem 0; display: flex; align-items: center; gap: .52rem; }
.rail-account > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.rail-account strong, .rail-account small { display: block; }
.rail-account strong { font-size: .82rem; color: #f7fbff; }
.rail-account small { color: var(--rail-muted); font-size: .71rem; }
.avatar { width: 1.85rem; height: 1.85rem; flex: none; display: grid; place-items: center; background: #263e5a; border-radius: 50%; color: #cfe5ff; font-size: .86rem; font-weight: 700; }
.logout { border: 1px solid #527294; border-radius: .43rem; color: #f3f8ff; background: transparent; font-size: .76rem; padding: .46rem .56rem; }
.logout:hover { background: #263e5a; }
.content { min-width: 0; padding: clamp(.9rem,3.2vw,2.65rem); max-width: 100rem; width: 100%; margin: 0 auto; }
.content:focus { outline: none; }
.topline { margin-bottom: 1.23rem; color: var(--muted); font-size: .78rem; font-weight: 690; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.55rem; }
.page-head p { color: var(--muted); margin-top: .54rem; max-width: 60ch; }
.sale-head { margin-top: .6rem; }
.back, .text-link { color: var(--blue); text-decoration: none; font-size: .87rem; font-weight: 700; }
.back:hover, .text-link:hover { text-decoration: underline; }
.status-row { display: flex; gap: .3rem; flex-wrap: wrap; }
.metrics { margin-bottom: 1.1rem; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(13rem,100%),1fr)); gap: .72rem; }
.metric { display: grid; grid-template-rows: auto 1fr auto; align-items: start; gap: .52rem; min-height: 8.3rem; padding: .82rem 1rem .92rem; border: 1px solid var(--neutral); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.metric svg { width: 1.12rem; height: 1.12rem; color: #3b64a4; }
.metric span { font-size: .84rem; font-weight: 700; color: #415268; }
.metric strong { font-size: clamp(1.25rem,2.8vw,2rem); letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1.07; overflow-wrap: anywhere; }
a.metric:hover { border-color: #6795cc; }
.metric-warm { border-top: 3px solid #d78850; }
.metric-blue { background: #e5f0ff; border-color: #c1d9f7; }
.panel { margin-bottom: 1rem; border: 1px solid var(--neutral); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 3px #17335807; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem; }
.panel-head h2 { display: inline-flex; align-items: center; gap: .6rem; }
.panel-head h2 svg { color: var(--blue); }
.panel-count { color: var(--muted); font-size: .81rem; white-space: nowrap; }
.panel-content { padding: 1rem; }
.panel-head + .panel-content { padding-top: .2rem; }
.columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .82rem; }
.columns:has(.totals) { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); }
.columns .panel { align-self: start; }
.collapsible summary { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .88rem 1rem; color: var(--ink); font-weight: 740; cursor: pointer; min-height: 3.15rem; list-style: none; }
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible[open] > summary { border-bottom: 1px solid var(--neutral); }
.summary-plus { color: var(--blue); font-size: 1.2rem; line-height: 1; }
.collapsible[open] .summary-plus { transform: rotate(45deg); }
.stack { display: grid; align-content: start; gap: .85rem; }
.form-grid, .line-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
.form-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.line-row { grid-template-columns: minmax(9rem,1.5fr) minmax(5rem,.7fr) minmax(7rem,1fr) auto; align-items: end; margin-bottom: .6rem; }
label { display: grid; gap: .35rem; color: #23344b; font-size: .84rem; font-weight: 680; min-width: 0; }
label:has(input[type="checkbox"]) { display: flex; align-items: center; }
input:not([type="hidden"],[type="checkbox"]), select { display: block; width: 100%; min-width: 0; min-height: 2.76rem; padding: .52rem .62rem; border: 1px solid #aab7c9; border-radius: .54rem; background: #fdfefe; color: var(--ink-deep); font-size: .94rem; font-weight: 500; }
input[type="checkbox"] { accent-color: var(--blue); width: 1.02rem; height: 1.02rem; flex: none; }
input::placeholder { color: #5b687a; opacity: 1; }
.form-hint { color: var(--muted); font-size: .88rem; }
.primary, .secondary, .remove-row { display: inline-flex; align-items: center; justify-content: center; padding: .47rem .78rem; min-height: 2.75rem; border: 1px solid transparent; border-radius: .52rem; font-size: .86rem; font-weight: 750; text-decoration: none; white-space: normal; text-align: center; }
.primary { color: white; background: var(--blue); }
.primary:hover { background: #1a4695; }
.secondary { color: #234a82; background: #fff; border-color: #9cb6d7; }
.secondary:hover { background: #edf4ff; }
.remove-row { background: #fdf2f1; color: #995045; width: 2.75rem; font-size: 1.15rem; padding: .2rem; }
.remove-row:hover { background: #fbe4e0; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: .58rem; }
.filters label { flex: 1 1 10rem; max-width: 23rem; }
.filters .text-link { align-self: center; margin-top: .9rem; }
.web-shortcuts { display: flex; flex-wrap: wrap; gap: .55rem; }
.catalogue-filters { margin-top: .85rem; }
.catalogue-jump { display: inline-block; margin-top: .85rem; }
.listing-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; padding: .72rem .86rem; border-top: 1px solid var(--neutral); color: var(--muted); font-size: .82rem; }
.listing-pages > div { display: flex; flex-wrap: wrap; gap: .42rem; }
.pill-beauty { border-color: #e4c6d9; background: #faf0f7; color: #693755; }
td .demo-label { color: #70400d; font-weight: 710; }
.table-wrap { max-width: 100%; overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .87rem; line-height: 1.33; }
th, td { padding: .66rem .85rem; text-align: left; border-top: 1px solid var(--neutral); vertical-align: middle; }
th { font-size: .74rem; background: #f4f7fb; color: #43546a; }
td small { display: block; color: var(--muted); padding-top: .16rem; }
tbody tr:hover { background: #f8fbff; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.id-link { font-weight: 740; text-underline-offset: .18rem; }
.pill { display: inline-flex; align-items: center; min-height: 1.45rem; border: 1px solid #c2d0e0; border-radius: 1rem; padding: .12rem .5rem; color: #364d65; background: #f2f6fa; font-size: .73rem; font-weight: 730; white-space: nowrap; }
.pill-pending { border-color: #e4c59e; background: #fff3dc; color: #70400d; }
.pill-preparing, .pill-shipped { border-color: #b8cfee; background: #eaf3ff; color: #204881; }
.pill-ready, .pill-completed, .pill-paid { border-color: #aed8c4; background: #e9f7ee; color: #205b45; }
.pill-cancelled, .pill-canceled { border-color: #e8b6ba; background: #fff1ef; color: #813742; }
.empty { padding: 1rem; border-top: 1px solid var(--neutral); color: var(--muted); font-size: .88rem; }
.empty strong { color: var(--ink); }
.empty p { margin-top: .15rem; }
.facts, .totals { margin: 0; display: grid; gap: .72rem; }
.facts dt, .totals dt { color: var(--muted); font-size: .79rem; }
.facts dd, .totals dd { margin: .16rem 0 0; font-size: .92rem; font-weight: 650; overflow-wrap: anywhere; }
.totals { padding: 1rem; justify-content: end; }
.totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; }
.totals .total dd { font-size: 1.12rem; }
.timeline { margin: 0; list-style: none; }
.timeline li { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; padding: .52rem 0; border-top: 1px solid var(--neutral); gap: .35rem; }
.timeline span:not(.pill), .timeline small { color: var(--muted); font-size: .81rem; }
.timeline span:not(.pill) { display: block; margin: .16rem 0; }
.low-stock, .movement-out { color: #855524; }
.movement-in { color: #266448; font-weight: 730; }
.user-indicator { margin-left: .55rem; color: var(--muted); }
.permissions { margin: 0; border: 1px solid var(--neutral); padding: .65rem; border-radius: .6rem; }
.permissions legend { font-size: .87rem; font-weight: 750; }
.permission-row { display: grid; grid-template-columns: minmax(5rem,1fr) minmax(3rem,.6fr) minmax(4.5rem,.7fr); padding: .32rem 0; border-bottom: 1px solid #eaf0f6; align-items: center; font-size: .85rem; gap: .25rem; max-width: 30rem; }
.permission-row:last-child { border-bottom: 0; }
.check { gap: .35rem; }
.flash { margin: 0 0 1rem; padding: .76rem .88rem; background: #edf5ff; border: 1px solid #a8c6ef; border-radius: .64rem; color: #17447b; font-size: .89rem; overflow-wrap: anywhere; }
.flash-error { background: #fff1ef; border-color: #e0aaad; color: #833244; }
.flash-success { background: #e8f8ef; border-color: #abd0bc; color: #18553d; }
.backup-panel { max-width: 46rem; }
.backup-panel p { color: var(--muted); }
.access-body { background: #e9eff7; }
.access { min-height: 100dvh; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,1fr); }
.access-brand { color: #fff; background: var(--rail); display: flex; flex-direction: column; align-items: start; justify-content: space-between; gap: 2rem; padding: clamp(1.3rem,5.6vw,6rem); position: relative; overflow: hidden; isolation: isolate; }
.access-brand::before { content: ""; position: absolute; z-index: -1; inset: 18% -12% 0 3%; background: linear-gradient(142deg,transparent 20%,#1b457134 48%,#3270ae68 72%,transparent 73%); transform: skewY(-13deg); pointer-events: none; }
.access-brand-content { margin-bottom: clamp(1rem,13vh,9rem); }
.access-brand h2 { margin: .45rem 0 .75rem; font-size: clamp(3rem,8vw,7.25rem); line-height: .94; letter-spacing: -.085em; }
.access-brand h2 span { color: var(--signal); }
.access-brand-content > p:last-child { color: var(--rail-muted); max-width: 25ch; font-size: 1.04rem; }
.eyebrow { color: #a0c4ed; font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.access-form { display: grid; place-items: center; padding: clamp(1.35rem,5vw,4rem); background: #f8fafd; }
.access-form > div { width: min(100%,26rem); }
.access-kicker { color: #245f9e; margin-bottom: .44rem; }
.access-form h1 { margin-bottom: .32rem; }
.access-form .form-hint { margin: 0 0 1.15rem; }
.access-form .primary { min-height: 3rem; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 12rem minmax(0,1fr); }
  .rail { padding-inline: .62rem; }
  .columns:has(.totals) { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: .75rem .85rem; display: grid; grid-template-columns: auto minmax(0,1fr); gap: .55rem; }
  .rail-brand { min-height: 2.4rem; padding: 0; }
  .rail-account { margin: 0; padding: 0; border: 0; justify-self: end; }
  .rail-account .avatar { display: none; }
  .rail-nav { grid-column: 1/-1; grid-row: 2; display: flex; flex-wrap: wrap; gap: .24rem; }
  .rail-nav a { font-size: .8rem; min-height: 2.75rem; padding: .35rem .49rem; gap: .3rem; }
  .rail-nav a svg { width: .9rem; height: .9rem; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .columns { grid-template-columns: 1fr; gap: 0; }
  .access { grid-template-columns: 1fr; min-height: 100dvh; grid-template-rows: auto 1fr; }
  .access-brand { gap: 1rem; }
  .access-brand img { width: 7rem; }
  .access-brand-content { margin-bottom: 0; }
  .access-brand h2 { font-size: clamp(2.2rem,10vw,3.5rem); }
  .access-form { align-items: start; }
}
@media (max-width: 565px) {
  .line-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; padding: .55rem; border: 1px solid var(--neutral); border-radius: .5rem; }
  .line-row label:first-child { grid-column: 1/-1; }
  .line-row .remove-row { align-self: end; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: .66rem; }
}
