/* ==========================================================================
   FoodBridge Amsterdam — shared design system
   Sections: reset, tokens, nav, buttons, homepage, dashboard, components
   ========================================================================== */

:root {
  /* Sleek Modern Light Mode (Zinc based) */
  --green-900: #0f172a;
  --green-700: #1e293b;
  --green-600: #334155;
  --green-100: #f1f5f9;
  
  /* Vibrant Accents */
  --blue-600: #3b82f6;   /* Vibrant Blue for Supermarkets */
  --purple-600: #8b5cf6; /* Vibrant Purple for Restaurants */
  --amber-600: #f59e0b;  /* Vibrant Amber/Gold for Hotels (No longer brownish) */
  --earth-600: #10b981;  /* Vibrant Emerald instead of earth brown */
  
  --ink: #09090b;
  --muted: #71717a;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e4e4e7;
  --danger: #ef4444;
  --radius: 8px; /* Modern rounded corners */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Poppins", "Inter", sans-serif;
  --select-chevron: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

:root[data-theme="dark"] {
  /* Sleek Modern Dark Mode (Zinc based) */
  --green-100: #1e293b;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --bg: #09090b; /* Deep Zinc Black */
  --card: #18181b; /* Dark Zinc Card */
  --border: #27272a;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --select-chevron: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

:root[data-theme="dark"] .site-nav { background: rgba(9, 9, 11, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] th { background: #18181b; }
:root[data-theme="dark"] .table-filters input,
:root[data-theme="dark"] #surplusForm input,
:root[data-theme="dark"] .input-toggle-btn,
:root[data-theme="dark"] .table-pagination button { background-color: var(--card); color: var(--ink); border-color: var(--border); }

:root[data-theme="dark"] .table-filters select,
:root[data-theme="dark"] #surplusForm select,
:root[data-theme="dark"] .global-filter select,
:root[data-theme="dark"] .site-nav .role-select {
  background-color: var(--card);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}
:root[data-theme="dark"] .demo-controls button { background: transparent; border-color: var(--border); color: var(--muted); }
:root[data-theme="dark"] .demo-controls button:hover { background: var(--border); color: var(--ink); }
:root[data-theme="dark"] .trust-banner { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); color: #93c5fd; }
:root[data-theme="dark"] .trust-banner-text strong { color: #bfdbfe; }
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip { background-color: var(--card); color: var(--ink); }
:root[data-theme="dark"] .facility-label { background: rgba(26, 26, 26, 0.92); color: var(--ink); }
:root[data-theme="dark"] th { color: var(--ink); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 10px; }
p { margin: 0 0 12px; color: var(--muted); }
a { color: var(--green-700); }
img, svg { max-width: 100%; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav .brand .logo-mark {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--green-600), var(--blue-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.site-nav .nav-links { display: flex; gap: 22px; align-items: center; }
.site-nav .nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}
.site-nav .nav-links a.active, .site-nav .nav-links a:hover { color: var(--green-700); }
.site-nav .nav-cta {
  background: var(--green-700);
  color: white !important;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600 !important;
}
.site-nav .role-select {
  background-color: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 6px 30px 6px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  transition: all 0.2s;
}
.site-nav .role-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.site-nav .role-select:hover { border-color: #2563eb; }
.site-nav .btn-nav-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 7px 15px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}
.site-nav .btn-nav-outline:hover { background: white; }
.site-nav .session-chip {
  font-size: 0.78rem;
  color: var(--muted);
}
.site-nav .session-chip:empty { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-900); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card); border-color: var(--muted); }
.btn-secondary { background: #fbeaea; color: var(--danger); border: none; }
.btn-block { width: 100%; justify-content: center; }

/* ================================================================
   HOMEPAGE
   ================================================================ */
.hero {
  padding: 74px 32px 60px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(42,138,82,0.10), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(47,111,235,0.10), transparent 45%);
}
.hero .eyebrow {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-700);
  padding: 5px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  max-width: 900px;
  margin: 0 auto 16px;
}
.hero .lede {
  max-width: 660px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 32px;
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head .eyebrow {
  color: var(--green-700); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-tile .num { font-size: 2rem; font-weight: 800; color: var(--green-700); font-family: var(--font-head); }
.stat-tile .cap { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.stat-tile .src { font-size: 0.7rem; color: #9aa79a; margin-top: 10px; display: block; }
.stat-tile .src a { color: #9aa79a; }

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  position: relative;
}
.flow-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.flow-card .step-no {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-700); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; margin-bottom: 12px;
}
.flow-card h3 { font-size: 1.02rem; }
.flow-card p { font-size: 0.88rem; margin: 0; }
.flow-card .branch-edible { color: var(--green-700); font-weight: 600; }
.flow-card .branch-inedible { color: var(--earth-600); font-weight: 600; }

.tech-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tech-badge {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.tech-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); }
.tech-badge.stub .dot { background: #cfc6a8; }

.reg-callout {
  background: #fff8ea;
  border: 1px solid #f0dfa8;
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 0.92rem;
  color: #5c4a12;
}
.reg-callout strong { color: #3d3009; }

.home-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: white;
  border-radius: var(--radius);
  padding: 48px 32px;
  margin: 0 32px 64px;
}
.home-cta h2 { color: white; }
.home-cta p { color: #d9ecdc; max-width: 560px; margin: 0 auto 24px; }
.home-cta .btn-primary { background: white; color: var(--green-800, var(--green-900)); }
.home-cta .btn-primary:hover { background: #eee; }

.site-footer {
  padding: 28px 32px 40px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.dash-header {
  padding: 18px 32px 6px;
}
.dash-header h1 { font-size: 1.4rem; margin-bottom: 2px; }
.dash-header .sub { font-size: 0.88rem; color: var(--muted); }
.demo-tag {
  display: inline-block;
  background: #fff3d6;
  color: #8a6a1d;
  border-radius: var(--radius);
  padding: 1px 8px;
  font-size: 0.72rem;
  margin-left: 6px;
  vertical-align: middle;
}

.stats-bar { padding: 14px 32px; }
.stats-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: #9aa79a;
  margin-bottom: 8px;
}
.global-filter { display: inline-flex; align-items: center; gap: 6px; }
.global-filter select {
  padding: 4px 30px 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--font-body);
  background-color: var(--card);
  color: var(--muted);
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.global-filter select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.stats-bar-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  min-width: 150px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.stat-card .stat-icon { position: absolute; top: 10px; right: 12px; font-size: 0.9rem; opacity: 0.6; display: block; }
.stat-card span:not(.stat-icon) { display: block; font-size: 1.5rem; font-weight: 800; color: var(--green-700); font-family: var(--font-head); }
.stat-card label { font-size: 0.76rem; color: var(--muted); }
.stat-trend { display: block; font-size: 0.72rem; margin-top: 3px; font-weight: 600; }
.stat-trend.up { color: var(--green-700); }
.stat-trend.down { color: var(--danger); }
.stat-trend:empty { display: none; }

.trust-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 10px 32px 0;
  padding: 10px 16px;
  background: #fff8ea;
  border: 1px solid #f0dfa8;
  border-radius: var(--radius);
  font-size: 0.78rem;
  color: #5c4a12;
}
.trust-banner-text strong { color: #3d3009; margin-right: 4px; }
.trust-banner-text strong:not(:first-child) { margin-left: 10px; }
.trust-banner #dismissBannerBtn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #8a6a1d;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 2px;
  line-height: 1;
}
.trust-banner #dismissBannerBtn:hover { color: #3d3009; }
.trust-banner.hidden { display: none; }

/* ---------- Filter chip row (Oasis-inspired) ---------- */
.chip-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 32px 14px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.filter-chip:hover { border-color: var(--green-600); }
.filter-chip.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: white;
  font-weight: 600;
}
.filter-chip.chip-urgent.active { background: var(--danger); border-color: var(--danger); }

/* ---------- Map List/Map view toggle ---------- */
.map-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-toggle-btn {
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border: none;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.view-toggle-btn.active { background: var(--green-700); color: white; }

/* ---------- Card-list view (Oasis-inspired: icon, name, address, tags, dot+kg+time) ---------- */
.records-card-list { display: flex; flex-direction: column; gap: 10px; }
.records-card-list.mobile-only { display: none; }
.record-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow 0.12s ease;
}
.record-card:hover { box-shadow: var(--shadow-sm); }
.record-card.urgent { border-left-color: var(--danger); }
.record-card .record-card-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.record-card .record-card-main { flex: 1; min-width: 0; }
.record-card .record-card-name { font-weight: 700; font-size: 0.92rem; }
.record-card .record-card-address { font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
.record-card .record-card-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.record-card .record-card-side { text-align: right; flex-shrink: 0; }
.record-card .record-card-kg { font-weight: 700; font-size: 0.92rem; }
.record-card .record-card-time { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.record-card .record-card-status { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }

/* ---------- Per-source detail drill-down panel ---------- */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 51, 33, 0.35);
  display: flex;
  justify-content: flex-end;
  z-index: 300;
}
.detail-overlay.hidden { display: none; }
.detail-panel {
  width: min(420px, 100%);
  height: 100%;
  background: var(--card);
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: detail-slide-in 0.18s ease;
}
@keyframes detail-slide-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }
.detail-close {
  position: absolute;
  top: 18px; right: 18px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
}
.detail-close:hover { color: var(--ink); }
.detail-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; padding-right: 28px; }
.detail-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.detail-title { font-size: 1.15rem; font-weight: 800; font-family: var(--font-head); }
.detail-subtitle { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.detail-status-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.detail-section { margin-bottom: 20px; }
.detail-section-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.detail-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-stat-tile { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.detail-stat-tile .num { font-size: 1.3rem; font-weight: 800; color: var(--green-700); font-family: var(--font-head); }
.detail-stat-tile label { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.detail-records-list { font-size: 0.82rem; color: var(--muted); }
.detail-records-list .drow { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.detail-records-list .drow:last-child { border-bottom: none; }

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  padding: 0 32px 32px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0; /* grid items default to min-width:auto, which lets wide flex
    content (e.g. .record-card rows) blow out the grid track instead of
    wrapping/shrinking to fit — this is the standard fix. */
}
.panel h2 { margin-top: 0; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.panel h2 small { font-weight: 400; color: var(--muted); font-size: 0.75rem; }

.intake-panel { grid-row: span 2; }
.map-panel { grid-column: 2; }
.forecast-panel { grid-column: 2; }
.dashboard-panel { grid-column: 1 / -1; }

#surplusForm label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 500;
}
#surplusForm label.checkbox { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
#surplusForm input[type="text"],
#surplusForm input[type="number"],
#surplusForm input[type="password"],
#surplusForm select {
  width: 100%;
  padding: 9px 12px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font-body);
  background-color: var(--card);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
#surplusForm select {
  padding-right: 32px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  cursor: pointer;
}
#surplusForm select:hover {
  border-color: #3b82f6;
}
#surplusForm input[type="text"]:focus,
#surplusForm input[type="number"]:focus,
#surplusForm input[type="password"]:focus,
#surplusForm select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
#surplusForm input.invalid { border-color: var(--danger); }
#surplusForm input.invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
#surplusForm button[disabled] { opacity: 0.55; cursor: not-allowed; }
.required-mark { color: var(--danger); font-weight: 700; }
.field-error { display: block; color: var(--danger); font-size: 0.74rem; margin-top: 3px; font-weight: 400; }
.field-error[hidden] { display: none; }

/* Skeleton loader -- shows a shimmering placeholder block instead of blank
   space or a static "Loading..." string while an async widget (weather,
   events) fetches. Text stays in the DOM (for layout/measurement) but is
   painted transparent so only the shimmer shows. */
.skeleton-text {
  display: inline-block;
  min-width: 110px;
  height: 1em;
  border-radius: 4px;
  color: transparent !important;
  background: linear-gradient(90deg, var(--border) 25%, var(--card) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-text { animation: none; background-position: 0 0; }
}

/* Data-provenance badges -- small inline indicator next to a panel/widget
   header showing whether what it displays is a live API call, a simulated
   device/process, or a static illustrative dataset. Reuse this one class
   pair everywhere instead of a new ad-hoc label per panel. */
.provenance-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.5;
  vertical-align: middle;
}
.provenance-live { background: rgba(34, 117, 75, 0.15); color: var(--green-700); }
.provenance-simulated { background: rgba(181, 154, 90, 0.18); color: var(--amber-600); }
.provenance-demo { background: rgba(100, 116, 139, 0.16); color: var(--muted); }
:root[data-theme="dark"] .provenance-live { background: rgba(16, 185, 129, 0.18); }
:root[data-theme="dark"] .provenance-simulated { background: rgba(245, 158, 11, 0.2); }
:root[data-theme="dark"] .provenance-demo { background: rgba(156, 163, 175, 0.18); }

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  cursor: help;
  margin-left: 4px;
}
.info-icon:hover, .info-icon:focus { background: var(--green-600); color: white; outline: none; }

.input-with-toggle { display: flex; gap: 6px; align-items: stretch; }
.input-with-toggle input { flex: 1; }
.input-toggle-btn {
  flex-shrink: 0;
  margin-top: 3px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius);
  padding: 0 10px;
  cursor: pointer;
  font-size: 0.9rem;
}
.input-toggle-btn:hover { background: #f0f2ee; }
.unit-select {
  flex-shrink: 0;
  width: auto !important;
  margin-top: 3px;
  padding: 7px 6px !important;
}

.map-fit-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 0.74rem;
  border-radius: var(--radius);
}
.pms-connect-row {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.pms-connect-row button {
  flex: 1;
  min-width: 130px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.pms-connect-row button:hover {
  border-color: var(--blue-600);
  color: var(--blue-600);
}

.automation-subsection { margin-top: 18px; }
.automation-subsection:first-of-type { margin-top: 10px; }
.automation-subsection h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 8px;
  font-weight: 700;
}
.auto-toggle-row { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; margin: 6px 0 4px; }
.sensor-status-row { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sensor-status-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--card);
}
.sensor-status-card strong { font-size: 0.85rem; }
.sensor-status-card .sub { font-size: 0.75rem; color: var(--muted); margin: 2px 0; }
.sensor-status-card .sensor-last { font-size: 0.75rem; }

.demo-controls { display: flex; gap: 8px; margin-top: 14px; }
.demo-controls button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}
.demo-controls button:hover {
  background: var(--border);
  color: var(--ink);
}

details.settings-panel {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.82rem;
  background: #fbfcfa;
}
details.settings-panel summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.settings-panel label { margin-top: 10px; }
.ai-status { font-size: 0.74rem; margin-top: 6px; }
.ai-status.on { color: var(--green-700); }
.ai-status.off { color: var(--muted); }

#map { height: 440px; border-radius: var(--radius); isolation: isolate; }
#map .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 34px; font-size: 18px; }
.legend {
  font-size: 0.82rem;
  color: var(--ink);
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.legend > summary { font-weight: 600; }
.legend[open] > summary { margin-bottom: 8px; padding-bottom: 0; border-bottom: none; }
.legend-body { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .item { display: inline-flex; align-items: center; gap: 5px; }
.legend .legend-toggle { cursor: pointer; }
.legend .legend-toggle input { margin: 0; cursor: pointer; }
.legend-caption { flex-basis: 100%; font-size: 0.74rem; color: var(--muted); }
.facility-label {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: none !important;
}
.facility-label::before { display: none; }
.dot-sample { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.line-sample { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--green-600); vertical-align: middle; }
.line-sample.inedible { border-top-color: var(--earth-600); }
.line-sample.dashed { border-top-style: dashed; border-top-color: #999; }

.forecast-panel .note { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.weather-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef3fe; color: var(--blue-600);
  border-radius: var(--radius); padding: 4px 12px; font-size: 0.78rem; margin-bottom: 10px;
}

.table-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.table-filters input,
.table-filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: var(--font-body);
  background: var(--card);
  color: var(--ink);
  transition: all 0.2s;
}
.table-filters select {
  padding-right: 32px;
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
.table-filters input:focus,
.table-filters select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.table-filters input { flex: 1; min-width: 160px; }
.table-filters .btn-secondary { padding: 8px 12px; font-size: 0.8rem; border-radius: var(--radius); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f0f2ee; position: sticky; top: 0; font-weight: 600; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--green-700); }
th[data-sort] .sort-arrow { margin-left: 4px; color: var(--green-700); }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.table-pagination button {
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.8rem;
}
.table-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.table-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  z-index: 200;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
tr.row-edible td:first-child { border-left: 3px solid var(--green-600); }
tr.row-inedible td:first-child { border-left: 3px solid var(--earth-600); }
tr.record-row { cursor: pointer; }
tr.record-row:hover { background: var(--green-100); }
tr.detail-row td { background: #fbfcfa; font-size: 0.8rem; color: var(--muted); }
tr.detail-row.hidden { display: none; }
.expand-hint { color: #9aa79a; font-size: 0.72rem; }

.row-chevron {
  display: inline-block;
  margin-right: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}
.row-chevron.expanded { transform: rotate(90deg); }

tr.row-highlight { animation: row-flash 2.2s ease; }
@keyframes row-flash {
  0% { background: var(--green-100); }
  70% { background: var(--green-100); }
  100% { background: transparent; }
}

.status-col { width: 22px; padding: 9px 4px !important; text-align: center; }
.freshness-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.relative-time { color: var(--muted); font-weight: 400; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.01em;
}
.badge-edible { background: var(--green-600); }
.badge-inedible { background: var(--earth-600); }
.badge-inedible-urgent { background: var(--danger); }
.source-name-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.source-name-link:hover { color: var(--green-700); }
.badge-supermarket { background: var(--blue-600); }
.badge-restaurant { background: var(--purple-600); }
.badge-hotel { background: var(--amber-600); }
.badge-fridge { background: #0d9488; }
.badge-ai { background: #17201b; }

/* ---------- Toasts ---------- */
#toastContainer {
  position: fixed;
  top: 80px; right: 20px; bottom: auto;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--green-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  max-width: 320px;
  animation: toast-in 0.2s ease;
}
.toast.warn { background: #7a4a12; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.facility-icon { font-size: 20px; text-align: center; }

.app-footer, .site-footer { padding-bottom: 30px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .intake-panel { grid-row: auto; }
  .map-panel, .forecast-panel, .dashboard-panel { grid-column: 1; }
  .stat-grid, .flow-grid { grid-template-columns: 1fr; }
  .site-nav { flex-wrap: wrap; row-gap: 8px; }
  .site-nav .nav-links { gap: 12px; flex-wrap: wrap; }
}

/* Stack the processed-records table into label:value cards below 768px —
   a 7-column table has no room to be legible on a phone. Label stacked
   above value (not side-by-side flex) because cell content mixes badges,
   <br>, and bare text nodes that flex-with-space-between distributes
   unpredictably. */
@media (max-width: 768px) {
  .desktop-only { display: none; }
  .records-card-list.mobile-only { display: flex; }
  .panel h2 { flex-wrap: wrap; }
  .map-header-actions { width: 100%; justify-content: space-between; }

  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr.record-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  tr.row-edible, tr.row-inedible { border-left-width: 1px; }
  tr.row-edible td:first-child, tr.row-inedible td:first-child { border-left: none; }
  tr.record-row td.status-col { display: none; } /* shown via the card-list view instead, below 768px */
  tr.record-row td {
    border-bottom: 1px dashed var(--border);
    padding: 7px 0;
  }
  tr.record-row td:last-child { border-bottom: none; }
  tr.record-row td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 3px;
  }
  tr.detail-row td { display: block; }

  /* UX audit fix: .bottom-dock (stats | forecast) had no override at this
     breakpoint at all -- the only pre-existing responsive rule here
     targeted .layout/.map-panel, class names that don't exist anywhere in
     the current markup (leftover from an earlier layout iteration), so it
     never actually applied. A fixed 2-column grid clamped to 220-300px
     tall was squeezing 6 stat cards into unreadably narrow columns with
     wrapped/overlapping text.
     Fix: stack the two dock panels, but cap the stack's total height
     (rather than height:auto/unbounded) and let it scroll internally --
     .app-container/body are `overflow:hidden` app-shell-wide (not just at
     this breakpoint), so an unbounded stack here would squeeze the map
     above it down to near-nothing instead of the stats/forecast content
     just scrolling into view. */
  .bottom-dock {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(180px, auto);
    height: auto;
    max-height: 55vh;
    min-height: 0;
    overflow-y: auto;
  }
  .dock-stats .stats-bar-cards { grid-template-columns: repeat(2, 1fr); }
}


/* ==========================================================================
   WORLD MONITOR DASHBOARD OVERRIDES
   ========================================================================== */

/* Add specific tactical dark mode variables that adapt properly */
:root {
  --overlay-bg: rgba(255, 255, 255, 0.95);
  --map-filter: none;
}

:root[data-theme="dark"] {
  --bg: #0F1115;
  --card: #1A1D24;
  --border: #2D323E;
  --ink: #F3F4F6;
  --muted: #9CA3AF;
  --green-700: #10B981;
  --green-900: #047857;
  --green-600: #34D399;
  --danger: #F43F5E;
  --amber-600: #F59E0B;
  --blue-600: #3B82F6;
  --overlay-bg: rgba(21, 24, 33, 0.92);
  --map-filter: brightness(0.95) contrast(1.05);
}

body {
  margin: 0;
  overflow: hidden; /* App-like */
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Main Workspace */
.main-workspace {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0; /* Critical: allows flex children to shrink below content size */
}

.map-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 0;
  filter: var(--map-filter);
}

/* Floating Panels Theme adaptation */
.map-overlay-header {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  max-width: 320px;
  z-index: 50;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.map-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 280px !important;
  max-width: 100% !important;
  z-index: 50;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  color: var(--ink);
  margin: 0;
  box-shadow: var(--shadow-md);
  font-size: 0.65rem;
  padding: 4px 8px;
}
.map-legend .legend-body {
  gap: 6px 10px;
}
.map-legend .legend-caption {
  font-size: 0.6rem;
  margin-top: 2px !important;
}
/* Animated flow paths for map routes */
.animated-flow-path {
  stroke-dasharray: 8, 12 !important;
  animation: flowAnimation 1.5s linear infinite;
}
@keyframes flowAnimation {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 40; }
}
.floating-left-panel h2 { color: var(--ink); }

/* Custom Scrollbar */
.floating-left-panel::-webkit-scrollbar, .dock-panel::-webkit-scrollbar { width: 6px; }
.floating-left-panel::-webkit-scrollbar-track, .dock-panel::-webkit-scrollbar-track { background: transparent; }
.floating-left-panel::-webkit-scrollbar-thumb, .dock-panel::-webkit-scrollbar-thumb { background: var(--muted); border-radius: var(--radius); }

/* Bottom Dock - Increased height to fix squishing */
.bottom-dock {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
  flex-shrink: 0;
  height: 35vh;
  min-height: 280px;
  max-height: 380px;
  margin-bottom: 0;
  z-index: 100;
}

.dock-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.dock-stats, .dock-forecast, .dock-table { padding: 0; }
.dock-stats .stats-bar { padding: 12px; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.dock-stats .stats-bar-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.dock-stats .stat-card {
  background: rgba(125,125,125,0.05);
  border-color: var(--border);
  min-width: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dock-stats .stat-card span:not(.stat-icon) { font-size: 1rem; font-weight: 600; line-height: 1.2; }

.dock-forecast .forecast-panel {
  padding: 16px; border: none; background: transparent; box-shadow: none; flex: 1; display: flex; flex-direction: column; margin: 0;
}


.dock-forecast canvas { flex: 1; max-height: 100%; min-height: 120px; }

.trust-banner.compact {
  margin: 0; border-radius: 0; border-left: none; border-right: none;
  font-size: 0.75rem; padding: 4px 16px;
  background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: var(--muted);
}

/* Collapsible Panel Fixes */
.collapsible-panel summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none;
}
.collapsible-panel summary::-webkit-details-marker { display: none; }
.collapsible-panel summary::before {
  content: '▸'; display: inline-block; font-size: 1.2rem; transition: transform 0.2s; color: var(--blue-600);
}
.collapsible-panel[open] > summary::before { transform: rotate(90deg); }
.collapsible-panel[open] > summary {
  border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px;
}
.map-header-details { min-width: 200px; }
.panel-inner-content { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Modal Styles */
.records-modal {
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  padding: 16px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}
.records-modal::backdrop {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}
.records-modal .modal-header { display: flex; justify-content: flex-end; margin-bottom: 0px; }
.records-modal .dock-table { height: calc(100% - 40px); background: transparent; border: none; }
.records-modal .dock-table .dashboard-panel { height: 100%; margin: 0; }
.records-modal .table-wrap { flex: 1; overflow-y: auto; }

/* Ensure select and inputs contrast properly */
:root[data-theme="dark"] #surplusForm input, 
:root[data-theme="dark"] #surplusForm select, 
:root[data-theme="dark"] .settings-panel, 
:root[data-theme="dark"] .table-filters input, 
:root[data-theme="dark"] .table-filters select {
  background-color: rgba(0,0,0,0.2) !important;
  border-color: #374151 !important;
  color: #f3f4f6 !important;
}

/* Time Filters */
.map-time-filters {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.map-time-filters label {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
  transition: all 0.2s;
  user-select: none;
}
.map-time-filters input[type="radio"] {
  display: none;
}
.map-time-filters input[type="radio"]:checked + span,
.map-time-filters label:has(input[type="radio"]:checked) {
  background: var(--blue-600);
  color: #fff;
}

/* Forecast Panel Redesign */
.forecast-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.forecast-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.live-indicator {
  width: 8px;
  height: 8px;
  background-color: #ff3b30;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #ff3b30;
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
.forecast-header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}
.forecast-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.f-metric {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
html[data-theme="light"] .f-metric {
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.05);
}
.fm-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.fm-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.highlight-metric {
  background: rgba(255, 59, 48, 0.1) !important;
  border-color: rgba(255, 59, 48, 0.3) !important;
}
.highlight-metric .fm-val {
  color: #ff3b30;
}
html[data-theme="light"] .highlight-metric .fm-val {
  color: #d70015;
}
.fm-sub {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 2px;
}
.metric-flash {
  animation: metricFlash 1.5s ease-out;
}
@keyframes metricFlash {
  0% { background: rgba(16, 185, 129, 0.4); border-color: rgba(16, 185, 129, 0.8); }
  100% { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
}
html[data-theme="light"] .metric-flash {
  animation: metricFlashLight 1.5s ease-out;
}
@keyframes metricFlashLight {
  0% { background: rgba(34, 197, 94, 0.3); border-color: rgba(34, 197, 94, 0.8); }
  100% { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.05); }
}
