/* La tipografía Inter se carga desde vendor/fonts.css, enlazado en el HTML antes
   que esta hoja. Aquí había un @import a Google Fonts que dejaba la interfaz sin
   tipografía cuando la PC del negocio se quedaba sin internet. */

/* ============================================
   1. CSS VARIABLES
   ============================================ */
:root {
    /* Refined modern palette - Indigo to Purple gradient */
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --primary-light: rgba(99, 102, 241, 0.08);
    --primary-glow: 0 8px 25px rgba(99, 102, 241, 0.35);

    --secondary-color: #06b6d4; /* Cyan */
    --secondary-light: rgba(6, 182, 212, 0.08);
    --secondary-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);

    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.08);
    --success-gradient: linear-gradient(135deg, #10b981, #34d399);

    --danger-color: #f43f5e;
    --danger-light: rgba(244, 63, 94, 0.08);
    --danger-gradient: linear-gradient(135deg, #f43f5e, #fb7185);

    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.08);
    --warning-gradient: linear-gradient(135deg, #f59e0b, #fcd34d);

    /* Light mode surfaces - Ultra clean glassmorphism */
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.75);
    --sidebar-bg: rgba(255, 255, 255, 0.7);
    --text-color: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    --glass-border: rgba(255, 255, 255, 0.6);

    --sidebar-width: 280px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dark-mode {
    --bg-color: #090d16;
    --bg-secondary: #020617;
    --card-bg: rgba(15, 23, 42, 0.65);
    --sidebar-bg: rgba(15, 23, 42, 0.6);
    --text-color: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: rgba(51, 65, 85, 0.5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --primary-light: rgba(99, 102, 241, 0.15);
    --secondary-light: rgba(6, 182, 212, 0.15);
    --success-light: rgba(16, 185, 129, 0.15);
    --danger-light: rgba(244, 63, 94, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);
}

/* ============================================
   2. RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   3. KEYFRAME ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.02); }
}

@keyframes float-reverse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-25px, 20px) scale(0.97); }
    50% { transform: translate(30px, -15px) scale(1.04); }
    75% { transform: translate(-10px, -20px) scale(1.01); }
}

@keyframes stat-enter {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes pulse-subtle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.15); }
    50% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Section transitions */
#content-area {
    animation: fadeIn 0.45s ease-out;
    flex-grow: 1;
}

/* ============================================
   4. APP LAYOUT
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   5. LOGIN
   ============================================ */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    transition: var(--transition);
    overflow: hidden;
}

/* Animated Orbs */
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    pointer-events: none;
}

.login-orb:nth-child(1) {
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.3);
    top: -10%;
    left: -10%;
    animation: float 12s ease-in-out infinite;
}

.login-orb:nth-child(2) {
    width: 450px;
    height: 450px;
    background: rgba(6, 182, 212, 0.25);
    bottom: -10%;
    right: -10%;
    animation: float-reverse 15s ease-in-out infinite;
}

.login-orb:nth-child(3) {
    width: 350px;
    height: 350px;
    background: rgba(168, 85, 247, 0.2);
    top: 40%;
    left: 45%;
    animation: float 18s ease-in-out infinite;
    animation-delay: -5s;
}

.dark-mode .login-orb:nth-child(1) { opacity: 0.35; }
.dark-mode .login-orb:nth-child(2) { opacity: 0.25; }
.dark-mode .login-orb:nth-child(3) { opacity: 0.18; }

.login-box {
    background: var(--card-bg);
    padding: 3.5rem 3rem;
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl), 0 20px 25px -5px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    width: 90%;
    max-width: 440px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.login-box:hover {
    box-shadow: var(--shadow-xl), 0 0 0 2px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.login-box h2 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 900;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: -1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.login-box h2 i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box h2 span {
    color: var(--primary-color);
    font-weight: 400;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================
   6. SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: calc(100vh - 2rem);
    margin: 1rem;
    border-radius: 24px;
    z-index: 1000;
    backdrop-filter: blur(24px) saturate(220%);
    -webkit-backdrop-filter: blur(24px) saturate(220%);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 2rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.5px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.sidebar-header h2 i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
}

.sidebar-header h2 span {
    color: var(--text-muted);
    font-weight: 300;
}

.nav-links {
    list-style: none;
    padding: 1.5rem 0.85rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.nav-links li {
    padding: 0.75rem 1.1rem;
    cursor: pointer;
    border-radius: 14px;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
}

/* Active indicator bar - stylized */
.nav-links li.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40%;
    background: var(--primary-gradient);
    border-radius: 4px;
}

.nav-links li:hover {
    background-color: var(--primary-light);
    transform: translateX(4px);
}

.nav-links li.active {
    background: var(--primary-gradient);
    box-shadow: var(--primary-glow);
}

.nav-links li.active a {
    color: white;
    font-weight: 600;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    width: 100%;
}

.nav-links li:hover a {
    color: var(--text-color);
}

.nav-links li.active:hover a {
    color: white;
}

.nav-links li i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-links li.active i {
    color: white;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

.sidebar-footer {
    padding: 1.5rem 0.85rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-footer button {
    font-family: inherit;
}

#theme-toggle,
#change-password-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
}

#theme-toggle:hover,
#change-password-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
}

/* ============================================
   7. MAIN CONTENT & TOP BAR
   ============================================ */
.main-content {
    flex-grow: 1;
    margin-left: calc(var(--sidebar-width) + 1.5rem);
    padding: 1.75rem 2.25rem 0 2.25rem;
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.top-bar h1 {
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

.user-info {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
}

#mobile-menu-btn {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    font-size: 1.15rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
}

#mobile-menu-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ============================================
   8. DASHBOARD / STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    /* Staggered entry animation */
    opacity: 0;
    animation: stat-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.05), transparent 60%);
    pointer-events: none;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 50ms; }
.stat-card:nth-child(3) { animation-delay: 100ms; }
.stat-card:nth-child(4) { animation-delay: 150ms; }
.stat-card:nth-child(5) { animation-delay: 200ms; }
.stat-card:nth-child(6) { animation-delay: 250ms; }
.stat-card:nth-child(7) { animation-delay: 300ms; }

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 12px 20px -10px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.25);
}

.stat-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: white;
    transition: var(--transition-fast);
}

/* Gradient icon variants — Premium Vibrant Palette */
.stat-icon.gradient-blue {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.stat-icon.gradient-green {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.stat-icon.gradient-amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

.stat-icon.gradient-purple {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
}

.stat-icon.gradient-red {
    background: linear-gradient(135deg, #f43f5e, #dc2626);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.3);
}

.stat-icon.gradient-pink {
    background: linear-gradient(135deg, #ec4899, #be185d);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.3);
}

.stat-icon.gradient-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.3);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(3deg);
}

.stat-info h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-info p {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

/* ============================================
   9. CARDS
   ============================================ */
.card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card#sale-cart-card.cart-active {
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.12), var(--shadow-lg) !important;
    background: linear-gradient(to bottom, var(--card-bg), rgba(99, 102, 241, 0.015)) !important;
}

.dark-mode .card#sale-cart-card.cart-active {
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2), var(--shadow-xl) !important;
    background: linear-gradient(to bottom, var(--card-bg), rgba(99, 102, 241, 0.025)) !important;
}

.card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
    color: var(--text-color);
}

/* ============================================
   10. TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

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

th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:last-child td {
    border-bottom: none;
}

/* Zebra striping */
tbody tr:nth-child(even) {
    background-color: rgba(99, 102, 241, 0.015);
}

.dark-mode tbody tr:nth-child(even) {
    background-color: rgba(99, 102, 241, 0.03);
}

/* Row hover */
tbody tr {
    transition: var(--transition-fast);
}

tbody tr:hover td {
    background-color: var(--primary-light);
}

/* ============================================
   11. BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 30px;
    white-space: nowrap;
}

/* ============================================
   12. BUTTONS
   ============================================ */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

/* Primary Button */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    box-shadow: var(--primary-glow);
    transform: translateY(-2px);
}

/* Secondary Button */
.btn-secondary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* Danger Button */
.btn-danger {
    background: var(--danger-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.35);
    transform: translateY(-2px);
}

/* Success Button */
.btn-success {
    background: var(--success-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    transform: translateY(-2px);
}

/* Warning Button */
.btn-warning {
    background: var(--warning-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

/* Disabled */
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

/* ============================================
   13. FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 11px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light), 0 0 0 1px var(--primary-color);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L.35 3.175 1.425 2.1 6 6.675 10.575 2.1l1.075 1.075z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

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

/* ============================================
   14. MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    transition: var(--transition);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 4vh auto;
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    width: 92%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Decorative gradient line at top */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 0 0 4px 4px;
}

.close-modal {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.close-modal:hover {
    color: var(--danger-color);
    background: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.2);
}

#modal-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    padding-top: 0.25rem;
}

/* ============================================
   15. PRODUCT CARDS (POS)
   ============================================ */
.product-item-card {
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.6rem;
    text-align: center;
}

.product-item-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color) !important;
}

/* ============================================
   16. SKELETONS
   ============================================ */
.skeleton-pulse {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.04) 25%,
        rgba(0, 0, 0, 0.08) 37%,
        rgba(0, 0, 0, 0.04) 63%
    );
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

.dark-mode .skeleton-pulse {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.1) 37%,
        rgba(255, 255, 255, 0.04) 63%
    );
    background-size: 400% 100%;
}

/* ============================================
   17. TOASTS
   ============================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s;
    opacity: 0;
    min-width: 290px;
    max-width: 400px;
    font-weight: 500;
    font-size: 0.88rem;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Toast progress bar */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 14px 14px;
    animation: toast-progress 4s linear forwards;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.success::after { background: var(--success-color); }
.toast.success i { color: var(--success-color); }

.toast.error { border-left: 4px solid var(--danger-color); }
.toast.error::after { background: var(--danger-color); }
.toast.error i { color: var(--danger-color); }

.toast.warning { border-left: 4px solid var(--warning-color); }
.toast.warning::after { background: var(--warning-color); }
.toast.warning i { color: var(--warning-color); }

.toast.info { border-left: 4px solid var(--primary-color); }
.toast.info::after { background: var(--primary-color); }
.toast.info i { color: var(--primary-color); }

.toast i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ============================================
   18. SIDEBAR OVERLAY (MOBILE)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   19. RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .main-content {
        padding: 1.75rem 1.5rem 0 1.5rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        left: -100%;
        top: 0;
        margin: 1rem;
        height: calc(100vh - 2rem);
        width: calc(100% - 2rem);
        max-width: 290px;
        box-shadow: none;
    }

    .sidebar.active {
        left: 0;
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1.25rem 0 1.25rem;
    }

    #mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .modal-content {
        margin: 2vh auto;
        padding: 2rem 1.5rem;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .top-bar h1 {
        font-size: 1.35rem;
    }

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

    .stat-card {
        padding: 1.1rem;
        gap: 0.9rem;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .stat-info p {
        font-size: 1.2rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    th, td {
        padding: 0.7rem 0.75rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 2rem 1.5rem;
    }

    .login-orb:nth-child(1) { width: 250px; height: 250px; }
    .login-orb:nth-child(2) { width: 200px; height: 200px; }
    .login-orb:nth-child(3) { width: 150px; height: 150px; }
}

/* ============================================
   14. FOOTER
   ============================================ */
.app-footer {
    margin-top: auto;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.02));
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body.dark-mode .app-footer {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.01));
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.25rem 0;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-col ul li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li a {
    color: var(--text-muted);
    font-size: 0.88rem;
    text-decoration: none;
    transition: var(--transition-fast);
    display: inline-block;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Brand Column styling */
.brand-col {
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo img {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.footer-logo span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.footer-logo span strong {
    color: var(--primary-color);
}

.footer-slogan {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
    margin: 0;
}

.footer-email {
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
    margin: 0;
}

.footer-email i {
    color: var(--primary-color);
    margin-right: 0.4rem;
}

.contact-info-item {
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.contact-info-item i {
    color: var(--primary-color);
    font-size: 0.95rem;
    width: 16px;
}

/* Footer Bottom */
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-bottom p {
    margin: 0;
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-slogan {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .app-footer {
        padding: 2.5rem 1rem 1rem 1rem;
    }
}

/* Utility to hide input number spinner arrows */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.no-spinner {
    -moz-appearance: textfield;
}
