:root {
    --primary: #e6192b;
    --primary-dark: #b31220;
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1f1f1f;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --danger: #d11124;
    --success: #057642;
    --warning: #f59e0b;
    --radius: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

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

/* Marca de agua institucional La Rioja como fondo de toda la app */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('assets/la_rioja_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* Aseguramos que el layout se vea por encima del fondo */
.layout,
.auth-container,
#toast-container {
    position: relative;
    z-index: 1;
}

/* 🔐 LOGIN / INDEX STYLES */
.center-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at top right, #e6192b, #b31220);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.auth-card {
    padding: 40px;
    text-align: center;
}

.logo-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.logo-triangle {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid var(--primary);
    transform: rotate(-45deg);
}

.brand-header h1 {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
}

.brand-header h1 span {
    color: var(--primary);
    display: block;
    font-size: 1.8rem;
}

.brand-header {
    margin-bottom: 30px;
}

/* 💻 DEVICE SELECTOR STYLES */
.device-selector {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.device-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--gray-200);
}

.device-option i {
    font-size: 1.8rem;
    color: var(--gray-600);
    transition: transform 0.3s ease;
}

.device-option span {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gray-600);
}

.device-option:hover {
    background: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
}

.device-option:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.device-option.active {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.device-option.active i, 
.device-option.active span {
    color: #3b82f6;
}

.device-option:active {
    transform: scale(0.95);
}

/* ============================================================
   📱 MODO MÓVIL — DISEÑO NATIVO LIMPIO
   ============================================================ */

body.mobile-mode {
    --radius: 20px;
    overflow: hidden;
}

/* ─── CABECERA SUPERIOR MÓVIL ─── */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    height: 56px;
    min-height: 56px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    position: sticky;
    top: 0;
    z-index: 2100;
    flex-shrink: 0;
}

body.mobile-mode .mobile-header {
    display: flex;
}

.mobile-header-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.mobile-header-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.mobile-header-gov {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-section {
    font-size: 0.92rem;
    font-weight: 900;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.03em;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--gray-600);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    min-height: unset !important;
}

.mobile-menu-btn:hover { background: var(--bg); }

/* ─── OVERLAY DEL SIDEBAR ─── */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2999;
    opacity: 0;
    transition: opacity 0.3s;
}

body.mobile-mode .mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ─── LAYOUT PRINCIPAL EN MÓVIL ─── */
body.mobile-mode .layout {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ─── SIDEBAR COMO DRAWER LATERAL ─── */
body.mobile-mode .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    z-index: 3000;
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex !important;
    flex-direction: column;
    overflow-y: auto;
}

body.mobile-mode .sidebar.active {
    left: 0 !important;
}

/* ─── CONTENIDO PRINCIPAL ─── */
body.mobile-mode .main-content {
    flex: 1;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* ─── VIEW HEADER NORMAL (NO FLOTANTE) ─── */
body.mobile-mode .view-header {
    position: static;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 14px;
    pointer-events: auto;
}

body.mobile-mode .view-header h1 {
    font-size: 1.35rem;
    margin-bottom: 4px;
}

body.mobile-mode .view-header p {
    font-size: 0.85rem;
}

/* 🎤 FAB (Floating Action Button) */
.mobile-fab-container {
    display: none;
    position: fixed;
    bottom: 30px; /* Adjust since bottom sheet is gone */
    right: 25px;
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.mobile-mode .mobile-fab-container {
    display: flex;
}

.fab-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(230, 25, 43, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.fab-btn:active {
    transform: scale(0.9);
}

.fab-btn.recording {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

.fab-status {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0;
    transition: 0.3s;
}

.fab-status.show {
    opacity: 1;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 25, 43, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(230, 25, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 25, 43, 0); }
}



/* Estilos de botones grandes para mobile */
body.mobile-mode .btn-primary, 
body.mobile-mode .btn-secondary {
    padding: 20px;
    font-size: 1.1rem;
    border-radius: 18px;
}

/* MODO PC (DASHBOARD - NO CAMBIAR) */
body.pc .sidebar {
    display: flex;
    width: 280px;
}

body.pc .main-content {
    padding: 40px;
}

body.pc .stats-grid {
    grid-template-columns: 2fr 1fr;
}



/* 📱 LAYOUT MULTI-PÁGINA */
.app-layout {
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--card);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    transition: 0.3s;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sidebar-header .logo-triangle {
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid var(--primary);
}

.sidebar-header h2 {
    font-weight: 800;
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.1;
    text-transform: uppercase;
}

.sidebar-header h2 span {
    color: var(--primary);
    display: block;
    font-size: 1.1rem;
}

/* Logo Gobierno de La Rioja */
.gov-logo-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gov-logo-icon svg {
    display: block;
    filter: drop-shadow(0 2px 6px rgba(230, 25, 43, 0.3));
    border-radius: 8px;
}

.gov-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.gov-subtitle {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--gray-600);
    text-transform: uppercase;
}

.gov-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Pie de Sidebar - Marca La Rioja Argentina */
.sidebar-brand-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: center;
}

/* Badge de Rol (Funcionario) */
.rol-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff3f3;
    color: var(--danger);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 7px 12px;
    border-radius: 20px;
    border: 1.5px solid #fca5a5;
    margin-bottom: 20px;
    width: fit-content;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer;
    transition: 0.2s;
}

.nav-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 15px rgba(230, 25, 43, 0.3);
}

/* Botones de servicios del gobierno - Rojo */
.nav-btn-gov {
    color: var(--primary);
}

.nav-btn-gov:hover {
    background: #fef2f2;
    color: var(--primary-dark);
}

.nav-btn-gov.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 15px rgba(230, 25, 43, 0.3);
}

/* Divisor de sección del sidebar */
.nav-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 5px 4px 5px;
    margin-top: 6px;
}

.nav-divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--primary);
    opacity: 0.25;
}

.nav-divider span {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    opacity: 0.8;
    white-space: nowrap;
}

.nav-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--primary);
    opacity: 0.25;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 800;
    font-size: 0.9rem;
}

.user-info small {
    color: var(--gray-600);
    font-size: 0.7rem;
}

.btn-logout {
    background: #fee2e2;
    color: #d11124;
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

/* 🏛️ MAIN CONTENT */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: var(--bg);
}

.view-container {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-container.active {
    display: block;
}

.view-header {
    margin-bottom: 30px;
}

.view-header h1 {
    font-weight: 800;
    font-size: 2rem;
    color: var(--primary);
}

.view-header p {
    color: var(--gray-600);
}

/* 🧱 UI COMPONENTS */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--bg);
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    width: 100%;
    background: white;
    color: var(--primary);
    padding: 14px;
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

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

/* 🗺️ MAP */
.map-box {
    height: 60vh;
    width: 100%;
    z-index: 1;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

/* 📊 STATS */
.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 15px;
}

.stat-item strong {
    font-size: 2.5rem;
    color: var(--primary);
}

/* 🚨 SOS */
.sos-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

.sos-menu {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.sos-menu.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

.sos-option {
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.sos-option.red {
    background: var(--danger);
}

.sos-option.blue {
    background: var(--primary);
}

/* 🔔 TOAST */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f1f1f;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Estilos para el Selector de Casa a Pantalla Completa */
.reg-map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    flex-direction: column;
    display: none;
}

.map-selector-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10000;
}

.btn-back {
    position: absolute;
    left: 0;
    background: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-instruction {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.map-instruction h3 {
    font-size: 1rem;
    color: var(--primary);
}

.map-instruction p {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.map-selector-footer {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 10000;
}

.btn-confirm-home {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(10, 102, 194, 0.4);
    cursor: pointer;
    transition: 0.3s;
}

.btn-map-selector {
    width: 100%;
    background: var(--gray-100);
    border: 2px dashed var(--gray-200);
    padding: 15px;
    border-radius: 12px;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#reg-map {
    flex: 1;
    width: 100%;
    height: 100vh;
}

/* 🚧 OBRAS PÚBLICAS */
.obras-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.obras-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.obra-card {
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: var(--card);
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.obra-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.obra-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.obra-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}

.obra-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-planificada {
    background: var(--gray-200);
    color: var(--gray-600);
}

.badge-ejecucion {
    background: #dcfce7;
    color: #166534;
}

.badge-pausada {
    background: #fef9c3;
    color: #854d0e;
}

.badge-finalizada {
    background: #dbeafe;
    color: #1e40af;
}

.obra-progress-container {
    width: 100%;
    background: var(--gray-200);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.obra-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.obra-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 5px;
    color: var(--gray-600);
}

/* Modal Obras */
.obra-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.obra-modal.active {
    display: flex;
    opacity: 1;
}

.obra-modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    animation: slideUp 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gray-200);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
    color: var(--text);
}

.close-btn:hover {
    background: var(--danger);
    color: white;
}

.obra-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
}

.obra-data-section {
    background: var(--bg);
    padding: 15px;
    border-radius: 12px;
}

.obra-data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--gray-200);
    padding-bottom: 5px;
}

.obra-data-label {
    font-weight: 700;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.obra-data-value {
    font-weight: 800;
    font-size: 0.9rem;
}

.obra-comments-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.obra-comment {
    background: var(--bg);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

/* 🚌 TRANSPORTE INTELIGENTE */
.transporte-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
}

.transporte-sidebar {
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.transporte-info-box {
    background: var(--bg);
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
}

.transporte-parada-item {
    background: var(--bg);
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 3px solid var(--gray-200);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transporte-parada-item:hover {
    border-left-color: var(--primary);
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.transporte-parada-item.active {
    border-left-color: var(--primary);
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.eta-floating-card {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    display: none;
    border-top: 4px solid var(--primary);
    animation: slideUp 0.3s ease;
}

.eta-floating-card.active {
    display: block;
}

/* ⚠️ ALERTAS DE SERVICIOS PÚBLICOS */
.servicios-layout {
    grid-template-columns: 1fr 350px;
}

@media (max-width: 768px) {
    .servicios-layout {
        grid-template-columns: 1fr;
    }
}

.alerta-item {
    background: white;
    border: 1px solid var(--gray-200);
    padding: 15px;
    border-radius: 12px;
    position: relative;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.alerta-item.alerta-Agua {
    border-left-color: #0ea5e9;
}

.alerta-item.alerta-Energía {
    border-left-color: #eab308;
}

.alerta-item.alerta-Gas {
    border-left-color: #f97316;
}

.alerta-eta {
    display: inline-block;
    background: var(--bg);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    margin-top: 10px;
}

.alerta-eta i {
    margin-right: 5px;
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100%;
        z-index: 2000;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 🚨 EMERGENCIAS Y ALERTAS OFICIALES */
.nav-btn-emergency {
    animation: emergPulse 2s infinite;
    position: relative;
    padding-left: 42px;
}

.nav-btn-emergency::before {
    content: '!';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes emergPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.75;
    }
}

.emerg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.emerg-header h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--danger);
}

.emerg-header p {
    color: var(--gray-600);
}

.emerg-live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fee2e2;
    color: var(--danger);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--danger);
    text-transform: uppercase;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: liveBlink 1s infinite;
}

@keyframes liveBlink {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.7);
    }
}

.emerg-sos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.emerg-sos-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.emerg-sos-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.emerg-sos-btn i {
    font-size: 1.8rem;
}

.emerg-sos-btn span {
    font-size: 0.8rem;
    font-weight: 700;
}

.emerg-sos-btn b {
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
}

.emerg-sos-btn.red {
    background: linear-gradient(135deg, #d11124, #e6192b);
}

.emerg-sos-btn.orange {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.emerg-sos-btn.blue {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.emerg-sos-btn.purple {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}

.emerg-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #d11124;
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 20px;
    animation: bannerBlink 1.5s infinite;
}

@keyframes bannerBlink {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(209, 17, 36, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(209, 17, 36, 0);
    }
}

.emerg-body {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

@media (max-width: 1024px) {
    .emerg-body {
        grid-template-columns: 1fr;
    }
}

.emerg-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: white;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    gap: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.emerg-map-legend div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.emerg-alerta-card {
    border-radius: 12px;
    padding: 14px;
    color: white;
    position: relative;
    overflow: hidden;
}

.emerg-alerta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.emerg-alerta-card h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.emerg-alerta-card p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.emerg-alerta-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.25);
    margin-top: 8px;
}

.emerg-historial-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--gray-200);
    font-size: 0.85rem;
}

.emerg-historial-item.leve {
    border-left-color: #3b82f6;
}

.emerg-historial-item.moderada {
    border-left-color: #f59e0b;
}

.emerg-historial-item.critica {
    border-left-color: #d11124;
}

/* 🎙️ REPORTE INTELIGENTE MULTIFORMATO */
.audio-module {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.audio-module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 800;
    color: var(--gray-600);
}

.audio-tip {
    background: #dcfce7;
    color: #166534;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.audio-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.audio-status.recording {
    border: 2px solid var(--danger);
    background: #fff5f5;
}

.audio-waveform {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
}

.audio-waveform span {
    width: 3px;
    background: #cbd5e1;
    border-radius: 3px;
    height: 30%;
}

.recording .audio-waveform span {
    background: var(--danger);
    animation: wave 1s infinite ease-in-out;
}

.recording .audio-waveform span:nth-child(1) {
    animation-delay: 0.1s;
}

.recording .audio-waveform span:nth-child(2) {
    animation-delay: 0.2s;
}

.recording .audio-waveform span:nth-child(3) {
    animation-delay: 0.3s;
}

.recording .audio-waveform span:nth-child(4) {
    animation-delay: 0.4s;
}

.recording .audio-waveform span:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes wave {

    0%,
    100% {
        height: 30%;
    }

    50% {
        height: 100%;
    }
}

.audio-controls {
    display: flex;
    gap: 10px;
}

.btn-audio-rec {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-audio-stop {
    flex: 1;
    background: var(--gray-600);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-audio-stop:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-audio-del {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    width: 45px;
    border-radius: 12px;
    cursor: pointer;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.form-divider span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
}

.photo-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.2s;
}

.photo-upload-box:hover {
    border-color: var(--primary);
    background: #fef2f2;
}

.location-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 700;
}

.location-indicator.no-location {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.location-indicator.has-location {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Admin Reports Grid */
/* Admin Reports Grid */
.admin-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

@media (max-width: 600px) {
    .admin-reports-grid {
        grid-template-columns: 1fr;
    }
}

/* 🙌 SISTEMA DE FEEDBACK CIUDADANO */
.feedback-container {
    background: #fdf2f8;
    border: 2px solid #fbcfe8;
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    animation: slideUp 0.3s ease-out;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #be185d;
    font-weight: 800;
    font-size: 0.9rem;
}

.stars-rating {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: 0.2s;
}

.star-btn.active {
    color: #f59e0b;
}

.star-btn:hover {
    transform: scale(1.2);
}

.feedback-input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f9a8d4;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.btn-feedback-send {
    width: 100%;
    background: #db2777;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* Notificación de Solucionado */
.notif-solucionado {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Admin Stats Mini Cards */
.admin-feedback-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-mini-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-mini-card b {
    font-size: 1.5rem;
    display: block;
    color: var(--primary);
}

.stat-mini-card span {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    font-weight: 700;
}

/* --- CHAT / COMUNICACION DIRECTA --- */
.chat-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.chat-box {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-bubble {
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    max-width: 85%;
    line-height: 1.3;
}

.msg-admin {
    align-self: flex-start;
    background: #f1f5f9;
    color: #334155;
    border-bottom-left-radius: 2px;
}

.msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-input-group {
    display: flex;
    gap: 5px;
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.85rem;
}

.btn-chat-send {
    background: var(--primary);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}





/* ─── OCULTAR ELEMENTOS SOLO DE ESCRITORIO EN MÓVIL ─── */
body.mobile-mode .sos-fab { display: none !important; }

/* ─── MAPA EN MOBILE ─── */
body.mobile-mode .map-box {
    height: 85vw;
    min-height: 300px;
    max-height: 480px;
    border-radius: 16px;
    overflow: hidden;
}

body.mobile-mode #mapaView {
    position: static !important;
    width: 100% !important;
    height: auto !important;
}

/* ─── SERVICIOS PÚBLICOS: GRID DE ESTADO ─── */
.servicios-status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* ─── TRANSPORTE: LAYOUT VERTICAL EN MOBILE ─── */
body.mobile-mode .transporte-layout {
    flex-direction: column !important;
    gap: 14px;
}

body.mobile-mode .transporte-sidebar {
    width: 100% !important;
    max-height: none;
    overflow-y: visible;
    order: 1;
}

body.mobile-mode .transporte-map-container {
    height: 280px !important;
    min-height: 280px;
    border-radius: 16px;
    overflow: hidden;
    order: 2;
}

body.mobile-mode #transporte-map {
    height: 280px !important;
}

/* ─── OBRAS: VERTICAL EN MOBILE ─── */
body.mobile-mode .obras-grid {
    grid-template-columns: 1fr !important;
}

body.mobile-mode #obras-map {
    height: 240px !important;
}

/* ─── SERVICIOS: MAPA Y LISTA VERTICAL ─── */
body.mobile-mode .servicios-layout {
    grid-template-columns: 1fr !important;
}

body.mobile-mode #servicios-map {
    height: 240px !important;
    border-radius: 14px;
}

/* ─── EMERGENCIAS: VERTICAL ─── */
body.mobile-mode .emerg-body {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px;
}

body.mobile-mode #emergencias-map {
    height: 240px !important;
}

/* ─── BOTONES TÁCTILES GRANDES ─── */
body.mobile-mode .nav-btn {
    min-height: 50px;
    font-size: 1rem;
    border-radius: 12px;
}

body.mobile-mode .btn-primary,
body.mobile-mode .btn-secondary {
    min-height: 50px;
    font-size: 1rem;
    border-radius: 12px;
    width: 100%;
}

/* Los botones pequeños (ícono/close) NO deben agrandarse */
body.mobile-mode .close-btn,
body.mobile-mode .mobile-menu-btn,
body.mobile-mode .btn-logout {
    min-height: unset !important;
    width: auto !important;
    font-size: inherit;
}

/* ─── FORMULARIOS ─── */
body.mobile-mode .input-group label {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

body.mobile-mode select,
body.mobile-mode input[type="text"],
body.mobile-mode input[type="email"],
body.mobile-mode input[type="number"],
body.mobile-mode textarea {
    font-size: 1rem;
    padding: 13px 14px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* ─── TARJETAS / CARDS ─── */
body.mobile-mode .card {
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
}

/* ─── TABLAS Y ESTADÍSTICAS ─── */
body.mobile-mode .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ─── MODALES ─── */
body.mobile-mode .obra-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 20px;
    margin: auto;
}

body.mobile-mode .obra-modal-grid {
    grid-template-columns: 1fr !important;
}

/* ─── LISTA DE REPORTES ─── */
body.mobile-mode .report-card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 16px;
}

body.mobile-mode .report-actions {
    flex-wrap: wrap;
    gap: 8px;
}

body.mobile-mode .report-actions button {
    flex: 1 1 auto;
    min-width: 100px;
}

/* ─── MAPA DE TRANSPORTE ─── */
body.mobile-mode .transporte-layout {
    flex-direction: column !important;
}

body.mobile-mode .transporte-sidebar {
    width: 100% !important;
    max-height: 40vh;
    overflow-y: auto;
}

body.mobile-mode #transporteMap,
body.mobile-mode #servicios-map,
body.mobile-mode #emergencias-map,
body.mobile-mode #obras-map {
    height: 240px !important;
    border-radius: 16px;
    margin-bottom: 14px;
}

/* ─── SECCIÓN DE EMERGENCIAS ─── */
body.mobile-mode .emerg-alerta-card {
    padding: 14px;
    border-radius: 14px;
    font-size: 0.92rem;
}

/* ─── TABS ─── */
body.mobile-mode .tab-btn {
    font-size: 0.85rem;
    padding: 8px 10px;
    min-height: unset !important;
}

/* ─── SCROLLBAR DELGADO EN MOBILE ─── */
body.mobile-mode ::-webkit-scrollbar { width: 4px; }
body.mobile-mode ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ─── FOOTER PADDING PARA NO TAPAR FAB ─── */
body.mobile-mode .main-content > .view-container.active:last-child {
    padding-bottom: 100px;
}

/* ─── MIS REPORTES: TIMELINE Y CARDS ─── */
.misrep-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.misrep-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
}

.misrep-stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.misrep-card {
    padding: 16px;
    transition: transform 0.2s;
}

.misrep-card:hover { transform: translateY(-3px); }

.report-timeline {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    position: relative;
    padding-top: 10px;
}

.report-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.timeline-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25%;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 3px solid white;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.timeline-step span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    text-align: center;
}

.timeline-step.done .timeline-dot { background: var(--primary); }
.timeline-step.done span { color: var(--gray-800); }
.timeline-step.current .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(230, 25, 43, 0.2);
    transform: scale(1.2);
}

/* ─── GUÍA DE TRÁMITES ─── */
.tramites-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.tramites-search-box:focus-within { border-color: var(--primary); }

.tramites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.tramites-cat-card {
    background: white;
    padding: 16px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.tramites-cat-card i { font-size: 1.5rem; }
.tramites-cat-card span { font-size: 0.75rem; font-weight: 700; color: var(--gray-600); }
.tramites-cat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.tramites-cat-card.selected { border-color: var(--primary); background: #fff1f2; }

.tramites-item {
    padding: 16px;
    border-left: 4px solid var(--primary);
}

.tramites-cat-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    background: #fff1f2;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ─── BOT DE TRÁMITES ─── */
.tramites-bot-card {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    height: 400px;
    padding: 0;
    overflow: hidden;
}

.tramites-bot-header {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.bot-online-badge {
    font-size: 0.6rem;
    font-weight: 800;
    color: #057642;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 4px;
}

.tramites-bot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}

.bot-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.bot-msg-bot {
    align-self: flex-start;
    background: #f1f5f9;
    color: var(--gray-800);
    border-bottom-left-radius: 2px;
}

.bot-msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.tramites-bot-input {
    padding: 12px;
    display: flex;
    gap: 8px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.tramites-bot-input input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

.bot-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.bot-send-btn:hover { transform: scale(1.1); }

/* Adaptaciones Mobile */
body.mobile-mode .misrep-stats-grid { grid-template-columns: 1fr; gap: 8px; }
body.mobile-mode .tramites-grid { grid-template-columns: repeat(2, 1fr); }
body.mobile-mode .tramites-bot-card { height: 450px; }
body.mobile-mode .timeline-step span { font-size: 0.55rem; }

/* ─── ADMIN: HERRAMIENTAS AVANZADAS ─── */
.heatmap-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.heatmap-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.admin-card {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.btn-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-circle:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

.admin-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.ia-suggestion {
    font-size: 0.6rem;
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.quick-responses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
}

.quick-responses button {
    background: #f1f5f9;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-responses button:hover {
    background: var(--primary);
    color: white;
}

/* ─── ANIMACIONES DE ESTADO ─── */
@keyframes gearRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes alertPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 25, 43, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(230, 25, 43, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 25, 43, 0); }
}

@keyframes fadeOutReport {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

.status-icon-rotating {
    display: inline-block;
    animation: gearRotate 3s linear infinite;
}

.urgency-pulse {
    animation: alertPulse 1.5s infinite;
}

.report-fade-out {
    animation: fadeOutReport 0.5s forwards;
}

/* Estilos de Gravedad */
.marker-urgente {
    border: 3px solid #e6192b;
    border-radius: 50%;
    background: white;
}

.marker-intermedio {
    border: 2px solid #f59e0b;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Tarjetas Dinámicas */
.admin-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.admin-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--border);
    transition: background 0.3s;
}

.admin-card.urgent::before { background: #e6192b; }
.admin-card.medium::before { background: #f59e0b; }
.admin-card.process::before { background: #0a66c2; }
.admin-card.solved::before { background: #057642; }

.status-badge-visual {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
}

.sb-review { background: #f1f5f9; color: #475569; }
.sb-process { background: #eff6ff; color: #1d4ed8; }
.sb-solved { background: #ecfdf5; color: #059669; }

/* Mobile Optimizations */
body.mobile-mode .status-badge-visual {
    font-size: 0.6rem;
    padding: 3px 8px;
}

body.mobile-mode .admin-card-header b {
    font-size: 1rem;
}

/* ADAPTACIONES MOBILE ADMIN */
body.mobile-mode .admin-controls-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

body.mobile-mode .heatmap-btn span {
    display: none;
}

body.mobile-mode .heatmap-btn {
    padding: 10px;
    border-radius: 50%;
    top: 10px;
    right: 10px;
}

body.mobile-mode .admin-card {
    padding: 15px;
}