:root {
  color-scheme: light;
  --ink: #17221c;
  --muted: #637068;
  --line: #dfe6e1;
  --paper: #f6f8f6;
  --card: #ffffff;
  --green: #1f7a4d;
  --green-dark: #145f3a;
  --mint: #e8f5ed;
  --amber: #f1a93b;
  --amber-soft: #fff5e4;
  --red: #b53c36;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: #14261e; color: white; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.brand-mark { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--amber); color: #1f281f; font-weight: 900; font-size: 24px; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 12px; font-size: 16px; }
nav { margin-top: 36px; }
.nav-item { display: block; color: white; text-decoration: none; padding: 13px 14px; border-radius: 12px; font-weight: 650; }
.nav-item.active { background: rgba(255,255,255,.12); }
.sidebar-footer { margin-top: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; color: #c1cec6; font-size: 14px; }
.link-button { border: 0; background: transparent; color: white; padding: 0; text-align: left; }
main { max-width: 1180px; width: 100%; padding: 44px 48px 80px; }
.page-header, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
h1 { margin: 4px 0 6px; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.035em; }
h2 { margin: 2px 0 0; font-size: 24px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; color: var(--muted); }
.eyebrow.accent { color: #ad6800; }
.subtitle { margin: 0; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.mode-badge, .count { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.mode-badge.fixture { border-color: #f1c77f; background: var(--amber-soft); color: #855000; }
.mode-badge.live { border-color: #add6bd; background: var(--mint); color: var(--green-dark); }
.secondary, .primary { border: 0; border-radius: 11px; padding: 10px 15px; font-weight: 750; }
.secondary { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.primary:disabled { opacity: .55; cursor: wait; }
.wide { width: 100%; padding: 13px; }
section { margin-top: 38px; }
.items { margin-top: 16px; display: grid; gap: 12px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; grid-template-columns: minmax(0,1.4fr) minmax(160px,.7fr) auto; align-items: center; gap: 20px; box-shadow: 0 5px 18px rgba(31,54,42,.04); }
.priority .item { border-color: #efca8e; box-shadow: 0 7px 24px rgba(173,104,0,.08); }
.item-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.item-title strong { font-size: 18px; }
.part-number { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--green-dark); font-weight: 800; }
.description { margin: 5px 0 0; color: var(--muted); }
.supplier { font-weight: 750; }
.meta { margin-top: 5px; color: var(--muted); font-size: 13px; }
.quantity { text-align: right; }
.quantity strong { display: block; font-size: 22px; }
.quantity span { color: var(--muted); font-size: 12px; }
.accept { min-width: 118px; }
.doc-chip { display: inline-flex; margin-top: 9px; border-radius: 7px; padding: 4px 7px; background: var(--amber-soft); color: #855000; font-size: 12px; font-weight: 750; }
.notice { border-radius: 12px; padding: 12px 15px; background: var(--mint); color: var(--green-dark); }
.notice.error { background: #fcebea; color: var(--red); }
.sync-status { margin: 0 0 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--muted); font-size: 13px; }
.sync-status.ok, .sync-status.live { border-color: #b8d9c5; background: #edf8f1; color: var(--green); }
.sync-status.failed, .sync-status.auth_required { border-color: #efc1bd; background: #fff2f0; color: var(--red); }
.search-box { display: grid; gap: 6px; margin: 0 0 24px; color: var(--muted); font-size: 12px; font-weight: 700; }
.search-box input { width: min(520px, 100%); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: white; color: var(--ink); font: inherit; }
.loading, .empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-icon { margin: 0 auto 12px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--green); font-size: 24px; }
.empty h2 { color: var(--ink); }
.login-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #f6e8c6, transparent 35%), #eef3ef; }
.login-card { width: min(390px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 25px 70px rgba(30,54,42,.12); }
.login-card h1 { font-size: 30px; margin-bottom: 28px; }
.login-card label { display: grid; gap: 7px; margin: 14px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; color: var(--ink); }
.login-card .primary { margin-top: 8px; }
.text-button { margin-top: 10px; border: 0; background: transparent; color: var(--green); font-weight: 750; }
.login-hint { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; flex-direction: row; align-items: center; gap: 12px; }
  .brand span:last-child, .sidebar-footer { display: none; }
  nav { margin: 0; flex: 1; }
  .nav-item { text-align: center; }
  main { padding: 28px 18px 60px; }
  .page-header { align-items: flex-end; }
  .subtitle, #refresh { display: none; }
  .item { grid-template-columns: 1fr auto; }
  .item-details { grid-column: 1 / -1; }
  .quantity { text-align: left; }
}
