:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-color: #f59e0b;
    --dark-premium: #0f172a;
    --surface-color: #ffffff;
    --background-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

* {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

html, body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--background-color); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Dashboard & Navigation */
.bg-dark-premium { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important; }
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(15, 23, 42, 0.9) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.85rem 0;
    z-index: 1060; /* Higher than glass cards */
}

.dropdown-menu {
    z-index: 1070 !important;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.glass-login {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Premium Card & Table */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: white;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h4, .card-header h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.table-premium {
    width: 100%;
    margin-bottom: 0;
}

.table-premium thead th {
    background-color: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.table-premium tbody td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-premium tbody tr {
    transition: var(--transition);
}

.table-premium tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.002);
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    background-color: #fcfdfe;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background-color: white;
}

/* Buttons Gradient */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    border: none !important;
}

.btn-premium-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: var(--transition);
}

.btn-premium-icon:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
}

/* POS UI refinement */
.left-panel, .right-panel {
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.qty-pill {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Interactivity & Feedback */
.active-nav {
    background: var(--accent-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.hover-lift {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
}

.hover-lift:hover {
    transform: translateY(-8px) !important;
    box-shadow: var(--shadow-lg) !important;
}

.modal-content {
    border: none !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.toast {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: none !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.footer {
    padding: 1.5rem 0;
    background-color: white;
    z-index: 5;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

@media print {
    .no-print {
        display: none !important;
    }
    header, footer, .navbar, .btn, .d-grid, .badge {
        display: none !important;
    }
    body, html, .container-fluid, .card {
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: auto !important;
        box-shadow: none !important;
    }
    .card {
        border: 1px solid #ddd !important;
        border-radius: 0 !important;
        margin-bottom: 20px !important;
    }
    .card-header {
        background: white !important;
        border-bottom: 2px solid #000 !important;
        color: #000 !important;
    }
    * {
        color: #000 !important; /* Force black text for clear receipts */
    }
    /* Expand columns to full width on print to avoid squishing */
    .col-md-8, .col-md-4 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}