/* Reset y base optimizado para móviles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Pantallas */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen - Optimizado para móviles */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(15px, 4vw, 20px);
}

.login-header {
    text-align: center;
    margin-bottom: clamp(25px, 6vw, 40px);
    color: white;
    width: 100%;
    max-width: min(400px, 90vw);
}

.login-header h1 {
    font-size: clamp(2em, 8vw, 3em);
    margin-bottom: clamp(8px, 2vw, 10px);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.login-header p {
    font-size: clamp(1em, 4vw, 1.2em);
    opacity: 0.9;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: clamp(25px, 6vw, 40px);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: min(400px, 90vw);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.input-group {
    margin-bottom: clamp(15px, 4vw, 20px);
}

.input-group label {
    display: block;
    margin-bottom: clamp(5px, 1.5vw, 8px);
    font-weight: 600;
    color: #555;
    font-size: clamp(0.9em, 3.5vw, 1em);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: clamp(10px, 3vw, 12px) clamp(12px, 3vw, 15px);
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: clamp(0.9em, 3.5vw, 1em);
    transition: border-color 0.3s;
    font-family: inherit;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Botones Base - Responsive */
.btn {
    padding: clamp(10px, 3vw, 12px) clamp(15px, 4vw, 25px);
    border: none;
    border-radius: 8px;
    font-size: clamp(0.9em, 3.5vw, 1em);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

/* ========== HEADER RESPONSIVE CORREGIDO ========== */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: clamp(10px, 3vw, 15px) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 clamp(15px, 4vw, 20px);
    gap: clamp(10px, 3vw, 15px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: clamp(10px, 3vw, 15px);
    flex: 1;
}

.header-title {
    font-size: clamp(1.2em, 5vw, 1.8em);
    color: #333;
    margin: 0;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px; /* Espacio generoso entre grupos */
}

/* Contenedor para usuario + tipo */
.user-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: clamp(0.9em, 3vw, 1em);
    line-height: 1.2;
}

.user-type {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: clamp(0.65em, 2vw, 0.75em);
    font-weight: 600;
    white-space: nowrap;
}

/* Botones */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-buttons .btn {
    padding: 8px 16px;
    font-size: clamp(0.8em, 2.5vw, 0.9em);
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
}

.user-info-mobile {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.user-details-mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.menu-toggle:hover {
    background: #f5f5f5;
}

/* ========== SIDEBAR CORREGIDO ========== */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
    position: relative;
}

.sidebar-content {
    padding: 20px 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.menu-item {
    margin: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: clamp(12px, 3vw, 15px) clamp(20px, 4vw, 25px);
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: clamp(0.9em, 3vw, 1em);
}

.menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #3498db;
}

.menu-link.active {
    background: rgba(52, 152, 219, 0.2);
    color: white;
    border-left-color: #3498db;
    font-weight: 600;
}

.menu-icon {
    font-size: 1.2em;
    margin-right: 15px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    font-size: 1em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== BOTONES MÓVIL EN SIDEBAR ========== */
.mobile-menu-buttons {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    margin: 0;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.mobile-menu-buttons .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-size: 0.95em;
    backdrop-filter: blur(10px);
}

.mobile-menu-buttons .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

/* ========== MAIN LAYOUT ========== */
.main-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.main-content {
    flex: 1;
    padding: clamp(20px, 4vw, 30px) clamp(15px, 3vw, 20px);
    background: #f8f9fa;
    overflow-y: auto;
    min-height: calc(100vh - 70px);
    max-width: 100%;
}

/* ========== DASHBOARD CARDS ========== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(15px, 3vw, 20px);
    margin-bottom: 30px;
    width: 100%;
}

.card {
    background: white;
    padding: clamp(20px, 4vw, 25px);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
    width: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.card.active {
    border-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff0 100%);
    transform: scale(1.02);
}

.card h3 {
    color: #555;
    margin-bottom: clamp(10px, 2vw, 15px);
    font-size: clamp(0.9em, 3vw, 1.1em);
    font-weight: 600;
    line-height: 1.3;
}

.card-number {
    font-size: clamp(1.8em, 6vw, 2.5em);
    font-weight: bold;
    color: #667eea;
    margin-bottom: clamp(6px, 1.5vw, 10px);
    line-height: 1;
}

.card.active .card-number {
    color: #28a745;
}

.card p {
    color: #555;
    font-size: clamp(0.8em, 2.5vw, 0.9em);
    line-height: 1.4;
    margin: 0;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: 1em;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-button.active {
    background: #667eea;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #f8f9fa;
}

.tab-button.hidden {
    display: none;
}

.tab-pane {
    display: none;
    width: 100%;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== TABLAS ========== */
.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 10px 15px;
    font-size: clamp(0.85em, 2.5vw, 0.9em);
    min-width: auto;
    flex: 1;
    min-width: 120px;
}

.search-input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: min(300px, 100%);
    font-size: clamp(0.9em, 3vw, 1em);
}

.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow-x: auto;
    margin-bottom: 20px;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: clamp(10px, 2vw, 15px);
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    font-size: clamp(0.85em, 2.5vw, 0.95em);
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
}

/* ========== MENSAJES ========== */
.message {
    padding: clamp(12px, 3vw, 15px);
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    font-size: clamp(0.9em, 3vw, 1em);
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ========== FORMULARIOS MODERNOS ========== */
.modern-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: clamp(25px, 5vw, 40px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: clamp(25px, 5vw, 40px);
}

.form-header h3 {
    color: #667eea;
    font-size: clamp(1.5em, 6vw, 2.2em);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.form-header h3::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.form-header p {
    color: #718096;
    font-size: clamp(1em, 3vw, 1.2em);
    margin-top: 25px;
    line-height: 1.6;
}

.form-section {
    margin-bottom: clamp(25px, 5vw, 40px);
    padding: clamp(20px, 4vw, 35px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.8;
}

.form-section:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.form-section h4 {
    color: #2d3748;
    margin-bottom: clamp(20px, 4vw, 30px);
    font-size: clamp(1.1em, 4vw, 1.4em);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
    position: relative;
}

.form-section h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
}

.modern-form-fields .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(20px, 3vw, 30px);
    margin-bottom: 25px;
}

.modern-form-fields .full-width {
    grid-column: 1 / -1;
}

.modern-input {
    position: relative;
    margin-bottom: 20px;
}

.modern-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #4a5568;
    font-size: clamp(0.9em, 3vw, 1em);
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-input-field {
    width: 100%;
    padding: clamp(14px, 3vw, 18px) clamp(16px, 3vw, 20px);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: clamp(0.95em, 3vw, 1.05em);
    background: #f7fafc;
    transition: all 0.3s ease;
    outline: none;
    color: #2d3748;
    font-family: inherit;
}

.modern-input-field:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.modern-input-field::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.input-underline {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.modern-input-field:focus ~ .input-underline {
    width: 100%;
}

.modern-input-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23667eea'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
    padding-right: 60px;
    cursor: pointer;
}

.modern-input-field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 50px;
    flex-wrap: wrap;
}

.btn-modern {
    padding: clamp(14px, 3vw, 18px) clamp(25px, 4vw, 40px);
    border: none;
    border-radius: 14px;
    font-size: clamp(1em, 3vw, 1.1em);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: min(220px, 100%);
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.btn-primary-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4a9a 100%);
}

.btn-secondary-modern {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary-modern:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    border-color: #cbd5e0;
}

.btn-icon {
    font-size: 1.3em;
}

.modern-message {
    padding: clamp(15px, 3vw, 20px) clamp(20px, 3vw, 25px);
    border-radius: 12px;
    margin-top: 25px;
    border-left: 4px solid;
    font-weight: 600;
    font-size: clamp(0.9em, 3vw, 1em);
    text-align: center;
}

.modern-message.success {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    color: #22543d;
    border-left-color: #38a169;
}

.modern-message.error {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    color: #742a2a;
    border-left-color: #e53e3e;
}

/* ========== SECCIONES ========== */
.equipo-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section {
    background: white;
    border-radius: 12px;
    padding: clamp(20px, 4vw, 25px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e9ecef;
    width: 100%;
}

.section-spaced {
    margin-bottom: 40px !important;
    padding: clamp(25px, 4vw, 30px) !important;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    background: white;
}

.section-spaced:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(20px, 4vw, 25px);
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.section-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: clamp(1.1em, 4vw, 1.4em);
    font-weight: 600;
}

/* ========== BADGES ========== */
.tipo-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: clamp(0.75em, 2.5vw, 0.85em);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.tipo-administrador {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.tipo-candidato {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.tipo-estrategia {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.tipo-lider {
    background: linear-gradient(135deg, #6f42c1 0%, #59359e 100%);
    color: white;
}

.tipo-gestion {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
    color: white;
}

.estado-activo {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
    border: 1px solid #c3e6cb;
}

.estado-inactivo {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
    border: 1px solid #f5c6cb;
}

.estado-consultado {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
    border: 1px solid #ffeaa7;
}

.usuario-seleccionado {
    background-color: #e3f2fd !important;
    border-left: 4px solid #2196f3;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2);
}

/* ========== MODALES ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: min(95%, 1000px);
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: clamp(20px, 4vw, 25px) clamp(25px, 4vw, 30px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.modal-header h3 {
    margin: 0;
    font-size: clamp(1.3em, 4vw, 1.6em);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 40px;
    min-height: 40px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    padding: 0;
    max-height: 65vh;
    overflow-y: auto;
}

.info-registro {
    padding: 0;
}

.info-section {
    padding: clamp(20px, 4vw, 30px);
    border-bottom: 1px solid #e8ecef;
    transition: all 0.3s ease;
    position: relative;
}

.info-section:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}

.info-section:last-child {
    border-bottom: none;
}

.info-section h4 {
    color: #2d3748;
    margin-bottom: clamp(20px, 4vw, 25px);
    font-size: clamp(1.1em, 4vw, 1.3em);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.info-section h4::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: clamp(15px, 3vw, 20px);
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.info-item:hover::before {
    opacity: 1;
}

.info-item label {
    font-weight: 700;
    color: #4a5568;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item span {
    color: #2d3748;
    font-size: clamp(0.95em, 3vw, 1.05em);
    line-height: 1.5;
    word-break: break-word;
    font-weight: 500;
}

.info-text {
    font-weight: 600;
    color: #2d3748;
    font-size: clamp(1em, 3vw, 1.1em);
    padding: 10px 15px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: block;
}

.modal-content .form-container {
    padding: 20px;
}

.modal-content .form-row {
    margin-bottom: 20px;
}

.modal-content .input-group {
    margin-bottom: 15px;
}

.modal-content .input-group label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.modal-content .input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.modal-content .input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer-centered {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    padding: clamp(20px, 4vw, 30px);
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 20px 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.btn-modal {
    padding: clamp(14px, 3vw, 16px) clamp(25px, 4vw, 32px);
    border: none;
    border-radius: 12px;
    font-size: clamp(0.9em, 3vw, 1em);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(180px, 100%);
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-modal:hover::before {
    left: 100%;
}

.btn-modal:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-secondary-modal {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary-modal:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

.btn-warning-modal {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.btn-warning-modal:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
}

.btn-danger-modal {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger-modal:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.btn-info-modal {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-info-modal:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

/* ========== CARGA MASIVA ========== */
.carga-masiva-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.carga-paso {
    animation: fadeIn 0.5s ease-in;
}

.carga-form-container {
    background: white;
    padding: clamp(20px, 4vw, 30px);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 100%;
}

.procesando-container {
    text-align: center;
    padding: clamp(30px, 6vw, 40px) 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progreso-carga {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 20px 0;
    position: relative;
    height: 20px;
}

.progreso-bar {
    height: 100%;
    background-color: #28a745;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progreso-texto {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: bold;
}

.resumen-carga {
    background: #f8f9fa;
    border-radius: 8px;
    padding: clamp(15px, 3vw, 20px);
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.resumen-item:last-child {
    border-bottom: none;
}

.resumen-label {
    font-weight: 600;
    color: #495057;
    font-size: clamp(0.9em, 3vw, 1em);
}

.resumen-valor {
    font-weight: bold;
    color: #667eea;
    font-size: clamp(0.9em, 3vw, 1em);
}

.lista-detalles {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
}

.detalle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
}

.detalle-item.exitoso {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.detalle-item.duplicado {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.detalle-item.error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.detalle-info {
    flex: 1;
}

.detalle-documento {
    font-weight: 600;
    font-size: clamp(0.9em, 3vw, 1em);
}

.detalle-nombre {
    font-size: clamp(0.85em, 2.5vw, 0.9em);
    opacity: 0.8;
}

.detalle-estado {
    font-weight: 600;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.3);
}

.detalle-mensaje {
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* ========== ESTILOS UBICACIÓN ========== */
.progreso-container {
    position: relative;
    background: #f0f0f0;
    border-radius: 10px;
    height: 24px;
    overflow: hidden;
    width: 100%;
    max-width: min(200px, 100%);
    margin: 0 auto;
}

.progreso-bar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    min-width: 0%;
}

.progreso-texto {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 600;
    font-size: clamp(0.75em, 2.5vw, 0.85em);
    text-shadow: 0 0 2px white;
    z-index: 2;
}

.badge-cantidad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: clamp(6px, 2vw, 8px) clamp(12px, 3vw, 16px);
    border-radius: 20px;
    font-weight: bold;
    font-size: clamp(0.85em, 3vw, 0.95em);
    min-width: 50px;
    text-align: center;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

#table-comunas td:nth-child(3),
#table-barrios td:nth-child(3) {
    text-align: center;
}

#table-comunas td:nth-child(2),
#table-barrios td:nth-child(2) {
    text-align: center;
}

#table-comunas td:nth-child(1),
#table-barrios td:nth-child(1) {
    font-weight: 600;
    color: #2d3748;
}

.doble-clic-hint {
    position: relative;
}

.doble-clic-hint::after {
    content: '🖱️ Doble clic para ver detalles';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(0.7em, 2vw, 0.75em);
    color: #667eea;
    opacity: 0;
    transition: opacity 0.3s ease;
}

tr:hover .doble-clic-hint::after {
    opacity: 1;
}

/* ========== VOTANTES ========== */
.votantes-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

#votantes-cards {
    margin-bottom: 30px;
}

#votantes-cards .card {
    background: white;
    padding: clamp(20px, 4vw, 25px);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

#votantes-cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#votantes-cards .card.active {
    border-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff0 100%);
    transform: scale(1.02);
}

#votantes-cards .card h3 {
    color: #555;
    margin-bottom: clamp(10px, 2vw, 15px);
    font-size: clamp(0.9em, 3vw, 1.1em);
}

#votantes-cards .card-number {
    font-size: clamp(1.8em, 6vw, 2.5em);
    font-weight: bold;
    color: #667eea;
    margin-bottom: clamp(6px, 1.5vw, 10px);
}

#votantes-cards .card.active .card-number {
    color: #28a745;
}

#votantes-contenido {
    background: white;
    border-radius: 10px;
    padding: clamp(20px, 4vw, 25px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-height: 400px;
    width: 100%;
}

.navegacion-votantes {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.breadcrumb-votantes {
    display: flex;
    align-items: center;
    gap: clamp(6px, 2vw, 10px);
    font-size: clamp(0.8em, 2.5vw, 0.9em);
    color: #6c757d;
    flex-wrap: wrap;
}

.breadcrumb-votantes .separator {
    color: #adb5bd;
}

.breadcrumb-votantes .nivel {
    cursor: pointer;
    padding: clamp(4px, 1.5vw, 5px) clamp(8px, 2vw, 10px);
    border-radius: 5px;
    transition: background 0.3s;
    white-space: nowrap;
}

.breadcrumb-votantes .nivel:hover {
    background: #f8f9fa;
}

.breadcrumb-votantes .nivel.actual {
    color: #495057;
    font-weight: 600;
}

.tabla-navegacion tbody tr {
    cursor: pointer;
    transition: background 0.3s;
}

.tabla-navegacion tbody tr:hover {
    background: #f8f9fa;
}

.tabla-navegacion .badge-cantidad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
}

.votante-apto { border-left: 4px solid #28a745; }
.votante-consulado { border-left: 4px solid #17a2b8; }
.votante-problema { border-left: 4px solid #ffc107; }
.votante-fallecido { border-left: 4px solid #dc3545; }

/* ========== MEDIA QUERIES CORREGIDAS ========== */

/* Tablets */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: nowrap;
    }
    
    .header-left {
        flex: 0 0 auto;
    }
    
    .user-info-desktop {
        gap: 12px;
    }
    
    .header-buttons {
        gap: 8px;
    }
    
    .header-buttons .btn {
        padding: 8px 12px;
    }
}

/* Móviles - COMPORTAMIENTO CORREGIDO */
@media (max-width: 768px) {

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    
    .mobile-menu-buttons {
        display: flex;
        order: 2; /* Los botones van DESPUÉS del menú */
        margin-top: 0;
    }

/* Mover los botones justo después del menú principal */
    .sidebar-content {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .sidebar-menu {
        order: 1; /* El menú va PRIMERO */
        flex: 1;
        overflow-y: auto;
    }
    
    .mobile-menu-buttons {
        order: 2; /* Los botones van DESPUÉS */
        flex-shrink: 0; /* No se reducen */
        margin-top: auto; /* Se pegan al final del espacio disponible */
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
    }
    
    .header-title {
        font-size: clamp(1.1em, 4vw, 1.4em);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* OCULTAR BOTONES DEL HEADER EN MÓVIL */
    .header-right {
        display: none !important;
    }
    
    /* Mostrar info móvil */
    .user-info-mobile {
        display: flex;
        order: 2;
        width: 100%;
        align-items: flex-start;
    }
    
    .user-details-mobile {
        align-items: flex-start;
    }
    
    .user-name {
        font-size: clamp(0.9em, 3.5vw, 1em);
    }
    
    .user-type {
        font-size: clamp(0.7em, 2.5vw, 0.75em);
        padding: 3px 10px;
    }
    
    /* Sidebar para móvil */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: min(280px, 85vw);
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* MOSTRAR BOTONES EN SIDEBAR EN MÓVIL */
    .mobile-menu-buttons {
        display: flex;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar-menu {
        max-height: calc(100vh - 200px); /* Altura máxima para el menú */
        overflow-y: auto;
    }
    
    .menu-link {
        border-left: 4px solid transparent;
        border-bottom: none;
    }
    
    .menu-link.active {
        border-left-color: #3498db;
        border-bottom: none;
    }
    
    .table-header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 0;
    }
    
    .search-input {
        width: 100%;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-modern {
        min-width: 100%;
        padding: 16px 30px;
    }
    
    .modern-form {
        padding: 25px;
    }
    
    .form-section {
        padding: 25px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    #votantes-cards .card {
        padding: 20px;
        min-height: 120px;
    }
    
    #votantes-cards .card-number {
        font-size: 2em;
    }
    
    .card {
        min-height: 120px;
        padding: 15px;
    }
    
    .card-number {
        font-size: 1.8em;
    }
    
    .progreso-container {
        min-width: 120px;
        max-width: 150px;
    }
    
    .progreso-texto {
        font-size: 0.75em;
    }
    
    .badge-cantidad {
        padding: 6px 12px;
        font-size: 0.85em;
        min-width: 40px;
    }
    
    .doble-clic-hint::after {
        content: '🖱️ 2 clics';
        font-size: 0.7em;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
        gap: 8px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .header-title {
        font-size: 1.1em;
    }
    
    .menu-toggle {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.3em;
    }
    
    .user-name {
        font-size: 0.9em;
    }
    
    .user-type {
        font-size: 0.7em;
        padding: 2px 8px;
    }
    
    .mobile-menu-buttons {
        padding: 15px;
    }
    
    .mobile-menu-buttons .btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .main-content {
        padding: 15px 10px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .card {
        min-height: 110px;
        padding: 15px;
    }
    
    .card h3 {
        font-size: 0.9em;
    }
    
    .card-number {
        font-size: 1.6em;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .breadcrumb-votantes {
        font-size: 0.8em;
    }
    
    .breadcrumb-votantes .nivel {
        padding: 3px 6px;
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .info-section {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.2em;
    }
    
    .btn-modal {
        padding: 12px 20px;
        font-size: 0.9em;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .modern-form {
        padding: 20px;
        margin: 10px;
    }
    
    .form-header h3 {
        font-size: 1.8em;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .modern-input-field {
        padding: 16px 18px;
    }
    
    .progreso-container {
        min-width: 100px;
        max-width: 120px;
    }
}

/* Escritorio grande */
@media (min-width: 1200px) {
    .header-content {
        padding: 0 40px;
    }
    
    .header-left {
        justify-content: flex-start;
    }
    
    .header-right {
        justify-content: flex-end;
    }
    
    /* Asegurar que los botones móviles estén ocultos en escritorio */
    .mobile-menu-buttons {
        display: none !important;
    }
    
    .main-content {
        padding: 30px 40px;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* ========== OVERLAY Y FONDOS ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

#login-screen .sidebar-overlay {
    display: none !important;
    opacity: 0 !important;
}

/* IMAGEN DE FONDO PARA LOGIN */
#login-screen {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-image: url('../images/FondoInicio.png');
    background-size: cover;        /* Cubre toda el área sin distorsionar */
    background-position: center;   /* Centra la imagen */
    background-repeat: no-repeat;
    background-attachment: fixed;  /* Fija el fondo al hacer scroll */
    
    z-index: -2;
}

/* Para móviles */
@media (max-width: 768px) {
    #login-screen::before {
        background-image: url('../images/ImagenMoviles.png');
        background-attachment: scroll;  /* En móvil mejor sin fixed */
        background-size: cover;         /* Mismo comportamiento que escritorio */
        background-position: center;    /* Mismo centrado */
    }
}

#login-screen::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    z-index: -1;
}

/* ========== ESTILOS ADICIONALES ========== */
.detalle-item.error-validacion {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.formato-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.formato-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.formato-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
}

.formato-card .card-body {
    padding: 25px;
}

.badge-campo {
    background: #e53e3e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
    margin: 2px;
}

.equipo-campana-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

#tab-equipo-campana .dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(15px, 3vw, 20px);
    margin-bottom: 0;
    width: 100%;
}

.equipo-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tab-pane:not(#tab-votantes) #votantes-cards {
    display: none;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estilos para usuarios inactivos en la tabla */
.usuario-inactivo {
    background-color: #fff5f5 !important;
    opacity: 0.7;
    border-left: 4px solid #dc3545 !important;
}

.usuario-inactivo:hover {
    background-color: #ffe6e6 !important;
    opacity: 0.9;
}

/* Mejora para el estado inactivo */
.estado-inactivo {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
    border: 1px solid #f5c6cb;
}

/* Estilo para el select de estado en el modal */
#editar-usuario-activo {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: #f7fafc;
    transition: all 0.3s ease;
    width: 100%;
}

#editar-usuario-activo:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Estilos mejorados para usuarios inactivos */
.usuario-inactivo {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%) !important;
    border-left: 4px solid #dc3545 !important;
    opacity: 0.8;
}

.usuario-inactivo:hover {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffd6d6 100%) !important;
    opacity: 1;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Mejorar la apariencia del estado inactivo */
.estado-inactivo {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
    border: 1px solid #c82333;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.estado-activo {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: clamp(0.8em, 2.5vw, 0.85em);
    font-weight: 600;
    border: 1px solid #20c997;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Estilos para campos ocultos */
.hidden {
    display: none !important;
}

/* Estilos para campos de barrio y comuna cuando son visibles */
.input-group.visible {
    display: block !important;
}

/* Asegurar que los campos dentro de form-row se muestren correctamente */
.form-row .input-group {
    transition: all 0.3s ease;
}

/* Cuando los campos están ocultos, ocultar toda la fila del label también */
.input-group.hidden-row {
    display: none !important;
}

/* Estilos para campos readonly */
input[readonly] {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

/* Estilos para campos editables */
input:not([readonly]) {
    background-color: #ffffff !important;
    color: #333333 !important;
    cursor: text !important;
}

.btn-volver {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-volver:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateX(-3px);
}

/* Asegurar que las secciones se comporten como contenedores separados */
#lista-miembros-equipo,
#registros-usuario-section,
#registros-equipo-section {
    transition: all 0.3s ease-in-out;
}

/* Estilo para el botón de volver más prominente */
#btn-volver-miembros {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

#btn-volver-miembros:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Asegurar que en móvil el botón sea fácil de tocar */
@media (max-width: 768px) {
    #btn-volver-miembros {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .table-header-actions {
        flex-direction: column;
    }
}

/* Estilos para el botón de editar en la tabla */
/* ========== ESTILOS PARA BOTÓN EDITAR EN TABLA ========== */

.btn-editar-usuario {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 90px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-editar-usuario::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-editar-usuario:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-editar-usuario:hover::before {
    left: 100%;
}

.btn-editar-usuario:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.btn-editar-usuario:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

/* Ícono del botón */
.btn-editar-usuario .btn-icon {
    font-size: 1em;
    display: flex;
    align-items: center;
}

/* Texto del botón */
.btn-editar-usuario .btn-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Estilos para la columna de acciones */
#table-usuarios th:nth-child(7),
#table-usuarios td:nth-child(7) {
    text-align: center;
    width: 120px;
    padding: 8px 12px;
}

/* Efecto de pulso sutil al hacer hover en la fila */
#usuarios-body tr:hover .btn-editar-usuario {
    transform: scale(1.05);
}

/* ========== RESPONSIVE ========== */

/* Tablets */
@media (max-width: 1024px) {
    .btn-editar-usuario {
        padding: 7px 14px;
        font-size: 0.82em;
        min-width: 85px;
        gap: 5px;
    }
    
    #table-usuarios th:nth-child(7),
    #table-usuarios td:nth-child(7) {
        width: 110px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .btn-editar-usuario {
        padding: 6px 10px;
        font-size: 0.75em;
        min-width: 70px;
        gap: 4px;
    }
    
    .btn-editar-usuario .btn-text {
        display: none; /* Ocultar texto en móviles */
    }
    
    .btn-editar-usuario .btn-icon::before {
        content: '✏️'; /* Solo mostrar ícono */
    }
    
    #table-usuarios th:nth-child(7),
    #table-usuarios td:nth-child(7) {
        width: 80px;
        padding: 6px 8px;
    }
    
    /* Tooltip para móviles */
    .btn-editar-usuario {
        position: relative;
    }
    
    .btn-editar-usuario:hover::after {
        content: 'Editar';
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.7em;
        white-space: nowrap;
        z-index: 1000;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .btn-editar-usuario {
        padding: 5px 8px;
        min-width: 60px;
        font-size: 0.7em;
    }
    
    #table-usuarios th:nth-child(7),
    #table-usuarios td:nth-child(7) {
        width: 70px;
        padding: 4px 6px;
    }
}

/* ========== ESTADOS ESPECIALES ========== */

/* Botón deshabilitado */
.btn-editar-usuario:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-editar-usuario:disabled:hover {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    transform: none;
    box-shadow: none;
}

/* Botón en fila de usuario inactivo */
.usuario-inactivo .btn-editar-usuario {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    opacity: 0.7;
}

.usuario-inactivo .btn-editar-usuario:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    opacity: 0.9;
}

/* Botón en fila de usuario seleccionado */
.usuario-seleccionado .btn-editar-usuario {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.usuario-seleccionado .btn-editar-usuario:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* ========== ANIMACIONES ========== */

@keyframes pulse-editar {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

/* Animación sutil al cargar la tabla */
.btn-editar-usuario {
    animation: fadeInUp 0.5s ease-out;
}

/* Efecto de carga */
.btn-editar-usuario.loading {
    position: relative;
    color: transparent;
}

.btn-editar-usuario.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #212529;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========== VARIANTES DE COLOR ========== */

/* Variante success (para otros botones futuros) */
.btn-success-usuario {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success-usuario:hover {
    background: linear-gradient(135deg, #20c997 0%, #1e7e34 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Variante danger (para otros botones futuros) */
.btn-danger-usuario {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger-usuario:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Estilos para diferenciar tipos de usuario en la tabla */
tr[style*="background-color: #fff9e6"] {
    border-left: 4px solid #ffc107 !important;
}

tr[style*="background-color: #e6f7ff"] {
    border-left: 4px solid #17a2b8 !important;
}

/* Estilos para los badges de tipo */
.tipo-badge.tipo-candidato {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.tipo-badge.tipo-estrategia {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.tipo-badge.tipo-lider {
    background: linear-gradient(135deg, #6f42c1 0%, #59359e 100%);
    color: white;
}