/* ==========================================================================
   ECOM CRM – interface styles
   Layers on top of Bootstrap 5.3. Sections: fonts · tokens · base · layout (rail, bar, tabs, dock) ·
   components · Today · order desk · order board · order page · phone · print
   ========================================================================== */

@font-face {
  font-family: "Inter var"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../vendor/inter/inter-latin-wght-normal.8e433c0592f7.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter var"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../vendor/inter/inter-latin-ext-wght-normal.ad4eb06671be.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: "Jakarta"; font-weight: 600; font-display: swap; src: url("../vendor/jakarta/plus-jakarta-sans-latin-600-normal.4f54d6c65e11.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 700; font-display: swap; src: url("../vendor/jakarta/plus-jakarta-sans-latin-700-normal.bf5e25824fd7.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 800; font-display: swap; src: url("../vendor/jakarta/plus-jakarta-sans-latin-800-normal.9e00056eb42e.woff2") format("woff2"); }

/* ---------- tokens ---------- */
:root {
  --brand: #1b3a7a; --brand-600: #15306a; --brand-700: #0f2453; --brand-50: #ecf1fa; --brand-100: #d5e0f3;
  --go: #16a34a; --go-600: #15803d; --go-50: #e8f8ee;
  --navy: #0b1f4d; --navy-2: #12295e;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e4e7f0; --line-2: #eef0f6; --bg: #f5f6fb; --surface: #fff; --surface-2: #f8f9fc;
  --ok: #16a34a; --ok-50: #e8f8ee; --warn: #f59e0b; --warn-50: #fff6e5; --bad: #e11d48; --bad-50: #fff0f3;
  --info: #0284c7; --info-50: #e6f4fd;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px rgba(15, 23, 42, .06);
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 44px rgba(15, 23, 42, .16);
  --rail-w: 236px; --bar-h: 64px; --dock-h: 66px;
  --font: "Inter var", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Jakarta", "Inter var", system-ui, sans-serif;

  /* Bootstrap hooks */
  --bs-body-font-family: var(--font); --bs-body-color: var(--ink); --bs-body-bg: var(--bg);
  --bs-primary: var(--brand); --bs-primary-rgb: 27, 58, 122;
  --bs-success: var(--go); --bs-success-rgb: 22, 163, 74;
  --bs-danger: var(--bad); --bs-danger-rgb: 225, 29, 72;
  --bs-warning: var(--warn); --bs-warning-rgb: 245, 158, 11;
  --bs-info: var(--info); --bs-info-rgb: 2, 132, 199;
  --bs-link-color: var(--brand-600); --bs-link-color-rgb: 21, 48, 106; --bs-link-hover-color: var(--brand-700);
  --bs-border-color: var(--line); --bs-border-radius: var(--radius-sm); --bs-secondary-color: var(--muted);
  --bs-focus-ring-color: rgba(27, 58, 122, .25);
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: .9rem; line-height: 1.5;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn:hover, .nav-link:hover, .rail a:hover, .stat:hover, .dock a:hover, .dropdown-item:hover, .page-link:hover, .tabs a:hover,
.kpi:hover, .lane-card:hover, .flag-row:hover, .stage-chip:hover, .pipe-step:hover { text-decoration: none; }
h1, h2, h3, h4, h5, h6, .page-title, .modal-title { font-family: var(--font-head); color: var(--ink); font-weight: 700; letter-spacing: -.015em; }
h5, h6 { font-weight: 700; }
.page-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -.025em; margin-bottom: 1.1rem; line-height: 1.2; }
.page-title .fs-6, .page-title .text-muted { font-family: var(--font); font-weight: 500; color: var(--muted) !important; letter-spacing: 0; }
.muted-small { color: var(--muted); font-size: .78rem; }
.text-muted { color: var(--muted) !important; }
code { color: var(--brand-700); background: var(--brand-50); padding: .1em .35em; border-radius: 6px; font-size: .85em; }
pre { border-radius: var(--radius-sm); border: 1px solid var(--line); }
::selection { background: var(--brand-100); }
:focus-visible { outline: 3px solid rgba(27, 58, 122, .35); outline-offset: 2px; }

/* ---------- layout: rail (left menu, navy) ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 1045; background: var(--navy);
  display: flex; flex-direction: column; transition: transform .25s ease; color: #b9c5e2;
}
.rail-brand { display: flex; align-items: center; gap: .5rem; height: var(--bar-h); padding: 0 1rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.rail-logo { display: flex; align-items: center; gap: .65rem; color: #fff; min-width: 0; font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; }
.rail-logo:hover { color: #fff; text-decoration: none; }
.logo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: #fff; color: var(--navy); font-family: var(--font-head); font-weight: 800; font-size: 1rem;
}
.bar .logo-mark, .signin .logo-mark { background: var(--navy); color: #fff; }
.logo-mark.sm { width: 30px; height: 30px; font-size: .9rem; border-radius: 9px; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rail-close { display: none; margin-left: auto; color: #b9c5e2; background: none; border: 0; font-size: 1.3rem; }
.rail-nav { flex: 1; overflow-y: auto; padding: .6rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: #2a4380 transparent; }
.rail-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: #7f91bd; padding: 1rem .7rem .35rem; font-weight: 700; }
.rail-link {
  position: relative; display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; margin-bottom: 2px; border-radius: 9px;
  color: #d3dbef; font-weight: 550; font-size: .88rem; background: none; border: 0; text-align: left; transition: background .12s, color .12s;
}
.rail-link > i:first-child { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #8fa2cf; }
.rail-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.rail-link.on { background: #fff; color: var(--navy); font-weight: 700; }
.rail-link.on > i:first-child { color: var(--navy); }
.rail-link.has-on { color: #fff; }
.rail-link.has-on > i:first-child { color: #fff; }
.rail-link .chev { margin-left: auto; font-size: .7rem; color: #8fa2cf; transition: transform .2s; }
.rail-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.rail-link .rail-badge + .chev { margin-left: .4rem; }
.rail-sub { margin: .1rem 0 .4rem 1.55rem; padding-left: .55rem; border-left: 1px solid rgba(255, 255, 255, .12); }
.rail-sub a { display: block; padding: .4rem .65rem; border-radius: 8px; color: #b9c5e2; font-size: .84rem; }
.rail-sub a:hover { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
.rail-sub a.on { color: var(--navy); background: #fff; font-weight: 650; }
.rail-badge { margin-left: auto; min-width: 22px; text-align: center; font-size: .68rem; font-weight: 700; padding: .18rem .4rem; border-radius: 999px; background: var(--bad); color: #fff; }
.rail-foot { border-top: 1px solid rgba(255, 255, 255, .07); padding: .75rem .8rem .9rem; }
.rail-me { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; color: #fff; }
.rail-me .avatar { background: #fff; color: var(--navy); }
.rail-me .who { line-height: 1.15; min-width: 0; }
.rail-me .who b { display: block; font-size: .84rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-me .who small { font-size: .72rem; color: #8fa2cf; }
.rail-foot-links { display: flex; gap: .4rem; }
.rail-foot-links a, .rail-foot-links button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: .76rem; font-weight: 600; color: #d3dbef;
  padding: .4rem .5rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; background: transparent;
}
.rail-foot-links form { flex: 1; display: flex; }
.rail-foot-links a:hover, .rail-foot-links button:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.rail-backdrop { display: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .82rem;
  background: var(--navy); color: #fff; font-family: var(--font-head);
}
.avatar.sm { width: 28px; height: 28px; font-size: .75rem; }

/* ---------- layout: bar (top) ---------- */
.shell { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 1030; height: var(--bar-h); display: flex; align-items: center; gap: .75rem;
  padding: 0 1.75rem; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.bar .menu-btn, .bar .search-btn { display: none; }
.bar-brand { display: none; align-items: center; gap: .55rem; font-family: var(--font-head); font-weight: 800; color: var(--ink); min-width: 0; letter-spacing: -.02em; }
.bar-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder { position: relative; flex: 1; max-width: 520px; }
.finder > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.finder input {
  width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 2.4rem 0 2.35rem; font-size: .88rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.finder input:focus { outline: 0; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(27, 58, 122, .12); }
.finder kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: var(--surface); color: var(--muted); border: 1px solid var(--line); box-shadow: none; font-size: .7rem; padding: .05rem .4rem; }
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 1.1rem; position: relative; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.me-btn { border-radius: 50%; }

.content { padding: 1.5rem 1.75rem 3rem; flex: 1; width: 100%; max-width: 1600px; }

/* bottom dock (phones / tablets) */
.dock { display: none; }

/* green action button (same green as the website) */
.btn-go {
  --bs-btn-color: #fff; --bs-btn-bg: var(--go); --bs-btn-border-color: var(--go); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--go-600);
  --bs-btn-hover-border-color: var(--go-600); --bs-btn-active-color: #fff; --bs-btn-active-bg: #116b33; --bs-btn-active-border-color: #116b33;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .1), inset 0 1px 0 rgba(255, 255, 255, .15);
}

/* ---------- components: cards ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface);
  --bs-card-cap-bg: transparent;
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--line-2); font-weight: 650; padding: .9rem 1.15rem;
  font-size: .95rem; color: var(--ink);
}
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-body { padding: 1.15rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--line-2); }
.card > .table-responsive:first-child, .card > .table-responsive:first-child table { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card > .table-responsive:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); overflow: auto; }
.card.card-body > h6:first-child, form.card > h6:first-child, .card-body > h6:first-child {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650;
}
.list-group-item { border-color: var(--line-2); }

/* ---------- components: figure tiles (reports) ---------- */
.stat {
  --tone: var(--brand); --tone-50: var(--brand-50);
  position: relative; display: block; border-radius: var(--radius); padding: 1rem 1.1rem 1.05rem 1.25rem; min-height: 104px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-xs); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tone); }
a.stat:hover { border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); box-shadow: var(--shadow-sm); color: var(--ink); }
.stat .label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.stat .value { font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; margin-top: .25rem; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.stat .value.fs-5 { font-size: 1.25rem !important; }
.stat .small { color: var(--muted); }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: .55rem; background: var(--tone-50); color: var(--tone); font-size: 1rem; }
.bg-violet { --tone: var(--brand); --tone-50: var(--brand-50); }
.bg-cyan { --tone: #0284c7; --tone-50: #e0f2fe; }
.bg-magenta { --tone: #c026d3; --tone-50: #fae8ff; }
.bg-amber { --tone: #d97706; --tone-50: #fef3c7; }
.bg-teal { --tone: var(--go); --tone-50: var(--go-50); }
.bg-coral { --tone: #e11d48; --tone-50: #ffe4e6; }
.stat.bg-light { --tone: var(--faint); }
.stat.bg-violet, .stat.bg-cyan, .stat.bg-magenta, .stat.bg-amber, .stat.bg-teal, .stat.bg-coral { background: var(--surface) !important; color: var(--ink) !important; }

/* ---------- components: tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #f7f7ff; margin-bottom: 0; color: var(--ink); }
.table > :not(caption) > * > * { padding: .72rem .9rem; border-bottom-color: var(--line-2); }
.table thead th, .table > thead > tr > th {
  background: var(--surface-2); color: var(--muted); font-size: .7rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: .06em; white-space: nowrap; border-bottom: 1px solid var(--line) !important; padding-top: .6rem; padding-bottom: .6rem;
}
.table td { vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .5rem .75rem; }
.table-hover > tbody > tr { transition: background .12s; }
.table-bordered > :not(caption) > * > * { border-color: var(--line-2); }
.table tfoot th, .table tfoot td { background: var(--surface-2); font-weight: 700; }
.table a.fw-semibold { color: var(--ink); }
.table a.fw-semibold:hover { color: var(--brand-600); }
.table-responsive { scrollbar-width: thin; }

/* ---------- components: badges ---------- */
.badge { font-weight: 650; letter-spacing: .01em; padding: .38em .7em; border-radius: 999px; font-size: .72rem; }
.badge[class*="status-"] { border: 1px solid transparent; }
.badge.status-new { background: #d5e0f3; color: #3730a3; border-color: #c7d2fe; }
.badge.status-pending, .badge.status-already_called, .badge.status-others { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge.status-confirmed { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.badge.status-scheduled { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.status-in_transit { background: #cffafe; color: #5b21b6; border-color: #ddd6fe; }
.badge.status-not_picking, .badge.status-number_off, .badge.status-incomplete_number { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge.status-delivered { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge.status-failed, .badge.status-cancelled { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
a.badge[class*="status-"]:hover { filter: brightness(.96); }
.badge.bg-success { background: var(--ok-50) !important; color: #067647 !important; }
.badge.bg-danger { background: var(--bad-50) !important; color: #b42318 !important; }
.badge.bg-warning { background: var(--warn-50) !important; color: #b54708 !important; }
.badge.bg-info { background: var(--info-50) !important; color: #026aa2 !important; }
.badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.badge.bg-primary { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.badge.bg-dark { background: #1e293b !important; color: #fff !important; }
.badge.bg-light { background: #eef0f6 !important; }

/* ---------- components: buttons ---------- */
.btn {
  --bs-btn-font-weight: 600; --bs-btn-border-radius: 10px; --bs-btn-padding-x: .95rem; --bs-btn-padding-y: .5rem; --bs-btn-font-size: .875rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; letter-spacing: .005em;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .34rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: 9px; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-success {
  --bs-btn-bg: #12a35e; --bs-btn-border-color: #12a35e; --bs-btn-hover-bg: #0e8a4f; --bs-btn-hover-border-color: #0e8a4f;
  --bs-btn-active-bg: #0b7442; --bs-btn-active-border-color: #0b7442;
}
.btn-danger { --bs-btn-bg: var(--bad); --bs-btn-border-color: var(--bad); --bs-btn-hover-bg: #d92d20; --bs-btn-hover-border-color: #d92d20; }
.btn-warning { --bs-btn-bg: #fdb022; --bs-btn-border-color: #fdb022; --bs-btn-hover-bg: #f79009; --bs-btn-hover-border-color: #f79009; --bs-btn-color: #3d2600; --bs-btn-hover-color: #3d2600; }
.btn-light {
  --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #d5d9e5;
  --bs-btn-color: var(--ink-2); box-shadow: var(--shadow-xs);
}
.btn-dark { --bs-btn-bg: #1e293b; --bs-btn-border-color: #1e293b; }
[class*="btn-outline-"] { --bs-btn-bg: var(--surface); box-shadow: var(--shadow-xs); }
.btn-outline-primary { --bs-btn-color: var(--brand-600); --bs-btn-border-color: #cfc6ff; --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-color: var(--brand-700); --bs-btn-hover-border-color: #b5a8ff; --bs-btn-active-bg: var(--brand-100); --bs-btn-active-color: var(--brand-700); }
.btn-outline-secondary, .btn-outline-dark { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #cfd4e2; --bs-btn-active-bg: #eef0f6; --bs-btn-active-color: var(--ink); }
.btn-outline-success { --bs-btn-color: #067647; --bs-btn-border-color: #a6e9c5; --bs-btn-hover-bg: var(--ok-50); --bs-btn-hover-color: #05603a; --bs-btn-hover-border-color: #75e0a7; --bs-btn-active-bg: #d1f5e0; --bs-btn-active-color: #05603a; }
.btn-outline-danger { --bs-btn-color: #b42318; --bs-btn-border-color: #fecdca; --bs-btn-hover-bg: var(--bad-50); --bs-btn-hover-color: #912018; --bs-btn-hover-border-color: #fda29b; --bs-btn-active-bg: #fee4e2; --bs-btn-active-color: #912018; }
.btn-outline-info { --bs-btn-color: #026aa2; --bs-btn-border-color: #b9e6fe; --bs-btn-hover-bg: var(--info-50); --bs-btn-hover-color: #065986; --bs-btn-hover-border-color: #7cd4fd; --bs-btn-active-bg: #e0f2fe; --bs-btn-active-color: #065986; }
.btn-outline-warning { --bs-btn-color: #b54708; --bs-btn-border-color: #fedf89; --bs-btn-hover-bg: var(--warn-50); --bs-btn-hover-color: #93370d; --bs-btn-hover-border-color: #fec84b; }
.btn-link { box-shadow: none; }
.btn .bi { font-size: 1em; }
.btn-close { box-shadow: none; }

/* ---------- components: forms ---------- */
.form-label { font-weight: 600; color: var(--ink-2); font-size: .8rem; margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: 10px; border-color: #d9dde8; font-size: .875rem; padding: .5rem .8rem; color: var(--ink);
  box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; background-color: var(--surface);
}
.form-select { padding-right: 2.2rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; font-size: .8rem; padding-top: .3rem; padding-bottom: .3rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(27, 58, 122, .12); }
.form-control::placeholder { color: var(--faint); }
.form-text { color: var(--muted); font-size: .76rem; }
.form-check-input { border-color: #c7cddb; width: 1.1em; height: 1.1em; margin-top: .2em; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(27, 58, 122, .15); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.3em; height: 1.25em; margin-top: .1em; }
.input-group > .btn { box-shadow: none; }
.filter-bar, form.card.card-body { gap: 0; }
form.card .form-label.small, .filter-bar .form-label { color: var(--muted); font-weight: 600; }
textarea.form-control { min-height: 2.6rem; }

/* ---------- components: nav pills, pagination, alerts, modals, dropdowns, progress ---------- */
.nav-pills { gap: .35rem; }
.nav-pills .nav-link { border-radius: 999px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .8rem; padding: .35rem .85rem; }
.nav-pills .nav-link.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-color: var(--ink-2); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-disabled-color: var(--muted); gap: .3rem; }
.pagination .page-link { border-radius: 9px !important; font-weight: 600; }
.alert { border-radius: 12px; border-width: 1px; font-weight: 500; box-shadow: var(--shadow-xs); display: flex; align-items: center; gap: .5rem; }
.alert-success { background: var(--ok-50); border-color: #a6f4c5; color: #05603a; }
.alert-danger { background: var(--bad-50); border-color: #fecdca; color: #912018; }
.alert-warning { background: var(--warn-50); border-color: #fedf89; color: #93370d; }
.alert-info { background: var(--info-50); border-color: #b9e6fe; color: #065986; }
.alert-dismissible .btn-close { padding: 1rem; }
.messages { position: relative; }
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line-2); padding: 1rem 1.25rem; }
.modal-header .modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-footer { border-top-color: var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-backdrop.show { opacity: .45; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; font-size: .875rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; display: flex; align-items: center; gap: .55rem; }
.dropdown-item:active { background: var(--brand); }
.progress { border-radius: 999px; background: #eef0f6; }
.progress .progress-bar { border-radius: 999px; font-size: .7rem; font-weight: 700; min-width: 2.4rem; overflow: visible; }
td .progress { min-width: 100px; }
dl.row dt { color: var(--muted); font-weight: 600; font-size: .82rem; }
dl.row dd { margin-bottom: .55rem; }
.breadcrumbs, nav.small { color: var(--muted); }
hr { border-color: var(--line); opacity: 1; }

/* ---------- page helpers ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.page-head .page-title { margin: 0; }
.quick-grid .btn { justify-content: flex-start; padding: .7rem .95rem; }
.empty { padding: 2.5rem 1rem !important; color: var(--muted); text-align: center; }
.m-filter-toggle { display: none; }
#bulk-form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .75rem; box-shadow: var(--shadow-xs); }
.chart-box { position: relative; min-height: 260px; }


/* ==========================================================================
   Today (home)
   ========================================================================== */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.hello h1 { font-size: 1.65rem; font-weight: 800; margin: 0; letter-spacing: -.03em; }
.hello p { margin: .15rem 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.kpi {
  --tone: var(--brand); --tone-50: var(--brand-50);
  display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s;
}
.kpi:hover { color: var(--ink); box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; font-weight: 600; color: var(--muted); }
.kpi-top i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--tone-50); color: var(--tone); font-size: .95rem; }
.kpi b { font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.kpi small { color: var(--muted); font-size: .76rem; }
.tone-indigo { --tone: var(--brand); --tone-50: var(--brand-50); }
.tone-green { --tone: var(--go); --tone-50: var(--go-50); }
.tone-amber { --tone: #d97706; --tone-50: #fef3c7; }
.tone-rose { --tone: #e11d48; --tone-50: #ffe4e6; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: center; gap: .6rem; padding: .95rem 1.15rem .4rem; }
.panel-head h2 { font-size: 1rem; font-weight: 750; margin: 0; }
.panel-head .more { margin-left: auto; font-size: .8rem; font-weight: 600; }
.panel-body { padding: .6rem 1.15rem 1.1rem; }
.pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.pipe-step { display: block; padding: .75rem .8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); }
.pipe-step:hover { color: var(--ink); border-color: var(--brand-100); background: var(--brand-50); }
.pipe-step .lbl { display: flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.pipe-step b { display: block; font-family: var(--font-head); font-size: 1.45rem; font-weight: 800; margin: .1rem 0 .45rem; }
.pipe-bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pipe-bar span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.flags { display: flex; flex-direction: column; }
.flag-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; border-top: 1px solid var(--line-2); color: var(--ink); }
.flag-row:first-child { border-top: 0; }
.flag-row:hover { color: var(--ink); background: var(--surface-2); border-radius: 10px; }
.flag-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; }
.flag-row.bad .flag-ico { background: var(--bad-50); color: var(--bad); }
.flag-row.warn .flag-ico { background: var(--warn-50); color: #b45309; }
.flag-row.info .flag-ico { background: var(--info-50); color: var(--info); }
.flag-row .txt { min-width: 0; flex: 1; line-height: 1.3; }
.flag-row .txt b { display: block; font-weight: 650; font-size: .88rem; }
.flag-row .txt small { color: var(--muted); font-size: .76rem; }
.flag-row .n { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; }
.all-clear { display: flex; align-items: center; gap: .7rem; padding: 1rem; border-radius: 12px; background: var(--go-50); color: #166534; font-weight: 600; }
.all-clear i { font-size: 1.4rem; }
.leader { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line-2); }
.leader:first-child { border-top: 0; }
.leader .rank { width: 22px; font-family: var(--font-head); font-weight: 800; color: var(--faint); }
.leader .nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader .nm small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.leader .rate { font-weight: 700; font-size: .84rem; color: var(--go-600); }
.mini-list .row-link { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line-2); color: var(--ink); }
.mini-list .row-link:first-child { border-top: 0; }
.mini-list .row-link:hover { color: var(--ink); background: var(--surface-2); }
.mini-list .who { flex: 1; min-width: 0; }
.mini-list .who b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .who small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.chart-box { position: relative; min-height: 240px; }

/* ==========================================================================
   Order desk (lists)
   ========================================================================== */
.desk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.desk-head h1 { font-size: 1.4rem; font-weight: 800; margin: 0; letter-spacing: -.025em; }
.desk-head h1 small { font-family: var(--font); font-size: .9rem; color: var(--muted); font-weight: 600; margin-left: .35rem; }
.desk-head p { margin: .15rem 0 0; color: var(--muted); font-size: .84rem; }
.desk-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.desk-search { position: relative; }
.desk-search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.desk-search input { padding-left: 2rem; width: 240px; }
.stage-chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .15rem; margin-bottom: .9rem; }
.stage-chips::-webkit-scrollbar { display: none; }
.stage-chip {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; padding: .38rem .75rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .8rem;
}
.stage-chip:hover { border-color: var(--brand-100); color: var(--brand-700); }
.stage-chip .n { font-size: .7rem; padding: .05rem .42rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.stage-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.stage-chip.on .n { background: rgba(255, 255, 255, .16); color: #fff; }
.desk-table tbody tr[data-href] { cursor: pointer; }
.desk-table td .cust { font-weight: 650; color: var(--ink); }
.desk-table td .sub { display: block; color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.desk-table .amt { font-weight: 650; white-space: nowrap; }
.owner { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.owner .avatar { width: 24px; height: 24px; font-size: .66rem; background: var(--brand-50); color: var(--brand-700); }
.owner.none { color: var(--bad); font-weight: 600; font-size: .8rem; }
.late { color: var(--bad); font-weight: 650; }
.bulkbar {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 140%); z-index: 1036; display: flex; align-items: center; gap: .5rem;
  flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 2rem); padding: .55rem .6rem .55rem 1rem; border-radius: 14px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); transition: transform .2s ease; margin-left: calc(var(--rail-w) / 2);
}
.bulkbar.show { transform: translate(-50%, 0); }
.bulkbar .sel { font-weight: 650; font-size: .85rem; margin-right: .35rem; }
.bulkbar .form-select { width: auto; min-width: 150px; background-color: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.bulkbar .form-select option { color: var(--ink); }
.bulkbar .btn-ghost { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .12); --bs-btn-border-color: rgba(255, 255, 255, .25); --bs-btn-hover-border-color: rgba(255, 255, 255, .4); box-shadow: none; }
.filter-drawer .offcanvas-header { border-bottom: 1px solid var(--line-2); }
.filter-drawer .offcanvas-title { font-weight: 800; }
.filter-drawer fieldset { margin-bottom: 1.1rem; }
.filter-drawer legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--faint); margin-bottom: .45rem; }
.filter-drawer .offcanvas-footer { padding: .9rem 1rem; border-top: 1px solid var(--line-2); display: flex; gap: .5rem; }
.filter-drawer .offcanvas-footer .btn { flex: 1; }
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 99px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem .22rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.st-inbox { background: #ecf1fa; color: #1b3a7a; border-color: #d5e0f3; }
.pill.st-calling { background: #fff7ed; color: #c2410c; border-color: #ffedd5; }
.pill.st-confirmed { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
.pill.st-scheduled { background: #fefce8; color: #a16207; border-color: #fef08a; }
.pill.st-road { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
.pill.st-delivered { background: var(--go-50); color: #15803d; border-color: #bbf7d0; }
.pill.st-lost { background: #fff1f2; color: #be123c; border-color: #ffe4e6; }

/* ==========================================================================
   Order board
   ========================================================================== */
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.board-head h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.board-head p { margin: .1rem 0 0; color: var(--muted); font-size: .84rem; }
.board-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.board-filters .form-select, .board-filters .form-control { width: auto; min-width: 150px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: .85rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; scroll-snap-type: x proximity; }
.lane { background: #eef0f7; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-height: 200px; scroll-snap-align: start; border: 1px solid transparent; transition: border-color .12s, background .12s; }
.lane.drop { border-color: var(--brand); background: var(--brand-50); }
.lane-head { display: flex; align-items: center; gap: .45rem; padding: .75rem .85rem .55rem; font-weight: 700; font-size: .86rem; }
.lane-head i { color: var(--muted); }
.lane-head .n { margin-left: auto; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: var(--surface); color: var(--muted); }
.lane-body { padding: .1rem .55rem .6rem; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; scrollbar-width: thin; }
.lane-more { display: block; text-align: center; font-size: .78rem; font-weight: 600; padding: .4rem; }
.lane-empty { text-align: center; color: var(--faint); font-size: .8rem; padding: 1.2rem .5rem; border: 1.5px dashed #d8dbe7; border-radius: 10px; }
.lane-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: .65rem .75rem; box-shadow: var(--shadow-xs); color: var(--ink); cursor: grab; position: relative; }
.lane-card:hover { color: var(--ink); border-color: #cfd4e4; box-shadow: var(--shadow-sm); }
.lane-card.dragging { opacity: .45; }
.lane-card.busy { opacity: .6; pointer-events: none; }
.lane-card .top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .2rem; }
.lane-card .nm { font-weight: 650; font-size: .88rem; line-height: 1.25; overflow-wrap: anywhere; }
.lane-card .items { font-size: .78rem; color: var(--muted); line-height: 1.35; margin: .15rem 0 .45rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lane-card .meta { padding-right: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .74rem; color: var(--muted); }
.lane-card .meta b { color: var(--ink); font-weight: 700; }
.lane-card .meta .late { color: var(--bad); }
.lane-card .st { font-size: .68rem; font-weight: 650; color: var(--muted); background: var(--surface-2); padding: .05rem .4rem; border-radius: 6px; white-space: nowrap; }
.lane-card .move { position: absolute; right: .45rem; bottom: .45rem; }
.lane-card .move .btn { --bs-btn-padding-x: .4rem; --bs-btn-padding-y: .1rem; --bs-btn-font-size: .72rem; box-shadow: none; }
.move-menu { width: 260px; }
.move-menu .dropdown-header { font-weight: 700; color: var(--ink); }
.board-pop { position: fixed; z-index: 1060; width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .9rem; }
.board-pop h6 { font-size: .9rem; margin-bottom: .6rem; }
.board-pop .opts { display: flex; flex-direction: column; gap: .35rem; }
.board-pop .opts button { text-align: left; }
.board-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 1070; background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 10px; font-weight: 600; font-size: .85rem; box-shadow: var(--shadow-lg); }
.board-toast.err { background: var(--bad); }

/* ==========================================================================
   Order page
   ========================================================================== */
.order-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.order-top .back { font-size: .8rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: .25rem; margin-bottom: .35rem; }
.order-top h1 { font-size: 1.55rem; font-weight: 800; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; letter-spacing: -.025em; }
.order-top h1 .code { font-size: .95rem; color: var(--muted); font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.order-top .sub { color: var(--muted); margin-top: .2rem; }
.order-top .acts { display: flex; flex-wrap: wrap; gap: .45rem; }
.track { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem .85rem; box-shadow: var(--shadow-xs); }
.track .step { position: relative; text-align: center; font-size: .76rem; font-weight: 650; color: var(--faint); }
.track .step::before { content: ""; position: absolute; top: 13px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 3px; border-radius: 3px; background: var(--line); }
.track .step:first-child::before { display: none; }
.track .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto .35rem; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line); color: var(--faint); font-size: .8rem; position: relative; z-index: 1; }
.track .step.done { color: var(--ink-2); }
.track .step.done .dot { background: var(--go); border-color: var(--go); color: #fff; }
.track .step.done::before, .track .step.on::before { background: var(--go); }
.track .step.on { color: var(--brand-700); }
.track .step.on .dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-50); }
.track.lost .step .dot { background: var(--surface-2); }
.lost-note { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; padding: .8rem 1rem; border-radius: 12px; background: #fff1f2; color: #9f1239; border: 1px solid #ffe4e6; font-weight: 600; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); margin-bottom: 1rem; }
.sheet-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { font-size: .98rem; font-weight: 750; margin: 0; }
.sheet-head .tools { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.sheet-body { padding: 1rem 1.1rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.25rem; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; margin-bottom: .1rem; }
.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }
.lines { width: 100%; }
.lines td { padding: .55rem 0; border-top: 1px solid var(--line-2); vertical-align: top; }
.lines tr:first-child td { border-top: 0; }
.lines .q { color: var(--muted); white-space: nowrap; padding-right: .75rem; width: 1%; }
.lines .p { text-align: right; white-space: nowrap; font-weight: 600; }
.sums { margin-top: .5rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.sums div { display: flex; justify-content: space-between; padding: .15rem 0; color: var(--ink-2); }
.sums .total { font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.sums .due { color: var(--bad); font-weight: 650; }
.act-panel { position: sticky; top: calc(var(--bar-h) + 16px); }
.act-panel .sheet:first-child { border-color: #c9d6ef; box-shadow: 0 0 0 4px var(--brand-50), var(--shadow-xs); }
.contact-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.contact-btns .btn { flex-direction: column; gap: .15rem; padding: .55rem .3rem; font-size: .76rem; }
.contact-btns .btn i { font-size: 1.15rem; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 1rem 1.6rem; }
.tl li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line-2); }
.tl li:last-child::before { display: none; }
.tl .mk { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); background: var(--brand); box-shadow: 0 0 0 1px var(--line); }
.tl .mk.pay { background: var(--go); }
.tl .what { font-weight: 650; }
.tl .when { color: var(--muted); font-size: .76rem; }
.tl .note { color: var(--ink-2); font-size: .84rem; margin-top: .15rem; }
.order-mbar { display: none; }
.table .btn, .btn-sm, .page-head .btn { white-space: nowrap; }
.table td .btn-sm { --bs-btn-padding-y: .28rem; }

/* ==========================================================================
   Tablet & phone
   ========================================================================== */
@media (max-width: 1199.98px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  :root { --bar-h: 58px; }
  .rail { transform: translateX(-100%); width: min(86vw, 300px); box-shadow: var(--shadow-lg); }
  .rail.show { transform: none; }
  .rail-close { display: block; }
  .rail-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 16, 51, .45); z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .rail-backdrop.show { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .shell { margin-left: 0; }
  .bar { padding: 0 .85rem; gap: .5rem; }
  .bar .menu-btn, .bar .search-btn { display: inline-grid; }
  .bar-brand { display: flex; }
  .finder { display: none; }
  .finder.open { display: block; position: absolute; left: .75rem; right: .75rem; top: calc(var(--bar-h) + 6px); max-width: none; }
  .finder.open input { height: 46px; font-size: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
  .bar-actions .desk-only, .finder kbd { display: none !important; }
  .content { padding: 1rem .85rem calc(var(--dock-h) + 1.5rem + env(safe-area-inset-bottom)); }
  .bulkbar { margin-left: 0; bottom: calc(var(--dock-h) + .75rem + env(safe-area-inset-bottom)); }
  .act-panel { position: static; }

  .dock {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    height: calc(var(--dock-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .dock a, .dock button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; color: var(--muted);
    font-size: .68rem; font-weight: 600; background: none; border: 0; position: relative;
  }
  .dock i { font-size: 1.25rem; line-height: 1; }
  .dock a.on { color: var(--brand); }
  .dock a.on i { background: var(--brand-50); border-radius: 99px; padding: .2rem .9rem; }
  .dock .fab { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--navy); box-shadow: 0 8px 20px rgba(11, 31, 77, .4); }
  .dock .fab i { font-size: 1.45rem; }
  .dock .count { position: absolute; top: 6px; left: 56%; background: var(--bad); color: #fff; border-radius: 999px; font-size: .6rem; padding: .1rem .35rem; }

  .order-mbar {
    display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: .5rem; position: fixed; left: 0; right: 0; z-index: 1034;
    bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); padding: .55rem .75rem;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  body:has(.order-mbar) .content { padding-bottom: calc(var(--dock-h) + 80px + env(safe-area-inset-bottom)); }
  #update-status { scroll-margin-top: calc(var(--bar-h) + 12px); }
  .lane { max-height: none; }
}

@media (max-width: 767.98px) {
  body { font-size: .9rem; }
  .page-title { font-size: 1.32rem; margin-bottom: .85rem; }
  .card-body { padding: .95rem; }
  .card-header { padding: .8rem .95rem; }
  .stat { min-height: 92px; padding: .85rem .95rem .9rem 1.1rem; }
  .stat .label { font-size: .78rem; }
  .stat .value { font-size: 1.45rem; }
  .row.g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
  /* 16px inputs stop iOS from zooming in; taller tap targets */
  .form-control, .form-select { font-size: 16px; min-height: 44px; }
  .form-control-sm, .form-select-sm { font-size: 15px; min-height: 38px; }
  textarea.form-control { min-height: 88px; }
  .btn { --bs-btn-padding-y: .6rem; }
  .btn-sm { --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .75rem; }
  .page-head > div:last-child, .page-head .d-flex { flex-wrap: wrap; }

  /* collapsible filter forms */
  .m-filter-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .95rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 650; color: var(--ink);
    box-shadow: var(--shadow-xs); margin-bottom: .75rem;
  }
  .m-filter-toggle .n { background: var(--brand); color: #fff; border-radius: 999px; font-size: .7rem; padding: .1rem .5rem; }
  .m-filter.m-collapsed { display: none !important; }

  /* tables become stacked cards */
  table.m-cards, table.m-cards tbody, table.m-cards tr, table.m-cards td { display: block; width: 100%; }
  table.m-cards thead { display: none; }
  table.m-cards tfoot { display: none; }
  table.m-cards tbody tr {
    position: relative; border: 1px solid var(--line); border-radius: 14px; margin: .7rem; width: auto; padding: .6rem .9rem;
    background: var(--surface); box-shadow: var(--shadow-xs);
  }
  .card > .table-responsive table.m-cards tbody tr:first-child { margin-top: .75rem; }
  table.m-cards > :not(caption) > * > * { border: 0; padding: .32rem 0; background: transparent !important; box-shadow: none; }
  /* label floats left; the value flows on the right (multi-line values stack, long labels make the row taller) */
  table.m-cards td { display: flow-root; text-align: right !important; min-height: 32px; overflow-wrap: anywhere; }
  table.m-cards td::before {
    content: attr(data-label); float: left; width: 38%; margin: .12rem .75rem .12rem 0; text-align: left; color: var(--muted);
    font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; overflow-wrap: normal;
  }
  table.m-cards td > .progress { display: inline-flex; width: 55%; vertical-align: middle; }
  table.m-cards td.m-head { text-align: left !important; font-size: 1rem; padding: .2rem 2rem .5rem 0 !important; display: block; border-bottom: 1px dashed var(--line) !important; margin-bottom: .25rem; }
  table.m-cards td.m-head::before { display: none; }
  table.m-cards td.m-check { position: absolute; top: .55rem; right: .75rem; width: auto; min-height: 0; padding: 0 !important; }
  table.m-cards td.m-check::before { display: none; }
  table.m-cards td.m-check .form-check-input { width: 1.35em; height: 1.35em; }
  table.m-cards td.m-nolabel::before { display: none; }
  table.m-cards td.m-empty { text-align: center !important; color: var(--muted); }
  table.m-cards td.m-empty::before { display: none; }
  table.m-cards tr:has(td.m-empty) { border-style: dashed; box-shadow: none; }
  table.m-cards td.m-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .4rem; padding: .55rem 0 .2rem !important; }
  table.m-cards td.m-actions::before { display: none; }
  table.m-cards td.m-actions .btn, table.m-cards td.m-actions form { flex: 1 1 auto; }
  table.m-cards td.m-actions form .btn { width: 100%; }
  table.m-cards td .progress { min-width: 110px; }
  .card > .table-responsive { overflow: visible; }

  /* modals become full-screen sheets */
  .modal-dialog { margin: 0; max-width: none; min-height: 100%; display: flex; align-items: flex-end; }
  .modal.fade .modal-dialog { transform: translateY(40px); }
  .modal.show .modal-dialog { transform: none; }
  .modal-content { border-radius: 20px 20px 0 0; max-height: 94vh; }
  .modal-body { overflow-y: auto; }
  .modal-footer { border-radius: 0; padding-bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1; }

  .nav-pills { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
  .nav-pills::-webkit-scrollbar { display: none; }
  .nav-pills .nav-link { white-space: nowrap; }
  pre { white-space: pre-wrap; word-break: break-all; font-size: .72rem; }
  dl.row dt { margin-bottom: .1rem; }
  .pagination { justify-content: center; }
}

@media (max-width: 380px) {
  .stat .value { font-size: 1.25rem; }
  .dock a span { font-size: .62rem; }
  .kpi b { font-size: 1.2rem; }
}


@media (max-width: 767.98px) {
  .hello h1 { font-size: 1.35rem; }
  .kpis { gap: .6rem; }
  .kpi { padding: .8rem .85rem; }
  .kpi b { font-size: 1.35rem; }
  .kpi small { font-size: .7rem; }
  .pipe { grid-template-columns: repeat(5, minmax(108px, 1fr)); overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
  .desk-head h1 { font-size: 1.2rem; }
  .desk-tools { width: 100%; }
  .desk-search { flex: 1 1 100%; }
  .desk-search input { width: 100%; }
  .desk-tools .btn { flex: 1 1 auto; }
  .bulkbar { left: .75rem; right: .75rem; transform: translateY(160%); max-width: none; padding: .55rem; }
  .bulkbar.show { transform: none; }
  .bulkbar .sel { width: 100%; text-align: center; margin: 0; }
  .bulkbar .btn, .bulkbar .form-select { flex: 1 1 auto; }
  .board { grid-auto-columns: 84vw; gap: .6rem; margin: 0 -.85rem; padding: 0 .85rem .75rem; scroll-snap-type: x mandatory; }
  .board-filters { width: 100%; }
  .board-filters .form-select, .board-filters .form-control { flex: 1 1 140px; min-width: 0; }
  .order-top h1 { font-size: 1.25rem; }
  .order-top .acts { width: 100%; }
  .order-top .acts .btn { flex: 1 1 auto; }
  .track { padding: .8rem .4rem .7rem; }
  .track .step { font-size: .64rem; }
  .track .dot { width: 24px; height: 24px; font-size: .7rem; }
  .track .step::before { top: 11px; left: calc(-50% + 13px); right: calc(50% + 13px); }
  .facts { grid-template-columns: 1fr; }
  .sheet-head { flex-wrap: wrap; }
  .desk-table td .sub { display: block; }
}
/* ---------- print ---------- */
@media print {
  .rail, .bar, .dock, .tabs, .no-print, .rail-backdrop, .m-filter-toggle, .bulkbar { display: none !important; }
  .shell { margin: 0; } .content { padding: 0; } body { background: #fff; }
  .card, .sheet, .panel { box-shadow: none; }
}

/* long unbroken text (URLs, pasted IDs, very long names) must never push the page sideways */
.page-title, .page-head, h1, h2, h3, h4, h5, dd, .card-header, .muted-small, .text-muted, nav.small, .breadcrumb, .alert, .stat .label { overflow-wrap: anywhere; }
.content, .content > *, .row > * { min-width: 0; }

/* leaderboard rank badges */
.rank-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-family: var(--font-head); font-weight: 800; font-size: .8rem; }
.rank-badge.r1 { background: #fef3c7; color: #a16207; } .rank-badge.r2 { background: #eef2f7; color: #475569; } .rank-badge.r3 { background: #fdecdc; color: #b45309; }
