/**
 * Nile Horizon Café POS System - Main UI Stylesheet
 * Developer: Addisu Ayalew
 */

:root {
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #334155;
    --bg-sidebar: #090d16;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --purple: #8b5cf6;
    --purple-bg: rgba(139, 92, 246, 0.15);
    --border: #475569;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Sidebar Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #60a5fa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.nav-item.active {
    border-left: 4px solid var(--accent);
    color: #93c5fd;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-badge {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: #38bdf8;
    text-transform: uppercase;
    font-weight: 700;
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Top Navigation Bar */
.topbar {
    height: 64px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-heading {
    font-size: 1.25rem;
    font-weight: 700;
}

.shift-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.pulse-dot.warning {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-clock {
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
}

/* Cashier POS Grid View */
.pos-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.tables-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-chip {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip-avail { border-color: var(--success); color: #34d399; }
.chip-occ { border-color: var(--warning); color: #fbbf24; }
.chip-await { border-color: var(--purple); color: #c084fc; }

/* Floor Plan Table Filter Tabs */
.floor-plan-filter-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0 14px 0;
}

.floor-tab-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.floor-tab-btn:hover {
    background: #334155;
    color: #f8fafc;
}

.floor-tab-btn.active {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.45);
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

/* Customer Account Table Card Accent */
.table-card.customer-account-card {
    border-color: #0284c7;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.15);
}

.table-card.customer-account-card:hover {
    border-color: #38bdf8;
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.3);
}

.table-card.customer-account-card .table-named-customer {
    color: #38bdf8;
    font-weight: 800;
}

/* Individual Table Card */
.table-card {
    background-color: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 120px;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.table-number {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.2;
}

.table-named-customer {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 4px;
    letter-spacing: 0.3px;
}

.table-sub-tag {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 1px;
    font-weight: 700;
}

.table-billing-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.billing-monthly {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #10b981;
}

.billing-weekly {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid #a855f7;
}

.billing-3days {
    background: rgba(6, 182, 212, 0.2);
    color: #38bdf8;
    border: 1px solid #06b6d4;
}

.billing-customer {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid #f59e0b;
}

.table-status-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.table-waiter-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.table-timer-badge {
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-amount-badge {
    font-size: 0.85rem;
    font-weight: 800;
    margin-top: 4px;
}

/* Table States Dynamic Styling */
.table-card.available {
    border-color: var(--table-color-available, #059669) !important;
}
.table-card.available .table-number {
    color: var(--table-color-available, #34d399) !important;
}
.table-card.available .table-status-label {
    background: var(--table-color-available, #059669) !important;
    color: #ffffff !important;
}

.table-card.occupied {
    border-color: var(--table-color-occupied, #d97706) !important;
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(217, 119, 6, 0.15) 100%) !important;
}
.table-card.occupied .table-number {
    color: var(--table-color-occupied, #fbbf24) !important;
}
.table-card.occupied .table-status-label {
    background: var(--table-color-occupied, #d97706) !important;
    color: #ffffff !important;
}
.table-card.occupied .table-timer-badge {
    color: #fde68a;
}
.table-card.occupied .table-amount-badge {
    color: #ffffff;
}

.table-card.awaiting_payment {
    border-color: var(--table-color-awaiting, #f59e0b) !important;
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(245, 158, 11, 0.2) 100%) !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35) !important;
}
.table-card.awaiting_payment .table-number {
    color: var(--table-color-awaiting, #fde047) !important;
}
.table-card.awaiting_payment .table-status-label {
    background: var(--table-color-awaiting, #f59e0b) !important;
    color: #000000 !important;
    font-weight: 800 !important;
}
.table-card.awaiting_payment .table-amount-badge {
    color: #ffffff;
    font-weight: 900;
}

.table-card.customer-account-card {
    border-color: var(--table-color-customer, #8b5cf6) !important;
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
}
.table-card.customer-account-card .table-named-customer {
    color: var(--table-color-customer, #a78bfa) !important;
    font-weight: 800;
}

/* ==========================================================================
   Order Terminal: 100% Fullscreen View (Tables Hidden When Open)
   ========================================================================== */
.order-terminal,
#orderTerminal {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    position: fixed !important;
    top: -99999px !important;
    left: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    z-index: -1 !important;
}

body.terminal-open .order-terminal,
body.terminal-open #orderTerminal {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 500 !important;
    background: #090e17 !important;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Force hiding all tables when order terminal is active */
body.terminal-open .tables-section,
.tables-section.terminal-active {
    display: none !important;
}

body.terminal-open .sidebar,
body.terminal-open .topbar {
    display: none !important;
}

.terminal-body-container {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 66px);
    box-sizing: border-box;
}

@media (min-width: 1600px) {
    .terminal-body-container {
        grid-template-columns: 1.35fr 1fr;
    }
}

.terminal-menu-pane {
    display: flex;
    flex-direction: column;
    background: #090e17;
    border-right: 2px solid var(--border);
    height: 100%;
    overflow: hidden;
}

.terminal-cart-pane {
    display: flex;
    flex-direction: column;
    background: #0f172a;
    height: 100%;
    overflow: hidden;
}

.order-terminal-header {
    padding: 14px 20px;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111827;
    flex-shrink: 0;
}

.active-table-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #93c5fd;
    letter-spacing: -0.3px;
}

.active-waiter-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-expand-terminal {
    width: 38px;
    height: 38px;
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-expand-terminal:hover {
    background: #3b82f6;
    border-color: #60a5fa;
    color: #fff;
    transform: scale(1.05);
}

.btn-close-terminal {
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn-close-terminal:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-back-tables {
    background: #1e293b;
    color: #f8fafc;
    font-weight: 800;
    border: 1.5px solid #475569;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.15s ease;
    user-select: none;
}

.btn-back-tables:hover {
    background: #334155;
    border-color: #38bdf8;
    color: #38bdf8;
}

/* Menu Category Tabs */
.menu-category-tabs {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: #0f172a;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.category-tab-btn {
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: #cbd5e1;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    user-select: none;
}

.category-tab-btn:hover {
    border-color: #60a5fa;
    color: #ffffff;
    transform: translateY(-1px);
}

.category-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* Products Selector Grid inside Terminal */
.products-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
    background: #0b1120;
    overflow-y: auto;
    align-content: start;
    flex: 1;
}

.order-terminal.expanded .products-selector-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px;
    align-content: start;
}

.product-btn {
    background: linear-gradient(180deg, #1e293b 0%, #151f30 100%);
    border: 1.5px solid #334155;
    border-radius: 8px;
    padding: 7px 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    height: 72px;
    min-height: 72px;
    max-height: 72px;
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    user-select: none;
    color: #ffffff;
    overflow: hidden;
}

.product-btn:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.product-btn:active {
    transform: scale(0.97);
    border-color: #10b981;
}

.prod-name {
    font-size: 0.86rem;
    font-weight: 750;
    color: #ffffff !important;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    text-align: center;
    margin-bottom: 2px;
    width: 100%;
}

.prod-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.prod-price {
    font-size: 0.95rem;
    font-weight: 850;
    color: #34d399;
    letter-spacing: -0.3px;
    text-align: center;
}

.prod-printer-tag {
    display: none;
}

/* Sub-Menu Orders Cart Table */
.order-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

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

.cart-table th {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 6px 6px;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.cart-table td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.92rem;
    vertical-align: middle;
}

.cart-item-name {
    font-size: 0.98rem;
    font-weight: 750;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 2px;
}

.cart-item-printer-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.printer-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.printer-badge.shisha {
    background: rgba(249, 115, 22, 0.18);
    color: #fb923c;
}

.cart-item-unit-price {
    font-size: 1.05rem;
    color: #cbd5e1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cart-item-line-total {
    font-size: 1.3rem;
    font-weight: 900;
    color: #34d399;
    font-variant-numeric: tabular-nums;
}

/* Big Touch Quantity Controls */
.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #090e17;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.btn-qty {
    width: 38px;
    height: 38px;
    background: #1e293b;
    border: 1px solid #475569;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    user-select: none;
}

.btn-qty:hover {
    background: #3b82f6;
    border-color: #60a5fa;
    color: #fff;
    transform: scale(1.05);
}

.btn-qty:active {
    transform: scale(0.95);
}

.cart-qty-val {
    min-width: 32px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 900;
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
}

.btn-void {
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-void:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: scale(1.05);
}

/* Cart Totals Summary */
.order-totals-summary {
    padding: 8px 14px;
    background: #0b1120;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.total-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 700;
    color: #94a3b8;
}

.total-line.grand {
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    border-top: 1.5px solid var(--border);
    padding-top: 6px;
    margin-top: 4px;
    align-items: baseline;
}

.total-line.grand .val {
    font-size: 1.55rem;
    font-weight: 950;
    color: #34d399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
    letter-spacing: -0.5px;
}

/* Order Actions Buttons */
.order-action-buttons {
    padding: 10px 14px;
    background: #090d16;
    border-top: 2px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex-shrink: 0;
}

.btn-action {
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter 0.15s ease, transform 0.12s ease;
    user-select: none;
    min-height: 42px;
}

.btn-action:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-prep-ticket {
    background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
    color: #fff;
    font-size: 0.88rem;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.25);
}

.btn-pay-cash {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 0.90rem;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-pay-vodafone {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 0.90rem;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-reprint {
    background: #334155;
    color: #cbd5e1;
    font-size: 0.82rem;
    padding: 7px 8px;
}
    font-size: 1.25rem;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-reprint {
    grid-column: span 2;
    background: var(--bg-card);
    color: #cbd5e1;
    border: 1px solid var(--border);
    font-size: 1.0rem;
    padding: 12px;
}

/* Modal Dialog Styles */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100000 !important;
    backdrop-filter: blur(4px) !important;
}

.modal-overlay.active,
.modal-overlay.show,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display: block"] {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-content.modal-lg {
    max-width: 780px;
    width: 95%;
}

.clickable-waiter {
    cursor: pointer;
    transition: all 0.15s ease;
}
.clickable-waiter:hover {
    color: #60a5fa !important;
    text-decoration: underline;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.kpi-box {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-box .kpi-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.kpi-box .kpi-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-main);
}

.modal-header {
    padding: 16px 20px;
    background: #111827;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.modal-body {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    background: #111827;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
}

.form-control {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--accent);
    outline: none;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

/* Fast Tender Buttons for Cash */
.tender-quick-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-tender {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #60a5fa;
    padding: 8px;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.btn-tender:hover {
    background: var(--accent);
    color: #fff;
}

/* Admin Dashboard Cards & Data Tables */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.metric-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-main);
}

.metric-val.money {
    color: #34d399;
}

.metric-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.data-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 800;
}

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

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: #111827;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-active { background: var(--success-bg); color: #34d399; }
.badge-inactive { background: var(--danger-bg); color: #f87171; }
.badge-shisha { background: rgba(234, 88, 12, 0.2); color: #fb923c; }
.badge-general { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* ==========================================================================
   LWA POS System - Multi-Theme & Appearance Settings
   ========================================================================== */

/* Theme: Light Mode */
body.theme-light {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #f8fafc;
    --bg-sidebar: #0f172a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #cbd5e1;
}
body.theme-light .order-terminal,
body.theme-light #orderTerminal {
    background-color: #f8fafc;
}
body.theme-light .terminal-cart-pane,
body.theme-light .terminal-items-pane {
    background-color: #ffffff;
    border-color: #cbd5e1;
}
body.theme-light .cart-table-wrap {
    background-color: #f1f5f9;
}
body.theme-light .cart-table tbody tr {
    background-color: #ffffff;
    border-color: #e2e8f0;
}
body.theme-light .cart-table td {
    color: #0f172a;
}
body.theme-light .cart-product-name {
    color: #0f172a;
}
body.theme-light .terminal-total-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
}
body.theme-light .pos-product-card {
    background: #ffffff;
    border-color: #cbd5e1;
}
body.theme-light .pos-product-name {
    color: #0f172a;
}
body.theme-light .data-panel {
    background-color: #ffffff;
    border-color: #cbd5e1;
}
body.theme-light .data-table th {
    background-color: #f1f5f9;
    color: #475569;
}
body.theme-light .data-table td {
    border-color: #e2e8f0;
    color: #1e293b;
}

/* Theme: Emerald Oasis (Forest Green & Gold) */
body.theme-emerald {
    --bg-main: #041d14;
    --bg-surface: #0a3022;
    --bg-card: #0f402e;
    --bg-sidebar: #02110c;
    --accent: #10b981;
    --accent-hover: #059669;
    --border: #134e3a;
}

/* Theme: Espresso Café (Rich Dark Roast & Amber) */
body.theme-espresso {
    --bg-main: #18100a;
    --bg-surface: #261a12;
    --bg-card: #38261b;
    --bg-sidebar: #100a06;
    --accent: #d97706;
    --accent-hover: #b45309;
    --border: #4a3424;
}

/* Theme: Cyber Navy (Deep Indigo & Cyan) */
body.theme-cyber {
    --bg-main: #050b18;
    --bg-surface: #0b1733;
    --bg-card: #12224d;
    --bg-sidebar: #03070f;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --border: #1a336e;
}

/* ==========================================================================
   Table Style Options
   ========================================================================== */

/* Modern Rounded (Default) */
body.table-style-modern_rounded .table-card {
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Classic POS Tile */
body.table-style-classic_tile .table-card {
    border-radius: 4px;
    border-width: 3px;
    box-shadow: none;
}
body.table-style-classic_tile .table-number {
    font-size: 1.6rem;
    font-weight: 900;
}

/* Compact Grid (High Density) */
body.table-style-compact_grid .tables-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)) !important;
    gap: 8px !important;
}
body.table-style-compact_grid .table-card {
    border-radius: 8px;
    min-height: 86px;
    padding: 8px 4px;
}
body.table-style-compact_grid .table-number {
    font-size: 1.15rem;
}
body.table-style-compact_grid .table-status-label {
    font-size: 0.65rem;
    padding: 1px 6px;
}

/* Pill / Capsule Cards */
body.table-style-pill_capsule .table-card {
    border-radius: 32px;
    padding: 16px 12px;
}
