:root {
  color-scheme: light;
  --ink: #19191d;
  --muted: #575761;
  --red: #b2152b;
  --line: #e5e2e4;
  --canvas: #f7f6f7;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--red); }
.top { color: white; background: #19191d; }
.top-inner, main { width: min(100% - 2rem, 1240px); margin-inline: auto; }
.top-inner { display: flex; align-items: center; gap: 1rem; }
.top .top-inner { min-height: 76px; justify-content: space-between; flex-wrap: wrap; padding-block: .75rem; }
.brand { color: white; text-decoration: none; display: flex; gap: .8rem; align-items: center; }
.brand strong { font-size: 1.25rem; font-weight: 900; letter-spacing: .035em; border-bottom: 4px solid #eb374f; }
.brand span { font-size: .9rem; }
.account, .language { display: flex; align-items: center; gap: .4rem; }
.language button { color: white; background: transparent; padding-inline: .5rem; }
.language button[aria-current] { text-decoration: underline; text-underline-offset: .35em; }
.outline { background: transparent; border: 1px solid #84848c; }
.navigation { background: white; border-bottom: 1px solid var(--line); }
.navigation .top-inner { flex-wrap: wrap; gap: 0 1.25rem; }
.navigation a { text-decoration: none; color: var(--ink); padding-block: .85rem; border-bottom: 3px solid transparent; font-weight: 600; font-size: .9rem; }
.navigation a[aria-current] { color: var(--red); border-color: var(--red); }
main { padding-block: clamp(1.5rem, 4vw, 3rem) 4rem; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1.2rem; letter-spacing: -.04em; }
h2 { font-size: 1.12rem; margin: 0 0 1rem; }
.project-names { color: var(--muted); margin: -.6rem 0 1.4rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.metrics article, .panel { background: white; border: 1px solid var(--line); border-radius: .75rem; padding: clamp(.9rem, 2vw, 1.4rem); }
.metrics article { border-top: 3px solid var(--red); }
.metrics span, small { display: block; color: var(--muted); font-size: .85rem; }
.metrics strong { display: block; font-size: 1.8rem; margin-top: .35rem; font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.records { list-style: none; margin: 0; padding: 0; }
.records li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .75rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.records li:last-child { padding-bottom: 0; }
small { margin-top: .25rem; }
.heading, .filters { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.heading { margin-bottom: 1.2rem; }
.heading h1 { margin: 0; }
.filters { justify-content: flex-start; align-items: end; margin-bottom: 1rem; }
.filters label { flex: 1 1 145px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
td, th { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: #f2eff0; }
label { display: block; font-weight: 600; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; padding: .55rem; margin-top: .25rem; border: 1px solid #aaa7af; border-radius: .35rem; font: inherit; background: white; }
button, .button { display: inline-block; border: 0; background: var(--red); color: white; border-radius: .35rem; font: inherit; font-weight: 600; text-decoration: none; padding: .6rem .9rem; cursor: pointer; }
form label + button { margin-top: .5rem; }
:focus-visible { outline: 3px solid #1959a3; outline-offset: 2px; }
.notice { padding: .75rem; border-left: 4px solid var(--red); background: #fceef0; }
.errorlist { color: var(--red); }
.login { max-width: 440px; margin-inline: auto; }
.intro { max-width: 75ch; color: var(--muted); }
.stacked { margin-top: 1rem; }
.operations section:first-child { grid-row: span 2; }
@media (max-width: 680px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .brand { flex-wrap: wrap; }
  .navigation .top-inner { gap: 0 .85rem; }
  .operations section:first-child { grid-row: auto; }
}
/* Compact goods overview and warehouse forms */
:root { --canvas: #f5f5f6; }
.top .top-inner { min-height: 58px; padding-block: .5rem; }
.top-inner, main { width: min(100% - 2rem, 1420px); }
.navigation a { padding-block: .65rem; white-space: nowrap; }
.navigation .top-inner { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
main { padding-block: 1.3rem 2.5rem; }
h1 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin: 0 0 .65rem; }
h2 { font-size: 1.05rem; margin-bottom: .65rem; }
.page-heading { margin-bottom: .95rem; }
.project-names { margin: 0; font-size: .92rem; }
.heading { margin-bottom: .65rem; gap: .6rem; }
.heading h2 { margin: 0; }
.panel { padding: .85rem; border-radius: .55rem; }
.primary-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.primary-metrics article { border-top-color: var(--status-fg); padding: .68rem .85rem; border-radius: .55rem; }
.primary-metrics article a { display: block; color: inherit; text-decoration: none; }
.primary-metrics article:hover, .primary-metrics article.active { background: var(--status-bg); }
.line-existing { margin-top: .4rem; font-size: .82rem; }
.primary-metrics strong { font-size: clamp(1.35rem, 3vw, 1.85rem); margin-top: .15rem; }
.expected { --status-bg: #ececf0; --status-fg: #484851; }
.stock, .received { --status-bg: #e5f0ff; --status-fg: #164d84; }
.reserved, .ready, .transit { --status-bg: #fff0df; --status-fg: #803a02; }
.delivered { --status-bg: #e0f3e8; --status-fg: #185c37; }
.damaged { --status-bg: #fae7ea; --status-fg: #962637; }
.state { display: inline-block; background: var(--status-bg); color: var(--status-fg); padding: .17rem .43rem; border-radius: .3rem; font-size: .75rem; white-space: nowrap; margin: 0 .12rem .18rem 0; }
.state b { margin-left: .12rem; }
.goods-filters { gap: .55rem; margin-bottom: .5rem; }
.goods-filters > label:first-child { flex: 2 1 220px; }
.goods-filters label, .workflow label { font-size: .85rem; }
.filter-detail { position: relative; align-self: end; }
summary { cursor: pointer; font-weight: 600; }
.filter-detail summary { padding: .5rem; }
.filter-content { position: absolute; z-index: 2; right: 0; top: calc(100% + .2rem); width: 225px; padding: .75rem; background: white; border: 1px solid var(--line); border-radius: .5rem; box-shadow: 0 5px 16px #19191d19; }
.filter-content label + label { margin-top: .45rem; }
.filter-content button { margin-top: .65rem; }
.goods-table { padding: 0; }
.goods-table table { min-width: max(100%, 650px); font-size: .83rem; }
.goods-table td, .goods-table th { padding: .5rem .54rem; }
.goods-table thead a { display: inline-block; color: var(--ink); text-decoration: none; line-height: 1.25; }
.goods-table thead a:hover, .goods-table thead [aria-sort] a { color: var(--red); }
.goods-table thead a span { color: var(--red); font-size: .7rem; }
.goods-table tbody tr:last-child > * { border-bottom: 0; }
.goods-table tbody th { min-width: 138px; }
.goods-table small { font-weight: 400; font-size: .72rem; }
.state-cell { min-width: 140px; }
.button.subtle, button.subtle { background: white; color: var(--red); border: 1px solid #d5a9af; }
.pagination { display: flex; gap: .85rem; justify-content: center; }
.stats dl { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; margin-bottom: 0; }
.stats dl div { display: flex; gap: .5rem; }
.stats dd { margin: 0; font-weight: 700; }
.item-summary p { margin-top: 0; }
.location-list { padding-left: 1.2rem; margin-bottom: 0; }
.workflow { max-width: 1050px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem .8rem; }
.form-grid > div { min-width: 0; }
.workflow .intro, .intro { margin-top: 0; }
.receipt-lines { margin-top: .75rem; }
.receipt-reference { margin-top: .35rem; }
.receipt-reference button { padding: .35rem .6rem; font-size: .82rem; }
.receipt-reference [data-reference-input] { margin-top: .4rem; }
.receipt-reference [data-reference-save] { margin-top: .35rem; }
.reference-error { color: var(--red); }
.receipt-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(75px, 125px) auto; align-items: end; gap: .6rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.primary-action { min-height: 44px; margin-top: .85rem; padding-inline: 1.25rem; }
.secondary-links { font-size: .88rem; }
@media (max-width: 800px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .top-inner, main { width: calc(100% - 1.2rem); }
  .navigation .top-inner { flex-wrap: wrap; overflow: visible; gap: 0 .72rem; }
  .navigation a { font-size: .82rem; padding-block: .52rem; }
  main { padding-top: .95rem; }
  .brand { gap: .25rem .5rem; }
  .primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goods-filters { position: relative; }
  .goods-filters > label:first-child { flex-basis: 100%; }
  .filter-detail { position: static; }
  .filter-content { right: .5rem; width: min(225px, calc(100% - 1rem)); }
  .primary-action { width: 100%; }
}
@media (max-width: 400px) {
  .form-grid { grid-template-columns: 1fr; }
  .receipt-line { grid-template-columns: 1fr auto; }
  .receipt-line > div:first-child { grid-column: 1 / -1; }
}
