@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Playfair+Display:wght@600&display=swap');

/* ── VARIABLES ── */
:root {
    --cream: #FAF8F4;
    --ink: #1A1714;
    --ink-light: #6B6560;
    --ink-lighter: #B8B3AE;
    --accent: #2B5BDB;
    --accent-light: #E8EEFF;
    --accent-dark: #1A3A9E;
    --success: #1A7A4A;
    --success-bg: #E8F5EE;
    --warning: #B85C00;
    --warning-bg: #FFF3E8;
    --danger: #A32D2D;
    --danger-bg: #FCEBEB;
    --border: #E5E1DB;
    --surface: #FFFFFF;
    --shadow: 0 10px 30px rgba(26,23,20,0.08);
    --shadow-soft: 0 6px 20px rgba(26,23,20,0.06);
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.2px; }
p { font-weight: 400; }
.text-muted-glass { color: var(--ink-light); }

/* ── LAYOUT ── */
.app-shell { display: flex; min-height: 100vh; }

.main {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 220px;
    background: var(--ink);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.sidebar-logo-sq {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
}

.sidebar-logo-sq i { font-size: 14px; color: white; }
.sidebar-logo-name { color: white; font-size: 13px; font-weight: 600; }

.sidebar-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.sidebar-section { margin-bottom: 1.5rem; }

.sidebar-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.25);
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 2px;
    transition: all .15s;
    text-decoration: none;
}

.sidebar-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.sidebar-item.active { background: var(--accent); color: white; }
.sidebar-item i { font-size: 15px; opacity: .85; width: 16px; text-align: center; }
.sidebar-spacer { flex: 1; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0.75rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

.sidebar-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-name { color: white; font-size: 12px; font-weight: 500; }
.sidebar-user-role { color: rgba(255,255,255,0.35); font-size: 10px; }

/* ── TOPBAR ── */
.topbar {
    background: var(--surface);
    border-bottom: 0.5px solid var(--border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.topbar-sub { font-size: 12px; color: var(--ink-light); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── PAGE BODY ── */
.page-body {
    padding: 1.5rem;
}

/* ── BOTONES ── */
.btn-primary-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary-glass:hover { background: var(--accent-dark); color: white; }

.btn-secondary-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cream);
    color: var(--ink);
    border: 0.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s;
    text-decoration: none;
}

.btn-secondary-glass:hover { background: var(--border); }

.btn-danger-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 0.5px solid rgba(163,45,45,0.2);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s;
}

.btn-danger-glass:hover { background: #F7C1C1; }

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(163,45,45,0.08);
    border: 0.5px solid rgba(163,45,45,0.2);
    color: var(--danger);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s;
}

.btn-logout:hover { background: var(--danger-bg); }

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    background: transparent;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    color: var(--ink-light);
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    font-size: 15px;
}

.btn-back:hover { background: var(--cream); color: var(--ink); border-color: var(--ink-lighter); }

/* ── ALERTAS ── */
.alert-glass-danger {
    background: var(--danger-bg);
    border: 0.5px solid rgba(163,45,45,0.25);
    color: var(--danger);
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 14px;
}

.alert-glass-success {
    background: var(--success-bg);
    border: 0.5px solid rgba(26,122,74,0.25);
    color: var(--success);
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 14px;
}

/* ── TOOLBAR ── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 10px; }

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-light);
    cursor: pointer;
}

/* ── TABLA ── */
.table-wrap {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    overflow: visible;
}

.table-responsive { overflow: visible !important; }

.table-glass {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table-glass thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-light);
    font-weight: 500;
    padding: 10px 16px;
    background: var(--cream);
    border-bottom: 0.5px solid var(--border);
    text-align: left;
    border-radius: 10px 10px 0 0;
}

.table-glass tbody td {
    padding: 11px 16px;
    border-bottom: 0.5px solid var(--border);
    color: var(--ink) !important;
    font-size: 13px;
    background: transparent !important;
    vertical-align: middle;
}

.table-glass tbody tr:last-child td { border-bottom: none; }
.table-glass tbody tr:hover td { background: #F7F5F1 !important; }

/* ── BADGES ── */
.badge-rol {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.badge-admin-rol       { background: var(--accent-light); color: var(--accent); }
.badge-encuestador-rol { background: var(--success-bg);   color: var(--success); }

.badge-inactivo {
    display: inline-block;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

.badge-sync {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.badge-sincronizado { background: var(--success-bg); color: var(--success); }
.badge-pendiente    { background: var(--warning-bg); color: var(--warning); }
.fila-inactiva td   { opacity: 0.5; }

/* ── DROPDOWN ── */
.btn-tres-puntos {
    background: transparent;
    border: 0.5px solid var(--border);
    color: var(--ink-light);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all .15s;
    font-size: 14px;
}

.btn-tres-puntos:hover { background: var(--cream); color: var(--ink); }

.dropdown-menu-glass {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 9999;
}

.dropdown-menu-glass .dropdown-item {
    color: var(--ink);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    transition: background .15s;
}

.dropdown-menu-glass .dropdown-item:hover         { background: var(--cream); color: var(--ink); }
.dropdown-menu-glass .dropdown-item.text-danger-glass { color: var(--danger); }
.dropdown-menu-glass .dropdown-item.text-danger-glass:hover { background: var(--danger-bg); }
.dropdown-menu-glass .dropdown-divider { border-color: var(--border); margin: 4px 0; }

/* ── FORM ── */
.form-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
    display: block;
}

.page-body-centered {
    display: flex;
    justify-content: center;
    width: 100%;
}

.form-control, .form-select {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    transition: border .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,91,219,0.08);
    color: var(--ink);
    outline: none;
}

.form-control::placeholder { color: var(--ink-lighter); }
.form-control[readonly]    { opacity: 0.65; cursor: not-allowed; }
.form-check-input:checked  { background-color: var(--accent); border-color: var(--accent); }

.section-divider {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-lighter);
    font-weight: 500;
    margin: 1.25rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 0.5px;
    background: var(--border);
}

#previewFoto {
    display: none;
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    max-height: 240px;
    object-fit: cover;
}

.ubicacion-coords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

/* ── MODAL ── */
.modal-glass .modal-content {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    color: var(--ink);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-glass .modal-header { border-bottom: 0.5px solid var(--border); padding: 1.25rem 1.5rem; }
.modal-glass .modal-footer { border-top:    0.5px solid var(--border); padding: 1rem 1.5rem; }
.modal-glass .modal-title  { font-size: 15px; font-weight: 600; color: var(--ink); }
.modal-glass .modal-body p { font-size: 13px; color: var(--ink-light); }

/* ── OFFCANVAS ── */
.offcanvas              { background: var(--surface) !important; border-left: 0.5px solid var(--border) !important; }
.offcanvas-title        { color: var(--ink) !important; font-weight: 600; font-size: 15px; }
.offcanvas-header       { border-bottom: 0.5px solid var(--border); padding: 1.25rem 1.5rem; }
.offcanvas-body         { padding: 1.5rem; }
.btn-close              { filter: none !important; opacity: 0.4; }
.btn-close:hover        { opacity: 0.8; }

/* ── FORM CARD ── */
.form-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    overflow: hidden;
}

.form-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.form-card-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.form-card-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.form-card-sub   { font-size: 12px; color: var(--ink-light); }
.form-card-body  { padding: 1.5rem; }

.form-card-footer {
    padding: 1rem 1.5rem;
    border-top: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.foto-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ── STATS (dashboard) ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-light);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-numero { font-size: 28px; font-weight: 600; color: var(--ink); line-height: 1; }

/* ── CARDS ACCESO (dashboard) ── */
.cards-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }

.card-acceso {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    text-decoration: none;
    color: var(--ink);
    display: block;
}

.card-acceso:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,91,219,0.07);
    color: var(--ink);
}

.card-acceso-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.card-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}

.icon-encuestas, .icon-nueva { background: var(--accent-light); color: var(--accent); }
.icon-mapa                   { background: var(--success-bg);   color: var(--success); }
.icon-usuarios               { background: var(--warning-bg);   color: var(--warning); }

.card-acceso h5 { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.card-acceso p  { font-size: 12px; color: var(--ink-light); margin: 0; }
.card-arrow     { color: var(--ink-lighter); font-size: 18px; line-height: 1; }

.badge-admin {
    background: rgba(43,91,219,0.1);
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── GRÁFICO (dashboard) ── */
.chart-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.chart-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.chart-title  { font-size: 14px; font-weight: 600; color: var(--ink); }
.chart-sub    { font-size: 12px; color: var(--ink-light); margin-top: 2px; }

.chart-badge {
    background: var(--accent-light);
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.chart-wrap {
    position: relative;
    height: 300px;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--ink-lighter);
    font-size: 13px;
    gap: 8px;
}

.chart-empty i { font-size: 28px; }

/* ── PERFIL ── */
.perfil-wrap { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 16px; }

.avatar-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-circle {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── MAPA ── */
.map-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  flex: 1;
}

/* Panel lateral */
.side-panel {
  background: #fff;
  border: 0.5px solid #E5E1DB;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.panel-title    { font-size: 19px; font-weight: 600; color: #1A1714; }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-box {
  background: #FAF8F4;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.stat-box-full { grid-column: span 2; }

.stat-value { font-size: 22px; font-weight: 600; color: #1A1714; line-height: 1; }
.stat-value-mono { font-size: 12px; font-weight: 500; color: #1A1714; font-family: monospace; }

hr.panel-divider { border: none; border-top: 0.5px solid #E5E1DB; margin: 0; }

.section-label {
  font-size: 11px; font-weight: 600; color: #1A1714;
  text-transform: uppercase; letter-spacing: 0.07em;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; color: #6B6560; }

.filter-group .form-select,
.filter-group .form-control {
  font-size: 13px;
  padding: 0.4rem 0.65rem;
  border: 0.5px solid #E5E1DB;
  border-radius: 8px;
  background: #fff;
  color: #1A1714;
  box-shadow: none;
}
.filter-group .form-select:focus,
.filter-group .form-control:focus {
  border-color: #B8B3AE;
  box-shadow: none;
}

.btn-panel {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-size: 13px; color: #1A1714;
  background: none;
  border: 0.5px solid #E5E1DB;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.btn-panel:hover { background: #FAF8F4; }
.btn-panel-danger { color: #A32D2D; border-color: #F7C1C1; }
.btn-panel-danger:hover { background: #FCEBEB; }

.legend-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 12px; color: #6B6560;
}
.legend-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #2B5BDB;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px #2B5BDB;
  flex-shrink: 0;
}

/* Panel del mapa */
.map-panel {
  background: #fff;
  border: 0.5px solid #E5E1DB;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.map-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 0.5px solid #E5E1DB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.map-panel-title { font-size: 19px; font-weight: 600; color: #1A1714; }
.map-badge {
  font-size: 11px; padding: 3px 10px;
  border-radius: 20px;
  background: #E6EFFE; color: #185FA5;
  font-weight: 500; white-space: nowrap;
}

#map { flex: 1; min-height: 500px; }

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10) !important;
  border: 0.5px solid #E5E1DB !important;
  padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; width: auto !important; }
.leaflet-popup-tip { background: #fff !important; }

.popup-inner {
  font-family: 'DM Sans', sans-serif;
  padding: 14px 16px;
  min-width: 200px;
}
.popup-name {
  font-size: 14px; font-weight: 600; color: #1A1714;
  margin-bottom: 8px;
}
.popup-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #6B6560;
  margin-bottom: 4px;
}
.popup-row i { font-size: 13px; color: #2B5BDB; width: 14px; }
.popup-coords {
  font-size: 11px; font-family: monospace;
  background: #FAF8F4; border-radius: 6px;
  padding: 4px 8px; margin-top: 8px;
  color: #1A1714;
}

/* ── LOGIN ── */
.login-left {
    flex: 1;
    background: var(--ink);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    min-width: 280px;
}

.login-left-grid {
    position: absolute;
    inset: 0;
    background-image:
            linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.login-left-glow {
    position: absolute;
    inset: 0;
    background:
            radial-gradient(ellipse 80% 60% at 20% 80%, rgba(43,91,219,0.35) 0%, transparent 60%),
            radial-gradient(ellipse 60% 50% at 80% 20%, rgba(43,91,219,0.15) 0%, transparent 55%);
}

.login-brand {
    position: absolute;
    top: 2.5rem; left: 2.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.login-brand-sq {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}

.login-brand-sq i    { color: white; font-size: 15px; }
.login-brand-name    { color: white; font-weight: 600; font-size: 14px; }
.login-left-text     { position: relative; z-index: 1; }

.login-tagline {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: white;
    line-height: 1.3;
    margin-bottom: 8px;
}

.login-tagline-sub { font-size: 12px; color: rgba(255,255,255,0.4); letter-spacing: 0.3px; }

.login-right {
    flex: 1.1;
    max-width: 480px;
    background: var(--surface);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-title { font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.login-desc  { font-size: 13px; color: var(--ink-light); margin-bottom: 2rem; }

.input-group-text {
    background: var(--cream);
    border: 1px solid var(--border);
    color: var(--ink-light);
}

.btn-login {
    background: var(--accent);
    border: none;
    color: white;
    font-weight: 500;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    padding: 12px;
    border-radius: 8px;
    transition: background .2s;
    letter-spacing: 0.2px;
}

.btn-login:hover    { background: var(--accent-dark); color: white; }
.btn-login:active   { transform: scale(0.99); }
.btn-login:disabled { background: var(--ink-lighter); }

.alert-custom {
    background: var(--danger-bg);
    border: 0.5px solid rgba(163,45,45,0.25);
    color: var(--danger);
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 14px;
}

.login-footer { margin-top: 1.5rem; display: flex; align-items: center; gap: 8px; }
.login-footer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.login-footer-txt { font-size: 11px; color: var(--ink-lighter); }

/* ── HAMBURGUESA ── */
.hamburger-btn { display: none; }

/* From Uiverse.io by SouravBandyopadhyay */
.credenciales {
  display: flex;
  flex-direction: column;
  isolation: isolate;
  position: relative;
  width: 25rem;
  height: 6.2rem;
  background: var(--cream);
  border-radius: 1rem;
  overflow: hidden;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 16px;
  --gradient: linear-gradient(to bottom, #2eadff, #3d83ff, #2b5bdb);
  --color: #2b5bdb;
}

.credenciales:before {
  position: absolute;
  content: "";
  inset: 0.0625rem;
  border-radius: 0.9375rem;
  background: var(--cream);
  z-index: 2
}

.credenciales:after {
  position: absolute;
  content: "";
  width: 0.25rem;
  inset: 0.65rem auto 0.65rem 0.5rem;
  border-radius: 0.125rem;
  background: var(--gradient);
  transition: transform 300ms ease;
  z-index: 4;
}

.credenciales:hover:after {
  transform: translateX(0.15rem)
}

.notititle {
  color: var(--color);
  padding: 0.50rem 0.25rem 0.1rem 1.25rem;
  font-weight:600;
  font-size: 1.1rem;
  transition: transform 300ms ease;
  z-index: 5;
}

.credenciales:hover .notititle {
  transform: translateX(0.15rem)
}

.notibody {
  color: #99999d;
  padding: 0 1.25rem;
  transition: transform 300ms ease;
  z-index: 5;
}

.credenciales:hover .notibody {
  transform: translateX(0.25rem)
}

.notiglow,
.notiborderglow {
  position: absolute;
  width: 20rem;
  height: 20rem;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle closest-side at center, #2b5bdb, transparent);
  opacity: 0;
  transition: opacity 300ms ease;
}

.notiglow {
  z-index: 3;
}

.notiborderglow {
  z-index: 1;
}

.credenciales:hover .notiglow {
  opacity: 0.1
}

.credenciales:hover .notiborderglow {
  opacity: 0.1
}

.note {
  color: var(--color);
  position: fixed;
  top: 80%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.9rem;
  width: 75%;
}

/* ── ESTADISTICAS ── */

.stats-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.stat-card-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 6px;
  font-weight: 500;
}
.delta-up  { background: var(--success-bg); color: var(--success); }
.delta-neu { background: var(--cream); color: var(--ink-light); border: 0.5px solid var(--border); }

.stat-sub-text { font-size: 12px; color: var(--ink-light); margin-top: 4px; }

.period-tabs { display: flex; gap: 4px; }
.period-tab {
  font-size: 12px; padding: 5px 13px;
  border-radius: 20px; cursor: pointer;
  border: 0.5px solid var(--border);
  color: var(--ink-light);
  background: none;
  font-family: 'DM Sans', sans-serif;
  transition: all .15s;
}
.period-tab.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.period-tab:hover:not(.active) { background: var(--cream); }

.charts-main   { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 1.25rem; margin-bottom: 1.25rem; }
.charts-bottom { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; }

.chart-card-stat {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.chart-card-stat .chart-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.chart-card-stat .chart-sub   { font-size: 12px; color: var(--ink-light); margin-top: 2px; margin-bottom: 1rem; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.chart-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-light); }
.legend-sq      { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-sq-dash { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; background: var(--border); border: 1px dashed var(--ink-lighter); }

.rank-list { display: flex; flex-direction: column; gap: 11px; }
.rank-row  { display: flex; align-items: center; gap: 10px; }
.rank-num  { font-size: 11px; color: var(--ink-lighter); width: 16px; text-align: center; flex-shrink: 0; }
.rank-name { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 88px; }
.rank-bar-wrap { flex: 1; background: var(--cream); border-radius: 4px; height: 6px; overflow: hidden; }
.rank-bar  { height: 100%; border-radius: 4px; background: var(--accent); }
.rank-val  { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }

.donut-wrap   { display: flex; align-items: center; gap: 1rem; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.donut-row    { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.donut-label  { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-light); }
.donut-pct    { font-size: 12px; font-weight: 600; color: var(--ink); }

.empty-state {
  color: var(--ink-lighter); font-size: 13px;
  text-align: center; padding: 2rem 0;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        top: 0; left: 0;
        padding: 0.75rem 1rem;
        z-index: 300;
    }

    .mobile-topbar { display: flex; justify-content: space-between; align-items: center; }

    .hamburger-btn {
        display: block;
        background: transparent;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
    }

    .sidebar-menu { display: none; flex-direction: column; width: 100%; margin-top: 1rem; }
    .sidebar-menu.show { display: flex; }
    .sidebar-user { margin-top: 1rem; }

    .main { margin-left: 0 !important; margin-top: 90px; }
    .stats-grid, .cards-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    #map { height: 480px; }
}

@media (max-width: 640px) {
    .login-left  { display: none; }
    .login-right { max-width: 100%; padding: 2rem 1.5rem; }
}