/* =========================================================
   Servora RMS — Restaurant Management Frontend
   Original design • warm terracotta + cream palette
   ========================================================= */

:root {
  --bg:           #f4f4f4;
  --surface:      #ffffff;
  --surface-2:    #f8f8f8;
  --sidebar:      #18161300;
  --sidebar-bg:   #000000;
  --sidebar-bg-2: #221e19;
  --sidebar-fg:   #d9d2c5;
  --sidebar-mute: #8a8275;
  --sidebar-hi:   #ffffff;
  --line:         #e8e8e8;
  --line-2:       #e2dccf;
  --text:         #1f1c18;
  --text-2:       #5b554c;
  --text-3:       #948d7f;

  --primary:      #e74c3c;
  --primary-2:    #c0392b;
  --primary-soft: #fbeae3;
  --gold:         #b88a3a;
  --gold-soft:    #f6ecd6;
  --green:        #3f8a5a;
  --green-soft:   #e2efe6;
  --red:          #c0392b;
  --red-soft:     #fbe5e1;
  --blue:         #355a8a;
  --blue-soft:    #e5ecf5;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 2px rgba(31,28,24,.04), 0 1px 1px rgba(31,28,24,.02);
  --shadow:       0 4px 14px rgba(31,28,24,.06), 0 1px 2px rgba(31,28,24,.04);
  --shadow-lg:    0 20px 50px rgba(31,28,24,.15);
  --font:         'Inter', system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:         'JetBrains Mono', ui-monospace, "SFMono-Regular", Menlo, monospace;
}

[data-theme="dark"] {
  --bg:           #0f0d0b;
  --surface:      #1a1714;
  --surface-2:    #221e1a;
  --line:         #2a251f;
  --line-2:       #342e26;
  --text:         #f4efe5;
  --text-2:       #b6ad9e;
  --text-3:       #807868;
  --primary-soft: #3a2018;
  --gold-soft:    #3a2d15;
  --green-soft:   #1a2e22;
  --red-soft:     #3a1c18;
  --blue-soft:    #1c2533;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}

.mono {  font-variant-numeric: tabular-nums; }

/* ============ LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.app.sidebar-collapsed { grid-template-columns: 72px 1fr; }

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  padding: 18px 14px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid #0e0c0a;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a251e; border-radius: 4px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid #2a251e;
}
.brand-mark {
  width: 60px;
  border-radius: 10px;
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.brand-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--sidebar-hi);
  letter-spacing: -.01em;
}
.brand-sub {
  font-size: 11px;
  color: var(--sidebar-mute);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .sidebar-foot-text { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }

.nav-section-title {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sidebar-mute);
  padding: 8px 10px 6px;
  font-weight: 600;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--sidebar-fg);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  position: relative;
  white-space: nowrap;
}
.nav-item .bi { font-size: 16px; width: 18px; text-align: center; opacity: .85; }
.nav-item:hover { background: #25201a; color: var(--sidebar-hi); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(184,84,60,.22), rgba(184,84,60,.06));
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-item .pill {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #2a251e;
  display: flex; align-items: center; gap: 10px;
  color: var(--sidebar-mute);
  font-size: 12px;
}
.sidebar-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: #3f8a5a; box-shadow: 0 0 0 3px rgba(63,138,90,.18); }

/* ============ MAIN / TOPBAR ============ */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface-2);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
}
.topbar .tb-title { font-weight: 600; font-size: 16px; color: var(--text); }
.topbar .tb-crumb { font-size: 12px; color: var(--text-3); }
.topbar .tb-search {
  flex: 1; max-width: 420px; margin: 0 8px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-2);
}
.topbar .tb-search input {
  border: 0; background: transparent; outline: none; flex: 1;
  font-size: 13px; color: var(--text);
}
.topbar .tb-search kbd {
  font-family: var(--font);
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ============ GLOBAL SEARCH ============ */
/* The box widens on focus and the panel always matches its edges. */
.topbar .global-search {
  position: relative;
  flex: 0 1 auto; width: 300px; max-width: none; min-width: 0;
  transition: width .2s ease, border-color .15s, box-shadow .15s;
}
.topbar .global-search:focus-within {
  width: 380px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.topbar .global-search input { min-width: 0; }
.global-search.is-loading > .bi-search { animation: gs-pulse .8s ease-in-out infinite alternate; }
@keyframes gs-pulse { from { opacity: 1; } to { opacity: .3; } }
.gs-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  max-height: min(72vh, 580px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1050;
}
.gs-group + .gs-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.gs-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
}
.gs-group-head .bi { margin-right: 4px; }
.gs-group-head a {
  text-transform: none; letter-spacing: 0; font-size: 12px;
  color: var(--primary); text-decoration: none;
}
.gs-group-head a:hover { text-decoration: underline; }
.gs-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none;
}
.gs-item.is-active { background: var(--surface-2); color: var(--text); }
.gs-item.is-active .gs-thumb { background: var(--primary-soft); color: var(--primary); }
.gs-thumb {
  flex: 0 0 34px; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px; overflow: hidden;
  background: var(--surface-2); color: var(--text-2);
  font-size: 15px;
}
.gs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gs-title, .gs-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-title { font-size: 13.5px; font-weight: 600; }
.gs-sub { font-size: 12px; color: var(--text-3); }
.gs-item mark { padding: 0; background: var(--gold-soft); color: inherit; border-radius: 2px; }
.gs-item .chip { flex: 0 0 auto; padding: 2px 8px; font-size: 11px; }
.gs-empty {
  display: grid; justify-items: center; gap: 4px;
  padding: 26px 16px; text-align: center;
  color: var(--text-2); font-size: 13px;
}
.gs-empty .bi { font-size: 24px; opacity: .45; }
.gs-empty small { color: var(--text-3); }
.gs-foot {
  display: flex; gap: 14px; justify-content: flex-end;
  border-top: 1px solid var(--line);
  margin-top: 4px; padding: 8px 10px 4px;
  font-size: 11.5px; color: var(--text-3);
}
.global-search .gs-foot kbd {
  font-family: var(--font); font-size: 10.5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  padding: 1px 5px; border-radius: 4px; margin-right: 3px;
}
@media (max-width: 1280px) {
  /* Less room here, so keep a fixed width instead of pushing the topbar around. */
  .topbar .global-search,
  .topbar .global-search:focus-within { width: 260px; }
}
@media (max-width: 600px) {
  /* Icon-sized until tapped, then it covers the topbar like a search bar. */
  .topbar .global-search { flex: 0 0 auto; width: 40px; margin: 0; justify-content: center; cursor: pointer; }
  .topbar .global-search:not(:focus-within) { gap: 0; overflow: hidden; }
  .topbar .global-search:focus-within {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: calc(100vw - 28px); z-index: 5;
  }
  .gs-panel { max-height: 75vh; }
  .gs-foot { display: none; }
}

.tb-icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
}
.tb-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.tb-icon-btn .badge-dot {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--surface);
}
.tb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.tb-user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #c0533a, #e0805a);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.tb-user .name { font-weight: 600; font-size: 13px; }
.tb-user .role { font-size: 11px; color: var(--text-3); }

.mobile-toggle { display: none; }

/* ============ CONTENT ============ */
.content { padding: 24px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-head h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-head p  { color: var(--text-2); margin: 4px 0 0; font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ============ CARDS / SURFACE ============ */
.card-s {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-s.no-border { border: 0; }
.card-s .card-s-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-s .card-s-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.card-s .card-s-head .sub { font-size: 12px; color: var(--text-3); }
.card-s .card-s-body { padding: 18px; }

/* ============ STAT CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1280px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.stat .stat-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 12px;
}
.stat.v-gold .stat-icon { background: var(--gold-soft); color: var(--gold); }
.stat.v-green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat.v-blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat.v-red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat.v-mute .stat-icon { background: var(--surface-2); color: var(--text-2); }
.stat .stat-label { font-size: 12px; color: var(--text-2); letter-spacing: .02em; }
.stat .stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.stat .stat-trend { font-size: 11.5px; margin-top: 6px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat .stat-trend.up { color: var(--green); }
.stat .stat-trend.down { color: var(--red); }

/* ============ TABLES ============ */
.t-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.t-table th, .t-table td {
  padding: 12px 14px;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.t-table th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  background: var(--surface-2);
}
.t-table tbody tr:hover td { background: var(--surface-2); }
.t-table tbody tr:last-child td { border-bottom: 0; }
.t-table .num {  font-variant-numeric: tabular-nums; }
.t-table tfoot td {
  background: var(--surface-2);
  font-weight: 700;
  border-top: 1px solid var(--line-2);
  border-bottom: 0;
}

/* ============ BADGES / CHIPS ============ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.chip .ind { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.success { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip.warn    { background: var(--gold-soft);  color: var(--gold);  border-color: transparent; }
.chip.danger  { background: var(--red-soft);   color: var(--red);   border-color: transparent; }
.chip.info    { background: var(--blue-soft);  color: var(--blue);  border-color: transparent; }
.chip.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ============ BUTTONS ============ */
.btn-s {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600; font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .05s, border-color .15s;
}
.btn-s:hover,
.btn-s:focus {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.btn-s:active { transform: translateY(1px); }
.btn-s.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-s.primary:hover,
.btn-s.primary:focus { background: var(--primary-2); color: #fff; }
.btn-s.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-s.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-s.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-s.success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-s.dark { background: #1b1814; color: #fff; border-color: #1b1814; }
.btn-s:disabled,
.btn-s.disabled {
  opacity: .58;
  cursor: not-allowed;
}
.btn-s.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-s.lg { padding: 12px 18px; font-size: 14px; }
.btn-s.block { width: 100%; justify-content: center; }
.icon-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 7px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }

/* ============ FORMS ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input-s, .select-s, .textarea-s {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input-s:focus, .select-s:focus, .textarea-s:focus {
  border-color: var(--primary);
}
.textarea-s { min-height: 76px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.field-row .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }

.switch {
  --w: 38px; --h: 22px;
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.switch input { display: none; }
.switch .track {
  width: var(--w); height: var(--h);
  background: var(--line-2); border-radius: 999px;
  position: relative; transition: background .15s;
}
.switch .track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: calc(var(--h) - 4px); height: calc(var(--h) - 4px);
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(calc(var(--w) - var(--h))); }

/* ============ DASHBOARD ============ */
.dash-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 12px 0 6px; }
.bar-chart .bar {
  flex: 1; background: linear-gradient(180deg, var(--primary), #d77056);
  border-radius: 6px 6px 2px 2px;
  position: relative;
  transition: transform .2s ease;
  min-width: 0;
  cursor: pointer;
}
.bar-chart .bar.alt { background: linear-gradient(180deg, var(--gold), #d6a85a); }
.bar-chart .bar:hover { transform: translateY(-2px); }
.bar-chart .bar .v {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--text-2); white-space: nowrap;
}
.bar-chart-x { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0 0; }
.bar-chart-x span { flex: 1; text-align: center; font-size: 11px; color: var(--text-3); }

.donut { width: 160px; height: 160px; position: relative; margin: 0 auto; }
.donut svg { transform: rotate(-90deg); }
.donut .center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  text-align: center;
}
.donut .center .lbl { font-size: 11px; color: var(--text-3); }
.donut .center .val { font-size: 18px; font-weight: 700; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

.popular-food {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.popular-food:last-child { border-bottom: 0; }
.popular-food .ph { width: 44px; height: 44px; border-radius: 8px; }
.popular-food .meta { flex: 1; min-width: 0; }
.popular-food .meta .n { font-weight: 600; font-size: 13.5px; }
.popular-food .meta .s { font-size: 11.5px; color: var(--text-3); }
.popular-food .qty { font-weight: 700; color: var(--primary);  }
.dashboard-popular-stat {
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-sales-chart .bar .v {
  display: none;
}
.dashboard-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dashboard-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.dashboard-lower-grid {
  align-items: start;
}
.dashboard-recent-table th,
.dashboard-recent-table td {
  padding: 10px 12px;
}
.dashboard-food-ph {
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.dashboard-compact-empty {
  padding: 30px 12px;
}
.dashboard-actions-card {
  margin-top: 16px;
}

.quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.quick-actions .qa {
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.quick-actions .qa:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.quick-actions .qa .bi { font-size: 18px; display: block; margin-bottom: 6px; }
.quick-actions .qa .l { font-size: 12px; font-weight: 600; }
@media (max-width: 720px) { .quick-actions { grid-template-columns: repeat(2,1fr); } }

/* ============ POS ============ */
.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  height: calc(100vh - 130px);
  min-height: 600px;
}
@media (max-width: 1200px) { .pos { grid-template-columns: 1fr; height: auto; } }

.pos-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pos-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.tabs .tab {
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
}
.tabs .tab.active { background: var(--primary); color: #fff; }
.tabs .tab:not(.active):hover { background: var(--surface-2); color: var(--text); }

.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cat-chips::-webkit-scrollbar { height: 4px; }
.cat-chips .cat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
}
.cat-chips .cat:hover { color: var(--text); }
.cat-chips .cat.active {
  background: var(--text); color: #fff; border-color: var(--text);
}
.cat-chips .cat .count {
  font-size: 11px;
  background: rgba(255,255,255,.18);
  padding: 1px 6px; border-radius: 6px;
}
.cat-chips .cat:not(.active) .count {
  background: var(--surface-2); color: var(--text-3);
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
  min-height: 240px;
}
.food-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  display: flex; flex-direction: column;
  align-self: start;
  min-height: 178px;
}
.food-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.food-card .img-ph {
  aspect-ratio: 4/3;
  border-radius: 8px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.food-card .img-ph .tag {
  position: absolute; top: 6px; left: 6px;
  font-size: 10px; font-weight: 600;
  background: rgba(0,0,0,.7); color: #fff;
  padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .05em;
}
.food-card .img-ph .var-badge {
  position: absolute; top: 6px; right: 6px;
  font-size: 9.5px; font-weight: 700;
  background: var(--gold); color: #fff;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase;
}
.food-card .n { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.food-card .p {
  margin-top: 4px;
  
  color: var(--primary);
  font-weight: 700;
  font-size: 13.5px;
}
.food-card .cat-tag {
  font-size: 10.5px; color: var(--text-3);
  margin-top: 2px; text-transform: uppercase; letter-spacing: .04em;
}

/* Photo placeholders — soft food-tone gradients with diagonal stripe */
.ph-stripe {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,.18) 0 10px, transparent 10px 20px),
    var(--ph-c, linear-gradient(135deg, #d8a373, #b66e3d));
}
.ph-1 { --ph-c: linear-gradient(135deg, #e0a877, #b8693a); }
.ph-2 { --ph-c: linear-gradient(135deg, #c9b079, #8a7438); }
.ph-3 { --ph-c: linear-gradient(135deg, #a6b886, #5d7a3c); }
.ph-4 { --ph-c: linear-gradient(135deg, #d28c8c, #93423f); }
.ph-5 { --ph-c: linear-gradient(135deg, #c8a1c0, #7d4b76); }
.ph-6 { --ph-c: linear-gradient(135deg, #8eb6c5, #3d6478); }
.ph-7 { --ph-c: linear-gradient(135deg, #d8c69e, #9a7f48); }
.ph-8 { --ph-c: linear-gradient(135deg, #c79085, #82473b); }


/* ============ ONGOING CARDS ============ */
.ongoing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.ongoing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.ongoing-card .o-head { display: flex; align-items: center; justify-content: space-between; }
.ongoing-card .o-table {
  font-weight: 700; font-size: 16px; letter-spacing: -.01em;
}
.ongoing-card .o-table .sub { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.ongoing-card .o-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  font-size: 12px;
}
.ongoing-card .o-meta .l { color: var(--text-3); }
.ongoing-card .o-amt {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.ongoing-card .o-amt .v { font-weight: 700;  font-size: 16px; color: var(--primary); }
.ongoing-card .o-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ MODALS (Bootstrap overrides) ============ */
.modal-dialog {
  max-height: calc(100vh - (var(--bs-modal-margin) * 2));
  max-height: calc(100dvh - (var(--bs-modal-margin) * 2));
}
.modal-content {
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - (var(--bs-modal-margin) * 2));
  max-height: calc(100dvh - (var(--bs-modal-margin) * 2));
  overflow: hidden;
}
.modal-content > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
  margin: 0;
  overflow: hidden;
}
.modal-header {
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  flex: 0 0 auto;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body {
  padding: 18px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.modal-footer {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  gap: 8px;
  flex: 0 0 auto;
  background: var(--surface);
}

/* ============ RECEIPT / KOT / INVOICE ============ */
.receipt {
  background: #fff;
  color: #181613;
  
  padding: 18px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  width: 320px;
  margin: 0 auto;
  border: 1px dashed #ccc;
}
.receipt h4 {
  text-align: center; margin: 0 0 4px;
  font-size: 16px; font-weight: 700;
  font-family: var(--font);
  letter-spacing: -.01em;
}
.receipt .center { text-align: center; }
.receipt .hr { border-top: 1px dashed #555; margin: 8px 0; }
.receipt .row-r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .row-r .l { color: #555; }
.receipt table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.receipt table th, .receipt table td {
  padding: 3px 0; font-size: 11.5px; text-align: left;
}
.receipt table th {
  border-bottom: 1px dashed #888;
  color: #444; text-transform: uppercase;
  font-weight: 600;
  font-size: 10.5px;
}
.receipt table td.num, .receipt table th.num { text-align: right; }
.receipt .grand-r {
  font-weight: 700; font-size: 14px;
  display: flex; justify-content: space-between;
  border-top: 2px solid #333; padding-top: 6px; margin-top: 6px;
}
.receipt .thanks { text-align: center; margin-top: 10px; font-style: italic; }
.kot { width: 280px; }
.kot h4 { text-transform: uppercase; }
.kot .stamp {
  display: inline-block;
  border: 2px solid #c0533a; color: #c0533a;
  padding: 2px 8px; border-radius: 6px;
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em;
  margin: 0 auto;
}

/* ============ POS Calculator Pad ============ */
.calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-pad button {
  padding: 10px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  
  transition: all .1s;
}
.calc-pad button:hover { background: var(--surface-2); }
.calc-pad button.op { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.calc-pad button.op:hover { background: var(--primary); color: #fff; }

/* ============ ROLES & PERMISSIONS ============ */
.perm-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(6, auto);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 12.5px;
}
.perm-grid .h, .perm-grid .c {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.perm-grid .h {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  background: var(--surface-2);
  text-align: center;
}
.perm-grid .h.l { text-align: left; }
.perm-grid .c { display: flex; align-items: center; justify-content: center; }
.perm-grid .c.l { justify-content: flex-start; font-weight: 600; }
.perm-grid .row:nth-child(even) .c { background: var(--surface-2); }

.checkbox-s {
  --sz: 18px;
  width: var(--sz); height: var(--sz);
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
  cursor: pointer;
  display: grid; place-items: center;
  background: var(--surface);
  transition: all .15s;
}
.checkbox-s:hover { border-color: var(--primary); }
.checkbox-s.checked {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.checkbox-s.checked::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ============ EMPTY STATE ============ */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-3);
}
.empty .bi { font-size: 42px; margin-bottom: 10px; opacity: .4; }
.empty h4 { font-size: 15px; color: var(--text-2); margin: 0 0 4px; }
.empty p { font-size: 13px; margin: 0; }

/* ============ MISC ============ */
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--text-3); }
.row-flex { display: flex; align-items: center; gap: 10px; }
.row-flex.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.hidden { display: none !important; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .mobile-toggle { display: grid; }
  .topbar .tb-title { display: none; }
  .topbar .tb-search { max-width: none; }
}

@media (max-width: 600px) {
  .topbar { padding: 10px 14px; }
  .content { padding: 16px; }
  .topbar .tb-search kbd, .topbar .tb-search input::placeholder { display: none; }
}

/* ============ PRINT ============ */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .modal-header, .modal-footer, .no-print { display: none !important; }
  .modal, .modal-dialog, .modal-content {
    position: static !important;
    box-shadow: none !important;
    border: 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    transform: none !important;
    display: block !important;
    opacity: 1 !important;
    overflow: visible !important;
  }
  .modal-content > form {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .modal-body { padding: 0 !important; overflow: visible !important; }
  .receipt { width: 100% !important; max-width: 320px; margin: 0 auto; border: 0; }
  .content {
    padding: 0 !important;
  }
  .report-print-area {
    color: #000;
  }
  .report-print-head {
    margin-bottom: 10px;
    border-bottom: 1px solid #000;
    padding-bottom: 8px;
  }
  .report-print-head p,
  .report-print-brand,
  .report-print-brand span {
    color: #333 !important;
  }
  .report-stats {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
  .report-stats .stat {
    box-shadow: none !important;
    border-color: #999 !important;
    break-inside: avoid;
  }
  .report-table-card {
    border: 0 !important;
    box-shadow: none !important;
  }
  .report-table th,
  .report-table td {
    color: #000 !important;
    background: #fff !important;
    border-bottom-color: #bbb !important;
    padding: 6px 5px !important;
    font-size: 11px !important;
  }
  .modal-backdrop { display: none !important; }
}

/* ============ LARAVEL ADMIN BASE ============ */
.brand,
.page-head h1,
.brand-mark {
  letter-spacing: 0;
}

.nav-item.disabled {
  opacity: .48;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-backdrop {
  display: none;
  border: 0;
  background: rgba(15,13,11,.42);
  position: fixed;
  inset: 0;
  z-index: 90;
}

.quick-actions.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.quick-actions .qa {
  color: inherit;
}

.quick-actions button.qa {
  appearance: none;
}

.quick-actions .qa:disabled {
  opacity: .72;
  cursor: not-allowed;
}

.input-s.is-invalid {
  border-color: var(--red);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 460px);
  background:
    radial-gradient(circle at 20% 20%, rgba(184,84,60,.12), transparent 28%),
    var(--bg);
}

.auth-panel {
  padding: clamp(28px, 5vw, 72px);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.auth-brand {
  border-bottom: 1px solid #2a251e;
  padding-left: 0;
}

.auth-copy {
  max-width: 620px;
}

.auth-copy h1 {
  color: #fff;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  margin: 18px 0 14px;
  letter-spacing: 0;
}

.auth-copy p {
  color: var(--sidebar-fg);
  font-size: 16px;
  max-width: 520px;
  margin: 0;
}

.auth-card {
  align-self: center;
  justify-self: center;
  width: min(100% - 32px, 420px);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

@media (max-width: 960px) {
  .app.sidebar-open .sidebar-backdrop { display: block; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel {
    min-height: auto;
    gap: 48px;
  }
  .auth-card {
    margin: 32px 0;
  }
}

@media (max-width: 600px) {
  .auth-copy h1 { font-size: 30px; }
  .auth-panel { padding: 24px; }
  .quick-actions.two-col { grid-template-columns: 1fr; }
}

/* ============ ROLES INDEX ============ */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.role-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.role-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.role-card-head .role-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
}
.role-card-head .role-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.role-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.role-form-top {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .role-form-top { grid-template-columns: 1fr; }
}

.perm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.switch .switch-label {
  color: var(--text-2);
}

.perm-check {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  margin: 0;
}
.perm-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.perm-check input:checked + .checkbox-s {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.perm-check input:checked + .checkbox-s::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.perm-na {
  color: var(--text-3);
  
  font-size: 14px;
  user-select: none;
}

.perm-grid .h {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.perm-grid .h.l { align-items: flex-start; }

/* ============ ADMIN USERS ============ */
.user-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}
.user-filter-card {
  color: inherit;
  text-decoration: none;
}
.user-filter-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,84,60,.12);
}
.user-list-card {
  overflow: hidden;
}
.user-list-head {
  align-items: center;
}
.user-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.user-search {
  min-width: min(320px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-2);
}
.user-search input {
  border: 0;
  background: transparent;
  outline: none;
  min-width: 0;
  width: 240px;
  color: var(--text);
  font-size: 13px;
}
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
}
.user-avatar.fallback,
.user-image-preview {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #d97056);
  color: #fff;
  font-weight: 700;
}
.pagination-wrap {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.pagination-wrap nav {
  margin: 0;
}
.user-form-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items: start;
}
.user-image-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-image-preview {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  font-size: 32px;
}
.user-image-preview.has-image span {
  display: none;
}
.user-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.user-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.btn-s:disabled {
  opacity: .56;
  cursor: not-allowed;
}
@media (max-width: 900px) {
  .user-stats { grid-template-columns: 1fr; }
  .user-list-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .user-filters {
    width: 100%;
    justify-content: flex-start;
  }
  .user-search,
  .user-search input {
    width: 100%;
  }
}
@media (max-width: 720px) {
  .user-form-grid { grid-template-columns: 1fr; }
  .user-image-preview {
    width: 96px;
    font-size: 24px;
  }
}

/* ============ SETTINGS ============ */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.settings-upload {
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 8px;
  border: 1px dashed var(--line-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  color: var(--text-3);
  background: var(--surface-2);
}
.settings-upload.dark {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
}
.settings-upload.light {
  background: #fff;
}
.settings-upload.favicon {
  width: 88px;
  aspect-ratio: 1;
  background: var(--primary-soft);
  color: var(--primary);
}
.settings-upload img {
  max-height: 100px;
  max-width: 100%;
  object-fit: cover;
}
.brand-logo-mark {
  padding: 5px;
}
.brand-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (max-width: 900px) {
  .brand-upload-grid { grid-template-columns: 1fr; }
  .settings-upload { max-width: 360px; }
}

/* ============ REUSABLE IMAGE UPLOAD ============ */
.image-upload-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.image-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.image-upload-drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  border: 1.5px dashed var(--line-2, #d8d2c5);
  border-radius: 12px;
  background: var(--surface-2, #faf7f1);
  color: var(--text-3, #7a6f5e);
  padding: 18px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.image-upload-drop:hover {
  border-color: var(--primary, #b8543c);
  color: var(--primary, #b8543c);
  background: var(--primary-soft, #fdeee9);
}
.image-upload-drop:focus-within {
  outline: none;
  border-color: var(--primary, #b8543c);
  box-shadow: 0 0 0 3px rgba(184, 84, 60, .18);
}
.image-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}
.image-upload-input:disabled { cursor: not-allowed; }

.image-upload-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}
.image-upload-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.image-upload-placeholder {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  padding: 6px 10px;
}
.image-upload-placeholder i {
  font-size: 28px;
  line-height: 1;
}
.image-upload-cta {
  font-weight: 600;
  font-size: 13px;
  color: inherit;
}
.image-upload-help {
  font-size: 11.5px;
  color: var(--text-3, #7a6f5e);
}

.image-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(31, 28, 24, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.image-upload-overlay i { font-size: 22px; }

.image-upload[data-image-upload-state="existing"] .image-upload-placeholder,
.image-upload[data-image-upload-state="selected"] .image-upload-placeholder {
  display: none;
}
.image-upload[data-image-upload-state="existing"] .image-upload-drop:hover .image-upload-overlay,
.image-upload[data-image-upload-state="selected"] .image-upload-drop:hover .image-upload-overlay {
  opacity: 1;
}

.image-upload.is-dragging .image-upload-drop {
  border-style: solid;
  border-color: var(--primary, #b8543c);
  background: var(--primary-soft, #fdeee9);
  color: var(--primary, #b8543c);
}
.image-upload.is-invalid .image-upload-drop,
.image-upload.has-error .image-upload-drop {
  border-color: #c0392b;
  background: rgba(192, 57, 43, .06);
  color: #a93222;
}

.image-upload-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}
.image-upload-filename {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.image-upload-clear {
  border: 0;
  background: transparent;
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.image-upload-clear:hover { background: rgba(192, 57, 43, .08); }

/* Size variants */
.image-upload-wide .image-upload-drop {
  aspect-ratio: 3 / 1;
  min-height: 120px;
}
.image-upload-square .image-upload-drop {
  aspect-ratio: 1 / 1;
  max-width: 220px;
  min-height: 160px;
}
.image-upload-favicon .image-upload-drop {
  width: 120px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  min-height: 0;
}
.image-upload-favicon .image-upload-placeholder i { font-size: 22px; }
.image-upload-favicon .image-upload-cta { font-size: 11px; }
.image-upload-favicon .image-upload-help { display: none; }

@media (max-width: 720px) {
  .image-upload-square .image-upload-drop { max-width: 100%; }
}

/* ============ PAYMENT METHODS ============ */
.compact-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}
.method-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.method-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .compact-stats { grid-template-columns: 1fr; }
}

/* ============ FLOOR & TABLE SETUP ============ */
.floor-icon {
  background: var(--blue-soft);
  color: var(--blue);
}
.table-icon {
  background: var(--gold-soft);
  color: var(--gold);
}
.kitchen-icon {
  background: var(--red-soft);
  color: var(--red);
}
.variant-icon {
  background: var(--blue-soft);
  color: var(--blue);
}
.category-icon {
  background: var(--gold-soft);
  color: var(--gold);
}
.food-thumb {
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.food-thumb i {
  font-size: 18px;
}
.food-preview {
  background: linear-gradient(135deg, var(--primary), #d36c52);
  color: #fff;
  font-size: 28px;
}
.food-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.food-variant-list {
  margin-top: 12px;
}

/* ============ POS ============ */
[v-cloak] { display: none !important; }

.pos-app .tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.pos-app .tabs .tab {
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pos-app .tabs .tab.active { background: var(--primary); color: #fff; }
.pos-app .tabs .tab:not(.active):hover { background: var(--surface-2); color: var(--text); }

.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 18px;
  height: calc(100vh - 200px);
  min-height: 600px;
}
@media (max-width: 1200px) {
  .pos { grid-template-columns: 1fr; height: auto; gap: 14px; }
}
.pos-left, .pos-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.pos-search {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pos-search .input-s { border: 0; padding: 6px 0; background: transparent; flex: 1; }

.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cat-chips::-webkit-scrollbar { height: 4px; }
.cat-chips .cat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
}
.cat-chips .cat:hover { color: var(--text); }
.cat-chips .cat.active { background: var(--text); color: #fff; border-color: var(--text); }
.cat-chips .cat .count {
  font-size: 11px;
  background: rgba(255,255,255,.18);
  padding: 1px 6px;
  border-radius: 6px;
}
.cat-chips .cat:not(.active) .count { background: var(--surface-2); color: var(--text-3); }
[data-theme="dark"] .cat-chips .cat.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme="dark"] .cat-chips .cat.active .count {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
  min-height: 240px;
}
.food-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  display: flex; flex-direction: column;
  align-self: start;
  height: 100%;
  min-height: 178px;
}
.food-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.food-card .img-ph {
  aspect-ratio: 4/3;
  border-radius: 8px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.food-card .img-ph .var-badge {
  position: absolute; top: 6px; right: 6px;
  font-size: 9.5px; font-weight: 700;
  background: var(--gold); color: #fff;
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase;
}
.food-card .n {
  font-weight: 600; font-size: 13.5px; line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.food-card .p {
  margin-top: auto;
  padding-top: 4px;
  
  color: var(--primary);
  font-weight: 700;
  font-size: 13.5px;
}
.food-card .p .from-tag { font-size: 11px; font-weight: 400; }
.food-card .cat-tag {
  font-size: 10.5px; color: var(--text-3);
  margin-top: 2px; text-transform: uppercase; letter-spacing: .04em;
}

.ph-stripe {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,.18) 0 10px, transparent 10px 20px),
    var(--ph-c, linear-gradient(135deg, #d8a373, #b66e3d));
  background-size: auto, cover;
}
.ph-1 { --ph-c: linear-gradient(135deg, #e0a877, #b8693a); }
.ph-2 { --ph-c: linear-gradient(135deg, #c9b079, #8a7438); }
.ph-3 { --ph-c: linear-gradient(135deg, #a6b886, #5d7a3c); }
.ph-4 { --ph-c: linear-gradient(135deg, #d28c8c, #93423f); }
.ph-5 { --ph-c: linear-gradient(135deg, #c8a1c0, #7d4b76); }
.ph-6 { --ph-c: linear-gradient(135deg, #8eb6c5, #3d6478); }
.ph-7 { --ph-c: linear-gradient(135deg, #d8c69e, #9a7f48); }
.ph-8 { --ph-c: linear-gradient(135deg, #c79085, #82473b); }

/* Food grid empty state spans every column instead of sitting in one cell */
.pos-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 340px;
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
}
.pos-empty-icon {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  box-shadow: 0 0 0 8px var(--surface-2);
  font-size: 26px;
}
.pos-empty h4 {
  max-width: 460px;
  margin: 0 0 6px;
  font-size: 16px; font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}
.pos-empty p { max-width: 340px; margin: 0; font-size: 13px; line-height: 1.5; }
.pos-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.pos-empty-actions:empty { display: none; }

/* Menu loading skeleton */
.food-card.is-skeleton { pointer-events: none; }
.food-card .sk,
.food-card.is-skeleton .img-ph {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.2s linear infinite;
}
.food-card .sk-line { height: 11px; width: 80%; margin-top: 6px; border-radius: 6px; }
.food-card .sk-line.short { width: 45%; margin-top: auto; }
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .food-card .sk, .food-card.is-skeleton .img-ph { animation: none; }
}

/* Cart */
.cart {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  height: 100%;
  overflow: hidden;
}
.cart.is-editing { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.cart-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.cart-head-icon {
  flex: 0 0 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 16px;
}
.cart.is-editing .cart-head-icon { background: var(--gold-soft); color: var(--gold); }
.cart-head-title { flex: 1; min-width: 0; }
.cart-head h3 { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.2; }
.cart-head .meta {
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px;
  font-size: 11.5px; color: var(--text-3);
}
.cart-count {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--text); color: var(--surface);
  font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cart-count.is-empty { background: var(--surface-2); color: var(--text-3); }
.cart-head .icon-btn:disabled,
.cart-head .icon-btn:disabled:hover {
  opacity: .45; cursor: not-allowed;
  background: var(--surface); color: var(--text-2); border-color: var(--line);
}

/* Customer / source / waiter / table — icon-prefixed, no label rows */
.cart-meta {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cart-meta .customer-selected { margin-top: 0; }
.cart-meta-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cart-meta-row.has-source { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cart-field { position: relative; display: block; margin: 0; min-width: 0; }
.cart-field > .bi {
  position: absolute; left: 10px; top: 17px;
  transform: translateY(-50%);
  z-index: 1;
  font-size: 13px; color: var(--text-3);
  pointer-events: none;
  transition: color .15s;
}
.cart-field:focus-within > .bi { color: var(--primary); }
.cart-field .input-s {
  height: 34px;
  padding: 6px 10px 6px 30px;
  font-size: 12.5px;
  background-color: var(--surface);
}
.cart-field .rs-trigger { padding-right: 10px; }

/* Line items */
.cart-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
}
.cart-empty {
  height: 100%; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 24px 18px;
  color: var(--text-3);
}
.cart-empty-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
  font-size: 24px;
}
.cart-empty h4 { font-size: 14px; font-weight: 700; color: var(--text-2); margin: 0 0 2px; }
.cart-empty p { font-size: 12px; margin: 0; }

.cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto 76px 24px;
  grid-template-areas: "no info qty tot del";
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background .15s;
}
.cart-item + .cart-item::before {
  content: "";
  position: absolute; top: 0; left: 8px; right: 8px;
  border-top: 1px dashed var(--line);
}
.cart-item:hover { background: var(--surface-2); }
.cart-item:hover::before,
.cart-item:hover + .cart-item::before { border-color: transparent; }
.cart-item-no {
  grid-area: no;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--surface-2); color: var(--text-3);
  font-size: 10.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cart-item-info { grid-area: info; min-width: 0; }
.cart-item .n {
  font-weight: 600; font-size: 13px; line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.cart-item .var {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px;
  margin-top: 2px;
  font-size: 11.5px; color: var(--text-3);
}
.cart-item .var-tag {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--gold-soft); color: var(--gold);
  font-size: 10.5px; font-weight: 600; line-height: 16px;
}
.cart-item .qty-stepper { grid-area: qty; }
.cart-item .ln-tot {
  grid-area: tot;
  text-align: right;
  font-weight: 700; font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.cart-item-remove {
  grid-area: del;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
}
.cart-item-remove:hover { background: var(--red-soft); color: var(--red); }

.qty-stepper {
  display: inline-flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.qty-stepper button {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--text-2); font-size: 15px;
  cursor: pointer;
}
.qty-stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.qty-stepper button .bi-trash3 { font-size: 11.5px; }
.qty-stepper .q {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-weight: 700; font-size: 13px;
}

/* Flash the line that was just added (restarted from pos.js on every add) */
.cart-item.is-flash { animation: cart-flash 1.6s ease-out; }
.cart-item.is-flash .q { animation: cart-qty-pop .4s ease-out; }
@keyframes cart-flash {
  0%, 55% { background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(231, 76, 60, .45); }
  100% { background: transparent; box-shadow: inset 0 0 0 1px transparent; }
}
@keyframes cart-qty-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); color: var(--primary); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cart-item.is-flash .q { animation: none; }
}

/* Footer: adjustments, summary, total, actions */
.cart-foot {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.cart-adjust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.adj { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.adj-l {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3);
}
.adj-field {
  display: flex; align-items: center;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.adj-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.adj-field input {
  flex: 1; width: 100%; min-width: 0; height: 100%;
  padding: 0 8px;
  border: 0; outline: none; background: transparent;
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}
.adj-field input::-webkit-outer-spin-button,
.adj-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.adj-seg { flex: 0 0 auto; display: flex; gap: 2px; padding: 3px; }
.adj-seg button {
  min-width: 22px; height: 24px;
  padding: 0 5px;
  border: 0; border-radius: 5px;
  background: transparent; color: var(--text-3);
  font-size: 11px; font-weight: 700;
  cursor: pointer;
}
.adj-seg button:hover { color: var(--text); }
.adj-seg button.active { background: var(--primary-soft); color: var(--primary); }
.adj-suffix { flex: 0 0 auto; padding: 0 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--text-3); }

.cart-summary { display: flex; flex-direction: column; gap: 3px; }
.sum-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--text-2);
}
.sum-row small { font-size: 11px; color: var(--text-3); }
.sum-row .mono { color: var(--text); font-weight: 600; white-space: nowrap; }
.sum-row.is-discount .mono { color: var(--green); }
.sum-row.is-strong,
.sum-row.is-strong .mono { font-weight: 700; color: var(--text); }
.cart-summary.is-platform {
  padding: 8px 10px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: var(--surface);
}

.cart-total {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.cart-total .lbl {
  font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-2);
}
.cart-total .v { font-size: 20px; font-weight: 800; line-height: 1.1; color: var(--primary); white-space: nowrap; }

.cart-cta { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px; }
.cart-cta.is-editing { grid-template-columns: auto minmax(0, 1fr); }
.cart-cta .btn-s { height: 42px; padding: 0 14px; justify-content: center; white-space: nowrap; }
.cart-cta .btn-s.primary { box-shadow: 0 4px 12px rgba(231, 76, 60, .25); }

/* Totals rows used by the payment modal and order details */
.tot-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.tot-row .v {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.grand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px;
  border-radius: 10px;
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(0,0,0,.03), rgba(0,0,0,.01));
  border: 1px dashed var(--line-2);
  font-weight: 700;
  font-size: 17px;
}
.grand .v {  color: var(--primary); font-size: 19px; }
.btn-s.dark {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-s.dark:hover { background: var(--text-2); border-color: var(--text-2); }
[data-theme="dark"] .btn-s.dark {
  background: #2a251f;
  border-color: #3a332a;
  color: var(--text);
}
[data-theme="dark"] .btn-s.dark:hover,
[data-theme="dark"] .btn-s.dark:focus {
  background: #342e26;
  border-color: #4a4035;
  color: #fff;
}

.pos-tab-pending {
  padding: 56px 24px;
}

/* Variant picker modal */
.variant-pick-list { display: flex; flex-direction: column; gap: 8px; }
.variant-pick-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  transition: all .12s;
}
.variant-pick-row:hover { border-color: var(--primary); }
.variant-pick-row.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.variant-pick-check {
  color: var(--primary);
  font-size: 18px;
  opacity: 0;
}
.variant-pick-row.selected .variant-pick-check { opacity: 1; }
.variant-pick-info { display: flex; flex-direction: column; }

/* Ongoing cards */
.ongoing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.ongoing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.ongoing-card .o-head {
  display: flex; align-items: center; justify-content: space-between;
}
.ongoing-card .o-table {
  font-weight: 700;
  font-size: 16px;
}
.ongoing-card .o-table .sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 2px;
}
.ongoing-card .o-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ongoing-card .o-meta .l {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
}
.ongoing-card .o-amt {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-weight: 700;
}
.ongoing-card .o-amt .v {
  
  font-size: 16px;
  color: var(--primary);
}

.ongoing-card .o-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.food-variant-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(110px, 1fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.food-variant-margin { grid-column: 1 / -1; margin-top: -4px; }
.food-variant-margin:empty { display: none; }
@media (max-width: 768px) {
  .food-variant-row {
    grid-template-columns: 1fr 1fr;
  }
}
.cost-margin-hint { font-size: 11.5px; color: var(--text-3); margin-top: -4px; }
.cost-margin-hint.is-good { color: var(--green); }
.cost-margin-hint.is-low { color: var(--gold); }
.cost-margin-hint.is-loss { color: var(--red); font-weight: 600; }

/* Profit & loss statement */
.pl-statement { display: flex; flex-direction: column; }
.pl-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.pl-line .pl-value { font-family: var(--mono, monospace); white-space: nowrap; }
.pl-line.is-less .pl-label { padding-left: 14px; color: var(--text-2); }
.pl-line.is-subtotal { background: var(--surface-2); font-weight: 600; }
.pl-line.is-total { font-weight: 700; font-size: 15px; border-bottom: 0; }
.pl-line.is-total.is-profit .pl-value { color: var(--green); }
.pl-line.is-total.is-loss .pl-value { color: var(--red); }
.pl-line.is-info { color: var(--text-3); font-size: 12.5px; }
.pl-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--text);
  font-size: 13px;
}
.pl-warning i { color: var(--gold); font-size: 18px; line-height: 1; }
.text-profit { color: var(--green); }
.text-loss { color: var(--red); }
.waiter-avatar,
.waiter-preview {
  background: linear-gradient(135deg, var(--green), #6aa77c);
}
.setup-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.setup-filter-select {
  width: auto;
  min-width: 150px;
}
.setup-filter-search {
  width: min(260px, 100%);
}
.order-filters {
  max-width: 980px;
}
.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.order-detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.order-detail-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
}
.order-payment-line,
.order-totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.order-totals > div:first-child { padding-top: 0; }
.order-totals .grand {
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--line-2);
  margin-top: 4px;
  padding-top: 10px;
}
.report-filter-card {
  margin-bottom: 16px;
}
.report-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 760px;
}
.report-actions .report-tab.active,
.report-actions .report-tab.active:hover,
.report-actions .report-tab.active:focus {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
  box-shadow: 0 0 0 3px rgba(31, 28, 24, .08);
}
.payment-report-methods {
  margin-bottom: 16px;
}
.payment-report-method-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.payment-method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.payment-method-tab {
  min-height: 42px;
}
.payment-method-tab.active,
.payment-method-tab.active:hover,
.payment-method-tab.active:focus {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184, 84, 60, .12);
}
.payment-method-tab .chip {
  padding: 2px 7px;
}
.payment-report-empty {
  padding: 28px 18px 10px;
}
.payment-report-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}
[data-payment-report-table].is-loading {
  opacity: .72;
}
.payment-report-row-message {
  padding: 34px 18px !important;
  color: var(--text-3);
  text-align: center !important;
}
.payment-report-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.report-filters {
  width: 100%;
  max-width: none;
  justify-content: flex-start;
}
.report-filters .field {
  min-width: 180px;
  margin: 0;
}
.report-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  align-self: end;
}
.report-print-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.report-print-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}
.report-print-head p {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
}
.report-print-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--text-2);
}
.report-print-brand span {
  font-size: 12px;
  color: var(--text-3);
}
.report-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.food-report-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.report-table-card {
  margin-top: 16px;
}
.table-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}
.table-status-stat {
  color: inherit;
  text-decoration: none;
}
.table-status-stat.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,84,60,.12);
}
.table-status-stat .stat-icon.success {
  background: var(--green-soft);
  color: var(--green);
}
.table-status-stat .stat-icon.warn {
  background: var(--gold-soft);
  color: var(--gold);
}
.table-status-stat .stat-icon.info {
  background: var(--blue-soft);
  color: var(--blue);
}
.table-status-stat .stat-icon.danger {
  background: var(--red-soft);
  color: var(--red);
}
@media (max-width: 1280px) {
  .table-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .table-stats { grid-template-columns: 1fr; }
  .setup-filters {
    width: 100%;
    justify-content: flex-start;
  }
  .setup-filter-select {
    width: 100%;
  }
  .setup-filter-search {
    width: 100%;
  }
  .order-detail-grid,
  .order-detail-footer {
    grid-template-columns: 1fr;
  }
  .report-filters .field,
  .report-filter-actions {
    width: 100%;
  }
  .report-filter-actions {
    align-self: stretch;
  }
  .report-filter-actions .btn-s {
    flex: 1;
  }
  .report-actions {
    justify-content: flex-start;
    max-width: none;
  }
  .report-actions .btn-s {
    flex: 1 1 auto;
    justify-content: center;
  }
  .payment-method-tab {
    flex: 1 1 180px;
    justify-content: center;
  }
  .payment-report-stats {
    grid-template-columns: 1fr;
  }
  .report-print-head {
    flex-direction: column;
  }
  .report-print-brand {
    align-items: flex-start;
  }
  .report-stats {
    grid-template-columns: 1fr;
  }
  .food-report-stats {
    grid-template-columns: 1fr;
  }
}

/* ============ VARIANTS ============ */
.variant-value-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 520px;
}
.variant-values-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.variant-values-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.variant-value-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.variant-switch {
  min-height: 38px;
}
.variant-value-status {
  min-width: 0;
}
@media (max-width: 720px) {
  .variant-values-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .variant-value-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   STEP 31 — UI POLISH & RESPONSIVE REFINEMENTS
   ========================================================= */

/* All horizontally-laid tables wrapped in .card-s-body.p-0 scroll on overflow.
   Keeps table layout intact instead of squashing columns on mobile. */
.card-s-body.p-0 {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.card-s-body.p-0 .t-table {
  min-width: 640px;
}

/* Page header stacks on narrow viewports so action buttons get their own row. */
@media (max-width: 720px) {
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .page-head .page-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .page-head .page-actions .btn-s {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Modals: tighten gutters on phones so dialogs do not crowd the edges. */
@media (max-width: 600px) {
  .modal-dialog {
    --bs-modal-margin: 12px;
    margin: 12px;
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .modal-footer {
    flex-wrap: wrap;
  }
  .modal-footer .btn-s {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* POS: on mobile, drop the fixed grid height so the food grid and cart
   both scroll naturally with the page instead of fighting each other. */
@media (max-width: 1200px) {
  .pos {
    height: auto;
    min-height: 0;
  }
  .food-grid {
    max-height: none;
    overflow: visible;
  }
  .cart {
    height: auto;
  }
  .cart-body {
    max-height: 360px;
  }
}

/* Smallest screens: cart lines wrap to two rows and Cancel becomes icon-only. */
@media (max-width: 480px) {
  .cart-item {
    grid-template-columns: 20px minmax(0, 1fr) auto 24px;
    grid-template-areas: "no info info del" ". qty tot tot";
    row-gap: 6px;
  }
  .cart-item .qty-stepper { justify-self: start; }
  .cart-cta { grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr); }
  .cart-cta.is-editing { grid-template-columns: 42px minmax(0, 1fr); }
  .cart-cta .btn-s { padding: 0 10px; }
  .cart-cta .cta-label { display: none; }
  .grand { font-size: 16px; padding: 10px; }
  .grand .v { font-size: 18px; }
}

/* Topbar spacing on mid screens — keep theme + bell visible, hide the
   collapse button (sidebar is hidden behind a drawer below 960px anyway). */
@media (max-width: 960px) {
  .topbar [data-sidebar-collapse] {
    display: none !important;
  }
  .topbar .tb-crumb {
    display: none;
  }
}

/* Sidebar backdrop is part of the .app shell — only render under mobile. */
.sidebar-backdrop {
  cursor: pointer;
}

/* Empty + loading skeletons */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--line) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: rms-skeleton 1.2s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}
.skeleton.line { height: 12px; margin-bottom: 8px; }
.skeleton.line.short { width: 40%; }
.skeleton.line.long { width: 90%; }
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px dashed var(--line);
}
.skeleton-row .skeleton.block {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.skeleton-row .skeleton-text { flex: 1; }
@keyframes rms-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Inline loader (button busy state) */
.btn-s.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-s.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: #fff;
  animation: rms-spin .7s linear infinite;
}
.btn-s.is-loading:not(.primary):not(.danger):not(.dark):not(.success)::after {
  color: var(--primary);
}
@keyframes rms-spin {
  to { transform: rotate(360deg); }
}

/* Consistent empty-state alignment inside card bodies that pad to 0 */
.card-s-body.p-0 .empty {
  padding: 48px 20px;
}

/* Bootstrap-Icons spin helper for inline loading affordances */
.bi-spin { animation: rms-spin 1s linear infinite; display: inline-block; }

/* Tighter chip line-height when used inside compact toolbars */
.row-flex .chip,
.user-filters .chip { line-height: 1.2; }

/* Print refinements */
@media print {
  @page {
    margin: 8mm;
  }
  html, body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar-backdrop,
  .topbar .tb-search,
  .topbar .tb-icon-btn,
  .topbar .tb-user,
  .page-actions,
  .pagination-wrap { display: none !important; }
  .receipt {
    border: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .receipt table { page-break-inside: auto; }
  .receipt table tr { page-break-inside: avoid; page-break-after: auto; }
  .kot { width: 280px !important; }
}











.pagination {
    gap: 6px;
}

.pagination .page-link {
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 13px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-2);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}

.pagination .page-link:hover {
    background: var(--surface-2);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: var(--shadow);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
    box-shadow: none;
}

.pagination .page-link:active {
    transform: scale(0.95);
}

.pagination-wrap .text-muted {
    font-size: 13px;
    color: var(--text-3) !important;
}

.notiflix-confirm-buttons a{
  text-decoration: none;
}




.dropdown-menu{
    border:none!important;
    border-radius:14px;
    padding:8px 0;
    min-width:240px;
    background:#fff;
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
    margin-top:-10px;
    transform:translateY(10px);
    opacity:0;
    transition:all .2s ease;
}

/* ONLY animate when Bootstrap adds .show */
.dropdown-menu.show{
    transform:translateY(0);
    opacity:1;
}

.dropdown-item{
    padding:10px 16px;
    font-size:14px;
    border-radius:8px;
    margin:2px 6px;
    transition:all .2s ease;
}

.dropdown-item:hover{
    background:rgba(0,0,0,0.05);
}

.tb-user i.bi-chevron-down{
    transition:transform .2s ease;
}

/* IMPORTANT: target correct parent */
.dropdown.show .bi-chevron-down{
    transform:rotate(180deg);
}

/* ===== Branches: topbar switcher + user assignment picker ===== */
.branch-switcher .branch-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
}

.branch-switcher .branch-switch-btn > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-switcher .dropdown-menu {
  min-width: 240px;
}

.branch-switcher .dropdown-item.active,
.branch-switcher .dropdown-item:active {
  background: var(--primary-soft);
  color: var(--text);
}

.branch-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.branch-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}

.branch-option:hover {
  border-color: var(--line-2);
}

.branch-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.branch-option:has(input:disabled) {
  opacity: .55;
  cursor: not-allowed;
}

.branch-option-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-option-code {
  font-size: 11px;
  color: var(--text-3);
}

/* ===== Customers: due collection ===== */
.due-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 14px;
}

.due-orders-wrap {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.due-orders-wrap .t-table {
  margin: 0;
}

/* ===== POS: customer picker ===== */
.icon-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.icon-btn.primary:hover {
  background: var(--primary-2);
  border-color: var(--primary-2);
  color: #fff;
}

.customer-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-picker-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.customer-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
}

.customer-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.customer-option:hover {
  background: var(--surface-2);
}

.customer-option.is-empty {
  color: var(--text-3);
  cursor: default;
  justify-content: center;
}

.customer-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-option-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-3);
}

.customer-selected {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.due-flag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Rooms & in-room dining */
.room-link-card { margin-bottom: 18px; }
.room-link-card .card-s-body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.room-link-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  flex: none;
}
.room-link-text { flex: 1 1 320px; min-width: 0; }
.room-link-text h3 { margin: 0 0 2px; font-size: 15px; }
.room-link-text p { margin: 0 0 6px; color: var(--text-2); font-size: 13px; }
.room-link-url {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  word-break: break-all;
}
.room-link-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.room-qr-box { display: inline-block; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.room-qr-box img, .room-qr-box canvas { display: block; }

.tab .tab-count {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid; place-items: center;
}
.room-order-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.room-order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.room-order-card.is-new { animation: room-order-flash 1.6s ease-out 2; }
@keyframes room-order-flash { 0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, .45); } 100% { box-shadow: 0 0 0 14px rgba(231, 76, 60, 0); } }
.room-order-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.room-order-room { font-size: 20px; font-weight: 700; line-height: 1.1; }
.room-order-room small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); margin-top: 2px; }
.room-order-age { text-align: right; font-size: 12px; color: var(--text-3); }
.room-order-age strong { display: block; font-size: 13px; color: var(--blue); }
.room-order-age.is-late strong { color: var(--red); }
.room-order-guest { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 16px 10px; font-size: 13px; color: var(--text-2); }
.room-order-guest a { color: inherit; }
.room-order-items { margin: 0 16px; padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.room-order-item { display: flex; gap: 8px; font-size: 13.5px; padding: 2px 0; }
.room-order-item .q { font-weight: 700; color: var(--primary); min-width: 26px; }
.room-order-item .n { flex: 1; }
.room-order-item .n small { color: var(--text-3); }
.room-order-item .n em { display: block; font-size: 12px; color: var(--gold); font-style: normal; }
.room-order-note { margin: 10px 16px 0; padding: 8px 10px; border-radius: 8px; background: var(--gold-soft); font-size: 12.5px; }
.room-order-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 14px; margin-top: auto; flex-wrap: wrap; }
.room-order-total { font-weight: 700; font-size: 16px; margin-right: auto; }
.room-order-foot .select-s, .room-order-foot .input-s { max-width: 150px; height: 34px; }

/* =========================================================
   RESPONSIVE AUDIT — CROSS-DEVICE FIXES
   ========================================================= */

/* Tables in .table-responsive scrolled but had no min-width, so columns
   squashed instead of scrolling on phones. Applies to every list page. */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table-responsive > .t-table { min-width: 680px; }

/* Modal tables are narrower by nature — smaller floor keeps them readable
   without forcing a scroll on tablets. */
.modal .table-responsive > .t-table { min-width: 520px; }

/* Print/invoice tables must never force a scroll width. */
@media print {
  .table-responsive > .t-table,
  .modal .table-responsive > .t-table { min-width: 0 !important; }
}

/* Filter/search bars: stack and go full width on phones so controls
   never overflow the card. */
@media (max-width: 600px) {
  .setup-filters,
  .report-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .setup-filters > *,
  .report-filters > * {
    width: 100%;
  }
  .card-s .card-s-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-s .card-s-head .page-actions,
  .card-s .card-s-head .btn-s {
    width: 100%;
    justify-content: center;
  }
}

/* Topbar: on phones the branch switcher label and user meta crowd the row. */
@media (max-width: 600px) {
  .topbar { gap: 8px; }
  .topbar .branch-switch-btn span { display: none; }
  .tb-user { padding: 3px; }
  .tb-user .bi-chevron-down { display: none; }
}

/* Long email/name cells were forcing horizontal page scroll. */
/* No word-break here on purpose: it broke button labels and chips
   mid-word ("Vie w", "Cancell ed"). Mobile uses stacked cards instead. */
.t-table td { overflow-wrap: break-word; }
.t-table td .btn-s, .t-table td .chip { white-space: nowrap; }

/* Purchase history: keep the table scrollable at every width, and let the
   date bar wrap cleanly on phones. */
.ph-table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ph-table { min-width: 720px; }

@media (max-width: 768px) {
  .ph-bar { flex-direction: column; align-items: stretch; }
  .ph-bar-left { flex-wrap: wrap; justify-content: flex-start; }
  .ph-bar-right { width: 100%; }
  .ph-search-form { flex: 1; }
  .ph-bar-date { flex: 1 1 auto; }
  .ph-date-input { flex: 1; min-width: 0; }
}
@media (max-width: 420px) {
  .ph-bar-day { display: none; }
  .ph-add-btn { width: 100%; justify-content: center; }
}

/* Pagination wraps instead of overflowing when there are many pages. */
.ph-pagination .pagination,
.pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }

/* Guard against any child forcing horizontal scroll of the whole page.
   No overflow-x here on purpose — it would clip dropdowns and popovers. */
.content > * { max-width: 100%; }
.main { min-width: 0; }

/* =========================================================
   POS — MOBILE OVERFLOW FIXES
   ========================================================= */

/* The tab strip is inline-flex, so four tabs sized to their content and
   pushed the whole page wider than a phone viewport, forcing the entire
   layout to scroll sideways. Let it scroll on its own instead. */
.page-actions { min-width: 0; max-width: 100%; }
.tabs { max-width: 100%; }

@media (max-width: 900px) {
  .tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

/* Every POS flex/grid child needs min-width:0 or its content sets the
   floor width and overflows the shell. */
.pos, .pos-left, .pos-right { min-width: 0; }
.pos-left > *, .pos-right > * { min-width: 0; max-width: 100%; }
.pos-app { min-width: 0; max-width: 100%; }

/* Category chips already scroll — make sure the row itself cannot stretch. */
.cat-chips { max-width: 100%; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }

@media (max-width: 600px) {
  /* Two comfortable columns at 393px instead of three cramped ones. */
  .food-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .food-card .n { font-size: 12.5px; overflow-wrap: anywhere; }
  .pos-search { padding: 8px 10px; }
  .cart-meta-row.has-source { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart-meta-row.has-source > :first-child { grid-column: 1 / -1; }
  .cart-body { max-height: 300px; }
  .page-head h1 { font-size: 19px; }
}

@media (max-width: 400px) {
  .food-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   GLOBAL MOBILE OVERFLOW GUARD
   ========================================================= */

/* Grid and flex children default to min-width:auto, so their content sets
   the floor width and pushes the shell wider than the screen. Zeroing it
   on the shell and the dashboard/list containers is the structural fix. */
.app, .main, .content { min-width: 0; }
.dash-grid, .stats-grid, .quick-actions, .role-grid { min-width: 0; }
.dash-grid > *, .stats-grid > *, .quick-actions > *, .role-grid > * { min-width: 0; }
.card-s, .card-s-head, .card-s-body { min-width: 0; }
.card-s-head > * { min-width: 0; }

/* Long unbroken values (invoice codes, emails, food names) were the usual
   trigger for the overflow above. */
.stat-value, .dashboard-status-row, .dashboard-status-row > * { min-width: 0; }
.stat-value.mono { overflow-wrap: anywhere; }

/* Belt-and-braces: nothing may scroll the page itself sideways on phones.
   Only on <html> — putting overflow-x on <body> would make body the scroll
   container and break the sticky topbar. */
@media (max-width: 960px) {
  html { overflow-x: hidden; }
  body { max-width: 100%; }
}

/* =========================================================
   MOBILE — TABLES AS STACKED CARDS
   =========================================================
   Below 768px a wide table squeezed every column until words broke
   mid-letter ("Com plete d"). Instead each row becomes a card and each
   cell a "label left / value right" line. Labels come from data-label,
   which app.js copies off the matching <th>. */

@media (max-width: 768px) {
  /* Stop the horizontal scroll — rows are full width now. */
  .table-responsive { overflow-x: visible; }
  .card-s-body.p-0 { overflow-x: visible; }
  .table-responsive > .t-table,
  .modal .table-responsive > .t-table,
  .card-s-body.p-0 .t-table { min-width: 0; }

  .t-table { display: block; border-collapse: collapse; }
  .t-table thead { display: none; }
  .t-table tbody { display: block; }

  .t-table tbody tr {
    display: block;
    margin: 0 12px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .t-table tbody tr:hover { background: var(--surface); }

  .t-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: auto;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    font-size: 13px;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .t-table tbody tr td:last-child { border-bottom: 0; }

  .t-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-3);
  }
  /* Cells with no header (action columns) keep the value full width. */
  .t-table tbody td:not([data-label])::before,
  .t-table tbody td[data-label=""]::before { content: none; }
  .t-table tbody td:not([data-label]),
  .t-table tbody td[data-label=""] { justify-content: flex-end; }

  /* Identity cell (thumbnail + name + subtitle) becomes the card header:
     full width, no label, so the name and description are not cut off. */
  .t-table tbody td[data-media] {
    justify-content: flex-start;
    text-align: left;
    padding: 12px;
    background: var(--surface-2);
  }
  .t-table tbody td[data-media]::before { content: none; }
  .t-table tbody td[data-media] .user-cell {
    min-width: 0;
    width: 100%;
    gap: 12px;
    align-items: flex-start;
  }
  .t-table tbody td[data-media] .user-cell > div { min-width: 0; }
  .t-table tbody td[data-media] .user-cell .fw-semibold { font-size: 14px; }
  .t-table tbody td[data-media] .user-cell .muted { white-space: normal; }
  .t-table tbody td[data-media] .user-avatar { width: 44px; height: 44px; }

  /* Identity cells without a .user-cell wrapper (icon + text, or plain
     text such as an order number) still read as the card's heading. */
  .t-table tbody td[data-media] > * { min-width: 0; }
  .t-table tbody td[data-media] .fw-semibold,
  .t-table tbody td[data-media] .mono { font-size: 14px; font-weight: 700; }
  .t-table tbody td[data-media] .muted { white-space: normal; }

  /* A picture in any other column keeps its label but never overflows. */
  .t-table tbody td[data-haspic]:not([data-media]) { flex-wrap: wrap; }
  .t-table tbody td[data-haspic] img { max-width: 100%; height: auto; }

  /* Same for the purchase-history receipt column. */
  .ph-table tbody td img { max-width: 100%; height: auto; }

  /* Right-hand side of each line: let chips and buttons wrap neatly. */
  .t-table tbody td > * { min-width: 0; }
  .t-table tbody td .d-flex,
  .t-table tbody td .row-actions,
  .t-table tbody td .table-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* Action buttons get their own full-width line. */
  .t-table tbody td:last-child { flex-wrap: wrap; }

  /* Footer totals get the same label/value lines — otherwise the numbers
     run together with nothing saying which column each belongs to. */
  .t-table tfoot { display: block; }
  .t-table tfoot tr {
    display: block;
    margin: 0 12px 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .t-table tfoot td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    font-weight: 700;
  }
  .t-table tfoot tr td:last-child { border-bottom: 0; }
  .t-table tfoot td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-3);
  }
  /* The spanning "Total" cell is a heading for the block, not a pair. */
  .t-table tfoot td[data-span] {
    justify-content: flex-start;
    text-align: left;
    background: var(--surface);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-2);
  }
  .t-table tfoot td[data-span]::before { content: none; }
  .t-table tfoot td:not([data-label]):not([data-span])::before,
  .t-table tfoot td[data-label=""]::before { content: none; }
  .t-table tfoot td:empty { display: none; }

  /* Table already carries the card border now. */
  .card-s-body.p-0 { padding-top: 12px; padding-bottom: 2px; }
}

/* Purchase history uses its own table markup — same treatment. */
@media (max-width: 768px) {
  .ph-table-card { overflow-x: visible; border: 0; background: transparent; }
  .ph-table { min-width: 0; display: block; }
  .ph-table thead { display: none; }
  .ph-table tbody { display: block; }
  .ph-table tbody tr {
    display: block; margin-bottom: 10px;
    background: #fff; border: 1px solid #eaedf1; border-radius: 10px; overflow: hidden;
  }
  .ph-table tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 12px; text-align: right; border-bottom: 1px solid #f3f4f6;
  }
  .ph-table tbody tr td:last-child { border-bottom: 0; }
  .ph-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%; text-align: left;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: #9ca3af;
  }
  .ph-td-ellipsis { max-width: none; white-space: normal; }
  .ph-table tfoot { display: block; }
  .ph-table tfoot tr {
    display: flex; justify-content: space-between; gap: 8px;
    background: #f9fafb; border: 1px solid #eaedf1; border-radius: 10px; padding: 10px 12px;
  }
  .ph-table tfoot td { display: inline; border: 0; padding: 0; background: none; }
  .ph-table tfoot td:empty { display: none; }
}

/* =========================================================
   CATEGORY CAROUSEL (POS)
   =========================================================
   The chip row scrolled but the scrollbar is hidden, so there was no clue
   more categories existed. Arrows sit beside the track rather than on top
   of it, so no chip is ever covered and no shadow is needed. */
.cat-carousel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cat-carousel > .cat-chips {
  flex: 1 1 auto;
  min-width: 0;
  scroll-behavior: smooth;
}
.cat-nav {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.cat-nav:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.cat-nav[hidden] { display: none; }

@media (max-width: 600px) {
  .cat-nav { width: 28px; height: 28px; font-size: 12px; }
  .cat-carousel { gap: 6px; }
}

/* =========================================================
   CUSTOM SELECT (enhanced from native <select> in app.js)
   ========================================================= */
.rs-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%);
  pointer-events: none !important;
}

.rs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  line-height: normal;
  cursor: pointer;
  user-select: none;
}
.rs-trigger .rs-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rs-trigger.is-placeholder .rs-value { color: var(--text-3); }
.rs-caret {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-3);
  transition: transform .18s ease, color .15s;
}
.rs-trigger:hover:not(:disabled) { border-color: var(--line-2); }
.rs-trigger:focus-visible,
.rs-trigger.is-open {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.rs-trigger.is-open .rs-caret { transform: rotate(180deg); color: var(--primary); }
.rs-trigger.is-invalid { border-color: var(--red); }
.rs-trigger.is-invalid:focus-visible,
.rs-trigger.is-invalid.is-open { box-shadow: 0 0 0 3px var(--red-soft); }
.rs-trigger:disabled {
  cursor: not-allowed;
  opacity: .65;
  background: var(--surface-2);
}
/* List-card filter bars use all the space beside the title, so the controls
   stay on one line instead of wrapping while there is still room. */
.card-s-head > .user-filters,
.card-s-head > .setup-filters { flex: 1 1 auto; }
.card-s-head > .user-filters .user-search,
.card-s-head > .setup-filters .user-search { flex: 0 1 280px; min-width: 200px; }
.card-s-head > .user-filters .user-search input,
.card-s-head > .setup-filters .user-search input { width: 100%; }

/* Heads with many filters (orders): title on top, filters on one full-width row. */
.card-s-head.has-wide-filters { flex-wrap: wrap; }
.card-s-head.has-wide-filters > .user-filters {
  flex: 1 1 100%;
  max-width: none;
  justify-content: flex-start;
}

/* Filter bars: size to the label like a native select instead of taking a whole row. */
.rs-trigger.setup-filter-select {
  width: auto;
  min-width: 150px;
  max-width: 240px;
  flex: 0 1 auto;
}
@media (max-width: 900px) {
  .rs-trigger.setup-filter-select { width: 100%; max-width: none; }
}

.rs-panel {
  position: fixed;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(31, 28, 24, .16), 0 2px 6px rgba(31, 28, 24, .06);
  overflow: hidden;
  font-size: 13px;
  animation: rs-drop .14s ease-out;
}
.rs-panel.is-above { animation-name: rs-rise; }
@keyframes rs-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes rs-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .rs-panel { box-shadow: 0 18px 44px rgba(0, 0, 0, .5); }

.rs-search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.rs-search .bi {
  position: absolute;
  left: 19px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  color: var(--text-3);
  pointer-events: none;
}
.rs-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.rs-search input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.rs-list {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  scrollbar-width: thin;
}
.rs-group {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rs-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text);
  line-height: 1.3;
  cursor: pointer;
}
.rs-option + .rs-option { margin-top: 1px; }
.rs-option .rs-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rs-option .rs-check { flex: 0 0 auto; font-size: 15px; color: var(--primary); visibility: hidden; }
.rs-option.is-active { background: var(--surface-2); }
.rs-option.is-selected { color: var(--primary); font-weight: 600; }
.rs-option.is-selected .rs-check { visibility: visible; }
.rs-option.is-selected.is-active { background: var(--primary-soft); }
.rs-option.is-placeholder:not(.is-selected) .rs-text { color: var(--text-3); }
.rs-option.is-disabled { opacity: .45; cursor: not-allowed; }
.rs-option.is-disabled.is-active { background: transparent; }
.rs-option mark {
  padding: 0;
  border-radius: 3px;
  background: var(--gold-soft);
  color: inherit;
  font-weight: 700;
}
.rs-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}
.rs-empty .bi { display: block; margin-bottom: 6px; font-size: 18px; opacity: .6; }

/* ============ SIDEBAR NAVIGATION (sections, dropdown groups, rail flyout) ============ */
.side-nav { display: flex; flex-direction: column; gap: 14px; }
.nav-section { display: flex; flex-direction: column; }
.nav-section .nav-section-title { padding: 2px 12px 6px; }

.nav-group-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
}
.nav-group-toggle:focus-visible,
.nav-item:focus-visible,
.nav-sub-item:focus-visible {
  outline: 2px solid rgba(231,76,60,.55);
  outline-offset: -2px;
}
.nav-item .nav-caret {
  margin-left: auto;
  width: auto;
  font-size: 11px;
  opacity: .5;
  transition: transform .22s ease, opacity .15s ease;
}
.nav-group-toggle:hover .nav-caret { opacity: .9; }
.nav-group.is-open > .nav-group-toggle .nav-caret { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-toggle { color: var(--sidebar-hi); }
.nav-group.has-active > .nav-group-toggle .bi:first-child { color: var(--primary); opacity: 1; }

.nav-sub-wrap {
  display: grid;
  grid-template-rows: 0fr;
}
.sidebar.nav-ready .nav-sub-wrap { transition: grid-template-rows .24s ease; }
.nav-group.is-open > .nav-sub-wrap { grid-template-rows: 1fr; }
.nav-sub { min-height: 0; overflow: hidden; }
.nav-sub-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 6px 21px;
  padding-left: 12px;
  border-left: 1px solid #2a251e;
}
.nav-sub-item {
  position: relative;
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--sidebar-mute);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s ease, background .15s ease;
}
.nav-sub-item:hover { color: var(--sidebar-hi); background: #1b1814; }
.nav-sub-item.active { color: #fff; font-weight: 600; background: rgba(231,76,60,.12); overflow: visible; }
.nav-sub-item.active::before {
  content: "";
  position: absolute;
  left: -16px; top: 50%;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(231,76,60,.22);
}

/* Help card pinned to the bottom of the menu */
.sidebar-help {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2a251e;
}
.sidebar-help-card {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid #2a251e;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(231,76,60,.18), rgba(231,76,60,.03));
  color: var(--sidebar-fg);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sidebar-help-card:hover { border-color: rgba(231,76,60,.55); color: #fff; }
.sidebar-help-icon {
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 6px 14px rgba(231,76,60,.35);
}
.sidebar-help-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sidebar-help-text strong { color: #fff; font-size: 12.5px; font-weight: 600; }
.sidebar-help-text small { color: var(--sidebar-mute); font-size: 11px; }
.sidebar-help-card > .bi-arrow-right { margin-left: auto; font-size: 13px; opacity: .55; }

/* Collapsed (icon-only) rail */
.sidebar-collapsed .side-nav { gap: 8px; }
.sidebar-collapsed .nav-section + .nav-section { padding-top: 8px; border-top: 1px solid #2a251e; }
.sidebar-collapsed .nav-caret,
.sidebar-collapsed .nav-sub-wrap { display: none; }
.sidebar-collapsed .nav-item .pill {
  position: absolute; top: 3px; right: 8px;
  margin: 0; padding: 1px 5px;
  font-size: 9px;
}
.sidebar-collapsed .nav-group.has-active > .nav-group-toggle {
  background: linear-gradient(90deg, rgba(184,84,60,.22), rgba(184,84,60,.06));
}
.sidebar-collapsed .nav-group.has-active > .nav-group-toggle::before {
  content: "";
  position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-collapsed .sidebar-help-card {
  justify-content: center;
  padding: 6px;
  border-color: transparent;
  background: transparent;
}

.nav-flyout {
  position: fixed;
  z-index: 1080;
  min-width: 190px;
  padding: 6px;
  background: #14110e;
  border: 1px solid #2a251e;
  border-radius: 11px;
  box-shadow: 0 16px 36px rgba(0,0,0,.38);
  color: var(--sidebar-fg);
  font-size: 13px;
  animation: nav-flyout-in .14s ease-out;
}
.nav-flyout:not(.is-menu) { min-width: 0; padding: 0; }
.nav-flyout-title {
  padding: 7px 11px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.nav-flyout.is-menu .nav-flyout-title {
  padding: 6px 10px 5px;
  color: var(--sidebar-mute);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-flyout-link {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--sidebar-fg);
  text-decoration: none;
  white-space: nowrap;
}
.nav-flyout-link:hover { background: #25201a; color: #fff; }
.nav-flyout-link.active { background: rgba(231,76,60,.18); color: #fff; font-weight: 600; }
@keyframes nav-flyout-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

/* ============ PRODUCT TOUR — Driver.js popover theme ============ */
.driver-popover.rms-tour {
  --driver-popover-font-family: var(--font);
  font-family: var(--font);
  min-width: 290px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 20px 18px 14px;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(18,15,12,.28), 0 2px 6px rgba(18,15,12,.12);
}
.rms-tour .tour-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--line);
}
.rms-tour .tour-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transition: width .35s ease;
}
.rms-tour .tour-eyebrow {
  display: flex; align-items: center; gap: 8px;
  margin: 0 30px 10px 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rms-tour .tour-eyebrow-icon {
  flex: none;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--primary-soft);
  font-size: 12px;
}
.rms-tour .tour-eyebrow-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rms-tour .tour-eyebrow-count {
  margin-left: auto;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
}
.driver-popover.rms-tour .driver-popover-title {
  font-family: var(--font);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--text);
}
.driver-popover.rms-tour .driver-popover-description {
  margin-top: 6px;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.rms-tour .driver-popover-description strong { color: var(--text); font-weight: 600; }
.rms-tour .tour-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.rms-tour .tour-list li { position: relative; padding-left: 16px; }
.rms-tour .tour-list li::before {
  content: "";
  position: absolute; left: 2px; top: .62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.rms-tour .tour-tip {
  display: flex; gap: 8px;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}
.rms-tour .tour-tip .bi { color: var(--gold); margin-top: 1px; }
.rms-tour kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}
.rms-tour .tour-finale {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  margin: 4px 0 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold-soft), var(--primary-soft));
  color: var(--gold);
  font-size: 26px;
}
.driver-popover.rms-tour .driver-popover-close-btn {
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  border-radius: 8px;
  color: var(--text-3);
  font-size: 20px;
  line-height: 28px;
}
.driver-popover.rms-tour .driver-popover-close-btn:hover,
.driver-popover.rms-tour .driver-popover-close-btn:focus-visible { background: var(--surface-2); color: var(--text); }
.driver-popover.rms-tour .driver-popover-footer { gap: 10px; margin-top: 18px; }
.driver-popover.rms-tour .driver-popover-progress-text {
  color: var(--text-3);
  font-family: var(--font);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rms-tour .tour-upnext {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12.5px;
}
.rms-tour .tour-upnext .bi { color: var(--primary); }
.rms-tour .tour-upnext strong { color: var(--text); font-weight: 600; }
.rms-tour .tour-upnext + .driver-popover-footer { margin-top: 12px; }
.rms-tour .tour-skip {
  all: unset;
  cursor: pointer;
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}
.rms-tour .tour-skip:hover,
.rms-tour .tour-skip:focus-visible { color: var(--text); text-decoration: underline; }
.driver-popover.rms-tour .driver-popover-footer-btn {
  /* Driver.js sets display:block inline; keep icon and label on one line. */
  display: inline-flex !important; align-items: center; gap: 6px;
  white-space: nowrap;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: none;
  transition: background .15s ease, border-color .15s ease;
}
.driver-popover.rms-tour .driver-popover-footer-btn:hover { background: var(--surface-2); }
.driver-popover.rms-tour .driver-popover-footer-btn:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 2px; }
.driver-popover.rms-tour .driver-popover-next-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.driver-popover.rms-tour .driver-popover-next-btn:hover { background: var(--primary-2); border-color: var(--primary-2); }
.driver-popover.rms-tour .driver-popover-prev-btn.driver-popover-btn-disabled { display: none !important; }
.driver-popover.rms-tour .driver-popover-navigation-btns button + button { margin-left: 6px; }
.driver-popover.rms-tour .driver-popover-arrow { border-width: 6px; }
.driver-popover.rms-tour .driver-popover-arrow-side-left { border-left-color: var(--surface); }
.driver-popover.rms-tour .driver-popover-arrow-side-right { border-right-color: var(--surface); }
.driver-popover.rms-tour .driver-popover-arrow-side-top { border-top-color: var(--surface); }
.driver-popover.rms-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--surface); }

/* ============ PRODUCT TOUR — Tour Center modal ============ */
.tour-center .modal-content { border-radius: 18px; }
.tour-hero {
  position: relative;
  flex: 0 0 auto;
  padding: 26px 28px 24px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.14) 1px, transparent 0) 0 0 / 18px 18px,
    radial-gradient(120% 140% at 100% 0%, #f07a5e 0%, var(--primary) 40%, #8f2a1f 100%);
}
.tour-hero::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -80px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.tour-hero > * { position: relative; z-index: 1; }
.tour-hero > .tour-hero-close {
  position: absolute; top: 14px; right: 14px;
  z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.14);
  color: #fff;
  transition: background .15s ease;
}
.tour-hero > .tour-hero-close:hover { background: rgba(255,255,255,.26); }
.tour-hero-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
  font-size: 22px;
}
.tour-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85;
}
.tour-hero h2 {
  margin: 4px 0 6px;
  padding-right: 36px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.tour-hero p { max-width: 540px; margin: 0; font-size: 13.5px; line-height: 1.55; opacity: .92; }
.tour-hero-progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.tour-meter {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.22);
}
.tour-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width .45s ease;
}
.tour-meter-label { font-size: 12px; font-weight: 600; white-space: nowrap; }
.tour-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tour-hero .btn-s.tour-btn-light { background: #fff; border-color: #fff; color: var(--primary-2); }
.tour-hero .btn-s.tour-btn-light:hover { background: #fff4f1; }
.tour-hero .btn-s.tour-btn-glass { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.34); color: #fff; }
.tour-hero .btn-s.tour-btn-glass:hover { background: rgba(255,255,255,.22); }

.tour-center-body { padding: 20px 24px 12px; }
.tour-section + .tour-section { margin-top: 18px; }
.tour-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tour-section-count { font-family: var(--mono); letter-spacing: 0; }
.tour-chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tour-chapter {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tour-chapter:hover,
.tour-chapter:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  outline: 0;
}
.tour-chapter-icon {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 17px;
  transition: background .15s ease, color .15s ease;
}
.tour-chapter:hover .tour-chapter-icon { background: var(--primary-soft); color: var(--primary); }
.tour-chapter-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.tour-chapter-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.tour-chapter-sum {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tour-chapter-state {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  font-size: 13px;
  transition: transform .15s ease, color .15s ease;
}
.tour-chapter:hover .tour-chapter-state { color: var(--primary); transform: translateX(2px); }
.tour-chapter.is-done .tour-chapter-icon,
.tour-chapter.is-done .tour-chapter-state { background: var(--green-soft); color: var(--green); }
.tour-chapter.is-next { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tour-tag {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tour-center-foot { justify-content: space-between; color: var(--text-3); font-size: 12px; }
.tour-keys kbd {
  margin: 0 2px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 11px;
  box-shadow: none;
}
@media (max-width: 640px) {
  .tour-hero { padding: 22px 18px 20px; }
  .tour-hero h2 { font-size: 19px; }
  .tour-hero-actions .btn-s { flex: 1 1 100%; justify-content: center; }
  .tour-center-body { padding: 16px; }
  .tour-chapter-grid { grid-template-columns: 1fr; }
  .tour-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-sub-wrap,
  .sidebar.nav-ready .nav-sub-wrap,
  .nav-flyout,
  .tour-chapter,
  .tour-meter span,
  .rms-tour .tour-bar span { transition: none; animation: none; }
}
@media print {
  .nav-flyout, .driver-popover, .driver-overlay { display: none !important; }
}

/* PWA install button: hidden inside the installed app. */
.tb-icon-btn[hidden],
.tb-icon-btn .badge-dot[hidden] { display: none; }
@media (display-mode: standalone) {
  [data-pwa-install] { display: none !important; }
}
