/* ================= Tokens ================= */
:root {
    --brand: #4f46e5;
    --brand-600: #4338ca;
    --brand-50: #eef2ff;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e7eaf3;
    --text: #0f172a;
    --muted: #64748b;
    --sidebar: #0f172a;
    --sidebar-text: #cbd5e1;
    --ok: #16a34a;
    --warn: #f59e0b;
    --bad: #dc2626;
    --info: #2563eb;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --sidebar-w: 256px;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-bs-theme="dark"] {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #0f172a;
    --border: #1f2937;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --sidebar: #030712;
    --brand-50: #1e1b4b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
}

html, body { font-family: var(--bs-body-font-family); }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-600); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.form-control, .form-select { border-radius: 10px; border-color: var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-icon { background: transparent; border: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: inherit; }
.btn-icon:hover { background: rgba(100, 116, 139, .12); }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(15, 23, 42, .25); background: var(--surface); }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.dropdown-menu { border-radius: 12px; }
.badge-status { font-weight: 600; letter-spacing: .2px; }
.text-muted { color: var(--muted) !important; }

/* ================= Brand ================= */
.brand-logo { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-size: 1.15rem; flex-shrink: 0; box-shadow: 0 6px 16px rgba(99, 102, 241, .35); }
.brand-logo.sm { width: 30px; height: 30px; font-size: .95rem; border-radius: 9px; }
.brand-logo.lg { width: 48px; height: 48px; font-size: 1.4rem; }
.sidebar-brand-img { height: 60px; width: auto; flex-shrink: 0; }

/* ================= App shell ================= */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; color: #fff; }
.brand-name { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.brand-sub { display: block; font-size: .72rem; opacity: .6; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; opacity: .45; padding: 16px 10px 6px; }
.nav-link-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--sidebar-text); font-size: .9rem; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.nav-link-item i { font-size: 1.05rem; opacity: .85; width: 20px; text-align: center; }
.nav-link-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link-item.active { background: linear-gradient(90deg, rgba(99, 102, 241, .9), rgba(139, 92, 246, .8)); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.sidebar-foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .06); color: var(--sidebar-text); }
.sidebar-backdrop { display: none; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); min-height: 62px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-weight: 700; font-size: 1.1rem; }
.topbar-center { justify-self: center; max-width: 420px; text-align: center; font-weight: 800; font-size: 1.25rem; color: var(--brand); letter-spacing: .01em; }
.topbar-right { justify-self: end; }
.content { padding: 24px; flex: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #ec4899); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.restaurant-switch { max-width: 230px; border-radius: 999px; font-weight: 500; }
.license-pill { align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #dcfce7; color: #166534; }
.license-pill.warn { background: #fef3c7; color: #92400e; }
.license-pill.bad { background: #fee2e2; color: #991b1b; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1035; }
    .main { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { padding: 8px 12px; }
}

/* ================= Cards & widgets ================= */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head h4 { margin: 0; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: .9rem; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stat { position: relative; overflow: hidden; padding: 18px; height: 100%; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 1.65rem; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.stat .hint { font-size: .8rem; color: var(--muted); }
.stat .icon { position: absolute; right: 16px; top: 16px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.tint-indigo { background: #eef2ff; color: #4f46e5; }
.tint-green { background: #dcfce7; color: #16a34a; }
.tint-amber { background: #fef3c7; color: #d97706; }
.tint-rose { background: #ffe4e6; color: #e11d48; }
.tint-sky { background: #e0f2fe; color: #0284c7; }
.tint-violet { background: #f3e8ff; color: #9333ea; }
[data-bs-theme="dark"] .tint-indigo, [data-bs-theme="dark"] .tint-green, [data-bs-theme="dark"] .tint-amber,
[data-bs-theme="dark"] .tint-rose, [data-bs-theme="dark"] .tint-sky, [data-bs-theme="dark"] .tint-violet { background: rgba(255, 255, 255, .06); }
.trend-up { color: var(--ok); font-weight: 600; }
.trend-down { color: var(--bad); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.empty i { font-size: 2.4rem; opacity: .4; display: block; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.food-veg, .food-nonveg, .food-egg { width: 14px; height: 14px; border: 1.5px solid; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; flex-shrink: 0; }
.food-veg { border-color: #16a34a; } .food-veg::after { content: ''; width: 6px; height: 6px; background: #16a34a; border-radius: 50%; }
.food-nonveg { border-color: #b91c1c; } .food-nonveg::after { content: ''; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid #b91c1c; }
.food-egg { border-color: #ca8a04; } .food-egg::after { content: ''; width: 6px; height: 6px; background: #ca8a04; border-radius: 50%; }
.progress-thin { height: 6px; border-radius: 99px; }
.key-box { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 1.1rem; letter-spacing: 1px; background: var(--surface-2); border: 1px dashed var(--brand); border-radius: 10px; padding: 8px 12px; }
.table { --bs-table-bg: transparent; color: var(--text); }
.table > :not(caption) > * > * { border-bottom-color: var(--border); padding: .65rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(79, 70, 229, .04); }
div.dt-container .dt-search input { border-radius: 10px; }
div.dt-container div.dt-layout-row { margin: .5rem 0; }
.dt-buttons .btn { border-radius: 8px !important; margin-right: 4px; }
.select2-container--bootstrap-5 .select2-selection { border-radius: 10px; border-color: var(--border); }
.nav-pills .nav-link.active { background: var(--brand); }
.nav-pills .nav-link { color: var(--muted); font-weight: 500; border-radius: 10px; }
.nav-tabs .nav-link.active { color: var(--brand); font-weight: 600; }
.announcement { border-left: 4px solid var(--info); }
.swal2-popup { border-radius: 18px !important; font-family: var(--bs-body-font-family) !important; }
.swal2-confirm { background: var(--brand) !important; }
#toast-container > div { border-radius: 12px; opacity: .97; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; }
.cursor-pointer { cursor: pointer; }
.color-swatch { width: 38px; padding: 2px; }

/* ================= Auth ================= */
.auth-body { background: var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; }
.auth-side { flex: 0 0 44%; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(168, 85, 247, .55), transparent 45%), radial-gradient(circle at 80% 80%, rgba(236, 72, 153, .45), transparent 45%), linear-gradient(135deg, #312e81, #4f46e5); }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-card .btn-lg { padding: .75rem; }
.app-footer { border-top: 1px solid var(--bs-border-color, #e5e7eb); background: var(--bs-tertiary-bg, #f8f9fa); position: relative; }
.app-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #b91c1c, #ef4444 40%, #f59e0b 100%); }
.app-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 24px; }
.app-footer-brand { display: flex; align-items: center; gap: 10px; }
.app-footer-mark { width: 26px; height: 26px; flex-shrink: 0; }
.app-footer-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.app-footer-name { font-weight: 800; letter-spacing: .04em; font-size: .95rem; color: var(--bs-emphasis-color, #1f2937); }
.app-footer-tagline { font-size: .72rem; color: var(--bs-secondary-color, #6b7280); }
.app-footer-links { display: flex; align-items: center; gap: 18px; font-size: .82rem; }
.app-footer-links a { color: var(--bs-secondary-color, #6b7280); text-decoration: none; font-weight: 500; position: relative; }
.app-footer-links a:hover { color: #dc2626; }
.app-footer-credit { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .75rem; color: var(--bs-secondary-color, #6b7280); text-align: right; }
.app-footer-heart i { color: #dc2626; font-size: .7rem; margin: 0 2px; }
.app-footer-heart a { color: inherit; font-weight: 600; text-decoration: none; }
.app-footer-heart a:hover { color: #dc2626; text-decoration: underline; }
.app-footer-auth-wrap { width: 100%; max-width: 420px; margin-top: 24px; border-radius: 14px; overflow: hidden; }
.app-footer-auth-wrap .app-footer-inner { flex-direction: column; align-items: center; text-align: center; padding: 16px 20px; gap: 10px; }
.app-footer-auth-wrap .app-footer-credit { align-items: center; text-align: center; }
@media (max-width: 640px) {
    .app-footer-inner { flex-direction: column; align-items: center; text-align: center; }
    .app-footer-credit { align-items: center; text-align: center; }
}
.plain-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bs-tertiary-bg, #f8f9fa); }
.plain-top { padding: 18px 24px; }
.plain-brand img { display: block; }
.plain-main { flex: 1; display: flex; justify-content: center; padding: 0 16px 40px; }
.plain-card { width: 100%; max-width: 780px; background: var(--bs-body-bg, #fff); border-radius: 16px; padding: 36px 40px; box-shadow: 0 1px 3px rgba(0,0,0,.06); line-height: 1.7; }
.plain-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.plain-card h2 { font-size: 1.1rem; font-weight: 700; margin-top: 28px; margin-bottom: 10px; }
.plain-card ul { padding-left: 1.2rem; }
.plain-card li { margin-bottom: 6px; }
.demo-logins button { font-size: .75rem; }

/* ================= POS shell ================= */
.pos-body { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.pos-top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; flex-shrink: 0; }
.pos-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; }
.pos-nav { display: flex; gap: 4px; }
.pos-nav a { color: rgba(255, 255, 255, .75); padding: 6px 12px; border-radius: 9px; font-size: .88rem; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.pos-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pos-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.pos-clock { font-variant-numeric: tabular-nums; opacity: .8; font-size: .85rem; }
.net-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.net-dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .3); }
.pos-top .form-select { background-color: rgba(255, 255, 255, .12); color: #fff; border-color: transparent; }
.pos-top .form-select option { color: #000; }
.offline-banner { background: #dc2626; color: #fff; text-align: center; padding: 6px; font-weight: 600; font-size: .9rem; }

/* ================= Billing screen ================= */
.pos-wrap { flex: 1; display: flex; min-height: 0; }
.pos-left { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pos-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.type-switch { display: flex; background: var(--surface-2); padding: 3px; border-radius: 12px; border: 1px solid var(--border); overflow-x: auto; max-width: 100%; }
.type-switch button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.type-switch button.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .35); }
.pos-search { position: relative; flex: 1; min-width: 180px; }
.pos-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pos-search input { padding-left: 36px; border-radius: 12px; height: 40px; }
.cat-bar { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--border); scrollbar-width: none; flex-shrink: 0; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: .85rem; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cat-chip .dot { border-radius: 50%; }
.cat-chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.pos-scroll { flex: 1; overflow-y: auto; padding: 12px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 12px 10px; cursor: pointer; user-select: none; transition: transform .08s, box-shadow .15s, border-color .15s; min-height: 96px; display: flex; flex-direction: column; overflow: hidden; }
.item-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--brand)); }
.item-card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c, var(--brand)) 45%, var(--border)); }
.item-card:active { transform: scale(.97); }
.item-card .nm { font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card .pr { margin-top: auto; font-weight: 700; color: var(--brand); font-size: .95rem; display: flex; justify-content: space-between; align-items: center; }
.item-card .code { font-size: .7rem; color: var(--muted); }
.item-card.oos { opacity: .45; pointer-events: none; }
.item-card.oos::after { content: 'Out of stock'; position: absolute; right: 8px; top: 8px; font-size: .65rem; background: var(--bad); color: #fff; padding: 2px 6px; border-radius: 6px; }
.item-card .qty-badge { position: absolute; right: 8px; top: 8px; background: var(--brand); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; font-size: .75rem; display: flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 6px; }
.item-card .var-hint { font-size: .7rem; color: var(--muted); }

.area-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.legend { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); margin-left: auto; flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.table-card { --c: #16a34a; position: relative; border-radius: 16px; padding: 12px; min-height: 110px; cursor: pointer; background: var(--surface); border: 2px solid color-mix(in srgb, var(--c) 35%, var(--border)); display: flex; flex-direction: column; transition: transform .08s, box-shadow .15s; user-select: none; }
.table-card:hover { box-shadow: var(--shadow); }
.table-card:active { transform: scale(.97); }
.table-card .tn { font-size: 1.25rem; font-weight: 800; }
.table-card .meta { font-size: .75rem; color: var(--muted); }
.table-card .amt { margin-top: auto; font-weight: 700; }
.table-card .status-strip { position: absolute; inset: 0 0 auto 0; height: 5px; border-radius: 14px 14px 0 0; background: var(--c); }
.table-card.running { --c: #f97316; background: color-mix(in srgb, #f97316 7%, var(--surface)); }
.table-card.billed { --c: #2563eb; background: color-mix(in srgb, #2563eb 7%, var(--surface)); }
.table-card.reserved { --c: #94a3b8; }
.table-card .bell { position: absolute; right: 10px; top: 10px; color: #dc2626; animation: ring 1s infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(15deg); } 75% { transform: rotate(-15deg); } }

.pos-cart { width: 400px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cart-head .title { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.cart-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cart-meta .btn { font-size: .78rem; padding: 4px 10px; border-radius: 999px; }
.cart-lines { flex: 1; overflow-y: auto; padding: 4px 0; }
.cart-line { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .nm { font-weight: 600; font-size: .9rem; }
.cart-line .sub { font-size: .75rem; color: var(--muted); }
.cart-line .note { font-size: .75rem; color: #b45309; }
.cart-line .amt { font-weight: 700; font-size: .9rem; white-space: nowrap; text-align: right; }
.cart-line.sent { background: color-mix(in srgb, var(--ok) 5%, transparent); }
.cart-line .kot-tag { font-size: .65rem; background: #dcfce7; color: #166534; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.qty-ctl button { border: 0; background: var(--surface-2); width: 30px; height: 28px; font-weight: 700; color: var(--text); }
.qty-ctl button:hover { background: var(--brand-50); color: var(--brand); }
.qty-ctl span { min-width: 34px; text-align: center; font-weight: 700; font-size: .85rem; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.cart-empty i { font-size: 3rem; opacity: .3; }
.cart-totals { padding: 10px 14px; border-top: 1px solid var(--border); font-size: .88rem; background: var(--surface-2); }
.cart-totals .row-t { display: flex; justify-content: space-between; padding: 2px 0; }
.cart-totals .grand { font-size: 1.35rem; font-weight: 800; padding-top: 6px; margin-top: 4px; border-top: 1px dashed var(--border); }
.cart-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 14px 14px; }
.cart-actions .btn { padding: 10px 4px; font-size: .82rem; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 12px; }
.cart-actions .btn i { font-size: 1.1rem; }
.cart-actions .btn small { font-size: .62rem; opacity: .7; font-weight: 500; }
.cart-actions .span-2 { grid-column: span 2; }
.btn-pay { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; border: 0; }
.btn-pay:hover { color: #fff; filter: brightness(1.05); }
.cart-fab { display: none; }

@media (max-width: 991.98px) {
    .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 88dvh; z-index: 1045; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .3); transform: translateY(105%); transition: transform .28s ease; border-left: 0; }
    body.cart-open .pos-cart { transform: none; }
    body.cart-open::after { content: ''; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1044; }
    .cart-fab { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1040; background: var(--brand); color: #fff; border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 700; align-items: center; justify-content: space-between; box-shadow: 0 12px 30px rgba(79, 70, 229, .45); }
    .pos-scroll { padding-bottom: 90px; }
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
    .cart-close { display: inline-flex !important; }
}
.cart-close { display: none !important; }

/* Payment modal */
.pay-total { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }
.pay-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-modes button { border: 2px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 6px; font-weight: 600; font-size: .85rem; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); }
.pay-modes button i { font-size: 1.3rem; }
.pay-modes button.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.pay-line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-cash button { border-radius: 999px; }
.change-box { background: #dcfce7; color: #166534; border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.due-box { background: #fee2e2; color: #991b1b; border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.opt-list label { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; cursor: pointer; }
.opt-list input:checked + span { color: var(--brand); font-weight: 700; }
.opt-list label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.running-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.running-item:hover { border-color: var(--brand); }

/* ================= Waiter (mobile) ================= */
.w-wrap { flex: 1; overflow-y: auto; padding: 12px 12px 100px; }
.w-item { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; }
.w-item .nm { font-weight: 600; }
.w-item .pr { color: var(--brand); font-weight: 700; font-size: .9rem; }
.w-add { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--brand-50); color: var(--brand); font-size: 1.3rem; font-weight: 700; flex-shrink: 0; }
.w-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 8px; z-index: 1030; box-shadow: 0 -8px 24px rgba(0, 0, 0, .06); }
.w-bar .btn { flex: 1; padding: 12px; font-weight: 700; border-radius: 14px; }
.w-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.w-head .tn { font-size: 1.4rem; font-weight: 800; }

/* ================= KDS ================= */
.kds-body { background: #0b1120; color: #e5e7eb; }
.kds-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; flex-wrap: wrap; background: #111827; border-bottom: 1px solid #1f2937; }
.kds-count { font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: .85rem; }
.kds-grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-content: start; grid-auto-rows: max-content; }
.kot { background: #111827; border: 1px solid #1f2937; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: pop .3s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.kot-head { padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.kot-head .t { font-size: 1.3rem; font-weight: 800; }
.kot-head .age { font-variant-numeric: tabular-nums; font-weight: 700; background: rgba(0, 0, 0, .25); padding: 2px 10px; border-radius: 999px; }
.kot.g .kot-head { background: #15803d; }
.kot.o .kot-head { background: #d97706; }
.kot.r .kot-head { background: #b91c1c; }
.kot.ready { outline: 3px solid #22c55e; }
.kot.cancel .kot-head { background: repeating-linear-gradient(45deg, #7f1d1d, #7f1d1d 10px, #991b1b 10px, #991b1b 20px); }
.kot-sub { padding: 6px 14px; font-size: .78rem; color: #94a3b8; border-bottom: 1px dashed #1f2937; }
.kot-items { padding: 8px 14px; flex: 1; }
.kot-items .li { display: flex; gap: 10px; padding: 5px 0; font-size: 1.02rem; }
.kot-items .q { font-weight: 800; min-width: 34px; color: #fbbf24; }
.kot-items .ad { font-size: .78rem; color: #a5b4fc; }
.kot-items .nt { font-size: .8rem; color: #fca5a5; font-style: italic; }
.kot-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid #1f2937; }
.kot-actions .btn { flex: 1; font-weight: 700; padding: 10px; }
.kds-body .empty { color: #64748b; grid-column: 1 / -1; }

/* ================= Print ================= */
@media print {
    .sidebar, .topbar, .no-print, .dt-buttons, .dt-search, .dt-length, .dt-paging { display: none !important; }
    .main { margin: 0; }
    .card { box-shadow: none; border: 0; }
}
