/* =========================================================
   Cheesy Bite POS — Theme & Components
   Light: pure white UI · Sidebar: white or brand green
   Dark: deep forest green with cheesy-yellow accents
   ========================================================= */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --soft: #F8FAFC;
  --soft-2: #F1F5F9;
  --border: #E6EAF0;
  --text: #0B1F14;
  --muted: #64748B;

  --primary: #0D3823;
  --primary-hover: #082817;
  --on-primary: #FFFFFF;
  --accent: #FBB710;
  --on-accent: #0D3823;

  --danger: #DC2626;  --danger-soft: #FEE2E2;  --danger-text: #B91C1C;
  --success: #16A34A; --success-soft: #DCFCE7; --success-text: #15803D;
  --warn: #D97706;    --warn-soft: #FEF3C7;    --warn-text: #B45309;
  --info: #2563EB;    --info-soft: #DBEAFE;    --info-text: #1D4ED8;

  /* Sidebar (white default) */
  --sb-bg: #FFFFFF;
  --sb-text: #334155;
  --sb-muted: #94A3B8;
  --sb-border: #E6EAF0;
  --sb-hover: #F8FAFC;
  --sb-active-bg: #0D3823;
  --sb-active-text: #FFFFFF;
  --sb-title: #0D3823;

  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

/* Brand-green sidebar (light mode switch) */
body.sb-green {
  --sb-bg: #0D3823;
  --sb-text: #E3EFE7;
  --sb-muted: #8FB5A0;
  --sb-border: #0D3823;
  --sb-hover: rgba(255, 255, 255, .07);
  --sb-active-bg: #FBB710;
  --sb-active-text: #0D3823;
  --sb-title: #FFFFFF;
}

/* Dark mode */
html.dark {
  --bg: #071910;
  --surface: #0B2416;
  --soft: #0E2B1B;
  --soft-2: #123622;
  --border: #1B4430;
  --text: #FFFFFF;
  --muted: #9DB8A8;
  --primary: #FBB710;
  --primary-hover: #F2A900;
  --on-primary: #082817;
  --accent: #FBB710;
  --on-accent: #082817;
  --danger-soft: rgba(220, 38, 38, .18);  --danger-text: #FCA5A5;
  --success-soft: rgba(22, 163, 74, .2);  --success-text: #86EFAC;
  --warn-soft: rgba(217, 119, 6, .22);    --warn-text: #FCD34D;
  --info-soft: rgba(37, 99, 235, .22);    --info-text: #93C5FD;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
html.dark body,
html.dark body.sb-green {
  --sb-bg: #05140B;
  --sb-text: #D7E7DD;
  --sb-muted: #7FA28E;
  --sb-border: #143823;
  --sb-hover: rgba(255, 255, 255, .05);
  --sb-active-bg: #FBB710;
  --sb-active-text: #082817;
  --sb-title: #FFFFFF;
}

* { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger-text); }
.text-success { color: var(--success-text); }
.text-brand { color: var(--primary); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px;
  background: var(--sb-bg); border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease, background .2s ease;
}
.main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.sb-overlay { position: fixed; inset: 0; background: rgba(3, 15, 9, .45); z-index: 35; display: none; }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
  .sb-overlay.show { display: block; }
  .main { margin-left: 0; }
}
.sb-brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 16px; border-bottom: 1px solid var(--sb-border); }
.sb-brand img { width: 54px; height: 54px; border-radius: 12px; object-fit: contain; background: #fff; flex-shrink: 0; padding: 2px; border: 1px solid var(--sb-border); }
.sb-title { font-weight: 800; font-size: 18px; color: var(--sb-title); line-height: 1.15; }
.sb-tag { font-size: 11px; color: var(--sb-muted); margin-top: 2px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sb-group { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-muted); font-weight: 600; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--sb-text); font-weight: 500; cursor: pointer; margin-bottom: 2px; transition: background .15s;
}
.nav-link:hover { background: var(--sb-hover); }
.nav-link.active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 600; }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.nav-count:empty { display: none; }
.sb-foot { padding: 12px; border-top: 1px solid var(--sb-border); }
.sb-user { display: flex; align-items: center; gap: 10px; color: var(--sb-text); }
.sb-user .icon-btn { background: transparent; border-color: var(--sb-border); color: var(--sb-text); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #0D3823; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 20px;
}
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.chip svg { width: 15px; height: 15px; }
.view { padding: 20px; flex: 1; min-width: 0; }
@media (max-width: 640px) { .view { padding: 14px; } .topbar { padding: 0 12px; } }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.card-h svg { width: 18px; height: 18px; color: var(--primary); }
.card-h .ml-auto { font-weight: 500; }
.card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tb-left, .tb-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, filter .15s; white-space: nowrap; user-select: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover:not(:disabled) { filter: brightness(.95); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--soft); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--soft-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger-text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 52px; font-size: 15px; border-radius: 12px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; flex-shrink: 0; transition: background .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--soft-2); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn.danger { color: var(--danger-text); }

.input, .select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; min-height: 72px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251, 183, 16, .25); }
.input::placeholder { color: var(--muted); opacity: .8; }
.input-lg { height: 52px; font-size: 20px; font-weight: 700; }
.w-auto.select, .w-auto.input { width: auto; }
.label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.search { position: relative; }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search .input { padding-left: 38px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.badge svg { width: 12px; height: 12px; }
.b-green { background: var(--success-soft); color: var(--success-text); }
.b-red { background: var(--danger-soft); color: var(--danger-text); }
.b-yellow { background: var(--warn-soft); color: var(--warn-text); }
.b-blue { background: var(--info-soft); color: var(--info-text); }
.b-gray { background: var(--soft-2); color: var(--muted); }
.b-brand { background: var(--primary); color: var(--on-primary); }
.b-accent { background: var(--accent); color: #0D3823; }
.b-solid-red { background: var(--danger); color: #fff; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--soft); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--soft); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .act { white-space: nowrap; text-align: right; }
.tbl .act .icon-btn { margin-left: 4px; }
.row-alert td { background: var(--danger-soft) !important; }

.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.pill svg { width: 16px; height: 16px; }
.pill.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pill-sm { height: 30px; padding: 0 12px; font-size: 12px; }

.seg { display: inline-flex; background: var(--soft-2); padding: 4px; border-radius: 12px; gap: 4px; max-width: 100%; overflow-x: auto; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; flex: 1;
}
.seg button svg { width: 16px; height: 16px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
html.dark .seg button.active { background: var(--accent); color: #082817; }
.seg-n { font-size: 11px; background: var(--border); color: var(--text); border-radius: 99px; padding: 0 6px; }
html.dark .seg button.active .seg-n { background: rgba(0, 0, 0, .15); color: #082817; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 40px; height: 22px; border-radius: 99px; background: var(--soft-2); border: 1px solid var(--border); transition: .2s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s; }
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
html.dark .switch input:checked + .track::after { background: #082817; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(251, 183, 16, .35); }

.opt { border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--surface); color: var(--text); text-align: left; transition: .15s; }
.opt:hover { border-color: var(--accent); }
.opt.active { border-color: var(--accent); background: rgba(251, 183, 16, .12); }
.opt-card { display: block; cursor: pointer; }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card > div { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; height: 100%; transition: .15s; }
.opt-card:hover > div { border-color: var(--accent); }
.opt-card:has(input:checked) > div { border-color: var(--accent); background: rgba(251, 183, 16, .12); box-shadow: 0 0 0 1px var(--accent); }

.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 38px; height: 38px; margin: 0 auto 10px; opacity: .55; }
.bar { height: 8px; background: var(--soft-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar.accent > span { background: var(--accent); }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ico svg { width: 20px; height: 20px; }
.tone-green { background: var(--success-soft); color: var(--success-text); }
.tone-yellow { background: rgba(251, 183, 16, .18); color: #A16C00; }
html.dark .tone-yellow { color: var(--accent); }
.tone-blue { background: var(--info-soft); color: var(--info-text); }
.tone-red { background: var(--danger-soft); color: var(--danger-text); }
.tone-brand { background: var(--primary); color: var(--on-primary); }
.up { color: var(--success-text); font-weight: 600; }
.down { color: var(--danger-text); font-weight: 600; }
.mini { padding: 14px 16px; }
.mini .l { font-size: 12px; color: var(--muted); }
.mini .v { font-size: 18px; font-weight: 700; margin-top: 2px; }

.alert-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--danger); color: #fff;
  border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(220, 38, 38, .25);
}
.alert-banner .ab-ico { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex-shrink: 0; }
.alert-banner .ab-ico svg { width: 20px; height: 20px; }
.alert-banner .btn { background: #fff; color: var(--danger); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

/* ---------- Modal / Toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 15, 9, .55); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 60; opacity: 0; transition: opacity .15s;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--surface); color: var(--text); border-radius: 16px; width: 100%; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  transform: translateY(10px); transition: transform .18s;
}
.modal-backdrop.show .modal { transform: none; }
.modal-sm { max-width: 430px; } .modal-md { max-width: 580px; } .modal-lg { max-width: 780px; } .modal-xl { max-width: 1000px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-weight: 700; font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-foot .btn { flex: 1; }
}
#toast-root { position: fixed; top: 16px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px; padding: 12px 14px; border-radius: 12px;
  background: #0D3823; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); font-weight: 500; font-size: 13.5px;
  animation: tin .2s ease; pointer-events: auto;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; color: #FBB710; }
.toast.error { background: #B91C1C; } .toast.error svg { color: #fff; }
.toast.info { background: #1E293B; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; background: var(--soft); }
html.dark .login-page { background: var(--bg); }
.login-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.login-box { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 34px 30px 30px; box-shadow: 0 20px 50px rgba(13, 56, 35, .08); }
@media (max-width: 480px) { .login-box { padding: 28px 20px 24px; } }
.login-logo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; margin: 0 auto; display: block; background: #fff; box-shadow: 0 0 0 4px var(--accent), 0 10px 26px rgba(13, 56, 35, .18); }
.login-name { font-size: 24px; font-weight: 800; color: var(--primary); margin-top: 16px; line-height: 1.1; }
.login-tag { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.login-divider { height: 1px; background: var(--border); margin: 22px 0 20px; }
.login-error { display: flex; align-items: center; gap: 8px; background: var(--danger-soft); color: var(--danger-text); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.login-foot { font-size: 12px; color: var(--muted); margin-top: 18px; }
.input-ico { position: relative; }
.input-ico > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.input-ico .input { padding-left: 40px; height: 48px; }
.input-ico .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pos-left { min-width: 0; }
@media (min-width: 1024px) {
  .view-pos { padding-bottom: 20px; }
  .pos { grid-template-columns: minmax(0, 1fr) 380px; height: calc(100vh - 64px - 40px); }
  .pos-left { display: flex; flex-direction: column; min-height: 0; }
  .pos-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 2px 4px 4px 2px; margin: -2px -4px -4px -2px; }
  .cart { height: 100%; }
}
@media (min-width: 1280px) { .pos { grid-template-columns: minmax(0, 1fr) 410px; } }
@media (max-width: 1023px) { .pos-left { padding-bottom: 84px; } }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.prod {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 8px;
  min-height: 136px; text-align: left; color: var(--text);
}
.prod:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(13, 56, 35, .08); }
.prod:active { transform: scale(.98); }
.prod .pi { width: 44px; height: 44px; border-radius: 12px; background: var(--soft-2); display: grid; place-items: center; color: var(--primary); }
.prod .pi svg { width: 22px; height: 22px; }
.prod.deal .pi { background: rgba(251, 183, 16, .18); color: #A16C00; }
html.dark .prod .pi, html.dark .prod.deal .pi { color: var(--accent); }
.prod-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.prod-price { font-weight: 700; color: var(--primary); font-size: 15px; }
.prod .pbadge { position: absolute; top: 10px; right: 10px; }
.prod .dsub { font-size: 11px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.strike { text-decoration: line-through; color: var(--muted); font-size: 11.5px; font-weight: 500; }

.suggest { position: absolute; left: 0; right: 0; top: 46px; max-height: 260px; overflow-y: auto; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--soft); }

.cart { display: flex; flex-direction: column; overflow: hidden; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-scroll { flex: 1; overflow-y: auto; min-height: 140px; overscroll-behavior: contain; }
.cart-items { min-height: 60px; }
.cart-line { padding: 12px 16px; border-bottom: 1px dashed var(--border); }
.cart-line .ln-note { display: inline-flex; gap: 4px; align-items: center; font-size: 11.5px; color: var(--warn-text); margin-top: 3px; }
.cart-line .ln-note svg { width: 12px; height: 12px; }
.cart-foot { border-top: 1px solid var(--border); padding: 4px 16px 14px; background: var(--surface); }
.cart-foot .grand { border-top: 0; margin-top: 0; padding: 8px 0 10px; }
.bill-adj { padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.cart-line.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: rgba(251, 183, 16, .28); } 100% { background: transparent; } }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--muted); }
.sum-row b { color: var(--text); font-weight: 600; }
.grand { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 12px; margin-top: 6px; border-top: 1px dashed var(--border); }
.grand .amt { font-size: 23px; font-weight: 800; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-actions .full { grid-column: 1 / -1; }
.adj-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.adj-row .seg button { height: 28px; padding: 0 10px; font-size: 12px; }
.adj-row .input { height: 34px; width: 90px; text-align: right; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text); font-size: 18px; font-weight: 600; }
.qty button:hover { background: var(--soft-2); }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }
.qty.lg button { width: 44px; height: 44px; font-size: 22px; }
.qty.lg span { min-width: 44px; font-size: 18px; }

.cart-fab { display: none; position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 44; justify-content: space-between; box-shadow: 0 10px 30px rgba(13, 56, 35, .35); }
@media (max-width: 1023px) {
  .cart { position: fixed; left: 0; right: 0; bottom: 0; height: 90vh; z-index: 46; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .25s ease; }
  .cart.open { transform: none; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
  .cart-fab { display: flex; }
  .cart-backdrop.show { display: block; }
}
.cart-backdrop { display: none; position: fixed; inset: 0; background: rgba(3, 15, 9, .45); z-index: 45; }

.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.table-tile { border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 8px; text-align: center; background: var(--surface); cursor: pointer; transition: .15s; color: var(--text); }
.table-tile:hover { border-color: var(--accent); }
.table-tile.busy { background: var(--warn-soft); border-color: #F59E0B; }
.table-tile.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.tt-no { font-size: 20px; font-weight: 800; }
.tt-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pay-total { text-align: center; padding: 16px; border-radius: 14px; background: var(--soft); border: 1px solid var(--border); }
.change-box { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--success-soft); color: var(--success-text); font-weight: 600; }
.change-box b { font-size: 18px; }
.change-box.neg { background: var(--danger-soft); color: var(--danger-text); }

/* ---------- Kitchen Display (one uniform card style) ---------- */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.kot { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
html.dark .kot { border-top-color: var(--accent); }
.kot-head { padding: 13px 14px 11px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--border); background: var(--soft); }
.kot-where { font-size: 19px; font-weight: 800; line-height: 1.1; color: var(--text); }
.kot-time { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.kot-time.late { color: var(--danger-text); }
.kot-items { list-style: none; margin: 0; padding: 0; }
.kot-items li { padding: 10px 14px; border-bottom: 1px dashed var(--border); font-size: 15px; }
.kot-items li:last-child { border-bottom: 0; }
.kot-items .kq { display: inline-block; min-width: 30px; font-weight: 800; color: var(--primary); }
.kot-items .kv { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--soft-2); margin-left: 6px; }
.kot-items .ka { font-size: 12.5px; color: var(--muted); margin: 3px 0 0 30px; }
.kot-note { margin: 6px 0 0 30px; font-size: 12.5px; font-weight: 600; background: var(--soft-2); color: var(--text); padding: 4px 8px; border-radius: 6px; display: flex; width: fit-content; align-items: center; gap: 5px; }
.kot-foot { padding: 12px 14px; display: flex; gap: 8px; margin-top: auto; border-top: 1px solid var(--border); }
.kot-foot .btn { flex: 1; }
.kstat { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); white-space: nowrap; }
.kstat::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kstat.k-new::before { background: #2563EB; }
.kstat.k-prep::before { background: #F59E0B; }
.kstat.k-ready::before { background: #16A34A; }
.kstat.k-done { color: var(--muted); }
.kstat.k-done::before { background: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; display: inline-block; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: livep 1.6s infinite; }
@keyframes livep { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* ---------- Forms in modals ---------- */
.var-head, .var-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr 56px 32px; gap: 8px; align-items: center; }
.var-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.var-row { margin-bottom: 8px; }
.var-row .input { height: 38px; }
.comp-row { display: grid; grid-template-columns: 1.6fr 1fr 70px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.comp-row .input, .comp-row .select { height: 38px; }
@media (max-width: 560px) {
  .var-head { display: none; }
  .var-row { grid-template-columns: 1fr 1fr; }
  .var-row > :first-child { grid-column: 1 / -1; }
  .comp-row { grid-template-columns: 1fr 1fr; }
  .comp-row > :first-child { grid-column: 1 / -1; }
}
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick button { height: 44px; border-radius: 10px; border: 1.5px solid var(--border); display: grid; place-items: center; color: var(--text); }
.icon-pick button.active { border-color: var(--accent); background: rgba(251, 183, 16, .14); }
.icon-pick svg { width: 20px; height: 20px; }
.cat-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--soft-2); color: var(--primary); display: grid; place-items: center; }
.cat-ico svg { width: 19px; height: 19px; }
.perm td, .perm th { text-align: center; }
.perm td:first-child, .perm th:first-child { text-align: left; }
.perm input { width: 18px; height: 18px; accent-color: #0D3823; cursor: pointer; }
html.dark .perm input { accent-color: #FBB710; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0 4px; background: linear-gradient(to top, var(--bg) 70%, transparent); margin-top: 8px; }

/* ---------- Thermal receipt ---------- */
.rcpt { font-family: 'Courier New', Courier, monospace; color: #000; background: #fff; margin: 0 auto; padding: 10px 8px; font-size: 12px; line-height: 1.35; }
.rcpt.w80 { width: 72mm; }
.rcpt.w58 { width: 48mm; font-size: 10.5px; }
.rcpt .c { text-align: center; }
.rcpt .r { text-align: right; white-space: nowrap; }
.rcpt .b { font-weight: 700; }
.rcpt .big { font-size: 1.25em; }
.rcpt .sm { font-size: .9em; padding-left: 8px; }
.rcpt .hr { border-top: 1px dashed #000; margin: 6px 0; }
.rcpt table { width: 100%; border-collapse: collapse; }
.rcpt td { vertical-align: top; padding: 1px 0; }
.rcpt img { width: 120px; height: auto; max-height: 120px; margin: 0 auto 4px; display: block; object-fit: contain; filter: grayscale(1) contrast(1.2); }
.rcpt.w58 img { width: 90px; }
.rcpt .kline { padding: 4px 0; border-bottom: 1px dotted #999; }
.rcpt-preview { background: var(--soft-2); padding: 18px 10px; border-radius: 12px; display: flex; justify-content: center; overflow-x: auto; }
.rcpt-preview .rcpt { box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }

#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  html, body { background: #fff !important; margin: 0; }
  .rcpt { box-shadow: none !important; margin: 0; }
}

/* ---------- v2 additions ---------- */
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; border-color: currentColor; border-top-color: transparent; vertical-align: -2px; }
.empty .spinner { margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.b-orange { background: #FFEDD5; color: #C2410C; }
html.dark .b-orange { background: rgba(234, 88, 12, .22); color: #FDBA74; }
.chk { width: 16px; height: 16px; accent-color: #0D3823; }
html.dark .chk { accent-color: #FBB710; }
a.icon-btn { text-decoration: none; }

/* Bill panel */
.bill-info { padding: 12px 16px 14px; border-bottom: 1px solid var(--border); background: var(--soft); position: relative; }
.bill-info .grid { position: relative; }
.bill-info .suggest { top: 62px; }
.bill-sec-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.bill-sec-title svg { width: 14px; height: 14px; }
.mini-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.mini-label span { color: var(--muted); font-weight: 400; }
.input-sm, .select.input-sm { height: 38px; font-size: 13.5px; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pay-opt { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: .15s; }
.pay-opt svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.pay-opt:hover { border-color: var(--accent); }
.pay-opt.active { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.pay-opt.active svg { color: var(--on-primary); }
.create-bill { font-size: 16px; letter-spacing: .01em; }
.bill-summary { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; }
.bill-summary > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.bill-summary > div:last-child { border-bottom: 0; }
.bill-summary span { color: var(--muted); }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; background: var(--soft-2); border: 1px solid var(--border); font-size: 13px; font-weight: 500; }
.tag-chip svg { width: 14px; height: 14px; }
.tag-chip button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.tag-chip button:hover { background: var(--danger-soft); color: var(--danger-text); }
.notice-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--warn-soft); color: var(--warn-text); border: 1px solid rgba(217, 119, 6, .25); }
.notice-bar > svg { width: 20px; height: 20px; flex-shrink: 0; }
.tbl td.nw, .tbl th.nw { white-space: nowrap; }

.login-logo.real { width: 230px; height: auto; border-radius: 16px; box-shadow: none; background: transparent; }
.app-credit { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 16px 16px; }
.app-credit a, .login-foot a { color: var(--primary); font-weight: 600; text-decoration: none; }
.app-credit a:hover, .login-foot a:hover { text-decoration: underline; }
@media (min-width: 1024px) { .view-pos + .app-credit { display: none; } }
.view-pos { padding-bottom: 8px; }
.pill-new { border-style: dashed; color: var(--muted); }
.pill-new:hover { color: var(--text); border-color: var(--accent); }
