:root {
    --primary: #ff5722;
    --primary-gradient: linear-gradient(135deg, #ff5722 0%, #f4511e 100%);
    --primary-dark: #e64a19;
    --primary-light: #fbe9e7;
    --secondary: #2196f3;
    --dark: #0f172a;
    --dark-surface: #1e293b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text: #334155;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;

    /* Soft 3D Elevation Shadows */
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12), 0 10px 15px -8px rgba(15, 23, 42, 0.04);
    --shadow-glow-primary: 0 8px 24px rgba(255, 87, 34, 0.35);

    /* Table Status Design Tokens */
    --status-free: #10b981;
    --status-free-bg: #ecfdf5;
    --status-free-glow: 0 8px 20px rgba(16, 185, 129, 0.2);

    --status-occupied: #ef4444;
    --status-occupied-bg: #fef2f2;
    --status-occupied-glow: 0 8px 20px rgba(239, 68, 68, 0.2);

    --status-billed: #f59e0b;
    --status-billed-bg: #fffbeb;
    --status-billed-glow: 0 8px 20px rgba(245, 158, 11, 0.2);

    --status-reserved: #3b82f6;
    --status-reserved-bg: #eff6ff;
    --status-reserved-glow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(255, 87, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); }
}

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

/* App Header */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    font-size: 1.8rem;
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 14px;
    box-shadow: var(--shadow-glow-primary);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.table-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-glow-primary);
}

/* Customer Container */
.customer-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    padding-bottom: 140px;
    animation: fadeIn 0.4s ease-out;
}

/* Search Box & Filter Section */
.filter-section {
    margin-bottom: 1.75rem;
}

.search-box {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: white;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    outline: none;
    transition: all 0.25s ease;
}

.search-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.15);
}

.scroll-bar {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.scroll-bar::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill-btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.pill-btn.active {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.dietary-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow-primary);
}

/* Product Cards Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeIn 0.4s ease-out;
}

.product-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.product-img-wrap {
    width: 100%;
    height: 190px;
    background: #f1f5f9;
    overflow: hidden;
    position: relative;
}

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

.product-card:hover .product-img {
    transform: scale(1.08);
}

.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.product-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--dark);
    letter-spacing: -0.01em;
}

.product-price {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}

.product-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    flex: 1;
}

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-veg { background: #dcfce7; color: #15803d; }
.badge-nonveg { background: #fee2e2; color: #b91c1c; }
.badge-vegan { background: #ccfbf1; color: #0f766e; }
.badge-gluten { background: #fef3c7; color: #b45309; }

.add-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    width: 100%;
    box-shadow: var(--shadow-glow-primary);
    transition: all 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255, 87, 34, 0.45);
}

.add-btn:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Sticky Bottom Cart Bar (Customer) */
.sticky-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    color: white;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.3s ease-out;
}

.cart-summary-text {
    font-size: 0.88rem;
    color: #94a3b8;
}

.cart-total-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
}

.view-cart-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-glow-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.25s ease;
}

.view-cart-btn:hover {
    transform: scale(1.04);
}

/* Floating Action Buttons */
.floating-actions {
    position: fixed;
    bottom: 100px;
    right: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 150;
}

.float-btn {
    background: white;
    color: var(--dark);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.float-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-lg);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.close-btn {
    background: var(--light-bg);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Order Tracker Stepper */
.status-stepper {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
}

.status-stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 4px;
    background: var(--border);
    z-index: 1;
    transform: translateY(-50%);
}

.step-item {
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 0.5rem;
    text-align: center;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow-primary);
    animation: pulseGlow 2s infinite;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.step-item.active .step-label {
    color: var(--dark);
}

/* ADMIN DASHBOARD STYLING */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.nav-item {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #94a3b8;
    transition: all 0.25s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.admin-content {
    flex: 1;
    padding: 2.25rem;
    background: var(--light-bg);
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

/* Floor Plan Interactive Cards */
.zone-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 2rem 0 1rem;
    color: var(--dark);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.table-card {
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--border);
    transition: background 0.3s;
}

.table-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.table-card.status-AVAILABLE::before { background: var(--status-free); }
.table-card.status-AVAILABLE { background: var(--status-free-bg); border-color: rgba(16, 185, 129, 0.3); }
.table-card.status-AVAILABLE:hover { box-shadow: var(--status-free-glow); }

.table-card.status-OCCUPIED::before { background: var(--status-occupied); }
.table-card.status-OCCUPIED { background: var(--status-occupied-bg); border-color: rgba(239, 68, 68, 0.3); }
.table-card.status-OCCUPIED:hover { box-shadow: var(--status-occupied-glow); }

.table-card.status-BILLED::before { background: var(--status-billed); }
.table-card.status-BILLED { background: var(--status-billed-bg); border-color: rgba(245, 158, 11, 0.3); }
.table-card.status-BILLED:hover { box-shadow: var(--status-billed-glow); }

.table-card.status-RESERVED::before { background: var(--status-reserved); }
.table-card.status-RESERVED { background: var(--status-reserved-bg); border-color: rgba(59, 130, 246, 0.3); }
.table-card.status-RESERVED:hover { box-shadow: var(--status-reserved-glow); }

.table-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark);
    margin-top: 0.25rem;
}

.table-status-pill {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    display: inline-block;
    margin-top: 0.5rem;
    letter-spacing: 0.03em;
}

.status-AVAILABLE .table-status-pill { background: #d1fae5; color: #065f46; }
.status-OCCUPIED .table-status-pill { background: #fee2e2; color: #991b1b; }
.status-BILLED .table-status-pill { background: #fef3c7; color: #92400e; }
.status-RESERVED .table-status-pill { background: #dbeafe; color: #1e40af; }

/* Kitchen KDS Cards */
.kds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.kds-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeIn 0.3s ease-out;
}

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

.kds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
}

.kds-items-list {
    list-style: none;
    margin-bottom: 1.25rem;
}

.kds-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

/* Image Base64 Upload Box */
.image-upload-box {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.25s ease;
}

.image-upload-box:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.preview-img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 0.75rem;
    box-shadow: var(--shadow-sm);
}

/* Card Panels & Elevated Containers */
.card-panel {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.metric-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

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

/* Printable Thermal Receipt */
@media print {
    body * { visibility: hidden; }
    #printable-receipt, #printable-receipt * { visibility: visible; }
    #printable-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        font-family: monospace;
    }
}
