:root {
    --moss: #1f3a2e;
    --moss-2: #2c5242;
    --cream: #faf7f2;
    --card: #ffffff;
    --ink: #1d2a24;
    --muted: #66726b;
    --line: #e7e1d6;
    --rose: #b83a63;       /* the one accent: primary series */
    --rose-soft: #f4dde5;
    --stem: #4f7f6a;       /* secondary series */
    --warn: #8a5a00;
    --radius: 12px;
    --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    background: var(--cream);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
}

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* ---- navigation ---- */
.nav { background: var(--moss); color: #dfe9e3; padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s1); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; letter-spacing: .2px; color: #fff; padding: 0 var(--s2) var(--s4); }
.brand svg { color: #f0b8c9; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9d8d0; text-decoration: none; }
.nav-item:hover { background: var(--moss-2); color: #fff; }
.nav-item.active { background: var(--rose); color: #fff; }

/* ---- content ---- */
.content { padding: var(--s5) var(--s5) 64px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
h1 { font-size: 28px; margin: 0; letter-spacing: -.2px; }
.sub { margin: 2px 0 0; color: var(--muted); }
h2 { font-size: 15px; margin: 0 0 var(--s3); font-weight: 650; }

.updated { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.updated .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stem); animation: pulse 2.4s ease-in-out infinite; }
.updated.stale { color: var(--warn); }
.updated.stale .dot { background: var(--warn); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s3) 14px; }
.tile-label { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 26px; font-weight: 650; margin-top: 2px; overflow-wrap: anywhere; }
.tile-note { color: var(--muted); font-size: 12px; margin-top: 2px; }

.grid { display: grid; gap: var(--s3); margin-bottom: var(--s3); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s4); margin-bottom: var(--s3); }
.grid .card { margin-bottom: 0; }

.empty { color: var(--muted); padding: var(--s3) 0; }
.hint { color: var(--muted); font-size: 12px; margin: var(--s2) 0 0; }
.banner { background: #fff4e0; border: 1px solid #ecd2a0; color: var(--warn); border-radius: var(--radius); padding: 12px var(--s3); margin-bottom: var(--s3); }
.banner.info { background: var(--rose-soft); border-color: #e8bfce; color: #6f2540; }

/* ---- bars ---- */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 36%) 1fr auto; align-items: center; gap: 12px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #f1ece3; border-radius: 6px; height: 14px; overflow: hidden; display: block; }
.bar-fill { display: block; height: 100%; background: var(--rose); border-radius: 6px; transition: width .5s ease; }
.bar-fill.alt { background: var(--stem); }
.bar-value { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 14px; text-align: right; min-width: 3ch; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid #f1ece3; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #eee9df; color: var(--ink); }
.pill.delivered { background: #dcebe3; color: #1e5a40; }
.pill.outfordelivery { background: var(--rose-soft); color: #7a2a47; }
.pill.failed, .pill.cancelled { background: #f0e0dc; color: #7a3a2a; }

/* ---- notifications ---- */
.toasts { position: fixed; right: var(--s4); bottom: var(--s4); display: grid; gap: var(--s2); z-index: 10; max-width: 320px; }
.toast { background: var(--moss); color: #fff; border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: slide .25s ease-out; }
.toast-detail { font-size: 12px; opacity: .8; margin-top: 2px; overflow-wrap: anywhere; }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- small screens: nav becomes a top bar ---- */
@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .nav { flex-direction: row; height: auto; position: static; overflow-x: auto; padding: var(--s2) var(--s3); align-items: center; }
    .brand { padding: 0 var(--s3) 0 0; }
    .brand span { display: none; }
    .content { padding: var(--s4) var(--s3) 48px; }
    .bars li { grid-template-columns: minmax(70px, 40%) 1fr auto; }
}
@media (prefers-reduced-motion: reduce) { .updated .dot, .toast, .bar-fill { animation: none; transition: none; } }
