/* Hallmark · macrostructure: n/a (product surface, not a marketing page) · component: dashboard
 * theme: custom · shares tokens.css with index.html — see that file's stamp for the full system
 * Bridges this file's existing --ink/--paper/… names onto the shared design tokens so the
 * dashboard and the marketing site read as one brand without rewriting every selector below.
 */

:root {
  --ink: var(--color-ink);
  --ink-2: var(--color-ink-2);
  --ink-3: var(--color-muted);
  --paper: var(--color-paper);
  --wash: var(--color-paper-2);
  --line: var(--color-rule-2);
  --line-2: var(--color-rule);
  /* --radius / --radius-sm already come from tokens.css unchanged */
  --shadow: var(--shadow-whisper);

  /* status accents — the only colour beyond ink/paper and the one signal accent */
  --ok: var(--color-ok);
  --ok-bg: var(--color-ok-bg);
  --go: var(--color-warn);
  --go-bg: var(--color-warn-bg);
  --bad: var(--color-bad);
  --bad-bg: var(--color-bad-bg);
  --info: var(--color-accent);
  --info-bg: var(--color-accent-tint-bg);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: var(--font-mono);
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
  color: var(--ink-2);
}

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

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
}
.logo:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 4px; }
.logo .mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 9px;
  font-weight: 700;
  flex: none;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink-2);
  cursor: pointer;
}
.nav-item .ic { color: var(--ink-3); font-size: 12px; width: 14px; text-align: center; }
.nav-item:hover { background: var(--wash); }
.nav-item.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.nav-item.is-active .ic { color: var(--paper); }

.side-foot {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--ink-3);
}
.side-foot p { margin: 2px 0; }
.side-foot .dim { color: var(--line-2); }

/* ---------- main ---------- */
.main {
  padding: 28px 34px 60px;
  max-width: 1080px;
}

.view { display: none; }
.view.is-active { display: block; animation: fade 0.16s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.sub { color: var(--ink-2); margin: 4px 0 0; }

/* ---------- cards / forms ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.split {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  align-items: start;
}

.form { display: flex; flex-direction: column; gap: 14px; }
.form.wide { gap: 22px; }

.group { display: flex; flex-direction: column; gap: 12px; }
.group h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span-2 { grid-column: span 2; }
.checks { align-items: center; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

input, select {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(16, 16, 16, 0.08);
}

.btn {
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--ink);
}
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #000; }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-ghost:hover { background: var(--wash); }
.btn[disabled] { opacity: 0.45; cursor: progress; }
.btn-row { display: flex; gap: 10px; }

.warn {
  font-size: 12px;
  color: var(--go);
  background: var(--go-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0;
}

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 12px; }
.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--ink-3);
}

.rate-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 16px;
  align-items: center;
}
.rate-row.rec { border-color: var(--ink); }
.rate-row h3 { margin: 0; font-size: 14px; font-weight: 600; grid-column: 1; }
.rate-row .meta { grid-column: 1; color: var(--ink-3); font-size: 12px; }
.rate-row .price { grid-column: 2; grid-row: 1 / span 2; font-size: 18px; font-weight: 700; }
.rate-row .pick {
  grid-column: 3; grid-row: 1 / span 2;
  border: 1px solid var(--ink);
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.rate-row .pick:hover { background: var(--ink); color: var(--paper); }

.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  color: var(--ink);
}

/* status pill — carries the only strong colour */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-ok   { color: var(--ok);   background: var(--ok-bg); }
.pill.s-go   { color: var(--go);   background: var(--go-bg); }
.pill.s-bad  { color: var(--bad);  background: var(--bad-bg); }
.pill.s-info { color: var(--info); background: var(--info-bg); }

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}
.status-line .mono { color: var(--ink-2); font-size: 12px; }

.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline li {
  border-left: 2px solid var(--line-2);
  padding: 0 0 16px 16px;
  position: relative;
}
.timeline li:last-child { border-color: transparent; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px; top: 3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.timeline li:first-child::before { background: var(--ink); }
.timeline .what { font-weight: 600; }
.timeline .when { color: var(--ink-3); font-size: 12px; }

.banner {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}
.banner.ok  { background: var(--ok-bg);  color: var(--ok); }
.banner.err { background: var(--bad-bg); color: var(--bad); }

.link { color: var(--ink); font-size: 12px; font-weight: 600; }

details.raw summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 0;
}
pre.json {
  background: var(--ink);
  color: #eaeaea;
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 380px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
  }
  .sidebar .side-foot { display: none; }
  .nav { flex-direction: row; }
  .main { padding: 20px; }
  .split { grid-template-columns: 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

/* =========================================================
   SIDE-BY-SIDE RATE COMPARISON STYLING
========================================================= */
.split-compare {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

/* Quick Presets Bar */
.presets-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.preset-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-3);
  letter-spacing: 0.05em;
}
.preset-btn {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-btn:hover {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}

/* Winner Banner */
.winner-banner {
  background: linear-gradient(135deg, #0d542b 0%, #15803d 100%);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.25);
  animation: bannerFade 0.25s ease-out;
}
@keyframes bannerFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.winner-banner .banner-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.winner-banner .banner-sub {
  font-size: 12.5px;
  opacity: 0.9;
  margin-top: 4px;
}

/* Segment Tabs */
.segment-tabs {
  display: flex;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.seg-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.seg-tab.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Side-by-Side Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.comparison-grid.shift-only-view #cardDelhivery { display: none; }
.comparison-grid.delhivery-only-view #cardShift { display: none; }
.comparison-grid.shift-only-view,
.comparison-grid.delhivery-only-view {
  grid-template-columns: 1fr;
}

/* Comparison Card */
.compare-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.compare-card.is-winner {
  border: 2px solid #16a34a;
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.12);
}
.compare-card.is-winner::after {
  content: "LOWEST COST";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #86efac;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.carrier-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.carrier-badge.badge-b2b {
  color: #b45309;
}
.sub-label {
  font-size: 11.5px;
  color: var(--ink-3);
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0;
}
.price-box .currency {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-2);
}
.price-box .amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.price-box .unit {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 4px;
}

.carrier-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.breakdown-list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.breakdown-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}
.breakdown-list .item-name {
  color: var(--ink-2);
}
.breakdown-list .item-val {
  font-weight: 600;
  color: var(--ink);
}
.font-semibold { font-weight: 600; color: #15803d !important; }

.full-width { width: 100%; text-align: center; }

/* Alt carriers list */
.alt-carriers-dropdown {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.alt-carriers-dropdown summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.alt-carriers-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =========================================================
   TOP CONTROL BAR & DUAL INTERFACE (D2C vs B2B & NATIONAL vs INTL)
========================================================= */
.top-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mode-switch-group,
.scope-switch-group {
  display: inline-flex;
  background: #ececec;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  gap: 2px;
}

.mode-btn,
.scope-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mode-btn:hover,
.scope-btn:hover {
  color: var(--ink);
}
.mode-btn.is-active,
.scope-btn.is-active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.dock-pill {
  font-size: 9.5px;
  text-transform: uppercase;
  background: #f59e0b;
  color: #000000;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-left: 2px;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: "JetBrains Mono", monospace;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.mode-indicator {
  padding: 0 0 8px;
}
.mode-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--wash);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.b2b-dock-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  animation: fade 0.16s ease;
}

.form-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sub-mode-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--wash);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
}

/* =========================================================
   VISUAL ROUTE STEPPER & DETAILED MAP
========================================================= */
.route-mini-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.route-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.route-meta {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}
.route-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  padding: 4px 0;
}
.step-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  width: 90px;
}
.step-point .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px #cbd5e1;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}
.step-point.is-origin .dot {
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}
.step-point.is-dest .dot {
  background: #10b981;
  box-shadow: 0 0 0 2px #10b981;
}
.step-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.25;
}
.step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin-top: 5px;
  position: relative;
}

/* Detailed Route View */
.route-full-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.map-container {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.map-svg {
  width: 100%;
  max-width: 800px;
  height: auto;
}
.pulse-line {
  animation: dash 24s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

.hubs-table-wrap {
  overflow-x: auto;
}
.hubs-table-wrap h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.hubs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}
.hubs-table th {
  background: var(--wash);
  color: var(--ink-2);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.hubs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

/* =========================================================
   B2B FAST DOCK MODE THEME (Optimized for Remote Depots)
========================================================= */
body.mode-b2b {
  background: #f2f3f5;
}
body.mode-b2b .mode-badge {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}
body.mode-b2b .top-control-bar {
  border-bottom-color: #d1d5db;
}
body.mode-b2b .card {
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.mode-b2b .price-box .amount {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.04em;
}
body.mode-b2b .breakdown-list .item-val {
  font-family: "JetBrains Mono", monospace;
}

@media (max-width: 900px) {
  .split-compare { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .top-control-bar { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   DELHIVERY D2C / B2C EXPRESS SUITE STYLING
========================================================= */
.waybill-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 12px;
  margin-top: 6px;
}
.waybill-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.serviceability-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.service-item span.lbl {
  color: var(--ink-2);
}
.service-item span.val {
  font-weight: 600;
  color: var(--ink);
}
.badge-service-ok {
  color: #15803d;
  font-weight: 700;
}
.badge-service-no {
  color: #b91c1c;
  font-weight: 700;
}


