/* ========================================
   VARIABLES CSS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');

:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #14b8a6;
    --success: #0ea972;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-main: #e9edf3;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-hover: rgba(255, 255, 255, 0.6);
    
    --text-primary: #0f172a;
    --text-secondary: #52607a;
    --text-light: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 40px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 60px rgba(15, 23, 42, 0.12);
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-blur: 14px;
    
    --font-family: 'Manrope', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Dark Theme para app.css */
[data-theme="dark"] {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #14b8a6;
    --success: #0ea972;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-sidebar: #0F172A;
    --bg-hover: rgba(30, 41, 59, 0.6);
    
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-light: #94A3B8;
    
    --border-color: rgba(51, 65, 85, 0.4);
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.5);
    
    --glass-bg: rgba(30, 41, 59, 0.78);
    --glass-border: rgba(51, 65, 85, 0.45);
    --glass-blur: 14px;
}

/* ========================================
   RESET Y BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.logo i {
    font-size: 28px;
    color: var(--primary);
}

.sidebar-toggle {
    display: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: white;
    border-left-color: var(--primary);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    margin-bottom: 12px;
}

.user-info i {
    font-size: 36px;
    color: var(--primary);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #9ca3af;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-toggle {
    display: inline-flex;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 32px;
    text-align: center;
    line-height: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 1200;
}

.toggle-icon-bars {
    font-size: 20px;
}

.toggle-icon-close {
    display: none;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.toggle-open .toggle-icon-close {
    display: inline-block;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: inline-flex;
    }

    body.sidebar-open .mobile-menu-toggle {
        display: none;
    }
}

.toggle-open .toggle-icon-bars {
    display: none;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-hover);
    padding: 10px 16px;
    border-radius: 10px;
    min-width: 300px;
}

.search-box i {
    color: var(--text-light);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-btn {
    position: relative;
    background: var(--bg-hover);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.header-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.content {
    flex: 1;
    padding: 30px;
}

/* ========================================
   CARDS & STATS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
}

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

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.stat-card-subtitle,
.stat-card-subtitle small,
.stat-subtext {
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.stat-card-icon.primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.stat-card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-card-change {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card-change.positive {
    color: var(--success);
}

.stat-card-change.negative {
    color: var(--danger);
}

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

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

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ========================================
   TABLE
   ======================================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-hover);
}

th {
    padding: 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tr:hover {
    background: var(--bg-hover);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select.form-control {
    cursor: pointer;
}

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

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

.modal-overlay.active {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: var(--shadow-lg);
}

.modal.active {
    display: block;
}

.modal-content {
    padding: 30px;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 90px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 24px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    /* Mostrar la X dentro del header oscuro del sidebar en móvil */
    body.sidebar-open .sidebar-toggle {
        display: flex;
        position: absolute;
        right: 12px;
        top: 12px;
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 10px;
        padding: 8px 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 1400;
    }

    body.sidebar-open .mobile-menu-toggle {
        display: none;
    }

    .search-box {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 20px;
    }
}

@media (min-width: 769px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content.collapsed {
        margin-left: 0;
    }

    .sidebar.collapsed .sidebar-toggle {
        position: fixed;
        left: 12px;
        top: 16px;
        background: rgba(15, 23, 42, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 1200;
    }
}

@media (min-width: 769px) {
    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content.collapsed {
        margin-left: 0;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
    text-align: center;
}

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

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   MODERN GLASS THEME OVERRIDES
   ======================================== */
body {
    background: radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.12), transparent 28%),
                radial-gradient(circle at 80% 0%, rgba(20, 184, 166, 0.12), transparent 32%),
                radial-gradient(circle at 40% 85%, rgba(59, 130, 246, 0.12), transparent 32%),
                var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
}

.main-content {
    backdrop-filter: blur(4px);
}

.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-sm);
}

.sidebar {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.82) 100%);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.15);
}

.sidebar-header .logo span {
    letter-spacing: 0.2px;
}

.nav-item {
    border-left: 3px solid transparent;
    border-radius: 10px;
    margin: 0 12px 4px;
    color: #cbd5e1;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.2), rgba(20, 184, 166, 0.12));
    border-left-color: var(--primary);
    color: #e2e8f0;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fecdd3;
}

.main-content .content, .page-header {
    position: relative;
    z-index: 1;
}

.card, .stat-card, .table-container, .modal, .modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.card {
    border-radius: 18px;
}

.stat-card {
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.18), transparent 45%),
                radial-gradient(circle at 80% 30%, rgba(20, 184, 166, 0.14), transparent 55%);
    opacity: 0.7;
    pointer-events: none;
}

.btn {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.18);
    backdrop-filter: blur(8px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #22d3ee);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0ea5e9, #0ea972);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
}

.btn-danger, .btn-success, .btn-warning, .btn-info {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.search-box input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.form-control, .form-select, textarea {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
}

.form-control:focus, .form-select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.table th, .table td {
    border-color: rgba(226, 232, 240, 0.6);
}

.table thead {
    background: rgba(14, 165, 233, 0.06);
}

.page-header h1 {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.page-title {
    font-weight: 700;
    color: var(--text-primary);
}

.header-btn {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

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

.modal-content {
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.btn-comanda {
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    width: 100%;
    min-height: 160px;
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 22px;
    border-radius: 18px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-comanda:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.btn-comanda-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
}

.btn-comanda-danger {
    background: linear-gradient(135deg, #f97316 0%, #f43f5e 100%);
}

.btn-comanda-info {
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
}

.btn-comanda-success {
    background: linear-gradient(135deg, #10b981 0%, #22d3ee 100%);
}

.btn-comanda-warning {
    background: linear-gradient(135deg, #fde047 0%, #f97316 100%);
}

.comandas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.btn-comanda-icon {
    font-size: 32px;
}

.btn-comanda-text {
    font-size: 1.05rem;
    font-weight: 700;
}

@media (max-width: 992px) {
    .sidebar {
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
    }
    
    .card, .stat-card {
        box-shadow: var(--shadow-sm);
    }
}

@media (min-width: 1400px) {
    .comandas-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* ========================================
   ALERTAS - DISEÑO MODERNO
   ======================================== */
.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .8;
    }
}

/* Hover effects para cards de alertas */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

/* Estilos para badges en alertas */
.badge {
    font-weight: 600;
    padding: 6px 12px;
    letter-spacing: 0.3px;
}

/* Transiciones suaves */
.btn, .card, .badge {
    transition: all 0.3s ease;
}

/* ========================================
   MÓDULO DE ACTIVOS
   ======================================== */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    background: var(--bg-card);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.activo-card {
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.badge-stock-bajo { 
    background-color: var(--warning); 
}

.badge-sin-stock { 
    background-color: var(--danger); 
}

.badge-mantenimiento { 
    background-color: #ff5722; 
}

.badge-stock-ok { 
    background-color: var(--success); 
}

.categoria-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.bg-orange {
    background-color: #ff9800 !important;
}

/* ============================================
   GLOBAL LOADING OVERLAY
   ============================================ */
.global-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.global-loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.global-loading-spinner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.spinner-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 4px solid transparent;
  border-top-color: #FF6B35;
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
  width: 60px;
  height: 60px;
  border-top-color: #1E3A5F;
  animation-delay: -0.5s;
  animation-duration: 1.2s;
  top: 10px;
  left: 10px;
}

.spinner-ring:nth-child(3) {
  width: 40px;
  height: 40px;
  border-top-color: #3B82F6;
  animation-delay: -1s;
  animation-duration: 1s;
  top: 20px;
  left: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.loading-text {
  margin-top: 100px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Prevenir interacciones cuando está activo */
.global-loading-overlay.active ~ * {
  pointer-events: none;
}

