/* ============ Seed tokens ============ */
:root {
  --seed-bg: #f2f0ea;
  --seed-surface: #ffffff;
  --seed-fg: #171b1e;
  --seed-muted: #6a7176;
  --seed-line: #dbd7cc;
  --seed-ink: #12181b;
  --seed-on-ink: #eef0ed;
  --seed-primary: #1c252a;
  --seed-on-primary: #ffffff;
  --seed-accent: #c64a1b;
  --seed-on-accent: #ffffff;
  --seed-success: #2f6b4f;
  --seed-warning: #96620f;
  --seed-danger: #a5332a;
  --seed-info: #2f5f7a;
  --seed-radius: 4px;
  --seed-space: 8px;
  --seed-type-scale: 1;
}
[data-theme="dark"] {
  --seed-bg: #111416;
  --seed-surface: #181c1f;
  --seed-fg: #edf0f1;
  --seed-muted: #9aa3a8;
  --seed-line: #2c3236;
  --seed-ink: #0c0f11;
  --seed-on-ink: #edf0f1;
  --seed-primary: #edf0f1;
  --seed-on-primary: #14181b;
}

/* ============ Derived tokens ============ */
:root {
  --bg: var(--seed-bg);
  --surface: var(--seed-surface);
  --surface-2: color-mix(in srgb, var(--seed-surface) 84%, var(--seed-bg));
  --fg: var(--seed-fg);
  --muted: var(--seed-muted);
  --line: var(--seed-line);
  --ink: var(--seed-ink);
  --on-ink: var(--seed-on-ink);
  --primary: var(--seed-primary);
  --on-primary: var(--seed-on-primary);
  --accent: var(--seed-accent);
  --on-accent: var(--seed-on-accent);
  --success: var(--seed-success);
  --warning: var(--seed-warning);
  --danger: var(--seed-danger);
  --info: var(--seed-info);
  --radius: var(--seed-radius);
  --s1: var(--seed-space);
  --s2: calc(var(--seed-space) * 1.5);
  --s3: calc(var(--seed-space) * 2);
  --s4: calc(var(--seed-space) * 3);
  --s5: calc(var(--seed-space) * 4);
  --s6: calc(var(--seed-space) * 5);
  --s8: calc(var(--seed-space) * 6);
  --font-display: "Bahnschrift", "DIN Alternate", "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Courier New", monospace;
  --shadow: 0 24px 60px color-mix(in srgb, var(--ink) 16%, transparent);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: calc(15px * var(--seed-type-scale));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

.shell { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 56px); }
.section { padding-block: clamp(44px, 5vw, 70px); border-top: 1px solid var(--line); }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; font-size: 13px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--muted);
}
.eyebrow::before { content: ""; width: 3px; height: 13px; background: var(--accent); flex: none; }
.eyebrow.on-dark { color: color-mix(in srgb, var(--on-ink) 62%, transparent); }

.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: clamp(20px, 4vw, 64px); margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-title { font-size: calc(clamp(26px, 2.8vw, 36px) * var(--seed-type-scale)); line-height: 1.15; letter-spacing: -0.02em; margin-top: 8px; }
.section-desc { max-width: 46ch; color: var(--muted); font-size: 13px; line-height: 1.75; }
.section-desc strong { color: var(--fg); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: none; font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 82%, var(--fg)); border-color: color-mix(in srgb, var(--accent) 82%, var(--fg)); }
.btn-dark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-dark:hover { background: color-mix(in srgb, var(--primary) 84%, var(--accent)); border-color: color-mix(in srgb, var(--primary) 84%, var(--accent)); }
.btn-outline { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-outline:hover { border-color: var(--fg); background: var(--surface); }
.btn-ghost-light { border-color: color-mix(in srgb, var(--on-ink) 26%, transparent); color: var(--on-ink); background: transparent; }
.btn-ghost-light:hover { border-color: var(--on-ink); background: color-mix(in srgb, var(--on-ink) 8%, transparent); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 82%, var(--fg)); border-color: color-mix(in srgb, var(--danger) 82%, var(--fg)); }

.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 15px; height: 15px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.input:disabled, .select:disabled { opacity: .55; cursor: not-allowed; }
.textarea { min-height: 82px; resize: vertical; }
.field-hint { font-size: 11px; color: var(--muted); }
.field-error { display: none; font-size: 11.5px; color: var(--danger); }
.field.invalid .field-error { display: block; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 2px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; flex: none; background: currentColor; }
.badge.success { color: color-mix(in srgb, var(--success) 82%, var(--fg)); background: color-mix(in srgb, var(--success) 12%, transparent); }
.badge.warning { color: color-mix(in srgb, var(--warning) 84%, var(--fg)); background: color-mix(in srgb, var(--warning) 13%, transparent); }
.badge.danger { color: color-mix(in srgb, var(--danger) 84%, var(--fg)); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.badge.info { color: color-mix(in srgb, var(--info) 84%, var(--fg)); background: color-mix(in srgb, var(--info) 12%, transparent); }
.badge.neutral { color: var(--muted); background: var(--surface-2); }
.badge.on-dark { color: color-mix(in srgb, var(--on-ink) 84%, transparent); background: color-mix(in srgb, var(--on-ink) 10%, transparent); }

/* ============ Site header ============ */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { position: relative; width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); border-radius: 2px; flex: none; }
.brand-mark .icon { width: 19px; height: 19px; color: var(--on-ink); }
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; background: var(--accent); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: 0.06em; line-height: 1.1; }
.brand-sub { margin-top: 2px; font-family: var(--font-body); font-size: 9.5px; letter-spacing: 0.04em; color: var(--muted); }
.main-nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 30px); margin-left: 6px; }
.main-nav a { position: relative; padding: 8px 0; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.main-nav a:hover { color: var(--fg); }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 2px; background: var(--accent); transition: right .2s ease; }
.main-nav a:hover::after { right: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.site-login-btn { min-height: 36px; padding-inline: 13px; font-size: 12px; }
.site-login-btn .icon { width: 15px; height: 15px; }
.header-phone { display: flex; flex-direction: column; margin-right: 6px; line-height: 1.2; }
.header-phone span { font-size: 9.5px; letter-spacing: 0.08em; color: var(--muted); }
.header-phone strong { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.cart-btn {
  position: relative; width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s ease;
}
.cart-btn:hover { border-color: var(--fg); }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); border-radius: 9px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
}
.cart-count[hidden] { display: none; }
.menu-btn { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.mobile-nav { display: none; background: var(--surface); border-bottom: 1px solid var(--line); }
.mobile-nav.open { display: block; }
.mobile-nav .shell { padding-block: 14px 18px; display: grid; gap: 4px; }
.mobile-nav a, .mobile-nav button {
  display: block; width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.mobile-nav a:last-child, .mobile-nav button:last-child { border-bottom: 0; }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--on-ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--on-ink) 5%, transparent) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(105deg, transparent 12%, color-mix(in srgb, var(--fg) 90%, transparent) 100%);
}
.hero::after { display: none; }
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: clamp(28px, 4vw, 56px); align-items: center;
  padding-block: clamp(32px, 4vw, 52px) clamp(36px, 4.5vw, 60px);
}
.hero-copy { position: relative; }
.hero-copy .eyebrow { color: color-mix(in srgb, var(--on-ink) 64%, transparent); }
.hero h1 {
  margin-top: 14px;
  font-size: clamp(34px, 3.8vw, 54px);
  font-size: calc(clamp(34px, 3.8vw, 54px) * var(--seed-type-scale));
  line-height: 1.06; letter-spacing: -0.03em; font-weight: 600;
}
.hero h1 .quiet { color: color-mix(in srgb, var(--on-ink) 62%, transparent); }
.hero-sub { max-width: 52ch; margin-top: 14px; font-size: 13.5px; line-height: 1.75; color: color-mix(in srgb, var(--on-ink) 67%, transparent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 16px clamp(24px, 4vw, 44px);
  margin-top: 24px; padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent);
}
.hero-meta div { min-width: 120px; }
.hero-meta span { display: block; font-family: var(--font-body); font-size: 10px; letter-spacing: 0.02em; color: color-mix(in srgb, var(--on-ink) 48%, transparent); }
.hero-meta b { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--on-ink); }

.hero-board {
  position: relative; border: 1px solid color-mix(in srgb, var(--on-ink) 18%, transparent);
  background: color-mix(in srgb, var(--on-ink) 5%, var(--ink));
}
.hero-board::before { content: ""; position: absolute; left: 0; top: 0; width: 34px; height: 2px; background: var(--accent); }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 16px; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent); }
.board-title { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.board-sub { margin-top: 3px; font-family: var(--font-body); font-size: 9.5px; letter-spacing: 0.02em; color: color-mix(in srgb, var(--on-ink) 48%, transparent); }
.board-time { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; color: color-mix(in srgb, var(--on-ink) 58%, transparent); white-space: nowrap; }
.live-dot { width: 6px; height: 6px; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.board-cols { display: flex; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 10%, transparent); font-family: var(--font-body); font-size: 9.5px; letter-spacing: 0.04em; color: color-mix(in srgb, var(--on-ink) 42%, transparent); }
.board-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 9%, transparent); }
.board-row:hover { background: color-mix(in srgb, var(--on-ink) 5%, transparent); }
.board-row-name { font-size: 12.5px; font-weight: 600; }
.board-row-spec { margin-top: 2px; font-family: var(--font-mono); font-size: 9.5px; color: color-mix(in srgb, var(--on-ink) 47%, transparent); }
.board-row-right { display: flex; align-items: baseline; gap: 10px; }
.board-row-qty { font-family: var(--font-mono); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.board-row-qty small { margin-left: 2px; font-size: 9px; font-weight: 500; color: color-mix(in srgb, var(--on-ink) 47%, transparent); }
.board-row .badge { font-size: 9.5px; padding: 1px 6px; }
.hero-board .badge.success { color: color-mix(in srgb, var(--success) 42%, var(--on-ink)); background: color-mix(in srgb, var(--success) 24%, transparent); }
.hero-board .badge.warning { color: color-mix(in srgb, var(--warning) 42%, var(--on-ink)); background: color-mix(in srgb, var(--warning) 26%, transparent); }
.hero-board .badge.danger { color: color-mix(in srgb, var(--danger) 46%, var(--on-ink)); background: color-mix(in srgb, var(--danger) 26%, transparent); }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 16px; font-size: 10.5px; color: color-mix(in srgb, var(--on-ink) 54%, transparent); }
.board-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--on-ink); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 30%, transparent); padding-bottom: 2px; }
.board-foot a:hover { border-bottom-color: var(--accent); }

/* ============ Quick entries ============ */
.entries { padding-block: clamp(22px, 3vw, 34px); background: var(--surface-2); }
.entries-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.entries-title { font-size: calc(clamp(24px, 2.4vw, 32px) * var(--seed-type-scale)); line-height: 1.15; letter-spacing: -0.02em; }
.entries-head p { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.entries-hint { font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.entry-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 146px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); text-align: left; text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.entry-card:hover { border-color: var(--accent); background: var(--surface); }
.entry-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); }
.entry-icon .icon { width: 22px; height: 22px; }
.entry-body { display: block; }
.entry-body b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.entry-body span { display: block; margin-top: 5px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.entry-go { display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 8px; font-size: 11px; font-weight: 600; color: var(--muted); }
.entry-go .icon { width: 14px; height: 14px; }
.entry-card:hover .entry-go { color: var(--accent); }
.entry-card.entry-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.entry-card.entry-primary:hover { background: color-mix(in srgb, var(--ink) 92%, var(--accent)); border-color: var(--accent); }
.entry-card.entry-primary .entry-icon { background: color-mix(in srgb, var(--on-ink) 10%, transparent); border-color: color-mix(in srgb, var(--on-ink) 18%, transparent); color: var(--on-ink); }
.entry-card.entry-primary .entry-body span { color: color-mix(in srgb, var(--on-ink) 64%, transparent); }
.entry-card.entry-primary .entry-go { color: color-mix(in srgb, var(--on-ink) 72%, transparent); }
.entry-card.entry-primary:hover .entry-go { color: var(--on-ink); }
.entry-card.entry-staff { border-left: 3px solid var(--accent); }
.entry-foot { margin-top: 10px; font-size: 10.5px; color: var(--muted); }

/* ============ Ticker ============ */
.ticker { background: var(--surface); border-bottom: 1px solid var(--line); }
.ticker-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.ticker-item { display: flex; flex-direction: column; gap: 3px; padding: 14px 0 14px clamp(16px, 2.5vw, 32px); border-left: 1px solid var(--line); }
.ticker-item:first-child { border-left: 0; padding-left: 0; }
.ticker-label { font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.ticker-value { font-family: var(--font-mono); font-size: 18px; font-weight: 600; letter-spacing: -0.03em; }
.ticker-value small { margin-left: 4px; font-family: var(--font-body); font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* ============ Categories ============ */
.categories { background: var(--surface); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cat-card {
  position: relative; min-height: 142px; padding: clamp(16px, 2vw, 22px);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-decoration: none; transition: background-color .18s ease;
}
.cat-card:hover { background: var(--surface-2); }
.cat-card:focus-visible { position: relative; z-index: 2; }
.cat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cat-icon { width: 34px; height: 34px; color: var(--fg); }
.cat-num { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--muted); }
.cat-name { margin-top: auto; padding-top: 18px; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.cat-en { margin-top: 3px; font-family: var(--font-body); font-size: 9.5px; letter-spacing: 0.02em; color: var(--muted); }
.cat-stat { position: absolute; right: clamp(16px, 2vw, 22px); bottom: clamp(16px, 2vw, 22px); text-align: right; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.cat-stat b { display: block; font-size: 15px; font-weight: 600; color: var(--fg); letter-spacing: -0.02em; }
.cat-empty { grid-column: 1 / -1; padding: 56px 24px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.cat-empty .icon { width: 34px; height: 34px; margin: 0 auto 14px; color: var(--muted); }
.cat-empty strong { display: block; font-size: 14px; }
.cat-empty p { max-width: 44ch; margin: 6px auto 0; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* ============ Inventory ============ */
.inventory { background: var(--bg); }
.inventory-toolbar { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, .72fr)) auto; gap: 10px; align-items: end; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-left: 36px; }
.inventory-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.01em; color: var(--muted);
}
.inventory-meta strong { color: var(--fg); font-weight: 600; }
.inventory-meta .meta-right { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inventory .data-table { min-width: 850px; }
.data-table th {
  position: sticky; top: 0; z-index: 2;
  padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: left; white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.product-name { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13px; font-weight: 600; }
.product-spec { margin-top: 3px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.01em; color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 11.5px; }
.mono { font-family: var(--font-mono); }
.stock-cell { min-width: 156px; }
.stock-line { display: flex; align-items: baseline; gap: 3px; font-family: var(--font-mono); font-size: 16px; font-weight: 600; letter-spacing: -0.03em; }
.stock-line small { font-family: var(--font-body); font-size: 9.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.stock-bar { width: 100%; max-width: 112px; height: 3px; margin-top: 7px; background: var(--surface-2); overflow: hidden; }
.stock-bar span { display: block; height: 100%; }
.stock-bar .ok { background: var(--success); }
.stock-bar .low { background: var(--warning); }
.stock-bar .out { background: var(--danger); }
.price { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.price small { margin-left: 2px; font-family: var(--font-body); font-size: 9.5px; font-weight: 500; color: var(--muted); }
.unit-aux { margin-left: 4px; font-family: var(--font-body); font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.stock-line .unit-aux { font-size: 9px; }
.inline-unit { display: flex; align-items: center; gap: 5px; }
.inline-unit .input { flex: 1; width: 100%; min-width: 0; }
.inline-unit .select { flex: none; width: 78px; padding-left: 7px; padding-right: 22px; }
.inline-unit-pair { flex-wrap: nowrap; }
.inline-unit-pair .input { min-width: 0; }
.inline-unit-pair .unit-tag { flex: none; }
.unit-tag { font-size: 10px; font-weight: 600; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.qty-control .unit-tag { padding: 0 6px; }
.qty-control input[data-cart-aux-qty] { width: 52px; border-inline: 1px solid var(--line); }
.empty-state { padding: 60px 24px; text-align: center; }
.empty-state .icon { width: 34px; height: 34px; margin: 0 auto 14px; color: var(--muted); }
.empty-state strong { display: block; font-size: 14px; }
.empty-state p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.empty-state .btn { margin-top: 16px; }

/* ============ Process ============ */
.process { background: var(--surface); border-bottom: 1px solid var(--line); }
.process-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.process-side { position: sticky; top: 100px; }
.process-side .section-desc { margin-top: 20px; }
.process-note { display: flex; gap: 14px; margin-top: 28px; padding: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.process-note .icon { color: var(--accent); margin-top: 2px; }
.process-note strong { display: block; font-size: 12.5px; }
.process-note p { margin-top: 4px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.process-side .btn { margin-top: 22px; }
.process-steps { border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.step-num { padding-top: 2px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.step h3 { font-size: 17px; letter-spacing: -0.01em; }
.step p { max-width: 56ch; margin-top: 6px; font-size: 12.5px; line-height: 1.75; color: var(--muted); }

/* ============ Warehouse ============ */
.hazard { height: 4px; background: var(--accent); }
.warehouse { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); }
.warehouse::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--on-ink) 4%, transparent) 1px, transparent 1px);
  background-size: 64px 100%;
}
.warehouse .shell { position: relative; z-index: 1; }
.warehouse-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.warehouse .section-title { color: var(--on-ink); }
.warehouse .section-desc { color: color-mix(in srgb, var(--on-ink) 64%, transparent); margin-top: 18px; }
.cap-list { margin-top: 32px; border-top: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent); }
.cap-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 12%, transparent); }
.cap-index { font-family: var(--font-mono); font-size: 10px; color: color-mix(in srgb, var(--on-ink) 42%, transparent); padding-top: 3px; }
.cap-item h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.cap-item p { margin-top: 4px; font-size: 11.5px; line-height: 1.7; color: color-mix(in srgb, var(--on-ink) 55%, transparent); }
.warehouse-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.warehouse-panel { border: 1px solid color-mix(in srgb, var(--on-ink) 17%, transparent); background: color-mix(in srgb, var(--on-ink) 5%, var(--ink)); padding: 22px; }
.warehouse-panel .board-head { padding: 0 0 16px; }
.panel-title { font-size: 14px; font-weight: 600; }
.panel-sub { margin-top: 3px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; color: color-mix(in srgb, var(--on-ink) 45%, transparent); text-transform: uppercase; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid color-mix(in srgb, var(--on-ink) 11%, transparent); }
.task-label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: color-mix(in srgb, var(--on-ink) 80%, transparent); }
.task-label .icon { width: 16px; height: 16px; color: color-mix(in srgb, var(--on-ink) 48%, transparent); }
.task-count { font-family: var(--font-mono); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.task-count small { margin-left: 3px; font-family: var(--font-body); font-size: 9.5px; font-weight: 500; color: color-mix(in srgb, var(--on-ink) 45%, transparent); }
.panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent); font-size: 10.5px; color: color-mix(in srgb, var(--on-ink) 48%, transparent); }
.panel-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--on-ink); text-decoration: none; font-size: 11.5px; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 30%, transparent); padding-bottom: 2px; }

/* ============ Footer ============ */
.site-footer { padding-block: 52px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr .8fr .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); }
.footer-brand p { max-width: 34ch; margin-top: 16px; font-size: 12px; line-height: 1.75; color: var(--muted); }
.footer-col h4 { margin-bottom: 14px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.footer-col a, .footer-col button { display: block; width: 100%; padding: 5px 0; border: 0; background: none; text-align: left; font-size: 12px; color: var(--fg); text-decoration: none; }
.footer-col a:hover, .footer-col button:hover { color: var(--accent); }
.footer-contact { font-size: 12px; line-height: 1.9; color: var(--muted); }
.footer-contact strong { display: block; font-family: var(--font-mono); font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--fg); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.footer-bottom p { font-size: 10px; color: var(--muted); }

/* ============ Cart drawer ============ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--ink) 58%, transparent); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(470px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface); box-shadow: -24px 0 70px color-mix(in srgb, var(--ink) 22%, transparent);
  transform: translateX(102%); visibility: hidden;
  transition: transform .3s cubic-bezier(.22, .7, .24, 1), visibility 0s linear .3s;
}
.cart-drawer.open { transform: translateX(0); visibility: visible; transition: transform .3s cubic-bezier(.22, .7, .24, 1), visibility 0s; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.drawer-steps { margin-top: 3px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--muted); }
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s ease; }
.icon-btn:hover { border-color: var(--fg); }
.icon-btn .icon { width: 16px; height: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.drawer-actions { display: flex; gap: 8px; }
.drawer-actions .btn { flex: 1; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line:first-child { padding-top: 0; }
.cart-line-name { font-size: 13px; font-weight: 600; }
.cart-line-meta { margin-top: 3px; font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.qty-control { display: inline-flex; align-items: center; margin-top: 9px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qty-control button { width: 30px; height: 30px; border: 0; background: none; font-size: 16px; line-height: 1; }
.qty-control button:hover { background: var(--surface-2); }
.qty-control input { width: 58px; height: 30px; padding: 0; border: 0; border-inline: 1px solid var(--line); background: transparent; text-align: center; font-family: var(--font-mono); font-size: 11.5px; }
.line-amount { text-align: right; font-family: var(--font-mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.remove-btn { margin-top: 8px; padding: 0; border: 0; background: none; font-size: 10.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.remove-btn:hover { color: var(--danger); }
.cart-summary { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 6px; font-size: 11.5px; color: var(--muted); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 10px 0 14px; font-size: 12.5px; font-weight: 600; }
.cart-total b { font-family: var(--font-mono); font-size: 23px; font-weight: 600; letter-spacing: -0.03em; }
.cart-total b small { font-family: var(--font-body); font-size: 10px; font-weight: 500; color: var(--muted); margin-right: 3px; }
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-grid .full { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 8px; }
.radio-pill { position: relative; flex: 1; min-width: 0; }
.radio-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-pill span { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.radio-pill input:checked + span { border-color: var(--fg); background: var(--surface-2); font-weight: 600; }
.radio-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.success-screen { padding: 24px 0; text-align: center; }
.success-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border: 1px solid var(--success); border-radius: 50%; color: var(--success); }
.success-mark .icon { width: 26px; height: 26px; }
.success-screen h3 { font-size: 20px; }
.success-screen > p { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.order-number { margin: 12px 0 20px; font-family: var(--font-mono); font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.success-list { margin-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.success-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.success-list span:first-child { color: var(--muted); }
.success-actions { display: grid; gap: 8px; margin-top: 22px; }

/* ============ Dialogs ============ */
dialog.modal {
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow);
}
dialog.modal.narrow { width: min(470px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: color-mix(in srgb, var(--ink) 62%, transparent); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.modal-sub { margin-top: 4px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.modal-body { max-height: calc(100vh - 230px); overflow-y: auto; padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.login-role-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.role-chip { padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; transition: border-color .15s ease, background-color .15s ease; }
.role-chip:hover { border-color: var(--fg); background: var(--surface-2); }
.role-chip b { display: block; font-size: 12px; }
.role-chip span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted); }
.error-banner { display: none; margin-bottom: 14px; padding: 9px 11px; border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); font-size: 11.5px; }
.error-banner.show { display: block; }
.modal-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10.5px; line-height: 1.7; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.detail-grid div { min-width: 0; }
.detail-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.detail-value { margin-top: 3px; font-size: 12.5px; font-weight: 500; word-break: break-word; }
.detail-items { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 11.5px; }
.detail-items th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.detail-items td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.detail-items td:last-child, .detail-items th:last-child { text-align: right; }
.detail-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.detail-total b { font-family: var(--font-mono); font-size: 18px; }
.timeline { display: flex; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.timeline-step { flex: 1; position: relative; padding-right: 12px; }
.timeline-step::before { content: ""; display: block; width: 7px; height: 7px; margin-bottom: 8px; background: var(--line); }
.timeline-step.done::before { background: var(--success); }
.timeline-step.current::before { background: var(--accent); }
.timeline-step b { display: block; font-size: 11px; }
.timeline-step span { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }

/* ============ App shell ============ */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.app-sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--ink); color: var(--on-ink); border-right: 1px solid color-mix(in srgb, var(--on-ink) 10%, transparent);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 10%, transparent); text-decoration: none; color: var(--on-ink); }
.sidebar-brand .brand-mark { background: color-mix(in srgb, var(--on-ink) 10%, transparent); }
.sidebar-brand .brand-sub { color: color-mix(in srgb, var(--on-ink) 42%, transparent); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group-label { padding: 12px 10px 7px; font-family: var(--font-body); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: color-mix(in srgb, var(--on-ink) 40%, transparent); }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.side-nav button {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border: 0; border-radius: var(--radius); background: none;
  color: color-mix(in srgb, var(--on-ink) 72%, transparent); font-size: 13.5px; text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.side-nav button:hover { background: color-mix(in srgb, var(--on-ink) 7%, transparent); color: var(--on-ink); }
.side-nav button.active { background: color-mix(in srgb, var(--on-ink) 11%, transparent); color: var(--on-ink); font-weight: 600; }
.side-nav button.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; background: var(--accent); }
.side-nav .icon { width: 18px; height: 18px; opacity: .85; }
.side-nav .nav-count { margin-left: auto; padding: 2px 6px; background: var(--accent); color: var(--on-accent); border-radius: 2px; font-family: var(--font-mono); font-size: 9.5px; }
.sidebar-user { padding: 12px 14px; border-top: 1px solid color-mix(in srgb, var(--on-ink) 10%, transparent); }
.user-card { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink); font-size: 11.5px; font-weight: 600; }
.user-meta { min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--on-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { margin-top: 1px; font-size: 9.5px; color: color-mix(in srgb, var(--on-ink) 44%, transparent); }
.user-actions { margin-left: auto; display: flex; gap: 2px; }
.user-actions button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; color: color-mix(in srgb, var(--on-ink) 55%, transparent); border-radius: 2px; }
.user-actions button:hover { background: color-mix(in srgb, var(--on-ink) 8%, transparent); color: var(--on-ink); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; min-height: 64px;
  padding: 10px clamp(16px, 3vw, 34px);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.app-hamburger { display: none; }
.app-context { min-width: 0; }
.app-context strong { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.app-context span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.notif-wrap { position: relative; }
.notif-btn { position: relative; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.notif-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(320px, calc(100vw - 32px)); padding: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
.notif-menu.open { display: block; }
.notif-menu-head { padding: 7px 8px 9px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; }
.notif-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 11.5px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item span { color: var(--muted); }
.notif-empty { padding: 16px 8px; font-size: 11px; color: var(--muted); }
.app-content { width: 100%; max-width: 1440px; margin-inline: auto; padding: clamp(20px, 3vw, 34px); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: calc(clamp(23px, 2.2vw, 29px) * var(--seed-type-scale)); letter-spacing: -0.025em; }
.page-head p { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 12px; margin-bottom: 14px; }
.kpi { position: relative; padding: 16px 18px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi::after { display: none; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.kpi-label .icon { width: 14px; height: 14px; }
.kpi-value { margin-top: 12px; font-family: var(--font-mono); font-size: 23px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.kpi-value small { margin-left: 4px; font-family: var(--font-body); font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.kpi-sub { margin-top: 8px; font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.kpi.is-alert .kpi-value { color: color-mix(in srgb, var(--danger) 82%, var(--fg)); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .9fr); gap: 14px; margin-bottom: 14px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.panel-head .meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.panel-link { padding: 0; border: 0; background: none; font-size: 10.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.panel-link:hover { color: var(--fg); }
.panel-body { padding: 18px; }
.chart-figure { margin: 0; }
.chart-svg { width: 100%; height: auto; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-family: var(--font-mono); font-size: 9px; }
.chart-bar { fill: var(--accent); opacity: .9; transition: opacity .15s ease; }
.chart-bar:hover { opacity: 1; }
.chart-value { fill: var(--fg); font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; }
.chart-label { fill: var(--muted); font-family: var(--font-mono); font-size: 9px; }
.chart-note { margin-top: 8px; font-size: 10px; color: var(--muted); }
.alert-list { display: flex; flex-direction: column; }
.alert-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.alert-item:first-child { padding-top: 0; border-top: 0; }
.alert-item:last-child { padding-bottom: 0; }
.alert-name { font-size: 11.5px; font-weight: 600; }
.alert-meta { margin-top: 2px; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.alert-qty { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: color-mix(in srgb, var(--danger) 82%, var(--fg)); white-space: nowrap; }
.pending-list { display: flex; flex-direction: column; }
.pending-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.pending-item:first-child { padding-top: 0; border-top: 0; }
.pending-item:last-child { padding-bottom: 0; }
.pending-main { min-width: 0; flex: 1; }
.pending-main b { display: block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; }
.pending-main span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-amount { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.data-table.compact { min-width: 760px; }
.data-table.compact td { padding: 11px 14px; font-size: 11.5px; }
.cell-customer { min-width: 156px; }
.data-table.compact th { padding: 10px 14px; }
.order-items { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10.5px; }
.table-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link-btn { padding: 0; border: 0; background: none; font-size: 10.5px; font-weight: 600; color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; white-space: nowrap; }
.link-btn:hover { text-decoration-color: var(--accent); }
.link-btn.danger { color: var(--danger); }
.link-btn:disabled { opacity: .4; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 13px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar .field { flex: 1; min-width: 145px; }
.toolbar .search-field { flex: 1.8; min-width: 210px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.status-tabs { display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.status-tabs button { padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.status-tabs button:hover { color: var(--fg); }
.status-tabs button.active { border-bottom-color: var(--accent); color: var(--fg); font-weight: 600; }
.table-note { margin-top: 8px; text-align: right; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.doc-note { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); font-size: 11px; line-height: 1.7; color: var(--muted); }
.doc-note b { color: var(--fg); }
.empty-table { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty-table strong { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--fg); }
.empty-table p { font-size: 10.5px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.summary-stat { padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.summary-stat b { display: block; font-family: var(--font-mono); font-size: 23px; font-weight: 600; letter-spacing: -0.03em; }
.summary-stat span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.ledger-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ledger-card { position: relative; overflow: hidden; padding: 16px 18px 16px 21px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ledger-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.ledger-card.aux::before { background: var(--accent); }
.ledger-card-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ledger-card-label em { font-style: normal; font-family: var(--font-body); font-weight: 400; letter-spacing: 0; text-transform: none; }
.ledger-card b { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.ledger-card-note { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.ledger-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.ledger-hero-card { padding: 15px 17px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.ledger-hero-card > span { display: block; font-size: 10px; color: var(--muted); }
.ledger-hero-card b { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.ledger-hero-card small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.ledger-hero-card.accent { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.ledger-table th:nth-child(2), .ledger-table th:nth-child(3),
.ledger-table td:nth-child(2), .ledger-table td:nth-child(3) { text-align: right; }
.ledger-table tr.current td { background: var(--surface-2); font-weight: 600; }
.progress-track { width: 100%; max-width: 130px; height: 4px; margin-top: 6px; background: var(--surface-2); }
.progress-track span { display: block; height: 100%; }
.progress-track .ok { background: var(--success); }
.progress-track .low { background: var(--warning); }
.progress-track .out { background: var(--danger); }
.staff-state { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; }
.staff-state::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.staff-state.active { color: color-mix(in srgb, var(--success) 82%, var(--fg)); }
.staff-state.disabled { color: var(--muted); }
.sidebar-overlay { position: fixed; inset: 0; z-index: 65; display: none; background: color-mix(in srgb, var(--ink) 55%, transparent); }
.sidebar-overlay.open { display: block; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 130;
  display: flex; align-items: center; gap: 9px;
  max-width: calc(100vw - 32px); padding: 11px 16px;
  background: var(--ink); color: var(--on-ink); border: 1px solid color-mix(in srgb, var(--on-ink) 16%, transparent);
  border-radius: var(--radius); font-size: 12px;
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 16px; height: 16px; color: var(--success); }
.toast.error .icon { color: var(--danger); }

/* ============ Responsive ============ */
@media (max-width: 1120px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-board { width: 100%; max-width: 640px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid, .warehouse-grid { grid-template-columns: 1fr; }
  .process-side { position: static; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-grid .footer-contact { grid-column: 1 / -1; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .main-nav, .header-phone { display: none; }
  .menu-btn { display: grid; }
  .inventory-toolbar { grid-template-columns: 1fr 1fr; }
  .inventory-toolbar .search-wrap { grid-column: 1 / -1; }
  .inventory-toolbar .toolbar-reset { grid-column: 1 / -1; }
  .app { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed; left: 0; top: 0; z-index: 70; width: min(280px, 86vw);
    transform: translateX(-102%); transition: transform .25s ease;
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-hamburger { display: grid; }
  .app-topbar { min-height: 60px; }
}
@media (max-width: 760px) {
  .section { padding-block: 38px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 12px; margin-bottom: 18px; }
  .hero-inner { padding-block: 30px 40px; }
  .hero h1 { font-size: calc(clamp(30px, 9vw, 42px) * var(--seed-type-scale)); }
  .hero-board { display: none; }
  .hero-meta { gap: 14px 22px; }
  .entries { padding-block: 20px; }
  .entries-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .entries-hint { white-space: normal; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-card { min-height: 136px; padding: 15px; }
  .quick-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .ticker-inner { grid-template-columns: 1fr 1fr; }
  .ticker-item { border-left: 0; padding-left: 0; }
  .ticker-item:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .ticker-item:nth-child(3), .ticker-item:nth-child(4) { border-top: 1px solid var(--line); }
  .cat-grid { grid-template-columns: 1fr; }
  .cat-card { min-height: 144px; }
  .inventory-toolbar { grid-template-columns: 1fr; }
  .inventory-toolbar .search-wrap { grid-column: auto; }
  .inventory-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
  .inventory .data-table { min-width: 0; display: block; }
  .inventory .data-table thead { display: none; }
  .inventory .data-table tbody { display: block; }
  .inventory .data-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 16px; border-bottom: 1px solid var(--line); }
  .inventory .data-table tr:last-child { border-bottom: 0; }
  .inventory .data-table td { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; }
  .inventory .data-table td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.09em; color: var(--muted); text-transform: uppercase; }
  .inventory .data-table td:first-child { grid-column: 1 / -1; }
  .inventory .data-table td:first-child::before { display: none; }
  .inventory .data-table td:last-child { grid-column: 1 / -1; }
  .inventory .data-table td:last-child .btn { width: 100%; }
  .stock-bar { max-width: none; }
  .process-grid { gap: 30px; }
  .step { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-grid .footer-contact { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 25px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid .summary-stat:last-child { grid-column: 1 / -1; }
  .toolbar .field { flex: 1 1 100%; }
  .toolbar-actions { width: 100%; margin-left: 0; }
  .toolbar-actions .btn { flex: 1; }
  .checkout-grid, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .checkout-grid .full, .form-grid .full { grid-column: auto; }
  .login-role-list { grid-template-columns: 1fr; }
  .modal-body { padding: 18px; }
  .modal-head { padding: 16px 18px; }
  .modal-foot { padding: 12px 18px; }
  .app-content { padding: 18px 14px 28px; }
  .app-topbar { padding-inline: 14px; }
  .app-context span { display: none; }
  .data-table.compact { min-width: 720px; }
  .timeline-step b { font-size: 10px; }
}
@media (max-width: 480px) {
  .header-actions .btn { padding-inline: 12px; }
  .header-actions .btn .btn-label { display: none; }
  .hero-actions .btn { flex: 1; }
  .hero-meta div { min-width: 100px; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 0; }
  .quick-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid .summary-stat:last-child { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid .footer-contact { grid-column: auto; }
  .notif-menu { right: -50px; }
  .table-note { text-align: left; }
  .cart-drawer .drawer-body { padding: 18px; }
  .drawer-head, .drawer-foot { padding-inline: 18px; }
}
/* ============ Real data app additions ============ */
[hidden] { display: none !important; }
.noscript {
  padding: 14px 18px; background: var(--danger); color: #fff;
  font-size: 13px; text-align: center;
}
.live-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em;
  color: var(--muted); white-space: nowrap;
}
.live-chip .live-dot { width: 5px; height: 5px; }
.data-flag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.06em; color: var(--muted); white-space: nowrap;
}
.data-flag .icon { color: var(--success); }
.brand-name { max-width: 13em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand .brand-name { max-width: 9em; }

.notice-shell { padding-top: 18px; padding-bottom: 0; }
.site-notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line));
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
  border-radius: var(--radius);
}
.site-notice-label {
  flex: none; margin-top: 1px; padding: 1px 6px;
  background: var(--warning); color: #fff;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
}
.site-notice p { white-space: pre-line; font-size: 12.5px; line-height: 1.7; color: var(--fg); }

.boot {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; padding: 28px; background: var(--ink); color: var(--on-ink); text-align: center;
}
.boot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--on-ink) 4%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--on-ink) 4%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
}
.boot-mark {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 58px; height: 58px; margin-bottom: 18px;
  background: var(--accent); color: var(--on-accent);
}
.boot-mark .icon { width: 34px; height: 34px; }
.boot-name { position: relative; z-index: 1; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: 0.12em; }
.boot-sub { position: relative; z-index: 1; margin-top: 6px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.2em; color: color-mix(in srgb, var(--on-ink) 46%, transparent); }
.boot-status { position: relative; z-index: 1; margin-top: 34px; font-size: 12.5px; color: color-mix(in srgb, var(--on-ink) 72%, transparent); }
.boot-bar { position: relative; z-index: 1; width: min(240px, 70vw); height: 2px; margin-top: 14px; background: color-mix(in srgb, var(--on-ink) 14%, transparent); overflow: hidden; }
.boot-bar span { display: block; width: 38%; height: 100%; background: var(--accent); animation: boot-run 1.15s ease-in-out infinite; }
.boot.is-error .boot-bar { display: none; }
.boot .btn { position: relative; z-index: 1; margin-top: 22px; }
.boot-hint { position: relative; z-index: 1; margin-top: 14px; font-size: 10.5px; color: color-mix(in srgb, var(--on-ink) 42%, transparent); }
@keyframes boot-run { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }

.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.inline-hint { font-size: 10.5px; line-height: 1.7; color: var(--muted); }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); }
.checkbox-row input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.checkbox-row label { font-size: 12px; font-weight: 600; }
.checkbox-row p { margin-top: 3px; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.read-only-box { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; }

.modal.wide { width: min(780px, calc(100vw - 32px)); }
.modal.xwide { width: min(1040px, calc(100vw - 32px)); }
.modal .form-grid { margin-top: 0; }
.modal-body > .error-banner:first-child { margin-top: 0; }
.order-detail-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.order-detail-head .order-number { margin: 0; }
.order-detail-head .badge { font-size: 11px; padding: 3px 9px; }
.modal-section-title { margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.modal-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-items th:first-child, .detail-items td:first-child { text-align: left; }

.table-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-panel .table-scroll { overflow-x: auto; }
.table-panel .data-table { min-width: 840px; }
.table-panel .data-table th { background: var(--surface-2); }
.table-empty { padding: 46px 22px; text-align: center; }
.table-empty .icon { width: 30px; height: 30px; margin: 0 auto 12px; color: var(--muted); }
.table-empty strong { display: block; font-size: 13px; }
.table-empty p { max-width: 46ch; margin: 5px auto 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
.table-empty .btn { margin-top: 15px; }
.cell-nowrap { white-space: nowrap; }
.cell-sub { margin-top: 2px; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.cell-strong { font-weight: 600; }
.amount-plus { color: color-mix(in srgb, var(--success) 82%, var(--fg)); }
.amount-minus { color: color-mix(in srgb, var(--danger) 82%, var(--fg)); }
.order-status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.order-status::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.order-status.pending { color: color-mix(in srgb, var(--warning) 84%, var(--fg)); }
.order-status.shipped { color: color-mix(in srgb, var(--info) 84%, var(--fg)); }
.order-status.done { color: color-mix(in srgb, var(--success) 82%, var(--fg)); }
.order-status.canceled { color: var(--muted); }
.status-tabs .tab-count { margin-left: 4px; font-family: var(--font-mono); font-size: 9px; color: var(--muted); }

.summary-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-panel { margin-bottom: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }
.quick-tile {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; min-height: 76px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: left;
}
.quick-tile:hover { border-color: var(--accent); background: var(--surface-2); }
.quick-tile-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); }
.quick-tile-icon .icon { width: 18px; height: 18px; }
.quick-tile-text { min-width: 0; }
.quick-tile-text b { display: block; font-size: 13px; font-weight: 600; }
.quick-tile-text em { display: block; margin-top: 3px; font-style: normal; font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.pending-panel { margin-bottom: 14px; }
.panel-note { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.7; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; align-items: start; }
.settings-stack { display: grid; gap: 14px; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.settings-card .panel-body { padding: 18px; }
.settings-card .form-grid { gap: 14px; }
.settings-card .form-actions { margin-top: 18px; }
.settings-meta { display: grid; gap: 12px; }
.settings-meta-row { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.settings-meta-row:last-child { padding-bottom: 0; border-bottom: 0; }
.settings-meta-row span { color: var(--muted); }
.settings-meta-row strong { text-align: right; font-weight: 600; }
.role-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.role-list li { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); font-size: 11px; line-height: 1.65; color: var(--muted); }
.role-list b { color: var(--fg); }
.staff-role { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; }
.staff-role::before { content: ""; width: 5px; height: 5px; background: var(--accent); }
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.user-inline { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.user-inline .user-name { color: var(--fg); font-size: 11.5px; }
.user-inline .user-role { color: var(--muted); font-size: 9.5px; }

.drawer-notice { margin-bottom: 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--line)); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); font-size: 11px; line-height: 1.65; color: var(--fg); }
.cart-empty { padding: 34px 0; text-align: center; }
.cart-empty .icon { width: 30px; height: 30px; margin: 0 auto 10px; color: var(--muted); }
.cart-empty strong { display: block; font-size: 13px; }
.cart-empty p { margin-top: 4px; font-size: 11px; color: var(--muted); }
.checkout-section-title { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.checkout-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-error { display: none; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); font-size: 11px; line-height: 1.6; }
.form-error.show { display: block; }

.app-topbar .icon-btn, .topbar-cart { flex: none; }
.app-content { min-height: calc(100vh - 61px); }
.page-head .eyebrow { margin-bottom: 8px; }
.page-head h1 { font-size: clamp(22px, 2.2vw, 29px); }
.page-actions .btn .icon { width: 15px; height: 15px; }
.kpi-grid .kpi-label .icon { color: var(--muted); }
.panel-head .panel-link { white-space: nowrap; }
.chart-empty { padding: 32px 12px; text-align: center; font-size: 11px; color: var(--muted); }
.alert-item .btn { flex: none; }
.data-table.compact .badge { font-size: 9.5px; }
.audit-detail { max-width: 460px; color: var(--fg); font-size: 11px; line-height: 1.6; word-break: break-word; }

@media (max-width: 1120px) {
  .settings-grid { grid-template-columns: 1fr; }
  .summary-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .form-grid.three { grid-template-columns: 1fr; }
  .notice-shell { padding-top: 14px; }
  .site-notice { padding: 10px 12px; }
  .settings-card .panel-body { padding: 15px; }
  .page-head h1 { font-size: 22px; }
  .live-chip { display: none; }
  .data-flag { white-space: normal; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid.four { grid-template-columns: 1fr 1fr; }
  .modal.wide, .modal.xwide { width: calc(100vw - 24px); }
}
@media (max-width: 480px) {
  .summary-grid.four { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .app-topbar .topbar-cart { display: none; }
  .boot-name { font-size: 24px; }
}

/* ============ Customers / suppliers / quotes / reports ============ */
.summary-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.aging-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--line);
}
.aging-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.aging-grid div { padding: 12px 14px; background: var(--surface); }
.aging-grid span { display: block; font-size: 10px; color: var(--muted); }
.aging-grid b { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.order-status.review { color: color-mix(in srgb, var(--warning) 84%, var(--fg)); }
.order-status.partial { color: color-mix(in srgb, var(--info) 84%, var(--fg)); }

.quote-table { min-width: 640px; }
.quote-table td { vertical-align: middle; }
.quote-table .input, .quote-table .select { width: 100%; }
.quote-editor-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line);
}
.quote-total { font-size: 11.5px; color: var(--muted); }
.quote-total b { margin-left: 6px; font-family: var(--font-mono); font-size: 19px; color: var(--fg); }
.ship-table { min-width: 560px; }
.ship-table .input { width: 100%; min-width: 100px; }

.report-toolbar { align-items: flex-end; }
.report-toolbar .field { flex: 0 0 180px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.report-grid .panel { margin: 0; }
.report-table { min-width: 520px; }
.report-warning {
  display: flex; align-items: flex-start; gap: 11px; margin: 14px 0;
  padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line));
  background: color-mix(in srgb, var(--warning) 7%, var(--surface)); border-radius: var(--radius);
}
.report-warning .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--warning); }
.report-warning b { font-size: 12px; }
.report-warning p { margin-top: 4px; font-size: 10.5px; line-height: 1.7; color: var(--muted); }
.report-inline-note { margin: 0 0 14px; padding: 10px 13px; border-left: 2px solid var(--accent); background: var(--surface-2); font-size: 11px; color: var(--muted); }
.report-inline-note b { color: var(--fg); }

@media (max-width: 760px) {
  .summary-grid.three { grid-template-columns: 1fr; }
  .aging-grid, .aging-grid.four { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .report-toolbar .field { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .aging-grid, .aging-grid.four { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ledger-summary, .ledger-hero { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ Mobile simplification ============ */
@media (max-width: 760px) {
  /* Site header：只留品牌和菜单，购物清单与登录收进菜单 */
  .site-header .brand-sub { display: none; }
  .header-inner { min-height: 54px; gap: 12px; }
  #siteCartBtn, #siteAuthBtn { display: none; }
  .header-actions { gap: 8px; }
  .menu-btn { width: 40px; height: 40px; }
  .mobile-nav a[href="#categories"],
  .mobile-nav a[href="#service"],
  .mobile-nav a[href="#warehouse"] { display: none; }
  .mobile-nav .shell { padding-block: 8px 12px; }
  .mobile-nav a, .mobile-nav button { padding: 12px 0; }

  /* Hero：去掉重复说明和两个重复按钮，只留一句主张和两项实时数据 */
  .hero-inner { padding-block: 24px 26px; }
  .hero-copy .eyebrow, .hero-sub, .hero-actions { display: none; }
  .hero h1 { margin-top: 0; font-size: calc(clamp(26px, 8.2vw, 32px) * var(--seed-type-scale)); line-height: 1.2; }
  .hero h1 br { display: none; }
  .hero-meta { margin-top: 16px; padding-top: 12px; gap: 10px 20px; }
  .hero-meta div { flex: 1; min-width: 0; }
  .hero-meta div:last-child { display: none; }
  .hero-meta span { display: none; }
  .hero-meta b { margin-top: 0; font-size: 12.5px; }

  /* 常用入口：两列紧凑按钮，说明文字不再重复 */
  .entries { padding-block: 16px 18px; }
  .entries-head { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 10px; }
  .entries-head p, .entries-hint, .entry-foot { display: none; }
  .entries-title { font-size: calc(20px * var(--seed-type-scale)); }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .entry-card {
    flex-direction: row; align-items: center; gap: 9px;
    min-height: 62px; padding: 11px 10px;
  }
  .entry-icon { width: 34px; height: 34px; }
  .entry-icon .icon { width: 18px; height: 18px; }
  .entry-body b { font-size: 13.5px; letter-spacing: 0; }
  .entry-body span, .entry-go { display: none; }

  /* 官网只保留“入口 + 现货”，营销与说明区块在手机端收起 */
  .ticker, .categories, .process, .hazard, .warehouse { display: none; }
  .notice-shell { padding-top: 10px; }
  .site-notice { padding: 10px 12px; }

  /* 现货区：只留搜索框，商品改为三列紧凑信息卡 */
  #inventory.section { padding-block: 18px 26px; }
  #inventory .section-head { padding-bottom: 0; margin-bottom: 12px; border-bottom: 0; }
  #inventory .section-head .eyebrow, #inventory .section-desc { display: none; }
  #inventory .section-title { margin-top: 0; font-size: calc(21px * var(--seed-type-scale)); }
  #inventory .inventory-toolbar {
    grid-template-columns: 1fr; gap: 0; padding: 10px;
    border-bottom: 1px solid var(--line);
  }
  #inventory .inventory-toolbar > .field:not(:first-child),
  #inventory .inventory-toolbar .toolbar-reset,
  #inventory .inventory-toolbar .field > label { display: none; }
  #inventory .inventory-toolbar .input { min-height: 40px; }
  #inventory .inventory-meta { padding: 8px 12px; }
  #inventory .inventory-meta .meta-right { display: none; }
  #inventory .inventory-meta > span { font-size: 10px; }
  #inventory .data-table tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px; padding: 12px;
  }
  #inventory .data-table td:nth-child(2) { display: none; }
  #inventory .data-table td:first-child { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  #inventory .data-table td:nth-child(3),
  #inventory .data-table td:nth-child(4),
  #inventory .data-table td:nth-child(5) { min-width: 0; }
  #inventory .product-name { font-size: 13px; gap: 5px; }
  #inventory .product-spec { font-size: 9px; }
  #inventory .stock-cell { min-width: 0; }
  #inventory .stock-line { flex-wrap: wrap; gap: 2px 3px; font-size: 13px; line-height: 1.35; }
  #inventory .stock-line .unit-aux { font-size: 8.5px; white-space: normal; }
  #inventory .stock-bar, #inventory .stock-cell .cell-sub { display: none; }
  #inventory .price { font-size: 12px; white-space: normal; }
  #inventory .price small { font-size: 8.5px; }
  #inventory .data-table td:last-child { margin-top: 2px; }
  #inventory .data-table td:last-child .btn { min-height: 36px; font-size: 11.5px; }
  #inventory .table-note { display: none; }

  /* Footer：只保留品牌和联系方式 */
  .site-footer { padding-block: 22px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 16px; }
  .footer-brand p, .site-footer .brand-sub { display: none; }
  .footer-grid .footer-col:not(.footer-contact) { display: none; }
  .footer-grid .footer-contact { grid-column: auto; }
  .footer-col h4 { margin-bottom: 6px; }
  .footer-contact { font-size: 11.5px; line-height: 1.8; }
  .footer-contact strong { font-size: 15px; }
  .footer-bottom { flex-direction: row; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; }
  .footer-bottom p { font-size: 9.5px; }
  .footer-bottom .data-flag { display: none; }

  /* 工作台顶栏：只留刷新和提醒 */
  .app-topbar { min-height: 54px; padding-inline: 12px; }
  .app-topbar .topbar-cart, #themeToggle { display: none; }
  .topbar-actions { gap: 6px; }
  .app-content { padding: 14px 12px 24px; }
  .status-tabs { scrollbar-width: none; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .status-tabs button { padding: 9px 10px; font-size: 11px; }

  /* 页头：收起说明文字，操作按钮压缩成一行 */
  .page-head { gap: 10px; margin-bottom: 14px; }
  .page-head .eyebrow, .page-head p { display: none; }
  .page-head h1 { margin: 0; font-size: 20px; }
  .page-actions { gap: 8px; }
  .page-actions .btn { flex: 1; min-height: 38px; padding: 8px 10px; font-size: 12px; }
  .page-actions .btn .icon { width: 14px; height: 14px; }
  #appContent[data-view="dashboard"] > .page-head { display: none; }

  /* 工作台常用功能：去掉外框和说明，两列大按钮 */
  .quick-panel { margin-bottom: 10px; background: transparent; border: 0; border-radius: 0; }
  .quick-panel > .panel-head { display: none; }
  .quick-panel .panel-body { padding: 0; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick-tile:nth-child(n+7) { display: none; }
  .quick-tile { align-items: center; gap: 9px; min-height: 58px; padding: 10px; }
  .quick-tile-icon { width: 30px; height: 30px; }
  .quick-tile-icon .icon { width: 16px; height: 16px; }
  .quick-tile-text b { font-size: 12px; }
  .quick-tile-text em { display: none; }

  /* 工作台指标：两列，去掉二级说明 */
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .kpi { padding: 11px 12px 10px; }
  .kpi-label { font-size: 9.5px; }
  .kpi-label .icon { width: 13px; height: 13px; }
  .kpi-value { margin-top: 5px; font-size: 17px; line-height: 1.3; }
  .kpi-value small { font-size: 8.5px; }
  .kpi-sub { display: none; }

  /* 工作台只保留库存预警和订单待办，7 日图表在手机端收起 */
  .dash-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
  .dash-grid > .panel:first-child { display: none; }
  .dash-grid > .panel { margin-bottom: 0; }
  .pending-panel { margin-bottom: 0; }

  /* 其他业务页的统计卡：两列，金额允许换行 */
  .summary-grid, .summary-grid.three, .summary-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .summary-grid .summary-stat { padding: 12px; }
  .summary-grid .summary-stat:last-child { grid-column: auto; }
  .summary-grid.three .summary-stat:last-child { grid-column: 1 / -1; }
  .summary-stat b { font-size: 18px; overflow-wrap: anywhere; }
  .summary-stat span { font-size: 9.5px; }
  .aging-grid, .aging-grid.four { gap: 1px; }
  .aging-grid div { padding: 10px 12px; }

  /* 台账表格在手机端收紧，但仍保留横向滚动查看完整列 */
  .data-table th, .data-table td { padding: 10px 12px; }
  .data-table.compact { min-width: 640px; }

  /* 单据中心：手机端改成卡片式单据行，打印按钮始终可见 */
  .table-panel .doc-table { min-width: 0; display: block; }
  .doc-table thead { display: none; }
  .doc-table tbody { display: block; }
  .doc-table tr { display: block; margin: 0 0 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .doc-table tbody tr:last-child { margin-bottom: 0; }
  .doc-table td { display: flex; gap: 10px; align-items: flex-start; width: auto; padding: 3px 0; border: 0; font-size: 11.5px; }
  .doc-table td::before { content: attr(data-label); flex: 0 0 74px; color: var(--muted); font-size: 9.5px; line-height: 1.8; }
  .doc-table td > * { min-width: 0; }
  .doc-table td .table-actions { gap: 14px; }
  .doc-table td[data-label="操作"] { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
  .doc-table td .cell-sub, .doc-table td .order-items { font-size: 10px; }
}

@media (max-width: 480px) {
  .header-inner { min-height: 52px; }
  .hero-inner { padding-block: 20px 22px; }
  .hero h1 { font-size: calc(25px * var(--seed-type-scale)); }
  .entry-grid, .quick-grid, .kpi-grid, .summary-grid, .summary-grid.three, .summary-grid.four,
  .aging-grid, .aging-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid .summary-stat:last-child { grid-column: auto; }
  .summary-grid.three .summary-stat:last-child { grid-column: 1 / -1; }
  .footer-bottom p { font-size: 9px; }
}

/* 一单多品种：入库 / 出库明细表 */
.stock-table td { vertical-align: top; }
.stock-table .select, .stock-table .input { width: 100%; }
.stock-table .field-hint { display: block; margin-top: 4px; line-height: 1.45; }
.stock-cell-label { display: block; margin-bottom: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.stock-input-unit { display: flex; align-items: center; gap: 6px; }
.stock-input-unit .input { flex: 1 1 auto; min-width: 0; }
.stock-input-unit .unit-tag { flex: none; }
.stock-line-total { padding-top: 22px; font-family: var(--font-mono); font-size: 11px; }
.stock-doc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.stock-table.inbound-table { min-width: 980px; }
.stock-table.outbound-table { min-width: 720px; }

@media (max-width: 760px) {
  .data-table.stock-table { min-width: 0; }
  .stock-table, .stock-table tbody, .stock-table tr, .stock-table td { display: block; width: 100%; }
  .stock-table thead { display: none; }
  .stock-table tbody { display: grid; gap: 10px; }
  .stock-table tr { margin: 0; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface); }
  .stock-table td { padding: 8px 0 0; border: 0; }
  .stock-table td:first-child { padding-top: 0; }
  .stock-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 9.5px; font-weight: 600; color: var(--muted); }
  .stock-table .stock-cell-label { display: none; }
  .stock-table td[data-label="操作"] { padding-top: 10px; text-align: right; }
  .stock-table td[data-label="操作"]::before { display: none; }
  .stock-line-total { padding-top: 8px; }
}
