/* ============================================
   SISTEMA DE TEMAS
   ============================================ */

:root {
    /* Tema Verde (Por defecto) */
    --tema-verde-primary: #4CAF50;
    --tema-verde-primary-dark: #45a049;
    --tema-verde-bg: #f5f5f5;
    --tema-verde-card: #ffffff;
    --tema-verde-text: #333333;
    --tema-verde-text-secondary: #666666;
    --tema-verde-border: #e0e0e0;
    
    /* Tema Dark */
    --tema-dark-primary: #4A90E2;
    --tema-dark-primary-dark: #357ABD;
    --tema-dark-bg: #121212;
    --tema-dark-card: #1e1e1e;
    --tema-dark-text: #ffffff;
    --tema-dark-text-secondary: #e0e0e0;
    --tema-dark-border: #333333;
    
    /* Tema Azul */
    --tema-azul-primary: #2196F3;
    --tema-azul-primary-dark: #1976D2;
    --tema-azul-bg: #ffffff;
    --tema-azul-card: #f8f9fa;
    --tema-azul-text: #212529;
    --tema-azul-text-secondary: #6c757d;
    --tema-azul-border: #dee2e6;
    
    /* Tema Gris */
    --tema-gris-primary: #607D8B;
    --tema-gris-primary-dark: #455A64;
    --tema-gris-bg: #eceff1;
    --tema-gris-card: #ffffff;
    --tema-gris-text: #37474f;
    --tema-gris-text-secondary: #78909c;
    --tema-gris-border: #cfd8dc;
    
    /* Tema mahnos (basado en colores del logo) */
    --tema-mahnos-primary: #1a237e;
    --tema-mahnos-primary-dark: #0d1b4a;
    --tema-mahnos-bg: #f5f5f5;
    --tema-mahnos-card: #ffffff;
    --tema-mahnos-text: #1a237e;
    --tema-mahnos-text-secondary: #5c6bc0;
    --tema-mahnos-border: #c5cae9;
    
    /* Variables activas (inicialmente tema verde) */
    --primary-color: var(--tema-verde-primary);
    --primary-color-dark: var(--tema-verde-primary-dark);
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: var(--tema-verde-primary);
    --bg-color: var(--tema-verde-bg);
    --card-bg: var(--tema-verde-card);
    --text-primary: var(--tema-verde-text);
    --text-secondary: var(--tema-verde-text-secondary);
    --border-color: var(--tema-verde-border);
    --cumplimiento-bg-light: rgba(76, 175, 80, 0.1);
    --cumplimiento-bg-dark: rgba(69, 160, 73, 0.15);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Tema Dark */
body[data-tema="dark"] {
    --primary-color: var(--tema-dark-primary);
    --primary-color-dark: var(--tema-dark-primary-dark);
    --secondary-color: #2196F3;
    --success-color: var(--tema-dark-primary);
    --bg-color: var(--tema-dark-bg);
    --card-bg: var(--tema-dark-card);
    --text-primary: var(--tema-dark-text);
    --text-secondary: var(--tema-dark-text-secondary);
    --border-color: var(--tema-dark-border);
    --cumplimiento-bg-light: rgba(44, 62, 80, 0.3);
    --cumplimiento-bg-dark: rgba(26, 37, 47, 0.3);
}

/* Tema Azul */
body[data-tema="azul"] {
    --primary-color: var(--tema-azul-primary);
    --primary-color-dark: var(--tema-azul-primary-dark);
    --secondary-color: #2196F3;
    --success-color: var(--tema-azul-primary);
    --bg-color: var(--tema-azul-bg);
    --card-bg: var(--tema-azul-card);
    --text-primary: var(--tema-azul-text);
    --text-secondary: var(--tema-azul-text-secondary);
    --border-color: var(--tema-azul-border);
    --cumplimiento-bg-light: rgba(33, 150, 243, 0.1);
    --cumplimiento-bg-dark: rgba(25, 118, 210, 0.15);
}

/* Compatibilidad con "light" (mantener por si hay datos antiguos) */
body[data-tema="light"] {
    --primary-color: var(--tema-azul-primary);
    --primary-color-dark: var(--tema-azul-primary-dark);
    --secondary-color: #2196F3;
    --success-color: var(--tema-azul-primary);
    --bg-color: var(--tema-azul-bg);
    --card-bg: var(--tema-azul-card);
    --text-primary: var(--tema-azul-text);
    --text-secondary: var(--tema-azul-text-secondary);
    --border-color: var(--tema-azul-border);
    --cumplimiento-bg-light: rgba(33, 150, 243, 0.1);
    --cumplimiento-bg-dark: rgba(25, 118, 210, 0.15);
}

/* Tema Gris */
body[data-tema="gris"] {
    --primary-color: var(--tema-gris-primary);
    --primary-color-dark: var(--tema-gris-primary-dark);
    --secondary-color: #2196F3;
    --success-color: var(--tema-gris-primary);
    --bg-color: var(--tema-gris-bg);
    --card-bg: var(--tema-gris-card);
    --text-primary: var(--tema-gris-text);
    --text-secondary: var(--tema-gris-text-secondary);
    --border-color: var(--tema-gris-border);
    --cumplimiento-bg-light: rgba(96, 125, 139, 0.1);
    --cumplimiento-bg-dark: rgba(69, 90, 100, 0.15);
}

/* Tema mahnos (basado en colores del logo) */
body[data-tema="mahnos"] {
    --primary-color: var(--tema-mahnos-primary);
    --primary-color-dark: var(--tema-mahnos-primary-dark);
    --secondary-color: #42a5f5;
    --success-color: var(--tema-mahnos-primary);
    --bg-color: var(--tema-mahnos-bg);
    --card-bg: var(--tema-mahnos-card);
    --text-primary: var(--tema-mahnos-text);
    --text-secondary: var(--tema-mahnos-text-secondary);
    --border-color: var(--tema-mahnos-border);
    --cumplimiento-bg-light: rgba(26, 35, 126, 0.1);
    --cumplimiento-bg-dark: rgba(13, 27, 74, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--tema-verde-primary-dark));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
}

body[data-tema="dark"] .app-header {
    background: linear-gradient(135deg, var(--tema-dark-primary), var(--tema-dark-primary-dark));
}

body[data-tema="azul"] .app-header {
    background: linear-gradient(135deg, var(--tema-azul-primary), var(--tema-azul-primary-dark));
}

body[data-tema="light"] .app-header {
    background: linear-gradient(135deg, var(--tema-azul-primary), var(--tema-azul-primary-dark));
}

body[data-tema="gris"] .app-header {
    background: linear-gradient(135deg, var(--tema-gris-primary), var(--tema-gris-primary-dark));
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-left i {
    font-size: 1.8rem;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

/* Botón de menú */
.btn-menu {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    margin-right: 0.5rem !important;
    border-radius: 4px !important;
    transition: background-color 0.3s !important;
    display: block !important;
}

.btn-menu:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--tema-verde-primary-dark));
    color: white;
    transition: left 0.3s ease, background 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

body[data-tema="dark"] .sidebar {
    background: linear-gradient(135deg, var(--tema-dark-primary), var(--tema-dark-primary-dark));
}

body[data-tema="azul"] .sidebar {
    background: linear-gradient(135deg, var(--tema-azul-primary), var(--tema-azul-primary-dark));
}

body[data-tema="light"] .sidebar {
    background: linear-gradient(135deg, var(--tema-azul-primary), var(--tema-azul-primary-dark));
}

body[data-tema="gris"] .sidebar {
    background: linear-gradient(135deg, var(--tema-gris-primary), var(--tema-gris-primary-dark));
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-close-sidebar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active {
    background-color: rgba(0, 0, 0, 0.05);
    border-right: 3px solid var(--primary-color);
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Overlay para móvil */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Ajustar contenido sin tab bar */
.main-container {
    padding-bottom: 2rem;
}

.btn-stats, .btn-home, .btn-install {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-stats:hover, .btn-home:hover, .btn-install:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-install i {
    margin-right: 0.3rem;
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    padding-bottom: 50px;
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 2rem;
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Formulario */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Asegurar que los inputs tengan texto visible en tema oscuro */
body[data-tema="dark"] .form-group input[type="text"],
body[data-tema="dark"] .form-group select,
body[data-tema="dark"] .filter-select,
body[data-tema="dark"] input[type="text"],
body[data-tema="dark"] input[type="number"],
body[data-tema="dark"] input[type="date"],
body[data-tema="dark"] input[type="email"],
body[data-tema="dark"] input[type="password"],
body[data-tema="dark"] textarea,
body[data-tema="dark"] select,
body[data-tema="dark"] #perfil,
body[data-tema="dark"] #profesional,
body[data-tema="dark"] #servicio,
body[data-tema="dark"] #turno {
    background: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

body[data-tema="dark"] .form-group input::placeholder,
body[data-tema="dark"] input::placeholder,
body[data-tema="dark"] textarea::placeholder {
    color: #b0b0b0 !important;
}

/* Asegurar que los selects tengan opciones visibles en tema oscuro */
body[data-tema="dark"] select option {
    background: #2d2d2d !important;
    color: #ffffff !important;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Botones */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #f5f5f5;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-info {
    background: #17a2b8;
    color: white;
    flex: 1;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-info:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6c757d;
}

/* Indicador de Cumplimiento */
.cumplimiento-indicator {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--cumplimiento-bg-light), var(--cumplimiento-bg-dark));
    border-radius: 12px;
    text-align: center;
}

.indicator-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.indicator-value {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.percentage {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.indicator-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Botones de período */
.btn-periodo {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-periodo:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-periodo.active {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Filtros */
.filter-controls {
    display: flex;
    gap: 0.5rem;
}

.filter-select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Tabla */
.table-container {
    overflow-x: auto;
}

.historial-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.historial-table thead {
    background: var(--primary-color);
    color: white;
}

.historial-table th,
.historial-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.historial-table th {
    font-weight: 600;
    font-size: 0.9rem;
}

.historial-table tbody tr:hover {
    background: #f9f9f9;
}

.historial-table td {
    font-size: 0.9rem;
}

/* Badge de Cumplimiento */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

/* Botón de eliminar */
.btn-delete {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    transform: scale(1.2);
}

/* No Data */
.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-data i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transform: translateY(200%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 90%;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Mejoras para móvil */
@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
        min-width: auto;
        padding: 1rem;
        font-size: 0.95rem;
    }
}

.toast.error {
    background: var(--danger-color);
}

.toast.success {
    background: var(--success-color);
}

.toast.info {
    background: #2196F3;
}

.toast.warning {
    background: #FF9800;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-left h1 {
        font-size: 1.2rem;
    }

    .btn-stats span {
        display: none;
    }

    .card {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .historial-table {
        font-size: 0.8rem;
    }

    .historial-table th,
    .historial-table td {
        padding: 0.5rem;
    }

    .filter-controls {
        width: 100%;
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

.fa-spinner {
    display: inline-block;
}

/* Tabla responsiva en móvil */
@media (max-width: 640px) {
    .historial-table thead {
        display: none;
    }

    .historial-table,
    .historial-table tbody,
    .historial-table tr,
    .historial-table td {
        display: block;
        width: 100%;
    }

    .historial-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.75rem;
        background: white;
    }

    .historial-table td {
        padding: 0.5rem;
        text-align: right;
        position: relative;
        padding-left: 50%;
        border-bottom: 1px solid var(--border-color);
    }

    .historial-table td:last-child {
        border-bottom: none;
    }

    .historial-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        font-weight: 600;
        text-align: left;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

/* Estilos responsive para sidebar y tab bar */
@media (max-width: 768px) {
    /* Mostrar botón de menú en móvil */
    .btn-menu {
        display: block !important;
    }
    
    /* Ocultar botones del header en móvil */
    .btn-stats, .btn-home {
        display: none;
    }
    
    /* Ajustar padding en móvil */
    .main-container {
        padding-bottom: 2rem;
    }
    
    /* Sidebar overlay en móvil */
    .sidebar {
        position: fixed;
        left: -300px;
        width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.active {
        left: 0;
    }
}

@media (min-width: 769px) {
    /* Mostrar botón de menú en escritorio también */
    .btn-menu {
        display: block !important;
    }
    
    /* Mostrar botones del header en escritorio */
    .btn-stats, .btn-home {
        display: flex;
    }
    
    /* Sidebar deslizable en escritorio también */
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* Mostrar botón de cerrar sidebar en escritorio */
    .btn-close-sidebar {
        display: block !important;
    }
    
    /* Mostrar overlay en escritorio también */
    .sidebar-overlay {
        display: block !important;
    }
    
    
    /* Ajustar margen del contenido en escritorio (sin sidebar fijo) */
    .main-container {
        margin-left: 0;
        padding-bottom: 2rem;
    }
    
    /* Header sin margen en escritorio */
    .app-header {
        margin-left: 0;
    }
}

/* Configuración */
.config-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.info-box strong {
    color: var(--primary-color);
}

.info-text {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-text i {
    color: #2196f3;
}

body[data-tema="dark"] .info-text i {
    color: var(--primary-color);
}

/* Botones de Radio Modernos */
.radio-button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.radio-button-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.radio-button {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

/* Radio buttons en tema oscuro */
body[data-tema="dark"] .radio-button {
    background: #2d2d2d !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

.radio-button:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

body[data-tema="dark"] .radio-button:hover {
    background: #3d3d3d !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3) !important;
}

.radio-button-group input[type="radio"]:checked + .radio-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.radio-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    margin-right: 18px;
    flex-shrink: 0;
}

.radio-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 20px;
    margin-right: 18px;
    flex-shrink: 0;
}

.radio-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.4;
    flex: 1;
}

/* Botones de guantes más grandes */
.guantes-button {
    padding: 20px 24px;
    min-height: 60px;
}

.guantes-button .radio-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
    margin-right: 20px;
}

.guantes-button .radio-text {
    font-size: 18px;
    font-weight: 600;
}

/* Efecto de selección */
.radio-button::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 ease;
}

.radio-button-group input[type="radio"]:checked + .radio-button::before {
    left: 100%;
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .radio-button {
        padding: 16px 18px;
    }
    
    .radio-number, .radio-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-right: 14px;
    }
    
    .radio-text {
        font-size: 15px;
    }
    
    .guantes-button {
        padding: 18px 20px;
        min-height: 55px;
    }
    
    .guantes-button .radio-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
        margin-right: 16px;
    }
    
    .guantes-button .radio-text {
        font-size: 16px;
    }
}

/* Mensajes de Error */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 12px 16px;
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 8px;
    color: #d32f2f;
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

.error-message i {
    color: #f44336;
    font-size: 16px;
}

/* Animación de error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Estilo de error para grupos de radio */
.radio-button-group.error {
    border-radius: 12px;
    padding: 8px;
}

.radio-button-group.error .radio-button {
    border: 3px solid #f44336 !important;
    background: #ffebee !important;
    animation: pulse-error 1s ease-in-out;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3) !important;
}

.radio-button-group.error .radio-button:hover {
    background: #ffcdd2 !important;
    border-color: #d32f2f !important;
}

/* Animación de pulso para errores */
@keyframes pulse-error {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(244, 67, 54, 0.1);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

/* Estilos para SVG de 5 Momentos Interactivo */
.momentos-svg-container {
    margin-top: 15px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}

.svg-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.momentos-svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 400px;
    display: block;
}

/* Estilos para los polígonos/paths clickeables del SVG */
.momentos-svg .cls-11 {
    cursor: pointer;
    pointer-events: all;
    transition: fill 0.3s ease, opacity 0.2s ease;
}

.momentos-svg .cls-11:hover {
    opacity: 0.8;
}

/* Etiquetas de los momentos */
.momentos-labels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.momento-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.momento-label:hover {
    background: #eeeeee;
    border-color: #bdbdbd;
}

.momento-label.seleccionado {
    background: #ffebee;
    border-color: #f44336;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

.momento-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #9e9e9e;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.momento-label.seleccionado .momento-numero {
    background: #f44336;
}

.momento-texto {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.svg-fallback {
    padding: 40px;
    text-align: center;
    color: #999;
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .momentos-svg-container {
        padding: 15px;
    }
    
    .momentos-labels {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .momento-label {
        padding: 10px 12px;
    }
    
    .momento-numero {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 10px;
    }
    
    .momento-texto {
        font-size: 13px;
    }
}

/* Estilo para display de IPS */
.ips-display {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.1rem;
}

/* ============================================
   SELECTOR DE TEMAS Y FOOTER MÓVIL
   ============================================ */
.selector-temas-mobile {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    margin: 1rem 0;
}

.selector-temas-mobile h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.temas-grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tema-option-mobile {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.tema-option-mobile:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.tema-option-mobile.activo {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.tema-option-mobile.activo .tema-nombre-mobile {
    color: white;
    font-weight: bold;
}

.tema-preview-mobile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid rgba(255,255,255,0.3);
}

.tema-preview-mobile.verde {
    background: #4CAF50;
}

.tema-preview-mobile.dark {
    background: #2C3E50;
}

.tema-preview-mobile.light {
    background: #2196F3;
}

.tema-preview-mobile.gris {
    background: #607D8B;
}

.tema-preview-mobile.mahnos {
    background: linear-gradient(135deg, #1a237e 0%, #42a5f5 100%);
}

.tema-nombre-mobile {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.tema-option-mobile.activo .tema-nombre-mobile {
    color: white;
}

/* Footer Móvil */
.app-footer-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    text-align: center;
    font-size: 9px;
    color: #888888;
    z-index: 1000;
    pointer-events: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-footer-mobile .footer-logo-container {
    display: none;
}

.app-footer-mobile .footer-logo {
    max-width: 120px;
    height: auto;
    opacity: 0.9;
    display: block;
}

.app-footer-mobile p {
    margin: 2px 0;
    line-height: 1.3;
    color: #888888;
}

.app-footer-mobile strong {
    color: #888888;
    font-weight: 500;
}

.app-footer-mobile .footer-logos-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0;
}

.app-footer-mobile .footer-logos-mobile span {
    font-weight: 500;
    color: #888888;
    font-size: 9px;
}

.app-footer-mobile .footer-logos-mobile .footer-logo-institucion {
    height: 25px;
    width: auto;
    max-width: 80px;
    opacity: 0.8;
    filter: grayscale(0.1);
}

/* Pantalla de Inicio (Splash Screen) */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    padding: 20px;
    max-width: 90%;
}

.splash-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.splash-logo-app {
    width: 200px;
    height: auto;
    max-width: 80%;
    animation: fadeInScale 0.8s ease-out;
}

.splash-logos-instituciones {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.splash-logo-institucion {
    height: 50px;
    width: auto;
    max-width: 120px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

.splash-logo-institucion:nth-child(2) {
    animation-delay: 0.5s;
}

.splash-text {
    margin-top: 30px;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.7s forwards;
}

.splash-text p {
    margin: 5px 0;
}

.splash-text strong {
    color: #333;
    font-weight: 600;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Ajustar padding del main para el footer - ya está definido arriba */

