:root {
  color-scheme: light;
  --ink: #19243b;
  --muted: #505f76;
  --border: #dce3ee;
  --surface: #fff;
  --canvas: #f3f6fb;
  --accent: #2b4ac3;
  --nav: #14213d;
  --nav-text: #dbe5f8;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #6a87f5; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.55rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 1.16rem; letter-spacing: -.01em; }
p { color: var(--muted); }
.admin-screen { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 2.35rem; padding: 1.55rem 1.05rem; background: var(--nav); color: var(--nav-text); }
.brand { display: flex; gap: .65rem; align-items: center; color: inherit; text-decoration: none; line-height: 1.2; }
.brand-icon { display: grid; flex: 0 0 2rem; height: 2rem; place-items: center; border-radius: .6rem; background: #dbe5ff; color: #243d9f; font-weight: 800; }
.sidebar nav { display: grid; gap: .3rem; }
.sidebar nav a, .sign-out { padding: .7rem .75rem; border-radius: .55rem; text-align: left; color: var(--nav-text); text-decoration: none; font-size: .9rem; }
.sidebar nav a:hover, .sidebar nav a[aria-current], .sign-out:hover { background: #26385d; color: #fff; }
.nav-icon { display: inline-block; width: 1.35rem; }
.sidebar form { margin-top: auto; }
.sign-out { border: 1px solid #435475; background: transparent; width: 100%; cursor: pointer; }
.main { width: 100%; max-width: 93rem; padding: clamp(1.15rem, 3.8vw, 3.15rem); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.65rem; flex-wrap: wrap; }
.page-header p { margin-top: .5rem; }
.actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.button { display: inline-flex; width: fit-content; align-items: center; justify-content: center; border-radius: .55rem; background: #fff; color: var(--ink); border: 1px solid var(--border); padding: .59rem .9rem; font-weight: 650; font-size: .9rem; text-decoration: none; white-space: nowrap; cursor: pointer; }
.button:hover { border-color: #8392b0; background: #f6f8ff; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #213a9b; border-color: #213a9b; }
.compact { padding: .35rem .65rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; margin-bottom: 1.15rem; }
.metric, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: .8rem; }
.metric { padding: 1rem 1.15rem; display: grid; gap: .38rem; }
.metric span { color: var(--muted); font-size: .875rem; font-weight: 600; }
.metric strong { font-size: 1.85rem; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.padded { padding: clamp(1rem, 2vw, 1.45rem); }
.filters { display: flex; padding: 1rem 1.15rem; gap: .65rem; flex-wrap: wrap; align-items: end; }
.report-actions { flex-basis: 100%; }
.report-actions small { align-self: center; }
.courier-columns { border-top: 1px solid var(--border); }
.courier-heading { display: grid; gap: .25rem; padding: .8rem 1.15rem; }
.courier-columns th { white-space: nowrap; }
.courier-columns td { min-width: 7rem; max-width: 18rem; overflow-wrap: anywhere; vertical-align: top; }
.courier-columns th:first-child, .courier-columns td:first-child { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--border); }
.courier-columns td:first-child { background: var(--surface); white-space: nowrap; }
.courier-columns td:first-child form { margin-top: .4rem; }
.courier-columns td input, .courier-columns td select { min-width: 5.5rem; }
.courier-columns td:nth-child(9) input, .courier-columns td:nth-child(10) input, .courier-columns td:nth-child(22) input { min-width: 14rem; }
.courier-columns td:last-child { text-align: left; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; border: 1px solid #b9c5d9; background: #fff; color: var(--ink); border-radius: .5rem; padding: .56rem .68rem; font-weight: 400; }
select { padding-right: 1.4rem; }
textarea { resize: vertical; }
input::placeholder { color: #62748d; }
.check { display: flex; align-items: baseline; gap: .45rem; font-weight: 400; }
.check input { accent-color: var(--accent); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.order-list table { min-width: 45rem; }
.order-list .order-summary { min-width: 65rem; }
.order-summary td:nth-child(3), .order-summary td:nth-child(4) { min-width: 9rem; max-width: 18rem; overflow-wrap: anywhere; }
th { background: #f5f7fc; color: var(--muted); font-size: .875rem; font-weight: 650; border-block: 1px solid var(--border); }
th, td { padding: .8rem 1.15rem; }
td { font-size: .94rem; border-bottom: 1px solid var(--border); }
td small { overflow-wrap: anywhere; }
td:last-child { text-align: right; }
.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
small { display: block; color: var(--muted); font-size: .82rem; }
.badge { display: inline-flex; font-size: .875rem; font-weight: 700; border-radius: 99px; padding: .28rem .68rem; white-space: nowrap; background: #eef2f8; color: #35435c; }
.status-new { background: #eaf0ff; color: #294093; }
.status-processing { background: #fff1d0; color: #724800; }
.status-shipped { background: #eaeaff; color: #4f348d; }
.status-delivered { background: #e2f4e9; color: #205f40; }
.status-cancelled { background: #fbe9eb; color: #9a3039; }
.pagination { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; padding: .85rem 1.15rem; }
.empty { text-align: center; border-top: 1px solid var(--border); padding: 3rem 1rem; }
.empty p { margin-top: .4rem; }
.back { margin-bottom: .8rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stack { display: grid; gap: .85rem; }
.padded h2 { margin-bottom: .8rem; }
.items { margin-top: .3rem; }
.items th, .items td { padding-inline: .65rem; }
.total { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-weight: 650; }
.total strong { font-size: 1.2rem; }
dl { display: grid; gap: .2rem; margin: 0; }
dt { color: var(--muted); font-weight: 600; font-size: .875rem; }
dd { margin: 0 0 .6rem; overflow-wrap: anywhere; }
dd:last-child { margin-bottom: 0; }
.subsection { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.timeline { display: grid; gap: .85rem; padding: 1rem 0 0 1.2rem; margin: 1rem 0 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.timeline strong { font-weight: 600; }
.notice { border: 1px solid var(--border); border-radius: .5rem; padding: .65rem .85rem; margin-bottom: 1rem; }
.notice.error { background: #fbe9eb; color: #81222b; border-color: #eeb7bb; }
.notice.success { background: #e5f6eb; color: #205f40; border-color: #a9d8bc; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 26rem); padding: 1.85rem; border: 1px solid var(--border); border-radius: 1rem; background: #fff; box-shadow: 0 18px 50px #21396214; }
.login-card h1 { margin: 1.4rem 0 1rem; font-size: 1.65rem; }
.login-card .button { width: 100%; margin-top: .3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 960px) {
  .admin-screen { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar form { margin: 0 0 0 auto; }
}
@media (max-width: 680px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar nav { order: 2; width: 100%; }
  .sidebar nav a { padding-inline: .45rem; }
  .page-header { gap: .8rem; }
}
