/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #F5F7FA;
  --surface:    #FFFFFF;
  --border:     #DDE2EA;
  --text:       #1A1A1A;
  --text-sub:   #5A6472;
  --text-muted: #9AA3AE;
  --accent:     #1B3A6B;   /* deep navy blue — from logo */
  --accent-lt:  #E8EDF5;
  --green:      #3A8F3F;
  --green-lt:   #E8F5E9;
  --yellow:     #E65100;
  --yellow-lt:  #FFF3E0;
  --orange:     #C84B11;
  --orange-lt:  #FBE9E7;
  --red:        #B71C1C;
  --red-lt:     #FFEBEE;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: monospace; font-size: 13px; background: var(--border); padding: 1px 5px; border-radius: 4px; }

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-logo {
  font-size: 17px; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-hamburger { display: none; }
.nav-link {
  color: var(--text-sub); font-size: 14px;
  padding: 5px 10px; border-radius: var(--radius);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); font-weight: 500; }
.nav-user-menu {
  position: relative;
  margin-left: 4px;
  border-left: 1px solid var(--border);
  padding-left: 8px;
}
.nav-user-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  padding: 5px 8px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 4px;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.nav-user-btn:hover, .nav-user-btn.active { background: var(--bg); color: var(--text); }
.nav-user-caret { font-size: 10px; opacity: .6; }
.nav-dropdown {
  display: none;
  position: absolute; right: 0; top: 100%;
  padding-top: 6px;
  background: transparent;
  min-width: 160px; z-index: 200;
}
.nav-dropdown::before {
  content: '';
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  position: absolute; inset: 6px 0 0 0;
  z-index: -1;
}
.nav-user-menu:hover .nav-dropdown { display: block; }
.nav-dropdown-item {
  display: block; padding: 9px 14px;
  font-size: 13px; color: var(--text-sub);
  text-decoration: none; position: relative;
  transition: background .12s, color .12s;
}
.nav-dropdown-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.nav-dropdown-item:last-child  { border-radius: 0 0 var(--radius) var(--radius); }
.nav-dropdown-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-dropdown-item.active { color: var(--accent); font-weight: 500; }

/* ── Main layout ──────────────────────────────────────────── */
.main {
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash-wrap { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 14px; border: 1px solid transparent;
}
.flash-success  { background: var(--green-lt);  color: var(--green);  border-color: #A5D6A7; }
.flash-error    { background: var(--red-lt);    color: var(--red);    border-color: #EF9A9A; }
.flash-warning  { background: var(--yellow-lt); color: var(--yellow); border-color: #FFCC80; }
.flash-info     { background: var(--accent-lt); color: var(--accent); border-color: #CE93D8; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-logo  { font-size: 28px; text-align: center; margin-bottom: .5rem; }
.auth-title { font-size: 22px; font-weight: 600; text-align: center; }
.auth-sub   { color: var(--text-sub); text-align: center; margin-bottom: 1.75rem; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: 14px; color: var(--text-sub); }

/* ── Page headers ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem;
}
.page-header h1 { font-size: 22px; font-weight: 600; }
.page-sub { color: var(--text-sub); font-size: 14px; margin-top: 2px; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title  { font-size: 16px; font-weight: 500; margin-bottom: .25rem; }
.card-sub    { font-size: 13px; color: var(--text-sub); margin-bottom: 1rem; }
.form-card   { max-width: 700px; }

/* ── Stat cards ───────────────────────────────────────────── */
.stat-row { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.1rem 1.4rem;
  flex: 1; box-shadow: var(--shadow);
}
.stat-card.stat-alert { border-color: #F0997B; background: var(--orange-lt); }
.stat-val { font-size: 28px; font-weight: 600; }
.stat-lbl { font-size: 13px; color: var(--text-sub); }

/* ── Info bar ─────────────────────────────────────────────── */
.info-bar { display: flex; gap: 2rem; }
.info-item {}
.info-lbl { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.info-val { font-size: 16px; font-weight: 500; margin-top: 2px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field-full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 500; color: var(--text-sub); }
.optional { font-weight: 400; color: var(--text-muted); }
input[type=text], input[type=email], input[type=password],
input[type=date], select, textarea {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.origin-county-display {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; font-size: 14px; background: var(--bg);
  color: var(--text); width: 100%;
}
.form-actions { display: flex; gap: 10px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 8px 16px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: #2E86C1; text-decoration: none; color: #fff; }
.btn-ghost    { background: transparent; border-color: var(--border); color: var(--text-sub); }
.btn-ghost:hover    { background: var(--bg); text-decoration: none; }
.btn-full     { width: 100%; text-align: center; }
.btn-sm       { padding: 4px 10px; font-size: 13px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: 99px; white-space: nowrap;
}
.badge-ok            { background: var(--green-lt);  color: var(--green); }
.badge-warning       { background: var(--yellow-lt); color: var(--yellow); }
.badge-danger        { background: var(--orange-lt); color: var(--orange); }
.badge-critical      { background: var(--red-lt);    color: var(--red); }
.badge-cold-warning  { background: #e3f2fd; color: #1565C0; }
.badge-cold-danger   { background: #bbdefb; color: #0d47a1; }
.badge-cold-critical { background: #c5cae9; color: #4527a0; }
.badge-in_transit    { background: var(--accent-lt); color: var(--accent); }
.badge-delivered   { background: var(--green-lt);  color: var(--green); }
.badge-delayed     { background: var(--yellow-lt); color: var(--yellow); }

/* ── Temperature colors ───────────────────────────────────── */
.temp-ok       { color: var(--green); }
.temp-warning  { color: var(--yellow); font-weight: 500; }
.temp-danger   { color: var(--orange); font-weight: 600; }
.temp-critical { color: var(--red);    font-weight: 600; }

/* ── Tables ───────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 10px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.row-critical td { background: #FFF5F5; }
.table tr.row-danger   td { background: #FFF8F5; }
.hub-name { font-weight: 500; font-size: 13px; }
.hub-city { font-size: 12px; color: var(--text-muted); }
.hub-step { color: var(--text-muted); font-size: 13px; }
.exposure-line { margin-top: 6px; font-size: 13px; }
.exposure-tooltip-wrap { position: relative; display: inline-block; margin-left: -1px; vertical-align: text-bottom; top: 3px; }
.exposure-tooltip-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; cursor: default; line-height: 1; }
.exposure-tooltip-body { display: none; position: absolute; top: 50%; left: calc(100% + 10px); transform: translateY(-50%); width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; color: var(--text); box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 100; }
.exposure-tooltip-body::after { content: ''; position: absolute; top: 50%; right: 100%; transform: translateY(-50%); border: 6px solid transparent; border-right-color: var(--border); }
.exposure-tooltip-wrap:hover .exposure-tooltip-body { display: block; }
.exposure-score { font-weight: 600; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; white-space: nowrap; }
.exposure-low      { background: var(--green-lt);  color: var(--green); }
.exposure-moderate { background: var(--yellow-lt); color: var(--yellow); }
.exposure-elevated { background: var(--yellow-lt); color: var(--orange); }
.exposure-high     { background: var(--orange-lt); color: var(--orange); }
.exposure-severe   { background: var(--red-lt);    color: var(--red); }
/* Temperature route strip */
.temp-strip { margin: 18px 0 20px; }
.temp-strip-bar-wrap { position: relative; }
.temp-strip-bar { height: 40px; border-radius: 6px; width: 100%; box-shadow: inset 0 1px 3px rgba(0,0,0,.15); }
.strip-truck { position: absolute; left: -15px; bottom: -2px; height: 55px; width: auto; filter: drop-shadow(1px 1px 2px rgba(0,0,0,.25)); pointer-events: none; }
.temp-strip-ticks { position: relative; height: 48px; margin-top: 4px; }
.strip-tick { position: absolute; top: 0; width: 1px; height: 8px; background: var(--text-muted); transform: translateX(-50%); }
.strip-tick-peak { width: 2px; height: 10px; background: var(--text); }
.strip-tick-lbl { position: absolute; top: 10px; font-size: 10px; line-height: 1.4; color: var(--text-sub); white-space: nowrap; }
.strip-lbl-city { }
.strip-lbl-temp { font-weight: 700; font-size: 11px; color: var(--text); }
.strip-lbl-peak { font-size: 9px; font-weight: 700; color: var(--orange); }

.route-row-extra { display: none; }
.route-toggle-btn { display: block; margin: 8px auto 4px; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 5px 16px; font-size: 12.5px; color: var(--text-sub); cursor: pointer; }
.route-toggle-btn:hover { background: var(--bg); color: var(--text); }
.corridor-row td { background: var(--bg); font-size: 12.5px; }
.nws-group { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.nws-group-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; background: var(--bg); }
.nws-group-header:hover { background: var(--accent-lt); }
.nws-group-title { flex: 1; font-size: 13.5px; font-weight: 500; }
.nws-group-count { font-size: 12px; color: var(--text-sub); }
.nws-group-toggle { font-size: 12px; color: var(--accent); white-space: nowrap; }
.nws-group-table { margin: 0; border-top: 1px solid var(--border); }
.corridor-row .corridor-label { font-size: 12.5px; font-weight: 500; color: var(--text-sub); }
.corridor-row .badge { font-size: 11px; padding: 1px 7px; }
.route-pill { font-size: 12px; color: var(--text-sub); }
.table-note { font-size: 12px; color: var(--text-muted); margin-top: 1rem; line-height: 1.5; }

/* ── Recommendation box ───────────────────────────────────── */
.rec-box {
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  border: 1px solid; margin-bottom: 1.25rem;
  font-size: 14px; line-height: 1.7;
}
.rec-ok       { background: var(--green-lt);  border-color: #A5D6A7; color: #1B5E20; }
.rec-warning  { background: var(--yellow-lt); border-color: #FFCC80; color: #4E2600; }
.rec-elevated { background: #FFE0B2;          border-color: #FFB74D; color: #4E2600; }
.rec-danger   { background: var(--orange-lt); border-color: #FFAB91; color: #4E1500; }
.rec-critical { background: var(--red-lt);    border-color: #EF9A9A; color: #4A0000; }
.route-summary {
  font-size: 14px; color: var(--text-sub); line-height: 1.6;
  margin-bottom: 1rem; padding: 0.5rem 0;
}
.route-detail-toggle {
  margin-bottom: 1rem; font-size: 13px;
}
.safe-window-hint {
  margin-top: .75rem; padding: .6rem .9rem;
  background: rgba(255,255,255,.45); border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,.08); font-size: 13.5px;
}

/* ── Misc ─────────────────────────────────────────────────── */
.link    { color: var(--accent); text-decoration: none; font-weight: 500; }
.muted   { color: var(--text-muted); font-size: 13px; }
.empty-state { padding: 2.5rem 0; text-align: center; color: var(--text-sub); }
.empty-state p { margin-bottom: 1rem; }
.cta-card { display: flex; align-items: center; justify-content: space-between; }
.cta-card p { color: var(--text-sub); font-size: 14px; }
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 1rem; }
.alert-error { background: var(--red-lt); color: var(--red); border: 1px solid #EF9A9A; }

/* ── Shipment detail hub table ───────────────────────────── */
.hub-date-mobile { display: none; font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ── Admin reports mobile helpers (defaults; overridden in media query below) ── */
.admin-report-mobile-extra { display: none; }
.admin-report-desktop { display: table-cell; }

/* ── Dashboard destination (defaults; short hidden, full shown) ── */
.dest-short { display: none; }
.dest-full  { display: inline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat-card { padding: .75rem 1rem; }
  .stat-val  { font-size: 22px; }
  .stat-lbl  { font-size: 12px; }
  .info-bar  { flex-wrap: wrap; gap: 1rem; }
  .page-header { flex-direction: column; }
  .nav-winery { display: none; }
  .cta-card { flex-direction: column; gap: 1rem; align-items: flex-start; }

  /* ── Mobile nav ── */
  .nav-hamburger {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 28px; height: 20px; background: none; border: none;
    cursor: pointer; padding: 0; z-index: 110;
  }
  .nav-hamburger span {
    display: block; height: 2px; width: 100%;
    background: var(--text-sub); border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  .nav-hamburger.nav-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav-hamburger.nav-open span:nth-child(2) { opacity: 0; }
  .nav-hamburger.nav-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

  .nav-links {
    display: none;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: center; padding: .5rem 1rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    z-index: 105;
  }
  .nav-links.nav-open { display: flex; }
  .nav-link { padding: 10px 12px; font-size: 15px; text-align: center; width: 100%; }

  .nav-user-menu {
    border-left: none; padding-left: 0;
    margin-left: 0; margin-top: 4px;
    border-top: 1px solid var(--border); padding-top: 4px;
    width: 100%;
  }
  .nav-user-btn { font-size: 15px; padding: 10px 12px; width: 100%; justify-content: center; }
  .nav-user-caret { display: none; }
  .nav-dropdown {
    position: static; padding-top: 0;
    display: block; box-shadow: none; border: none;
  }
  .nav-dropdown::before { display: none; }
  .nav-user-menu:hover .nav-dropdown { display: block; }
  .nav-dropdown-item { text-align: center; font-size: 15px; padding: 10px 12px; }

  .nav-logo img { height: 34px !important; }
  .main { padding: 1.25rem 1rem; }

  /* ── Map ── */
  .map-container { height: 380px !important; }
  .leaflet-control-zoom { display: none !important; }
  .day-slider { touch-action: none; }
  .map-card-header { padding: .75rem 1rem .5rem; }
  .map-slider-row { padding: .4rem 1rem .5rem; }

  /* ── Dashboard table ── */
  .dash-col-hide { display: none !important; }
  .dest-full  { display: none; }
  .dest-short { display: inline; }
  /* Column widths: Tracking=auto, Dest=34px, Alerts=88px, Checkbox=48px */
  .dash-table { table-layout: fixed; width: 100%; }
  .dash-table thead th:nth-child(1) { width: auto; white-space: nowrap; font-size: 11px; }
  .dash-table thead th:nth-child(2) { width: 34px; font-size: 11px; }
  .dash-table thead th:nth-child(7) { width: 88px; font-size: 11px; }
  .dash-table thead th:last-child   { width: 48px; }
  .dash-table td:last-child         { text-align: center; }
  .dash-table td:nth-child(1) { word-break: break-word; }
  .dash-table td:nth-child(7) { white-space: nowrap; }

  /* ── Shipment detail hub table ── */
  .hub-col-hide { display: none !important; }
  .hub-table    { table-layout: fixed; width: 100%; }
  .hub-table thead th:nth-child(1) { width: 28px; }
  .hub-table thead th:nth-child(2) { width: auto; }
  .hub-table thead th:nth-child(4) { width: 62px; padding-right: 4px; }
  .hub-table thead th:nth-child(6) { width: 76px; padding-left: 4px; }

  /* ── Admin reports: show mobile extra, hide desktop-only cells ── */
  .admin-report-mobile-extra { display: block !important; }
  .admin-report-desktop { display: none !important; }
}

/* Mobile-only overrides (must come after the 820px block to win) */
@media (max-width: 480px) {
  .map-container { height: 215px !important; }
  .exposure-tooltip-body {
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + 8px);
    transform: none;
    width: 260px;
  }
  .exposure-tooltip-body::after {
    top: 100%;
    right: 6px;
    left: auto;
    transform: none;
    border: 6px solid transparent;
    border-top-color: var(--border);
    border-right-color: transparent;
  }
}

/* Tablet-only: restore columns hidden on mobile */
@media (min-width: 481px) and (max-width: 820px) {
  .tablet-col-show { display: table-cell !important; }
  .dash-actions-cell { display: flex !important; }
  .hub-table { table-layout: auto; }
  .hub-table thead th { width: auto; }
  .dest-full  { display: inline !important; }
  .dest-short { display: none !important; }
  .dash-table { table-layout: auto; }
  .dash-table thead th { width: auto; font-size: 12px; }
  .dash-table td:last-child { text-align: center; }
}

/* ── Dashboard action cell (flex on desktop, hidden on mobile via dash-col-hide) ── */
.dash-actions-cell { display: flex; gap: 6px; align-items: center; }

/* ── Settings page ───────────────────────────────────────── */
.threshold-hints { display: flex; flex-direction: column; gap: 6px; margin-top: 1rem; }
.hint {
  font-size: 13px; color: var(--text-sub);
  padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.hint-active {
  background: var(--accent-lt); border-color: var(--accent);
  color: var(--accent);
}
.badge-cold { background: #E3F2FD; color: #1565C0; }
.badge-heat { background: #FBE9E7; color: #BF360C; }
.temp-cold  { color: #1565C0; font-weight: 500; }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar-form { margin-bottom: 12px; }
.search-bar { display: flex; gap: 8px; align-items: center; }
.search-input {
  flex: 1; max-width: 420px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.search-input:focus { outline: none; border-color: var(--primary); }

/* ── Filter tabs ─────────────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 4px;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { white-space: nowrap; flex-shrink: 0; }
.filter-tab {
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-sub);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
}
.filter-tab:hover { background: var(--bg); text-decoration: none; }
.filter-tab.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
}
.tab-count {
  display: inline-block;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 99px;
  margin-left: 4px;
}

/* ── Batch dropdown & tags ───────────────────────────────── */
/* ── Bulk action bar ─────────────────────────────────────── */
.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--accent-lt);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 13px;
}
.bulk-bar.bulk-bar-visible { display: flex; }
.bulk-count { font-weight: 500; color: var(--accent); }

.batch-select-row {
  margin-bottom: 1rem;
}
.batch-select {
  padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text);
  min-width: 260px; cursor: pointer;
}
.batch-tag {
  display: inline-block;
  font-size: 11px; color: var(--accent);
  background: var(--accent-lt);
  padding: 1px 7px; border-radius: 99px;
  margin-top: 3px; text-decoration: none;
}
.batch-tag:hover { text-decoration: underline; }

.btn-delete {
  background: none; border: none;
  color: var(--text-muted); font-size: 14px;
  cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  line-height: 1;
}
.btn-delete:hover { color: var(--red); background: var(--red-lt); }

/* ── Delete confirmation modal ───────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: .5rem; }
.modal p  { font-size: 14px; color: var(--text-sub); margin-bottom: 1.25rem; line-height: 1.6; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Home page — threshold bands ─────────────────────────── */
.threshold-bands { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.band {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 99px;
}
.band-warn         { background: var(--yellow-lt); color: var(--yellow); }
.band-danger       { background: var(--orange-lt); color: var(--orange); }
.band-critical     { background: var(--red-lt);    color: var(--red); }
.band-cold-warn    { background: #E3F2FD; color: #1565C0; }
.band-cold-danger  { background: #BBDEFB; color: #0D47A1; }
.band-cold-critical{ background: #90CAF9; color: #01579B; }

/* ── Home page — map card ────────────────────────────────── */
.map-card { padding: 0; overflow: hidden; }
.map-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  padding: 1.1rem 1.4rem .75rem;
}
.map-container { height: 520px; width: 100%; background: #cdd8e3; position: relative; overflow: hidden; }
.map-container canvas { border: none !important; outline: none !important; }
.leaflet-overlay-pane canvas { border: none !important; }
.leaflet-layer { border: none !important; outline: none !important; }

.map-slider-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 1.4rem .6rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.day-slider {
  flex: 1; cursor: pointer; accent-color: var(--accent);
}
.slider-edge-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.map-legend {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-sub); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── Home page — news ────────────────────────────────────── */
.news-body {
  font-size: 14px; line-height: 1.8; color: var(--text);
  padding: .25rem 0;
}
/* ── Sortable column headers ─────────────────────────────── */
.sort-link {
  color: inherit; text-decoration: none; white-space: nowrap;
}
.sort-link:hover { color: var(--accent); }
.sort-link.sort-active { color: var(--accent); font-weight: 600; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.pagination-info { font-size: 13px; color: var(--text-sub); }

/* ── Air-only service note ───────────────────────────────── */
.service-note {
  font-size: 11px; color: #1565C0; font-weight: 500;
  margin-top: 2px;
}
.service-note-bar {
  background: #E3F2FD; border: 1px solid #90CAF9;
  color: #1565C0; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px; margin-bottom: 12px;
}
