:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #f97316;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-800: #334155;
    --gray-700: #475569;
    --gray-600: #64748b;
    --gray-500: #94a3b8;
    --gray-400: #cbd5e1;
    --gray-300: #e2e8f0;
    --gray-200: #f1f5f9;
    --gray-100: #f8fafc;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(99,102,241,0.03) 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 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 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);
    min-height: 100vh;
    color: var(--gray-900);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ================================================
   LOGIN SECTION
   ================================================ */
#login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

#login-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.5);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--gray-900);
    font-weight: 700;
    font-size: 1.75rem;
}

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

.login-card .form-label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.login-card .form-control {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    background: var(--white);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-card .btn-primary {
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* ================================================
   NAVBAR
   ================================================ */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.customer-info {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.customer-info .discount-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary) !important;
    background: var(--gray-100);
}

.nav-link.active {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.1);
}

/* ================================================
   MAIN CONTAINER
   ================================================ */
.main-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ================================================
   CATEGORY SIDEBAR
   ================================================ */
.category-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
}

.category-sidebar h6 {
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.category-sidebar .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 4px;
    color: var(--gray-700);
    transition: all 0.2s ease;
    background: transparent;
}

.category-sidebar .list-group-item:hover {
    background: var(--gray-100);
    color: var(--primary);
    transform: translateX(4px);
}

.category-sidebar .list-group-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.category-sidebar .list-group-item.active:hover {
    transform: translateX(0);
}

.category-sidebar .list-group-item.active .badge {
    background: rgba(255, 255, 255, 0.25) !important;
}

.category-sidebar .badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 50px;
}

/* ================================================
   PRODUCT CARDS
   ================================================ */
.product-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image-container {
    height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    min-height: 2.8em;
    color: var(--gray-900);
    transition: color 0.2s ease;
}

.product-card:hover .card-title {
    color: var(--primary);
}

.price-display {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.discounted-price {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.original-price {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 50px;
    font-size: 0.75rem;
}

.product-card .card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem;
}

.qty-input {
    width: 50px !important;
    text-align: center;
    font-weight: 600;
    border: none;
    background: var(--white);
}

.product-card .input-group .btn {
    border-color: var(--gray-300);
    color: var(--gray-600);
    font-weight: 600;
    transition: all 0.2s ease;
}

.product-card .input-group .btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ================================================
   CART BADGE
   ================================================ */
#cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    min-width: 20px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ================================================
   MODALS
   ================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .price-display {
    margin-top: 1rem;
}

.modal-body .discounted-price {
    font-size: 1.75rem;
}

/* ================================================
   CARDS (General)
   ================================================ */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Allow datepicker to overflow card boundaries */
.card:has(.datepicker) {
    overflow: visible;
}

.card-header {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    padding: 1rem 1.25rem;
    color: var(--gray-800);
}

/* ================================================
   TABLES
   ================================================ */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-top: none;
    padding: 1rem;
    background: var(--gray-50);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: var(--gradient-primary);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

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

.btn-outline-secondary {
    border-color: var(--gray-300);
    color: var(--gray-600);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
}

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

/* ================================================
   FORM INPUTS
   ================================================ */
.form-control, .form-select {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

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

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ================================================
   ALERTS
   ================================================ */
.alert {
    border-radius: var(--radius);
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #3730a3;
}

/* ================================================
   ORDER CONFIRMATION
   ================================================ */
.fa-circle-check {
    color: var(--success);
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ================================================
   SEARCH INPUT
   ================================================ */
.input-group .form-control {
    border-right: none;
}

.input-group .input-group-text {
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-left: none;
    color: var(--gray-500);
}

.input-group .form-control:focus + .input-group-text {
    border-color: var(--primary);
}

/* ================================================
   PAGE HEADER
   ================================================ */
h4 {
    font-weight: 700;
    color: var(--gray-900);
}

h4 small {
    font-weight: 400;
}

/* ================================================
   DROPDOWN
   ================================================ */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* ================================================
   LOADING SPINNER
   ================================================ */
.fa-spinner {
    color: var(--primary);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .product-image-container {
        height: 160px;
    }

    .customer-info {
        display: none;
    }

    .navbar-nav {
        flex-direction: row;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem;
    }

    .category-sidebar {
        position: static;
        margin-bottom: 1.5rem;
        padding: 1rem;
    }

    .category-sidebar .list-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .category-sidebar .list-group-item {
        flex: 0 0 auto;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 50px;
    }

    .category-sidebar .list-group-item.active {
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

    .category-sidebar .badge {
        display: none;
    }

    .category-sidebar h6 {
        display: none;
    }

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }

    .discounted-price {
        font-size: 1.1rem;
    }

    .product-card .card-title {
        font-size: 0.85rem;
        min-height: auto;
    }
}

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ================================================
   SELECTION
   ================================================ */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-dark);
}
