/* =========================================================================
   LISO Cafe & Restaurant POS - Professional Dark & Neon Theme
   ========================================================================= */

:root {
    --liso-primary: #06b6d4;      /* Liso Cyan/Teal */
    --liso-primary-dark: #0891b2;
    --liso-primary-glow: rgba(6, 182, 212, 0.35);
    --liso-bg: #090d16;          /* Deep Obsidian Blue */
    --liso-surface: #111827;     /* Dark Surface */
    --liso-card: #1e293b;        /* Card Background */
    --liso-border: #334155;      /* Subtle Border */
    --liso-text: #f8fafc;
    --liso-muted: #94a3b8;
    --liso-success: #10b981;
    --liso-warning: #f59e0b;
    --liso-danger: #ef4444;
    --liso-purple: #8b5cf6;
    --sidebar-width: 250px;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif !important;
    background-color: var(--liso-bg) !important;
    color: var(--liso-text) !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    user-select: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--liso-primary);
}

/* Glassmorphism Cards */
.liso-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.25s ease-in-out;
}

.liso-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

/* Header & Sidebar */
.liso-sidebar {
    width: var(--sidebar-width);
    background: #0d1322;
    border-left: 1px solid var(--liso-border);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.liso-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    padding: 1.5rem;
    background-color: var(--liso-bg);
}

@media (max-width: 992px) {
    .liso-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .liso-sidebar.open {
        transform: translateX(0);
    }
    .liso-content {
        margin-right: 0;
        padding: 1rem;
    }
}

/* Nav Item Styling */
.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.25rem;
    color: var(--liso-muted);
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin: 3px 12px;
}

.nav-link-custom:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link-custom.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
    border: 1px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 15px var(--liso-primary-glow);
}

.nav-link-custom i {
    font-size: 1.25rem;
}

/* Stat Widget Cards */
.stat-card {
    background: linear-gradient(145deg, #1e293b, #131d2e);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.cyan::after { background: var(--liso-primary); }
.stat-card.green::after { background: var(--liso-success); }
.stat-card.purple::after { background: var(--liso-purple); }
.stat-card.orange::after { background: var(--liso-warning); }
.stat-card.red::after { background: var(--liso-danger); }

/* POS Cashier Grid & Cards */
.pos-product-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pos-product-card:hover {
    transform: translateY(-3px);
    border-color: var(--liso-primary);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.2);
}

.pos-product-card:active {
    transform: scale(0.97);
}

/* Category Filter Tabs */
.pos-category-btn {
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e293b;
    color: #cbd5e1;
    white-space: nowrap;
    transition: all 0.2s;
}

.pos-category-btn.active, .pos-category-btn:hover {
    background: var(--liso-primary);
    color: #090d16;
    border-color: var(--liso-primary);
    box-shadow: 0 0 12px var(--liso-primary-glow);
}

/* Table Cards */
.table-card {
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.table-card.available {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.table-card.available:hover {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.table-card.occupied {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}
.table-card.occupied:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.table-card.reserved {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

/* Kitchen Orders Board (KDS) */
.kitchen-ticket {
    background: #1e293b;
    border-radius: 14px;
    border-top: 5px solid var(--liso-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.kitchen-ticket.delayed {
    border-top-color: var(--liso-danger);
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.8); }
}

/* Touch POS Buttons */
.btn-touch {
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
}

/* Thermal Printable Receipt */
.thermal-receipt {
    width: 80mm;
    margin: 0 auto;
    background: #fff;
    color: #000;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 4px;
}

@media print {
    body * {
        visibility: hidden;
    }
    .thermal-receipt, .thermal-receipt * {
        visibility: visible;
    }
    .thermal-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* Responsive application shell and Phase 1 operational screens */
.app-shell { min-height: 100vh; }
.menu-toggle, .sidebar-backdrop { display: none; }
.filter-scroll { overflow-x: auto; padding-bottom: 0.25rem; }
.filter-scroll > .btn { flex: 0 0 auto; white-space: nowrap; }

@media (max-width: 1199.98px) {
    .pos-product-card { min-height: 160px; }
    .pos-cart-panel { min-height: auto !important; }
}

@media (max-width: 991.98px) {
    .liso-sidebar { box-shadow: -12px 0 30px rgba(0, 0, 0, 0.42); }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 999;
        border: 0;
        background: rgba(0, 0, 0, 0.55);
    }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .app-topbar { position: sticky; top: 0.5rem; z-index: 100; }
    .app-topbar > div:last-child { gap: 0.5rem !important; }
}

@media (max-width: 767.98px) {
    :root { --sidebar-width: min(86vw, 320px); }

    body { font-size: 0.92rem; }
    .liso-content { padding: 0.75rem; }
    .liso-card { border-radius: 12px; }
    .app-topbar { margin-bottom: 1rem !important; padding: 0.65rem !important; top: 0; }
    .app-topbar .fs-5 { font-size: 0.98rem !important; }
    .app-topbar > div:last-child .btn { padding: 0.4rem 0.55rem; }
    .app-topbar > div:last-child .btn span { display: none; }

    .page-heading { align-items: stretch !important; flex-direction: column; margin-bottom: 1rem !important; }
    .page-heading h4, main h4 { font-size: 1.05rem; }
    .page-heading p { line-height: 1.6; }
    .filter-scroll { width: 100%; }
    .table-legend { flex-wrap: wrap; gap: 0.5rem 1rem !important; }

    .pos-layout .col-12 { min-width: 0; }
    .pos-layout .liso-card { padding: 0.75rem !important; }
    .pos-layout .d-flex.justify-content-between.align-items-center > .position-relative { width: 100%; min-width: 0 !important; }
    .pos-layout .d-flex.justify-content-between.align-items-center > .position-relative .form-control { min-height: 42px; }
    .pos-product-card { min-height: 140px; }
    .pos-product-card .position-relative { height: 74px !important; padding: 0.5rem !important; }
    .pos-product-card .fs-1 { font-size: 1.55rem !important; }
    .pos-layout .row.overflow-y-auto { max-height: none !important; overflow: visible !important; }
    .pos-cart-panel { min-height: auto !important; }
    .pos-cart-panel .flex-grow-1 { max-height: 42vh !important; }

    .modal { overflow-y: auto; padding: 0.5rem; }
    .modal-dialog { margin: 0.5rem auto; }
    .modal-content { padding: 1rem !important; }
    .modal-footer { flex-wrap: wrap; }
    .modal-footer .btn { flex: 1 1 auto; }
}

@media (max-width: 420px) {
    .liso-content { padding: 0.5rem; }
    .app-topbar .fs-5 { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav-link-custom { margin-inline: 8px; padding: 0.7rem 0.9rem; }
    .pos-category-btn { padding: 0.5rem 0.85rem; font-size: 0.85rem; }
    .pos-layout .col-6 { width: 50%; }
    .table-card { padding: 0.75rem !important; }
    .table-card .fs-2 { font-size: 1.5rem !important; }
    .table-card h5 { font-size: 0.95rem; }
}

@media (max-width: 767.98px) {
    .invoices-table { min-width: 760px; }
    .invoice-modal .modal-dialog { max-width: 100%; }
}
