/* =============================================================================
   GIS Dashboard — SaaS dark (FTTH / Corp)
   Variables, glass surfaces, BEM-like .dash-* naming
   ============================================================================= */

:root {
  --dash-bg-deep: #0a0d12;
  --dash-bg: #0d1117;
  --dash-surface: rgba(24, 30, 40, 0.62);
  --dash-surface-2: rgba(30, 37, 50, 0.78);
  --dash-elevated: rgba(36, 44, 59, 0.86);
  --dash-border: rgba(148, 163, 184, 0.08);
  --dash-border-strong: rgba(148, 163, 184, 0.14);
  --dash-text: #e5e7eb;
  --dash-muted: #94a3b8;
  --dash-muted-2: #64748b;
  --dash-accent: #60a5fa;
  --dash-accent-soft: rgba(96, 165, 250, 0.1);
  --dash-cyan: #7dd3fc;
  --dash-cyan-dim: rgba(125, 211, 252, 0.08);
  --dash-green: #34d399;
  --dash-green-neon: #34d399;
  --dash-green-dim: rgba(52, 211, 153, 0.08);
  --dash-amber: #f59e0b;
  --dash-rose: #fb7185;
  --dash-danger: #f87171;
  --dash-radius-lg: 18px;
  --dash-radius-md: 12px;
  --dash-radius-sm: 9px;
  --dash-sidebar-w: 252px;
  --dash-sidebar-w-collapsed: 72px;
  --dash-shadow-soft: 0 6px 22px rgba(0, 0, 0, 0.32);
  --dash-shadow-glow: 0 0 36px rgba(59, 130, 246, 0.04);
  --dash-glow-hover: 0 8px 24px rgba(2, 6, 23, 0.4);
  --dash-active-glow: 0 0 0 1px rgba(148, 163, 184, 0.18), 0 8px 24px rgba(2, 6, 23, 0.4);
  --dash-font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --dash-font-display: "Plus Jakarta Sans", var(--dash-font);
  --dash-transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dash-transition: 0.01ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.dash {
  height: 100%;
  margin: 0;
}

body.dash {
  font-family: var(--dash-font);
  font-size: 14.5px;
  font-weight: 400;
  color: var(--dash-text);
  background: var(--dash-bg-deep);
  background-image:
    radial-gradient(ellipse 110% 70% at 50% -20%, rgba(71, 85, 105, 0.28), transparent 60%),
    radial-gradient(ellipse 70% 55% at 100% 10%, rgba(59, 130, 246, 0.07), transparent 55%),
    radial-gradient(ellipse 70% 55% at 0% 100%, rgba(16, 185, 129, 0.05), transparent 55%);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

.dash-app {
  display: flex;
  min-height: 100%;
  min-height: 100dvh;
}

/* ----- Sidebar ----- */
.dash-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--dash-sidebar-w);
  min-height: 100dvh;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(24, 30, 40, 0.72) 0%, rgba(13, 17, 23, 0.88) 100%);
  border-right: 1px solid var(--dash-border);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.2);
  transition: width var(--dash-transition), padding var(--dash-transition);
  z-index: 40;
}

.dash-app.is-sidebar-collapsed .dash-sidebar {
  width: var(--dash-sidebar-w-collapsed);
  padding-inline: 10px;
}

.dash-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--dash-border);
}

.dash-sidebar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dash-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--dash-transition), border-color var(--dash-transition), background var(--dash-transition);
}

.dash-sidebar__menu-btn:hover {
  color: var(--dash-text);
  border-color: var(--dash-border-strong);
  background: rgba(148, 163, 184, 0.08);
}

.dash-app.is-sidebar-collapsed .dash-sidebar__brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.dash-sidebar__brand-text {
  font-family: var(--dash-font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  transition: opacity var(--dash-transition), width var(--dash-transition);
}

.dash-logo {
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(148, 163, 184, 0.2));
  opacity: 0.92;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--dash-radius-sm);
  color: var(--dash-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition:
    color var(--dash-transition),
    background var(--dash-transition),
    border-color var(--dash-transition),
    box-shadow var(--dash-transition);
}

.dash-nav__link:hover {
  color: var(--dash-text);
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.14);
}

.dash-nav__link--active {
  color: var(--dash-text);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(148, 163, 184, 0.06));
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: var(--dash-active-glow);
}

.dash-nav__ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.92;
}

.dash-nav__ico svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dash-app.is-sidebar-collapsed .dash-nav__label {
  display: none;
}

.dash-app.is-sidebar-collapsed .dash-nav__link {
  justify-content: center;
  padding-inline: 10px;
}

.dash-sidebar__collapse {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dash-muted);
  cursor: pointer;
  transition: color var(--dash-transition), border-color var(--dash-transition), background var(--dash-transition);
}

.dash-sidebar__collapse:hover {
  color: var(--dash-text);
  border-color: var(--dash-border-strong);
  background: rgba(148, 163, 184, 0.08);
}

.dash-app.is-sidebar-collapsed .dash-sidebar__collapse .dash-nav__ico {
  transform: rotate(180deg);
}

.dash-sidebar__collapse .dash-nav__ico {
  transition: transform var(--dash-transition);
}

/* ----- Main column ----- */
.dash-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ----- Header ----- */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 28px;
  margin: 12px 12px 0;
  border-radius: var(--dash-radius-lg);
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: var(--dash-shadow-soft), var(--dash-shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dash-header__title {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-header__subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--dash-muted);
}

.dash-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dash-api-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: var(--dash-green-neon);
}

.dash-api-status.is-offline {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--dash-danger);
}

.dash-api-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dash-green-neon);
  box-shadow: 0 0 10px var(--dash-green-neon);
  animation: dash-pulse 2.2s ease-in-out infinite;
}

.dash-api-status.is-offline .dash-api-status__dot {
  background: var(--dash-danger);
  box-shadow: none;
  animation: none;
}

@keyframes dash-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.dash-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dash-muted);
  cursor: pointer;
  transition: color var(--dash-transition), border-color var(--dash-transition), background var(--dash-transition), transform 0.15s ease;
}

.dash-icon-btn:hover {
  color: var(--dash-text);
  border-color: var(--dash-border-strong);
  background: rgba(148, 163, 184, 0.08);
}

.dash-icon-btn:active {
  transform: scale(0.96);
}

.dash-icon-btn--sm {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  line-height: 1;
}

.dash-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 99px;
  background: rgba(251, 113, 133, 0.85);
  color: #fff;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--dash-border);
  background: rgba(255, 255, 255, 0.03);
}

.dash-user__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  background: linear-gradient(145deg, #475569, #1e293b);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.4);
}

.dash-user__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dash-user__name {
  font-weight: 600;
  font-size: 0.88rem;
}

.dash-user__role {
  font-size: 0.72rem;
  color: var(--dash-muted);
}

/* ----- Main content ----- */
.dash-main {
  flex: 1;
  padding: 16px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

/* KPIs */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1200px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
}

.dash-kpi {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 18px;
  border-radius: var(--dash-radius-lg);
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--dash-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--dash-transition), transform var(--dash-transition), box-shadow var(--dash-transition);
}

.dash-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(148, 163, 184, 0.05), transparent 60%);
  pointer-events: none;
}

.dash-kpi:hover {
  border-color: var(--dash-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--dash-shadow-soft), 0 12px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dash-kpi__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.dash-kpi__ico {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--dash-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dash-border);
}

.dash-kpi__ico svg {
  width: 20px;
  height: 20px;
}

.dash-kpi__tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--dash-muted);
}

.dash-kpi__tag--cyan {
  background: var(--dash-cyan-dim);
  color: var(--dash-cyan);
}

.dash-kpi__tag--green {
  background: var(--dash-green-dim);
  color: var(--dash-green-neon);
}

.dash-kpi__tag--neon {
  background: rgba(52, 211, 153, 0.1);
  color: var(--dash-green-neon);
}

.dash-kpi__value {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.dash-kpi__unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dash-muted);
  margin-left: 2px;
}

.dash-kpi__label {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--dash-muted);
  position: relative;
  z-index: 1;
}

.dash-kpi__bar {
  margin-top: 14px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.dash-kpi__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #64748b, #60a5fa 60%, #34d399);
}

.dash-kpi--alert::before {
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(251, 113, 133, 0.08), transparent 60%);
}

.dash-kpi--maint::before {
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(96, 165, 250, 0.08), transparent 60%);
}

/* Workspace: map + detail */
.dash-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  min-height: 420px;
  flex: 1;
}

@media (max-width: 1100px) {
  .dash-workspace {
    grid-template-columns: 1fr;
  }

  .dash-detail-panel {
    max-height: 420px;
  }
}

.dash-map-panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--dash-radius-lg);
  overflow: hidden;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface-2);
  box-shadow: var(--dash-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  min-height: 380px;
}

.dash-map-panel__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dash-border);
  background: rgba(0, 0, 0, 0.2);
}

.dash-map-tools {
  display: flex;
  gap: 8px;
}

.dash-tool-btn {
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dash-muted);
  cursor: pointer;
  transition: all var(--dash-transition);
}

.dash-tool-btn:hover {
  color: var(--dash-text);
  border-color: var(--dash-border-strong);
  background: rgba(148, 163, 184, 0.06);
}

.dash-tool-btn--active {
  color: var(--dash-text);
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.1);
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dash-muted);
}

.dash-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dash-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dash-legend__item--nap .dash-legend__dot {
  background: #7dd3fc;
}

.dash-legend__item--cierre .dash-legend__dot {
  background: #94a3b8;
}

.dash-legend__item--troncal .dash-legend__dot {
  background: #60a5fa;
}

.dash-legend__item--falla .dash-legend__dot {
  background: #fb7185;
}

.dash-legend__item--maint .dash-legend__dot {
  background: var(--dash-green-neon);
}

.dash-map {
  position: relative;
  flex: 1;
  min-height: 320px;
  background: #0a0d12;
}

.dash-map__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.dash-map__grid {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}

.dash-map__hint {
  position: relative;
  z-index: 1;
  max-width: 360px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--dash-muted);
}

.dash-map__hint strong {
  color: var(--dash-text);
}

.dash-map__zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.dash-map-zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--dash-border-strong);
  background: rgba(15, 23, 42, 0.85);
  color: var(--dash-text);
  font-size: 1.1rem;
  cursor: default;
  backdrop-filter: blur(8px);
}

/* Detail panel */
.dash-detail-panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--dash-radius-lg);
  border: 1px solid var(--dash-border);
  background: var(--dash-surface-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--dash-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: opacity var(--dash-transition), transform var(--dash-transition);
}

.dash-app.is-detail-hidden .dash-detail-panel {
  display: none;
}

.dash-app.is-detail-hidden .dash-workspace {
  grid-template-columns: 1fr;
}

.dash-detail-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--dash-border);
}

.dash-detail-panel__title {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 1rem;
  font-weight: 700;
}

.dash-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--dash-border);
  background: rgba(0, 0, 0, 0.15);
}

.dash-tab {
  flex: 1;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  border-radius: var(--dash-radius-sm);
  background: transparent;
  color: var(--dash-muted);
  cursor: pointer;
  transition: background var(--dash-transition), color var(--dash-transition);
}

.dash-tab:hover {
  color: var(--dash-text);
  background: rgba(148, 163, 184, 0.06);
}

.dash-tab--active {
  color: var(--dash-text);
  background: rgba(148, 163, 184, 0.1);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.dash-detail-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.dash-detail-block--hidden {
  display: none;
}

.dash-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.dash-pill--falla {
  background: rgba(251, 113, 133, 0.15);
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.dash-pill--nap {
  background: rgba(125, 211, 252, 0.1);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.dash-detail-h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.dash-dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.dash-dl > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  font-size: 0.84rem;
}

.dash-dl dt {
  margin: 0;
  color: var(--dash-muted-2);
  font-weight: 500;
}

.dash-dl dd {
  margin: 0;
  font-weight: 600;
}

.dash-text-warn {
  color: var(--dash-amber);
}

.dash-detail-p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--dash-muted);
  line-height: 1.5;
}

.dash-timeline {
  margin: 0;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--dash-muted);
}

.dash-timeline li {
  margin-bottom: 10px;
}

.dash-timeline time {
  display: block;
  font-size: 0.72rem;
  color: var(--dash-muted-2);
  margin-bottom: 2px;
}

/* Charts */
.dash-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1100px) {
  .dash-charts {
    grid-template-columns: 1fr;
  }
}

.dash-chart-card {
  padding: 18px 20px 20px;
  border-radius: var(--dash-radius-lg);
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--dash-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color var(--dash-transition);
}

.dash-chart-card:hover {
  border-color: var(--dash-border-strong);
}

.dash-chart-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-chart-card__head h3 {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.dash-chart-card__hint {
  font-size: 0.72rem;
  color: var(--dash-muted-2);
}

.dash-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 160px;
  padding-top: 8px;
}

.dash-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dash-bar__fill {
  width: 100%;
  max-width: 36px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #94a3b8 0%, #60a5fa 70%, #475569 100%);
  opacity: 0.92;
  transition: opacity var(--dash-transition), transform var(--dash-transition);
}

.dash-bar:hover .dash-bar__fill {
  opacity: 1;
  transform: scaleY(1.02);
  transform-origin: bottom;
}

.dash-bar__label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--dash-muted-2);
  text-align: center;
  line-height: 1.2;
}

.dash-spark {
  height: 140px;
  position: relative;
  border-radius: var(--dash-radius-md);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.06), transparent);
  overflow: hidden;
}

.dash-spark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dash-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-donut {
  --p: 68;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    #60a5fa calc(var(--p) * 1%),
    rgba(245, 158, 11, 0.8) 0 calc(var(--p) * 1% + 22%),
    rgba(251, 113, 133, 0.7) 0
  );
  position: relative;
}

.dash-donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--dash-bg);
}

.dash-donut-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--dash-muted);
}

.dash-donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-dot--cyan {
  background: #60a5fa;
}

.dash-dot--amber {
  background: var(--dash-amber);
}

.dash-dot--rose {
  background: var(--dash-rose);
}

/* ----- Responsive tuning ----- */
body.dash {
  overflow-x: hidden;
}

@media (max-width: 900px) {
  html,
  body.dash {
    max-width: 100%;
    overflow-x: hidden;
  }

  .dash-app {
    flex-direction: column;
    min-height: 100dvh;
    max-width: 100%;
    overflow-x: hidden;
  }

  .dash-main-wrap,
  .dash-main,
  .dash-header,
  .dash-header__left,
  .dash-header__right,
  .dash-workspace,
  .dash-map-panel,
  .dash-detail-panel,
  .dash-chart-card {
    min-width: 0;
  }

  .dash-sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 10px 10px 8px;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid var(--dash-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  }

  .dash-app.is-sidebar-collapsed .dash-sidebar {
    width: 100%;
    padding-inline: 10px;
  }

  .dash-sidebar__brand {
    padding: 4px 6px 8px;
    margin-bottom: 0;
    border-bottom: none;
  }

  .dash-sidebar__menu-btn {
    display: inline-flex;
  }

  .dash-app.is-sidebar-collapsed .dash-sidebar__brand-text {
    opacity: 1;
    width: auto;
    overflow: visible;
    white-space: nowrap;
  }

  .dash-nav {
    display: none;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .dash-app.is-mobile-sidebar-open .dash-nav {
    display: flex;
  }

  .dash-nav__link {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
    padding: 10px 12px;
  }

  .dash-app.is-sidebar-collapsed .dash-nav__label {
    display: inline;
  }

  .dash-app.is-sidebar-collapsed .dash-nav__link {
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .dash-sidebar__collapse {
    display: none;
  }

  .dash-header {
    margin: 8px 8px 0;
    padding: 14px 12px;
    gap: 12px;
  }

  .dash-header__right {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .dash-user {
    margin-left: auto;
  }

  .dash-main {
    padding: 12px 10px 16px;
    gap: 14px;
  }

  .dash-workspace {
    min-height: 0;
    gap: 12px;
  }

  .dash-map-panel {
    min-height: 320px;
  }

  .dash-map-panel__toolbar {
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }

  .dash-map-tools {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .dash-tool-btn {
    min-height: 40px;
    white-space: nowrap;
  }

  .dash-detail-panel {
    max-height: none;
  }

  .dash-detail-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 520px) {
  .dash-header__title {
    font-size: clamp(1rem, 5vw, 1.15rem);
  }

  .dash-header__subtitle {
    font-size: 0.78rem;
  }

  .dash-user__meta {
    display: none;
  }

  .dash-api-status {
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .dash-kpi {
    padding: 16px 14px;
  }

  .dash-kpi__value {
    font-size: clamp(1.4rem, 7.5vw, 1.75rem);
  }

  .dash-chart-card {
    padding: 14px 14px 16px;
  }

  .dash-bars {
    height: 132px;
    gap: 8px;
  }

  .dash-map {
    min-height: 260px;
  }

  .dash-map__hint {
    font-size: 0.82rem;
  }

  .dash-dl > div {
    grid-template-columns: 82px 1fr;
  }
}
