/**
 * Senra IO visual alignment — obsidian base, muted greys, gold accent.
 * Load after the app bundle CSS so :root tokens and hardcoded light surfaces win.
 */
:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-page: #030303;
  --bg-elevated: #0c0c0c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #fafafa;
  /* Secondary / muted must stay legible on #030303 (old #6b6b6b failed WCAG for small text). */
  --text-secondary: #b8b8c2;
  --text-muted: #9ca3af;
  --accent: #c5a059;
  --accent-soft: rgba(197, 160, 89, 0.12);
  --accent-border: rgba(197, 160, 89, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.55);
}

html {
  color-scheme: dark;
}

body {
  background: var(--bg-page);
  color: var(--text);
}

.top-bar {
  background: rgba(3, 3, 3, 0.92) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border) !important;
}

.beta-badge {
  color: var(--text-secondary) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--border) !important;
}

.btn.primary:hover:not(:disabled) {
  background: #a6894a !important;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.search-input:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.22) !important;
}

.search-loading-strip {
  background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.45), transparent) 0 0 / 200% 100% !important;
}

.map-shell {
  background: #121212 !important;
  border-color: var(--border) !important;
}

.map-shell .leaflet-container {
  background: #1a1a1a !important;
}

.map-legend {
  background: rgba(12, 12, 12, 0.92) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

.map-pulse-ring {
  border-color: rgba(197, 160, 89, 0.85) !important;
}

.legend-dot.issue {
  background: #c5a059 !important;
  border-color: #5c4a2a !important;
}

.issue-popup__desc {
  border-top-color: var(--border) !important;
}

.error {
  color: #fca5a5 !important;
  background: rgba(185, 28, 28, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
}

.badge-new {
  color: #a3a3a3 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.search-briefing__crime-cat-btn {
  background: rgba(185, 28, 28, 0.12) !important;
  border-color: var(--border) !important;
}

.search-briefing__crime-cat-btn:hover {
  background: rgba(185, 28, 28, 0.2) !important;
  border-color: rgba(248, 113, 113, 0.25) !important;
}

.sector-card-head {
  background: rgba(255, 255, 255, 0.04) !important;
}

.sector-card-head:hover {
  background: rgba(255, 255, 255, 0.07) !important;
}

.chip {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.skeleton-talking {
  background: rgba(255, 255, 255, 0.04) !important;
  border-left-color: rgba(197, 160, 89, 0.35) !important;
}

.sk-line {
  background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.09) 50%,
      rgba(255, 255, 255, 0.04) 100%
    )
    0 0 / 200% 100% !important;
}

.data-table th,
.data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.data-table th {
  background: rgba(255, 255, 255, 0.04) !important;
}

.data-table tbody tr.click-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.search-briefing__row-btn {
  background: rgba(255, 255, 255, 0.04) !important;
}

.search-briefing__row-btn:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: var(--border) !important;
}

.detail-panel__backdrop {
  background: rgba(0, 0, 0, 0.65) !important;
}

.detail-panel__close {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-secondary) !important;
}

.detail-panel__close:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--text) !important;
}

.detail-panel__cat-badge {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.plan-badge--amber {
  color: #fcd34d !important;
  background: rgba(180, 83, 9, 0.22) !important;
  border-color: rgba(252, 211, 77, 0.3) !important;
}

.plan-badge--green {
  color: #6ee7b7 !important;
  background: rgba(4, 120, 87, 0.22) !important;
  border-color: rgba(110, 231, 183, 0.28) !important;
}

.plan-badge--red {
  color: #fca5a5 !important;
  background: rgba(185, 28, 28, 0.2) !important;
  border-color: rgba(252, 165, 165, 0.3) !important;
}

.plan-badge--violet {
  color: #c4b5fd !important;
  background: rgba(91, 33, 182, 0.28) !important;
  border-color: rgba(196, 181, 253, 0.35) !important;
}

.crime-outcome-badge--red {
  color: #fca5a5 !important;
  background: rgba(185, 28, 28, 0.18) !important;
  border-color: rgba(252, 165, 165, 0.35) !important;
}

.crime-outcome-badge--amber {
  color: #fcd34d !important;
  background: rgba(146, 64, 14, 0.25) !important;
  border-color: rgba(252, 211, 77, 0.3) !important;
}

.crime-outcome-badge--green {
  color: #6ee7b7 !important;
  background: rgba(6, 95, 70, 0.25) !important;
  border-color: rgba(110, 231, 183, 0.3) !important;
}

.crime-outcome-badge--grey {
  color: var(--text-secondary) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--border) !important;
}

.streets-list__head {
  background: rgba(255, 255, 255, 0.04) !important;
}

.streets-list__head:hover {
  background: rgba(255, 255, 255, 0.07) !important;
}

/* Street row counts: neutral only (same treatment for issues / planning / objections / crimes). */
.street-badge--issue,
.street-badge--plan,
.street-badge--obj,
.street-badge--crime,
.street-badge--crime.has-crime {
  color: var(--text-secondary) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--border) !important;
}

.streets-sub__link {
  background: rgba(255, 255, 255, 0.04) !important;
}

.streets-sub__link:hover {
  background: rgba(255, 255, 255, 0.07) !important;
}

.talking-panel__label {
  color: #c5a059 !important;
}

code {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e4e4e7 !important;
}

.chevron {
  color: var(--text-muted) !important;
}

/* Leaflet: dark chrome while keeping map tiles readable */
.leaflet-bar,
.leaflet-control-layers {
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-bar a {
  background-color: #141414 !important;
  color: var(--text) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.leaflet-bar a:hover,
.leaflet-bar a:focus {
  background-color: #1f1f1f !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55) !important;
}

.leaflet-popup-content {
  color: var(--text) !important;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--text-muted) !important;
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
  color: var(--text) !important;
}

.leaflet-container .leaflet-control-attribution {
  background: rgba(12, 12, 12, 0.85) !important;
  color: var(--text-muted) !important;
}

.leaflet-container .leaflet-control-attribution a {
  color: #c5a059 !important;
}

.leaflet-tooltip {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}

.sector-item-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* --- Dashboard meta: must not disappear on black (data refresh, stats scope, quick actions) --- */
.data-refresh-line {
  color: var(--text-secondary) !important;
}

.data-refresh-line__label {
  color: var(--text-secondary) !important;
}

.data-refresh-line__date {
  color: #e4e4e7 !important;
  font-weight: 500 !important;
}

.data-refresh-line--muted {
  color: var(--text-secondary) !important;
}

.data-refresh-line--stale {
  color: #fbbf24 !important;
}

.data-refresh-line--stale .data-refresh-line__date {
  color: #fef3c7 !important;
}

.data-refresh-line--stale .data-refresh-line__warn {
  color: #fde68a !important;
}

.stats-strip__scope {
  color: var(--text-secondary) !important;
}

.stats-top {
  color: var(--text-secondary) !important;
}

.quick-actions__card:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.app-footer p {
  color: var(--text-secondary) !important;
}

