:root {
  --brand: #e4572e;
  --brand-dark: #b8401d;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f6f8;
  --veg: #198754;
  --nonveg: #b02a37;
  --egg: #d4a106;
  --sidebar: #1f2430;
}
body { background: var(--bg); color: var(--ink); }
a { color: var(--brand-dark); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.text-brand { color: var(--brand) !important; }

/* ---------- back-office shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: 232px; background: var(--sidebar); color: #cfd3dc; flex-shrink: 0; }
.app-sidebar .brand { color: #fff; font-weight: 700; font-size: 1.2rem; padding: 1rem 1.25rem; display: block; text-decoration: none; }
.app-sidebar .brand span { color: var(--brand); }
.app-sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8a90a0; padding: .9rem 1.25rem .3rem; }
.app-sidebar a.nav-link { color: #cfd3dc; padding: .45rem 1.25rem; border-left: 3px solid transparent; }
.app-sidebar a.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.app-sidebar a.nav-link.active { color: #fff; border-left-color: var(--brand); background: rgba(255,255,255,.08); }
.app-sidebar a.nav-link i { width: 1.4rem; display: inline-block; }
.app-main { flex: 1; min-width: 0; }
.app-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1.25rem; display: flex; align-items: center; gap: .75rem; }
.app-content { padding: 1.25rem; }
@media (max-width: 991px) {
  .app-sidebar { position: fixed; z-index: 1040; height: 100vh; overflow-y: auto; transform: translateX(-100%); transition: transform .2s; }
  .app-sidebar.open { transform: none; }
}
.card { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.stat-card .value { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: .85rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0; }

/* ---------- veg / non-veg marks ---------- */
.ft { display: inline-block; width: 12px; height: 12px; border: 1.5px solid; position: relative; vertical-align: -1px; border-radius: 2px; }
.ft::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; top: 1.5px; left: 1.5px; }
.ft-veg { border-color: var(--veg); } .ft-veg::after { background: var(--veg); }
.ft-nonveg { border-color: var(--nonveg); } .ft-nonveg::after { background: var(--nonveg); }
.ft-egg { border-color: var(--egg); } .ft-egg::after { background: var(--egg); }

/* ---------- full-screen POS ---------- */
.pos-body { height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: #eef0f3; }
.pos-top { background: var(--sidebar); color: #fff; padding: .4rem .75rem; display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.pos-top a, .pos-top .btn-link { color: #fff; }
.pos-grid { flex: 1; display: grid; grid-template-columns: 170px 1fr 400px; min-height: 0; }
.pos-cats { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.pos-cats button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .65rem .8rem; border-left: 3px solid transparent; font-size: .92rem; }
.pos-cats button.active { background: #fff3ee; border-left-color: var(--brand); font-weight: 600; }
.pos-items { overflow-y: auto; padding: .6rem; }
.pos-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.pos-item { background: #fff; border: 1px solid var(--line); border-radius: .5rem; padding: .55rem .6rem; text-align: left; min-height: 74px; cursor: pointer; position: relative; }
.pos-item:hover { border-color: var(--brand); }
.pos-item .nm { font-size: .88rem; font-weight: 600; line-height: 1.2; }
.pos-item .pr { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.pos-item.off { opacity: .45; cursor: not-allowed; }
.pos-item .code { position: absolute; right: .4rem; top: .35rem; font-size: .68rem; color: var(--muted); }
.pos-cart { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pos-cart .cart-lines { flex: 1; overflow-y: auto; }
.cart-line { padding: .45rem .7rem; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.cart-line.sent { background: #f7faf7; }
.cart-line .qty-btn { width: 26px; height: 26px; padding: 0; line-height: 1; }
.cart-line .sub { font-size: .76rem; color: var(--muted); }
.pos-cart .totals { border-top: 1px solid var(--line); padding: .5rem .7rem; font-size: .9rem; }
.pos-cart .actions { padding: .5rem; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; border-top: 1px solid var(--line); }
.pos-cart .actions .btn { font-weight: 600; padding: .6rem .2rem; }
@media (max-width: 1100px) { .pos-grid { grid-template-columns: 130px 1fr 340px; } }
@media (max-width: 760px) {
  .pos-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .pos-cats { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .pos-cats button { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; width: auto; }
  .pos-cats button.active { border-bottom-color: var(--brand); }
  .pos-cart { max-height: 45vh; border-left: 0; border-top: 1px solid var(--line); }
}

/* tables floor view */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.floor-table { border-radius: .6rem; padding: .7rem; text-align: center; border: 2px solid var(--line); background: #fff; cursor: pointer; min-height: 84px; }
.floor-table .tn { font-weight: 700; font-size: 1.1rem; }
.floor-table .ts { font-size: .75rem; }
.floor-table.free { border-color: #cfe8d6; }
.floor-table.running { border-color: #f0b49f; background: #fff3ee; }
.floor-table.billed { border-color: #9fc3f0; background: #eef5ff; }
.floor-table.qr { box-shadow: 0 0 0 3px #ffc107; }

/* kitchen display */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; padding: .75rem; overflow-y: auto; }
.kds-card { background: #fff; border-radius: .5rem; border-top: 6px solid #6c757d; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.kds-card.new { border-top-color: var(--brand); }
.kds-card.preparing { border-top-color: #f0ad4e; }
.kds-card.ready { border-top-color: #198754; }
.kds-card.cancel { border-top-color: #000; background: #fff0f0; }
.kds-card .hd { padding: .5rem .7rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.kds-card ul { list-style: none; margin: 0; padding: .5rem .7rem; flex: 1; font-size: 1rem; }
.kds-card li { padding: .2rem 0; }
.kds-card .late { color: #b02a37; font-weight: 700; }

/* public QR menu */
.qr-body { background: #fafafa; padding-bottom: 90px; }
.qr-header { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1rem; position: sticky; top: 0; z-index: 10; }
.qr-cats { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 1rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 9; }
.qr-cats a { white-space: nowrap; text-decoration: none; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .85rem; }
.qr-item { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1rem; display: flex; gap: .75rem; }
.qr-item img { width: 84px; height: 84px; object-fit: cover; border-radius: .5rem; }
.qr-cartbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--brand); color: #fff; padding: .85rem 1rem; display: flex; justify-content: space-between; align-items: center; z-index: 20; }

/* print */
@media print { .no-print { display: none !important; } }
