:root {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-soft: rgba(255, 255, 255, 0.92);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e5e5ea;
  --primary: #1d1d1f;
  --primary-2: #2f2f33;
  --primary-3: #0071e3;
  --ok: #0b6b2f;
  --warn: #8a5a00;
  --shadow-1: 0 18px 45px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 8px 22px rgba(0, 0, 0, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif !important;
  color: var(--ink) !important;
  background:
    radial-gradient(1200px 520px at -10% -10%, rgba(0, 113, 227, 0.07) 0%, rgba(0, 113, 227, 0) 58%),
    radial-gradient(900px 420px at 110% 0%, rgba(29, 29, 31, 0.05) 0%, rgba(29, 29, 31, 0) 64%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) !important;
}

.card {
  border-radius: 28px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.90)) !important;
  box-shadow: var(--shadow-1) !important;
}

.head {
  border-radius: 20px !important;
  background: linear-gradient(135deg, #1f1f22 0%, #2b2b30 100%) !important;
  color: #fff !important;
}

.title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: -0.02em !important;
  font-weight: 700 !important;
}

.sub {
  color: rgba(255, 255, 255, 0.84) !important;
}

.quick-nav a,
.lang-select,
.btn.alt,
.sync-chip,
.mini-btn {
  border-color: #d2d2d7 !important;
  color: #1d1d1f !important;
  background: #fff !important;
}

.quick-nav a:hover,
.sync-chip:hover,
.mini-btn:hover {
  border-color: #0071e3 !important;
  background: #f4f8ff !important;
}

.btn,
.mini-btn.buy {
  border-color: #0071e3 !important;
  background: #0071e3 !important;
  color: #fff !important;
}

.btn:hover,
.mini-btn.buy:hover {
  filter: brightness(0.95) !important;
}

.plan-card,
.auth,
.advisor-box,
.admin-box,
.health-box,
.audit-box,
.user-box,
.trend-wrap,
.funnel-mini {
  border-color: #e5e5ea !important;
  background: #fff !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04) !important;
}

.plan-price {
  letter-spacing: -0.03em !important;
}

a.project {
  border: 1px solid rgba(255,255,255,.22) !important;
  background:
    radial-gradient(280px 120px at 95% -10%, rgba(172, 220, 255, 0.24), transparent 65%),
    linear-gradient(145deg, #1f1f22 0%, #2d2d31 55%, #3a3a40 100%) !important;
}

.cap {
  background: rgba(255, 255, 255, 0.18) !important;
}

.notice {
  border-color: #ffd9a6 !important;
  background: #fff9ef !important;
}

.notice.ok {
  border-color: #bfe8cb !important;
  background: #f1fcf4 !important;
}

.logo-wrap {
  border-color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18) !important;
}

@media (max-width: 860px) {
  .title { font-size: clamp(28px, 8vw, 38px) !important; }
  .t { font-size: clamp(28px, 8vw, 36px) !important; }
}

/* =========================
   Padron map unified theme
   ========================= */
#sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94)) !important;
  border-right: 1px solid #d2d2d7 !important;
  box-shadow: 0 14px 30px rgba(9, 30, 66, 0.08) !important;
}

#sidebar-header {
  border-bottom: 1px solid #d2d2d7 !important;
  background:
    radial-gradient(360px 120px at 95% -20%, rgba(90, 172, 255, 0.28), transparent 72%),
    linear-gradient(128deg, #0e2742 0%, #12365d 52%, #14537d 100%) !important;
}

#sidebar-header h1 {
  color: #f8fafc !important;
  letter-spacing: -0.01em !important;
}

#sidebar-header p {
  color: rgba(248, 250, 252, 0.82) !important;
}

#stats-bar,
#filters {
  border-bottom: 1px solid #e5e5ea !important;
}

.stat-card {
  background: #f8fafc !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 10px !important;
}

.stat-label,
#filters label,
.circ-meta,
.bar-label,
.bar-pct,
.kv-key,
#legend h3 {
  color: #6e6e73 !important;
}

.stat-value,
.circ-name,
.detail-title,
.kv-val {
  color: #1d1d1f !important;
}

#filters select,
#vista-select {
  background: #fff !important;
  border: 1px solid #d2d2d7 !important;
  border-radius: 10px !important;
  color: #1d1d1f !important;
}

.circ-item {
  border: 1px solid transparent !important;
  border-radius: 10px !important;
}

.circ-item:hover {
  background: #f5f5f7 !important;
  border-color: #d2d2d7 !important;
}

.circ-item.active {
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.14), rgba(73, 159, 251, 0.08)) !important;
  border-color: #86b8ed !important;
}

#map-wrap {
  background:
    radial-gradient(900px 350px at 110% -8%, rgba(26, 127, 212, 0.12), transparent 62%),
    radial-gradient(900px 350px at -10% -8%, rgba(19, 55, 90, 0.09), transparent 62%),
    linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%) !important;
}

#detail-panel {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid #d2d2d7 !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14) !important;
}

#detail-close {
  color: #6e6e73 !important;
}

#detail-close:hover {
  color: #1d1d1f !important;
}

.detail-meta,
.section-label {
  color: #6e6e73 !important;
}

.detail-section {
  border-top: 1px solid #e5e5ea !important;
}

.kv-row {
  border-bottom: 1px solid #e5e5ea !important;
}

.bar-track {
  background: #dbe5f0 !important;
}

.gemini-box {
  background: #f8fbff !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 12px !important;
}

.gemini-box .label {
  color: #28537e !important;
}

.gemini-box p,
.demandas-list li {
  color: #1d1d1f !important;
}

.demandas-kpi {
  background: #fff !important;
  border: 1px solid #dbe5f0 !important;
}

.demandas-kpi .k {
  color: #6e6e73 !important;
}

.demandas-kpi .v {
  color: #1d1d1f !important;
}

#layer-toggle {
  gap: 8px !important;
}

.layer-btn {
  background: rgba(255,255,255,.96) !important;
  border: 1px solid #d2d2d7 !important;
  color: #1d1d1f !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

.layer-btn.active {
  background: #0071e3 !important;
  border-color: #0071e3 !important;
  color: #fff !important;
}

#legend {
  background: rgba(255,255,255,.96) !important;
  border: 1px solid #d2d2d7 !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08) !important;
}

#legend span {
  color: #1d1d1f !important;
}

.leaflet-control-zoom a {
  background: rgba(255,255,255,.96) !important;
  color: #1d1d1f !important;
  border-color: #d2d2d7 !important;
}

.leaflet-control-zoom a:hover {
  background: #f4f8ff !important;
  color: #0071e3 !important;
}

@media (max-width: 768px) {
  #detail-panel {
    max-height: calc(100vh - 28px) !important;
  }
}
