/* DineFlow theme — warm saffron accent, light aur dark mode */
:root {
  --brand: #f26b1d;
  --brand-600: #d9570c;
  --brand-50: #fff3ea;
  --brand-100: #ffe1cc;
  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #faf8f6;
  --border: #ebe6e0;
  --border-strong: #d9d2c9;
  --text: #1d1915;
  --muted: #7a716a;
  --faint: #a69d95;
  --success: #15935a;
  --success-bg: #e6f6ee;
  --danger: #d63b3b;
  --danger-bg: #fdecec;
  --warning: #c27a07;
  --warning-bg: #fdf3dc;
  --info: #2f6fdb;
  --info-bg: #e8f0fd;
  --violet: #7a4fd6;
  --violet-bg: #f1ebfd;
  --sidebar: #1b1612;
  --sidebar-text: #b9aea4;
  --sidebar-active: #2b231d;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 25, 21, .04), 0 4px 16px rgba(29, 25, 21, .05);
  --shadow-lg: 0 20px 50px rgba(29, 25, 21, .18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f0c0a;
  --surface: #191512;
  --surface-2: #1f1a16;
  --border: #2c2520;
  --border-strong: #3d342d;
  --text: #f4efea;
  --muted: #a3988f;
  --faint: #7b7067;
  --brand-50: #2c1a0e;
  --brand-100: #4a2810;
  --success-bg: #0f2a1d;
  --danger-bg: #331414;
  --warning-bg: #33250b;
  --info-bg: #13223d;
  --violet-bg: #231a3a;
  --sidebar: #120e0b;
  --sidebar-active: #241d18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
::selection { background: var(--brand-100); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px;
  transition: width .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; padding: 4px 8px 20px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-text); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 21px; flex-shrink: 0;
}
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f645b; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--sidebar-text); font-weight: 500; transition: background .15s, color .15s;
}
.nav a i { font-size: 19px; }
.nav a:hover { background: var(--sidebar-active); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a .count { margin-left: auto; background: rgba(255, 255, 255, .12); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 20px; }
.nav a.active .count { background: rgba(255, 255, 255, .25); }
.sidebar-foot { border-top: 1px solid #2b231d; padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; color: #fff; }
.user-chip small { display: block; color: var(--sidebar-text); font-size: 11px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 13px;
}
.sidebar .avatar { background: #3a2c22; color: #ffb27d; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.clock { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; position: relative; font-size: 19px;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.menu-toggle { display: none; }
.sidebar-toggle { display: flex; align-items: center; justify-content: center; gap: 0; flex: 0 0 38px; }
.sidebar-toggle > i:first-child { font-size: 18px; }
.sidebar-toggle-arrow { font-size: 13px; margin-left: -5px; }
.content { padding: 24px; flex: 1; }
.content.flush { padding: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn i { font-size: 18px; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--surface); }
.btn-dark:hover { background: var(--text); opacity: .9; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(.95); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-soft { background: var(--brand-50); border-color: transparent; color: var(--brand); }
.btn-soft:hover { background: var(--brand-100); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-sm i { font-size: 16px; }
.btn-lg { height: 50px; font-size: 15px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

.stat { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.stat .chip { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.stat .delta { font-size: 12px; font-weight: 600; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; }
.up { color: var(--success); }
.down { color: var(--danger); }
.c-brand { background: var(--brand-50); color: var(--brand); }
.c-success { background: var(--success-bg); color: var(--success); }
.c-info { background: var(--info-bg); color: var(--info); }
.c-violet { background: var(--violet-bg); color: var(--violet); }
.c-warning { background: var(--warning-bg); color: var(--warning); }
.c-danger { background: var(--danger-bg); color: var(--danger); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge i { font-size: 13px; }
.b-gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.b-brand { background: var(--brand-50); color: var(--brand); }
.b-success { background: var(--success-bg); color: var(--success); }
.b-danger { background: var(--danger-bg); color: var(--danger); }
.b-warning { background: var(--warning-bg); color: var(--warning); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-violet { background: var(--violet-bg); color: var(--violet); }
.veg-dot { width: 14px; height: 14px; border: 1.5px solid var(--success); border-radius: 3px; display: inline-grid; place-items: center; flex-shrink: 0; }
.veg-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.veg-dot.non { border-color: var(--danger); }
.veg-dot.non::after { background: var(--danger); border-radius: 0; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid var(--danger); background: none; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=tel], input[type=date], input[type=month], input[type=email], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0 12px; height: 40px; width: 100%; outline: none; transition: border .15s, box-shadow .15s;
}
textarea { padding: 10px 12px; height: auto; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 18px; pointer-events: none; }
.input-icon input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* Segmented / chips */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button, .seg a {
  border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted);
  padding: 6px 13px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; font-size: 13px;
  color: var(--muted); padding: 7px 14px; border-radius: 30px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip-btn.on { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Alerts, empty, toast */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.alert i { font-size: 19px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 46px; color: var(--faint); }
.empty-state h2 { color: var(--text); margin: 10px 0 4px; }
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; font-weight: 500; min-width: 260px; max-width: 380px; animation: toastIn .25s ease;
}
.toast i { font-size: 20px; }
.toast.success i { color: #4ade80; }
.toast.error i { color: #f87171; }
.toast.info i { color: #fdba74; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 15, 10, .5); backdrop-filter: blur(3px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* Auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero {
  background: var(--sidebar); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--brand);
  opacity: .16; right: -160px; top: -140px;
}
.auth-hero::after {
  content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; border: 60px solid var(--brand);
  opacity: .1; left: -120px; bottom: -120px;
}
.auth-hero h1 { font-size: 40px; line-height: 1.15; max-width: 460px; position: relative; z-index: 1; }
.auth-hero h1 span { color: #ff9a57; }
.auth-hero p { color: var(--sidebar-text); max-width: 420px; font-size: 15px; position: relative; z-index: 1; }
.hero-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; position: relative; z-index: 1; }
.hero-feats div { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); padding: 12px; border-radius: 12px; font-weight: 500; }
.hero-feats i { color: #ff9a57; font-size: 20px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 6px 0 4px; }
.brand-lg { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; margin-bottom: 18px; }
.demo-logins { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px; margin: 16px 0; }
.demo-logins button { all: unset; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.demo-logins button:hover { background: var(--brand-50); }

/* POS */
.pos { display: grid; grid-template-columns: 200px minmax(0, 1fr) 380px; height: calc(100vh - 64px); }
.pos-cats { border-right: 1px solid var(--border); background: var(--surface); padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cat-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 0; background: transparent;
  font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left;
}
.cat-btn i { font-size: 20px; }
.cat-btn .n { margin-left: auto; font-size: 11px; color: var(--faint); }
.cat-btn:hover { background: var(--surface-2); color: var(--text); }
.cat-btn.on { background: var(--brand-50); color: var(--brand); }
.cat-btn.on .n { color: var(--brand); }
.pos-menu { display: flex; flex-direction: column; min-width: 0; }
.pos-toolbar { padding: 14px 18px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.pos-toolbar .input-icon { flex: 1; min-width: 200px; }
.pos-items { padding: 16px 18px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; align-content: start; flex: 1; }
.item-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; position: relative;
  transition: transform .12s, border-color .12s, box-shadow .12s; min-height: 118px;
}
.item-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(242, 107, 29, .12); transform: translateY(-1px); }
.item-card:active { transform: scale(.97); }
.item-card .top { display: flex; justify-content: space-between; align-items: center; }
.item-card .code { font-size: 11px; color: var(--faint); font-weight: 600; }
.item-card .name { font-weight: 600; line-height: 1.3; flex: 1; }
.item-card .price { font-weight: 700; font-size: 15px; }
.item-card .in-cart { position: absolute; top: -7px; right: -7px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; padding: 0 6px; border: 2px solid var(--bg); }
.item-card.off { opacity: .45; cursor: not-allowed; }
.item-card.off:hover { transform: none; border-color: var(--border); box-shadow: none; }
.best-tag { font-size: 10.5px; font-weight: 700; color: var(--warning); display: inline-flex; align-items: center; gap: 2px; }
.pos-cart { border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-lines { flex: 1; overflow-y: auto; padding: 6px 16px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.cart-line .nm { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.cart-line .sub { font-size: 12px; color: var(--muted); }
.cart-line .note-btn { border: 0; background: none; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.cart-line .note-btn:hover { color: var(--brand); }
.cart-line.sent { opacity: .9; }
.cart-line .amt { font-weight: 700; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.qty button { width: 28px; height: 28px; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.qty button:hover { background: var(--brand-50); color: var(--brand); }
.qty span { min-width: 28px; text-align: center; font-weight: 700; font-size: 13px; }
.cart-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 12px 0 2px; display: flex; justify-content: space-between; }
.cart-foot { border-top: 1px solid var(--border); padding: 14px 16px; background: var(--surface-2); }
.sum-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-row.total { color: var(--text); font-size: 20px; font-weight: 700; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--border-strong); }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cart-actions .wide { grid-column: 1 / -1; }
.table-pick { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--surface-2); }
.table-pick:hover { border-color: var(--brand); }
.table-pick .tname { font-weight: 700; font-size: 16px; }
.kbd { font-size: 11px; font-weight: 600; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface); }

/* Floor / tables */
.area-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-weight: 700; }
.area-title:first-child { margin-top: 0; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ttile {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px; min-height: 128px;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer; position: relative; transition: transform .12s, box-shadow .12s; color: inherit;
}
.ttile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ttile .tn { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ttile .seats { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.ttile .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }
.ttile.free { border-style: dashed; }
.ttile.free .state { color: var(--success); }
.ttile.busy { border-color: var(--brand); background: var(--brand-50); }
.ttile.busy .state { color: var(--brand); }
.ttile.ready { border-color: var(--success); background: var(--success-bg); }
.ttile.ready .state { color: var(--success); }
.ttile .help { position: absolute; top: 10px; right: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* KDS */
.kds-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop .25s ease; }
.ticket-head { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket-head .t { font-size: 18px; font-weight: 700; }
.ticket-head .meta { font-size: 12px; opacity: .85; font-weight: 500; }
.ticket-head .timer { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.ticket.fresh .ticket-head { background: var(--success-bg); color: var(--success); }
.ticket.warn .ticket-head { background: var(--warning-bg); color: var(--warning); }
.ticket.late { border-color: var(--danger); }
.ticket.late .ticket-head { background: var(--danger); color: #fff; }
.ticket-items { padding: 6px 14px; }
.titem { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--border); cursor: pointer; }
.titem:last-child { border-bottom: 0; }
.titem .q { font-weight: 800; font-size: 16px; min-width: 30px; }
.titem .n { flex: 1; font-weight: 600; font-size: 15px; }
.titem .note { display: block; font-size: 12px; color: var(--danger); font-weight: 600; }
.titem.preparing .n::after { content: ' • ban raha hai'; font-size: 11px; color: var(--warning); font-weight: 700; }
.titem.ready .n { text-decoration: line-through; color: var(--muted); }
.titem.ready .q { color: var(--success); }
.ticket-foot { padding: 10px 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Dashboard */
.chart-box { position: relative; height: 280px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.insight { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.insight:last-child { border-bottom: 0; }
.insight .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.insight b { display: block; font-weight: 600; }
.insight span { font-size: 13px; color: var(--muted); }
.ai-card { background: var(--sidebar); color: #fff; border: 0; }
.ai-card .card-head { border-color: #2b231d; }
.ai-card .insight { border-color: #2b231d; }
.ai-card .insight span { color: var(--sidebar-text); }
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.welcome h1 { font-size: 26px; }

/* Receipt */
.receipt { width: 80mm; max-width: 100%; margin: 0 auto; background: #fff; color: #000; padding: 16px; font-family: 'Courier New', monospace; font-size: 12.5px; }
.receipt .c { text-align: center; }
.receipt h2 { font-family: var(--font); font-size: 18px; margin: 0; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt .r { text-align: right; }
.receipt .big { font-size: 16px; font-weight: 700; }
.receipt #upiqr { display: flex; justify-content: center; margin: 8px 0; }

/* Customer QR menu (mobile) */
.cm { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 110px; }
.cm-hero { background: var(--sidebar); color: #fff; padding: 22px 18px 26px; border-radius: 0 0 26px 26px; position: relative; overflow: hidden; }
.cm-hero::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: var(--brand); opacity: .22; right: -70px; top: -90px; }
.cm-hero h1 { font-size: 24px; position: relative; z-index: 1; }
.cm-hero p { margin: 4px 0 0; color: var(--sidebar-text); position: relative; z-index: 1; }
.cm-table { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; padding: 5px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; margin-top: 14px; position: relative; z-index: 1; }
.cm-search { margin: -20px 16px 0; position: relative; z-index: 2; }
.cm-search input { height: 48px; border-radius: 14px; box-shadow: var(--shadow); border-color: var(--border); }
.cm-cats { display: flex; gap: 8px; overflow-x: auto; padding: 16px; scrollbar-width: none; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.cm-cats::-webkit-scrollbar { display: none; }
.cm-cats .chip-btn { flex-shrink: 0; }
.cm-section { padding: 0 16px; }
.cm-section h2 { margin: 10px 0 10px; font-size: 17px; }
.cm-item { display: flex; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 10px; }
.cm-item .info { flex: 1; min-width: 0; }
.cm-item .nm { font-weight: 700; margin: 4px 0 2px; }
.cm-item .ds { font-size: 12.5px; color: var(--muted); }
.cm-item .pr { font-weight: 700; margin-top: 6px; }
.cm-thumb { width: 84px; height: 84px; border-radius: 14px; display: grid; place-items: center; font-size: 34px; flex-shrink: 0; position: relative; }
.cm-add { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); }
.cm-add .btn { height: 30px; padding: 0 14px; font-size: 12px; box-shadow: var(--shadow); background: var(--surface); color: var(--brand); border-color: var(--brand); }
.cm-add .qty { background: var(--surface); border-color: var(--brand); }
.cm-cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: calc(100% - 32px); max-width: 488px; z-index: 30; }
.cm-cartbar .btn { width: 100%; height: 58px; border-radius: 16px; justify-content: space-between; box-shadow: var(--shadow-lg); font-size: 15px; }
.cm-upsell { background: var(--brand-50); color: var(--brand); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }

/* Zomato / Swiggy */
.plat { width: 22px; height: 22px; border-radius: 7px; background: var(--pc); color: #fff; font-weight: 800; font-size: 12px; display: inline-grid; place-items: center; flex-shrink: 0; }
.plat.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 21px; }
.plat-chip { background: color-mix(in srgb, var(--pc) 12%, transparent); color: var(--pc); }
.online-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 12px; min-height: 220px; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; font-weight: 700; }
.lane-head .badge { font-size: 12px; }
.ocard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; animation: pop .25s ease; }
.ocard.new { border: 1.5px solid var(--pc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 14%, transparent); }
.ocard-top { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px dashed var(--border); }
.ocard-top .grow { flex: 1; min-width: 0; }
.ocard-top .oid { font-weight: 700; }
.ocard-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.ocard-body .li { display: flex; gap: 8px; }
.ocard-body .li b { min-width: 24px; }
.ocard-foot { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.countdown { font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown.urgent { color: var(--danger); animation: pulse 1s infinite; }
.prep-pick { display: flex; gap: 6px; }
.prep-pick button { flex: 1; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 0; font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; }
.prep-pick button.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.rider { display: flex; gap: 8px; align-items: center; background: var(--info-bg); color: var(--info); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 24px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::before { transform: translateX(20px); }
@media (max-width: 1100px) { .online-board { grid-template-columns: 1fr; } }

/* Compact sidebar (POS aur kitchen par zyada jagah) */
@media (min-width: 961px) {
  .app.compact .sidebar { width: 76px; padding: 18px 10px; }
  .app.compact .brand { padding: 4px 0 18px; justify-content: center; }
  .app.compact .brand > div, .app.compact .nav-label, .app.compact .nav .lbl, .app.compact .user-chip > div, .app.compact .user-chip > a { display: none; }
  .app.compact .nav a { justify-content: center; padding: 11px 0; position: relative; }
  .app.compact .nav a .count { position: absolute; top: 3px; right: 4px; padding: 0 5px; font-size: 10px; background: var(--brand); }
  .app.compact .nav a.active .count { background: #fff; color: var(--brand); }
  .app.compact .user-chip { justify-content: center; }
}
.pos-mbar { display: none; }

/* Responsive */
@media (max-width: 1200px) {
  .pos { grid-template-columns: 76px minmax(0, 1fr) 340px; }
  .cat-btn { flex-direction: column; gap: 3px; font-size: 10.5px; text-align: center; padding: 10px 4px; }
  .cat-btn .n { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: -260px; z-index: 60; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: grid; }
  .grid-main, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-cats { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .cat-btn { flex-direction: row; font-size: 13px; flex-shrink: 0; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--border); padding-bottom: 80px; }
  .pos-mbar { display: block; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; }
  .pos-mbar .btn { width: 100%; height: 54px; justify-content: space-between; border-radius: 14px; box-shadow: var(--shadow-lg); }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; z-index: 61; }
  .clock { display: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stat .value { font-size: 21px; }
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .receipt { padding: 0; width: 100%; }
}
