:root {
  --navy: #1f3a5f;
  --ink: #1d2430;
  --muted: #5f6b7a;
  --line: #dfe3e8;
  --bg: #f5f6f8;
  --card: #ffffff;
  --open-bg: #e8f0fb;  --open-fg: #1f4f8f;
  --ship-bg: #e7f5ec;  --ship-fg: #1e6b3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
a { color: var(--navy); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--navy); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.brand { font-weight: 700; letter-spacing: .2px; }
.brand span { font-weight: 400; opacity: .8; margin-left: 10px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.userbox span { opacity: .85; }
.userbox .btn.link { color: #fff; }

main.wrap { padding-top: 24px; padding-bottom: 24px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.card.narrow { max-width: 440px; margin: 40px auto; }
.card.empty { text-align: center; color: var(--muted); }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type=email], input[type=search] {
  width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

.btn {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #b9c1cb; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; margin-top: 16px; width: 100%; padding: 10px 14px; }
.btn.link { background: none; border: none; padding: 0; text-decoration: underline; }

.pagehead { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 340px; }
.tabs { display: flex; gap: 4px; background: #e9ecf0; padding: 4px; border-radius: 8px; }
.tabs a { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; }
.tabs a b { font-weight: 600; color: var(--muted); margin-left: 4px; }
.tabs a.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: #f0f2f5; font-weight: 600; cursor: pointer; user-select: none; }
th.sorted-asc::after { content: " ▲"; font-size: 10px; }
th.sorted-desc::after { content: " ▼"; font-size: 10px; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: none; }
.r { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.pill.open { background: var(--open-bg); color: var(--open-fg); }
.pill.shipped { background: var(--ship-bg); color: var(--ship-fg); }

.footer { color: var(--muted); font-size: 13px; padding-bottom: 32px; }
.print-only { display: none; }

@media print {
  @page { size: landscape; margin: 0.5in; }
  body { background: #fff; font-size: 11px; }
  .topbar, .no-print, .footer { display: none !important; }
  .print-only { display: block; }
  .printhead { font-weight: 600; margin: 0 0 8px; }
  .pagehead { margin-bottom: 4px; }
  .pagehead .muted { display: none; }
  .tablewrap { border: none; overflow: visible; }
  th { position: static; background: #eee !important; cursor: default; }
  th::after { content: "" !important; }
  th, td { padding: 4px 6px; }
  tr { break-inside: avoid; }
  .pill { padding: 0; background: none !important; }
}
