:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: #3b82f6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

/* Barra de Navegación */
.navbar {
    width: 100%;
    margin-bottom: 2rem;
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    position: sticky;
    top: 0;
    z-index: 2000;
    overflow: visible !important;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.main-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    height: calc(85vh - 80px); /* Ajustado por la altura del nav */
    min-height: 600px;
    padding: 0 2rem 2rem 2rem;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Form Section */
.form-container {
    flex: 1;
    max-width: 450px;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: max-width 0.3s ease;
}

.form-container.promovido-mode {
    max-width: 100%; /* Expanded width when map is hidden */
}

/* 2-column Layout for Promovido Tab */
.promovido-grid {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.promovido-col-photos {
    flex: 0 0 320px; /* Fixed width column for photos */
}
.promovido-col-data {
    flex: 1; /* Takes remaining space */
}
.photo-row-vertical {
    flex-direction: column !important;
}

@media (max-width: 768px) {
    .promovido-grid {
        flex-direction: column;
    }
    .promovido-col-photos {
        flex: auto;
        width: 100%;
    }
}

/* Custom scrollbar for form container */
.form-container::-webkit-scrollbar {
    width: 6px;
}
.form-container::-webkit-scrollbar-track {
    background: transparent;
}
.form-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.header {
    margin-bottom: 1.25rem;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Multi-column rows */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* OCR Upload Area */
.ine-upload-area {
    border: 2px dashed var(--input-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    transition: all 0.3s ease;
    margin-bottom: 1.25rem;
    position: relative;
}

.ine-upload-area:hover, .ine-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.ine-upload-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.ine-upload-content p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.ocr-status {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ocr-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.ocr-status.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-group select {
    cursor: pointer;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Coordinates Display */
.coords-display {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.coord-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.coord-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.coord-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: #60a5fa;
    word-break: break-all;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Map Section */
.map-container {
    flex: 2;
    position: relative;
    padding: 0.5rem; /* Border thickness */
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 15px;
    z-index: 1;
    background-color: #1e293b; /* Placeholder color before map loads */
}

/* Customizing Leaflet Map to fit dark theme slightly */
.leaflet-container {
    font-family: 'Inter', sans-serif;
}
.leaflet-control-zoom a {
    background-color: var(--panel-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--panel-border) !important;
    backdrop-filter: blur(10px);
}
.leaflet-control-zoom a:hover {
    background-color: var(--primary-color) !important;
}

.map-overlay {
    position: absolute;
    inset: 0.5rem; /* Inside the padding */
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    transition: opacity 0.5s ease;
}

.map-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.pulse-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.map-overlay p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Utilities */
.class-hidden {
    display: none !important;
}

.class-hidden-desktop {
    display: none !important;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

.message.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: #34d399;
}

.message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: #f87171;
}

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

/* Dashboard Styles */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 90%;
    max-width: 90vw;
    padding: 0 2rem 2rem 2rem;
}

.dashboard-map-section {
    padding: 2rem;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.map-global {
    flex: 1;
    border-radius: 15px;
    border: 1px solid var(--panel-border);
}

.dashboard-table-section {
    padding: 2rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-table th {
    background-color: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: rgba(255,255,255,0.05);
}

.data-table td {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.text-center {
    text-align: center;
}

.loading-text {
    padding: 2rem;
    color: var(--text-secondary);
}

/* DataTables Custom Theme overriding default styles */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter, 
.dataTables_wrapper .dataTables_info, 
.dataTables_wrapper .dataTables_processing, 
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary) !important;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--input-focus);
}

.dataTables_wrapper .dataTables_length select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 0.2rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    border: 1px solid transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: white !important;
    background: var(--primary-color) !important;
    border: 1px solid var(--primary-hover) !important;
}

table.dataTable.no-footer {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

/* Ocultar botón de menú en escritorio por defecto */
.nav-toggle {
    display: none;
}

/* Responsive */
@media (max-width: 900px) {
    /* Navbar móvil de alto impacto */
    .navbar {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 1rem 1.5rem !important;
        margin-bottom: 1.25rem !important;
        position: sticky;
        top: 0;
        z-index: 2000;
        overflow: visible !important;
    }
    
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 2100;
        outline: none;
    }
    
    .nav-toggle span {
        width: 100%;
        height: 2px;
        background-color: var(--text-primary);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Animación del botón hamburguesa activo */
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Menú móvil vertical tipo overlay con desenfoque de cristal */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 1.5rem;
        z-index: 2050;
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 5rem 2rem 3rem 2rem;
        overflow-y: auto;
    }

    .class-hidden-desktop {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 0.5rem;
    }

    .mobile-user-avatar {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--primary-color);
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    .mobile-user-avatar-placeholder {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.8rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    .mobile-user-name-text {
        color: var(--text-primary);
        font-size: 1.2rem;
        margin-top: 0.5rem;
        text-align: center;
    }
    
    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    .nav-link {
        font-size: 1.2rem !important;
        padding: 0.75rem 2rem !important;
        width: 85%;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    .nav-link.active {
        background: rgba(59, 130, 246, 0.2) !important;
        border: 1px solid rgba(59, 130, 246, 0.4) !important;
    }
    
    .nav-link.logout-btn {
        margin-top: 1rem;
        width: 85% !important;
    }
    
    /* Contenedor principal adaptable */
    .main-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .dashboard-container {
        padding: 1rem;
    }

    .form-container {
        max-width: 100%;
        order: 2; /* Formulario abajo del mapa */
        padding: 1.5rem 1.25rem !important;
    }
    
    .map-container {
        height: 50vh;
        min-height: 380px;
        order: 1;
        padding: 0.25rem !important;
    }

    /* MAPA.PHP - Ajustes de Capas y Sidebar en móviles */
    .map-page-container {
        flex-direction: column !important;
        height: calc(100vh - 70px) !important;
    }
    
    .map-sidebar {
        width: 100% !important;
        height: auto !important;
        max-height: 240px !important;
        overflow-y: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--panel-border) !important;
        padding: 1rem !important;
        gap: 0.75rem !important;
    }

    .map-sidebar .header p {
        display: none !important;
    }
    
    .map-sidebar .header h1 {
        font-size: 1.15rem !important;
        margin-bottom: 0 !important;
        text-align: center;
    }

    .map-sidebar .layer-control-card {
        padding: 0.75rem !important;
        gap: 0.5rem !important;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .map-sidebar .layer-control-card h3 {
        grid-column: span 2;
        font-size: 0.85rem !important;
        margin-bottom: 0.1rem !important;
    }

    .map-sidebar .layer-control-card .layer-toggle {
        font-size: 0.8rem !important;
        gap: 0.5rem !important;
    }
    
    .map-sidebar .layer-control-card .layer-toggle[style*="border-top"] {
        grid-column: span 2;
        margin-top: 0.25rem !important;
        padding-top: 0.4rem !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
    }

    .map-sidebar .layer-control-card[style*="margin-top: auto"] {
        margin-top: 0 !important;
        padding: 0.5rem 0.75rem !important;
    }

    .map-sidebar .layer-control-card[style*="margin-top: auto"] h3 {
        display: none !important;
    }

    .map-sidebar .layer-control-card[style*="margin-top: auto"] button {
        padding: 0.4rem !important;
        font-size: 0.8rem !important;
    }

    .map-main {
        flex: 1 !important;
        height: 100% !important;
        width: 100% !important;
    }
}


/* Estilos para etiquetas de distritos estilo SIGE8 INE */
.district-tooltip {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    color: #1f2937 !important;
    text-transform: uppercase;
}
.district-label-tooltip {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}
.district-label-tooltip.base-fed {
    color: #1d4ed8; /* Azul federal */
}
.district-label-tooltip.base-loc {
    color: #db2777; /* Rosa/morado local */
}

/* ==========================================
   GLOBAL SIDEBAR STYLES (DESKTOP > 900PX)
   ========================================== */

/* Structure adjustments for body when sidebar is enabled */
@media (min-width: 901px) {
    body > nav.navbar {
        display: none !important;
    }

    body.has-sidebar {
        padding-left: 280px !important;
        padding-top: 70px !important; /* shift content down to accommodate top header bar */
        align-items: stretch !important;
    }
}

.sidebar-aside {
    width: 280px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--panel-border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
}

.sidebar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: none; /* Firefox */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
    width: 0;
    height: 0;
}

.sidebar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.sidebar-link.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

/* Estatus Badges */
.badge-estatus {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}
.badge-pendiente { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-proceso { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-atendido { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rechazado { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Responsive rule to hide sidebar */
@media (max-width: 900px) {
    .sidebar-aside {
        display: none !important;
    }
}

/* ==========================================
   TOP BAR & USER MENU (DESKTOP ONLY)
   ========================================== */
@media (min-width: 901px) {
    .top-header-bar {
        position: fixed;
        top: 0;
        left: 280px; /* starts right after the sidebar */
        right: 0;
        height: 70px;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--panel-border);
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0 3.5rem;
        z-index: 999;
    }
}

@media (max-width: 900px) {
    .top-header-bar {
        display: none !important;
    }
}

.user-profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: background-color 0.3s;
    user-select: none;
}

.user-profile-menu:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(59, 130, 246, 0.5);
    background: #1e293b;
}

.user-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid rgba(59, 130, 246, 0.4);
    font-size: 0.9rem;
}

.user-name-text {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-name-text::after {
    content: "▼";
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-profile-menu:hover .user-name-text::after {
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    background: #151d30;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 2000;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-dropdown.active {
    display: flex;
}

.user-dropdown-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.user-dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.user-dropdown-item.logout {
    color: #f87171;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-radius: 0 0 8px 8px;
}

.user-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs Styles */
.tabs-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}
.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}
.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.tab-content {
    display: none;
    width: 100%;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Photo Upload Blocks */
.photo-upload-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}
.photo-upload-block:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}
.photo-upload-block input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.photo-upload-block .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.photo-upload-block .text {
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}
.photo-upload-block img.preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    background: #000;
}
