/* =====================================================================
   Restaurant SaaS — light theme design system
   Bootstrap 5 loads first; this overrides it. Mobile-first responsive.
   ===================================================================== */

:root {
    --bg:          #f4f6fa;
    --surface:     #ffffff;
    --surface-2:   #f8fafc;
    --border:      #e5e9f2;
    --border-2:    #eef1f7;
    --text:        #1e2939;
    --text-2:      #46536b;
    --muted:       #8592ab;
    --brand:       #f4620f;
    --brand-2:     #ff8a3d;
    --brand-soft:  #fff2e9;
    --ok:          #16a34a;
    --ok-soft:     #e8f7ee;
    --info:        #0284c7;
    --info-soft:   #e6f4fd;
    --warn:        #d97706;
    --warn-soft:   #fdf3e3;
    --bad:         #dc2626;
    --bad-soft:    #fdecec;
    --sidebar-w:   256px;
    --radius:      12px;
    --shadow:      0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
    --shadow-lg:   0 10px 30px rgba(16,24,40,.10);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
hr { border-color: var(--border); opacity: 1; }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; }

/* ── SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .22s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #dfe4ee; border-radius: 8px; }

.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text); font-weight: 700;
    position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.brand:hover { color: var(--text); }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center; flex: 0 0 38px; overflow: hidden;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-size: 18px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }

.nav-section {
    padding: 16px 20px 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .9px;
    text-transform: uppercase; color: var(--muted);
}
.side-nav { list-style: none; margin: 0; padding: 4px 10px; }
.side-nav:last-child { padding-bottom: 22px; }
.side-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin-bottom: 2px;
    border-radius: 9px; color: var(--text-2); font-weight: 500;
}
.side-nav a i { font-size: 16px; width: 18px; text-align: center; color: var(--muted); }
.side-nav a:hover { background: var(--surface-2); color: var(--brand); }
.side-nav a:hover i { color: var(--brand); }
.side-nav a.active {
    background: var(--brand-soft); color: var(--brand); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}
.side-nav a.active i { color: var(--brand); }
.side-nav .badge-soft { margin-left: auto; }
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.4);
    z-index: 1044; display: none;
}
.sidebar-backdrop.show { display: block; }

/* ── SHELL ────────────────────────────────────────────────────────── */
.app { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 1035;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 11px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar h1 { font-size: 17px; margin: 0; line-height: 1.25; }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; margin-top: 2px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs span { color: var(--text-2); font-weight: 500; }
.crumbs i { color: #c3cad9; font-size: 10px; }

.icon-btn {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center; cursor: pointer; flex: 0 0 38px;
}
.icon-btn:hover { color: var(--brand); border-color: #f7cdb4; background: var(--brand-soft); }

.who { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: grid; place-items: center; color: #fff; font-weight: 600;
}
.who .name { font-weight: 600; line-height: 1.15; font-size: 13.5px; }
.who .role { font-size: 11.5px; color: var(--muted); }

.content { padding: 20px; flex: 1; width: 100%; }
.footer-note {
    padding: 14px 20px; color: var(--muted); font-size: 12px;
    border-top: 1px solid var(--border); background: var(--surface);
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .lead-text { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

/* ── CARDS ────────────────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text);
}
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 16px; border-bottom: 1px solid var(--border-2);
    background: transparent; font-weight: 600; font-size: 14px; flex-wrap: wrap;
}
.card-header .bi { color: var(--brand); }
.card-body { padding: 16px; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border-2); padding: 12px 16px; }

/* ── STAT CARDS ───────────────────────────────────────────────────── */
.stat {
    display: flex; align-items: center; gap: 14px; height: 100%;
    padding: 16px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-ico {
    width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px;
    display: grid; place-items: center; font-size: 20px; color: #fff;
}
.bg-orange { background: linear-gradient(135deg, #f4620f, #ff8a3d); }
.bg-blue   { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.bg-green  { background: linear-gradient(135deg, #15803d, #22c55e); }
.bg-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.bg-pink   { background: linear-gradient(135deg, #db2777, #fb7185); }
.bg-teal   { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.bg-slate  { background: linear-gradient(135deg, #475569, #94a3b8); }

.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 21px; font-weight: 700; line-height: 1.2; }
.stat .delta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }

/* ── TABLES ───────────────────────────────────────────────────────── */
.table { color: var(--text); margin: 0; font-size: 13.5px; }
.table > :not(caption) > * > * { background: transparent; border-color: var(--border-2); padding: 11px 14px; }
.table thead th {
    background: var(--surface-2); color: var(--muted);
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    font-weight: 700; white-space: nowrap;
}
.table tbody tr:hover > * { background: #fbfcfe; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table td .sub { color: var(--muted); font-size: 12px; }

/* ── FORMS ────────────────────────────────────────────────────────── */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-control, .form-select {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    border-radius: 9px; padding: 9px 12px; font-size: 13.5px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand); box-shadow: 0 0 0 3px rgba(244,98,15,.12);
}
.form-control::placeholder { color: #aab3c5; }
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); }
.form-text { color: var(--muted) !important; font-size: 11.5px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(244,98,15,.12); border-color: var(--brand); }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--muted); font-size: 13px; }
.required { color: var(--bad); }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn { border-radius: 9px; font-size: 13.5px; font-weight: 500; padding: 8px 14px; }
.btn:focus { box-shadow: none; }
.btn i { vertical-align: -1px; }
.btn-brand { background: var(--brand); border: 1px solid var(--brand); color: #fff; }
.btn-brand:hover { background: #dc540b; border-color: #dc540b; color: #fff; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--brand); border-color: #f7cdb4; }
.btn-soft { background: var(--brand-soft); border: 1px solid #fbdcc7; color: var(--brand); }
.btn-soft:hover { background: #ffe6d5; color: #c2490a; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }

/* ── BADGES / CHIPS ───────────────────────────────────────────────── */
.badge { font-weight: 600; font-size: 10.5px; padding: 5px 9px; border-radius: 6px; letter-spacing: .2px; }
.badge-soft { border: 1px solid transparent; }
.badge-soft.b-ok   { background: var(--ok-soft);   color: #15803d; border-color: #c9ecd7; }
.badge-soft.b-info { background: var(--info-soft); color: #0369a1; border-color: #c8e6fa; }
.badge-soft.b-warn { background: var(--warn-soft); color: #b45309; border-color: #f6e2bf; }
.badge-soft.b-bad  { background: var(--bad-soft);  color: #b91c1c; border-color: #f8d4d4; }
.badge-soft.b-mute { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge-soft.b-brand{ background: var(--brand-soft);color: var(--brand); border-color: #fbdcc7; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); border-color: #c9ecd7; color: #15803d; }
.chip.warn { background: var(--warn-soft); border-color: #f6e2bf; color: #b45309; }
.chip.bad { background: var(--bad-soft); border-color: #f8d4d4; color: #b91c1c; }
.chip.brand { background: var(--brand-soft); border-color: #fbdcc7; color: var(--brand); }

.veg-dot, .nonveg-dot {
    display: inline-grid; place-items: center;
    width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--ok);
    flex: 0 0 14px;
}
.veg-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.nonveg-dot { border-color: var(--bad); }
.nonveg-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }

/* ── ALERTS ───────────────────────────────────────────────────────── */
.alert { border-radius: 10px; border: 1px solid var(--border); font-size: 13.5px; padding: 11px 14px; }
.alert-success { background: var(--ok-soft);   border-color: #c9ecd7; color: #15803d; }
.alert-danger  { background: var(--bad-soft);  border-color: #f8d4d4; color: #b91c1c; }
.alert-warning { background: var(--warn-soft); border-color: #f6e2bf; color: #b45309; }
.alert-info    { background: var(--info-soft); border-color: #c8e6fa; color: #0369a1; }

/* ── EMPTY / MISC ─────────────────────────────────────────────────── */
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty i { font-size: 38px; color: #c9d1e0; display: block; margin-bottom: 10px; }
.empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 3px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--text); }

.progress { background: var(--surface-2); height: 7px; border-radius: 999px; }
.progress-bar { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.logo-thumb {
    width: 40px; height: 40px; border-radius: 9px; object-fit: cover;
    background: var(--surface-2); border: 1px solid var(--border);
}
.thumb-56 { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); background: var(--surface-2); }

.credentials-box {
    background: var(--surface); border: 1px dashed #f0a675; border-radius: 10px;
    padding: 13px 15px; font-family: ui-monospace, Consolas, monospace; font-size: 13px;
    color: var(--text); overflow-x: auto;
}

.nav-tabs { border-bottom-color: var(--border); gap: 2px; }
.nav-tabs .nav-link { color: var(--muted); border: none; border-bottom: 2px solid transparent; font-size: 13.5px; font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--brand); border-bottom-color: #f7cdb4; }
.nav-tabs .nav-link.active { color: var(--brand); background: transparent; border-bottom-color: var(--brand); font-weight: 600; }

.modal-content { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--border-2); }
.modal-title { font-size: 15.5px; }

.dropdown-menu {
    border: 1px solid var(--border); border-radius: 11px; padding: 6px;
    box-shadow: var(--shadow-lg); font-size: 13.5px;
    z-index: 1070; /* above sticky topbar and table headers */
}
/* Row menus inside a horizontally scrolling table are positioned with
   Popper's fixed strategy (see layout JS) so .table-wrap cannot crop them. */
.table-wrap { overflow-x: auto; overflow-y: visible; }
.dropdown-item { color: var(--text-2); border-radius: 7px; padding: 7px 10px; }
.dropdown-item:hover { background: var(--brand-soft); color: var(--brand); }
.dropdown-item i { width: 16px; color: var(--muted); }
.dropdown-item:hover i { color: var(--brand); }
.dropdown-item.text-danger:hover { background: var(--bad-soft); color: var(--bad) !important; }

/* ── AUTH ─────────────────────────────────────────────────────────── */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 22px;
    background:
        radial-gradient(700px 380px at 8% -6%, #ffe8d8, transparent 62%),
        radial-gradient(700px 420px at 104% 108%, #e0f0fb, transparent 60%),
        var(--bg);
}
.auth-card {
    width: 100%; max-width: 392px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 24px 24px 18px; box-shadow: var(--shadow-lg);
}
.auth-card .logo {
    width: 52px; height: 52px; border-radius: 14px; margin-bottom: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: grid; place-items: center; color: #fff; font-size: 22px;
}
.auth-card h1 { font-size: 19px; margin: 0 0 2px; }
.auth-card p.sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.auth-card .foot {
    margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--border-2);
    font-size: 11.5px; color: var(--muted); text-align: center;
}
.auth-badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
    color: var(--text-2); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 10px; margin-bottom: 13px;
}

/* ── DEVELOPER ACCENT ─────────────────────────────────────────────── */
body.dev-panel {
    --brand: #4f46e5; --brand-2: #7c68f5; --brand-soft: #eef0fe;
}
body.dev-panel .btn-brand { background: var(--brand); border-color: var(--brand); }
body.dev-panel .btn-brand:hover { background: #4338ca; border-color: #4338ca; }
body.dev-panel .side-nav a.active { box-shadow: inset 3px 0 0 var(--brand); }
body.dev-panel .credentials-box { border-color: #b9b3f6; }

/* ── NOTIFICATION BELL ────────────────────────────────────────────── */
.bell-count {
    position: absolute; top: -5px; right: -5px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--bad); color: #fff; border-radius: 999px;
    font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}
.icon-btn.ring { animation: bell-ring .9s ease; color: var(--brand); border-color: #f7cdb4; }
@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(12deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(7deg); }
    80% { transform: rotate(-5deg); }
}
.bell-menu { width: 348px; max-width: calc(100vw - 24px); overflow: hidden; }
.bell-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--border-2);
    font-weight: 600; font-size: 13.5px;
}
.bell-head .bi { color: var(--brand); }
.bell-list { max-height: 340px; overflow-y: auto; }
.bell-item {
    display: flex; gap: 10px; align-items: flex-start; position: relative;
    padding: 10px 12px; border-bottom: 1px solid var(--border-2); color: var(--text-2);
}
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--surface-2); color: var(--text-2); }
.bell-item.unread { background: #fffaf6; }
.bell-item.unread:hover { background: var(--brand-soft); }
.bell-ico {
    width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
    display: grid; place-items: center; font-size: 14px;
}
.bell-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bell-title { font-weight: 600; color: var(--text); font-size: 13px; line-height: 1.3; }
.bell-body { font-size: 12px; color: var(--muted); }
.bell-time { font-size: 11px; color: #a3adc0; }
.bell-dot {
    position: absolute; top: 14px; right: 10px;
    width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
}
.bell-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.bell-empty i { display: block; font-size: 26px; color: #ccd4e2; margin-bottom: 6px; }
.bell-foot {
    display: block; padding: 9px 12px; text-align: center; font-size: 12.5px;
    border-top: 1px solid var(--border-2); background: var(--surface-2);
}

/* ── LIVE INDICATORS ──────────────────────────────────────────────── */
.live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
    display: inline-block; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22,163,74,.45); }
    50% { opacity: .65; box-shadow: 0 0 0 5px rgba(22,163,74,0); }
}
.flash { animation: flash-bg .9s ease; }
@keyframes flash-bg {
    0% { background: var(--brand-soft); }
    100% { background: transparent; }
}
.section-label {
    font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    color: var(--muted); margin: 2px 0 8px;
}
.section-label .bi { color: var(--brand); }

/* ── RESERVATION TIMELINE ─────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.tl-row {
    display: grid; grid-template-columns: 96px minmax(0, 1fr) 34px;
    gap: 10px; align-items: center;
    padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.tl-row:last-child { border-bottom: none; }
.tl-row.now { background: var(--brand-soft); border-radius: 9px; padding: 9px 8px; }
.tl-time { font-weight: 600; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.tl-live {
    display: inline-block; margin-left: 4px; font-size: 9.5px; font-weight: 700;
    color: #fff; background: var(--brand); border-radius: 4px; padding: 1px 4px;
    text-transform: uppercase;
}
.tl-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 999px; font-size: 12px;
}
.tl-chip:hover { filter: brightness(.97); }
.tl-pax { font-size: 10.5px; opacity: .8; }
.tl-free { font-size: 11.5px; color: var(--muted); align-self: center; }
.tl-add { opacity: .55; }
.tl-row:hover .tl-add { opacity: 1; }

/* ── MONTH CALENDAR ───────────────────────────────────────────────── */
.cal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; font-size: 13.5px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow {
    text-align: center; font-size: 10px; font-weight: 700; color: var(--muted);
    padding-bottom: 3px; text-transform: uppercase;
}
.cal-cell {
    position: relative; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 12.5px; color: var(--text-2); background: var(--surface);
}
.cal-cell.empty { border: none; background: transparent; }
.cal-cell:hover { border-color: var(--brand); color: var(--brand); }
.cal-cell.today { border-color: var(--info); box-shadow: inset 0 0 0 1px var(--info); }
.cal-cell.selected { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.cal-cell.has-bookings { font-weight: 600; color: var(--text); }
.cal-count {
    position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    min-width: 15px; height: 14px; line-height: 14px; padding: 0 3px;
    background: var(--brand-soft); color: var(--brand);
    border-radius: 999px; font-size: 9px; font-weight: 700;
}
.cal-cell.selected .cal-count { background: rgba(255,255,255,.9); color: var(--brand); }
.cal-legend {
    display: flex; gap: 12px; justify-content: center; margin-top: 9px;
    font-size: 11px; color: var(--muted);
}

/* ── TABLE MAP (floor plan) ───────────────────────────────────────── */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.table-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: 14px 12px; text-align: center;
    box-shadow: var(--shadow); position: relative;
}
.table-card .t-no { font-size: 17px; font-weight: 700; }
.table-card .t-cap { font-size: 11.5px; color: var(--muted); }
.table-card .t-state { margin-top: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.table-card .t-line { font-size: 11.5px; color: var(--text-2); margin-top: 2px; line-height: 1.3; }
.table-card .t-more { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.table-card .t-next {
    margin-top: 5px; padding: 3px 5px; border-radius: 6px;
    background: var(--info-soft); color: #0369a1;
    font-size: 10.5px; font-weight: 600; line-height: 1.25;
}
.table-card.is-available { border-top: 3px solid var(--ok); }
.table-card.is-occupied  { border-top: 3px solid var(--bad); background: var(--bad-soft); }
.table-card.is-reserved  { border-top: 3px solid var(--info); background: var(--info-soft); }
.table-card.is-cleaning  { border-top: 3px solid var(--warn); background: var(--warn-soft); }

/* ── POS (3 panes: categories · dishes · bill) ─────────────────────── */
.pos-shell {
    display: grid;
    grid-template-columns: 178px minmax(0, 1fr) 396px;
    gap: 12px;
    align-items: start;
}

/* category rail */
.pos-cats {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 8px; position: sticky; top: 74px;
    max-height: calc(100vh - 96px); overflow-y: auto;
}
.pos-cats .cat-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    width: 100%; text-align: left; border: 1px solid transparent; background: transparent;
    border-radius: 9px; padding: 9px 11px; margin-bottom: 3px;
    font-size: 13px; font-weight: 500; color: var(--text-2);
}
.pos-cats .cat-btn small { color: var(--muted); font-size: 11px; }
.pos-cats .cat-btn:hover { background: var(--surface-2); color: var(--brand); }
.pos-cats .cat-btn.active {
    background: var(--brand-soft); color: var(--brand); font-weight: 600;
    border-color: #fbdcc7;
}
.pos-cats .cat-btn.active small { color: var(--brand); }

/* dish grid */
.pos-main {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.pos-search-bar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 12px 14px; border-bottom: 1px solid var(--border-2);
    position: sticky; top: 62px; background: var(--surface); z-index: 5;
    border-radius: var(--radius) var(--radius) 0 0;
}
.pos-search-bar .form-control { flex: 1 1 200px; }
.pos-items {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 10px; padding: 14px;
}
.pos-item {
    border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
    cursor: pointer; text-align: left; overflow: hidden; position: relative;
    transition: border-color .12s, box-shadow .12s, transform .08s;
    display: flex; flex-direction: column;
}
.pos-item:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(244,98,15,.16); transform: translateY(-2px); }
.pos-item:active { transform: translateY(0); }
.pos-item .pi-img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    background: var(--surface-2); display: block;
}
.pos-item .pi-body { padding: 8px 9px 9px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pos-item .pi-name { font-weight: 600; font-size: 12.5px; line-height: 1.25; color: var(--text); }
.pos-item .pi-price { color: var(--brand); font-weight: 700; font-size: 13.5px; margin-top: auto; }
.pos-item .pi-meta { font-size: 10.5px; color: var(--muted); }
.pos-item .pi-tag {
    position: absolute; top: 6px; left: 6px;
    background: rgba(255,255,255,.94); border-radius: 6px; padding: 3px 5px;
    display: flex; align-items: center; box-shadow: var(--shadow);
}
.pos-item .pi-combo {
    position: absolute; top: 6px; right: 6px;
    background: var(--brand); color: #fff; font-size: 9.5px; font-weight: 700;
    padding: 3px 6px; border-radius: 6px; letter-spacing: .4px;
}
.pos-item.out { opacity: .5; pointer-events: none; }
.pos-item.out::after {
    content: 'OUT OF STOCK'; position: absolute; inset: auto 0 40% 0;
    background: rgba(220,38,38,.9); color: #fff; font-size: 10px; font-weight: 700;
    text-align: center; padding: 3px 0;
}

/* bill pane */
.pos-bill { position: sticky; top: 74px; }
.pos-bill .card-body { padding: 0; }
.bill-table { width: 100%; font-size: 13px; }
.bill-table thead th {
    background: var(--surface-2); color: var(--muted); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
    padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.bill-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.bill-table tbody tr:last-child td { border-bottom: none; }
.bill-table .b-name { font-weight: 600; color: var(--text); line-height: 1.25; }
.bill-table .b-note { font-size: 11px; color: var(--warn); }
.bill-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bill-scroll { max-height: 300px; overflow-y: auto; }
.bill-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.bill-empty i { display: block; font-size: 30px; color: #d3dae7; margin-bottom: 8px; }

.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-box button { border: none; background: var(--surface-2); width: 24px; height: 26px; line-height: 1; color: var(--text-2); font-weight: 700; }
.qty-box button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-box span { min-width: 26px; text-align: center; font-weight: 700; font-size: 12.5px; }

.totals-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13px; padding: 12px 14px; }
.totals-grid .t-label { color: var(--muted); }
.totals-grid .t-val { text-align: right; font-variant-numeric: tabular-nums; }
.totals-payable {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; background: var(--brand-soft); border-top: 1px solid #fbdcc7;
}
.totals-payable .amt { font-size: 22px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

.type-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.type-pills input { position: absolute; opacity: 0; pointer-events: none; }
.type-pills label {
    border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px;
    font-size: 12.5px; cursor: pointer; color: var(--text-2); background: var(--surface);
}
.type-pills input:checked + label {
    background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.pay-pills label { border-radius: 8px; padding: 7px 0; text-align: center; width: 100%; }

.kbd {
    display: inline-block; border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 5px; padding: 1px 5px; font-size: 10.5px; color: var(--muted);
    background: var(--surface-2); font-family: ui-monospace, Consolas, monospace;
}

/* ── KOT BOARD ────────────────────────────────────────────────────── */
.kot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.kot-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.kot-card .kot-head { padding: 11px 13px; border-bottom: 1px solid var(--border-2); display: flex; justify-content: space-between; align-items: center; }
.kot-card.age-warn .kot-head { background: var(--warn-soft); }
.kot-card.age-late .kot-head { background: var(--bad-soft); }
.kot-item { padding: 9px 13px; border-bottom: 1px dashed var(--border); display: flex; gap: 9px; align-items: flex-start; }
.kot-item:last-child { border-bottom: none; }
.kot-item .k-qty { font-weight: 700; color: var(--brand); min-width: 26px; }

/* ── PRINT (thermal + A4) ─────────────────────────────────────────── */
.print-wrap { padding: 0 12px 28px; }
.print-sheet {
    background: #fff; color: #000; margin: 0 auto;
    font-family: ui-monospace, 'Courier New', monospace; font-size: 12px; line-height: 1.45;
    max-width: 100%; box-sizing: border-box; overflow-wrap: break-word;
}
.print-sheet.w58 { width: 58mm; padding: 4mm; font-size: 10.5px; }
.print-sheet.w80 { width: 80mm; padding: 5mm; }
.print-sheet.wa4 {
    width: 190mm; padding: 10mm; font-family: 'Inter', sans-serif; font-size: 13px;
}
.print-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-sheet td, .print-sheet th { overflow-wrap: break-word; vertical-align: top; }
.print-sheet .dash { border-top: 1px dashed #000; margin: 5px 0; }
.print-sheet .center { text-align: center; }
.print-sheet .right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.print-sheet .bold { font-weight: 700; }
.print-sheet .lg { font-size: 1.25em; }
.print-sheet .muted { color: #444; }
.print-toolbar {
    max-width: 820px; margin: 16px auto; display: flex; gap: 8px;
    justify-content: center; flex-wrap: wrap; padding: 0 12px;
}

/* bill view (screen) — right-aligned tabular numbers */
.bill-view .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bill-view tfoot td { border-top: 1px solid var(--border); }
.summary-box {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px;
}
.summary-box .row-line {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 13px; padding: 3px 0;
}
.summary-box .row-line .lbl { color: var(--muted); }
.summary-box .row-line .val { font-variant-numeric: tabular-nums; }
.summary-box .grand {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.summary-box .grand .amt { font-size: 21px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .print-sheet { box-shadow: none; width: auto; padding: 0; }
    @page { margin: 4mm; }
}

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 1399.98px) {
    .pos-shell { grid-template-columns: 156px minmax(0, 1fr) 340px; }
}
@media (max-width: 1199.98px) {
    .pos-shell { grid-template-columns: 1fr; }
    .pos-cats { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; }
    .pos-cats .cat-btn { width: auto; white-space: nowrap; margin: 0; }
    .pos-bill { position: static; }
    .pos-search-bar { position: static; }
}
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .app { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { padding: 10px 14px; }
    .kv { grid-template-columns: 130px 1fr; }
}
@media (max-width: 575.98px) {
    body { font-size: 13.5px; }
    .content { padding: 12px; }
    .card-body { padding: 13px; }
    .card-header { padding: 11px 13px; }
    .topbar h1 { font-size: 15.5px; }
    .stat { padding: 13px; gap: 11px; }
    .stat-ico { width: 40px; height: 40px; flex: 0 0 40px; font-size: 17px; }
    .stat .value { font-size: 18px; }
    .kv { grid-template-columns: 1fr; gap: 3px 0; }
    .kv dd { margin-bottom: 8px; }
    .page-head { gap: 8px; }
    .page-head .btn { width: 100%; }
    .floor-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
    .pos-items { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
    .table > :not(caption) > * > * { padding: 9px 11px; }
}
