/* ===== ESTILOS OPTYKA - VERSIÓN COMPLETA SIN HAMBURGUESA ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --primary-dark: #0a1a2f;
    --primary: #0f2a44;
    --accent: #4da8ff;
    --accent-hover: #7ab9ff;
    --accent-soft: #e6f0ff;
    --surface: #ffffff;
    --background: #f3f4f6;
    --border: #e5e7eb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    background: var(--background);
    color: var(--text-dark);
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== BARRA DE NAVEGACIÓN SUPERIOR ===== */
.top-nav {
    background: var(--primary-dark);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.logo span {
    font-size: 12px;
    color: var(--accent);
    display: block;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 10px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
}

.nav-link.active {
    background: var(--accent);
    color: var(--primary-dark);
}

.nav-link i {
    font-size: 14px;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ===== HEADER DEL DASHBOARD ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-dark);
}

.btn-refresh {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--accent);
    color: white;
}

/* ===== TARJETAS DE ESTADÍSTICAS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #e6f0ff;
    color: #2563eb;
}

.stat-icon.green {
    background: #d1fae5;
    color: #059669;
}

.stat-icon.orange {
    background: #fed7aa;
    color: #d97706;
}

.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ===== FILAS DEL DASHBOARD ===== */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.dashboard-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== BARRAS DE PROGRESO ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin: 5px 0;
}

.progress-fill {
    height: 8px;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.xalapa {
    background: var(--primary-dark);
}

.progress-fill.cdmx {
    background: var(--accent);
}

/* ===== ALERTAS ===== */
.alert-item {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}

.alert-item strong {
    display: block;
    margin-bottom: 4px;
    color: #92400e;
}

/* ===== TABLAS ===== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f9fafb;
    color: var(--text-dark);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* ===== BOTONES ===== */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-small {
    background: var(--accent-soft);
    color: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--accent);
    color: white;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(77, 168, 255, 0.1);
}

/* ===== PESTAÑAS ===== */
.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.tab-btn.active {
    background: var(--accent);
    color: var(--primary-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== BADGES ===== */
.visit-badge {
    background: var(--accent-soft);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.saldo-positivo {
    color: var(--warning);
    font-weight: 600;
}

.saldo-cero {
    color: var(--success);
    font-weight: 600;
}

.paciente-nombre {
    font-weight: 600;
    color: var(--primary-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .top-nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-refresh {
        width: 100%;
        justify-content: center;
    }
    
    .tabs-header {
        justify-content: center;
    }
}