:root {
  --brand: #e03131; --brand-d: #c92a2a; --brand-l: #fff0f0;
  --side: #1d2433; --side-l: #2a3346; --ink: #212529; --bg: #f3f4f7;
  --bs-primary: #e03131; --bs-primary-rgb: 224,49,49; --bs-link-color: #c92a2a; --bs-link-hover-color: #a51111;
}
body { background: var(--bg); font-size: 14px; color: var(--ink); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-d); --bs-btn-hover-border-color: var(--brand-d); --bs-btn-active-bg: #b02525; --bs-btn-disabled-bg: #e77; --bs-btn-disabled-border-color: #e77; }
.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-d); }
.text-bg-primary { background: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: #f08c8c; box-shadow: 0 0 0 .2rem rgba(224,49,49,.15); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
a { text-decoration: none; }

/* ------------- app shell */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; background: var(--side); color: #c9d1e1; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 16px 18px; color: #fff; font-weight: 700; font-size: 17px; border-bottom: 1px solid #2f3a50; }
.sidebar .brand img { height: 30px; width: auto; max-width: 110px; object-fit: contain; }
.sidebar .nav { padding: 8px 10px 30px; }
.sidebar .nav-link { color: #c9d1e1; padding: 8px 12px; border-radius: 8px; display: flex; gap: 10px; align-items: center; margin-bottom: 2px; }
.sidebar .nav-link i { font-size: 16px; width: 18px; }
.sidebar .nav-link:hover { background: var(--side-l); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.sidebar .nav-pos { background: rgba(255,255,255,.08); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7d8aa5; padding: 14px 12px 4px; }
.layout-app .main { margin-left: 230px; min-height: 100vh; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid #e6e8ee; display: flex; align-items: center; padding: 0 16px; position: sticky; top: 0; z-index: 1030; gap: 6px; }
.brand-mini { color: var(--ink); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.brand-mini img { height: 24px; width: auto; max-width: 90px; object-fit: contain; }
.content { padding: 18px; }
.trial-bar { background: #fff3bf; color: #5c3c00; padding: 6px 18px; font-size: 13px; }
.trial-bar a { font-weight: 600; margin-left: 6px; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  body.sb-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .layout-app .main { margin-left: 0; }
  .content { padding: 12px; }
}
.card { border: 1px solid #e6e8ee; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #eef0f4; }
.table > :not(caption) > * > * { padding: .5rem .6rem; }
.table thead th { font-size: 12px; text-transform: uppercase; color: #6b7280; font-weight: 600; background: #fafbfc; }
.stat { padding: 16px; }
.stat .lbl { color: #6b7280; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .val { font-size: 24px; font-weight: 700; }
.stat i { font-size: 26px; opacity: .25; float: right; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subnav a { padding: 6px 12px; border-radius: 20px; background: #fff; border: 1px solid #e3e6ec; color: #444; }
.subnav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.fdot { display: inline-block; width: 12px; height: 12px; border: 1.5px solid; position: relative; vertical-align: -1px; border-radius: 2px; }
.fdot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; }
.fdot-veg { border-color: #2b8a3e; } .fdot-veg::after { background: #2b8a3e; }
.fdot-nonveg { border-color: #a61e4d; } .fdot-nonveg::after { background: #a61e4d; }
.fdot-egg { border-color: #e67700; } .fdot-egg::after { background: #e67700; }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 3px; }

/* ------------- guest */
.guest-wrap { display: flex; min-height: 100vh; }
.guest-side { flex: 1; background: linear-gradient(140deg, #c92a2a, #7a1f1f 70%, #1d2433); color: #fff; align-items: center; padding: 60px; }
.guest-side i { color: #ffc9c9; margin-right: 6px; }
.guest-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; background: #fff; }
.guest-card { width: 100%; max-width: 440px; }

/* ------------- POS */
.layout-full .main { height: 100vh; display: flex; flex-direction: column; }
.layout-full main { flex: 1; min-height: 0; }
.pos { display: grid; grid-template-columns: 170px 1fr 400px; height: 100%; }
.pos-cats { background: #fff; border-right: 1px solid #e6e8ee; overflow-y: auto; }
.pos-cats button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; border-left: 4px solid transparent; font-weight: 500; border-bottom: 1px solid #f1f2f5; }
.pos-cats button.active { background: var(--brand-l); border-left-color: var(--brand); color: var(--brand-d); }
.pos-menu { display: flex; flex-direction: column; min-width: 0; }
.pos-tools { padding: 10px; display: flex; gap: 8px; background: #fff; border-bottom: 1px solid #e6e8ee; }
.pos-items { flex: 1; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; align-content: start; }
.pos-item { background: #fff; border: 1px solid #e3e6ec; border-left: 4px solid var(--c, #adb5bd); border-radius: 8px; padding: 10px; cursor: pointer; user-select: none; min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; }
.pos-item:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(224,49,49,.12); }
.pos-item:active { transform: scale(.97); }
.pos-item .nm { font-weight: 600; line-height: 1.2; font-size: 13px; }
.pos-item .pr { color: #555; font-size: 12px; }
.pos-item.na { opacity: .4; pointer-events: none; }
.pos-cart { background: #fff; border-left: 1px solid #e6e8ee; display: flex; flex-direction: column; min-height: 0; }
.pos-cart-head { padding: 10px; border-bottom: 1px solid #eef0f4; }
.otype .btn { font-size: 12px; padding: 5px 4px; }
.cart-lines { flex: 1; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr 96px 70px; gap: 6px; align-items: center; padding: 7px 10px; border-bottom: 1px dashed #eceef2; }
.cart-line.sent { background: #f8f9fb; }
.cart-line .nm { font-weight: 500; font-size: 13px; line-height: 1.2; }
.cart-line .sub { font-size: 11px; color: #868e96; }
.qty { display: flex; align-items: center; border: 1px solid #dee2e6; border-radius: 6px; overflow: hidden; }
.qty button { border: 0; background: #f8f9fa; width: 28px; height: 28px; }
.qty input { width: 38px; border: 0; text-align: center; font-weight: 600; }
.cart-tot { border-top: 1px solid #e6e8ee; padding: 8px 10px; font-size: 13px; }
.cart-tot .grand { font-size: 20px; font-weight: 700; }
.cart-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 10px 10px; }
.cart-actions .btn { font-weight: 600; padding: 9px 4px; font-size: 13px; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tbl { border: 2px dashed #ced4da; border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; background: #fff; min-height: 86px; }
.tbl .n { font-weight: 700; font-size: 16px; }
.tbl.busy { border: 2px solid #f59f00; background: #fff9db; }
.tbl.billed { border: 2px solid #2b8a3e; background: #ebfbee; }
.tbl.pending { border: 2px solid #e03131; background: #fff5f5; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(224,49,49,.15); } }
.pay-modes .btn { min-width: 74px; }
@media (max-width: 1100px) { .pos { grid-template-columns: 120px 1fr 340px; } }
@media (max-width: 800px) {
  .pos { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .pos-cats { display: flex; overflow-x: auto; border: 0; }
  .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: 55vh; }
}

/* ------------- KDS */
.kds { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-content: start; overflow-y: auto; height: 100%; }
.kot { background: #fff; border-radius: 10px; border-top: 6px solid #fab005; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.kot.preparing { border-top-color: #1c7ed6; } .kot.ready { border-top-color: #2b8a3e; }
.kot.late { box-shadow: 0 0 0 2px #e03131; }
.kot-h { padding: 8px 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.kot ul { list-style: none; margin: 0; padding: 8px 10px; flex: 1; }
.kot li { padding: 4px 0; border-bottom: 1px dotted #eee; font-size: 15px; }
.kot li.x { text-decoration: line-through; color: #aaa; }
.kot-f { padding: 8px 10px; }

/* ------------- QR menu (public) */
.qr-body { background: #fff; max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: 90px; }
.qr-head { background: linear-gradient(120deg, var(--brand-d), var(--brand)); color: #fff; padding: 18px; }
.qr-cat { position: sticky; top: 0; background: #fff; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px; border-bottom: 1px solid #eee; }
.qr-cat a { white-space: nowrap; padding: 5px 12px; border-radius: 16px; background: #f1f3f5; color: #333; font-size: 13px; }
.qr-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #f1f3f5; gap: 10px; }
.qr-cartbar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto; background: var(--brand); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }

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