:root {
    --app-bg: #f4f6f9;
    --hover-bg: #e9ecef;
    --border-soft: #eeeeee;
    --muted-card-bg: #f8f9fa;
    --standard-section-bg: #eef1f5;
    --standard-section-border: #ced4da;
    --standard-section-text: #495057;
    --vip-section-bg-1: #fff8e1;
    --vip-section-bg-2: #ffe9a8;
    --vip-section-text: #8a6d1a;
    --stat-success-bg: #e8f8ef;
    --stat-danger-bg: #fdecec;
    --stat-primary-bg: #e8f0fe;
    --stat-warning-bg: #fff8e6;
    --rate-vip-bg: #fffaf0;
    --rate-vip-border: #f0d78c;
    --rate-standard-bg: #f4f9ff;
    --rate-standard-border: #cfe2ff;
}
[data-bs-theme="dark"] {
    --app-bg: #0d1013;
    --hover-bg: #2a3138;
    --border-soft: #2c333a;
    --muted-card-bg: #1c2227;
    --standard-section-bg: #1c2227;
    --standard-section-border: #3a434c;
    --standard-section-text: #c3ccd3;
    --vip-section-bg-1: #2b2410;
    --vip-section-bg-2: #3a2f12;
    --vip-section-text: #e8c766;
    --stat-success-bg: #123424;
    --stat-danger-bg: #3a1c1c;
    --stat-primary-bg: #182a3d;
    --stat-warning-bg: #362c11;
    --rate-vip-bg: #2b2410;
    --rate-vip-border: #6b551c;
    --rate-standard-bg: #16232f;
    --rate-standard-border: #244059;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--app-bg);
}
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}
.navbar .nav-link {
    color: rgba(255,255,255,0.75);
}
.navbar .nav-link.active {
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid #0d6efd;
}
.table-section {
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}
.table-section-vip {
    background: linear-gradient(135deg, var(--vip-section-bg-1) 0%, var(--vip-section-bg-2) 100%);
    border: 2px solid #d4af37;
}
.table-section-standard {
    background: var(--standard-section-bg);
    border: 2px solid var(--standard-section-border);
}
.table-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1.15rem;
}
.table-section-header.vip { color: var(--vip-section-text); }
.table-section-header.standard { color: var(--standard-section-text); }
.type-vip.table-card { border-top: 6px solid #d4af37; }
.type-standard.table-card { border-top: 6px solid #6c757d; }

.table-card {
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.table-card:hover { transform: translateY(-5px); }
.status-available {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}
.status-busy {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: white;
}
.status-cleaning {
    background: linear-gradient(135deg, #0dcaf0 0%, #6edff6 100%);
    color: #212529;
}
.status-closed {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
    color: white;
}
.status-menu-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: none;
    z-index: 2;
}
.status-menu-btn:hover { background: rgba(0,0,0,0.55); }
.table-icon { font-size: 3rem; opacity: 0.8; }
.type-ribbon {
    position: absolute;
    top: 10px;
    right: -32px;
    transform: rotate(45deg);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 35px;
    letter-spacing: 1px;
}
.type-vip .type-ribbon { background: #b8860b; }
.pause-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ffc107;
    color: #212529;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.maintenance-ribbon {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.rate-text { font-size: 0.8rem; opacity: 0.9; }
.pos-item { cursor: pointer; transition: all 0.2s; }
.pos-item:hover { background-color: var(--hover-bg); transform: scale(1.02); }
.order-list { max-height: 300px; overflow-y: auto; }
.sidebar {
    background: var(--bs-body-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.page-card {
    background: var(--bs-body-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.rate-card { border-radius: 12px; border: 1px solid var(--border-soft); padding: 15px; margin-bottom: 15px; }
.rate-card.vip { border-color: var(--rate-vip-border); background: var(--rate-vip-bg); }
.rate-card.standard { border-color: var(--rate-standard-border); background: var(--rate-standard-bg); }
.move-target-card { cursor: pointer; border-radius: 12px; transition: all 0.15s; }
.move-target-card:hover { background-color: var(--hover-bg); transform: scale(1.02); }
.move-log-item { font-size: 0.78rem; color: var(--bs-secondary-color); }
.stat-box { border-radius: 12px; padding: 12px; text-align: center; background: var(--muted-card-bg); }
.stat-box-lg {
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
    height: 100%;
}
.stat-box-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}
.bg-success-subtle { background-color: var(--stat-success-bg); }
.bg-danger-subtle { background-color: var(--stat-danger-bg); }
.bg-primary-subtle { background-color: var(--stat-primary-bg); }
.bg-warning-subtle { background-color: var(--stat-warning-bg); }
.scroll-body { max-height: 420px; overflow-y: auto; }
.time-rate-row { font-size: 0.85rem; }

/* ---- Printable content (receipts, QR codes, etc.) ----
   Scoped to whichever modal is currently open (.modal.show) so that if
   more than one .printable container exists in the page at once, only
   the one actually being shown to the user gets printed. */
@media print {
    body * { visibility: hidden; }
    .modal.show .printable, .modal.show .printable * { visibility: visible; background: white !important; color: black !important; }
    .modal.show .printable {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 8px;
        background: white !important;
        color: black !important;
    }
    .no-print { display: none !important; }
}
