/* Panafrican Business Intelligence dashboard — self-contained skin.
 *
 * The page loads only this stylesheet plus the vendored MapLibre CSS. Tokens
 * mirror the Intelligence Center palette so the module reads as part of the
 * same product without depending on styles.css or redesign.css.
 */

:root {
  --bi-bg: #03080e;
  --bi-bg-2: #071320;
  --bi-panel: rgba(7, 19, 31, 0.92);
  --bi-panel-solid: #0a1725;
  --bi-line: rgba(36, 215, 255, 0.16);
  --bi-line-strong: rgba(36, 215, 255, 0.34);
  --bi-text: #e8f4fb;
  --bi-dim: #93b2c4;
  --bi-faint: #5c7d91;
  --bi-cyan: #00e5ff;
  --bi-blue: #4d8bff;
  --bi-gold: #ffc84a;
  --bi-green: #36ef9b;
  --bi-amber: #ff9d36;
  --bi-red: #ff5566;
  --bi-violet: #b98bff;
  --bi-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --bi-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --bi-radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 22% 12%, rgba(0, 190, 255, 0.06), transparent 58%),
    radial-gradient(1100px 800px at 82% 90%, rgba(255, 200, 74, 0.04), transparent 52%),
    radial-gradient(1400px 900px at 50% 45%, rgba(0, 80, 120, 0.35), transparent 62%),
    var(--bi-bg);
  color: var(--bi-text);
  font-family: var(--bi-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: rgba(3, 12, 22, 0.6); }
*::-webkit-scrollbar-thumb { background: rgba(36, 215, 255, 0.24); border-radius: 8px; border: 2px solid rgba(3, 12, 22, 0.9); }
*::-webkit-scrollbar-thumb:hover { background: rgba(36, 215, 255, 0.42); }
* { scrollbar-width: thin; scrollbar-color: rgba(36, 215, 255, 0.28) rgba(3, 12, 22, 0.55); }

.bi-shell {
  max-width: 1760px;
  margin: 0 auto;
  padding: 16px clamp(12px, 2vw, 26px) 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100dvh;
}

/* ── top bar ─────────────────────────────────────────────────────────── */

.bi-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(9, 21, 33, 0.97), rgba(4, 10, 17, 0.96));
  border: 1px solid var(--bi-line);
  border-radius: var(--bi-radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
}

.bi-brand { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.bi-brand-mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--bi-line-strong);
  background: radial-gradient(circle at 32% 28%, #12324d, #071a2a);
  color: var(--bi-cyan);
  font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}
.bi-brand-text b { display: block; font-size: 15px; letter-spacing: 2.4px; }
.bi-brand-text span { display: block; font-size: 10px; letter-spacing: 2px; color: var(--bi-faint); text-transform: uppercase; margin-top: 2px; }

.bi-topbar-spacer { flex: 1 1 auto; }

.bi-topbar-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bi-user { font-size: 11px; color: var(--bi-dim); }
.bi-user b { color: var(--bi-text); font-weight: 600; }
.bi-nav-link {
  font-size: 11px; letter-spacing: 1.2px; text-decoration: none;
  color: var(--bi-cyan); padding: 6px 11px; border-radius: 8px;
  border: 1px solid var(--bi-line); transition: 0.15s ease;
}
.bi-nav-link:hover { background: rgba(0, 229, 255, 0.1); border-color: var(--bi-line-strong); }

.bi-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--bi-dim); }
.bi-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--bi-green); box-shadow: 0 0 9px var(--bi-green); }
.bi-status.is-live i { background: var(--bi-cyan); box-shadow: 0 0 9px var(--bi-cyan); animation: bi-pulse 1.6s infinite ease-in-out; }
.bi-status.is-error { color: var(--bi-red); }
.bi-status.is-error i { background: var(--bi-red); box-shadow: 0 0 9px var(--bi-red); }
@keyframes bi-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── KPIs ────────────────────────────────────────────────────────────── */

.bi-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }

.bi-kpi {
  position: relative;
  padding: 14px 15px 16px;
  border: 1px solid var(--bi-line);
  border-radius: var(--bi-radius);
  background: linear-gradient(165deg, rgba(11, 25, 38, 0.95), rgba(4, 11, 18, 0.93));
  box-shadow: inset 0 0 26px rgba(0, 229, 255, 0.03);
  overflow: hidden;
}
.bi-kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bi-accent, var(--bi-cyan)); opacity: 0.9; }
.bi-kpi-cyan { --bi-accent: var(--bi-cyan); }
.bi-kpi-green { --bi-accent: var(--bi-green); }
.bi-kpi-gold { --bi-accent: var(--bi-gold); }
.bi-kpi-blue { --bi-accent: var(--bi-blue); }
.bi-kpi-violet { --bi-accent: var(--bi-violet); }
.bi-kpi-label { display: block; font-size: 9px; letter-spacing: 1.9px; color: var(--bi-faint); text-transform: uppercase; }
.bi-kpi-value { display: block; font-size: 27px; font-weight: 700; margin: 6px 0 3px; text-shadow: 0 0 16px rgba(0, 229, 255, 0.18); }
.bi-kpi-sub { display: block; font-size: 10.5px; color: var(--bi-dim); }
.bi-kpi-meter { display: block; height: 3px; margin-top: 11px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bi-kpi-meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--bi-accent), rgba(255, 255, 255, 0.25)); }

/* ── main workspace ──────────────────────────────────────────────────── */

.bi-main {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 356px;
  gap: 12px;
  align-items: stretch;
}

.bi-panel,
.bi-sidebar,
.bi-map-panel,
.bi-detail {
  border: 1px solid var(--bi-line);
  border-radius: var(--bi-radius);
  background: var(--bi-panel);
  box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.025), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.bi-sidebar { padding: 15px; display: flex; flex-direction: column; gap: 13px; overflow: auto; max-height: 760px; }

.bi-section-label { font-size: 9.5px; letter-spacing: 2.2px; color: var(--bi-faint); text-transform: uppercase; }
.bi-field { display: flex; flex-direction: column; gap: 5px; }
.bi-field > span { font-size: 9.5px; letter-spacing: 1.5px; color: var(--bi-faint); text-transform: uppercase; }
.bi-field input,
.bi-field select {
  width: 100%;
  background: #0b1c2c;
  border: 1px solid var(--bi-line);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 12.5px;
  min-height: 38px;
}
.bi-field input:focus, .bi-field select:focus { outline: none; border-color: var(--bi-cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14); }
.bi-field select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2300e5ff' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }

.bi-btn {
  width: 100%;
  border: 1px solid var(--bi-line);
  background: linear-gradient(180deg, #16314c, #0e2236);
  color: var(--bi-cyan);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 11px;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: 0.15s ease;
}
.bi-btn:hover { border-color: var(--bi-line-strong); box-shadow: 0 0 14px rgba(0, 229, 255, 0.15); }

.bi-hint { font-size: 10.5px; color: var(--bi-faint); line-height: 1.5; margin: 0; }
.bi-note { font-size: 10px; color: var(--bi-faint); line-height: 1.55; margin: 10px 0 0; }

.bi-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-filter-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--bi-line-strong); background: rgba(0, 229, 255, 0.1);
  color: var(--bi-text); border-radius: 999px; padding: 5px 7px 5px 11px;
  font-size: 10.5px; cursor: pointer;
}
.bi-filter-chip span { color: var(--bi-cyan); font-size: 10px; }
.bi-filter-chip:hover { background: rgba(0, 229, 255, 0.18); }

.bi-sidebar-links { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--bi-line); display: flex; flex-direction: column; gap: 6px; }
.bi-sidebar-links a { font-size: 11px; color: var(--bi-dim); text-decoration: none; }
.bi-sidebar-links a:hover { color: var(--bi-cyan); }

/* ── map ─────────────────────────────────────────────────────────────── */

.bi-map-panel { position: relative; overflow: hidden; min-height: 540px; }
#biMap { position: absolute; inset: 0; background: #04101a; }
.bi-map-panel .maplibregl-ctrl { filter: saturate(0.6) brightness(0.9); }

.bi-map-overlay { position: absolute; z-index: 6; pointer-events: none; }
.bi-map-head { top: 12px; left: 14px; display: flex; flex-direction: column; gap: 3px; }
.bi-map-head b { font-size: 12.5px; letter-spacing: 1.4px; }
.bi-map-head small { font-size: 10px; color: var(--bi-dim); }
.bi-map-attribution a { pointer-events: auto; color: inherit; text-decoration: underline; }
.bi-map-legend {
  left: 13px; bottom: 13px;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(3, 11, 18, 0.86);
  border: 1px solid var(--bi-line); border-radius: 10px;
  padding: 9px 12px; font-size: 10px; color: var(--bi-dim);
  pointer-events: none;
}
.bi-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.bi-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.bi-dot-contact { background: #22d3ee; box-shadow: 0 0 8px rgba(34, 211, 238, 0.7); }
.bi-dot-gap { background: #ffb020; box-shadow: 0 0 8px rgba(255, 176, 32, 0.7); }
.bi-dot-selected { background: transparent; border: 2px solid var(--bi-gold); }

.bi-map-status {
  left: 50%; top: 12px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(3, 11, 18, 0.86);
  border: 1px solid var(--bi-line); border-radius: 8px;
  padding: 7px 11px; font-size: 10px; color: var(--bi-dim);
  pointer-events: none;
}
.bi-map-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--bi-cyan); box-shadow: 0 0 8px var(--bi-cyan); }
.bi-map-status.is-live i { background: var(--bi-green); box-shadow: 0 0 8px var(--bi-green); }
.bi-map-status.is-degraded i, .bi-map-status.is-unavailable i { background: var(--bi-amber); box-shadow: 0 0 8px var(--bi-amber); }
.bi-map-status.is-error i { background: var(--bi-red); }

.bi-map-fallback {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  background: rgba(3, 10, 16, 0.92); text-align: center; padding: 24px;
  font-size: 12px; color: var(--bi-dim); line-height: 1.6;
}

/* ── detail ──────────────────────────────────────────────────────────── */

.bi-detail { padding: 16px; overflow: auto; max-height: 760px; }
.bi-detail-empty b { display: block; font-size: 13px; letter-spacing: 1.4px; margin-bottom: 10px; }
.bi-detail-empty p { font-size: 12px; color: var(--bi-dim); line-height: 1.6; }
.bi-detail-empty ul { margin: 10px 0 0; padding-left: 18px; font-size: 11.5px; color: var(--bi-faint); line-height: 1.8; }

.bi-detail-head { display: flex; gap: 12px; align-items: flex-start; }
.bi-detail-thumb { width: 62px; height: 62px; flex: 0 0 62px; object-fit: cover; border-radius: 10px; border: 1px solid var(--bi-line); }
.bi-detail-kicker { font-size: 9.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--bi-cyan); }
.bi-detail-head h2 { font-size: 17px; margin: 4px 0 8px; line-height: 1.25; }
.bi-detail-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.bi-badge { font-size: 9.5px; padding: 3px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--bi-line); color: var(--bi-dim); }
.bi-badge.is-ok { color: var(--bi-green); border-color: rgba(54, 239, 155, 0.4); }
.bi-badge.is-warn { color: var(--bi-amber); border-color: rgba(255, 157, 54, 0.4); }

.bi-detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.bi-action {
  font-size: 10.5px; letter-spacing: 0.6px; text-decoration: none;
  border: 1px solid var(--bi-line); background: rgba(7, 22, 35, 0.8);
  color: var(--bi-text); border-radius: 8px; padding: 7px 10px; cursor: pointer; transition: 0.15s ease;
}
.bi-action:hover { border-color: var(--bi-line-strong); background: rgba(12, 40, 58, 0.9); }
.bi-action-primary { border-color: var(--bi-line-strong); color: var(--bi-cyan); }

.bi-detail-desc { font-size: 11.5px; color: var(--bi-dim); line-height: 1.65; margin: 4px 0 14px; }

.bi-info-grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--bi-line); }
.bi-info-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(36, 215, 255, 0.08); font-size: 11.5px; }
.bi-info-row span { color: var(--bi-faint); }
.bi-info-row b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }

.bi-provenance { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--bi-line); }
.bi-provenance .bi-info-row b { font-family: var(--bi-mono); font-size: 10.5px; }

/* ── lower grid ──────────────────────────────────────────────────────── */

.bi-lower { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) minmax(0, 1fr); gap: 12px; align-items: start; }

.bi-panel { display: flex; flex-direction: column; }
.bi-panel-head { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--bi-line); flex-wrap: wrap; }
.bi-panel-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bi-panel-body { padding: 13px 15px; }

.bi-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--bi-faint); }
.bi-sort select { background: #0b1c2c; border: 1px solid var(--bi-line); border-radius: 7px; padding: 5px 8px; font-size: 11px; }
.bi-ghost-btn { border: 1px solid var(--bi-line); background: transparent; color: var(--bi-dim); border-radius: 7px; padding: 6px 10px; font-size: 10.5px; cursor: pointer; }
.bi-ghost-btn:hover:not(:disabled) { color: var(--bi-cyan); border-color: var(--bi-line-strong); }
.bi-ghost-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.bi-filter-summary { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 10.5px; color: var(--bi-dim); }
.bi-filter-summary b { color: var(--bi-text); font-weight: 600; }
.bi-sep { color: var(--bi-faint); }

/* directory */
.bi-dir-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.bi-dir-item + .bi-dir-item { border-top: 1px solid rgba(36, 215, 255, 0.08); }
.bi-dir-btn {
  width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: transparent; border: 0; border-left: 3px solid transparent;
  padding: 11px 13px; cursor: pointer; transition: 0.14s ease;
}
.bi-dir-btn:hover { background: rgba(0, 229, 255, 0.06); }
.bi-dir-item.is-selected .bi-dir-btn { background: rgba(0, 229, 255, 0.1); border-left-color: var(--bi-cyan); }
.bi-dir-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; width: 100%; }
.bi-dir-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.bi-dir-rating { font-size: 10px; color: var(--bi-gold); white-space: nowrap; }
.bi-dir-meta { font-size: 10.5px; color: var(--bi-faint); }
.bi-dir-foot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.bi-chip { font-size: 9px; letter-spacing: 0.4px; padding: 2px 6px; border-radius: 5px; border: 1px solid transparent; }
.bi-chip.is-on { color: var(--bi-green); background: rgba(54, 239, 155, 0.1); border-color: rgba(54, 239, 155, 0.28); }
.bi-chip.is-off { color: var(--bi-amber); background: rgba(255, 157, 54, 0.1); border-color: rgba(255, 157, 54, 0.3); }

.bi-empty { padding: 18px 4px; font-size: 11.5px; color: var(--bi-faint); line-height: 1.6; }

.bi-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 15px; border-top: 1px solid var(--bi-line); flex-wrap: wrap; }
.bi-pager-range { font-size: 10.5px; color: var(--bi-faint); }
.bi-pager-controls { display: flex; align-items: center; gap: 8px; }
.bi-pager-btn { border: 1px solid var(--bi-line); background: transparent; color: var(--bi-dim); border-radius: 7px; padding: 6px 11px; font-size: 11px; cursor: pointer; }
.bi-pager-btn:hover:not(:disabled) { color: var(--bi-cyan); border-color: var(--bi-line-strong); }
.bi-pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bi-pager-page { font-size: 10.5px; color: var(--bi-dim); }

/* analytics bars */
.bi-bars { display: flex; flex-direction: column; gap: 5px; }
.bi-bar {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 7px 9px; cursor: pointer; text-align: left; transition: 0.14s ease;
}
.bi-bar:hover { background: rgba(0, 229, 255, 0.06); border-color: var(--bi-line); }
.bi-bar.is-active { background: rgba(0, 229, 255, 0.12); border-color: var(--bi-line-strong); }
.bi-bar-label { font-size: 11.5px; color: var(--bi-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-bar-label em { color: var(--bi-faint); font-style: normal; font-size: 9.5px; }
.bi-bar-count { font-size: 11px; color: var(--bi-cyan); font-weight: 600; }
.bi-bar-track { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bi-bar-track i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--bi-cyan), var(--bi-blue)); }
.bi-bar.is-active .bi-bar-track i { background: linear-gradient(90deg, var(--bi-gold), var(--bi-amber)); }

.bi-analytics-section + .bi-analytics-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--bi-line); }
/* Keep the three lower panels close to the same height: the category list can
 * run to dozens of rows, so it scrolls inside its panel instead of stretching
 * the whole dashboard row. */
.bi-panel-analytics .bi-panel-body { max-height: 642px; overflow-y: auto; }

/* imports */
.bi-imports { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.bi-import { border: 1px solid var(--bi-line); border-radius: 10px; background: rgba(5, 15, 25, 0.7); padding: 11px 12px; }
.bi-import header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bi-import code { font-family: var(--bi-mono); font-size: 10px; color: var(--bi-faint); }
.bi-run-status { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; font-weight: 700; }
.bi-run-status.is-ok { background: rgba(54, 239, 155, 0.14); color: var(--bi-green); }
.bi-run-status.is-live { background: rgba(0, 229, 255, 0.14); color: var(--bi-cyan); }
.bi-run-status.is-bad { background: rgba(255, 85, 102, 0.16); color: var(--bi-red); }
.bi-run-status.is-idle { background: rgba(255, 255, 255, 0.08); color: var(--bi-dim); }
.bi-import dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.bi-import dt { font-size: 8.5px; letter-spacing: 1px; color: var(--bi-faint); text-transform: uppercase; }
.bi-import dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; }
.bi-import dd.is-up { color: var(--bi-green); }
.bi-import dd.is-warn { color: var(--bi-amber); }
.bi-import footer { display: flex; flex-direction: column; gap: 2px; font-size: 9.5px; color: var(--bi-faint); }
.bi-import-error { margin: 8px 0 0; font-size: 10px; color: var(--bi-red); }

/* gate */
.bi-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.bi-gate-card {
  max-width: 460px; text-align: center; padding: 34px 28px;
  border: 1px solid var(--bi-line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(11, 25, 38, 0.96), rgba(4, 11, 18, 0.95));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.bi-gate-mark { font-size: 30px; margin-bottom: 12px; }
.bi-gate-card h1 { font-size: 19px; margin: 0 0 10px; letter-spacing: 0.6px; }
.bi-gate-card p { font-size: 12.5px; color: var(--bi-dim); line-height: 1.65; margin: 0 0 18px; }
.bi-gate-action { display: inline-block; text-decoration: none; color: #04121b; background: linear-gradient(180deg, #7fe9ff, var(--bi-cyan)); border-radius: 10px; padding: 10px 18px; font-size: 12.5px; font-weight: 600; }
.bi-gate-action:hover { filter: brightness(1.06); }

/* toast */
.bi-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: rgba(6, 20, 32, 0.96); border: 1px solid var(--bi-line-strong);
  color: var(--bi-text); font-size: 12px; padding: 10px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: 0.2s ease; z-index: 80;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.bi-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.bi-footer { font-size: 10px; color: var(--bi-faint); text-align: center; padding-top: 6px; }

/* ── responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  .bi-main { grid-template-columns: 250px minmax(0, 1fr); }
  .bi-detail { grid-column: 1 / -1; max-height: none; }
  .bi-lower { grid-template-columns: 1fr 1fr; }
  .bi-panel-imports { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .bi-brand { min-width: 0; }
  /* A 200px sticky header would cover the detail panel when a mobile row
   * scrolls it into view; let the header scroll away instead. */
  .bi-topbar { position: static; }
  .bi-detail { scroll-margin-top: 10px; }
  .bi-main { grid-template-columns: 1fr; }
  .bi-sidebar { max-height: none; }
  .bi-map-panel { min-height: 420px; }
  .bi-detail.is-empty { display: none; }
  .bi-lower { grid-template-columns: 1fr; }
  .bi-topbar-meta { width: 100%; justify-content: space-between; }
  /* The attribution bar spans the bottom of the map on narrow screens; keep
   * the legend above it instead of letting the two overlap. */
  .bi-map-legend {
    left: 12px; bottom: auto; top: 58px;
    flex-direction: row; flex-wrap: wrap; gap: 4px 10px;
    padding: 6px 9px; font-size: 9px;
  }
  .bi-map-status { display: none; }
}

@media (max-width: 560px) {
  .bi-shell { padding: 10px 10px 30px; }
  .bi-topbar { padding: 10px 12px; gap: 8px; }
  .bi-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .bi-brand-text b { font-size: 13px; letter-spacing: 1.6px; }
  .bi-brand-text span { font-size: 8.5px; letter-spacing: 1.2px; }
  .bi-nav-link { padding: 4px 8px; font-size: 9.5px; }
  .bi-user { font-size: 9.5px; }
  .bi-kpis { grid-template-columns: 1fr 1fr; }
  .bi-kpi-value { font-size: 22px; }
  .bi-panel-tools { width: 100%; margin-left: 0; }
  .bi-dir-list { max-height: none; }
}
