/* ============================================
   INTRANET SOUTHFOOD - ESTILOS GLOBALES
   Versión: 1.1.0
   ============================================ */

/* ============================================
   VARIABLES GLOBALES
   ============================================ */
:root {
    --color-primary: #e31837;
    --color-primary-dark: #c0392b;
    --color-primary-darker: #a93226;
    --color-dark: #1a1a2e;
    --color-dark-mid: #16213e;
    --color-dark-light: #0f3460;
    --color-white: #ffffff;
    --color-bg: #f0f2f5;
    --color-text-muted: rgba(255,255,255,0.6);
    --color-text-light: rgba(255,255,255,0.8);
    --color-glass: rgba(255,255,255,0.05);
    --color-glass-border: rgba(255,255,255,0.1);
    --border-radius-sm: 8px;
    --border-radius-md: 10px;
    --border-radius-lg: 15px;
    --border-radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.2);
    --shadow-lg: 0 25px 45px rgba(0,0,0,0.3);
    --shadow-primary: 0 5px 15px rgba(227,24,55,0.4);
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: auto;
}

body {
    min-width: 320px;
}

img,
canvas {
    max-width: 100%;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-mid) 50%, var(--color-dark-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--color-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.brand-logos {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.brand-logos img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    background: var(--color-white);
    padding: 5px;
    transition: transform 0.3s;
}

.brand-logos img:hover {
    transform: scale(1.1);
}

.login-titulo {
    color: var(--color-white);
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.login-subtitulo {
    color: var(--color-text-muted);
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-form-control {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--color-white);
    border-radius: var(--border-radius-md);
    padding: 12px 15px;
    transition: all 0.3s;
}

.login-form-control:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 0 0 0.2rem rgba(227,24,55,0.25);
}

.login-form-control::placeholder {
    color: rgba(255,255,255,0.4);
}

.login-label {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.btn-login {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    border-radius: var(--border-radius-md);
    padding: 12px;
    font-weight: bold;
    font-size: 1rem;
    width: 100%;
    color: var(--color-white);
    margin-top: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-darker));
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: var(--color-white);
}

.login-error {
    background: rgba(227,24,55,0.2);
    border: 1px solid rgba(227,24,55,0.5);
    color: #ff6b7a;
    border-radius: var(--border-radius-md);
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.login-footer {
    color: rgba(255,255,255,0.3);
    text-align: center;
    font-size: 0.75rem;
    margin-top: 25px;
}

/* ============================================
   NAVBAR
   ============================================ */
.main-navbar {
    background: linear-gradient(135deg, var(--color-dark), var(--color-dark-light));
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.navbar-brand-text {
    color: var(--color-white);
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-brand-text:hover { color: var(--color-white); text-decoration: none; }

.main-navbar > .d-flex {
    min-width: 0;
}

.nav-logos img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    background: var(--color-white);
    border-radius: var(--border-radius-sm);
    padding: 3px;
    margin-left: 5px;
}

.user-info-text {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.btn-logout {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--color-white);
    border-radius: var(--border-radius-sm);
    padding: 5px 15px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(227,24,55,0.5);
    color: var(--color-white);
}

/* ============================================
   DASHBOARD PRINCIPAL
   ============================================ */
.welcome-card {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    color: var(--color-white);
    margin-bottom: 20px;
}

.dashboard-status-panel {
    min-width: 260px;
    text-align: right;
}

.dashboard-current-date {
    color: rgba(255,255,255,0.78);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.sync-card {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: var(--border-radius-md);
    padding: 10px 12px;
    color: var(--color-white);
    min-width: 260px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.sync-card-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.sync-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    font-size: 0.76rem;
    font-weight: 800;
}

.sync-icon-loading {
    background: rgba(255,255,255,0.24);
}

.sync-icon-ok {
    background: #27ae60;
}

.sync-icon-error {
    background: #f39c12;
}

.sync-card-time {
    font-size: 1.72rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.sync-card-date {
    color: rgba(255,255,255,0.9);
    font-size: 0.78rem;
    font-weight: 600;
}

.sync-card-detail,
.sync-card-refresh {
    color: rgba(255,255,255,0.72);
    font-size: 0.7rem;
    line-height: 1.25;
    margin-top: 4px;
}

.sync-card-error {
    border-color: rgba(255,255,255,0.38);
    background: rgba(26,26,46,0.24);
}

.rol-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.78rem;
    display: inline-block;
    margin-top: 5px;
}

.seccion-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

.menu-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
    box-shadow: var(--shadow-sm);
}

.menu-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(227,24,55,0.15);
    text-decoration: none;
}

.menu-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.menu-titulo {
    font-weight: 700;
    color: var(--color-dark);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.menu-desc {
    color: #888;
    font-size: 0.74rem;
    line-height: 1.3;
}

/* ============================================
   DASHBOARD VENTAS - KPIs
   ============================================ */
.kpi-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    border-left: 4px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.kpi-valor {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.2;
    margin-top: 4px;
}

.kpi-label {
    font-size: 0.78rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   GRAFICOS
   ============================================ */
.grafico-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.grafico-titulo {
    font-weight: 700;
    color: var(--color-dark);
    font-size: 0.9rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}

/* ============================================
   FILTROS
   ============================================ */
.filtros-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.filtro-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.filtro-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid #ddd;
    padding: 7px 10px;
    font-size: 0.85rem;
    width: 100%;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 6px;
    width: 100%;
}

.segmented-btn {
    border: 1px solid #ddd;
    background: #f8f9fb;
    color: #555;
    border-radius: var(--border-radius-sm);
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.segmented-btn.active {
    background: var(--color-dark);
    border-color: var(--color-dark);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(26,26,46,0.16);
}

.segmented-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.btn-filtrar {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

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

.btn-exportar {
    background: var(--color-dark);
    color: var(--color-white);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-exportar:hover {
    background: var(--color-dark-light);
}

/* ============================================
   TABLA
   ============================================ */
.tabla-container {
    overflow-x: auto;
}

.tabla-ventas {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.tabla-ventas th {
    background: var(--color-dark);
    color: var(--color-white);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.tabla-ventas th:hover {
    background: var(--color-dark-light);
}

.tabla-ventas td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap;
}

.tabla-ventas tr:hover td {
    background: #fff5f5;
}

.tabla-ventas td:nth-child(1) { width: 90px; }
.tabla-ventas td:nth-child(2) { min-width: 180px; }
.tabla-ventas td:nth-child(3) { width: 80px; text-align: right; }
.tabla-ventas td:nth-child(4) { width: 100px; text-align: right; }
.tabla-ventas td:nth-child(5) { width: 120px; text-align: right; }
.tabla-ventas td:nth-child(6) { width: 150px; }

/* Tabla de empleados (RRHH): compacta, columnas automáticas y texto con ajuste
   para que entren todas sin scroll horizontal. Anula los anchos fijos de ventas. */
.tabla-emp { font-size: 0.75rem; min-width: 0; }
.tabla-emp th, .tabla-emp td {
    width: auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    padding: 5px 8px !important;
    word-break: break-word;
}
.tabla-emp th { font-size: 0.72rem; }

.badge-franq {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    display: inline-block;
}

.barra-pct {
    display: flex;
    align-items: center;
    gap: 6px;
}

.barra-bg {
    background: #f0f0f0;
    border-radius: 10px;
    height: 6px;
    width: 60px;
    overflow: hidden;
    flex-shrink: 0;
}

.barra-fill {
    height: 100%;
    border-radius: 10px;
}

/* ============================================
   ADMIN CRUD
   ============================================ */
.admin-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.admin-titulo {
    font-weight: 700;
    color: var(--color-dark);
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
}

.btn-primary-sf {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-sf:hover {
    background: var(--color-primary-dark);
    color: white;
}

.btn-dark-sf {
    background: var(--color-dark);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-dark-sf:hover {
    background: var(--color-dark-light);
    color: white;
}

.btn-danger-sf {
    background: #c0392b;
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 6px 14px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger-sf:hover {
    background: #a93226;
}

.btn-warning-sf {
    background: #f39c12;
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 6px 14px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-warning-sf:hover {
    background: #d68910;
}

.form-sf input,
.form-sf select,
.form-sf textarea {
    border-radius: var(--border-radius-sm);
    border: 1px solid #ddd;
    padding: 8px 12px;
    font-size: 0.85rem;
    width: 100%;
    transition: border-color 0.2s;
}

.form-sf input:focus,
.form-sf select:focus,
.form-sf textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(227,24,55,0.15);
}

.form-sf label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    display: block;
}

/* ============================================
   CHART CONTAINERS
   ============================================ */
.chart-container { position: relative; width: 100%; }
.chart-sm { height: 220px; }
.chart-md { height: 280px; }
.chart-lg { height: 320px; }
.chart-xl { height: 200px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container-fluid.p-4 { padding: 12px !important; }
    .main-navbar {
        padding: 8px 12px;
        gap: 8px;
    }
    .navbar-brand-text { font-size: 0.95rem; }
    .nav-logos { display: none; }
    .user-info-text { font-size: 0.78rem; }
    .btn-logout { padding: 5px 10px; font-size: 0.78rem; }
    .module-tabs {
        padding: 0 8px;
        top: 50px;
    }
    .module-tab { padding: 9px 10px; font-size: 0.76rem; }
    /* Subtabs: scroll horizontal en lugar de wrap */
    .module-subtabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        padding: 4px 4px;
    }
    .module-subtabs::-webkit-scrollbar { display: none; }
    .module-subtab {
        min-width: auto;
        flex: 0 0 auto;
        font-size: 0.74rem;
        padding: 7px 10px;
    }
    .welcome-card,
    .admin-card,
    .grafico-card,
    .filtros-card,
    .kpi-card { border-radius: var(--border-radius-md); }
    .welcome-card { padding: 14px; }
    .admin-card,
    .grafico-card,
    .filtros-card { padding: 12px; }
    .login-card { margin: 16px; padding: 22px; }
    .kpi-valor { font-size: 1.15rem; }
    .brand-logos img { width: 45px; height: 45px; }
    .menu-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-sm { height: 180px; }
    .chart-md { height: 200px; }
    .chart-lg { height: 220px; }
    .tabla-ventas { font-size: 0.73rem; }
    .tabla-ventas td, .tabla-ventas th { padding: 6px 8px; }
    .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 2px;
    }
    .dashboard-status-panel { min-width: 100%; text-align: left; }
    .sync-card { min-width: 100%; }
    .sync-card-header { justify-content: flex-start; }
    /* KPI compacto en móvil */
    .kpi-card { padding: 12px 14px; }
    .kpi-label { font-size: 0.7rem; }
    /* Filtros compactos */
    .filtro-label { font-size: 0.7rem; }
    .filtro-select { padding: 6px 8px; font-size: 0.8rem; }
    .btn-toggle { padding: 5px 10px; font-size: 0.74rem; }
}

@media (max-width: 480px) {
    .container-fluid.p-4 { padding: 10px !important; }
    .container-fluid.p-3 { padding: 10px !important; }
    .container-fluid.px-3 { padding-left: 10px !important; padding-right: 10px !important; }
    .main-navbar { padding: 8px 10px; }
    .menu-grid { grid-template-columns: 1fr; }
    .kpi-card { padding: 10px 12px; }
    .kpi-valor {
        font-size: 1rem;
        overflow-wrap: anywhere;
    }
    .grafico-titulo { font-size: 0.82rem; }
    .chart-sm,
    .chart-md,
    .chart-lg,
    .chart-xl { height: 200px; }
    .segmented-control { grid-template-columns: 1fr; }
    /* Paginación lista productos: botones más pequeños */
    #lista-paginacion button { padding: 4px 8px !important; font-size: 0.72rem !important; }
    #sel-lista-pp { width: 60px !important; }
    #inp-lista-producto { width: 140px !important; }
}

/* ============================================
   TOGGLE BUTTONS (franquicia, turno, canal)
   ============================================ */
.btn-toggle {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #ddd;
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #555;
}
.btn-toggle:hover { border-color: #aaa; }
.btn-toggle.active-ph      { background: #e31837; border-color: #e31837; color: white; }
.btn-toggle.active-kfc     { background: #e67e00; border-color: #e67e00; color: white; }
.btn-toggle.active-all,
.btn-toggle.active-canal   { background: #1a1a2e; border-color: #1a1a2e; color: white; }
.btn-toggle.active-diurno  { background: #f39c12; border-color: #f39c12; color: white; }
.btn-toggle.active-nocturno{ background: #3498db; border-color: #3498db; color: white; }

/* ============================================
   PRESET DATE BUTTONS
   ============================================ */
.btn-preset {
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid #ddd;
    background: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-preset:hover  { border-color: #aaa; color: #333; }
.btn-preset.active { background: #1a1a2e; border-color: #1a1a2e; color: white; }

/* ============================================
   SUB-TABS (dentro de un módulo)
   ============================================ */
.module-subtabs {
    display: flex;
    gap: 4px;
    background: #e9ecef;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.module-subtab {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.module-subtab.active {
    background: white;
    color: #1a1a2e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.module-subtab:hover:not(.active) { color: #333; }

/* ============================================
   DELIVERY — CARDS INTEGRADORES
   ============================================ */
.integrador-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #ddd;
    transition: transform 0.15s, box-shadow 0.15s;
}
.integrador-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.integrador-nombre {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}
.integrador-total {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
}
.integrador-meta {
    font-size: 0.73rem;
    color: #999;
    margin-top: 4px;
}
.integrador-pct { font-size: 0.8rem; font-weight: 700; color: #555; }
.integrador-var {
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 2px;
}
.var-up   { color: #27ae60; }
.var-down { color: #e31837; }

.pct-bar {
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    margin-top: 8px;
}
.pct-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card { height: 110px; border-radius: 12px; }

/* ============================================
   SPINNER OVERLAY
   ============================================ */
.spinner-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #aaa;
    font-size: 0.9rem;
    gap: 10px;
}

/* MODULE TABS */
.module-tabs {
    background: var(--color-dark);
    padding: 0 20px;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: sticky;
    top: 55px;
    z-index: 99;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.module-tabs::-webkit-scrollbar { display: none; }
.module-tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}
.module-tab:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); text-decoration: none; }
.module-tab.active { color: white; border-bottom-color: var(--color-primary); background: rgba(227,24,55,0.1); }
@media (max-width: 768px) {
    .module-tabs { padding: 0 10px; }
    .module-tab  { padding: 9px 10px; font-size: 0.78rem; }
}

/* Fila de totales — no cambiar color al hover */
.tabla-ventas tr.fila-total:hover td,
.tabla-ventas tr.fila-total td {
    background: inherit !important;
    color: white !important;
}
