/* ==========================================================================
   AIRA FREIGHT — COURIER 101 DASHBOARD
   Same tokens as the website: navy rail, white working area, blue actions.
   ========================================================================== */
:root { --navy: var(--a-navy); --white: #fff; --line: var(--a-line); --surface: var(--a-cloud); --muted: var(--a-muted); --ink: var(--a-ink);
  --blue: var(--a-blue); --blue-50: var(--a-blue-50); --orange: var(--a-orange); --orange-50: var(--a-orange-50); --ok: var(--a-ok); --warn: var(--a-warn); --warn-50: var(--a-warn-50); --radius: 22px; --radius-sm: 14px; }
.dash-main .calc { display: grid; gap: 14px; }
body[data-page="dashboard"] { background: var(--surface); }
.dash { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }

/* Rail */
.dash-rail {
  background: var(--navy); color: rgba(255,255,255,.75); padding: 26px 18px; display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.dash-rail .logo { padding-inline: 10px; }
.mailbox-chip { margin-inline: 4px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); display: grid; gap: 2px; }
.mailbox-chip small { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 700; }
.mailbox-chip strong { color: var(--white); font-size: 1.08rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.dash-nav { display: grid; gap: 4px; }
.dash-nav button, .dash-rail-foot a, .dash-rail-foot button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 12px; border: 0;
  background: transparent; color: rgba(255,255,255,.75); font-weight: 600; font-size: .98rem; text-align: left; cursor: pointer;
}
.dash-nav .bi, .dash-rail-foot .bi { font-size: 1.15rem; flex: none; }
.dash-nav button:hover, .dash-rail-foot a:hover, .dash-rail-foot button:hover { background: rgba(255,255,255,.07); color: var(--white); text-decoration: none; }
.dash-nav button[aria-current="true"] { background: var(--blue); color: var(--white); font-weight: 700; }
.dash-nav .badge { margin-left: auto; background: var(--orange); color: var(--white); font-size: .74rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.dash-rail-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }

/* Main */
.dash-main { min-width: 0; padding: 28px clamp(16px, 3.5vw, 44px) 56px; display: grid; gap: 24px; align-content: start; }
.dash-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash-top h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; letter-spacing: -0.03em; }
.dash-top p { color: var(--muted); margin-top: 4px; }
.dash-top-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sample-badge { font-size: .78rem; font-weight: 700; color: var(--warn); background: var(--warn-50); border-radius: 999px; padding: 5px 12px; }
.dash-mobilebar { display: none; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 1.2rem; letter-spacing: -0.015em; }
.card-head a, .card-head button.link { font-weight: 700; font-size: .92rem; background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 6px; }
.stat span { color: var(--muted); font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat span i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stat strong { font-size: 2rem; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat--due { background: var(--navy); border-color: var(--navy); color: var(--white); }
.stat--due span { color: rgba(255,255,255,.7); }
.stat--due .btn { justify-self: start; margin-top: 4px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }

.alert { margin: 0; border: 0; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--orange-50); color: #8a3a00; font-weight: 600; flex-wrap: wrap; }
.alert .bi { font-size: 1.2rem; flex: none; color: var(--orange); }
.alert .btn { margin-left: auto; }

.table-wrap { overflow-x: auto; margin-inline: -24px; padding-inline: 24px; }
.pkg-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .96rem; }
.pkg-table th { text-align: left; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 12px 12px 0; border-bottom: 1px solid var(--line); }
.pkg-table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pkg-table tr:last-child td { border-bottom: 0; }
.pkg-table .id { font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.pkg-table .sub { color: var(--muted); font-size: .86rem; display: block; }
.pkg-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.pkg-table th.num { text-align: right; }
.inv-missing { color: var(--orange); font-weight: 700; font-size: .86rem; background: none; border: 0; padding: 0; cursor: pointer; }
.inv-ok { color: var(--ok); font-size: .86rem; font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { border: 1.5px solid var(--line); background: var(--white); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.filters button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-50); color: var(--blue); font-weight: 700; }

.address-card { background: var(--navy); color: var(--white); border-color: var(--navy); position: relative; overflow: hidden; }
.address-card::after { content: ""; position: absolute; right: -70px; top: -90px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(0,76,255,.35); pointer-events: none; }
.address-card > * { position: relative; z-index: 1; }
.address-card .card-head h2 { color: var(--white); }
.address-lines { display: grid; gap: 2px; font-size: 1.05rem; font-weight: 600; line-height: 1.5; }
.address-lines b { font-weight: 700; }
.address-card .btn-outline-light { justify-self: start; }
.addr-table { display: grid; gap: 0; }
.addr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.addr-row:last-child { border-bottom: 0; }
.addr-row small { color: var(--muted); font-size: .8rem; display: block; font-weight: 600; }
.addr-row b { font-weight: 700; font-size: 1.02rem; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--muted); }
.tips li { display: flex; gap: 10px; }
.tips .bi { color: var(--orange); flex: none; }

.drop {
  border: 1.5px dashed #c6d3f5; border-radius: var(--radius-sm); padding: 22px; text-align: center; cursor: pointer; display: grid; gap: 6px; justify-items: center;
  background: var(--blue-50); color: var(--muted); transition: border-color .2s;
}
.drop:hover, .drop.is-over { border-color: var(--blue); }
.drop .bi { font-size: 1.6rem; color: var(--blue); }
.drop b { color: var(--ink); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.narrow { max-width: 720px; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-rail {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 80; transform: translateX(-100%);
    transition: transform .25s; padding-top: calc(26px + env(safe-area-inset-top, 0px));
  }
  .dash.is-rail-open .dash-rail { transform: none; box-shadow: 20px 0 60px rgba(6,26,74,.35); }
  .dash-scrim { position: fixed; inset: 0; background: rgba(6,26,74,.45); z-index: 70; }
  .dash-mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 60; background: var(--white); border-bottom: 1px solid var(--line);
    padding: 12px 16px;
  }
  .dash-main { padding-top: 20px; }
}

/* ==========================================================================
   v2 additions: shared by the customer dashboard and the admin console
   ========================================================================== */
.dash-boot { min-height: 100dvh; display: grid; place-items: center; background: var(--surface); }
.stack { display: grid; gap: 24px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; word-break: break-all; }
.tnum { font-variant-numeric: tabular-nums; }
button.mailbox-chip { text-align: left; cursor: pointer; color: inherit; font: inherit; transition: background .2s; }
button.mailbox-chip:hover { background: rgba(255,255,255,.12); }
.dash-nav .badge--blue { background: rgba(255,255,255,.16); }
.dash-nav button[aria-current="true"] .badge--blue { background: rgba(255,255,255,.25); }
.alert--ok { background: var(--a-ok-50); color: #0b6b3c; }
.alert--ok .bi { color: var(--ok); }
.alert--blue { background: var(--blue-50); color: var(--a-navy-800); }
.alert--blue .bi { color: var(--blue); }
button.stat { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .2s var(--a-ease), box-shadow .2s; }
button.stat:hover { transform: translateY(-2px); box-shadow: var(--a-shadow); }
.stats--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .stats--3 { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } .stat strong { font-size: 1.6rem; } }
.search-sm { position: relative; min-width: min(260px, 100%); }
.search-sm .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-sm .form-control { min-height: 42px; padding-left: 40px; border-radius: 999px; font-size: .94rem; }
.empty-row { color: var(--muted); text-align: center; padding: 28px 12px !important; margin: 0; }
.pkg-table.is-clickable tbody tr[data-pkg], .pkg-table.is-clickable tbody tr[data-row] { cursor: pointer; transition: background .15s; }
.pkg-table.is-clickable tbody tr[data-pkg]:hover, .pkg-table.is-clickable tbody tr[data-row]:hover { background: var(--surface); }
.pkg-table tbody tr:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.link-inline { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; }
.due { color: var(--orange); font-weight: 800; }

/* Lists */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row > div { min-width: 0; flex: 1; display: grid; }
.list-row small { color: var(--muted); font-size: .84rem; }
.list-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); flex: none; }
.list-ic--ok { background: var(--a-ok-50); color: var(--ok); }
.list-ic--warn { background: var(--warn-50); color: var(--warn); }
.list-ic--orange { background: var(--orange-50); color: var(--orange); }
.for-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--blue-50); color: var(--a-navy-800); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }

/* Calculator */
.calc-out--dash { align-items: flex-end; }
.calc-out--dash b { font-weight: 700; }
.calc-break { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; color: rgba(255,255,255,.72); }
.calc-break b { color: #fff; font-weight: 700; margin-left: 4px; }
.rate-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rate-chip { border: 1px solid var(--line); background: var(--white); border-radius: 14px; padding: 14px; display: grid; gap: 2px; text-align: left; cursor: pointer; transition: border-color .2s, transform .2s var(--a-ease); }
.rate-chip:hover { border-color: var(--blue); transform: translateY(-1px); }
.rate-chip span { color: var(--muted); font-size: .84rem; font-weight: 600; }
.rate-chip b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* Tax */
.tax-hero { display: flex; gap: 16px; align-items: flex-start; }
.tax-hero h2 { font-size: 1.3rem; margin: 0 0 4px; }
.tax-hero p { color: var(--muted); margin: 0; }
.tax-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--orange-50); color: var(--orange); display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.steps-list { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.steps-list li::before { content: counter(s); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-weight: 800; display: grid; place-items: center; }
.steps-list span { color: var(--muted); font-size: .92rem; }
.choice--2 { grid-template-columns: 1fr 1fr; }

/* Drawer (Bootstrap offcanvas) */
.drawer { --bs-offcanvas-width: min(520px, 100vw); border-left: 0 !important; box-shadow: -30px 0 80px -20px rgba(6,26,74,.35); }
.drawer .offcanvas-header { padding: 22px 24px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.drawer .offcanvas-title { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; margin: 0; }
.drawer-kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.drawer .offcanvas-body { padding: 20px 24px 40px; display: grid; gap: 22px; align-content: start; }
.drawer-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.drawer-sec { display: grid; gap: 8px; }
.drawer-sec h3 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 4px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.kv--total { border-bottom: 0; border-top: 1.5px solid var(--ink); margin-top: 4px; padding-top: 12px; }
.kv--total b { font-weight: 900; font-size: 1.1rem; }
.track-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.track-steps::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 21px; height: 3px; background: var(--line); border-radius: 3px; }
.track-steps li { display: grid; justify-items: center; gap: 6px; position: relative; z-index: 1; }
.track-steps li span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--white); border: 2px solid var(--line); color: var(--muted); font-size: 1.05rem; transition: all .3s; }
.track-steps li small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.track-steps li.done span { background: var(--blue); border-color: var(--blue); color: #fff; }
.track-steps li.now span { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 0 6px var(--orange-50); animation: pulse-now 1.8s ease-in-out infinite; }
.track-steps li.done small, .track-steps li.now small { color: var(--ink); }
@keyframes pulse-now { 50% { box-shadow: 0 0 0 10px rgba(255,106,0,.08); } }
@media (prefers-reduced-motion: reduce) { .track-steps li.now span { animation: none; } }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; display: grid; gap: 14px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; display: grid; }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--line); }
.timeline li.is-latest::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-50); }
.timeline b { font-weight: 600; font-size: .95rem; }
.timeline time { color: var(--muted); font-size: .84rem; }
.timeline small { color: var(--muted); }
button.stat--due { color: var(--white); }
.pkg-table--compact { min-width: 420px; }
.offcanvas.offcanvas-end.drawer { width: var(--bs-offcanvas-width); }

