/* ═══════════════════════════════════════════════════════════
   DASHBOARD V2 — Custom SaaS styles
   Requiere Bootstrap 5 + tema Mantis (base)
   Agrega en: public/css/dashboard.css
   e incluye en layouts/app.blade.php:
   <link rel="stylesheet" href="{{ asset('css/dashboard.css') }}">
═══════════════════════════════════════════════════════════ */

/* ─── Tokens ─── */
:root {
  --dash-primary:      #4361ee;
  --dash-primary-light:#eef0fd;
  --dash-success:      #10b981;
  --dash-success-light:#d1fae5;
  --dash-warning:      #f59e0b;
  --dash-warning-light:#fef3c7;
  --dash-danger:       #ef4444;
  --dash-danger-light: #fee2e2;
  --dash-gray-50:      #f8fafc;
  --dash-gray-100:     #f1f5f9;
  --dash-gray-200:     #e2e8f0;
  --dash-gray-400:     #94a3b8;
  --dash-gray-600:     #475569;
  --dash-gray-800:     #1e293b;
  --dash-radius:       12px;
  --dash-radius-sm:    8px;
  --dash-shadow:       0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --dash-shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --dash-transition:   0.18s cubic-bezier(.4,0,.2,1);
  --dash-font:         'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

/* ─── Base layout ─── */
.dashboard-v2 {
  font-family: var(--dash-font);
  color: var(--dash-gray-800);
}

/* ─── Header ─── */
.dash-header {
  padding-top: .25rem;
}

.dash-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--dash-gray-800);
  margin: 0;
}

.dash-subtitle {
  font-size: .8125rem;
  color: var(--dash-gray-400);
}

/* ─── Primary button ─── */
.dash-btn-primary {
  background: var(--dash-primary);
  color: #fff;
  border: none;
  border-radius: var(--dash-radius-sm);
  padding: .5rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background var(--dash-transition), transform var(--dash-transition), box-shadow var(--dash-transition);
  box-shadow: 0 2px 8px rgba(67,97,238,.22);
}
.dash-btn-primary:hover {
  background: #3451d1;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(67,97,238,.32);
}
.dash-btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--dash-gray-600);
  border: 1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  padding: .45rem 1rem;
  font-size: .875rem;
  transition: background var(--dash-transition), color var(--dash-transition);
}
.btn-ghost:hover {
  background: var(--dash-gray-100);
  color: var(--dash-gray-800);
  border-color: var(--dash-gray-200);
}

/* ─── KPI Cards ─── */
.kpi-card {
  border-radius: var(--dash-radius);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  box-shadow: var(--dash-shadow);
  border: 1px solid var(--dash-gray-200);
  transition: box-shadow var(--dash-transition), transform var(--dash-transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--dash-radius) var(--dash-radius) 0 0;
}
.kpi-card:hover {
  box-shadow: var(--dash-shadow-md);
  transform: translateY(-2px);
}

.kpi-operation::before  { background: var(--dash-success); }
.kpi-available::before  { background: var(--dash-primary); }
.kpi-maintenance::before{ background: var(--dash-warning); }

.kpi-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.kpi-operation  .kpi-icon-wrap { background: var(--dash-success-light); color: var(--dash-success); }
.kpi-available  .kpi-icon-wrap { background: var(--dash-primary-light); color: var(--dash-primary); }
.kpi-maintenance .kpi-icon-wrap{ background: var(--dash-warning-light); color: var(--dash-warning); }

.kpi-body {
  display: flex; flex-direction: column; gap: .15rem;
}
.kpi-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--dash-gray-400);
}
.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--dash-gray-800);
  line-height: 1;
}
.kpi-tag {
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}
.tag-operation  { background: var(--dash-success-light); color: var(--dash-success); }
.tag-available  { background: var(--dash-primary-light); color: var(--dash-primary); }
.tag-maintenance{ background: var(--dash-warning-light); color: var(--dash-warning); }

/* ─── Dash Cards ─── */
.dash-card {
  background: #fff;
  border-radius: var(--dash-radius);
  border: 1px solid var(--dash-gray-200);
  box-shadow: var(--dash-shadow);
  overflow: hidden;
  transition: box-shadow var(--dash-transition);
}
.dash-card:hover { box-shadow: var(--dash-shadow-md); }

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--dash-gray-100);
  background: #fff;
}
.dash-card-eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dash-gray-400);
  margin-bottom: .2rem;
}
.dash-card-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--dash-gray-800);
}
.dash-card-body {
  padding: 1.25rem 1.5rem;
}

/* ─── Chart nav buttons ─── */
.chart-nav-group {
  gap: 4px;
}
.btn-chart-nav {
  width: 30px; height: 30px;
  border-radius: 8px !important;
  border: 1px solid var(--dash-gray-200);
  background: #fff;
  color: var(--dash-gray-600);
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: background var(--dash-transition), color var(--dash-transition), border-color var(--dash-transition);
}
.btn-chart-nav:hover {
  background: var(--dash-primary-light);
  color: var(--dash-primary);
  border-color: var(--dash-primary);
}

/* ─── Table ─── */
.dash-table {
  font-size: .855rem;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.dash-table thead tr {
  background: var(--dash-gray-50);
}
.dash-table thead th {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dash-gray-400);
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--dash-gray-200);
  white-space: nowrap;
}
.dash-table tbody tr {
  transition: background var(--dash-transition);
}
.dash-table tbody tr:hover {
  background: var(--dash-gray-50);
}
.dash-table tbody td {
  padding: .8rem 1.25rem;
  border-bottom: 1px solid var(--dash-gray-100);
  color: var(--dash-gray-800);
  vertical-align: middle;
}
.dash-table-sm thead th { padding: .65rem 1rem; }
.dash-table-sm tbody td { padding: .65rem 1rem; }

/* Table header badges */
.th-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.th-available  { background: var(--dash-primary-light); color: var(--dash-primary); }
.th-operation  { background: var(--dash-success-light); color: var(--dash-success); }
.th-maintenance{ background: var(--dash-warning-light); color: var(--dash-warning); }

/* ─── Table action icons ─── */
.btn-icon-action {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--dash-gray-200);
  background: #fff;
  color: var(--dash-gray-600);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--dash-transition), color var(--dash-transition), border-color var(--dash-transition);
}
.btn-icon-action:hover {
  background: var(--dash-primary-light);
  color: var(--dash-primary);
  border-color: var(--dash-primary);
}

/* ─── Status pills ─── */
.status-pill {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.status-disponible       { background: var(--dash-primary-light); color: var(--dash-primary); }
.status-en-operacion     { background: var(--dash-success-light); color: var(--dash-success); }
.status-mantenimiento    { background: var(--dash-warning-light); color: var(--dash-warning); }

/* ─── Serial code ─── */
.serial-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .78rem;
  background: var(--dash-gray-100);
  padding: .15rem .5rem;
  border-radius: 5px;
  color: var(--dash-gray-600);
}

/* ─── Signal badges ─── */
.signal-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.signal-none  { background: #f1f5f9; color: #94a3b8; }
.signal-low   { background: #fee2e2; color: #ef4444; }
.signal-fair  { background: #fef3c7; color: #b45309; }
.signal-good  { background: #dbeafe; color: #1d4ed8; }
.signal-great { background: var(--dash-success-light); color: var(--dash-success); }

/* ─── Skeleton loader ─── */
.skeleton-row { padding: .35rem 0; }
.skeleton-cell {
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Geographic section ─── */
.dash-section-header {
  display: flex; align-items: center; justify-content: space-between;
}

.badge-geo {
  font-size: .72rem;
  font-weight: 700;
  background: var(--dash-primary-light);
  color: var(--dash-primary);
  padding: .2rem .65rem;
  border-radius: 20px;
}

/* State tabs */
.geo-nav { border-bottom: 1px solid var(--dash-gray-200); }
.geo-tabs { gap: .25rem; flex-wrap: wrap; }
.geo-tab-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--dash-gray-600);
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dash-transition), color var(--dash-transition);
}
.geo-tab-btn:hover { background: var(--dash-gray-50); color: var(--dash-primary); }
.geo-tab-btn.active {
  background: #fff;
  color: var(--dash-primary);
  font-weight: 700;
  border-color: var(--dash-gray-200);
  border-bottom-color: #fff;
  margin-bottom: -1px;
}
.geo-count {
  background: var(--dash-primary-light);
  color: var(--dash-primary);
  font-size: .7rem;
  font-weight: 700;
  border-radius: 20px;
  padding: .1rem .45rem;
}

/* Municipality pills */
.muni-pills { background: var(--dash-gray-50); border-bottom: 1px solid var(--dash-gray-100); }
.muni-label { font-size: .78rem; font-weight: 600; color: var(--dash-gray-400); letter-spacing: .04em; }
.muni-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  border: 1px solid var(--dash-gray-200);
  background: #fff;
  color: var(--dash-gray-600);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dash-transition);
}
.muni-pill:hover {
  border-color: var(--dash-primary);
  color: var(--dash-primary);
  background: var(--dash-primary-light);
}
.muni-pill.active {
  border-color: var(--dash-primary);
  background: var(--dash-primary);
  color: #fff;
}
.muni-pill-count {
  background: rgba(0,0,0,.08);
  border-radius: 20px;
  padding: .05rem .4rem;
  font-size: .7rem;
}
.muni-pill.active .muni-pill-count { background: rgba(255,255,255,.25); }

/* Accordion */
.geo-accordion { border: none; }
.geo-accordion-item {
  border: none !important;
  margin-bottom: 0;
}
.geo-total-row {
  padding: .65rem .25rem .25rem;
  font-size: .82rem;
  color: var(--dash-gray-600);
}

/* ─── Modals ─── */
.dash-modal {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--dash-gray-200);
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}
.dash-modal-header {
  background: var(--dash-gray-50);
  border-bottom: 1px solid var(--dash-gray-200);
  padding: 1rem 1.5rem;
}
.dash-modal-header .modal-title {
  font-weight: 700;
  font-size: .9375rem;
  color: var(--dash-gray-800);
}
.dash-modal-footer {
  background: var(--dash-gray-50);
  border-top: 1px solid var(--dash-gray-200);
  padding: .75rem 1.25rem;
}

.modal-loader {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.92);
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  backdrop-filter: blur(4px);
}
.modal-loader.d-none { display: none !important; }

.modal-spinner {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.85);
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}

/* ─── Detail modal ─── */
.detail-section {
  background: var(--dash-gray-50);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  height: 100%;
}
.detail-section-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dash-gray-400);
  margin-bottom: .75rem;
}
.detail-list { display: flex; flex-direction: column; gap: .5rem; }
.detail-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .4rem 0;
  border-bottom: 1px solid var(--dash-gray-200);
  gap: .75rem;
}
.detail-item:last-child { border-bottom: none; }
.detail-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--dash-gray-400);
  white-space: nowrap;
}
.detail-value {
  font-size: .84rem;
  color: var(--dash-gray-800);
  text-align: right;
}
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* ─── Footer timestamp ─── */
.dash-updated-at {
  font-size: .8rem;
  color: var(--dash-gray-400);
  padding-top: 1rem;
  border-top: 1px solid var(--dash-gray-100);
  margin-top: 1.5rem;
}

/* ─── Utility ─── */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ─── Responsive ─── */
@media (max-width: 767.98px) {
  .dash-title  { font-size: 1.2rem; }
  .kpi-value   { font-size: 1.5rem; }
  .dash-card-header { padding: .85rem 1rem; }
  .dash-card-body   { padding: 1rem; }
  .dash-table thead th,
  .dash-table tbody td { padding: .65rem .85rem; }
  .kpi-card { padding: 1rem; }
  .dash-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 575.98px) {
  .geo-tab-btn { font-size: .78rem; padding: .4rem .75rem; }
  .kpi-label   { font-size: .7rem; }
}

/* ═══════════════════════════════════════════════════════════════
   SECCIÓN: Filtros, Offcanvas, Exportar, Paginación, KPI skeleton
   Clases globales usadas en múltiples vistas.
   Agregadas en v2.1 — antes estaban definidas localmente en
   alarmDashboard.blade.php causando pérdida de estilos en otras vistas.
═══════════════════════════════════════════════════════════════ */

/* ─── Offcanvas de filtros ──────────────────────────────────── */
.dash-offcanvas {
  border-left: 1px solid var(--dash-gray-200);
}
.dash-offcanvas-header {
  background:    var(--dash-gray-50);
  border-bottom: 1px solid var(--dash-gray-200);
  padding:       1.25rem 1.5rem;
}

/* ─── Labels de filtro ──────────────────────────────────────── */
.dash-filter-label {
  display:        block;
  font-size:      .78rem;
  font-weight:    600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color:          var(--dash-gray-400);
}

/* ─── Inputs de filtro ──────────────────────────────────────── */
.dash-input {
  border:        1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  font-size:     .875rem;
  transition:    border-color var(--dash-transition),
                 box-shadow   var(--dash-transition);
}
.dash-input:focus {
  border-color: var(--dash-primary);
  box-shadow:   0 0 0 3px rgba(67,97,238,.12);
  outline:      none;
}
.dash-input-group { gap: 0; }
.dash-input-sep {
  background:   var(--dash-gray-100);
  border-color: var(--dash-gray-200);
  color:        var(--dash-gray-400);
  font-size:    .8rem;
}

/* ─── Select compacto (cabecera de tabla) ───────────────────── */
.dash-select-sm {
  border:        1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  font-size:     .8rem;
  padding:       .3rem .65rem;
  color:         var(--dash-gray-600);
  max-width:     130px;
}
.dash-select-sm:focus {
  border-color: var(--dash-primary);
  outline:      none;
  box-shadow:   0 0 0 3px rgba(67,97,238,.1);
}

/* ─── Botón exportar Excel ──────────────────────────────────── */
.dash-btn-export {
  background:    #f0fdf4;
  color:         #16a34a;
  border:        1px solid #bbf7d0;
  border-radius: var(--dash-radius-sm);
  padding:       .5rem 1rem;
  font-size:     .875rem;
  font-weight:   600;
  transition:    background var(--dash-transition),
                 box-shadow var(--dash-transition);
}
.dash-btn-export:hover {
  background:  #dcfce7;
  color:       #15803d;
  box-shadow:  0 2px 8px rgba(22,163,74,.15);
}

/* ─── Pie de tabla (total + paginación) ─────────────────────── */
.dash-table-footer {
  border-top: 1px solid var(--dash-gray-100);
}
.dash-record-count {
  font-size: .8rem;
  color:     var(--dash-gray-400);
}

/* ─── Paginación del Design System ─────────────────────────── */
.dash-pagination .page-item .page-link {
  font-size:     .8rem;
  padding:       .3rem .65rem;
  border-radius: var(--dash-radius-sm) !important;
  border:        1px solid var(--dash-gray-200);
  color:         var(--dash-gray-600);
  margin:        0 1px;
  transition:    background var(--dash-transition),
                 color       var(--dash-transition);
}
.dash-pagination .page-item.active .page-link {
  background:   var(--dash-primary);
  border-color: var(--dash-primary);
  color:        #fff;
}
.dash-pagination .page-item:not(.disabled):not(.active) .page-link:hover {
  background:   var(--dash-primary-light);
  color:        var(--dash-primary);
  border-color: var(--dash-primary);
}
.dash-pagination .page-item.disabled .page-link {
  color:      var(--dash-gray-200);
  background: transparent;
}

/* ─── KPI skeleton (carga asíncrona) ───────────────────────── */
.kpi-skeleton {
  display:    inline-block;
  width:      64px;
  height:     32px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--dash-gray-100) 25%,
    var(--dash-gray-200) 50%,
    var(--dash-gray-100) 75%);
  background-size: 200% 100%;
  animation:  skeleton-shimmer 1.4s infinite;
}

/* ─── KPI variante danger ───────────────────────────────────── */
.kpi-danger::before         { background: var(--dash-danger); }
.kpi-danger .kpi-icon-wrap  { background: var(--dash-danger-light); color: var(--dash-danger); }
.tag-danger                 { background: var(--dash-danger-light); color: var(--dash-danger); }

/* ─── Detalle modal info block ──────────────────────────────── */
.detail-info-block {
  background:    var(--dash-gray-50);
  border-radius: var(--dash-radius-sm);
  padding:       1rem 1.1rem;
}
.detail-info-block p      { margin-bottom: .4rem; font-size: .875rem; color: var(--dash-gray-800); }
.detail-info-block strong { color: var(--dash-gray-600); font-weight: 600; }

/* ─── waiting-input (select en espera de datos) ─────────────── */
.waiting-input {
  border-color: var(--dash-warning) !important;
  box-shadow:   0 0 0 3px rgba(245,158,11,.15) !important;
}

/* ─── Empty tbody row ───────────────────────────────────────── */
.empty-row td {
  padding: 2.5rem 1.25rem !important;
  color:   var(--dash-gray-400);
}

/* ═══════════════════════════════════════════════════════════════
   SECCIÓN: Componentes Geo-panel y formularios de mapa
   Movidas desde geocercas.blade.php <style> local → global.
   Usadas en: geocercas.blade, equipment_orden.blade, maps.blade
═══════════════════════════════════════════════════════════════ */

/* ─── Inputs y campos de formulario (offcanvas/panel) ────────── */
.geo-field {}

.geo-label {
  display:        block;
  font-size:      .78rem;
  font-weight:    700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color:          var(--dash-gray-400);
  margin-bottom:  .4rem;
}
.geo-label-hint {
  font-weight:    400;
  text-transform: none;
  letter-spacing: 0;
  font-size:      .72rem;
  color:          var(--dash-gray-400);
  float:          right;
}

.geo-input {
  width:         100%;
  padding:       .5rem .75rem;
  border:        1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  font-size:     .855rem;
  color:         var(--dash-gray-800);
  background:    #fff;
  transition:    border-color var(--dash-transition),
                 box-shadow   var(--dash-transition);
  font-family:   inherit;
}
.geo-input:focus {
  outline:      none;
  border-color: var(--dash-primary);
  box-shadow:   0 0 0 3px rgba(67,97,238,.1);
}
.geo-input::placeholder { color: var(--dash-gray-400); font-size: .835rem; }

.geo-select  { appearance: auto; }
.geo-textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

/* ─── Error de formulario ────────────────────────────────────── */
.geo-form-error {
  display:       flex;
  align-items:   center;
  padding:       .55rem .85rem;
  background:    var(--dash-danger-light);
  color:         var(--dash-danger);
  border:        1px solid #fca5a5;
  border-radius: var(--dash-radius-sm);
  font-size:     .825rem;
  font-weight:   500;
}

/* ─── Botones de acción del formulario en paneles de mapa ─────── */
.geo-btn-secondary {
  background:    var(--dash-primary-light);
  color:         var(--dash-primary);
  border:        1px solid rgba(67,97,238,.2);
  border-radius: var(--dash-radius-sm);
  padding:       .45rem .9rem;
  font-size:     .845rem;
  font-weight:   600;
  transition:    background var(--dash-transition),
                 box-shadow  var(--dash-transition);
}
.geo-btn-secondary:hover {
  background:  #dde3fc;
  color:       var(--dash-primary);
  box-shadow:  0 2px 8px rgba(67,97,238,.15);
}

.geo-btn-danger {
  background:    var(--dash-danger-light);
  color:         var(--dash-danger);
  border:        1px solid rgba(239,68,68,.2);
  border-radius: var(--dash-radius-sm);
  padding:       .45rem .9rem;
  font-size:     .845rem;
  font-weight:   600;
  transition:    background var(--dash-transition),
                 box-shadow  var(--dash-transition);
}
.geo-btn-danger:hover {
  background:  #fdd;
  color:       var(--dash-danger);
  box-shadow:  0 2px 8px rgba(239,68,68,.15);
}

/* ─── Búsqueda dentro del panel ──────────────────────────────── */
.geo-search-wrap { position: relative; }
.geo-search-icon {
  position:       absolute;
  left:           .75rem;
  top:            50%;
  transform:      translateY(-50%);
  font-size:      .9rem;
  color:          var(--dash-gray-400);
  pointer-events: none;
}
.geo-search-input {
  width:         100%;
  padding:       .5rem .75rem .5rem 2.25rem;
  border:        1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  font-size:     .835rem;
  color:         var(--dash-gray-800);
  background:    #fff;
  transition:    border-color var(--dash-transition),
                 box-shadow   var(--dash-transition);
}
.geo-search-input:focus {
  outline:      none;
  border-color: var(--dash-primary);
  box-shadow:   0 0 0 3px rgba(67,97,238,.1);
}
.geo-search-input::placeholder { color: var(--dash-gray-400); }

/* ─── Lista de items en panel izquierdo ─────────────────────── */
.geo-list-scroll {
  max-height:     44vh;
  overflow-y:     auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-gray-200) transparent;
}
.geo-list-scroll::-webkit-scrollbar       { width: 4px; }
.geo-list-scroll::-webkit-scrollbar-thumb { background: var(--dash-gray-200); border-radius: 10px; }

.geo-list-item {
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  padding:        .65rem .75rem;
  border-radius:  var(--dash-radius-sm);
  border-left:    3px solid transparent;
  cursor:         pointer;
  transition:     background     var(--dash-transition),
                  border-color   var(--dash-transition);
  margin-bottom:  2px;
}
.geo-list-item:hover {
  background:     var(--dash-gray-50);
  border-left-color: var(--dash-primary-light);
}
.geo-list-item.active {
  background:     var(--dash-primary-light);
  border-left-color: var(--dash-primary);
}
.geo-list-item-name {
  font-size:   .845rem;
  font-weight: 600;
  color:       var(--dash-gray-800);
  margin-bottom: .1rem;
}
.geo-list-item-meta { font-size: .75rem; color: var(--dash-gray-400); }
.geo-list-item-badge {
  width:       28px; height: 28px;
  border-radius: 8px;
  background:  var(--dash-primary-light);
  color:       var(--dash-primary);
  display:     flex; align-items: center; justify-content: center;
  font-size:   .85rem;
  flex-shrink: 0;
  transition:  background var(--dash-transition), color var(--dash-transition);
}
.geo-list-item.active .geo-list-item-badge {
  background: var(--dash-primary);
  color:      #fff;
}

/* ─── Empty state dentro del panel ──────────────────────────── */
.geo-list-empty { text-align: center; padding: 2rem 1rem; }
.geo-list-empty i { font-size: 2rem; color: var(--dash-gray-200); display: block; margin-bottom: .5rem; }
.geo-list-empty p { font-size: .825rem; color: var(--dash-gray-400); margin: 0; }

/* ─── Flash alerts flotantes (sobre mapa) ────────────────────── */
.geo-flash {
  position:    fixed;
  top:         80px;
  left:        50%;
  transform:   translateX(-50%);
  z-index:     9999;
  display:     flex;
  align-items: center;
  padding:     .65rem 1.1rem;
  border-radius: var(--dash-radius-sm);
  font-size:   .875rem;
  font-weight: 500;
  box-shadow:  var(--dash-shadow-md);
  min-width:   280px;
  max-width:   480px;
  animation:   geo-flash-in .25s ease;
}
@keyframes geo-flash-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.geo-flash-success {
  background: var(--dash-success-light);
  color:      var(--dash-success);
  border:     1px solid #86efac;
}
.geo-flash-error {
  background: var(--dash-danger-light);
  color:      var(--dash-danger);
  border:     1px solid #fca5a5;
}
/* ═══════════════════════════════════════════════════════════════
   ADDENDUM — dashboard.css
   Sección: Header, Sidebar, Notificaciones
   Agrega este bloque al FINAL de public/css/dashboard.css
═══════════════════════════════════════════════════════════════ */

/* ─── Sidebar brand ──────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .25rem 0;
  text-decoration: none;
}
.sidebar-brand-icon {
  font-size: 1.5rem;
  color: var(--dash-primary);
}
.sidebar-brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--dash-gray-800);
}

/* ─── Header icon button ─────────────────────────────────────── */
.hdr-icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--dash-gray-50);
  border: 1px solid var(--dash-gray-200);
  color: var(--dash-gray-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  transition: background var(--dash-transition), color var(--dash-transition),
              border-color var(--dash-transition), transform var(--dash-transition);
}
.hdr-icon-btn:hover {
  background: var(--dash-primary-light);
  color: var(--dash-primary);
  border-color: var(--dash-primary);
  transform: translateY(-1px);
}

/* ─── Notification badge ─────────────────────────────────────── */
.hdr-notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--dash-danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  animation: notif-pulse 2s infinite;
}
@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}

/* ─── Notification dropdown ──────────────────────────────────── */
.hdr-notif-dropdown {
  width: 380px;
  border: 1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  padding: 0;
  overflow: hidden;
}
.hdr-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--dash-gray-50);
  border-bottom: 1px solid var(--dash-gray-200);
}
.hdr-notif-count {
  font-size: .75rem;
  color: var(--dash-gray-400);
  font-weight: 500;
}
.hdr-notif-body {
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-gray-200) transparent;
}
.hdr-notif-body::-webkit-scrollbar       { width: 4px; }
.hdr-notif-body::-webkit-scrollbar-thumb { background: var(--dash-gray-200); border-radius: 10px; }

/* Notification items */
.notification-item {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--dash-gray-100);
  cursor: pointer;
  transition: background var(--dash-transition);
  border-left: 3px solid transparent;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover      { background: var(--dash-gray-50); }
.notification-item.unread {
  background: var(--dash-primary-light);
  border-left-color: var(--dash-primary);
}
.notification-item-title {
  font-size: .845rem;
  font-weight: 700;
  color: var(--dash-gray-800);
  margin-bottom: .2rem;
}
.notification-item-message {
  font-size: .8rem;
  color: var(--dash-gray-600);
  line-height: 1.45;
  margin-bottom: .25rem;
}
.notification-item-time {
  font-size: .72rem;
  color: var(--dash-gray-400);
}

/* Empty state inside notification dropdown */
.hdr-notif-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}
.hdr-notif-empty i {
  font-size: 2rem;
  color: var(--dash-gray-200);
  display: block;
  margin-bottom: .5rem;
}
.hdr-notif-empty p {
  font-size: .825rem;
  color: var(--dash-gray-400);
  margin: 0;
}

/* Footer */
.hdr-notif-foot {
  padding: .65rem 1.1rem;
  background: var(--dash-gray-50);
  border-top: 1px solid var(--dash-gray-200);
  text-align: center;
}
.hdr-notif-mark-all {
  font-size: .8rem;
  font-weight: 600;
  color: var(--dash-primary);
  text-decoration: none;
  transition: color var(--dash-transition);
}
.hdr-notif-mark-all:hover { color: #3451d1; }

/* ─── Alert strip (carousel) ─────────────────────────────────── */
.hdr-alert-strip {
  flex: 0 1 400px;
  min-width: 0;
  height: 36px;
  background: rgba(254,226,226,.75);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  margin: 0 1rem;
}
.hdr-alert-strip .carousel,
.hdr-alert-strip .carousel-inner { height: 100%; }
.hdr-alert-strip .carousel-item {
  height: 100%;
  display: none;
  align-items: center;
  padding: 0 32px;
}
.hdr-alert-strip .carousel-item.active { display: flex; }

.hdr-alert-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px;
  background: rgba(255,255,255,.6);
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--dash-danger);
  font-size: .7rem;
  transition: background var(--dash-transition);
  z-index: 5;
}
.hdr-alert-btn:hover { background: rgba(255,255,255,.9); }
.hdr-alert-prev { left: 4px; }
.hdr-alert-next { right: 4px; }

/* Alert content inside strip */
.alert-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: .5rem;
}
.alert-details { display: flex; align-items: center; gap: .4rem; min-width: 0; flex: 1; }
.alert-text    { min-width: 0; }
.alert-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--dash-danger);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.alert-subtitle {
  font-size: .72rem;
  color: var(--dash-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.alert-time { font-size: .68rem; color: var(--dash-gray-400); }
.map-link {
  cursor: pointer;
  color: var(--dash-danger);
  font-size: .85rem;
  flex-shrink: 0;
  transition: color var(--dash-transition);
}
.map-link:hover { color: #c53030; }

/* ─── Header profile button ──────────────────────────────────── */
.hdr-profile-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: .3rem .5rem;
  border-radius: 10px;
  transition: background var(--dash-transition);
}
.hdr-profile-btn:hover { background: var(--dash-gray-50); }

.hdr-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--dash-primary);
  color: #fff;
  font-size: .875rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hdr-avatar-lg {
  width: 42px; height: 42px;
  border-radius: 12px;
  font-size: 1rem;
}

/* Profile dropdown */
.hdr-profile-dropdown {
  min-width: 220px;
  border: 1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius);
  box-shadow: var(--dash-shadow-md);
  padding: .5rem 0;
}
.hdr-profile-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem 1rem;
}
.hdr-profile-item {
  font-size: .845rem;
  display: flex;
  align-items: center;
  padding: .5rem 1rem;
  color: var(--dash-gray-600);
  transition: background var(--dash-transition), color var(--dash-transition);
}
.hdr-profile-item:hover { background: var(--dash-gray-50); }
.hdr-profile-item.text-danger { color: var(--dash-danger) !important; }
.hdr-profile-item.text-danger:hover { background: var(--dash-danger-light); }

/* ─── Floating notifications (created by notifications.js) ───── */
#floating-notifications {
  position: fixed;
  top: 80px; right: 20px;
  width: 350px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.floating-notification {
  background: #fff;
  border-radius: var(--dash-radius-sm);
  padding: .85rem 1rem;
  box-shadow: var(--dash-shadow-md);
  border-left: 4px solid var(--dash-primary);
  pointer-events: auto;
  cursor: pointer;
  transition: transform var(--dash-transition), box-shadow var(--dash-transition);
  animation: float-in .25s ease;
}
@keyframes float-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.floating-notification:hover { transform: translateX(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.floating-notification.alert-type-danger   { border-left-color: var(--dash-danger); }
.floating-notification.alert-type-warning  { border-left-color: var(--dash-warning); }
.floating-notification.alert-type-success  { border-left-color: var(--dash-success); }
.floating-notification .float-close {
  opacity: .5;
  transition: opacity var(--dash-transition);
}
.floating-notification .float-close:hover { opacity: 1; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .hdr-notif-dropdown { width: 320px; }
  .hdr-alert-strip    { display: none; }
  #floating-notifications { width: 300px; right: 10px; }
}
@media (max-width: 575.98px) {
  .hdr-notif-dropdown { width: 280px; }
  #floating-notifications { width: 260px; }
}

/* ═══════════════════════════════════════════════════════════════
   VISTA GEOGRÁFICA — Toggle y Explorador Lateral (Vista B)
   Agregado en v2.2 — Dashboard Geographic Explorer
═══════════════════════════════════════════════════════════════ */

/* ─── Toggle de vista ────────────────────────────────────────── */
.geo-view-toggle {
  display: flex;
  border: 1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  overflow: hidden;
  background: var(--dash-gray-50);
}
.geo-view-btn {
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--dash-gray-400);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--dash-transition), color var(--dash-transition);
  white-space: nowrap;
  display: flex; align-items: center; gap: .25rem;
}
.geo-view-btn:hover  { color: var(--dash-primary); background: var(--dash-primary-light); }
.geo-view-btn.active {
  background: var(--dash-primary);
  color: #fff;
}

/* ─── Explorador lateral layout ──────────────────────────────── */
.geo-sb-layout {
  display: flex;
  min-height: 480px;
  border-top: 1px solid var(--dash-gray-100);
}

/* ─── Sidebar izquierdo ──────────────────────────────────────── */
.geo-sb-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--dash-gray-100);
  background: var(--dash-gray-50);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-gray-200) transparent;
  display: flex;
  flex-direction: column;
}
.geo-sb-sidebar::-webkit-scrollbar       { width: 4px; }
.geo-sb-sidebar::-webkit-scrollbar-thumb { background: var(--dash-gray-200); border-radius: 10px; }

/* Estado (agrupador) */
.geo-sb-state { border-bottom: 1px solid var(--dash-gray-100); }

.geo-sb-state-btn {
  width: 100%;
  padding: .7rem .9rem .5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transition: background var(--dash-transition);
}
.geo-sb-state-btn:hover { background: var(--dash-primary-light); }
.geo-sb-state.open .geo-sb-state-btn { background: var(--dash-primary-light); }

.geo-sb-state-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.geo-sb-state-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--dash-gray-800);
}
.geo-sb-state-count {
  font-size: .72rem;
  font-weight: 700;
  color: var(--dash-primary);
  background: var(--dash-primary-light);
  padding: .1rem .45rem;
  border-radius: 20px;
}
.geo-sb-state.open .geo-sb-state-count {
  background: var(--dash-primary);
  color: #fff;
}

/* Barra de proporción */
.geo-sb-bar-wrap {
  width: 100%;
  height: 3px;
  background: var(--dash-gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.geo-sb-bar {
  height: 100%;
  background: var(--dash-primary);
  border-radius: 3px;
  transition: width .4s ease;
}

/* Chevron */
.geo-sb-chevron {
  display: none; /* ocultamos el chevron, la barra es suficiente */
}

/* Municipios dentro del estado */
.geo-sb-munis {
  background: #fff;
}
.geo-sb-muni-btn {
  width: 100%;
  padding: .5rem .9rem .5rem 1.4rem;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8rem;
  color: var(--dash-gray-600);
  transition: background var(--dash-transition), border-color var(--dash-transition),
              color var(--dash-transition);
}
.geo-sb-muni-btn:hover {
  background: var(--dash-gray-50);
  border-left-color: var(--dash-primary-light);
  color: var(--dash-gray-800);
}
.geo-sb-muni-btn.active {
  background: var(--dash-primary-light);
  border-left-color: var(--dash-primary);
  color: var(--dash-primary);
  font-weight: 600;
}
.geo-sb-muni-name  { flex: 1; }
.geo-sb-muni-count {
  font-size: .72rem;
  font-weight: 700;
  color: var(--dash-gray-400);
  background: var(--dash-gray-100);
  padding: .05rem .4rem;
  border-radius: 20px;
  flex-shrink: 0;
}
.geo-sb-muni-btn.active .geo-sb-muni-count {
  background: var(--dash-primary);
  color: #fff;
}

/* Total */
.geo-sb-total {
  margin-top: auto;
  padding: .65rem .9rem;
  font-size: .78rem;
  color: var(--dash-gray-400);
  border-top: 1px solid var(--dash-gray-100);
}

/* ─── Panel derecho ──────────────────────────────────────────── */
.geo-sb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Search en el header del card */
.geo-sb-search {
  position: relative;
  width: 240px;
  flex-shrink: 0;
}
.geo-sb-search-icon {
  position: absolute;
  left: .7rem;
  top: 50%; transform: translateY(-50%);
  color: var(--dash-gray-400);
  font-size: .85rem;
  pointer-events: none;
}
.geo-sb-search-input {
  width: 100%;
  padding: .4rem .75rem .4rem 2.1rem;
  border: 1px solid var(--dash-gray-200);
  border-radius: var(--dash-radius-sm);
  font-size: .835rem;
  color: var(--dash-gray-800);
  background: #fff;
  transition: border-color var(--dash-transition), box-shadow var(--dash-transition);
}
.geo-sb-search-input:focus {
  outline: none;
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}
.geo-sb-search-input::placeholder { color: var(--dash-gray-400); }

/* Breadcrumb contextual */
.geo-sb-breadcrumb {
  display: flex;
  align-items: center;
  padding: .6rem 1rem;
  background: var(--dash-gray-50);
  border-bottom: 1px solid var(--dash-gray-100);
  font-size: .8rem;
  gap: .15rem;
  flex-shrink: 0;
}
.geo-sb-bc-state { font-weight: 600; color: var(--dash-gray-600); }
.geo-sb-bc-muni  { font-weight: 700; color: var(--dash-primary); }
.geo-sb-bc-count {
  font-size: .75rem;
  color: var(--dash-gray-400);
  background: var(--dash-gray-100);
  padding: .1rem .55rem;
  border-radius: 20px;
}

/* Tabla del panel */
.geo-sb-panel { flex: 1; display: flex; flex-direction: column; }
.geo-sb-table-wrap {
  flex: 1;
  max-height: 440px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-gray-200) transparent;
}
.geo-sb-table-wrap::-webkit-scrollbar       { width: 4px; }
.geo-sb-table-wrap::-webkit-scrollbar-thumb { background: var(--dash-gray-200); border-radius: 10px; }

/* No results */
.geo-sb-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--dash-gray-400);
}
.geo-sb-no-results i {
  font-size: 2rem;
  color: var(--dash-gray-200);
  display: block;
  margin-bottom: .5rem;
}
.geo-sb-no-results p { font-size: .875rem; margin: 0; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .geo-sb-layout  { flex-direction: column; }
  .geo-sb-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--dash-gray-100); }
  .geo-sb-search  { width: 100%; }
  .geo-sb-total   { display: none; }
}
