:root {
  --ink: #15251d;
  --muted: #6e7b72;
  --line: #d9e4d8;
  --paper: #fffdf5;
  --cream: #f5f0df;
  --green: #076734;
  --green-2: #0d8a4a;
  --mint: #e7f4e7;
  --coral: #ef6f61;
  --gold: #d69a2d;
  --shadow: 0 18px 55px rgba(14, 58, 34, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(7, 103, 52, .1), transparent 32%),
    linear-gradient(250deg, rgba(214, 154, 45, .12), transparent 36%),
    var(--cream);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 103, 52, .12);
}

.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(245, 240, 223, .72), rgba(245, 240, 223, .88)),
    url("https://images.unsplash.com/photo-1528735602780-2552fd46c7af?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  background: rgba(255, 253, 245, .94);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 18px 0 8px;
  font-size: clamp(1.8rem, 5vw, 2.65rem);
  line-height: 1;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.brand-mark.wordmark {
  width: auto;
  min-height: 54px;
  padding: 0 14px;
  text-align: left;
  font-size: .95rem;
  line-height: 1.1;
  text-transform: lowercase;
}

.login-logos {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-logos img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(14, 58, 34, .1);
}

.stack-form, .customer-form, .payment-box {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.primary-btn, .soft-btn, .text-btn, .icon-btn, .profile-chip {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: var(--green);
}

.primary-btn:hover { background: #075c30; }

.soft-btn {
  color: var(--green);
  background: var(--mint);
}

.text-btn {
  color: var(--green);
  background: transparent;
  padding: 0;
}

.icon-btn {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.app-shell {
  min-height: 100vh;
}

.notification-tray {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.notification-toast {
  position: relative;
  padding: 14px 16px;
  border: 1px solid rgba(7, 103, 52, .18);
  border-radius: 16px;
  background: rgba(255, 253, 245, .98);
  box-shadow: var(--shadow);
}

.notification-toast strong {
  display: block;
  margin-bottom: 4px;
}

.notification-toast button {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.notification-center {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 45;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(7, 103, 52, .14);
  border-radius: 16px;
  background: rgba(255, 253, 245, .98);
  box-shadow: var(--shadow);
}

.notification-entry {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.notification-entry time,
.notification-entry small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint);
  font-size: .78rem;
  font-weight: 800;
}

.countdown-pill.warning {
  color: #9a4a00;
  background: #fff1d7;
}

.countdown-pill.due {
  color: #a33027;
  background: #ffe1df;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px clamp(16px, 3vw, 34px);
  background: rgba(245, 240, 223, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 228, 216, .72);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 230px;
}

.brand strong { display: block; }
.brand span { color: var(--muted); font-size: .82rem; font-weight: 700; }

.main-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  font-weight: 800;
  color: var(--muted);
}

.main-nav button.active {
  color: var(--green);
  border-color: var(--green);
  background: #fff;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bell-btn {
  position: relative;
  min-width: 42px;
  padding: 0 12px;
}

.bell-icon {
  font-size: 1rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: #fff;
  background: var(--coral);
  font-size: .68rem;
  font-weight: 800;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.profile-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

main {
  padding: clamp(14px, 3vw, 30px);
}

.view { display: none; }
.view.active { display: block; }

.order-layout, .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
}

.menu-panel, .checkout-panel, .admin-panel, .dashboard-main, .queue-panel {
  border: 1px solid rgba(217, 228, 216, .9);
  border-radius: 8px;
  background: rgba(255, 253, 245, .88);
  box-shadow: var(--shadow);
}

.dashboard-main, .queue-panel {
  padding: 18px;
}

.queue-panel {
  position: sticky;
  top: 96px;
  padding: 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.menu-panel {
  padding: 18px;
  overflow: hidden;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 148px;
  gap: 12px;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
}

.search-box span {
  position: absolute;
  left: 15px;
  top: 12px;
  color: var(--green);
}

.search-box input {
  padding-left: 75px;
  border-color: var(--green);
  border-radius: 999px;
  min-height: 52px;
}

.category-scroller, .bundle-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
}

.category-card, .bundle-card {
  flex: 0 0 200px;
  min-height: 102px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  text-align: left;
  background: #fff;
}

.category-card.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.category-card img, .bundle-card img {
  position: absolute;
  right: -12px;
  bottom: -16px;
  width: 96px;
  height: 78px;
  object-fit: cover;
  border-radius: 50%;
  opacity: .88;
}

.category-card.active img { opacity: .42; }
.category-card strong, .bundle-card strong {
  display: block;
  margin-top: 20px;
  font-size: 1rem;
  line-height: 1.15;
}
.category-card span, .bundle-card span {
  display: block;
  margin-top: 3px;
  font-size: .76rem;
  font-weight: 700;
}

.bundle-card {
  flex-basis: 240px;
  background: #fff8e9;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.food-card {
  display: grid;
  grid-template-rows: 112px auto;
  min-height: 238px;
  overflow: hidden;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #fff;
}

.food-card.out {
  opacity: .55;
  filter: grayscale(.4);
}

.food-card img {
  width: 100%;
  height: 112px;
  object-fit: cover;
}

.food-body {
  display: grid;
  gap: 6px;
  padding: 10px 10px 9px;
}

.food-body h3 {
  margin: 0;
  font-size: .92rem;
  line-height: 1.15;
}

.thai-name {
  color: var(--muted);
  min-height: 16px;
  font-size: .74rem;
  line-height: 1.15;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.add-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  background: #fff;
  font-size: 1.25rem;
}

.add-btn.filled {
  color: #fff;
  background: var(--green);
}

.stock-pill, .discount-pill {
  width: max-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--green);
  background: var(--mint);
  font-size: .68rem;
  font-weight: 800;
}

.stock-pill.out {
  color: #a33027;
  background: #ffe1df;
}

.checkout-panel {
  position: sticky;
  top: 96px;
  padding: 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.checkout-header, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkout-header h2, .section-head h2, .admin-panel h2 {
  margin: 2px 0 0;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 800;
}

.current-customer {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mint);
  font-weight: 800;
}

.service-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin: 14px 0;
  border-radius: 999px;
  background: var(--mint);
}

.service-toggle button {
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.service-toggle button.active {
  color: #fff;
  background: var(--green);
}

.customer-form {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.wide { grid-column: 1 / -1; }

.basket-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.basket-empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.basket-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.basket-item img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.basket-item h4 {
  margin: 0 0 2px;
}

.basket-item small {
  color: var(--muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.item-note {
  grid-column: 2 / -1;
}

.payment-box {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.payment-box label:nth-last-child(1),
.payment-box label:nth-last-child(2) {
  grid-column: 1 / -1;
}

.payment-qr-box {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.payment-qr-box img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.payment-qr-box small {
  color: var(--muted);
}

.totals {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.totals div {
  display: flex;
  justify-content: space-between;
}

.totals .grand {
  font-size: 1.35rem;
  color: var(--green);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-subnav {
  display: grid;
  gap: 8px;
}

.admin-subnav button {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.admin-subnav button.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.admin-content {
  display: grid;
}

.admin-page {
  display: none;
  gap: 14px;
}

.admin-page.active {
  display: grid;
}

.admin-page-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 18px;
}

.admin-page-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-panel {
  padding: 18px;
}

.admin-panel h3 {
  margin: 0 0 12px;
  font-size: .96rem;
}

.admin-form-panel {
  align-self: start;
}

.admin-data-panel {
  min-height: 220px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 14px 0;
}

.admin-list, .customer-list, .history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.customer-toolbar {
  display: grid;
  gap: 10px;
  margin: 12px 0 4px;
}

.alphabet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alphabet-bar button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.customer-group-label {
  margin-top: 12px;
  color: var(--green);
  font-size: .9rem;
  font-weight: 800;
}

.customer-frequency {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.customer-frequency h4 {
  margin: 0;
  font-size: .84rem;
}

.mini-chart {
  display: grid;
  gap: 6px;
}

.mini-chart-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.admin-row, .customer-row, .history-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.site-log-row small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.order-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.order-edit-grid label {
  min-width: 0;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
}

.report-toolbar button {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.report-toolbar button.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.report-toolbar input {
  width: 155px;
}

.frequency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.frequency-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.frequency-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.busy-board,
.month-board {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  margin: 16px 0;
}

.busy-board h3,
.month-board h3 {
  margin: 0;
  font-size: 1rem;
}

.busy-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 8px;
}

.busy-cell,
.month-cell {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 64px;
  padding: 8px;
  border-radius: 14px;
  color: var(--ink);
  background: #eef5ea;
  font-size: .78rem;
  font-weight: 700;
}

.busy-cell small,
.month-cell small {
  color: rgba(21, 37, 29, .76);
  font-size: .72rem;
}

.busy-green { background: #dcefd8; }
.busy-yellow { background: #fff1bf; }
.busy-red { background: #ffd6d1; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px 1fr 34px;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--mint);
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  font-weight: 800;
}

.danger { color: #b33025; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input, .check-list input {
  width: auto;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.7rem;
}

.last-orders {
  margin-top: 8px;
  padding-left: 18px;
  color: var(--muted);
}

.profile-panel {
  max-width: 520px;
}

.customer-accordion {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
}

.customer-accordion summary {
  padding: 13px 14px;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.customer-accordion .customer-form {
  padding: 0 12px 12px;
}

.map-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.leaflet-map {
  grid-column: 1 / -1;
  width: 100%;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--mint);
  overflow: hidden;
}

.route-map {
  margin-top: 14px;
  height: 320px;
}

.drink-options {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.planner-day {
  min-height: 120px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.planner-day span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .78rem;
}

@media (min-width: 1121px) {
  body {
    background: #6f7f6a;
  }

  .topbar {
    width: min(1500px, calc(100% - 56px));
    margin: 28px auto 0;
    border-radius: 28px 28px 0 0;
    background: rgba(255, 253, 245, .96);
  }

  main {
    width: min(1500px, calc(100% - 56px));
    margin: 0 auto 32px;
    padding: 22px;
    border-radius: 0 0 28px 28px;
    background: rgba(255, 253, 245, .96);
  }
}

.login-screen {
  background: #6f7f6a;
}

.login-card,
.menu-panel,
.checkout-panel,
.admin-panel,
.dashboard-main,
.queue-panel {
  border-radius: 28px;
}

input,
select,
textarea {
  border-radius: 16px;
}

.primary-btn,
.soft-btn,
.text-btn,
.icon-btn,
.profile-chip {
  border-radius: 999px;
}

.category-card,
.bundle-card,
.food-card,
.basket-item,
.admin-row,
.customer-row,
.history-row,
.stat-card,
.frequency-card {
  border-radius: 22px;
}

.brand-mark {
  border-radius: 16px;
}

/* ── Tablet landscape / small laptop (≤1120px) ───────────────────────────── */
@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
    padding: 12px clamp(12px, 2vw, 24px);
  }

  /* Row 1: brand left, top-actions right. Row 2: nav full width. */
  .brand      { grid-column: 1; grid-row: 1; min-width: 0; }
  .top-actions { grid-column: 2; grid-row: 1; }
  #mainNav    { grid-column: 1 / -1; grid-row: 2; }

  .order-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .checkout-panel { position: static; max-height: none; }
}

/* ── Admin page form+data panels → single column at tablet ───────────────── */
@media (max-width: 900px) {
  .admin-page-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Tablet portrait (≤768px) ────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Admin sidebar collapses into a horizontal scrollable pill nav */
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; padding: 10px; }
  .admin-subnav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 4px;
  }
  .admin-subnav::-webkit-scrollbar { display: none; }
  .admin-subnav button {
    flex: 0 0 auto;
    border-radius: 999px;
    min-height: 36px;
    padding: 0 14px;
  }

  /* Queue panel no longer sticky in single-column layout */
  .queue-panel { position: static; max-height: none; }

  /* Planner weekly grid: horizontal scroll rather than overflow */
  .planner-grid {
    overflow-x: auto;
    grid-template-columns: repeat(7, 150px);
    padding-bottom: 8px;
  }

  /* Topbar export is duplicated in each view; hide the header copy */
  #exportOrdersBtn { display: none; }
}

/* ── Mobile (≤680px) ─────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  main { padding: 10px; }
  .login-card { padding: 24px; }
  .search-row, .customer-form, .inline-form {
    grid-template-columns: 1fr;
  }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-card { flex-basis: 190px; }
  .food-card { grid-template-rows: 100px auto; min-height: 245px; }
  .food-card img { height: 100px; }
  .basket-item { grid-template-columns: 48px 1fr; }
  .basket-item > .qty-controls { grid-column: 2; }
  .item-note { grid-column: 1 / -1; }
  .payment-box, .order-edit-grid { grid-template-columns: 1fr; }
  .report-toolbar input { width: 100%; }
  /* Month calendar: scroll horizontally on narrow screens */
  .month-board { overflow-x: auto; }
  .month-grid  { min-width: 340px; }
}

/* ── Small phone (≤420px) ────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .menu-grid { grid-template-columns: 1fr; }
  .top-actions { flex-wrap: wrap; }
  /* Allow section headers to wrap when heading + button don't fit */
  .section-head { flex-wrap: wrap; }
  /* Drop "Order & CRM System" text; keep the wordmark logo only */
  .brand > div:not(.brand-mark) { display: none; }
}
