:root {
  color-scheme: light;
  --text: #1d2430;
  --muted: #667085;
  --line: #e3e6eb;
  --navy: #1f3b63;
  --navy-dark: #162c4a;
  --bg: #ffffff;
  --soft: #f6f7f9;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; }
.muted, .hint, .page-heading p { color: var(--muted); }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1040px; margin: auto; padding: 0 24px; min-height: 56px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); white-space: nowrap; }
.can-icon { flex: none; }
nav { display: flex; gap: 24px; align-self: stretch; }
nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; }
nav a:hover { color: var(--text); }
nav a[aria-current] { color: var(--text); border-color: var(--navy); font-weight: 500; }
.top-inner > form { margin-left: auto; }

/* page */
.shell { max-width: 1040px; margin: auto; padding: 32px 24px 48px; }
.page-heading, .section-heading, .refill { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-heading { margin-bottom: 24px; }
.page-heading p { margin-top: 4px; font-size: 14px; }
.panel { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.listing { overflow: hidden; }
.section-heading { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.section-heading p { font-size: 13px; }

/* stock numbers */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 24px; }
.stats > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.stats p { font-size: 12px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left; font-size: 14px; }
th, td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--soft); text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.reference { color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 3px; border: 1px solid; }
.pending { color: #8a5a00; border-color: #ecd9a8; background: #fdf8ea; }
.delivered { color: var(--navy); border-color: #c9d4e5; background: #f1f4f9; }
.returned { color: #2f6b3f; border-color: #c8dfcd; background: #f2f8f3; }
.cancelled { color: #6b7280; border-color: var(--line); background: var(--soft); }

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 14px; border: 1px solid #cfd4dc; border-radius: 4px; background: var(--bg); color: var(--text); font-size: 14px; white-space: nowrap; cursor: pointer; }
.button:hover { background: var(--soft); }
.button.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.button.primary:hover { background: var(--navy-dark); }
.button.small { min-height: 28px; padding: 2px 10px; font-size: 13px; }
.button.quiet { border-color: transparent; color: var(--muted); background: none; }
.button.quiet:hover { color: var(--text); }
.button.sign-out { min-height: 30px; font-size: 13px; }
.text-link { font-size: 14px; color: var(--navy); }
.text-link:hover { text-decoration: underline; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; }
.actions { display: flex; align-items: center; gap: 6px; }

/* forms */
.refill { margin-bottom: 24px; padding: 14px 16px; }
.refill p { font-size: 13px; }
.refill label { font-size: 13px; color: var(--muted); }
.refill input { width: 72px; }
.entry { max-width: 480px; padding: 20px; }
.form-grid { display: grid; gap: 14px; }
.form-grid label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.hint { font-size: 12px; font-weight: 400; }
input, textarea, select { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid #cfd4dc; border-radius: 4px; background: var(--bg); color: var(--text); }
input:focus, textarea:focus, select:focus { border-color: var(--navy); outline: none; }
textarea { resize: vertical; }
.notice { margin-bottom: 16px; padding: 10px 14px; border-left: 3px solid var(--navy); background: #f1f4f9; font-size: 14px; }
.notice.error { border-color: #b42318; background: #fdf3f2; color: #8c1d13; }

/* login */
.login-shell { max-width: 380px; margin: 80px auto; padding: 0 20px; }
.login-panel { padding: 28px; }
.login-panel h1 { font-size: 22px; }
.login-panel .muted { margin: 4px 0 20px; font-size: 14px; }
.demo { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; color: var(--muted); font-size: 13px; }
.demo code { color: var(--text); }

@media (max-width: 760px) {
  .top-inner { flex-wrap: wrap; gap: 0 16px; padding: 10px 16px 0; }
  nav { width: 100%; order: 1; margin-top: 4px; min-height: 40px; }
  .shell { padding: 24px 16px 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .refill { flex-wrap: wrap; }
  .login-shell { margin: 40px auto; }
  .top-inner:has(> .brand:only-child) { padding-bottom: 10px; }
}
@media (max-width: 450px) {
  .page-heading { flex-direction: column; align-items: flex-start; }
  .login-panel { padding: 22px; }
}
