/* ============================================
   INVENTORYPRO V2 — SISTEMA DE DISEÑO PREMIUM
   RESPONSIVE MOBILE-FIRST
   ============================================ */

/* ---------- Variables de Tema ---------- */
:root {
    --font: 'Inter', system-ui, sans-serif;

    --bg-body:    #0d1117;
    --bg-sidebar: #161b22;
    --bg-card:    #1c2330;
    --bg-hover:   #21262d;
    --border:     #30363d;

    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:     #484f58;

    --accent:       #3b82f6;
    --accent-light: rgba(59,130,246,0.15);
    --accent-glow:  rgba(59,130,246,0.4);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger:  #ef4444;
    --purple:  #a78bfa;

    --sidebar-width: 240px;
    --topbar-height: 60px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="light"] {
    --bg-body:    #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card:    #ffffff;
    --bg-hover:   #f1f5f9;
    --border:     #cbd5e1;
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---------- Layout Principal ---------- */
.app-layout { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR OVERLAY (Mobile) ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s ease, background 0.3s ease;
}

.sidebar-logo {
    padding: 1.1rem 1.25rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-logo .logo-icon {
    width: 32px; height: 32px;
    background: transparent !important;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
}
.sidebar-logo .logo-text {
    font-size: 1.3rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px;
}
.sidebar-logo .logo-text span { display: none; }

/* Botón cerrar sidebar en mobile */
.sidebar-close {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.sidebar-close:hover { color: white; }

.sidebar-nav { flex: 1; padding: 0.875rem 0.75rem; }

.nav-section-title {
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.75rem 0.5rem 0.4rem;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 0.6rem 0.75rem;
    border-radius: 8px; text-decoration: none;
    color: var(--text-secondary);
    font-size: 13.5px; font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    min-height: 42px; /* Touch target */
}
.nav-item:hover { background: var(--bg-hover) !important; color: var(--accent) !important; }
.nav-item.active { background: var(--accent-light) !important; color: var(--accent) !important; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer;
    transition: background 0.15s;
}
.sidebar-user:hover { background: var(--bg-hover); }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info .role { font-size: 11px; color: var(--text-secondary); }

/* ---------- MAIN WRAPPER ---------- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* ---------- TOPBAR ---------- */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 100;
    gap: 1rem;
}
.topbar-left h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.topbar-left p { font-size: 11px; color: var(--text-secondary); }
.topbar-right { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.topbar-date { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }

/* Botón hamburguesa (solo mobile) */
.btn-menu {
    display: none;
    width: 40px; height: 40px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    align-items: center; justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-menu:hover { background: var(--accent); color: white; }
.btn-menu svg { width: 20px; height: 20px; }

/* Botón Tema */
.btn-theme {
    width: 36px; height: 36px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s; flex-shrink: 0;
}
.btn-theme:hover { color: var(--text-primary); border-color: var(--accent); }
.btn-theme svg { width: 16px; height: 16px; }

/* Botón Volver */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .45rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}
.btn-back:hover { color: var(--text-primary); border-color: var(--accent); background: var(--accent-light); }
.btn-back svg { width: 14px; height: 14px; }

/* ---------- MAIN CONTENT ---------- */
.page-content { flex: 1; padding: 1.5rem; }

/* ---------- STATS GRID ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    display: flex; flex-direction: column; gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.stat-card-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-card-icon svg { width: 16px; height: 16px; }
.stat-card-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; color: var(--text-primary); line-height: 1; margin: 4px 0 0; }
.stat-card-sub { font-size: 11px; color: var(--text-secondary); }
.stat-card-accent { position: absolute; top: 0; right: 0; width: 80px; height: 80px; border-radius: 50%; filter: blur(30px); opacity: 0.15; pointer-events: none; }

/* Colores tarjetas */
.card-blue   { border-top: 2px solid #3b82f6; }
.card-orange { border-top: 2px solid #f97316; }
.card-purple { border-top: 2px solid #a78bfa; }
.card-green  { border-top: 2px solid #22c55e; }
.card-teal   { border-top: 2px solid #2dd4bf; }
.icon-blue   { background: rgba(59,130,246,0.15); color: #3b82f6; }
.icon-orange { background: rgba(249,115,22,0.15); color: #f97316; }
.icon-purple { background: rgba(167,139,250,0.15); color: #a78bfa; }
.icon-green  { background: rgba(34,197,94,0.15); color: #22c55e; }
.icon-teal   { background: rgba(45,212,191,0.15); color: #2dd4bf; }
.glow-blue   { background: #3b82f6; }
.glow-orange { background: #f97316; }
.glow-purple { background: #a78bfa; }
.glow-green  { background: #22c55e; }
.glow-teal   { background: #2dd4bf; }

/* ---------- DASHBOARD GRIDS ---------- */
.dashboard-grid-main {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1rem;
    margin-bottom: 1rem;
}
.dashboard-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---------- CONTENT CARDS — DISEÑO PREMIUM ---------- */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 2px solid var(--card-color, var(--accent));
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.22s, transform 0.22s;
}
/* Glow difuminado en la esquina — igual que stat-card-accent */
.content-card::before {
    content: '';
    position: absolute;
    top: -15px; right: -15px;
    width: 100px; height: 100px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.12;
    pointer-events: none;
    background: var(--card-color, var(--accent));
    transition: opacity 0.3s;
}
.content-card:hover::before { opacity: 0.22; }
.content-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Colores rotativos para content-card según posición */
.content-card:nth-child(5n+1) { --card-color: #3b82f6; }
.content-card:nth-child(5n+2) { --card-color: #f97316; }
.content-card:nth-child(5n+3) { --card-color: #a78bfa; }
.content-card:nth-child(5n+4) { --card-color: #22c55e; }
.content-card:nth-child(5n+5) { --card-color: #2dd4bf; }

/* Si hay solo una card, que sea azul siempre */
.content-card:only-child { --card-color: #3b82f6; }

/* Variantes de color manuales */
.content-card.card-blue   { --card-color: #3b82f6; }
.content-card.card-green  { --card-color: #22c55e; }
.content-card.card-orange { --card-color: #f97316; }
.content-card.card-purple { --card-color: #a78bfa; }
.content-card.card-teal   { --card-color: #2dd4bf; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.card-title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.card-title svg { color: var(--card-color, var(--accent)); }
.card-badge {
    font-size: 11px;
    background: rgba(59,130,246,0.12);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(59,130,246,0.2);
    font-weight: 600;
}

/* ---------- GRID UTILITIES RESPONSIVE ---------- */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-sidebar { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.grid-stats-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.grid-main-chart { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }

/* ---------- TABLAS RESPONSIVE ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- LISTAS ---------- */
.data-list { display: flex; flex-direction: column; gap: 4px; }
.data-row { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0.5rem; border-radius: 8px; transition: background 0.15s; }
.data-row:hover { background: var(--bg-hover); }
.data-row-left { display: flex; align-items: center; gap: 10px; }
.data-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.data-row-title { font-size: 13px; font-weight: 500; }
.data-row-sub { font-size: 11px; color: var(--text-secondary); }
.data-row-right { text-align: right; }
.data-row-value { font-size: 13px; font-weight: 600; }
.data-row-date { font-size: 11px; color: var(--text-secondary); }

/* ---------- BADGES ---------- */
.badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-danger  { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ---------- ALERT BANNER ---------- */
.alert-banner {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: 8px; font-size: 13px;
    background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3);
    color: #f59e0b; margin-bottom: 1rem;
}

/* ---------- FORMULARIOS PREMIUM ---------- */
input, select, textarea {
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    background: var(--bg-hover) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 0.6rem 0.875rem;
    transition: all 0.2s ease;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
    background: var(--bg-card) !important;
}
/* Labels de formularios */
label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.375rem;
    letter-spacing: 0.02em;
}

/* ---------- MODALES RESPONSIVE ---------- */
.modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}
.modal-backdrop.active { display: flex; }
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 16px;
    padding: 1.75rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.modal-box::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    background: var(--accent);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.08;
    pointer-events: none;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* ── Tablet grande: 1280px ── */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid-main { grid-template-columns: 1fr; }
}

/* ── Tablet: 1024px ── */
@media (max-width: 1024px) {
    .dashboard-grid-bottom { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Mobile grande: 768px ── */
@media (max-width: 768px) {

    /* Sidebar se oculta y convierte en drawer */
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 300;
        box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: flex; }

    /* Main no tiene margen lateral */
    .main-wrapper { margin-left: 0; }

    /* Botón hamburguesa visible */
    .btn-menu { display: flex !important; }
    
    /* Sidebar always starts hidden on mobile */
    .sidebar { transform: translateX(-100%) !important; }
    .sidebar.open { transform: translateX(0) !important; }

    /* Todas las grids colapsan a 1 columna */
    .grid-2col,
    .grid-3col,
    .grid-sidebar,
    .grid-main-chart,
    .dashboard-grid-main,
    .dashboard-grid-bottom { 
        display: block !important; 
    }
    .grid-2col > *,
    .grid-3col > *,
    .grid-sidebar > *,
    .grid-main-chart > * {
        margin-bottom: 1rem;
    }
    
    /* Stats: 2 columnas en móvil */
    .stats-grid,
    .grid-stats-5 { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 0.75rem; 
    }

    /* FORZAR grids inline a colapsar */
    [style*="grid-template-columns: 1fr 340px"],
    [style*="grid-template-columns:1fr 340px"] {
        display: block !important;
    }
    [style*="grid-template-columns: 1fr 340px"] > *,
    [style*="grid-template-columns:1fr 340px"] > * {
        margin-bottom: 1rem;
        width: 100% !important;
    }
    [style*="grid-template-columns: repeat(2,1fr)"],
    [style*="grid-template-columns:repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns: repeat(3,1fr)"],
    [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }


    /* Topbar compacta */
    .topbar { padding: 0 1rem; }
    .topbar-date { display: none; }
    .topbar-left h2 { font-size: 0.95rem; }
    .topbar-left p { display: none; }

    /* Stats: 2 columnas */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-card-value { font-size: 1.3rem; }

    /* Padding reducido */
    .page-content { padding: 1rem; }

    /* Grids a 1 columna */
    .dashboard-grid-main,
    .dashboard-grid-bottom { grid-template-columns: 1fr; }

    /* Grids personalizados de módulos */
    div[style*="grid-template-columns: 1fr 340px"] {
        display: block !important;
    }
    div[style*="grid-template-columns: 1fr 340px"] > div {
        margin-bottom: 1rem;
    }
    div[style*="grid-template-columns: repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: repeat(3,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Tablas con scroll horizontal */
    .content-card { padding: 0; }
    .content-card table { min-width: 560px; }

    /* Modales a pantalla completa */
    .modal-backdrop { padding: 0.5rem; align-items: flex-end; }
    .modal-box { max-width: 100%; border-radius: 12px 12px 0 0; }
    div[style*="max-width:420px"], div[style*="max-width:400px"], 
    div[style*="max-width:450px"], div[style*="max-width:500px"], 
    div[style*="max-width:600px"], div[style*="max-width:640px"], 
    div[style*="max-width:700px"] { max-width: 100% !important; }

    /* Botones de acción en tabla: columna */
    td div[style*="display:flex;gap:.4rem"] {
        flex-direction: column !important;
        gap: 4px !important;
    }
    td div[style*="display:flex;gap:.5rem"] {
        flex-direction: column !important;
        gap: 4px !important;
    }

    /* Filtros en fila scrollable */
    div[style*="display:flex;gap:.5rem;margin-bottom:1.25rem"] {
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap !important;
    }

    /* Acciones del topbar */
    div[style*="display:flex; gap:1rem"] {
        gap: 0.5rem !important;
    }

    /* Ocultar fecha en topbar de módulos */
    .topbar-right .topbar-date { display: none; }

    /* Cards stat más compactas */
    .stat-card { padding: 0.875rem 1rem; }
}

/* ── Mobile pequeño: 480px ── */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.625rem; }
    .stat-card-value { font-size: 1.2rem; }
    .stat-card-title { font-size: 9.5px; }
    .page-content { padding: 0.75rem; }

    .topbar-left h2 { font-size: 0.875rem; }
    .topbar { padding: 0 0.75rem; }
    .stat-card { padding: 0.75rem; }

    /* Modales anclados al fondo en mobile pequeño */
    div[style*="position:fixed"][style*="align-items:center"] {
        align-items: flex-end !important;
        padding: 0 !important;
    }
    div[style*="max-width:420px"], div[style*="max-width:400px"], 
    div[style*="max-width:450px"], div[style*="max-width:500px"], 
    div[style*="max-width:600px"], div[style*="max-width:640px"], 
    div[style*="max-width:700px"] {
        max-width: 100% !important;
        border-radius: 12px 12px 0 0 !important;
        margin: 0 !important;
    }

    /* Botones de acción en tablas: apilados */
    td > div { flex-direction: column !important; gap: 3px !important; }
    td > div > button, td > div > form > button {
        width: 100%;
        text-align: center;
    }

    /* Inputs y selects full width */
    input[type="number"], input[type="text"], input[type="date"], select {
        min-height: 42px;
        font-size: 16px !important; /* Evita zoom en iOS */
    }

    .modal-box { padding: 1rem; border-radius: 12px 12px 0 0; }

    /* Ocultar columnas secundarias en tablas pequeñas */
    .hide-mobile { display: none !important; }
}


/* =============================================
   FILTROS Y REPORTES
   ============================================= */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-filters {
    display: flex;
    background: var(--bg-hover);
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.time-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary) !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-btn:hover { color: var(--accent) !important; }
.time-btn.active {
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.75rem;
}

.date-range input {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    width: 100%;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-filter-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-print { background: var(--bg-hover) !important; color: var(--text-primary) !important; }
.btn-print:hover { background: var(--accent) !important; border-color: var(--accent) !important; color: white !important; }

.btn-clear { background: transparent; color: var(--text-secondary); }
.btn-clear:hover { color: var(--danger); border-color: var(--danger); }

/* Estilos para Impresión */
@media print {
    .sidebar, .topbar, .filter-card, .btn-float, .sidebar-overlay { display: none !important; }
    .main-wrapper { margin-left: 0 !important; padding: 0 !important; }
    .page-content { padding: 0 !important; }
    .content-card { border: none !important; box-shadow: none !important; }
    body { background: white !important; color: black !important; }
    table { width: 100% !important; color: black !important; }
    tr { border-bottom: 1px solid #ddd !important; }
    .badge { border: 1px solid #ddd !important; color: black !important; background: white !important; }
}

/* ==============================================
   DISEÑO PREMIUM GLOBAL — TABLAS Y UI
   ============================================== */

/* Tablas premium */
table {
    width: 100%;
    border-collapse: collapse;
}
thead tr {
    background: var(--bg-hover);
    border-bottom: 2px solid var(--accent);
}
thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover) !important; }
td {
    padding: 0.875rem 1rem;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Filter-card premium */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.filter-card::before {
    content: '';
    position: absolute;
    top: -10px; right: -10px;
    width: 100px; height: 100px;
    background: var(--accent);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.07;
    pointer-events: none;
}

/* Sidebar premium: borde izquierdo en activo */
.nav-item.active {
    background: var(--accent-light) !important;
    color: var(--accent) !important;
    border-left: 3px solid var(--accent);
    padding-left: calc(0.75rem - 3px);
}

/* Topbar premium */
.topbar {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
[data-theme="light"] .topbar {
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

/* Stat cards: animación de entrada suave */
.stat-card {
    animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }

/* Botones de acción en tablas */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}
.btn-action-edit {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
    border-color: rgba(59,130,246,0.25);
}
.btn-action-edit:hover { background: #3b82f6; color: white; }
.btn-action-delete {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border-color: rgba(239,68,68,0.25);
}
.btn-action-delete:hover { background: #ef4444; color: white; }
.btn-action-success {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
    border-color: rgba(34,197,94,0.25);
}
.btn-action-success:hover { background: #22c55e; color: white; }

/* Page content: animación de entrada */
.page-content {
    animation: pageIn 0.3s ease;
}
@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==============================================
   GRID DE TARJETAS Y MODALES PREMIUM
   ============================================== */

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Animación de entrada para el grid */
.cat-grid > * {
    animation: fadeInScale 0.4s ease backwards;
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.cat-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-icon.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239,68,68,0.1);
}

/* Modales Premium */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: auto;
    position: relative;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-box label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.modal-box input, 
.modal-box select, 
.modal-box textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-hover) !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.modal-box input:focus, 
.modal-box select:focus, 
.modal-box textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}
