/* ==========================================================================
   Anjok POS — light blue professional theme
   ========================================================================== */
:root {
  --brand: #2f7fe0;
  --brand-dark: #1f66c2;
  --brand-soft: #e9f2fd;
  --brand-softer: #f4f8fe;
  --accent: #5fb0f7;
  --ink: #12304f;
  --ink-2: #4b6480;
  --muted: #8299b3;
  --line: #e3ebf5;
  --bg: #f3f7fc;
  --card: #ffffff;
  --navy: #163a5f;
  --rose: #e0677a;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 48, 79, .04), 0 1px 3px rgba(18, 48, 79, .05);
  --shadow: 0 6px 24px rgba(31, 102, 194, .08);

  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-primary: #2f7fe0;
  --bs-primary-rgb: 47, 127, 224;
  --bs-primary-text-emphasis: #1f66c2;
  --bs-primary-bg-subtle: #e9f2fd;
  --bs-primary-border-subtle: #bcd7f7;
  --bs-info-rgb: 95, 176, 247;
  --bs-success-rgb: 31, 168, 133;
  --bs-success: #1fa885;
  --bs-success-bg-subtle: #e3f6f0;
  --bs-success-text-emphasis: #137a60;
  --bs-warning-rgb: 245, 177, 66;
  --bs-warning-bg-subtle: #fdf3e1;
  --bs-warning-text-emphasis: #9a6a12;
  --bs-danger: #e0677a;
  --bs-danger-rgb: 224, 103, 122;
  --bs-danger-bg-subtle: #fcebee;
  --bs-danger-text-emphasis: #b04459;
  --bs-dark-rgb: 22, 58, 95;
  --bs-secondary-rgb: 130, 153, 179;
  --bs-link-color: #1f66c2;
  --bs-link-color-rgb: 31, 102, 194;
  --bs-link-hover-color: #174f97;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 14px;
  --bs-focus-ring-color: rgba(47, 127, 224, .2);
}
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); font-size: .92rem; color: var(--ink); letter-spacing: -.005em; }
h1, h2, h3, h4, h5, h6, .h4, .h5 { font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.min-vw-0, .min-w-0 { min-width: 0; }
code { color: var(--brand-dark); background: var(--brand-soft); padding: .1em .35em; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: -.005em; }
.btn-sm { border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: #9cc3f2; --bs-btn-disabled-border-color: #9cc3f2; box-shadow: 0 4px 14px rgba(47, 127, 224, .25); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #bcd7f7; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); --bs-btn-active-color: #fff; }
.btn-dark { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: #0f2c49; --bs-btn-hover-border-color: #0f2c49; --bs-btn-active-bg: #0f2c49; }
.btn-outline-dark { --bs-btn-color: var(--navy); --bs-btn-border-color: #c9d7e6; --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); --bs-btn-active-border-color: var(--navy); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--brand-softer); --bs-btn-hover-border-color: #cfe0f4; --bs-btn-color: var(--ink); }
.btn-light.border { border-color: var(--line) !important; }
.btn-success { --bs-btn-bg: #1fa885; --bs-btn-border-color: #1fa885; --bs-btn-hover-bg: #178a6c; --bs-btn-hover-border-color: #178a6c; --bs-btn-active-bg: #178a6c; }
.btn-outline-success { --bs-btn-color: #178a6c; --bs-btn-border-color: #a9e2d2; --bs-btn-hover-bg: #1fa885; --bs-btn-hover-border-color: #1fa885; }
.btn-warning { --bs-btn-bg: #fdf0d6; --bs-btn-border-color: #f6d99c; --bs-btn-color: #8a5d0a; --bs-btn-hover-bg: #f9e2b2; --bs-btn-hover-border-color: #f2cc7b; --bs-btn-hover-color: #6f4a05; }
.btn-danger { --bs-btn-bg: var(--rose); --bs-btn-border-color: var(--rose); --bs-btn-hover-bg: #c95368; --bs-btn-hover-border-color: #c95368; }
.btn-outline-danger { --bs-btn-color: #c24e63; --bs-btn-border-color: #f2c4cc; --bs-btn-hover-bg: var(--rose); --bs-btn-hover-border-color: var(--rose); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: #d3dfec; --bs-btn-hover-bg: var(--brand-softer); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #bcd2ea; --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-color: var(--ink); }
.btn-link { font-weight: 500; }
.text-primary { color: var(--brand) !important; }
.text-danger { color: #c24e63 !important; }
.text-success { color: #178a6c !important; }
.bg-primary-subtle { background: var(--brand-soft) !important; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; letter-spacing: .01em; }
.d-flex > .badge { align-self: center; flex-shrink: 0; }
.badge.bg-primary, .text-bg-primary { background: var(--brand-soft) !important; color: var(--brand-dark) !important; }
.badge.bg-success, .text-bg-success { background: #e1f5ee !important; color: #137a60 !important; }
.badge.bg-warning, .text-bg-warning { background: #fdf1d9 !important; color: #8a5d0a !important; }
.badge.bg-danger, .text-bg-danger { background: #fce8ec !important; color: #b04459 !important; }
.badge.bg-info, .text-bg-info { background: #e3f2fe !important; color: #1f6fb7 !important; }
.badge.bg-secondary, .text-bg-secondary { background: #edf2f8 !important; color: #5a718b !important; }
.badge.bg-dark, .text-bg-dark { background: var(--navy) !important; color: #fff !important; }
.badge.bg-light, .text-bg-light { background: #f2f6fb !important; color: var(--ink-2) !important; }
#notifyCount { background: var(--brand) !important; color: #fff !important; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-color: #d8e3f0; border-radius: 10px; padding: .55rem .8rem; color: var(--ink); background-color: #fff; }
.form-control-sm, .form-select-sm { border-radius: 8px; padding: .35rem .6rem; }
.form-control-lg { border-radius: 12px; }
.form-control:focus, .form-select:focus { border-color: #8dbcf3; box-shadow: 0 0 0 4px rgba(47, 127, 224, .12); }
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); margin-bottom: .3rem; }
.input-group-text { background: var(--brand-softer); border-color: #d8e3f0; color: var(--ink-2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(47, 127, 224, .12); border-color: #8dbcf3; }
.btn-check:checked + .btn-outline-dark, .btn-check:checked + .btn-outline-secondary { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Layout: sidebar ---------- */
.sidebar { width: 252px; height: 100vh; position: sticky; top: 0; flex-shrink: 0; z-index: 1040; color: #fff;
  background: radial-gradient(420px 260px at 0% 0%, rgba(255,255,255,.18) 0, transparent 60%), linear-gradient(180deg, #3b8cea 0%, #2f7fe0 45%, #2264c4 100%);
  box-shadow: 4px 0 24px rgba(31, 102, 194, .18); }
.sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.2rem; color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; border-bottom: 1px solid rgba(255,255,255,.14); }
.sidebar .brand small { display: block; font-weight: 600; font-size: .64rem; color: rgba(255,255,255,.72); letter-spacing: .12em; text-transform: uppercase; }
/* Anjok "A" monogram cropped from the full logo, on a white tile */
.brand-mark { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: inline-block;
  background: #fff url('anjok-logo.png') no-repeat; background-size: 150% auto; background-position: 81% 14%;
  filter: contrast(1.15) brightness(1.06); box-shadow: 0 6px 16px rgba(18, 48, 79, .18); border: 1px solid rgba(255,255,255,.6); }
.brand-mark.lg { width: 64px; height: 64px; border-radius: 18px; }
.brand-logo-full { height: 96px; width: auto; filter: contrast(1.15) brightness(1.06); }
.sidebar nav { padding: 0 .75rem; }
.sidebar .nav-group { font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.62); padding: 1.1rem .7rem .35rem; font-weight: 700; }
.sidebar .nav-link { color: rgba(255,255,255,.9); padding: .5rem .75rem; display: flex; gap: .7rem; align-items: center; border-radius: 10px; font-weight: 500; margin-bottom: 2px; transition: background .12s, color .12s; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--brand-dark); font-weight: 700; box-shadow: 0 6px 16px rgba(18, 48, 79, .15); }
.sidebar .nav-link.active i { color: var(--brand); }
.sidebar .nav-link i { font-size: 1.05rem; color: rgba(255,255,255,.75); width: 20px; text-align: center; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); }
.sidebar-plan { margin: .75rem; padding: .9rem 1rem; border-radius: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff !important; }
.sidebar-plan .text-muted { color: rgba(255,255,255,.75) !important; }
.sidebar-plan .badge { background: #fff !important; color: var(--brand-dark) !important; }
.sidebar-backdrop { display: none; }
@media (max-width: 1199.98px) {
  .sidebar { position: fixed; left: -270px; transition: left .22s ease; box-shadow: none; }
  .sidebar.show { left: 0; box-shadow: 0 20px 60px rgba(18, 48, 79, .25); }
  .sidebar.show + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(18, 48, 79, .3); backdrop-filter: blur(2px); z-index: 1035; }
}

/* ---------- Topbar ---------- */
.main { min-width: 0; }
.topbar { height: 62px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.topbar .tenant-name { font-weight: 700; font-size: 1rem; }
.topbar .btn-light { border-color: var(--line); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--brand); }
.content { max-width: 1600px; }
.page-head h1 { font-size: 1.45rem; }
.page-head .sub { color: var(--muted); font-size: .85rem; }

/* ---------- Cards, tables, lists ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--card); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 700; padding: .9rem 1.1rem; color: var(--ink); }
.card-footer { border-top: 1px solid var(--line); }
.card-body { padding: 1.1rem; }
.card.border-primary { border-color: #b9d5f6 !important; box-shadow: 0 0 0 4px rgba(47, 127, 224, .06); }
.card.border-danger { border-color: #f2c9d0 !important; }
.stat { overflow: hidden; position: relative; }
.stat .fs-5 { font-weight: 800 !important; letter-spacing: -.02em; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.bg-primary-subtle { background: var(--brand-soft) !important; color: var(--brand) !important; }
.stat-icon.bg-success-subtle { background: #e1f5ee !important; color: #1fa885 !important; }
.stat-icon.bg-warning-subtle { background: #fdf1d9 !important; color: #d18f1c !important; }
.stat-icon.bg-info-subtle { background: #e3f2fe !important; color: #3a95e6 !important; }
.stat-icon.bg-danger-subtle { background: #fce8ec !important; color: var(--rose) !important; }
.table { --bs-table-color: var(--ink); --bs-table-hover-bg: var(--brand-softer); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .8rem; border-bottom-color: #edf2f8; }
.table-sm > :not(caption) > * > * { padding: .45rem .6rem; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #f8fbfe; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-light, .table tfoot.table-light { --bs-table-bg: #f8fbfe; }
.table-danger { --bs-table-bg: #fdf3f5; --bs-table-color: var(--ink); }
.list-group { --bs-list-group-border-color: #edf2f8; --bs-list-group-action-hover-bg: var(--brand-softer); --bs-list-group-active-bg: var(--brand-soft); --bs-list-group-active-border-color: #d6e7fb; --bs-list-group-active-color: var(--brand-dark); }
.list-group-item { padding: .7rem 1.1rem; }
.list-group-item.active { font-weight: 700; }
.alert { border-radius: 12px; border: 1px solid transparent; }
.alert-info { background: #eef6fe; border-color: #d3e7fb; color: #1d5ea6; }
.alert-success { background: #e9f8f3; border-color: #c7ecdf; color: #12684f; }
.alert-warning { background: #fef7e8; border-color: #f7e2b4; color: #7d570f; }
.alert-danger { background: #fdf0f2; border-color: #f6d3d9; color: #9e3c4f; }
.alert-light { background: #fff; border-color: var(--line); }
.alert.rounded-0 { border-radius: 0; border-left: 0; border-right: 0; }
.nav-tabs { border-bottom-color: var(--line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; border-radius: 0; }
.nav-tabs .nav-link.active { color: var(--brand-dark); border-bottom-color: var(--brand); background: transparent; }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(18, 48, 79, .25); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-backdrop.show { opacity: .35; }
.progress { background: #edf2f8; border-radius: 99px; }
.progress-bar { background: linear-gradient(90deg, var(--accent), var(--brand)) !important; }
.toast { border-radius: 12px; box-shadow: var(--shadow); color: #fff !important; }
.toast.text-bg-dark { background: var(--navy) !important; }
.toast.text-bg-primary, .toast.text-bg-info { background: var(--brand) !important; }
.toast.text-bg-success { background: #1fa885 !important; }
.toast.text-bg-warning { background: #d9962a !important; }
.toast.text-bg-danger { background: var(--rose) !important; }
.veg-dot, .nonveg-dot { display: inline-block; width: 13px; height: 13px; border: 1.5px solid; border-radius: 3px; position: relative; vertical-align: -1px; }
.veg-dot { border-color: #1fa885; } .nonveg-dot { border-color: #c2795a; }
.veg-dot::after, .nonveg-dot::after { content: ''; position: absolute; inset: 2.5px; border-radius: 50%; }
.veg-dot::after { background: #1fa885; } .nonveg-dot::after { background: #c2795a; }
pre { border: 1px solid var(--line); }

/* ---------- Auth & landing ---------- */
.auth-bg { min-height: 100vh; background: radial-gradient(1200px 500px at 0% 0%, #dcebfd 0, transparent 60%), radial-gradient(900px 500px at 100% 100%, #e5f3ff 0, transparent 60%), var(--bg); }
.auth-card { max-width: 440px; margin: 7vh auto; }
.auth-card .card { box-shadow: var(--shadow); border-radius: 20px; }
.landing-nav { background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hero { background: radial-gradient(900px 400px at 85% 10%, #d6e9fd 0, transparent 60%), linear-gradient(180deg, #f4f9ff 0%, #eaf3fe 100%); color: var(--ink); border-bottom: 1px solid var(--line); }
.hero h1 { color: var(--ink); }
.hero .lead { color: var(--ink-2); }
.hero .eyebrow { display: inline-flex; gap: .4rem; align-items: center; background: #fff; border: 1px solid #d6e7fb; color: var(--brand-dark); border-radius: 999px; padding: .35rem .8rem; font-weight: 600; font-size: .8rem; }
.hero-card { background: #fff; border-radius: 20px; padding: 1.25rem; box-shadow: 0 30px 70px rgba(31, 102, 194, .18); border: 1px solid var(--line); }
.feature-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: var(--brand-soft); color: var(--brand); }
.price-card { border-radius: 20px; transition: transform .15s, box-shadow .15s; }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price-card.featured { border: 2px solid var(--brand); box-shadow: 0 20px 50px rgba(47, 127, 224, .15); }

/* ---------- POS ---------- */
.pos-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: .9rem; height: calc(100vh - 62px - 1.5rem); height: calc(100dvh - 62px - 1.5rem); }
.pos-menu, .pos-cart { background: #fff; border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow-sm); }
.pos-toolbar { padding: .75rem; border-bottom: 1px solid var(--line); }
.pos-cats { display: flex; gap: .45rem; overflow-x: auto; padding: .7rem .75rem; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.pos-cats .btn { white-space: nowrap; border-radius: 999px; padding: .4rem .95rem; font-weight: 600; }
.pos-cats .btn-light { background: var(--brand-softer); border-color: transparent; color: var(--ink-2); }
.pos-cats .btn-primary { box-shadow: 0 4px 12px rgba(47, 127, 224, .3); }
.pos-items { overflow-y: auto; padding: .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; align-content: start; flex: 1; background: linear-gradient(180deg, #fbfdff, #fff); }
.pos-item { border: 1px solid var(--line); border-radius: 14px; padding: .75rem; cursor: pointer; background: #fff; text-align: left; transition: transform .08s, box-shadow .12s, border-color .12s; min-height: 96px; display: flex; flex-direction: column; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.pos-item:hover { border-color: #a9cdf6; box-shadow: 0 8px 20px rgba(47, 127, 224, .12); }
.pos-item:active { transform: scale(.97); background: var(--brand-softer); }
.pos-item .nm { font-weight: 700; line-height: 1.25; font-size: .88rem; }
.pos-item .pr { margin-top: auto; color: var(--brand-dark); font-weight: 800; padding-top: .35rem; }
.pos-item.na { opacity: .45; pointer-events: none; }
.pos-cart-head { padding: .75rem; border-bottom: 1px solid var(--line); }
.pos-cart-items { overflow-y: auto; flex: 1; min-height: 80px; }
.cart-line { padding: .6rem .85rem; border-bottom: 1px solid #f0f4f9; }
.cart-line.sent { background: #f6fbf9; }
.qty-btn { width: 30px; height: 30px; padding: 0; line-height: 1; border-radius: 8px; }
.pos-totals { border-top: 1px solid var(--line); padding: .75rem .9rem; font-size: .88rem; background: #fbfdff; }
.pos-totals .fs-4 { color: var(--ink); letter-spacing: -.02em; }
.pos-actions { padding: .75rem; border-top: 1px solid var(--line); }
.pos-actions .btn { padding: .65rem .3rem; font-weight: 700; border-radius: 12px; line-height: 1.15; }
.pos-actions .btn i { font-size: 1.15rem; }
kbd { font-size: .62rem; background: rgba(18, 48, 79, .12); color: inherit; padding: 1px 4px; border-radius: 4px; font-family: inherit; }
.btn-primary kbd, .btn-dark kbd { background: rgba(255, 255, 255, .22); }
#typeGroup .btn { border-radius: 10px !important; margin-right: 4px; border-color: #d6e4f3; color: var(--ink-2); white-space: nowrap; padding-left: .4rem; padding-right: .4rem; }
#typeGroup .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pos-mobile-bar { display: none; }
@media (min-width: 992px) and (max-width: 1279.98px) { .pos-wrap { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (min-width: 768px) and (max-width: 991.98px) {
  .pos-wrap { grid-template-columns: minmax(0, 1fr) 330px; gap: .6rem; }
  .pos-items { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .pos-actions kbd, .pos-toolbar kbd { display: none; }
}
@media (max-width: 767.98px) {
  .pos-wrap { display: block; height: auto; }
  .pos-menu { min-height: calc(100dvh - 62px - 90px); border-radius: 14px; }
  .pos-items { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 90px; }
  .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: 8vh; z-index: 1045; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -20px 60px rgba(18, 48, 79, .25); }
  .pos-cart.open { transform: none; }
  .pos-cart .sheet-handle { display: flex !important; }
  .pos-mobile-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1030; }
  .pos-toolbar kbd, .pos-actions kbd { display: none; }
  .pos-toolbar .btn .lbl { display: none; }
}

/* ---------- Tables floor ---------- */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .85rem; }
.tbl { border-radius: 16px; padding: .9rem; border: 1px solid var(--line); min-height: 130px; background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.tbl::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.tbl.free::before { background: #1fa885; } .tbl.free .tn { color: #178a6c; }
.tbl.occupied { background: linear-gradient(180deg, #f2f8ff, #fff); border-color: #cfe2f8; } .tbl.occupied::before { background: var(--brand); } .tbl.occupied .tn { color: var(--brand-dark); }
.tbl.reserved { background: linear-gradient(180deg, #fffaf0, #fff); border-color: #f5e3bd; } .tbl.reserved::before { background: #f5b142; } .tbl.reserved .tn { color: #a7700e; }
.tbl .tn { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; }

/* ---------- KDS ---------- */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .85rem; }
.kot { background: #fff; border-radius: 16px; border: 1px solid var(--line); border-top: 5px solid #9db1c8; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.kot.pending { border-top-color: var(--brand); } .kot.preparing { border-top-color: #f5b142; } .kot.ready { border-top-color: #1fa885; }
.kot.late { animation: pulse 1.6s infinite; border-top-color: var(--rose); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 103, 122, .45); } 50% { box-shadow: 0 0 0 7px rgba(224, 103, 122, 0); } }
.kot-head { padding: .75rem .9rem; border-bottom: 1px solid #f0f4f9; }
.kot-items { padding: .6rem .9rem; flex: 1; }
.kot-items li { padding: .25rem 0; border-bottom: 1px dashed #edf2f8; }
.kot-items li:last-child { border-bottom: 0; }

/* ---------- Receipt / print ---------- */
.receipt { width: 80mm; max-width: 100%; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 12px; color: #000; background: #fff; padding: 4mm; border-radius: 6px; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td, .receipt th { padding: 1px 0; vertical-align: top; }
.receipt .hr { border-top: 1px dashed #000; margin: 4px 0; }
.receipt .c { text-align: center; } .receipt .r { text-align: right; }
.a4 { max-width: 820px; margin: 0 auto; background: #fff; padding: 32px; border-radius: 12px; }
@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  body { background: #fff !important; }
  .receipt { width: 100%; padding: 0; box-shadow: none !important; }
  .card { box-shadow: none; }
  @page { margin: 4mm; }
}

/* ---------- Misc ---------- */
.chart-box { position: relative; height: 280px; }
.timeline-msg { border-radius: 14px; padding: .8rem 1rem; margin-bottom: .7rem; }
.timeline-msg.admin { background: var(--brand-soft); border: 1px solid #d3e6fb; margin-left: 2rem; }
.timeline-msg.user { background: #fff; border: 1px solid var(--line); margin-right: 2rem; }
.app-fluid .content { padding: .75rem !important; max-width: none; }
.empty-state { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: #b6c8dc; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfdcea; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Tablet & phone ---------- */
@media (max-width: 991.98px) {
  .content { padding: 1rem !important; }
  .chart-box { height: 240px; }
}
@media (max-width: 575.98px) {
  body { font-size: .9rem; }
  .content { padding: .75rem !important; }
  .page-head h1 { font-size: 1.2rem; }
  .page-head .ms-auto { width: 100%; }
  .page-head .ms-auto .btn { flex: 1 1 auto; }
  .card-body { padding: .9rem; }
  .table > :not(caption) > * > * { padding: .55rem .6rem; }
  .stat .card-body { padding: .8rem; gap: .65rem !important; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; }
  .stat .fs-5 { font-size: .98rem !important; white-space: nowrap; }
  .stat .stat-icon { display: none; }
  .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .kds-grid { grid-template-columns: 1fr; }
  .modal-dialog { margin: .5rem; }
  .chart-box { height: 210px; }
  .timeline-msg.admin { margin-left: .5rem; } .timeline-msg.user { margin-right: .5rem; }
  .display-5 { font-size: 2rem; }
}
/* Touch devices: bigger targets */
@media (pointer: coarse) {
  .btn-sm { padding: .4rem .7rem; }
  .sidebar .nav-link { padding: .65rem .75rem; }
  .qty-btn { width: 34px; height: 34px; }
}

/* ---------- Dish photo library ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .85rem; padding-bottom: 80px; }
.lib-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .1s, box-shadow .15s, border-color .15s; box-shadow: var(--shadow-sm); margin: 0; }
.lib-card:hover { box-shadow: var(--shadow); border-color: #b9d5f6; }
.lib-card img { width: 100%; height: 130px; object-fit: cover; background: var(--brand-softer); }
.lib-card .lib-body { padding: .6rem .7rem .7rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; font-size: .85rem; }
.lib-card .lib-check { position: absolute; top: .55rem; left: .55rem; width: 1.35rem; height: 1.35rem; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.lib-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 127, 224, .25); }
.lib-card.in-menu { opacity: .65; cursor: default; }
.lib-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 1030; width: min(560px, calc(100% - 24px)); background: var(--navy); color: #fff; border-radius: 16px; padding: .65rem .8rem .65rem 1.1rem; display: flex; align-items: center; gap: .75rem; box-shadow: 0 20px 50px rgba(18, 48, 79, .35); }
.item-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--brand-softer); flex-shrink: 0; }
.item-thumb.ph { display: inline-grid; place-items: center; color: #b6c8dc; font-size: 1.1rem; }
.pos-item .thumb { width: calc(100% + 1.5rem); height: 82px; object-fit: cover; margin: -.75rem -.75rem .55rem; border-radius: 13px 13px 0 0; background: var(--brand-softer); }
.pos-item.has-img { padding-top: .75rem; min-height: 172px; overflow: hidden; }
.pos-item.has-img .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-item .thumb + div { min-width: 0; }
.photo-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; background: var(--brand-softer); }
@media (max-width: 575.98px) {
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .lib-card img { height: 105px; }
  .pos-item .thumb { height: 70px; }
}

/* ---------- Restaurant branding ---------- */
.logo-box { width: 84px; height: 84px; border-radius: 16px; border: 1px dashed #c9dbf0; background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tenant-logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; object-fit: contain; padding: 3px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(18, 48, 79, .18); }
.topbar .tenant-logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; border: 1px solid var(--line); padding: 2px; }
.login-logo { max-width: 180px; max-height: 120px; object-fit: contain; }
.login-pill { display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid #d6e7fb; color: var(--brand-dark); border-radius: 999px; padding: .3rem .8rem; font-weight: 600; font-size: .75rem; letter-spacing: .04em; }
.admin-login .auth-card .card { border-top: 4px solid var(--brand-dark); }
