:root,
body.theme-light {
    --background: #ffffff; /* Blanco puro */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff; /* Blanco puro para el menú */
    --sidebar-text: #374151;
    --sidebar-heading: #9ca3af;
    --header-bg: #ffffff;
    --button-bg: #ffffff;
    --button-hover-bg: #f9fafb;
    --button-active-bg: #1f2937;
    --button-active-text: #ffffff;
    --input-bg: #f9fafb;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(255, 255, 255, 0.4);
    --login-border-color: rgba(229, 231, 235, 0.6);
    --login-button-bg: #1f2937;
    --login-button-text: #ffffff;
}

/* Bloqueo de seguridad para modales no cerrables (ej: caducidad) */
body.modal-locked #app-container,
body.security-locked #app-container {
    pointer-events: none;
    user-select: none;
}

body.modal-locked #modal-backdrop,
body.security-locked #security-barrier {
    background: rgba(15, 23, 42, 0.4);
    z-index: 999999 !important;
}

/* Animación de entrada para la barrera */
.animate-slide-up {
    animation: securitySlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes securitySlideUp {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

body.theme-dark {
    --background: #1f2937;
    /* gray-800 */
    --text-primary: #f3f4f6;
    /* gray-100 */
    --text-secondary: #9ca3af;
    /* gray-400 */
    --border-color: #4b5563;
    /* gray-600 */
    --card-bg: #374151;
    /* gray-700 */
    --sidebar-bg: #111827;
    /* gray-900 */
    --sidebar-text: #d1d5db;
    /* gray-300 */
    --sidebar-heading: #9ca3af;
    /* gray-400 */
    --header-bg: #374151;
    /* gray-700 */
    --button-bg: #4b5563;
    /* gray-600 */
    --button-hover-bg: #52525b;
    /* zinc-600 */
    --button-active-bg: #4f46e5;
    /* indigo-600 */
    --button-active-text: #ffffff;
    --input-bg: #4b5563;
    --login-card-bg: rgba(31, 41, 55, 0.75);
    --login-input-bg: rgba(75, 85, 99, 0.4);
    --login-border-color: rgba(107, 114, 128, 0.6);
    --login-button-bg: #4f46e5;
    --login-button-text: #ffffff;
}

body.theme-blue {
    --background: #eff6ff;
    /* blue-50 */
    --text-primary: #1e3a8a;
    /* blue-900 */
    --text-secondary: #3b82f6;
    /* blue-500 */
    --border-color: #bfdbfe;
    /* blue-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #1e40af;
    /* blue-800 */
    --sidebar-text: #dbeafe;
    /* blue-100 */
    --sidebar-heading: #93c5fd;
    /* blue-300 */
    --header-bg: #dbeafe;
    /* blue-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #eff6ff;
    /* blue-50 */
    --button-active-bg: #2563eb;
    /* blue-600 */
    --button-active-text: #ffffff;
    --input-bg: #eff6ff;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(219, 234, 254, 0.4);
    --login-border-color: rgba(191, 219, 254, 0.6);
    --login-button-bg: #1e40af;
    --login-button-text: #ffffff;
}

body.theme-minimalist {
    --background: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #f3f4f6;
    /* gray-100 */
    --card-bg: #ffffff;
    --sidebar-bg: #f9fafb;
    /* gray-50 */
    --sidebar-text: #374151;
    /* gray-700 */
    --sidebar-heading: #9ca3af;
    --header-bg: #ffffff;
    --button-bg: #ffffff;
    --button-hover-bg: #f9fafb;
    --button-active-bg: #1f2937;
    --button-active-text: #ffffff;
    --input-bg: #f9fafb;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(243, 244, 246, 0.4);
    --login-border-color: rgba(229, 231, 235, 0.6);
    --login-button-bg: #1f2937;
    --login-button-text: #ffffff;
}

body.theme-classic {
    --background: #fefce8;
    /* yellow-50 */
    --text-primary: #44403c;
    /* stone-700 */
    --text-secondary: #78716c;
    /* stone-500 */
    --border-color: #e7e5e4;
    /* stone-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #292524;
    /* stone-800 */
    --sidebar-text: #e7e5e4;
    /* stone-200 */
    --sidebar-heading: #a8a29e;
    /* stone-400 */
    --header-bg: #fafaf9;
    /* stone-50 */
    --button-bg: #ffffff;
    --button-hover-bg: #f5f5f4;
    --button-active-bg: #57534e;
    /* stone-600 */
    --button-active-text: #ffffff;
    --input-bg: #fefce8;
    --login-card-bg: rgba(255, 255, 250, 0.75);
    --login-input-bg: rgba(245, 245, 244, 0.4);
    --login-border-color: rgba(231, 229, 228, 0.6);
    --login-button-bg: #57534e;
    --login-button-text: #ffffff;
}

body.theme-purple {
    --background: #faf5ff;
    /* purple-50 */
    --text-primary: #581c87;
    /* purple-900 */
    --text-secondary: #7c3aed;
    /* purple-600 */
    --border-color: #d8b4fe;
    /* purple-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #581c87;
    /* purple-900 */
    --sidebar-text: #e9d5ff;
    /* purple-100 */
    --sidebar-heading: #c4b5fd;
    /* purple-300 */
    --header-bg: #e9d5ff;
    /* purple-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #faf5ff;
    /* purple-50 */
    --button-active-bg: #7c3aed;
    /* purple-600 */
    --button-active-text: #ffffff;
    --input-bg: #faf5ff;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(233, 213, 255, 0.4);
    --login-border-color: rgba(216, 180, 254, 0.6);
    --login-button-bg: #581c87;
    --login-button-text: #ffffff;
}

/* Complete purple theme with muted panel background for dashboard */
body.theme-purple {
    --muted-panel-bg: #f3e8ff;
    /* purple-100 with reduced opacity */
}

body.theme-green {
    --muted-panel-bg: #ecfdf5;
    /* emerald-50 */
}

body.theme-orange {
    --muted-panel-bg: #fff7ed;
    /* orange-50 */
}

body.theme-red {
    --muted-panel-bg: #fef2f2;
    /* red-50 */
}

body.theme-gradient-blue {
    --muted-panel-bg: rgba(255, 255, 255, 0.9);
}

body.theme-gradient-purple {
    --muted-panel-bg: rgba(255, 255, 255, 0.9);
}

body.theme-gradient-green {
    --muted-panel-bg: rgba(255, 255, 255, 0.9);
}

body.theme-gradient-orange {
    --muted-panel-bg: rgba(255, 255, 255, 0.9);
}

body.theme-gradient-sunset {
    --muted-panel-bg: rgba(255, 255, 255, 0.9);
}

body.theme-green {
    --background: #ecfdf5;
    /* emerald-50 */
    --text-primary: #064e3b;
    /* emerald-900 */
    --text-secondary: #059669;
    /* emerald-600 */
    --border-color: #a7f3d0;
    /* emerald-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #064e3b;
    /* emerald-900 */
    --sidebar-text: #d1fae5;
    /* emerald-100 */
    --sidebar-heading: #6ee7b7;
    /* emerald-300 */
    --header-bg: #d1fae5;
    /* emerald-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #ecfdf5;
    /* emerald-50 */
    --button-active-bg: #059669;
    /* emerald-600 */
    --button-active-text: #ffffff;
    --input-bg: #ecfdf5;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(209, 250, 229, 0.4);
    --login-border-color: rgba(167, 243, 208, 0.6);
    --login-button-bg: #064e3b;
    --login-button-text: #ffffff;
}

body.theme-orange {
    --background: #fff7ed;
    /* orange-50 */
    --text-primary: #9a3412;
    /* orange-900 */
    --text-secondary: #ea580c;
    /* orange-600 */
    --border-color: #fed7aa;
    /* orange-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #9a3412;
    /* orange-900 */
    --sidebar-text: #ffedd5;
    /* orange-100 */
    --sidebar-heading: #fdba74;
    /* orange-300 */
    --header-bg: #ffedd5;
    /* orange-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #fff7ed;
    /* orange-50 */
    --button-active-bg: #ea580c;
    /* orange-600 */
    --button-active-text: #ffffff;
    --input-bg: #fff7ed;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(255, 237, 213, 0.4);
    --login-border-color: rgba(254, 215, 170, 0.6);
    --login-button-bg: #9a3412;
    --login-button-text: #ffffff;
}

body.theme-red {
    --background: #fef2f2;
    /* red-50 */
    --text-primary: #7f1d1d;
    /* red-900 */
    --text-secondary: #dc2626;
    /* red-600 */
    --border-color: #fecaca;
    /* red-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #7f1d1d;
    /* red-900 */
    --sidebar-text: #fee2e2;
    /* red-100 */
    --sidebar-heading: #fca5a5;
    /* red-300 */
    --header-bg: #fee2e2;
    /* red-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #fef2f2;
    /* red-50 */
    --button-active-bg: #dc2626;
    /* red-600 */
    --button-active-text: #ffffff;
    --input-bg: #fef2f2;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(254, 226, 226, 0.4);
    --login-border-color: rgba(254, 202, 202, 0.6);
    --login-button-bg: #7f1d1d;
    --login-button-text: #ffffff;
}

/* Gradient Themes - Mejorados para interfaz completa */
body.theme-gradient-blue {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #1e40af;
    --text-secondary: #3b82f6;
    --border-color: #bfdbfe;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(135deg, #1e4a99 0%, #1e4a99 100%);
    --sidebar-text: #dbeafe;
    --sidebar-heading: #93c5fd;
    --header-bg: linear-gradient(135deg, #1e4a99 0%, #1e4a99 100%);
    --button-bg: #ffffff;
    --button-hover-bg: #eff6ff;
    --button-active-bg: #1e40af;
    --button-active-text: #ffffff;
    --input-bg: #ffffff;
    --login-card-bg: rgba(255, 255, 255, 0.95);
    --login-input-bg: rgba(255, 255, 255, 0.8);
    --login-border-color: rgba(59, 130, 246, 0.3);
    --login-button-bg: #1e40af;
    --login-button-text: #ffffff;
}

body.theme-gradient-purple {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #ffffff;
    --text-secondary: #e9d5ff;
    --border-color: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.95);
    --sidebar-bg: linear-gradient(135deg, #581c87 0%, #7c3aed 100%);
    --sidebar-text: #e9d5ff;
    --sidebar-heading: #c4b5fd;
    --header-bg: rgba(255, 255, 255, 0.9);
    --button-bg: rgba(255, 255, 255, 0.9);
    --button-hover-bg: rgba(255, 255, 255, 0.95);
    --button-active-bg: #7c3aed;
    --button-active-text: #ffffff;
    --input-bg: rgba(255, 255, 255, 0.9);
    --login-card-bg: rgba(255, 255, 255, 0.9);
    --login-input-bg: rgba(255, 255, 255, 0.7);
    --login-border-color: rgba(255, 255, 255, 0.5);
    --login-button-bg: #7c3aed;
    --login-button-text: #ffffff;
}

body.theme-gradient-green {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #064e3b;
    --text-secondary: #d1fae5;
    --border-color: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.95);
    --sidebar-bg: linear-gradient(135deg, #064e3b 0%, #059669 100%);
    --sidebar-text: #d1fae5;
    --sidebar-heading: #6ee7b7;
    --header-bg: rgba(255, 255, 255, 0.9);
    --button-bg: rgba(255, 255, 255, 0.9);
    --button-hover-bg: rgba(255, 255, 255, 0.95);
    --button-active-bg: #059669;
    --button-active-text: #ffffff;
    --input-bg: rgba(255, 255, 255, 0.9);
    --login-card-bg: rgba(255, 255, 255, 0.9);
    --login-input-bg: rgba(255, 255, 255, 0.7);
    --login-border-color: rgba(255, 255, 255, 0.5);
    --login-button-bg: #059669;
    --login-button-text: #ffffff;
}

body.theme-gradient-orange {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #9a3412;
    --text-secondary: #ffedd5;
    --border-color: rgba(255, 255, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.95);
    --sidebar-bg: linear-gradient(135deg, #9a3412 0%, #ea580c 100%);
    --sidebar-text: #ffedd5;
    --sidebar-heading: #fdba74;
    --header-bg: rgba(255, 255, 255, 0.9);
    --button-bg: rgba(255, 255, 255, 0.9);
    --button-hover-bg: rgba(255, 255, 255, 0.95);
    --button-active-bg: #ea580c;
    --button-active-text: #ffffff;
    --input-bg: rgba(255, 255, 255, 0.9);
    --login-card-bg: rgba(255, 255, 255, 0.9);
    --login-input-bg: rgba(255, 255, 255, 0.7);
    --login-border-color: rgba(255, 255, 255, 0.5);
    --login-button-bg: #ea580c;
    --login-button-text: #ffffff;
}

body.theme-gradient-sunset {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #7c2d12;
    --text-secondary: #ea580c;
    --border-color: #fed7aa;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(135deg, #dc2626 0%, #ea580c 50%, #f59e0b 100%);
    --sidebar-text: #fef3c7;
    --sidebar-heading: #fcd34d;
    --header-bg: linear-gradient(135deg, #dc2626 0%, #ea580c 50%, #f59e0b 100%);
    --button-bg: #ffffff;
    --button-hover-bg: #fef3c7;
    --button-active-bg: #ea580c;
    --button-active-text: #ffffff;
    --input-bg: #ffffff;
    --login-card-bg: rgba(255, 255, 255, 0.95);
    --login-input-bg: rgba(255, 245, 235, 0.8);
    --login-border-color: rgba(234, 88, 12, 0.3);
    --login-button-bg: #ea580c;
    --login-button-text: #ffffff;
}

/* Nuevos colores temÃ¡ticos aÃ±adidos */
body.theme-cyan {
    --background: #ecfeff;
    /* cyan-50 */
    --text-primary: #164e63;
    /* cyan-900 */
    --text-secondary: #0891b2;
    /* cyan-600 */
    --border-color: #a5f3fc;
    /* cyan-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #164e63;
    /* cyan-900 */
    --sidebar-text: #c7f6ff;
    /* cyan-100 */
    --sidebar-heading: #67e8f9;
    /* cyan-300 */
    --header-bg: #c7f6ff;
    /* cyan-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #ecfeff;
    /* cyan-50 */
    --button-active-bg: #0891b2;
    /* cyan-600 */
    --button-active-text: #ffffff;
    --input-bg: #ecfeff;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(199, 246, 255, 0.4);
    --login-border-color: rgba(165, 243, 252, 0.6);
    --login-button-bg: #164e63;
    --login-button-text: #ffffff;
}

body.theme-teal {
    --background: #f0fdfa;
    /* emerald-50 */
    --text-primary: #134e4a;
    /* teal-900 */
    --text-secondary: #0d9488;
    /* teal-600 */
    --border-color: #99f6e4;
    /* teal-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #134e4a;
    /* teal-900 */
    --sidebar-text: #ccfbf1;
    /* teal-100 */
    --sidebar-heading: #5eead4;
    /* teal-300 */
    --header-bg: #ccfbf1;
    /* teal-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #f0fdfa;
    /* emerald-50 */
    --button-active-bg: #0d9488;
    /* teal-600 */
    --button-active-text: #ffffff;
    --input-bg: #f0fdfa;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(204, 251, 241, 0.4);
    --login-border-color: rgba(153, 246, 228, 0.6);
    --login-button-bg: #134e4a;
    --login-button-text: #ffffff;
}

body.theme-pink {
    --background: #fdf2f8;
    /* pink-50 */
    --text-primary: #831843;
    /* pink-900 */
    --text-secondary: #db2777;
    /* pink-600 */
    --border-color: #f9a8d4;
    /* pink-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #831843;
    /* pink-900 */
    --sidebar-text: #fce7f3;
    /* pink-100 */
    --sidebar-heading: #f9a8d4;
    /* pink-300 */
    --header-bg: #fce7f3;
    /* pink-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #fdf2f8;
    /* pink-50 */
    --button-active-bg: #db2777;
    /* pink-600 */
    --button-active-text: #ffffff;
    --input-bg: #fdf2f8;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(252, 231, 243, 0.4);
    --login-border-color: rgba(249, 168, 212, 0.6);
    --login-button-bg: #831843;
    --login-button-text: #ffffff;
}

body.theme-indigo {
    --background: #eef2ff;
    /* indigo-50 */
    --text-primary: #312e81;
    /* indigo-900 */
    --text-secondary: #6366f1;
    /* indigo-600 */
    --border-color: #c7d2fe;
    /* indigo-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #312e81;
    /* indigo-900 */
    --sidebar-text: #e0e7ff;
    /* indigo-100 */
    --sidebar-heading: #a5b4fc;
    /* indigo-300 */
    --header-bg: #e0e7ff;
    /* indigo-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #eef2ff;
    /* indigo-50 */
    --button-active-bg: #6366f1;
    /* indigo-600 */
    --button-active-text: #ffffff;
    --input-bg: #eef2ff;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(224, 231, 255, 0.4);
    --login-border-color: rgba(199, 210, 254, 0.6);
    --login-button-bg: #312e81;
    --login-button-text: #ffffff;
}

body.theme-gradient-ocean {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #0c4a6e;
    --text-secondary: #0369a1;
    --border-color: #bae6fd;
    --card-bg: #ffffff;
    --sidebar-bg: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0284c7 100%);
    --sidebar-text: #e0f2fe;
    --sidebar-heading: #7dd3fc;
    --header-bg: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0284c7 100%);
    --button-bg: #ffffff;
    --button-hover-bg: #f0f9ff;
    --button-active-bg: #0369a1;
    --button-active-text: #ffffff;
    --input-bg: #ffffff;
    --login-card-bg: rgba(255, 255, 255, 0.95);
    --login-input-bg: rgba(240, 249, 255, 0.8);
    --login-border-color: rgba(3, 105, 161, 0.3);
    --login-button-bg: #0369a1;
    --login-button-text: #ffffff;
}

/* Temas de Accesibilidad */
body.theme-high-contrast {
    --background: #000000;
    --text-primary: #ffffff;
    --text-secondary: #ffff00;
    --border-color: #ffffff;
    --card-bg: #000000;
    --sidebar-bg: #000000;
    --sidebar-text: #ffffff;
    --sidebar-heading: #ffff00;
    --header-bg: #000000;
    --button-bg: #ffffff;
    --button-hover-bg: #ffff00;
    --button-active-bg: #ffffff;
    --button-active-text: #000000;
    --input-bg: #ffffff;
    --login-card-bg: #000000;
    --login-input-bg: #ffffff;
    --login-border-color: #ffffff;
    --login-button-bg: #ffffff;
    --login-button-text: #000000;
}

body.theme-colorblind-friendly {
    --background: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #495057;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --sidebar-bg: #343a40;
    --sidebar-text: #f8f9fa;
    --sidebar-heading: #e9ecef;
    --header-bg: #f8f9fa;
    --button-bg: #ffffff;
    --button-hover-bg: #e9ecef;
    --button-active-bg: #495057;
    --button-active-text: #f8f9fa;
    --input-bg: #ffffff;
    --login-card-bg: rgba(255, 255, 255, 0.95);
    --login-input-bg: rgba(248, 249, 250, 0.8);
    --login-border-color: rgba(33, 37, 41, 0.3);
    --login-button-bg: #495057;
    --login-button-text: #f8f9fa;
}

/* ===== PERSONALIZACIONES DINÃMICAS ===== */

/* Fuentes del Sistema */
body.font-system {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body.font-sans {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body.font-serif {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

body.font-mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* TamaÃ±os de Fuente */
.font-size-small {
    font-size: 0.875rem;
    /* 14px */
}

.font-size-small .card {
    padding: 1rem;
}

.font-size-small .section-header {
    font-size: 1.125rem;
}

.font-size-small .tab-btn,
.font-size-small .nav-btn {
    font-size: 0.875rem;
    padding: 0.5rem;
}

.font-size-normal {
    font-size: 1rem;
    /* 16px */
}

.font-size-large {
    font-size: 1.125rem;
    /* 18px */
}

.font-size-large .card {
    padding: 2rem;
}

.font-size-large .section-header {
    font-size: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.font-size-large .tab-btn,
.font-size-large .nav-btn {
    font-size: 1.125rem;
    padding: 0.75rem 1.5rem;
}

.font-size-xlarge {
    font-size: 1.25rem;
    /* 20px */
}

.font-size-xlarge .card {
    padding: 2.5rem;
}

.font-size-xlarge .section-header {
    font-size: 1.75rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.font-size-xlarge .tab-btn,
.font-size-xlarge .nav-btn {
    font-size: 1.25rem;
    padding: 1rem 1.5rem;
}

/* Radio de Bordes */
.border-radius-none {
    --border-radius: 0;
}

.border-radius-none .card,
.border-radius-none .input-modern,
.border-radius-none .form-input,
.border-radius-none .nav-btn,
.border-radius-none .tab-btn,
.border-radius-none .login-card,
.border-radius-none .category-filter-btn,
.border-radius-none .keypad-btn {
    border-radius: 0 !important;
}

.border-radius-small {
    --border-radius: 0.25rem;
    /* 4px */
}

.border-radius-normal {
    --border-radius: 0.75rem;
    /* 12px */
}

.border-radius-large {
    --border-radius: 1rem;
    /* 16px */
}

.border-radius-large .card {
    border-radius: 1.5rem;
}

.border-radius-large .input-modern,
.border-radius-large .form-input {
    border-radius: 1rem;
}

.border-radius-xlarge {
    --border-radius: 1.5rem;
    /* 24px */
}

.border-radius-xlarge .card {
    border-radius: 2rem;
}

.border-radius-xlarge .input-modern,
.border-radius-xlarge .form-input {
    border-radius: 1.5rem;
}

.border-radius-xlarge .nav-btn,
.border-radius-xlarge .tab-btn {
    border-radius: 1.5rem;
}

/* Aplicar radio de bordes a todos los elementos */
.card,
.input-modern,
.form-input,
.nav-btn,
.tab-btn,
.login-card,
.category-filter-btn,
.keypad-btn {
    border-radius: var(--border-radius, 0.75rem);
}

/* Densidad de Espaciado */
.density-compact {
    --spacing-scale: 0.75;
}

.density-compact .card {
    padding: 1rem;
}

.density-compact .section-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.density-compact .grid {
    gap: 0.75rem;
}

.density-normal {
    --spacing-scale: 1;
}

.density-comfortable {
    --spacing-scale: 1.25;
}

.density-comfortable .card {
    padding: 2.5rem;
}

.density-comfortable .section-header {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.density-spacious {
    --spacing-scale: 1.5;
}

.density-spacious .card {
    padding: 3rem;
}

.density-spacious .section-header {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.density-spacious .grid {
    gap: 2rem;
}

/* Intensidad de Sombras */
.shadow-none {
    --shadow-light: none;
    --shadow-medium: none;
    --shadow-heavy: none;
}

.shadow-none .card,
.shadow-none .nav-btn,
.shadow-none .tab-btn {
    box-shadow: none !important;
}

.shadow-subtle {
    --shadow-light: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 4px 8px 0 rgba(0, 0, 0, 0.12);
}

.shadow-normal {
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-heavy: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-strong {
    --shadow-light: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
    --shadow-medium: 0 5px 10px -1px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.shadow-extreme {
    --shadow-light: 0 4px 8px 0 rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 8px 16px -2px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Aplicar sombras dinÃ¡micas */
.card,
.nav-btn,
.tab-btn {
    box-shadow: var(--shadow-medium, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
}

.card:hover {
    box-shadow: var(--shadow-heavy, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .density-spacious .card {
        padding: 1.5rem;
    }

    .density-spacious .section-header {
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .font-size-large .card,
    .font-size-xlarge .card {
        padding: 1.5rem;
    }

    .font-size-large .section-header,
    .font-size-xlarge .section-header {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {

    .density-spacious .card,
    .density-comfortable .card {
        padding: 1rem;
    }

    .font-size-large .section-header,
    .font-size-xlarge .section-header,
    .font-size-large .card,
    .font-size-xlarge .card {
        padding: 1rem;
    }
}

/* Base styles using variables */
.bg-background {
    /* background-color: var(--background); */
}


.text-text-primary {
    color: var(--text-primary);
}

.text-text-secondary {
    color: var(--text-secondary);
}

.border-separator {
    border-color: var(--border-color);
}

.bg-card {
    background-color: var(--card-bg);
}

.bg-sidebar {
    background-color: var(--sidebar-bg);
}

.text-sidebar-text {
    color: var(--sidebar-text);
}

.text-sidebar-heading {
    color: var(--sidebar-heading);
}

.bg-header-bg {
    background-color: var(--header-bg);
}

.bg-input {
    background-color: var(--input-bg);
}

/* Sidebar Menu Styles */
.sidebar-category-title {
    @apply px-2 text-sm font-semibold text-gray-400 mb-2;
    transition: opacity 0.3s ease;
}

.sidebar-menu-item {
    @apply flex items-center gap-3 p-2 rounded-lg font-medium text-left w-full relative overflow-hidden;
    color: var(--sidebar-text);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

body.theme-minimalist .sidebar-menu-item:hover {
    background-color: #f3f4f6;
    /* gray-100 */
    color: var(--text-primary);
}

.sidebar-menu-item.active {

    color: var(--button-active-text);
    transform: translateX(0);
}

/* Sidebar Collapsed State */
#sidebar {
    overflow-x: hidden;
    /* evita scroll horizontal al animar el ancho */
}

#sidebar.collapsed {
    width: 4.5rem;
    /* 72px */
}

#sidebar.collapsed .sidebar-title,
#sidebar.collapsed .sidebar-item-text,
#sidebar.collapsed .sidebar-category-title {
    display: none;
    opacity: 0;
}

/* Oculta textos reales del menÃº cuando estÃ¡ contraÃ­do */
#sidebar.collapsed nav h4,
#sidebar.collapsed .nav-btn span,
#sidebar.collapsed .p-4 span.font-bold {
    display: none;
}

#sidebar.collapsed .sidebar-logo {
    margin-left: auto;
    margin-right: auto;
}

#sidebar.collapsed .sidebar-menu-item {
    justify-content: center;
    padding: 0.75rem;
    /* Adjust padding for collapsed state */
}

#sidebar.collapsed .nav-btn {
    justify-content: center;
}

#sidebar.collapsed #sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* Tooltip for collapsed sidebar items */
#sidebar.collapsed .sidebar-menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

#sidebar.collapsed .sidebar-menu-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Horizontal Menu Styles */
.horizontal-menu-container {
    @apply flex gap-2 overflow-x-auto pb-2;
    /* Added flex and gap for items, pb-2 for scrollbar */
    -webkit-overflow-scrolling: touch;
    /* For smooth scrolling on iOS */
    scrollbar-width: none;
    /* Firefox */
}

.horizontal-menu-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.horizontal-category {
    @apply flex items-center gap-2 pr-4;
    flex-shrink: 0;
}

.horizontal-category-title {
    @apply px-2 text-sm font-semibold text-gray-500 whitespace-nowrap;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
    margin-right: 0.5rem;
}

.horizontal-menu-item {
    @apply flex items-center gap-2 px-3 py-2 rounded-lg font-medium whitespace-nowrap;
    background-color: var(--button-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.horizontal-menu-item:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.horizontal-menu-item.active {

    color: var(--button-active-text);

    transform: translateY(0);
    box-shadow: none;
}

/* Page transition animations */
.page-content {
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateX(-10px);
    display: none; /* Default state */
}

/* Override for visibility swap */
.page-content:not(.hidden) {
    display: block;
}

.page-content.entering {
    opacity: 0;
    animation: pageFadeIn 0.2s ease-out forwards;
}

.page-content.active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease-out; /* Smooth fade in */
}

/* Skeleton Loading System */
.skeleton-shimmer {
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer-anim 1.5s infinite;
}

body.theme-dark .skeleton-shimmer {
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
}

.skeleton-box {
    background-color: #f3f4f6;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
}

body.theme-dark .skeleton-box {
    background-color: #374151;
}

.skeleton-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer-anim 1.5s infinite;
}

body.theme-dark .skeleton-box::after {
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
}

@keyframes skeleton-shimmer-anim {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Fix for "None" animation type - Instant appearance */
.no-animations .page-content.active,
body:not(.has-animations) .page-content.active {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Fade animations */
@keyframes pageFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes pageFadeOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(20px) scale(0.98);
    }
}

/* Slide animations */
@keyframes pageSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pageSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Scale animations */
@keyframes pageScaleIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pageScaleOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.85);
    }
}

/* Loading animation for app initialization */
.app-loading {
    opacity: 0;
    transform: translateY(20px);
    animation: appEntrance 0.6s ease 0.1s forwards;
}

@keyframes appEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading spinner for page transitions */
.page-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--button-active-bg);
    border-radius: 50%;
    animation: page-loading-spin 1s linear infinite;
}

@keyframes page-loading-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Navigation button hover enhancement */
.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.4s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

/* Disable animations when no-animations class is present */
.no-animations .app-loading,
.no-animations .page-content.entering,
.no-animations .page-content.leaving,
.no-animations .sidebar-collapsed,
.no-animations .nav-btn,
.no-animations .submenu,
.no-animations [style*="transition"] {
    animation: none !important;
    transition: none !important;
}

/* General hide class */
.hidden {
    display: none;
}

/* Scrollbar styling for sidebar nav */
#sidebar-nav-container {
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

#sidebar-nav-container::-webkit-scrollbar {
    width: 6px;
}

#sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-nav-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

#sidebar-nav-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Sidebar collapsed state */
/* Moved to new .sidebar-collapsed styles */

#main-content-wrapper.sidebar-collapsed {
    margin-left: 4.5rem;
}

/* Tab styles for Inventory and Users pages */
.tab-btn {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease-in-out;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--button-active-text);
    border-bottom: 2px solid var(--button-active-bg);
}


/* Login Screen Styles */
#video-background {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    background-size: cover;
}

#video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    /* 16:9 Aspect Ratio */
    min-height: 100vh;
    min-width: 177.77vh;
    /* 16:9 Aspect Ratio */
    transform: translateX(-50%) translateY(-50%);
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.login-card {
    background-color: var(--login-card-bg);
    border-color: var(--login-border-color);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.input-group {
    position: relative;
}

.form-input {
    width: 100%;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--login-border-color);
    background-color: var(--login-input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;

    box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-active-bg) 30%, transparent);
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.2s ease;
}

.form-input:focus+.form-label,
.form-input:not(:placeholder-shown)+.form-label {
    top: -0.65rem;
    left: 0.75rem;
    font-size: 0.75rem;
    padding: 0 0.25rem;
    background-color: var(--card-bg);

}

/* Specific fix for Webkit autofill which has a different background color */
.form-input:-webkit-autofill+.form-label {
    top: -0.65rem;
    left: 0.75rem;
    font-size: 0.75rem;
    padding: 0 0.25rem;
    background-color: var(--card-bg);
    /* Use solid color to cover line */

}


.login-button {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    background-color: var(--login-button-bg);
    color: var(--login-button-text);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Keypad styles */
.keypad-container {
    margin-top: auto;
    /* Push to the bottom */
}

.keypad-btn,
.keypad-btn-special,
.keypad-btn-mode,
.keypad-btn-delete {
    @apply w-full h-12 flex items-center justify-center rounded-2xl text-lg font-semibold transition-all duration-150 shadow;
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.keypad-btn:hover,
.keypad-btn-special:hover,
.keypad-btn-mode:hover,
.keypad-btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    background-color: var(--button-hover-bg);
}

.keypad-btn:active,
.keypad-btn-special:active,
.keypad-btn-mode:active,
.keypad-btn-delete:active {
    transform: scale(0.98) translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.keypad-btn-mode.active {

    color: var(--button-active-text) !important;

}

.keypad-btn-delete {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

#page-pos .keypad-btn-delete:hover {
    background-color: #fecaca;
}

.keypad-btn-special {
    font-size: 0.875rem;
    /* text-sm */
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#current-client-name {
    max-width: 100px;
}

.order-item-row[data-selected="true"] {

    color: var(--button-active-text);
}

.category-container::-webkit-scrollbar {
    height: 6px;
}

.category-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.category-filter-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border-width: 2px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    border-color: transparent;
    background-color: var(--button-hover-bg);
    color: var(--text-secondary);
}

.category-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.category-filter-btn.active {

    color: var(--button-active-text) !important;
    border-color: var(--button-active-bg) !important;
    box-shadow: none;
    transform: none;
}

.category-filter-btn.active img,
.category-filter-btn.active .icon-placeholder {
    border: 2px solid var(--card-bg);
}

.category-filter-btn img,
.category-filter-btn .icon-placeholder {
    width: 1.75rem;
    /* w-7 */
    height: 1.75rem;
    /* h-7 */
    border-radius: 0.5rem;
    /* rounded-lg */
    object-fit: cover;
    background-color: #d1d5db;
    /* bg-gray-300 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    /* text-sm */
    flex-shrink: 0;
}


.time-separator-row td {
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.color-swatch {
    transition: transform 0.1s ease-in-out;
}

.color-swatch.selected {

    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--button-active-bg);
}

/* ===== Design System Utilities (global) ===== */
/* Theme-specific muted panel backgrounds for totals emphasis */
:root,
body.theme-light {
    --muted-panel-bg: #f9fafb;
}

body.theme-dark {
    --muted-panel-bg: #2b3440;
}

body.theme-blue {
    --muted-panel-bg: #eff6ff;
}

body.theme-minimalist {
    --muted-panel-bg: #f9fafb;
}

body.theme-classic {
    --muted-panel-bg: #fafaf9;
}

/* Card wrapper for sections */
.card {
    background-color: var(--card-bg);
    border-radius: 1.5rem;
    /* rounded-3xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
    /* shadow-xl */
    padding: clamp(1rem, 2vw, 2rem);
    /* p-6 ~ sm:p-8 */
}

/* Section header with divider */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* gap-3 */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    /* pb-4 */
    margin-bottom: 1rem;
    /* mb-4 */
}

/* Emphasis panel for totals */
.totals-panel {
    background-color: var(--muted-panel-bg);
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 1.5rem;
    /* p-6 */
}

/* Modern input styling (shared) */
.input-modern {
    width: 100%;
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 0.5rem 0.75rem;
    /* px-3 py-2 */
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input-modern:focus {
    outline: none;

    box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-active-bg) 30%, transparent);
}

/* Modern table helpers */
.table-modern th,
.table-custom th {
    background-color: #f9fafb;
    /* gray-50 */
    color: var(--text-secondary);
    font-weight: 600;
}

body.theme-dark .table-modern th,
body.theme-dark .table-custom th {
    background-color: #374151;
    /* gray-700 */
}

.table-modern td,
.table-modern th,
.table-custom td,
.table-custom th {
    padding: 1rem;
    /* p-4 */
}

.table-modern tbody tr,
.table-custom tbody tr {
    border-top: 1px solid var(--border-color);
}

/* Badge helper */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    /* px-2 py-0.5 */
    border-radius: 9999px;
    /* rounded-full */
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 600;
    /* font-medium */
    border: 1px solid var(--border-color);
}

/* ===== POS (Punto de Venta) overrides to match provided HTML design ===== */
#page-pos .pos-tab-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

#page-pos .pos-tab-btn:hover {
    color: #111827;

}

#page-pos .pos-tab-btn.active {
    color: #3b82f6;

}

#page-pos .keypad-btn,
#page-pos .keypad-btn-special,
#page-pos .keypad-btn-mode,
#page-pos .keypad-btn-delete {
    background-color: #f3f4f6;
    color: #1f2937;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

#page-pos .keypad-btn:hover,
#page-pos .keypad-btn-special:hover,
#page-pos .keypad-btn-mode:hover,
#page-pos .keypad-btn-delete:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

#page-pos .keypad-btn-special {
    background-color: #eef2ff;
    color: #3730a3;
    border-radius: 0.75rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border: 1px solid #e0e7ff;
}

#page-pos .keypad-btn-special:hover {
    background-color: #e0e7ff;
}

#page-pos .keypad-btn-mode.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

#page-pos .keypad-btn-delete {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

#page-pos .keypad-btn-delete:hover {
    background-color: #fecaca;
}

#page-pos .order-item-row[data-selected="true"] {
    background-color: #dbeafe;
    color: inherit;
}

#page-pos .order-item-row[data-selected="true"] td {
    color: #1e40af;
    font-weight: 600;
}


#page-pos .product-card[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

#page-pos .product-card[disabled]:hover {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-color: #e5e7eb;
}

#page-pos .category-filter-btn {
    border-width: 1px;
}

#page-pos .category-filter-btn .icon-placeholder {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
}

#page-pos .category-filter-btn img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* ===== FOOTER MODERNO ===== */
.footer-modern {
    background: linear-gradient(135deg, #111827 0%, #1e293b 50%, #0f172a 100%);
    color: #f1f5f9;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: auto;
    align-self: stretch;
    flex-shrink: 0;
}

.footer-container-modern {
    width: 100%;
    max-width: none;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* SecciÃ³n Superior con Gradiente */
.footer-top {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.03) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 4rem;
    padding: 2rem 1rem 2rem 17rem;
    align-items: start;
}

.footer-brand-modern {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-logo-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    object-fit: cover;
}

.footer-logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #93c5fd, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    letter-spacing: -0.02em;
}

.footer-description-modern {
    color: #cbd5e1;
    line-height: 1.7;
    font-size: 1.1rem;
    max-width: 500px;
}

.footer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;

    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Enlaces del Footer */
.footer-links-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-section-modern {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--button-active-bg);
    border-radius: 2px;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
    display: inline-block;
}

.footer-links-list a:hover {

    transform: translateX(8px);
}

.footer-links-list a::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--button-active-bg);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-links-list a:hover::before {
    opacity: 1;
    left: -5px;
}

/* InformaciÃ³n de Contacto */
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contact-item:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.contact-item i {
    font-size: 1.5rem;

    width: 24px;
    text-align: center;
}

.contact-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.contact-value {
    font-size: 0.95rem;
    color: #f1f5f9;
    font-weight: 500;
}

/* Redes Sociales */
.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link-modern {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-link-modern:hover {
    color: #ffffff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(96, 165, 250, 0.4);
    border-color: #60a5fa;
}

.social-link-modern:hover::before {
    opacity: 1;
}

.social-link-modern i {
    position: relative;
    z-index: 1;
}

/* Newsletter */
.footer-newsletter {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.05) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3rem 2rem;
    margin: 0 -2rem;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.newsletter-subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.newsletter-input-group {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.newsletter-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 1rem 1.5rem;
    color: #f1f5f9;
    font-size: 1rem;
    border-radius: 50px;
}

.newsletter-input::placeholder {
    color: #94a3b8;
}

/* Estilos para mesas ocupadas (POS) - Estilo vibrante Rose */
.table-occupied {
    background: linear-gradient(to bottom right, #f43f5e, #db2777) !important;
    /* Gradient Rose-Pink */
    border: 6px solid #ffffff !important;
    /* Borde grueso blanco */
    border-radius: 2.25rem !important;
    /* Muy redondeado como en la imagen */
    color: #ffffff !important;
    box-shadow: 0 25px 40px -15px rgba(225, 29, 72, 0.7) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.table-occupied:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 35px 50px -12px rgba(225, 29, 72, 0.8) !important;
}

.table-occupied .status-ping {
    background: #ffffff !important;
}

.newsletter-btn {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.newsletter-btn i {
    font-size: 1.1rem;
}

/* ========================================================
   FOOTER PREMIUM PROFESSIONAL - LEONIX V2
   ======================================================== */
.premium-footer {
    position: relative;
    width: 100%;
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .premium-footer {
    background: #0f172a;
    border-top: 1px solid #1e293b;
}

/* Borde Shimmer Superior */
.footer-top-bar {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.4) 20%, 
        rgba(139, 92, 246, 0.6) 40%, 
        rgba(6, 182, 212, 0.4) 60%, 
        rgba(16, 185, 129, 0.4) 80%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: footerShimmer 8s linear infinite;
    opacity: 0.8;
}

@keyframes footerShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.footer-glass-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
}

/* LEFT: Brand & Identity */
.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.2));
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
}

.footer-brand-name {
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #1e293b;
}

.dark .footer-brand-name { color: #f1f5f9; }

.footer-brand-sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* CENTER: Status & Subscription */
.footer-center {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-health-pills {
    display: flex;
    gap: 0.5rem;
}

.health-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    transition: all 0.2s ease;
}

.dark .health-pill {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* Subscription Status Colors */
.health-pill.status-active {
    background: rgba(34, 197, 94, 0.1) !important;
    color: #16a34a !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
}
.dark .health-pill.status-active {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

.health-pill.status-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    animation: subPulse 2s infinite ease-in-out;
}
.dark .health-pill.status-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

.health-pill.status-critical {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    animation: subPulseCritical 1s infinite cubic-bezier(0.4, 0, 0.6, 1);
    font-weight: 800 !important;
}
.dark .health-pill.status-critical {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

@keyframes subPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

@keyframes subPulseCritical {
    0%, 100% { background-color: rgba(239, 68, 68, 0.1); transform: scale(1); }
    50% { background-color: rgba(239, 68, 68, 0.25); transform: scale(1.05); }
}

.health-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.health-dot.health-ok { 
    background: #10b981; 
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: healthPulse 4s infinite;
}

@keyframes healthPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* RIGHT: Metadata & Clock */
.footer-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.footer-meta-chip, .footer-session-chip, .footer-clock {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.3);
}

.dark .footer-meta-chip, .dark .footer-session-chip, .dark .footer-clock {
    color: #94a3b8;
    background: rgba(0,0,0,0.1);
}

.footer-clock {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    min-width: 80px;
    justify-content: center;
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.footer-action-group {
    display: flex;
    gap: 0.4rem;
    margin-left: 0.5rem;
}

.footer-icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-icon-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* Copyright line */
.footer-copyright-line {
    padding: 0.4rem 2rem;
    background: rgba(0,0,0,0.02);
    border-top: 1px solid rgba(0,0,0,0.03);
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.dark .footer-copyright-line {
    background: rgba(0,0,0,0.2);
    border-top-color: rgba(255,255,255,0.02);
}

/* Sidebar Adapters */
#footer-modern-adapter.sidebar-collapsed { padding-left: 0; }
#footer-modern-adapter.sidebar-expanded { padding-left: 0; }

/* Responsive */
@media (max-width: 1024px) {
    .footer-glass-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        justify-items: center;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .footer-left, .footer-center, .footer-right {
        justify-content: center;
    }
}


/* ========================================================
   KEYBOARD SHORTCUTS MODAL - PREMIUM DESIGN
   ======================================================== */
.shortcuts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: all 0.3s ease;
}

.shortcuts-modal-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transform: translateY(0);
    animation: modalAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark .shortcuts-modal-card {
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.shortcuts-modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .shortcuts-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.shortcuts-modal-header h3 {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin: 0 !important;
}

.dark .shortcuts-modal-header h3 { color: #f1f5f9 !important; }

.shortcuts-modal-header h3 i {
    color: #3b82f6 !important;
    font-size: 1.1rem !important;
}

.shortcuts-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shortcuts-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

.shortcuts-modal-body {
    padding: 1.5rem 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.shortcut-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shortcut-group-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    padding-left: 0.5rem;
    border-left: 3px solid #3b82f6;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.dark .shortcut-row { background: rgba(255, 255, 255, 0.02); }

.shortcut-row:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
}

.shortcut-row span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.dark .shortcut-row span { color: #cbd5e1; }

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 1.8rem;
    padding: 0 0.5rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-bottom: 3px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark kbd {
    color: #f1f5f9;
    background: #334155;
    border-color: #475569;
    border-bottom-color: #1e293b;
}

.shortcut-sep {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}


body.theme-dark {
    --background: #1f2937;
    /* gray-800 */
    --text-primary: #f3f4f6;
    /* gray-100 */
    --text-secondary: #9ca3af;
    /* gray-400 */
    --border-color: #4b5563;
    /* gray-600 */
    --card-bg: #374151;
    /* gray-700 */
    --sidebar-bg: #111827;
    /* gray-900 */
    --sidebar-text: #d1d5db;
    /* gray-300 */
    --sidebar-heading: #9ca3af;
    /* gray-400 */
    --header-bg: #374151;
    /* gray-700 */
    --button-bg: #4b5563;
    /* gray-600 */
    --button-hover-bg: #52525b;
    /* zinc-600 */
    --button-active-bg: #4f46e5;
    /* indigo-600 */
    --button-active-text: #ffffff;
    --input-bg: #4b5563;
    --login-card-bg: rgba(31, 41, 55, 0.75);
    --login-input-bg: rgba(75, 85, 99, 0.4);
    --login-border-color: rgba(107, 114, 128, 0.6);
    --login-button-bg: #4f46e5;
    --login-button-text: #ffffff;
}

body.theme-blue {
    --background: #eff6ff;
    /* blue-50 */
    --text-primary: #1e3a8a;
    /* blue-900 */
    --text-secondary: #3b82f6;
    /* blue-500 */
    --border-color: #bfdbfe;
    /* blue-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #1e40af;
    /* blue-800 */
    --sidebar-text: #dbeafe;
    /* blue-100 */
    --sidebar-heading: #93c5fd;
    /* blue-300 */
    --header-bg: #dbeafe;
    /* blue-100 */
    --button-bg: #ffffff;
    --button-hover-bg: #eff6ff;
    /* blue-50 */
    --button-active-bg: #2563eb;
    /* blue-600 */
    --button-active-text: #ffffff;
    --input-bg: #eff6ff;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(219, 234, 254, 0.4);
    --login-border-color: rgba(191, 219, 254, 0.6);
    --login-button-bg: #1e40af;
    --login-button-text: #ffffff;
}

body.theme-minimalist {
    --background: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #f3f4f6;
    /* gray-100 */
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    /* gray-50 */
    --sidebar-text: #374151;
    /* gray-700 */
    --sidebar-heading: #9ca3af;
    --header-bg: #ffffff;
    --button-bg: #ffffff;
    --button-hover-bg: #f9fafb;
    --button-active-bg: #1f2937;
    --button-active-text: #ffffff;
    --input-bg: #f9fafb;
    --login-card-bg: rgba(255, 255, 255, 0.75);
    --login-input-bg: rgba(243, 244, 246, 0.4);
    --login-border-color: rgba(229, 231, 235, 0.6);
    --login-button-bg: #1f2937;
    --login-button-text: #ffffff;
}

body.theme-classic {
    --background: #fefce8;
    /* yellow-50 */
    --text-primary: #44403c;
    /* stone-700 */
    --text-secondary: #78716c;
    /* stone-500 */
    --border-color: #e7e5e4;
    /* stone-200 */
    --card-bg: #ffffff;
    --sidebar-bg: #292524;
    /* stone-800 */
    --sidebar-text: #e7e5e4;
    /* stone-200 */
    --sidebar-heading: #a8a29e;
    /* stone-400 */
    --header-bg: #fafaf9;
    /* stone-50 */
    --button-bg: #ffffff;
    --button-hover-bg: #f5f5f4;
    --button-active-bg: #57534e;
    /* stone-600 */
    --button-active-text: #ffffff;
    --input-bg: #fefce8;
    --login-card-bg: rgba(255, 255, 250, 0.75);
    --login-input-bg: rgba(245, 245, 244, 0.4);
    --login-border-color: rgba(231, 229, 228, 0.6);
    --login-button-bg: #57534e;
    --login-button-text: #ffffff;
}

/* Base styles using variables */
.bg-background {
    /* background-color: var(--background); */
}


.text-text-primary {
    color: var(--text-primary);
}

.text-text-secondary {
    color: var(--text-secondary);
}

.border-separator {
    border-color: var(--border-color);
}

.bg-card {
    background-color: var(--card-bg);
}

.bg-sidebar {
    background-color: var(--sidebar-bg);
}

.text-sidebar-text {
    color: var(--sidebar-text);
}

.text-sidebar-heading {
    color: var(--sidebar-heading);
}

.bg-header-bg {
    background-color: var(--header-bg);
}

.bg-input {
    background-color: var(--input-bg);
}


/* Navigation Button styles */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.2s, color 0.2s;
    background-color: transparent;
    border: none;
    color: var(--sidebar-text);
}

#header-horizontal .nav-btn {
    background-color: var(--button-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

#header-horizontal .nav-btn:hover {
    background-color: var(--button-hover-bg);
}

/* Horizontal header spacing fix when sidebar hidden */
/* main is not an adjacent sibling by id in DOM, spacing handled by JS ml-0 */


.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.theme-minimalist .nav-btn:hover {
    background-color: #f3f4f6;
    /* gray-100 */
    color: var(--text-primary);
}

.nav-btn.active {

    color: var(--button-active-text);
}

/* Redesigned navigation button (keeps compatibility with .nav-btn) */
.nav-btn-redesigned {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    /* space between icon and text */
    padding: 0.625rem 0.875rem;
    /* a bit more padded */
    border-radius: 0.75rem;
    /* rounded-xl */
    font-weight: 600;
    line-height: 1.25rem;
    /* text-sm-ish */
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--sidebar-text, #d1d5db);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

/* Sidebar look */
#sidebar .nav-btn-redesigned:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

body.theme-minimalist #sidebar .nav-btn-redesigned:hover {
    background-color: #f3f4f6;
    color: var(--text-primary);
}

/* Horizontal header look */
#header-horizontal .nav-btn.nav-btn-redesigned {
    background-color: var(--button-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

#header-horizontal .nav-btn.nav-btn-redesigned:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Active states */
#sidebar .nav-btn-redesigned.active {

    color: var(--button-active-text);
}

#header-horizontal .nav-btn.nav-btn-redesigned.active {

    color: var(--button-active-text);

    transform: translateY(0);
    box-shadow: none;
}

.nav-btn-redesigned i {
    width: 1rem;
    text-align: center;
}

/* Horizontal header grouped chips */
.group-chip {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.group-chip-title {
    display: inline-block;
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 0 0.5rem 0.5rem 0.25rem;
}

#header-horizontal .group-chip .nav-btn-redesigned {
    margin: 0.25rem;
    padding: 0.5rem 0.75rem;
}

#header-horizontal .group-chip .nav-btn-redesigned i {
    width: 0.95rem;
}

/* Horizontal Navbar (header-horizontal) */
#header-horizontal .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 0 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: 70px;
}

#header-horizontal .nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

#header-horizontal .nav-menu {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    height: 100%;
}

#header-horizontal .nav-menu>li {
    display: flex;
    align-items: center;
    position: relative;
}

#header-horizontal .nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    position: relative;
    transition: color .2s ease, background-color .2s ease;
    display: flex;
    align-items: center;
    gap: .25rem;
}



#header-horizontal .dropdown {
    position: relative;
}

#header-horizontal .dropdown-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: .5rem 0;
    margin: 0;
    min-width: 220px;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    border: 1px solid var(--border-color);
}

#header-horizontal .dropdown:hover>.dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#header-horizontal .dropdown-menu li {
    width: 100%;
}

#header-horizontal .dropdown-menu a {
    padding: .75rem 1.25rem;
    width: calc(100% - 2.5rem);
    border-radius: 6px;
    margin: .25rem .5rem;
    display: block;
}

#header-horizontal .user-profile {
    display: flex;
    align-items: center;
    gap: .75rem;
}

#header-horizontal .user-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--text-secondary) 15%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#header-horizontal .notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease;
}

#header-horizontal .notification-btn:hover {
    background-color: color-mix(in srgb, var(--button-active-bg) 10%, transparent);
}

/* Remove older group-chip styles interference */
#header-horizontal .group-chip,
#header-horizontal .group-chip-content,
#header-horizontal .group-chip-title {
    all: unset;
}

/* Fix for hover on modals and pickers */
#product-picker .product-picker-item:hover,
#modal-container .selection-modal-item:hover {
    background-color: var(--button-active-bg) !important;
    color: var(--button-active-text) !important;
}

#product-picker .product-picker-item:hover *,
#modal-container .selection-modal-item:hover * {
    color: var(--button-active-text) !important;
}

/* Compact role modal styles */
#modal-container .perm-chip {
    border-radius: 9999px;
}

#modal-container .perm-section+.perm-section {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.5rem;
}

#modal-container .toolbar-btn {
    background-color: var(--button-bg);
}

#modal-container .toolbar-btn:hover {
    background-color: var(--button-hover-bg);
}

/* Limit modal body height for better layout and enable scroll */
#modal-container>.p-4:nth-child(2) {
    max-height: 80vh;
    overflow: auto;
}

/* General hide class */
.hidden {
    display: none;
}

/* Scrollbar styling for sidebar nav */
#sidebar-nav-container {
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

#sidebar-nav-container::-webkit-scrollbar {
    width: 6px;
}

#sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-nav-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

#sidebar-nav-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Sidebar collapsed state */
#sidebar.collapsed {
    width: 4.5rem;
    /* 72px */
}

#sidebar.collapsed .sidebar-text {
    display: none;
}

#sidebar.collapsed .sidebar-logo {
    margin-left: auto;
    margin-right: auto;
}

#sidebar.collapsed .nav-btn {
    justify-content: center;
}

#sidebar.collapsed .nav-btn svg {
    margin-right: 0;
}

#sidebar.collapsed #sidebar-toggle-btn svg {
    transform: rotate(180deg);
}

#main-content-wrapper.sidebar-collapsed {
    margin-left: 4.5rem;
}

/* Tab styles for Inventory and Users pages */
.tab-btn {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease-in-out;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--button-active-text);
    border-bottom: 2px solid var(--button-active-bg);
}


/* Login Screen Styles */
#video-background {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    background-size: cover;
}

#video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    /* 16:9 Aspect Ratio */
    min-height: 100vh;
    min-width: 177.77vh;
    /* 16:9 Aspect Ratio */
    transform: translateX(-50%) translateY(-50%);
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.login-card {
    background-color: var(--login-card-bg);
    border-color: var(--login-border-color);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.input-group {
    position: relative;
}

.form-input {
    width: 100%;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--login-border-color);
    background-color: var(--login-input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;

    box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-active-bg) 30%, transparent);
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.2s ease;
}

.form-input:focus+.form-label,
.form-input:not(:placeholder-shown)+.form-label {
    top: -0.65rem;
    left: 0.75rem;
    font-size: 0.75rem;
    padding: 0 0.25rem;
    background-color: var(--card-bg);

}

/* Specific fix for Webkit autofill which has a different background color */
.form-input:-webkit-autofill+.form-label {
    top: -0.65rem;
    left: 0.75rem;
    font-size: 0.75rem;
    padding: 0 0.25rem;
    background-color: var(--card-bg);
    /* Use solid color to cover line */

}


.login-button {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    background-color: var(--login-button-bg);
    color: var(--login-button-text);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Keypad styles */
.keypad-container {
    margin-top: auto;
    /* Push to the bottom */
}

.keypad-btn,
.keypad-btn-special,
.keypad-btn-mode,
.keypad-btn-delete {
    @apply w-full h-12 flex items-center justify-center rounded-2xl text-lg font-semibold transition-all duration-150 shadow;
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.keypad-btn:hover,
.keypad-btn-special:hover,
.keypad-btn-mode:hover,
.keypad-btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    background-color: var(--button-hover-bg);
}

.keypad-btn:active,
.keypad-btn-special:active,
.keypad-btn-mode:active,
.keypad-btn-delete:active {
    transform: scale(0.98) translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.keypad-btn-mode.active {

    color: var(--button-active-text) !important;

}

.keypad-btn-delete {
    background-color: #fee2e2;
    /* red-100 */
    color: #b91c1c;
    /* red-700 */
}

body.theme-dark .keypad-btn-delete {
    background-color: #7f1d1d;
    /* red-900 */
    color: #fecaca;
    /* red-200 */
}

.keypad-btn-special {
    font-size: 0.875rem;
    /* text-sm */
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#current-client-name {
    max-width: 100px;
}

.order-item-row[data-selected="true"] {

    color: var(--button-active-text);
}

.category-container::-webkit-scrollbar {
    height: 6px;
}

.category-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.category-filter-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border-width: 2px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    border-color: transparent;
    background-color: var(--button-hover-bg);
    color: var(--text-secondary);
}

.category-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.category-filter-btn.active {

    color: var(--button-active-text) !important;
    border-color: var(--button-active-bg) !important;
    box-shadow: none;
    transform: none;
}

.category-filter-btn.active img,
.category-filter-btn.active .icon-placeholder {
    border: 2px solid var(--card-bg);
}

.category-filter-btn img,
.category-filter-btn .icon-placeholder {
    width: 1.75rem;
    /* w-7 */
    height: 1.75rem;
    /* h-7 */
    border-radius: 0.5rem;
    /* rounded-lg */
    object-fit: cover;
    background-color: #d1d5db;
    /* bg-gray-300 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    /* text-sm */
    flex-shrink: 0;
}


.time-separator-row td {
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.color-swatch {
    transition: transform 0.1s ease-in-out;
}

.color-swatch.selected {

    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--button-active-bg);
}

/* ===== Design System Utilities (global) ===== */
/* Theme-specific muted panel backgrounds for totals emphasis */
:root,
body.theme-light {
    --muted-panel-bg: #f9fafb;
}

body.theme-dark {
    --muted-panel-bg: #2b3440;
}

body.theme-blue {
    --muted-panel-bg: #eff6ff;
}

body.theme-minimalist {
    --muted-panel-bg: #f9fafb;
}

body.theme-classic {
    --muted-panel-bg: #fafaf9;
}

/* Card wrapper for sections */
.card {
    background-color: var(--card-bg);
    border-radius: 1.5rem;
    /* rounded-3xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
    /* shadow-xl */
    padding: clamp(1rem, 2vw, 2rem);
    /* p-6 ~ sm:p-8 */
}

/* Section header with divider */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* gap-3 */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    /* pb-4 */
    margin-bottom: 1rem;
    /* mb-4 */
}

/* Emphasis panel for totals */
.totals-panel {
    background-color: var(--muted-panel-bg);
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 1.5rem;
    /* p-6 */
}

/* Modern input styling (shared) */
.input-modern {
    width: 100%;
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 0.5rem 0.75rem;
    /* px-3 py-2 */
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input-modern:focus {
    outline: none;

    box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-active-bg) 30%, transparent);
}

/* Modern table helpers */
.table-modern th,
.table-custom th {
    background-color: #f9fafb;
    /* gray-50 */
    color: var(--text-secondary);
    font-weight: 600;
}

body.theme-dark .table-modern th,
body.theme-dark .table-custom th {
    background-color: #374151;
    /* gray-700 */
}

.table-modern td,
.table-modern th,
.table-custom td,
.table-custom th {
    padding: 1rem;
    /* p-4 */
}

.table-modern tbody tr,
.table-custom tbody tr {
    border-top: 1px solid var(--border-color);
}

/* Badge helper */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    /* px-2 py-0.5 */
    border-radius: 9999px;
    /* rounded-full */
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 600;
    /* font-medium */
    border: 1px solid var(--border-color);
}

/* ===== POS (Punto de Venta) overrides to match provided HTML design ===== */
#page-pos .pos-tab-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

#page-pos .pos-tab-btn:hover {
    color: #111827;

}

#page-pos .pos-tab-btn.active {
    color: #3b82f6;

}

#page-pos .keypad-btn,
#page-pos .keypad-btn-mode,
#page-pos .keypad-btn-delete {
    background-color: #f3f4f6;
    color: #1f2937;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

#page-pos .keypad-btn:hover,
#page-pos .keypad-btn-mode:hover,
#page-pos .keypad-btn-delete:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

#page-pos .keypad-btn-special {
    background-color: #eef2ff;
    color: #3730a3;
    border-radius: 0.75rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border: 1px solid #e0e7ff;
}

#page-pos .keypad-btn-special:hover {
    background-color: #e0e7ff;
}

#page-pos .keypad-btn-mode.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

#page-pos .keypad-btn-delete {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

#page-pos .keypad-btn-delete:hover {
    background-color: #fecaca;
}

#page-pos .order-item-row[data-selected="true"] {
    background-color: #dbeafe;
    color: inherit;
}

#page-pos .order-item-row[data-selected="true"] td {
    color: #1e40af;
    font-weight: 600;
}


#page-pos .product-card[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

#page-pos .product-card[disabled]:hover {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-color: #e5e7eb;
}

#page-pos .category-filter-btn {
    border-width: 1px;
}

#page-pos .category-filter-btn .icon-placeholder {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
}

#page-pos .category-filter-btn img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* ========================================================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ======================================================================== */

/* ===== HAMBURGER MENU BUTTON ===== */
.hamburger-menu {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background-color: var(--button-hover-bg);
    transform: scale(1.05);
}

.hamburger-menu i {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== TABLETS Y MÓVILES (< 1024px) ===== */
@media (max-width: 1024px) {
    .hamburger-menu {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    #sidebar.mobile-open {
        left: 0;
    }

    #main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    #header {
        padding-left: 4rem;
    }

    #toggle-sidebar-btn {
        display: none;
    }
}

/* ===== TABLETS (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* ===== MÓVILES (< 768px) ===== */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .card {
        padding: 1rem !important;
    }

    .section-header {
        font-size: 1.25rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .tab-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tab-btn {
        white-space: nowrap;
        min-width: 120px;
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-group {
        width: 100% !important;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-actions button {
        width: 100%;
    }

    .responsive-table {
        border: 0;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: block;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        background-color: var(--card-bg);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        flex: 1;
    }

    .responsive-table td .action-buttons {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .chart-container {
        min-height: 250px;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header,
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    #header {
        flex-wrap: wrap;
        padding: 0.75rem 4rem 0.75rem 1rem;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .search-container {
        width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
}

/* ===== MÓVILES PEQUEÑOS (< 480px) ===== */
@media (max-width: 480px) {
    .card {
        padding: 0.75rem !important;
    }

    body {
        font-size: 0.875rem;
    }

    .section-header {
        font-size: 1.125rem;
    }

    .btn,
    .tab-btn,
    .nav-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .form-input,
    .input-modern {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    .grid {
        gap: 0.75rem;
    }

    #page-pos .pos-layout {
        flex-direction: column;
    }

    #page-pos .pos-products,
    #page-pos .pos-cart {
        width: 100%;
    }

    #page-pos .keypad {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    #page-pos .keypad-btn {
        padding: 1rem 0.5rem;
        font-size: 1rem;
    }

    #page-pos .product-card {
        padding: 0.75rem;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
}

/* ===== TOUCH TARGETS (44x44px mínimo) ===== */
@media (max-width: 768px) {

    button,
    .btn,
    .tab-btn,
    .nav-btn,
    a.clickable,
    .action-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .icon-btn {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
}

/* ===== LANDSCAPE MÓVIL ===== */
@media (max-width: 896px) and (orientation: landscape) {
    #sidebar {
        width: 240px;
        left: -240px;
    }

    .modal-content {
        max-height: 95vh;
    }
}

/* ===== PRINT ===== */
@media print {

    #sidebar,
    #header,
    .hamburger-menu,
    .sidebar-overlay,
    .tab-container,
    .form-actions,
    .action-buttons {
        display: none !important;
    }

    #main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #000;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* ===== ACCESIBILIDAD: REDUCIR MOVIMIENTO ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #sidebar {
        transition: none !important;
    }

    .sidebar-overlay {
        transition: none !important;
    }
}

/* Progress Bar Animation */
@keyframes progress-stripe {
    from { background-position: 40px 0; }
    to { background-position: 0 0; }
}

.animate-progress-stripe {
    animation: progress-stripe 2s linear infinite;
} 

/* Subscription Badge Styles - Professional Glassmorphism */
.subscription-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.subscription-badge:hover {
  transform: translateY(-2px);
  background-color: rgba(17, 24, 39, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.subscription-badge i {
  font-size: 1rem;
}

.subscription-badge.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.subscription-badge.status-active:hover {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.subscription-badge.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.subscription-badge.status-critical {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.4);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.1);
  animation: criticalPulseNeo 3s infinite;
}

@keyframes criticalPulseNeo {
  0% { 
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); 
    border-color: rgba(251, 113, 133, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.3);
    border-color: rgba(251, 113, 133, 0.8);
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6);
    border-color: rgba(251, 113, 133, 0.4);
  }
}

