:root {
  --teal: #0A9396;
  --dark: #005F73;
  --gold: #D4A84B;
  --bg: #f8fafc;
  --text: #1e293b;
  --muted: #64748b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--teal); }

.site-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--teal) 100%);
  color: #fff;
  padding: 1.25rem 1.5rem;
}
.site-header-inner {
  max-width: none;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header h1 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.site-header p { margin: 4px 0 0; font-size: 0.85rem; opacity: 0.9; }
.header-links a {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  text-decoration: none;
  margin-left: 1rem;
}
.header-links a:hover { color: #fff; text-decoration: underline; }

main { max-width: none; margin: 0; padding: 1.25rem 0 0; }
.page-pad {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.search-hero {
  background: linear-gradient(135deg, var(--dark), var(--teal));
  border-radius: 16px;
  padding: 1.75rem;
  color: #fff;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 95, 115, 0.25);
}
.search-hero h2 { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 700; }
.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}
.search-form label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.9;
}
.search-form input, .search-form select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.search-form-route {
  grid-template-columns: 1fr 1fr 140px auto;
}
.ac-wrap { position: relative; }
.ac-suggestions {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  max-height: 220px;
  overflow-y: auto;
}
.ac-suggestions-hero {
  color: #1e293b;
}
.ac-suggestions-hero .ac-pick {
  color: #1e293b;
}
.ac-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}
.ac-pick:hover, .ac-pick.ac-active { background: #f0fdfa; }
.ac-pick strong { color: var(--teal); }
.search-form-actions {
  display: flex;
  align-items: end;
}
.search-form input::placeholder { color: rgba(255,255,255,0.5); }
.search-form select option { color: #1e293b; }
.search-btn {
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  background: var(--gold);
  color: var(--dark);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s;
}
.search-btn:hover { transform: translateY(-1px); }
.search-btn:disabled { opacity: 0.6; cursor: wait; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card .val { font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.stat-card .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.25rem;
}

.results-card {
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
  width: 100%;
}
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.results-header {
  font-weight: 700;
  font-size: 14px;
}
.grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 8px 12px;
  background: #eef2f7;
  border-bottom: 1px solid #cbd5e1;
  font-size: 12px;
}
.grid-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  flex: 1;
}
.gt-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.03em;
}
.gt-field input, .gt-field select {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
  min-width: 88px;
}
.gt-field input[readonly] { background: #f8fafc; color: #334155; }
.grid-toolbar-pills { display: flex; gap: 6px; align-items: center; }
.rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  cursor: default;
}
.rate-pill.is-active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.rate-pill-n { font-variant-numeric: tabular-nums; }
.gt-opt-wm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.gt-opt-wm input { accent-color: var(--teal); }
.view-toggle {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}
.view-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}
.view-btn.is-active {
  background: #fff;
  color: var(--dark);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.results-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}

.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rate-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.rate-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.rate-table tr.rate-row { cursor: pointer; }
.rate-table tr.rate-row:hover td { background: #f8fafc; }
.rate-table tr.rate-row.is-expanded td { background: #f0fdfa; }
.rate-expand { width: 28px; padding-left: 8px !important; padding-right: 4px !important; }
.rate-expand-th { width: 28px; }
.rate-chevron {
  display: inline-block;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.rate-row.is-expanded .rate-chevron { transform: rotate(90deg); color: var(--teal); }

.wb-table .wb-val { color: var(--teal); font-weight: 600; }

.sheet-scroll, .cg-tariff-scroll { overflow-x: auto; }
.sheet-viewport { position: relative; }
.sheet-scroll.sheet-scroll-main {
  overflow-x: auto;
  scrollbar-width: thin;
}
.sheet-hscroll-rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #cbd5e1;
  border-top: 1px solid #94a3b8;
  display: none;
}
.sheet-hscroll-rail.is-visible { display: block; }
.sheet-hscroll-rail-inner { height: 1px; }
.rate-sheet-table {
  width: 100%;
  min-width: 1880px;
  font-size: 11px;
  line-height: 1.3;
}
.rate-sheet-table tbody tr:nth-child(even) { background: #f8fafc; }
.rate-sheet-table tbody tr.rate-row.is-selected { background: #dbeafe !important; }
.rate-sheet-table tbody tr.rate-row:hover td { background: #f0fdfa; }
.rate-sheet-table th,
.rate-sheet-table td {
  padding: 4px 7px;
  white-space: nowrap;
  vertical-align: middle;
}
.rate-sheet-table .sheet-group-row th {
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 5px 7px;
  background: #e8eef4;
  border-bottom: 1px solid #cbd5e1;
}
.rate-sheet-table .sheet-group-h { color: #334155; }
.rate-sheet-table .sheet-col-row th {
  font-size: 9px;
  padding: 4px 7px;
}
.rate-sheet-table .sheet-filter-row th {
  padding: 3px 4px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}
.sheet-filter {
  width: 100%;
  min-width: 36px;
  max-width: 96px;
  padding: 3px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 10px;
  background: #fff;
}
.sheet-filter:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(10, 147, 150, 0.15);
}
.rate-sheet-table .cg-td-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.rate-sheet-table .cg-td-commodity {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.rate-sheet-table .cg-td-code {
  font-weight: 700;
  font-size: 10px;
  color: #475569;
}
.rate-sheet-table .cg-td-total {
  font-weight: 700;
  color: var(--teal);
}
.rate-sheet-table .cg-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.rate-sheet-table .cg-td-wb {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--teal);
  font-weight: 600;
}
.rate-sheet-table .cg-td-promo { width: 22px; text-align: center; padding: 4px 2px !important; }
.cg-promo { font-size: 14px; line-height: 1; cursor: help; }
.rate-sheet-table .cg-td-cc { padding: 4px 5px !important; }
.rate-sheet-table .cg-td-valid { font-size: 10px; color: var(--muted); }
.rate-sheet-table .cg-charge-pills {
  max-width: 76px;
  padding: 4px 5px !important;
  vertical-align: middle;
}
.rate-sheet-table .cg-charge-pills .pill-empty { font-size: 9px; }
.cg-charge-cell {
  position: relative;
  display: inline-block;
  max-width: 100%;
  cursor: help;
}
.cg-charge-codes {
  display: block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}
.cg-charge-incl .cg-charge-codes { color: #166534; }
.cg-charge-subj .cg-charge-codes { color: #92400e; }
.cg-charge-opt .cg-charge-codes { color: #1e40af; }
.cg-charge-popup {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 80;
  min-width: 210px;
  max-width: 280px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.cg-charge-cell:hover .cg-charge-popup { display: block; }
.cg-charge-popup-head {
  display: block;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  letter-spacing: 0.02em;
}
.cg-charge-incl .cg-charge-popup-head { background: #059669; }
.cg-charge-subj .cg-charge-popup-head { background: #d97706; }
.cg-charge-opt .cg-charge-popup-head { background: #2563eb; }
.cg-charge-popup-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #111827;
  color: #f9fafb;
}
.cg-charge-popup-list li {
  display: grid;
  grid-template-columns: 18px 42px 1fr;
  gap: 4px 6px;
  align-items: start;
  padding: 4px 10px;
  font-size: 10px;
  line-height: 1.35;
}
.cg-charge-ico {
  opacity: 0.85;
  font-size: 11px;
  line-height: 1.2;
}
.cg-charge-code {
  font-weight: 700;
  color: #fff;
}
.cg-charge-name {
  color: #e5e7eb;
  font-weight: 500;
}
.prod-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1;
}
.prod-icon-gc { background: #e0f2fe; }
.prod-icon-dg { background: #fee2e2; }
.prod-icon-temp { background: #dbeafe; }
.prod-icon-live { background: #fef3c7; }
.cg-td-ref, .cg-td-cond { font-size: 10px; color: var(--muted); max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
.cg-td-ratio { font-size: 10px; font-weight: 700; color: #475569; }
.sheet-row-chk { width: 28px; text-align: center; }
.sheet-row-chk input { accent-color: var(--teal); cursor: pointer; }
.airline-logo-sm {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  display: block;
}
.cg-cc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 9px;
  font-weight: 800;
  color: #475569;
}
.cg-wh-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}
.cg-wh-info .cg-subhead { margin-top: 0; }
.cg-wh-addr { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.cg-wh-map { min-width: 0; }
.charge-pills-cell { display: flex; flex-wrap: wrap; gap: 3px; max-width: 120px; }
.charge-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.charge-pill-included { background: #dcfce7; color: #166534; }
.charge-pill-subject { background: #fef3c7; color: #92400e; }
.charge-pill-optional { background: #dbeafe; color: #1e40af; }
.pill-empty { color: var(--muted); font-size: 11px; }

/* CargoGuide-style rate detail modal */
.cg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cg-modal-overlay[hidden] { display: none; }
.cg-modal {
  background: #fff;
  border-radius: 12px;
  width: min(960px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  overflow: hidden;
}
.cg-modal-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.cg-top-left { display: flex; align-items: center; gap: 10px; }
.cg-top-route { font-weight: 700; text-align: center; }
.cg-top-price { font-size: 1.25rem; font-weight: 800; color: var(--teal); text-align: right; }
.cg-top-product, .cg-top-valid { font-size: 12px; color: var(--muted); }
.cg-modal-close {
  border: none;
  background: #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
}
.cg-modal-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  min-height: 320px;
  flex: 1;
  overflow: hidden;
}
.cg-modal-nav {
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}
.cg-nav-btn {
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.cg-nav-btn.is-active {
  background: var(--teal);
  color: #fff;
  border-left-color: var(--dark);
}
.cg-modal-content {
  padding: 16px 18px;
  overflow: auto;
}
.cg-calc-table, .cg-wb-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cg-calc-table th, .cg-wb-grid th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.cg-calc-table td, .cg-wb-grid td { padding: 8px; border-bottom: 1px solid #f1f5f9; }
.cg-total { font-weight: 700; color: #b91c1c; }
.cg-calc-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: start;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.cg-foot-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.cg-calc-total-box {
  background: #16a34a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: right;
}
.cg-calc-total { font-size: 1.35rem; font-weight: 800; }
.cg-calc-total-sub { font-size: 12px; opacity: 0.9; }
.cg-charge-sections { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.cg-carrier-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.cg-carrier-head h3 { margin: 0 0 4px; }
.cg-subhead { margin: 16px 0 8px; font-size: 13px; color: var(--dark); }
.cg-product-hero h3 { margin: 0 0 8px; color: var(--dark); }
.cg-product-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cg-conditions { font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.cg-wh-block { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.cg-map-wrap { margin-top: 0; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.cg-map { width: 100%; height: 200px; border: 0; display: block; }
.cg-map-links { margin: 6px 0 0; font-size: 11px; display: flex; flex-wrap: wrap; gap: 10px; }
.cg-map-links a { font-weight: 600; }

.detail-kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-kv th {
  text-align: left;
  width: 38%;
  padding: 7px 10px 7px 0;
  color: var(--muted);
  font-weight: 600;
  vertical-align: top;
}
.detail-kv td { padding: 7px 0; }
.detail-note, .detail-empty { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.detail-list { list-style: none; margin: 0; padding: 0; }
.detail-list li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }

@media (max-width: 800px) {
  .cg-modal-top { grid-template-columns: 1fr auto; }
  .cg-modal-body { grid-template-columns: 1fr; }
  .cg-modal-nav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid #e2e8f0; }
  .cg-nav-btn { border-left: none; border-bottom: 3px solid transparent; }
  .cg-nav-btn.is-active { border-bottom-color: var(--dark); }
  .cg-wh-block { grid-template-columns: 1fr; }
}
.airline-cell { display: flex; align-items: center; gap: 10px; }
.airline-logo {
  width: 44px; height: 44px; border-radius: 10px; background: #fff;
  object-fit: contain; flex-shrink: 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.airline-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #475569; letter-spacing: 0.02em;
}
.rate-val-total { font-size: 1.15rem; }
.quote-breakdown {
  margin-top: 6px; font-size: 11px; color: var(--muted);
}
.quote-breakdown summary {
  cursor: pointer; color: var(--teal); font-weight: 600;
}
.quote-breakdown ul {
  margin: 6px 0 0; padding: 0; list-style: none;
}
.quote-breakdown li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 2px 0; border-bottom: 1px dashed #f1f5f9;
}
.rate-val { font-size: 1.1rem; font-weight: 800; color: var(--teal); }
.rate-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.svc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  text-transform: capitalize;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { font-weight: 600; }

.shipment-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.shipment-card-head h3 { margin: 0 0 4px; font-size: 1rem; color: var(--dark); }
.shipment-card-head p { margin: 0 0 1rem; font-size: 12px; color: var(--muted); }
.shipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}
.shipment-grid label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.shipment-grid input, .shipment-grid select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}
.cw-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--dark);
}
.cw-meta { font-size: 12px; color: var(--muted); }
.dg-card { border-left: 3px solid #f59e0b; }
.commodity-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-bottom: 10px;
}
.dg-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0;
}
.dg-fields { margin-top: 8px; }
.dg-un-wrap { position: relative; }
.dg-suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  max-height: 200px;
  overflow-y: auto;
}
.dg-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.dg-pick:hover { background: #f0fdfa; }
.dg-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.header-links a.staff-link {
  color: #fef3c7;
  font-weight: 700;
}

.shipment-grid-main {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.dim-open-cell { grid-column: span 2; }
.dim-open-btn {
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.dim-open-btn:hover { border-color: var(--teal); background: #f0fdfa; }
.dim-summary {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-panel {
  background: #fff;
  border-radius: 14px;
  width: min(720px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; color: var(--dark); }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-close {
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}
.modal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}
.modal-toolbar label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.modal-toolbar select {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.modal-table-wrap {
  overflow: auto;
  padding: 0 1.25rem;
  flex: 1;
}
.dim-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dim-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 6px;
  border-bottom: 1px solid #e2e8f0;
}
.dim-table td { padding: 6px 4px; }
.dim-table input {
  width: 100%;
  min-width: 56px;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
}
.row-del {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.modal-totals { font-size: 12px; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; }
.btn-ghost, .btn-primary {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-ghost { background: #f1f5f9; color: #334155; }
.btn-primary { background: var(--teal); color: #fff; }

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

@media (max-width: 720px) {
  .search-form-route {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .rate-table thead { display: none; }
  .rate-table tr { display: block; padding: 12px; border-bottom: 1px solid #e2e8f0; }
  .rate-table td { display: block; padding: 4px 0; border: none; }
  .rate-table td::before {
    content: attr(data-label);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    display: block;
  }
}
