/* Screen palette for the warehouse workspace. Print layouts use app.css. */
:root {
  color-scheme: dark;
  --bg: #141311;
  --sidebar: #191816;
  --card: #201e1a;
  --well: #181715;
  --raised: #2a2722;
  --ink: #f5f1e9;
  --muted: #c0b9ad;
  --faint: #aba395;
  --gold: #e2b666;
  --gold-dark: #e5bc76;
  --line: #413c33;
  --green: #8ed3b0;
  --red: #ffa79c;
}
body { font-variant-numeric: tabular-nums; }
.sidebar { border-right: 1px solid var(--line); padding: 22px 12px 15px; }
.brand { padding: 3px 11px 23px; }
.wordmark { font-size: 26px; letter-spacing: -1.15px; font-weight: 650; color: var(--ink); }
.wordmark b { color: var(--gold); font-weight: 650; }
.sidebar nav { gap: 13px; scrollbar-width: thin; scrollbar-color: #584e3c var(--sidebar); }
.nav-group { gap: 1px; }
.nav-group h2 { color: var(--faint); font-size: 10px; letter-spacing: .095em; text-transform: uppercase; }
.sidebar nav a { border-radius: 6px; padding: 6px 10px; color: #d5cfc5; }
.sidebar nav a span { color: #b3a58c; line-height: 1.2; }
.sidebar nav a:hover { background: var(--raised); }
.sidebar nav a.active { background: #3c3221; color: #f0cd90; }
.sidebar nav a.active span { color: inherit; }
.sidebar-bottom { margin-top: auto; border-color: var(--line); padding-top: 12px; color: var(--faint); }
.sidebar-bottom .logout { color: var(--muted); }
.topbar { height: 60px; padding-inline: clamp(18px,3vw,40px); gap: 14px; background: var(--sidebar); }
.workspace-location { white-space: nowrap; text-transform: none; letter-spacing: 0; }
.topbar b { color: var(--ink); margin-left: 4px; }
.workspace-search { display: flex; align-items: center; border: 1px solid var(--line); background: var(--well); border-radius: 7px; width: min(325px,45%); margin-left: auto; }
.workspace-search input { margin: 0; flex: 1; min-width: 0; min-height: 34px; padding: 5px 11px; background: transparent; border: 0; }
.workspace-search:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.workspace-search button { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--gold); font-size: 12px; padding: 3px 10px; }
.pill { background: var(--well); color: var(--muted); }
.content { padding: clamp(20px,2.6vw,38px); }
.panel, .kpis article { border-radius: 10px; }
.panel { padding: clamp(18px,1.8vw,27px); }
.kpis { gap: 12px; }
.kpis article { padding: 18px 20px; }
.kpis article > span, .kpis strong small, .kpis p, .sale-numbers span, .chart-labels,
.footnote, td small, label small, .input-money > span, .watch-alert-price span { color: var(--muted); }
.kpis article > span { font-size: 12px; }
.kpis p, td small, label small { font-size: 11px; }
th { background: var(--raised); color: var(--muted); }
td, .step { border-color: var(--line); }
.item-name, label, .topbar .workspace-location { color: var(--ink); }
summary, .watch-source, .fulfillment-hint { color: var(--gold); }
.button { border-radius: 6px; }
.primary { color: #231b0f; background: var(--gold); box-shadow: none; }
.secondary, .subtle, .tag { color: var(--ink); background: var(--raised); border-color: var(--line); }
input, select, textarea, .auth-card input { background: var(--well); color: var(--ink); border-color: #625b4f; }
input::placeholder, textarea::placeholder { color: #a49c90; }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--gold); }
a:focus-visible, button:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.info, .tag.returned, .watch-goal, .invoice-draft-banner, .payment-calendar-chip, .calendar-chip,
.return-history tr.focused-return, .return-history tr:target, .mfa-seed { background: #322b1e; color: #f2d198; border-color: #665335; }
.notice, .calendar-chip.done { background: #1f3027; color: #c3e6ce; border-color: #41614c; }
.notice.error { background: #382320; color: #ffc4bb; border-color: #825249; }
.notice p, .notice a, .watch-goal strong small { color: inherit; }
.watch-hit { background: #24362c !important; color: var(--green) !important; }
.watch-expired { background: #342d21 !important; color: #ecd3a2 !important; }
.watch-best b { color: var(--green); }
.watch-stale { color: #d9c4a3; }
.calendar-weekday, .calendar-cell.outside, .calendar-chip.cancelled, .test-document,
.backup-fingerprint, .backup-command, .import-panel form, .article-nav a:hover { background: var(--well); color: var(--muted); border-color: var(--line); }
.accent-panel, .auth-card { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.auth-main { background: var(--bg); }
.accent-panel .eyebrow, .accent-panel > a { color: var(--gold); }
.accent-panel p, .step { color: var(--muted); }
.analytics-track { fill: var(--raised); }
.analytics-fill { fill: var(--gold); }
.chart-base { stroke: var(--line); }
.stock-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; }
.age-distribution, .preview-sheet ul { list-style: none; padding: 0; margin: 0; }
.age-distribution li { display: grid; grid-template-columns: 8em minmax(4em,1fr) 6em 8em; gap: 14px; align-items: center; padding: 6px 0; }
.age-distribution strong, .age-distribution small { text-align: right; }
.age-distribution small { color: var(--muted); }
.age-distribution progress { display: block; width: 100%; height: 7px; appearance: none; border: 0; border-radius: 9px; overflow: hidden; background: var(--raised); }
.age-distribution progress::-webkit-progress-bar { background: var(--raised); }
.age-distribution progress::-webkit-progress-value { background: var(--gold); border-radius: 9px; }
.age-distribution progress::-moz-progress-bar { background: var(--gold); border-radius: 9px; }
.stock-age p { margin-bottom: 0; }
.invoice-workspace > form { min-width: 0; }
.invoice-live[hidden], .preview-sheet [hidden] { display: none; }
.invoice-live { min-width: 0; }
.invoice-live h2 { white-space: nowrap; }
.preview-sheet { min-width: 0; background: var(--well); padding: 18px; border: 1px solid var(--line); border-top: 2px solid var(--gold); overflow-wrap: anywhere; border-radius: 5px; }
.preview-sheet > strong, .preview-sheet dt { color: var(--muted); font-size: 12px; }
.preview-sheet h3 { margin: 4px 0 18px; }
.preview-sheet dd { margin: 2px 0 12px; white-space: pre-line; }
.preview-sheet h4 { font-size: 12px; margin: 14px 0 4px; }
.preview-sheet li, .preview-total { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 6px 0; }
.preview-sheet li strong, .preview-total strong { white-space: nowrap; }
.preview-total { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.invoice-live .footnote { margin: 12px 0 0; }
@media (min-width: 1150px) {
  .invoice-workspace:has(.invoice-live:not([hidden])) { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(280px,1fr); align-items: start; gap: 18px; }
  .invoice-live { position: sticky; top: 14px; max-height: calc(100dvh - 28px); overflow-y: auto; }
}
@media (max-width: 760px) {
  .sidebar { padding: 12px 16px; }
  .brand { padding: 0 0 9px; }
  .wordmark { font-size: 22px; }
  .sidebar nav { gap: 4px; }
  .sidebar nav a { padding: 7px 10px; }
  .sidebar-bottom { padding-top: 4px; }
  .workspace-search { margin: 0; flex: 1; width: auto; }
  .topbar { padding-inline: 16px; }
  .age-distribution li { grid-template-columns: 1fr auto auto; gap: 3px 12px; padding: 8px 0; }
  .age-distribution progress { grid-column: 1/-1; grid-row: auto; order: 1; }
  .preview-sheet li, .preview-total { flex-wrap: wrap; }
}
@media (max-width: 440px) { .topbar .pill { display: none; } }

.inventory-refine { margin: 0; padding: 0; border: 0; }
.preview-jump, .preview-back { display: inline-block; color: var(--gold); margin-block: 0 12px; }
.preview-back { margin-block: 10px 0; }
.preview-jump[hidden] { display: none; }
@media (min-width: 1150px) { .preview-jump, .preview-back { display: none; } }

@media (min-width: 1450px) {
  .stock-overview { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items: start; }
  .stock-overview .sale-numbers { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

.value-card { margin-block: 0 20px; background: var(--card); }
.value-card .section-heading { align-items: center; }
.period-picker { display: flex; gap: 8px; align-items: center; }
.period-picker select { margin: 0; min-width: 120px; }
.period-picker [hidden], .intake-form [hidden] { display: none; }
.value-kpis { display: grid; grid-template-columns: 1.6fr repeat(3,minmax(0,1fr)); gap: 16px; }
.value-kpis > div { min-width: 0; border-left: 1px solid var(--line); padding-left: 16px; }
.value-kpis > div:first-child { padding-left: 0; border: 0; }
.value-kpis span, .value-flow dt { color: var(--muted); font-size: 12px; }
.value-kpis strong { display: block; font-size: clamp(17px,1.6vw,26px); }
.value-kpis > div:first-child strong { font-size: clamp(23px,2.2vw,33px); }
.value-kpis small { color: var(--gold); }
.value-flow { display: flex; flex-wrap: wrap; gap: 10px 36px; border-top: 1px solid var(--line); padding-top: 14px; }
.value-flow dd, .value-days dd { margin: 0; font-weight: 650; }
.value-plot { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 9px; }
.value-plot svg { width: 100%; height: clamp(125px,14vw,185px); }
.value-scale, .value-dates { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
.value-scale { flex-direction: column; align-items: end; padding: 4px 0; }
.value-dates { grid-column: 2; }
.value-grid { fill: none; stroke: var(--line); stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.value-line { stroke: var(--gold); fill: none; stroke-width: 2.3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.value-area { fill: var(--gold); opacity: .10; }
.value-days { max-width: 580px; }
.value-days > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 5px 0; }
#intake-dialog { background: var(--sidebar); color: var(--ink); border: 1px solid #836937; border-radius: 15px; padding: 0; max-height: 88dvh; width: min(760px,calc(100% - 24px)); overflow: auto; }
#intake-dialog::backdrop { background: rgb(0 0 0 / .64); backdrop-filter: blur(3px); }
#intake-dialog > header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 23px; background: var(--sidebar); border-bottom: 1px solid var(--line); }
#intake-dialog header h2 { margin: 0; font-size: 22px; }
#intake-dialog header button { width: 38px; height: 38px; color: var(--muted); border: 1px solid var(--line); background: var(--card); border-radius: 7px; font-size: 21px; }
#intake-dialog form { margin: 0; border: 0; border-radius: 0; }
.intake-form { max-width: 860px; }
.intake-form fieldset { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.intake-form legend { color: var(--gold); font-size: 12px; text-transform: uppercase; font-weight: 700; letter-spacing: .08em; margin: 0 0 12px; }
.intake-form .form-actions { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.intake-form .measure-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.value-card .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media(max-width: 800px) {
  .value-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .value-kpis > div { border: 0; padding: 0; }
  .period-picker { flex-wrap: wrap; }
}
@media(max-width: 440px) {
  .intake-form .measure-row { grid-template-columns: 1fr; }
  .value-flow { gap: 10px 15px; }
  .value-scale { max-width: 90px; overflow-wrap: anywhere; }
}


.value-scale.value-flat { justify-content: flex-end; }
@media (max-width: 500px) { .value-dates span:not(:first-child):not(:last-child) { display: none; } }
