/* SAC - Sistema de Administración de Comedores */
/* Estilos principales - Diseño empresarial moderno inspirado en ODOO, SAP y sistemas empresariales */

:root {
    /* Colores primarios - Azul corporativo empresarial (inspirado en SAP/ODOO) */
    --primary-color: #0066CC;
    --primary-dark: #004C99;
    --primary-darker: #003366;
    --primary-light: #3385D6;
    --primary-lighter: #E6F2FF;
    
    /* Colores secundarios - Grises sofisticados empresariales */
    --secondary-color: #5C6B7A;
    --secondary-dark: #3D4851;
    --secondary-light: #8B9AAB;
    --secondary-lighter: #F5F7FA;
    
    /* Colores de estado - Sistema empresarial */
    --success-color: #28A745;
    --success-light: #D4EDDA;
    --success-dark: #1E7E34;
    
    --danger-color: #DC3545;
    --danger-light: #F8D7DA;
    --danger-dark: #C82333;
    
    --warning-color: #FFC107;
    --warning-light: #FFF3CD;
    --warning-dark: #E0A800;
    
    --info-color: #17A2B8;
    --info-light: #D1ECF1;
    --info-dark: #138496;
    
    /* Fondos - Gradientes suaves empresariales */
    --bg-color: #F8F9FA;
    --bg-secondary: #E9ECEF;
    --bg-white: #FFFFFF;
    --bg-hover: #F0F4F8;
    
    /* Textos - Jerarquía empresarial */
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-muted: #ADB5BD;
    --text-light: #FFFFFF;
    
    /* Bordes y separadores */
    --border-color: #DEE2E6;
    --border-light: #E9ECEF;
    --border-dark: #CED4DA;
    
    /* Sombras empresariales - Más sutiles y profesionales */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Espaciado y diseño */
    --radius: 6px;
    --radius-lg: 10px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradientes empresariales */
    --gradient-primary: linear-gradient(135deg, #0066CC 0%, #004C99 100%);
    --gradient-header: linear-gradient(180deg, #FFFFFF 0%, #F8F9FA 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Inter', sans-serif;
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header y Navegación - Estilo empresarial moderno */
.header {
    background: var(--gradient-header);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-color);
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.header-welcome {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 2rem;
}

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

.welcome-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.3px;
}

.welcome-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.welcome-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: var(--primary-lighter);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Contenedor principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards - Estilo empresarial moderno */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.card-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin: 0;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: var(--success-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Formularios */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
    background: var(--bg-white);
}

.form-control:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Tablas */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.table thead {
    background: linear-gradient(180deg, #F8F9FA 0%, #E9ECEF 100%);
    border-bottom: 2px solid var(--border-dark);
}

.table th {
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 0.875rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--primary-lighter);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success-color);
    font-weight: 500;
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid var(--danger-color);
    font-weight: 500;
}

.badge-warning {
    background: var(--warning-light);
    color: #856404;
    border: 1px solid var(--warning-color);
    font-weight: 500;
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
    border: 1px solid var(--info-color);
    font-weight: 500;
}

/* Alertas - Estilo empresarial moderno */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.alert-danger {
    background: var(--danger-light);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.alert-info {
    background: var(--info-light);
    border-color: var(--info-color);
    color: var(--info-dark);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning-color);
    color: #856404;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.75rem;
}

.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.75rem;
}

/* Utilidades */
.text-center {
    text-align: center;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* Login Page - Estilo empresarial */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.login-title h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-title p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 400;
}

/* Tabs/Pestañas */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.tab:hover {
    color: var(--primary-color);
    background: var(--primary-lighter);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--primary-lighter);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 0;
    min-height: 200px;
}

.tab-content.active {
    display: block !important;
}

/* Asegurar que los campos dentro de pestañas sean accesibles */
.tab-content input,
.tab-content select,
.tab-content textarea {
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .header-welcome {
        order: 3;
        width: 100%;
        margin: 1rem 0 0 0;
        padding-top: 1rem;
        border-top: 1px solid var(--border-light);
    }

    .welcome-title {
        font-size: 1.125rem;
    }

    .welcome-text {
        font-size: 0.8125rem;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .col-6,
    .col-4,
    .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .table-container {
        font-size: 0.8125rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .table-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Loading */
.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 0.8s linear infinite;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Sidebar estilo Windows 11 */
.app-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 80px;
}

.sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
    transform: translateX(2px);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 76, 153, 0.08) 100%);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
    transition: var(--transition);
}

.sidebar-item:hover .sidebar-icon {
    transform: scale(1.1);
}

.sidebar-item.active .sidebar-icon {
    stroke-width: 2.5;
}

.sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 0;
    transition: var(--transition);
}

/* Responsive para sidebar */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .sidebar.active {
        max-height: 500px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-nav {
        padding: 0.5rem;
    }
    
    .sidebar-item {
        padding: 1rem;
    }
}

