@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&family=Stardos+Stencil:wght@700&family=Special+Elite&display=swap');

/* LMFM BLR — "parcel desk": kraft-paper desk, shipping-label cards, packing-tape top bar,
   luggage-tag menu, ink postmarks for the Home categories, stencil numbers, typewritten IDs.
   Loaded after theme.css / Tailwind on every page. Look only: no IDs or behaviour change here. */
:root {
  --kraft: #c8a27a;
  --kraft-deep: #a9825a;
  --label: #fbf8f1;        /* label paper */
  --manila: #f1e2c2;       /* luggage tags, table heads */
  --ink: #1e2b4a;          /* postal blue-black ink */
  --ink-soft: #5d5246;
  --post-blue: #23408e;    /* buttons */
  --stamp-red: #b3261e;
  --brand: #23408e;
  --brand-dark: #1a3172;
  --muted: #6b5e50;
  --line: #2a2a2a;
  --ring: 0 0 0 3px rgba(35, 64, 142, .28);
  --font: 'Archivo', system-ui, sans-serif;
  --stencil: 'Stardos Stencil', 'Archivo', sans-serif;
  --type: 'Special Elite', 'Courier New', monospace;
}

/* ---------- The desk ---------- */
html, body {
  font-family: var(--font) !important;
  color: var(--ink) !important;
  background-color: var(--kraft) !important;
  background-image:
    radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.2px),
    radial-gradient(rgba(60, 35, 10, .09) 1px, transparent 1.2px),
    linear-gradient(115deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .05)) !important;
  background-size: 7px 7px, 11px 11px, 100% 100% !important;
  background-position: 0 0, 3px 5px, 0 0 !important;
  background-attachment: fixed !important;
}
::selection { background: rgba(35, 64, 142, .25); }

/* ---------- Packing-tape top bar ---------- */
.topbar, body > header {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #c99a63, #b5874f) !important;
  border-bottom: 0 !important;
  box-shadow: 0 3px 0 rgba(70, 45, 20, .35), 0 1px 0 rgba(255, 255, 255, .25) inset !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.brand-name, body > header h1 { color: #2a1b0c !important; font-weight: 800 !important; letter-spacing: -.01em; }
.brand-sub, body > header #subtitle { color: #4d3519 !important; }
.brand-logo { background: var(--label) !important; border: 1.5px solid #2a1b0c !important; border-radius: 50% !important; }
/* the BLR rubber stamp */
.brand-name::after, body > header h1::after {
  content: "BLR"; display: inline-block; margin-left: 10px; padding: 0 7px; vertical-align: 2px;
  font-family: var(--stencil); font-size: 13px; letter-spacing: .12em; line-height: 1.5;
  color: var(--stamp-red); border: 2px solid var(--stamp-red); border-radius: 3px;
  transform: rotate(-7deg); background: rgba(255, 255, 255, .18);
}
.date-pill { background: rgba(255, 255, 255, .28) !important; color: #2a1b0c !important; border-radius: 3px !important; }
.topbar .pill { border-radius: 3px !important; }
.topbar .pill-ok { background: rgba(255, 255, 255, .3); color: #14532d; }
body > header a.text-blue-600 { color: #2a1b0c !important; font-weight: 700; }

/* ---------- Shipping-label surfaces ---------- */
.card, .bg-white, .bg-white\/95, .popover, .menu, .lmfm-exp-menu {
  background: var(--label) !important;
  border: 1.5px solid var(--line) !important;
  border-radius: 4px !important;
  box-shadow: 0 3px 0 rgba(70, 45, 20, .38) !important;
}
.bg-slate-50, .bg-slate-100 { background: var(--manila) !important; }
.card-foot { background: var(--manila) !important; border-color: var(--line) !important; }
.border-slate-100, .border-slate-200, .border-slate-300 { border-color: #cdbb98 !important; }
.shadow-sm, .shadow-xl, .shadow-lg { box-shadow: 0 3px 0 rgba(70, 45, 20, .38) !important; }
.page-title, h1.page-title { font-weight: 800 !important; color: var(--ink) !important; letter-spacing: -.02em; }
.meta, .cat-sub, .label, .kpi-label, .section-title, .menu-hint, .donut-center-sub, .donut-center-label, .table-foot,
.text-slate-500, .text-slate-400 { color: var(--muted) !important; }
.text-slate-900, .text-slate-800, .text-slate-700, .text-slate-600 { color: var(--ink) !important; }
.meta b, .meta strong { color: var(--ink) !important; }
.section-title, .kpi-label, .donut-center-label { letter-spacing: .04em !important; text-transform: none !important; font-size: 12.5px !important; font-weight: 700 !important; }

/* stencil numbers (crate markings) */
.kpi-value, .donut-center-value, #count, #total-orders, #center-orders {
  font-family: var(--stencil) !important; font-weight: 700 !important; color: var(--ink) !important; letter-spacing: .02em;
}
/* typewritten IDs */
.mono, .copy-tid, td.mono { font-family: var(--type) !important; font-size: 13px !important; color: var(--ink) !important; }

/* ---------- Controls ---------- */
.input, input, select, textarea {
  background: #fff !important; color: var(--ink) !important;
  border: 1.5px solid var(--line) !important; border-radius: 3px !important;
}
input:focus, select:focus, .input:focus { box-shadow: var(--ring) !important; outline: none; }
.btn, button.rounded-lg, a.rounded-lg { border-radius: 3px !important; }
.btn-primary, .bg-blue-600, .bg-slate-900 {
  background: var(--post-blue) !important; color: #fff !important; border: 1.5px solid #14275a !important;
  box-shadow: 0 3px 0 #14275a !important;
}
.btn-primary:hover, .hover\:bg-blue-700:hover, .hover\:bg-slate-800:hover { background: #2c4fa8 !important; }
.btn-primary:active, .bg-blue-600:active { transform: translateY(2px); box-shadow: 0 1px 0 #14275a !important; }
.btn-primary:disabled { background: #8c9bc4 !important; box-shadow: none !important; }
.btn-ghost, .lmfm-exp-btn, .back-btn {
  background: var(--label) !important; color: var(--ink) !important; border: 1.5px solid var(--line) !important;
  border-radius: 3px !important; box-shadow: 0 2px 0 rgba(70, 45, 20, .35) !important;
}
.btn-ghost:hover, .lmfm-exp-btn:hover, .back-btn:hover { background: #fff !important; }
.btn-link, .crumb:hover, .title-stack > .crumb:only-child:hover { color: var(--post-blue) !important; text-decoration: underline; text-underline-offset: 3px; }
.title-stack > .crumb:only-child { color: var(--ink) !important; }
.hover\:bg-slate-50:hover, .hover\:bg-slate-100:hover, .menu-item:hover, .lmfm-exp-menu button:hover { background: var(--manila) !important; }

/* courier tabs: folder tabs */
.seg { background: transparent !important; padding: 0 !important; gap: 6px !important; border-bottom: 1.5px solid var(--line); border-radius: 0 !important; }
.seg-btn {
  background: var(--manila) !important; color: var(--ink) !important; border: 1.5px solid var(--line) !important;
  border-bottom: 0 !important; border-radius: 6px 6px 0 0 !important; box-shadow: none !important; margin-bottom: -1.5px;
}
.seg-btn.is-active { background: var(--label) !important; font-weight: 800 !important; }
#range-group { background: var(--manila) !important; border: 1.5px solid var(--line); border-radius: 3px !important; }
#range-group button.bg-white { background: var(--post-blue) !important; color: #fff !important; box-shadow: none !important; }

/* exception filters: manila tags */
.xtile {
  background: var(--manila) !important; color: var(--ink) !important; border: 1.5px solid var(--line) !important;
  border-radius: 3px 12px 12px 3px !important; box-shadow: 0 2px 0 rgba(70, 45, 20, .35) !important;
}
.xtile-n { background: rgba(30, 43, 74, .1) !important; color: var(--ink) !important; border-radius: 3px !important; }
.xtile.is-active { background: var(--label) !important; border-color: var(--post-blue) !important; color: var(--post-blue) !important; }
.xtile.is-active .xtile-n { background: var(--post-blue) !important; color: #fff !important; }

/* ---------- Tables on labels ---------- */
.tbl thead th, thead th, thead.bg-slate-50, thead.bg-slate-50 th {
  background: var(--manila) !important; color: var(--ink) !important; font-weight: 800 !important;
  border-bottom: 1.5px solid var(--line) !important; letter-spacing: .03em;
}
.tbl tbody td, tbody td { border-top: 1px dashed #c9b796 !important; color: #2b2b33; }
.tbl tbody tr:hover td, tbody tr:hover td { background: #f7efdc !important; }
.tbl tr.state-row td, .tbl tr.state-row:hover td { background: var(--label) !important; }
tfoot, tfoot.bg-slate-50 { background: var(--manila) !important; color: var(--ink) !important; border-top: 1.5px solid var(--line); }
tfoot td { font-family: var(--stencil); font-size: 15px; }
.copy-tid { text-decoration: underline dashed !important; text-underline-offset: 3px; }
.blr-detail {
  margin-top: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.6; color: #2b2b33;
  background: #fff; border: 1.5px dashed #8a7457; border-radius: 3px;
}
.blr-detail b { color: var(--ink); }

/* ---------- Chips, notes ---------- */
.chip { border-radius: 3px !important; font-weight: 700 !important; }
.chip-plain { background: transparent !important; color: var(--ink) !important; border: 1.5px solid var(--ink); }
.chip-month { background: transparent !important; color: var(--post-blue) !important; border: 1.5px dashed var(--post-blue); }
.chip-completed { color: #166534 !important; background: transparent !important; border: 1.5px solid #166534; }
.chip-returning { color: #c2410c !important; background: transparent !important; border: 1.5px solid #c2410c; }
.chip-in_transit { color: var(--post-blue) !important; background: transparent !important; border: 1.5px solid var(--post-blue); }
.chip-risk, .chip-missing { color: var(--stamp-red) !important; background: transparent !important; border: 1.5px solid var(--stamp-red); }
.count-pill { background: transparent !important; color: var(--stamp-red) !important; border: 2px solid var(--stamp-red); border-radius: 3px !important; transform: rotate(-3deg); font-weight: 800 !important; }
.note { border-radius: 3px !important; border: 1.5px dashed #8a7457; }
.note-info { background: var(--manila) !important; color: var(--ink) !important; }
.note-warn { background: #fff4d6 !important; color: #7a4a00 !important; }
.note-error { background: #fde8e6 !important; color: var(--stamp-red) !important; }
.menu-ico, .cp-brand { background: var(--manila) !important; color: var(--ink) !important; border-radius: 3px !important; }
.empty-ico { background: var(--manila) !important; color: var(--ink) !important; border-radius: 50% !important; border: 1.5px solid var(--ink); }
/* status pills on All courier orders */
.bg-emerald-50, .bg-orange-50, .bg-blue-50, .bg-red-50 { background: transparent !important; }
.text-emerald-700 { color: #166534 !important; } .border-emerald-200 { border-color: #166534 !important; }
.text-orange-700 { color: #c2410c !important; } .border-orange-200 { border-color: #c2410c !important; }
.text-blue-700 { color: var(--post-blue) !important; } .border-blue-200 { border-color: var(--post-blue) !important; }
.text-red-700 { color: var(--stamp-red) !important; } .border-red-200 { border-color: var(--stamp-red) !important; }

/* ---------- Home: categories as ink postmarks ---------- */
div:has(> a.cat-row) {
  flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important;
  gap: 18px 22px !important; min-width: 0 !important; max-width: 420px;
}
a.cat-row {
  --ink-c: var(--ink);
  width: 168px; height: 168px; border-radius: 50% !important; padding: 0 !important;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important;
  text-align: center; color: var(--ink-c) !important;
  background: transparent !important; box-shadow: none !important;
  border: 3px solid var(--ink-c) !important;
  outline: 1.5px solid var(--ink-c); outline-offset: -10px;
  transition: transform .15s ease;
  opacity: .92;
}
a.cat-row:nth-of-type(1) { --ink-c: #166534; transform: rotate(-6deg); }
a.cat-row:nth-of-type(2) { --ink-c: #c2410c; transform: rotate(4deg); }
a.cat-row:nth-of-type(3) { --ink-c: #23408e; transform: rotate(-2deg); }
a.cat-row:nth-of-type(4) { --ink-c: #b3261e; transform: rotate(7deg); }
a.cat-row:hover, a.cat-row:focus-visible { transform: rotate(0) scale(1.04); opacity: 1; background: rgba(255, 255, 255, .45) !important; }
a.cat-row:focus-visible { box-shadow: var(--ring) !important; }
a.cat-row > div { flex-direction: column !important; gap: 2px !important; }
a.cat-row .dot, a.cat-row .arrow { display: none !important; }
a.cat-row .cat-name { color: var(--ink-c) !important; font-family: var(--stencil); font-size: 15px !important; text-transform: uppercase; letter-spacing: .08em; line-height: 1.15; max-width: 120px; }
a.cat-row .cat-sub { color: var(--ink-c) !important; font-size: 12.5px !important; }
a.cat-row .cat-sub span:first-child { font-family: var(--stencil); font-size: 30px; display: block; line-height: 1.1; }
a.cat-row .cat-pct { color: var(--ink-c) !important; font-size: 12px !important; font-weight: 800 !important; border-top: 1.5px dashed var(--ink-c); padding-top: 2px; margin-top: 2px; }
div:has(> a.cat-row) > .btn-link { flex-basis: 100%; text-align: center; justify-content: center; }
circle[stroke="#eef1f6"] { stroke: #eadcc0; }

/* ---------- Menu: closed airmail envelopes at the bottom ---------- */
:root {
  --env: #efe3c6;
  --env-flap: #e7d8b6;
  --env-line: rgba(120, 95, 60, .5);
  --airmail: repeating-linear-gradient(45deg, #b8322a 0 7px, #f7f1e3 7px 10px, #2b4a93 10px 17px, #f7f1e3 17px 20px);
  --waves: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='54'%3E%3Cg fill='none' stroke='%23222' stroke-width='2' opacity='.6'%3E%3Cpath d='M0 7q10-7 20 0t20 0 20 0 20 0 20 0 20 0'/%3E%3Cpath d='M0 19q10-7 20 0t20 0 20 0 20 0 20 0 20 0'/%3E%3Cpath d='M0 31q10-7 20 0t20 0 20 0 20 0 20 0 20 0'/%3E%3Cpath d='M0 43q10-7 20 0t20 0 20 0 20 0 20 0 20 0'/%3E%3C/g%3E%3C/svg%3E");
}
.bnav, nav.fixed.bottom-4 { bottom: 14px !important; }
.bnav-in, nav.fixed.bottom-4 > div {
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  gap: 16px !important; align-items: flex-end !important; overflow: visible !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.bnav-item, nav.fixed.bottom-4 > div > a {
  position: relative; display: flex !important; align-items: center !important; justify-content: center !important; gap: 7px !important;
  width: 178px; height: 76px; padding: 0 !important;
  color: #2a2116 !important; font-weight: 800 !important; font-size: 14.5px !important; text-shadow: 0 1px 0 var(--env);
  /* back of the envelope: the four flap folds meeting in the middle */
  background:
    linear-gradient(to bottom right, transparent calc(50% - .9px), var(--env-line) 50%, transparent calc(50% + .9px)) left top / 50% 64% no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - .9px), var(--env-line) 50%, transparent calc(50% + .9px)) right top / 50% 64% no-repeat,
    linear-gradient(to top right, transparent calc(50% - .9px), var(--env-line) 50%, transparent calc(50% + .9px)) left bottom / 50% 46% no-repeat,
    linear-gradient(to top left, transparent calc(50% - .9px), var(--env-line) 50%, transparent calc(50% + .9px)) right bottom / 50% 46% no-repeat,
    var(--env) !important;
  border: 6px solid transparent !important; border-image: var(--airmail) 6 !important; border-radius: 0 !important;
  box-shadow: 0 8px 16px rgba(60, 35, 10, .3) !important;
  transform: rotate(-2deg); transition: transform .18s ease, box-shadow .18s ease;
}
.bnav-item:nth-child(2), nav.fixed.bottom-4 > div > a:nth-child(2) { transform: rotate(1.5deg); }
.bnav-item:nth-child(3), nav.fixed.bottom-4 > div > a:nth-child(3) { transform: rotate(-1deg); }
/* round postmark top-right */
.bnav-item::after, nav.fixed.bottom-4 > div > a::after {
  content: ""; position: absolute; top: 3px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(34, 34, 34, .55); box-shadow: inset 0 0 0 3px var(--env), inset 0 0 0 4px rgba(34, 34, 34, .35);
}
.bnav-item svg { width: 17px !important; height: 17px !important; color: #2b4a93; }
.bnav-item:hover, nav.fixed.bottom-4 > div > a:hover { transform: rotate(0) translateY(-4px); }
/* the page you are on: envelope lifted, letter peeking out of the top */
.bnav-item.is-active, nav.fixed.bottom-4 > div > a.bg-blue-50 {
  transform: rotate(0) translateY(-14px); color: #1e2b4a !important;
  box-shadow: 0 14px 24px rgba(30, 30, 80, .3) !important;
}
.bnav-item.is-active::before, nav.fixed.bottom-4 > div > a.bg-blue-50::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: -22px; height: 16px;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(93, 82, 70, .25) 5px 6px) 10px 6px / 70% 10px no-repeat, var(--label);
  border: 1px solid #cdbb98; border-bottom: 0;
}
@media (max-width: 560px) {
  .bnav-in, nav.fixed.bottom-4 > div { gap: 8px !important; }
  .bnav-item, nav.fixed.bottom-4 > div > a { width: 112px; height: 62px; font-size: 12.5px !important; }
  .bnav-item svg { display: none; }
  .bnav-item::after, nav.fixed.bottom-4 > div > a::after { width: 16px; height: 16px; top: 2px; right: 3px; }
}
body { padding-bottom: 130px !important; }

/* ---------- Page change: the envelope opens and the letter comes out ---------- */
.blr-env {
  position: fixed; z-index: 9999; pointer-events: none; perspective: 1400px;
  transition: left .36s cubic-bezier(.2, .8, .2, 1), top .36s cubic-bezier(.2, .8, .2, 1),
              width .36s cubic-bezier(.2, .8, .2, 1), height .36s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
}
.blr-env .env-letter {
  position: absolute; left: 6%; right: 6%; top: 6%; height: 88%; z-index: 1;
  background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(93, 82, 70, .16) 22px 23px) 0 62% / 100% 38% no-repeat, var(--label);
  border: 1px solid #cdbb98; box-shadow: 0 4px 14px rgba(40, 25, 10, .25);
  display: flex; flex-direction: column; justify-content: flex-start; padding: 6% 8%;
  transition: transform .42s cubic-bezier(.2, .8, .2, 1);
}
.blr-env .pc-title { font-family: var(--stencil); font-size: clamp(14px, 4vw, 38px); color: var(--ink); line-height: 1.05; }
.blr-env .pc-from { font-family: var(--type); font-size: clamp(9px, 1.25vw, 14px); color: var(--muted); margin-top: 6px; }
.blr-env .env-body {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), var(--env-line) 50%, transparent calc(50% + 1px)) left bottom / 50% 58% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), var(--env-line) 50%, transparent calc(50% + 1px)) right bottom / 50% 58% no-repeat,
    var(--env);
  border: 10px solid transparent; border-image: var(--airmail) 10;
  box-shadow: 0 26px 50px rgba(40, 25, 10, .45);
  /* the pocket is open at the top: only its lower part covers the letter */
  clip-path: polygon(0 26%, 50% 62%, 100% 26%, 100% 100%, 0 100%);
}
.blr-env .env-back { position: absolute; inset: 0; z-index: 0; background: var(--env-flap); border: 10px solid transparent; border-image: var(--airmail) 10; }
.blr-env .env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 64%; z-index: 3; transform-origin: 50% 0;
  background: var(--env-flap); clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 1px rgba(60, 35, 10, .35));
  transition: transform .3s ease-in, z-index 0s .15s;
}
.blr-env .env-mark {
  position: absolute; z-index: 4; top: 9%; right: 6%; width: 34%; height: 22%;
  background: var(--waves) right center / auto 100% no-repeat;
}
.blr-env .env-mark::before {
  content: "BLR"; position: absolute; left: -8%; top: 4%; width: clamp(28px, 6vw, 62px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--stencil); font-size: clamp(8px, 1.3vw, 14px); letter-spacing: .1em;
  color: rgba(34, 34, 34, .75); border: 2px solid rgba(34, 34, 34, .6); box-shadow: inset 0 0 0 3px var(--env), inset 0 0 0 4.5px rgba(34, 34, 34, .45);
  background: var(--env); transform: rotate(-12deg);
}
.blr-env.flap-open .env-flap { transform: rotateX(178deg); z-index: 0; }
.blr-env.flap-open .env-mark { opacity: 0; transition: opacity .15s; }
.blr-env.letter-out .env-letter { transform: translateY(-62%); }
.blr-env.gone { opacity: 0; }
/* in the bar: the envelope inside the menu link itself */
.blr-env.inbar { position: absolute; left: -6px; top: -6px; right: -6px; bottom: -6px; transition: none; perspective: 600px; }
.blr-env.mini .env-body, .blr-env.mini .env-back { border-width: 6px; border-image: var(--airmail) 6; }
.blr-env.mini .env-body { box-shadow: none; }
.blr-env.mini .env-letter { padding: 7px 10px; left: 7%; right: 7%; top: 8%; height: 84%; }
.blr-env.mini .pc-title { font-size: 13.5px; font-family: var(--font); font-weight: 800; color: var(--ink); }
.blr-env.mini .env-flap { transition: transform .24s cubic-bezier(.45, 0, .55, 1), z-index 0s .12s; will-change: transform; }
.blr-env.mini .env-letter { transition: transform .26s cubic-bezier(.45, 0, .55, 1); will-change: transform; }
.blr-env.mini.letter-out .env-letter { transform: translateY(-58%); }
.blr-env.static .env-flap, .blr-env.static .env-letter { transition: none !important; }
/* the link under its open envelope: no letter peek, no postmark, text hidden under the envelope */
.env-holder::before, .env-holder::after { display: none !important; }
.env-holder { color: transparent !important; text-shadow: none !important; }
.env-holder svg { visibility: hidden; }
/* any link holding an envelope sits straight and lifted, and moves in step with the envelope */
.bnav-item.env-holder, nav.fixed.bottom-4 > div > a.env-holder { transform: rotate(0) translateY(-6px) !important; }
.bnav-item, nav.fixed.bottom-4 > div > a { transition: transform .24s cubic-bezier(.45, 0, .55, 1), box-shadow .24s ease !important; }
@media (prefers-reduced-motion: reduce) { .blr-env .env-flap, .blr-env .env-letter { transition: none !important; } }

/* ---------- Accessibility ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--post-blue) !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { a.cat-row, .btn-primary { transition: none !important; } }

/* Tailwind page headers carry .bg-white: keep them as packing tape */
body > header.bg-white {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #c99a63, #b5874f) !important;
  border: 0 !important; border-radius: 0 !important;
  box-shadow: 0 3px 0 rgba(70, 45, 20, .35) !important;
}
/* donut in the same inks as the postmarks */
#slice-completed { stroke: #166534; }
#slice-returning { stroke: #c2410c; }
#slice-intransit { stroke: #23408e; }
@media (max-width: 520px) {
  a.cat-row { width: 140px; height: 140px; }
  a.cat-row .cat-sub span:first-child { font-size: 24px; }
  a.cat-row .cat-name { font-size: 13px !important; }
}
.brand-name::after { font-size: 11.5px; line-height: 1.35; transform: rotate(-5deg) translateY(-2px); }
.brand-name { margin-bottom: 2px; }

/* ================= Pass 2 refinements ================= */

/* 1. Page titles read as crate markings, like the counts */
.page-title, body > header h1 {
  font-family: var(--stencil) !important; font-weight: 700 !important;
  font-size: 26px !important; letter-spacing: .03em !important; line-height: 1.1 !important;
}
body > header h1 { font-size: 24px !important; }

/* 2. Packing tape has a torn bottom edge */
.topbar, body > header { position: relative; }
.topbar::after, body > header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 7px; pointer-events: none;
  background:
    linear-gradient(135deg, #b5874f 33%, transparent 34%) 0 0 / 9px 7px repeat-x,
    linear-gradient(225deg, #b5874f 33%, transparent 34%) 0 0 / 9px 7px repeat-x;
  filter: drop-shadow(0 2px 0 rgba(70, 45, 20, .3));
}
.topbar { position: sticky !important; }

/* 3. Wide tables keep the order visible while scrolling sideways */
body:not(:has(#tiles)) .tbl th:first-child, body:not(:has(#tiles)) .tbl td:first-child,
body:has(#status) table th:first-child, body:has(#status) table td:first-child {
  position: sticky; left: 0; z-index: 2; background: var(--label);
  box-shadow: 1.5px 0 0 #cdbb98;
}
body:not(:has(#tiles)) .tbl thead th:first-child, body:has(#status) thead th:first-child { z-index: 3; background: var(--manila) !important; }
/* My Earning: DATE + ORDER ID stay pinned */
body:has(#foot) table th:nth-child(1), body:has(#foot) table td:nth-child(1) {
  position: sticky; left: 0; z-index: 2; min-width: 104px; max-width: 104px; background: var(--label);
}
body:has(#foot) table th:nth-child(2), body:has(#foot) table td:nth-child(2) {
  position: sticky; left: 104px; z-index: 2; background: var(--label); box-shadow: 1.5px 0 0 #cdbb98;
}
body:has(#foot) thead th:nth-child(-n+2) { z-index: 3; background: var(--manila) !important; }
body:has(#foot) tfoot td:nth-child(-n+2) { background: var(--manila) !important; }
tbody tr:hover td:first-child, body:has(#foot) tbody tr:hover td:nth-child(2) { background: #f7efdc !important; }

/* 4. One page-load moment: the postmarks are stamped onto the label */
@keyframes blr-stamp {
  0%   { opacity: 0; transform: scale(1.35) rotate(var(--r, 0deg)); }
  60%  { opacity: 1; transform: scale(.96) rotate(var(--r, 0deg)); }
  100% { opacity: .92; transform: scale(1) rotate(var(--r, 0deg)); }
}
a.cat-row:nth-of-type(1) { --r: -6deg; }
a.cat-row:nth-of-type(2) { --r: 4deg; }
a.cat-row:nth-of-type(3) { --r: -2deg; }
a.cat-row:nth-of-type(4) { --r: 7deg; }
a.cat-row { animation: blr-stamp .42s cubic-bezier(.2, .9, .3, 1.2) both; }
a.cat-row:nth-of-type(2) { animation-delay: .12s; }
a.cat-row:nth-of-type(3) { animation-delay: .24s; }
a.cat-row:nth-of-type(4) { animation-delay: .36s; }
a.cat-row:hover, a.cat-row:focus-visible { animation: none; transform: rotate(0) scale(1.04); }
@media (prefers-reduced-motion: reduce) { a.cat-row { animation: none !important; } }

/* 5. Validate: the fix hint is a quiet note, the action stands out */
.tbl td.wide.muted { font-size: 12.5px !important; line-height: 1.5; min-width: 330px; }
.tbl td.wide.muted > div { flex-wrap: wrap; }
.tbl td.wide.muted .btn-primary { margin-top: 2px; }
.tbl td.wide.muted label { color: var(--muted) !important; }

/* 7. Home: label header and stamp grid sit closer, less dead space */
section.card .card-body > .flex.justify-around { justify-content: center !important; gap: 72px !important; }
body > header h1::after { font-size: 11.5px; line-height: 1.3; transform: rotate(-5deg) translateY(-4px); }
body > header #subtitle { margin-top: 3px; }

/* ================= Home: Shipment movement = one postmark + three postage stamps ================= */
.mv { display: flex; align-items: center; justify-content: center; gap: 56px; padding: 8px 0 4px; }
/* the total: a round cancellation postmark */
.mv-mark { position: relative; width: 220px; height: 220px; flex: none; }
.mv-ring { width: 100%; height: 100%; display: block; }
.mv-ring .mv-edge { fill: none; stroke: var(--ink); stroke-width: 1.4; opacity: .55; }
.mv-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mv-cap { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.mv-total { font-family: var(--stencil); font-size: 40px; line-height: 1.05; color: var(--ink); margin: 2px 0; }

/* the statuses: three equal round rubber stamps (double ring, straight text so nothing crowds) */
.mv-side { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.mv-stamps { display: grid; grid-template-columns: repeat(3, 190px); gap: 26px; }
.stamp {
  position: relative; width: 190px; height: 190px; border-radius: 50%; padding-top: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  text-decoration: none !important; color: var(--ink);
  border: 3px solid var(--ink);
  background: transparent;
  transition: transform .18s ease;
}
.stamp::before {          /* the inner ring */
  content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px solid var(--ink); opacity: .75; pointer-events: none;
}
.stamp::after {           /* faint ink: rubber stamps never print perfectly evenly */
  display: none; content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .35), transparent 45%);
}
.stamp:nth-child(1) { transform: rotate(-5deg); }
.stamp:nth-child(3) { transform: rotate(4deg); }
.stamp:hover, .stamp:focus-visible { transform: rotate(0) scale(1.04); }
.stamp-name { font-family: var(--stencil); font-size: 15.5px; font-weight: 800; letter-spacing: .05em; line-height: 1.1; text-transform: uppercase; color: var(--ink); }
.stamp-num { font-family: var(--stencil); font-size: 44px; line-height: 1; color: var(--ink); margin-top: 2px; }
.stamp-unit { font-size: 13px; color: var(--ink); opacity: .85; margin-top: 3px; }
.stamp-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 52px; margin-top: 10px; padding-top: 3px; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 50%, transparent); }
.stamp-bar { display: none; width: 100%; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 14%, transparent); overflow: hidden; }
.stamp-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.stamp-pct { font-size: 13px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mv-all { align-self: flex-end; }
/* one load moment: each stamp is pressed onto the card */
@keyframes blr-press { 0% { opacity: 0; transform: scale(1.3) rotate(var(--rr, 0deg)); } 60% { opacity: 1; transform: scale(.97) rotate(var(--rr, 0deg)); } 100% { transform: scale(1) rotate(var(--rr, 0deg)); } }
.stamp:nth-child(1) { --rr: -5deg; } .stamp:nth-child(3) { --rr: 4deg; }
.stamp { animation: blr-press .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.stamp:nth-child(2) { animation-delay: .1s; } .stamp:nth-child(3) { animation-delay: .2s; }
.stamp:hover, .stamp:focus-visible { animation: none; }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none !important; transition: none !important; } .stamp-bar i { transition: none; } }

@media (max-width: 900px) {
  .mv { flex-direction: column; gap: 28px; }
  .mv-side { width: 100%; align-items: center; }
  .mv-all { align-self: center; }
}
@media (max-width: 620px) {
  .mv-mark { width: 176px; height: 176px; }
  .mv-total { font-size: 32px; }
  .mv-stamps { grid-template-columns: repeat(3, 108px); gap: 10px; }
  .stamp { width: 108px; height: 108px; border-width: 2px; padding-top: 2px; }
  .stamp-bar { display: none; }
  .stamp::before { inset: 4px; }
  .stamp-name { font-size: 9px; letter-spacing: .02em; }
  .stamp-num { font-size: 26px; margin-top: 1px; }
  .stamp-unit { font-size: 10px; margin-top: 1px; }
  .stamp-foot { width: 36px; margin-top: 4px; padding-top: 2px; gap: 0; }
  .stamp-pct { font-size: 10px; }
}

/* ================= Home: column chart (replaces the donut) ================= */
.mv-chart { width: 300px; flex: none; display: flex; flex-direction: column; }
.mv-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 8px; border-bottom: 1.5px dashed #cdbb98; }
.mv-head .mv-total { font-size: 34px; margin: 0; }
.mv-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: end; height: 190px; padding-top: 14px;
  border-bottom: 2px solid var(--ink); }
.mv-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.mv-colv { font-family: var(--stencil); font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 5px; }
.mv-colbar { width: 100%; max-width: 58px; height: calc(100% - 26px); display: flex; align-items: flex-end; }
.mv-colbar i { display: block; width: 100%; height: 0; background: var(--ink); transition: height .7s cubic-bezier(.2, .8, .2, 1); }
.mv-coll { order: 3; position: relative; top: 8px; height: 0; font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.mv-chart { padding-bottom: 26px; }
@media (prefers-reduced-motion: reduce) { .mv-colbar i { transition: none; } }
@media (max-width: 900px) { .mv-chart { width: min(340px, 100%); } }
@media (max-width: 620px) {
  .mv-cols { height: 150px; gap: 16px; }
  .mv-head .mv-total { font-size: 28px; }
}

/* ================= My Earning: totals always in the top card ================= */
.earn-top { grid-template-columns: auto 1fr auto !important; }
.earn-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 760px; width: 100%; margin: 0 auto; }
.earn-stat { text-align: center; padding: 4px 14px; }
.earn-stat + .earn-stat { border-left: 1.5px dashed #cdbb98; }
.earn-lbl { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.earn-val { font-family: var(--stencil); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.15; white-space: nowrap; }
.earn-sub { font-size: 12px; color: var(--muted); }
.earn-stat.is-main .earn-lbl { color: var(--stamp-red); letter-spacing: .08em; }
.earn-stat.is-main .earn-val { color: var(--stamp-red); font-size: 30px; }
/* the table ends above the envelope bar, so its last rows are never hidden behind it */
.earn-table { max-height: calc(100vh - 400px); min-height: 260px; }
@media (max-width: 900px) {
  .earn-top { grid-template-columns: 1fr !important; }
  .earn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .earn-stat:nth-child(3) { border-left: 0; }
  .earn-val { font-size: 22px; } .earn-stat.is-main .earn-val { font-size: 24px; }
}
/* the letter in a bar envelope: one line, fits on phones */
.blr-env.mini .pc-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .blr-env.mini .pc-title { font-size: 11px; } .blr-env.mini .env-letter { padding: 5px 6px; } }

/* ================= Smaller bottom bar ================= */
.bnav, nav.fixed.bottom-4 { bottom: 10px !important; }
.bnav-in, nav.fixed.bottom-4 > div { gap: 12px !important; }
.bnav-item, nav.fixed.bottom-4 > div > a {
  width: 128px; height: 48px; font-size: 12.5px !important; gap: 5px !important;
  border-width: 4px !important; border-image: var(--airmail) 4 !important;
  box-shadow: 0 5px 10px rgba(60, 35, 10, .28) !important;
}
.bnav-item svg { width: 14px !important; height: 14px !important; }
.bnav-item::after, nav.fixed.bottom-4 > div > a::after { width: 15px; height: 15px; top: 2px; right: 4px; }
.blr-env.inbar { left: -4px; top: -4px; right: -4px; bottom: -4px; }
.blr-env.mini .env-body, .blr-env.mini .env-back { border-width: 4px; border-image: var(--airmail) 4; }
.blr-env.mini .env-letter { padding: 4px 8px; }
.blr-env.mini .pc-title { font-size: 11.5px; }
.bnav-item.env-holder, nav.fixed.bottom-4 > div > a.env-holder { transform: rotate(0) translateY(-4px) !important; }
body { padding-bottom: 96px !important; }
.earn-table { max-height: calc(100vh - 360px); }
@media (max-width: 560px) {
  .bnav-in, nav.fixed.bottom-4 > div { gap: 8px !important; }
  .bnav-item, nav.fixed.bottom-4 > div > a { width: 100px; height: 42px; font-size: 11.5px !important; }
  .blr-env.mini .pc-title { font-size: 10.5px; }
}
