/* C:\xampp\htdocs\MUDI-Gestion\public\assets\css\style.css */

/* =========================================
   0. RESET Y TIPOGRAFÍA GLOBAL
   ========================================= */
:root {
    --primary-color: #3b82f6;      
    --primary-dark: #2563eb;       
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent-color: #38bdf8;       
    
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-white: #f8fafc;
    
    --navbar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    
    --radius-card: 16px;
    --radius-btn: 10px;
    --radius-pill: 50px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-dark); margin-bottom: 0.5rem; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
p { margin-bottom: 1rem; }
a { text-decoration: none; color: inherit; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* =========================================
   1. SIDEBAR (MENÚ LATERAL)
   ========================================= */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--navbar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    color: var(--text-white);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
    font-weight: 800;
    font-size: 1.25rem;
    display: flex; align-items: center; justify-content: center; gap: 12px;
}

.sidebar-header img {
    max-height: 35px;
    width: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 15px;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-menu a i {
    width: 24px; text-align: center; margin-right: 12px; font-size: 1.1em;
    transition: transform 0.2s ease;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: #ffffff !important;
}

.sidebar-menu a:hover i {
    transform: scale(1.1);
}

.sidebar-menu a.active {
    background: var(--primary-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.menu-header {
    padding: 20px 16px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-link {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.logout-link a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5 !important;
    border-radius: 12px;
    font-weight: 700;
    gap: 8px;
}

.logout-link a:hover {
    background: #ef4444;
    color: white !important;
}

/* =========================================
   2. HEADER MÓVIL
   ========================================= */
.mobile-header {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; height: 70px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 20px; z-index: 2000;
    align-items: center; justify-content: space-between; color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.burger-btn { 
    background: rgba(255,255,255,0.1); border: none; width: 40px; height: 40px; 
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: white; font-size: 1.2rem;
}

.mobile-logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.5px; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px); z-index: 999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================
   3. CONTENIDO PRINCIPAL
   ========================================= */
.main-content {
    margin-left: var(--navbar-width);
    padding: 40px;
    width: calc(100% - var(--navbar-width));
    transition: all 0.3s ease;
}

.top-navbar { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 35px; flex-wrap: wrap; gap: 20px;
}

.user-profile { display: flex; align-items: center; gap: 15px; }

/* =========================================
   4. COMPONENTES MODERNOS
   ========================================= */

/* Cards */
.glass-card, .card {
    background: var(--bg-white); border-radius: var(--radius-card); padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 15px -3px rgba(0,0,0,0.02); 
    border: 1px solid var(--border-color); margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header { 
    font-size: 1.15rem; font-weight: 800; margin-bottom: 1.5rem; 
    padding-bottom: 1.2rem; border-bottom: 1px solid var(--border-color); 
    color: var(--text-dark); display: flex; align-items: center; gap: 10px;
}

/* Tablas */
.table-responsive { 
    width: 100%; overflow-x: auto; border-radius: 12px; 
    -webkit-overflow-scrolling: touch; border: 1px solid var(--border-color);
}
.table { width: 100%; border-collapse: collapse; min-width: 700px; }
.table thead th {
    background: #f8fafc; color: var(--text-muted); font-size: 0.75rem; 
    font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 15px 20px; border-bottom: 2px solid var(--border-color); text-align: left;
}
.table tbody tr { transition: background 0.2s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody td { padding: 16px 20px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }

/* Botones */
.btn { 
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-btn); font-weight: 700; 
    cursor: pointer; border: none; font-size: 0.9rem; transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow); }

.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; color: #1e293b; }

.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; padding: 4px 10px; 
    border-radius: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.6rem; font-weight: 700; font-size: 0.85rem; color: var(--text-gray); text-transform: uppercase; letter-spacing: 0.5px; }
.form-control { 
    width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); 
    border-radius: var(--radius-btn); font-size: 0.95rem; background: #f8fafc;
    transition: all 0.2s;
}
.form-control:focus { border-color: var(--primary-color); background: white; outline: none; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }

/* =========================================
   5. RESPONSIVIDAD AVANZADA
   ========================================= */

/* Desktop / Tablet Grande */
@media (max-width: 1200px) {
    .main-content { padding: 30px; }
}

/* Tablet / Laptop Pequeña */
@media (max-width: 992px) {
    :root { --navbar-width: 240px; }
    .main-content { padding: 25px; }
    .top-navbar h2 { font-size: 1.3rem; }
}

/* Móvil / Tablet Vertical */
@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .top-navbar { display: none; }
    
    .sidebar { 
        width: 280px; 
        transform: translateX(-100%); 
        padding-top: 70px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    }
    .sidebar.active { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    
    .main-content { 
        margin-left: 0 !important; 
        width: 100% !important; 
        padding: 90px 15px 30px 15px; 
    }
    
    .row { flex-direction: column; gap: 15px; }
    .card, .glass-card { padding: 20px; width: 100% !important; }
    
    .table-responsive { border-radius: 8px; }
    .table thead th { padding: 12px; font-size: 11px; }
    .table tbody td { padding: 12px; font-size: 13px; }
    
    /* Grid de botones responsivos */
    .btn-group-mobile { display: flex; flex-direction: column; gap: 10px; width: 100%; }
    .btn-group-mobile .btn { width: 100%; }
}

/* Móvil Pequeño */
@media (max-width: 480px) {
    .main-content { padding-top: 85px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .card-header { font-size: 1rem; padding-bottom: 0.8rem; }
    .btn { padding: 8px 16px; font-size: 0.85rem; }
}

/* =========================================
   6. MODALES ELEGANTES
   ========================================= */
.custom-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-overlay.show { opacity: 1; visibility: visible; }

.custom-modal-box {
    background: white; padding: 35px; border-radius: 24px;
    width: 90%; max-width: 420px; text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-overlay.show .custom-modal-box { transform: scale(1); }

.modal-icon { font-size: 3.5rem; margin-bottom: 20px; display: inline-block; }
.modal-icon.error { color: #ef4444; }
.modal-icon.warning { color: #f59e0b; }
.modal-icon.info { color: #3b82f6; }
.modal-icon.success { color: #10b981; }

.modal-title { font-size: 1.5rem; font-weight: 800; color: #1e293b; margin-bottom: 12px; }
.modal-text { font-size: 1rem; color: #64748b; margin-bottom: 30px; line-height: 1.6; }

.modal-btn-close {
    background: #1e293b; color: white; border: none; padding: 14px;
    border-radius: 14px; font-weight: 700; font-size: 1rem;
    cursor: pointer; width: 100%; transition: all 0.2s;
}

.modal-btn-close:hover { background: #0f172a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }