:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #152235;
  background: #f3f5f8;
  font-synthesis: none;
  --muted: #526276;
  --line: #dce3eb;
  --accent: #b63d16;
  --nav: #141c2b;
}
* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
[hidden] { display: none !important; }
.sidebar { background: var(--nav); color: #edf1f7; padding: 28px 16px; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 0 8px; font-size: 19px; font-weight: 760; letter-spacing: -.03em; }
.brand small { display: block; color: #aebdce; font-size: 12px; font-weight: 500; letter-spacing: 0; margin-top: 4px; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; background: #fd8a65; border-radius: 9px; flex: 0 0 auto; }
.mark::before { content: ""; width: 13px; height: 17px; border: solid var(--nav); border-width: 0 4px 4px 0; border-radius: 0 0 6px 2px; transform: skew(-20deg); }
nav { margin-top: 43px; display: grid; gap: 5px; }
nav a { color: #c5d0de; text-decoration: none; font-size: 14px; font-weight: 620; border-radius: 8px; padding: 11px 12px; display: flex; align-items: center; gap: 13px; }
nav a span { text-align: center; width: 21px; font-size: 19px; line-height: 1; }
nav a:hover { background: #222d40; }
nav a[aria-current] { background: #2b374c; color: white; }
nav a[aria-current] span { color: #fd9b7b; }
main { min-width: 0; padding: 46px 36px; max-width: 1740px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 27px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.052em; line-height: 1.06; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 11px; line-height: 1.5; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: default; }
.primary, .secondary { border-radius: 8px; padding: 10px 15px; min-height: 41px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.primary { border: 1px solid transparent; background: var(--accent); color: white; }
.primary:hover:enabled { background: #99300f; }
.secondary { background: white; border: 1px solid var(--line); }
.secondary:hover:enabled { background: #f8f9fb; }
:focus-visible { outline: 2px solid #2460af; outline-offset: 3px; }
.sidebar :focus-visible { outline-color: #fd9b7b; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 25px; }
.metric { border: 1px solid var(--line); background: white; border-radius: 11px; padding: 17px 18px; min-width: 0; }
.metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.35; }
.metric strong { display: block; margin-top: 6px; font-size: clamp(22px, 2.7vw, 32px); letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.panel-top { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid var(--line); }
h2 { font-size: 17px; letter-spacing: -.02em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { min-width: 0; max-width: 100%; padding: 9px 10px; min-height: 38px; border: 1px solid #bac7d6; background: white; border-radius: 7px; font-size: 13px; }
.filters input { width: 202px; }
.table-wrap { max-height: min(65dvh, 40rem); overflow: auto; }
.table-wrap:empty { display: none; }
.table-wrap:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 13px; }
th { font-size: 11px; letter-spacing: .035em; background: #f7f9fb; color: var(--muted); }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; }
th, td { padding: 12px 16px; border-bottom: 1px solid #e7ecf2; vertical-align: middle; }
td { line-height: 1.4; }
td strong { display: block; font-weight: 680; }
td small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; border-radius: 6px; padding: 3px 7px; background: #edf1f5; color: #3c4e63; font-size: 11px; font-weight: 675; white-space: nowrap; }
.pill.good { background: #e6f5ec; color: #176342; }
.pill.wait { background: #fff0da; color: #7c4109; }
.pill.move { background: #e8effb; color: #2455a0; }
.row-action { padding: 5px 9px; min-height: 29px; }
.empty { text-align: center; padding: 57px 18px; color: var(--muted); line-height: 1.55; }
.empty strong { display: block; color: #152235; font-size: 17px; margin-bottom: 7px; }
.empty p { font-size: 14px; }
.empty button { margin-top: 17px; }
.panel footer { color: var(--muted); padding: 12px 17px; font-size: 12px; }
dialog { width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 13px; padding: 0; box-shadow: 0 24px 80px #0b18264d; }
dialog::backdrop { background: #0b18267a; }
.dialog-head, .dialog-foot { padding: 16px 20px; display: flex; align-items: center; gap: 9px; background: #fff; }
.dialog-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 21px; }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--line); }
.close { background: transparent; border: 0; border-radius: 6px; font-size: 24px; line-height: 1; padding: 4px 8px; }
.close:hover { background: #edf1f5; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 13px; padding: 19px 20px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 650; }
.field small, .field-note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.field-note { grid-column: 1 / -1; background: #f1f5f9; border-radius: 7px; padding: 9px 12px; }
textarea { resize: vertical; min-height: 63px; }
#form-error { margin: 0 20px 15px; color: #9d270c; font-size: 13px; line-height: 1.45; }
#toast { position: fixed; inset: auto 20px 20px auto; background: #192639; color: white; font-size: 14px; padding: 12px 16px; border-radius: 8px; box-shadow: 0 8px 24px #0b182633; max-width: calc(100% - 40px); }
@media (max-width: 1000px) {
  body { grid-template-columns: 174px minmax(0, 1fr); }
  main { padding: 35px 22px; }
  th, td { padding-left: 11px; padding-right: 11px; }
}
@media (max-width: 730px) {
  body { display: block; }
  .sidebar { padding: 13px 12px 7px; }
  .brand { font-size: 17px; }
  .brand small { display: none; }
  .mark { width: 30px; height: 30px; }
  nav { margin-top: 10px; display: flex; gap: 4px; overflow: auto; }
  nav a { white-space: nowrap; padding: 8px 9px; gap: 5px; font-size: 13px; }
  main { padding: 24px 13px; }
  .page-head { align-items: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .metric { padding: 10px 12px; }
  .panel-top { padding: 12px; }
  .filters input { flex: 1 1 170px; }
  .filters select { flex: 1 1 auto; }
}
.sign-out { margin: 24px 8px 0; }
.sign-out button { color: #152235; }
body.sign-in { display: grid; place-items: center; padding: 18px; }
.sign-in main { max-width: 420px; padding: 25px; }
.sign-in h1 { font-size: 34px; }
.sign-in form { display: grid; gap: 16px; margin-top: 20px; }
.sign-in .error { color: #9d270c; margin-top: 12px; }
@media (max-width: 730px) {
  .sign-out { margin: 7px 8px; }
  .sign-out button { min-height: 29px; padding: 4px 8px; }
}
.stock-details summary, .edit-specs summary { cursor: pointer; color: #2455a0; font-size: 12px; font-weight: 650; margin-top: 5px; }
.stock-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: 12px; }
.stock-details dt { color: var(--muted); }
.stock-details dd { margin: 0; overflow-wrap: anywhere; }
.edit-specs > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.order-totals { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.order-totals strong { margin-left: 5px; color: #152235; }
.dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-card { padding: 18px; min-width: 0; }
.dashboard-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dashboard-card-head a { color: #2455a0; font-size: 12px; font-weight: 650; text-underline-offset: 2px; }
.dashboard-headlines { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 17px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dashboard-headline { display: grid; align-content: start; flex: 1 1 112px; min-width: 0; gap: 4px; }
.dashboard-headline strong { font-size: clamp(25px, 3vw, 36px); line-height: 1.1; letter-spacing: -.045em; overflow-wrap: anywhere; }
.dashboard-headline span, .dashboard-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.dashboard-totals { margin: 0; }
.dashboard-totals > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e7ecf2; font-size: 13px; line-height: 1.35; }
.dashboard-totals > div:last-child { border-bottom: 0; padding-bottom: 0; }
.dashboard-totals dt { color: var(--muted); }
.dashboard-totals dd { margin: 0; text-align: right; font-weight: 700; }
.dashboard-headline strong, .dashboard-totals dd { font-variant-numeric: tabular-nums; }
.dashboard-note { margin-top: 14px; }
@media (max-width: 680px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
}
.order-items { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; margin: 0; min-width: 0; padding: 10px; }
.order-items legend { padding: 0 5px; font-size: 13px; font-weight: 700; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(65px, .28fr) minmax(105px, .46fr) auto; gap: 7px; align-items: end; margin-bottom: 10px; }
.order-line select { width: 100%; }
.order-line-remove { min-height: 38px; padding: 8px; }
.order-table-line + .order-table-line { margin-top: 7px; }
@media (max-width: 550px) {
  .order-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .order-line-sku { grid-column: 1 / -1; }
}
.form-checkbox { display: flex; align-items: center; align-self: center; gap: 8px; font-size: 13px; font-weight: 650; min-height: 38px; }
.form-checkbox input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }

.payment-tracking { display: grid; justify-items: start; gap: 4px; }
.payment-tracking-fields { grid-column: 1 / -1; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.payment-tracking-fields legend { padding: 0 5px; font-size: 13px; font-weight: 700; }
.tracking-hint { color: var(--muted); font-size: 12px; margin: 4px 0; }
.order-address { grid-column: 1 / -1; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.order-address legend { padding: 0 5px; font-size: 13px; font-weight: 700; }
.order-address-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 13px; }
.stock-details address { color: var(--muted); font-size: 12px; font-style: normal; margin-top: 5px; overflow-wrap: anywhere; }
.inventory-curve th, .order-status-group th { background: #e2eaf4; color: #152235; font-size: 14px; padding-top: 10px; padding-bottom: 10px; }
.inventory-hand th { background: #f3f6fa; color: #384d66; font-size: 12px; padding-top: 6px; padding-bottom: 6px; }
.inventory-flex { vertical-align: top; font-weight: 700; color: #384d66; }
