:root {
  --brand: #c0392b;
  --brand-dark: #922b21;
  --bg: #faf6f2;
  --surface: #ffffff;
  --text: #2b2320;
  --text-muted: #7a6f68;
  --border: #e8ddd4;
  --accent: #2e7d32;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* The [hidden] attribute must always win, even against classes like
   .admin-form that set their own `display` — otherwise elements with equal
   CSS specificity to the UA default can stay visible despite being hidden. */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---------- Customer page ---------- */

.customer-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shop-header {
  text-align: center;
  margin-bottom: 16px;
}

.shop-logo {
  display: block;
  max-width: 160px;
  max-height: 96px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.shop-logo[hidden],
.dashboard-logo[hidden],
.logo-preview[hidden] {
  display: none;
}

.shop-header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.shop-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.talk-button {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 16px auto;
  padding: 18px 24px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.talk-button:hover {
  background: var(--brand-dark);
}

.talk-button:active {
  transform: scale(0.98);
}

.talk-button.listening {
  background: var(--accent);
  animation: pulse-green 1.4s infinite;
}

.talk-button.thinking {
  background: #b8860b;
  animation: pulse-amber 1s infinite;
}

.talk-button.speaking {
  background: #1565c0;
  animation: pulse-blue 1.2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(46, 125, 50, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
  }
}

@keyframes pulse-amber {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes pulse-blue {
  0% {
    box-shadow: 0 0 0 0 rgba(21, 101, 192, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(21, 101, 192, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(21, 101, 192, 0);
  }
}

.voice-status {
  text-align: center;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.voice-warning {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  color: #664d03;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: center;
}

.chat-window {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 320px;
  max-height: 50vh;
}

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.bubble.assistant {
  background: #f1ece7;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.bubble.user {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bubble.system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-input-row input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.chat-input-row input:focus {
  outline: 2px solid var(--brand);
}

.chat-input-row button {
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chat-input-row button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---------- Dashboard page ---------- */

.dashboard-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-logo {
  max-width: 96px;
  max-height: 44px;
  object-fit: contain;
}

.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.connection-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.connection-dot .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c0392b;
}

.connection-dot.connected .dot {
  background: var(--accent);
}

.enable-sound-banner {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid #ffe69c;
  border-radius: 10px;
  background: #fff3cd;
  color: #664d03;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.enable-sound-banner[hidden] {
  display: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .board {
    grid-template-columns: repeat(2, 1fr);
  }
}

.column {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 200px;
  box-shadow: var(--shadow);
}

.column h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  margin: 4px 8px 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.column[data-status="new"] .column-count {
  background: var(--brand);
  color: #fff;
}

.order-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.order-card.new {
  border-left: 4px solid var(--brand);
}

.order-card .order-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.order-card .order-number {
  font-weight: 700;
  font-size: 1.05rem;
}

.order-card .order-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.order-top-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-menu {
  position: relative;
}

.order-card .card-menu-btn {
  width: auto;
  background: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.order-card .card-menu-btn:hover {
  background: var(--border);
}

.card-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}

.card-menu-dropdown[hidden] {
  display: none;
}

.card-menu-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 4px 8px 2px;
}

.order-card .card-menu-dropdown button {
  width: 100%;
  text-align: left;
  background: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 6px;
}

.order-card .card-menu-dropdown button:hover {
  background: var(--bg);
}

.order-card .order-type {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #eee;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.order-card ul {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 0.88rem;
}

.order-card .order-total {
  font-weight: 700;
  margin-bottom: 8px;
}

.order-card .order-customer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.order-card .order-warning {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a4b00;
  background: #fff4e0;
  border: 1px solid #f0c987;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 8px;
}

.order-card button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.order-card button:hover {
  opacity: 0.9;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px;
}

/* ---------- Admin page ---------- */

.admin-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-brand {
  font-weight: 700;
  font-size: 1.1rem;
}

.admin-whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
}

.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-card-header h2 {
  margin: 0 0 4px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-header-row h3 {
  margin: 0;
}

.tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.hours-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.hours-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}

.hours-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hours-row .hours-day {
  width: 44px;
  font-size: 0.85rem;
  font-weight: 600;
}

.hours-row input[type='time'] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.hours-row span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-form button[type='submit'] {
  align-self: flex-start;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-error {
  color: #c0392b;
  font-size: 0.85rem;
  min-height: 1.1em;
}

.form-success {
  color: var(--accent);
  font-size: 0.85rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

.shops-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--bg);
}

.shop-list-item:hover {
  border-color: var(--brand);
}

.shop-list-item .shop-list-name {
  font-weight: 700;
}

.shop-list-item .shop-list-type {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Admin → Conversations tab */
.conversations-list { display: flex; flex-direction: column; gap: 8px; }
.conversation { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.conversation summary {
  cursor: pointer;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
}
.conversation-meta { font-size: 0.8rem; color: var(--text-muted); }
.conversation-outcome { font-size: 0.8rem; font-weight: 600; text-align: right; }
.conversation-preview {
  grid-column: 1 / -1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversation-body { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.conversation-line { max-width: 85%; padding: 6px 10px; border-radius: 12px; font-size: 0.88rem; }
.conversation-line.customer { align-self: flex-end; background: var(--brand); color: #fff; }
.conversation-line.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }

.model-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.model-row .hint {
  margin: 6px 0;
}

.model-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.model-test-row .secondary-btn {
  width: auto;
}

.modal-section {
  margin: 18px 0 4px;
  font-size: 1rem;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: var(--text);
}

.usage-table th,
.usage-table td {
  text-align: left;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border);
}

.phone-warnings {
  margin: 0;
  padding: 10px 14px 10px 30px;
  border-radius: 10px;
  background: #fff6e0;
  border: 1px solid #f0d58c;
  color: #6b4e00;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Signup honeypot: off-screen rather than display:none, since some bots skip
   fields that are display:none. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pending-banner {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff6e0;
  border: 1px solid #f0d58c;
  color: #6b4e00;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* /admin opened by the super admin — impossible to miss whose shop this is. */
.super-admin-banner {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #2b2320;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

.pending-banner strong {
  display: block;
  margin-bottom: 2px;
}

/* Account menu (top right of /admin and the owner's dashboard) */
.account-menu {
  position: relative;
}

.account-menu-btn {
  display: flex;
  text-decoration: none;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.account-menu-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 210px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.account-menu-list button,
.account-menu-list a {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-list button:hover,
.account-menu-list a:hover {
  background: var(--bg);
}

.account-menu-email {
  display: none;
  padding: 6px 12px 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.account-menu-short {
  display: none;
}

.home-box a {
  color: var(--brand);
}

.account-menu-list hr {
  margin: 6px 4px;
  border: none;
  border-top: 1px solid var(--border);
}

.section-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.section-nav h3 {
  margin: 0;
}

/* Home (the shop's landing screen in /admin) */
.home-primary-btn {
  display: block;
  padding: 16px;
  margin: 8px 0 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.home-primary-btn:hover {
  background: var(--brand-dark);
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-stat {
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
}

.home-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.home-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.home-ai-status {
  margin: 10px 0 16px;
}

.home-grid {
  display: grid;
  /* The boxes share the width and wrap to fewer columns on narrower screens (tablets). */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.home-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}

.home-box h3 {
  margin: 0 0 4px;
}

.home-qr {
  text-align: center;
}

.home-qr .qr-code-img {
  width: 180px;
  height: 180px;
  margin: 8px auto;
}

.copy-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
}

.home-menu-btn {
  display: block;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .account-menu-btn #whoAmIEmail {
    display: none;
  }

  .account-menu-short,
  .account-menu-email {
    display: block;
  }

  .admin-brand {
    font-size: 1rem;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-stat-value {
    font-size: 1.15rem;
  }
}

.upload-box {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.upload-box input[type='file'] {
  display: block;
  margin: 10px 0;
}

.upload-box button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.menu-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.menu-item-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
}

.menu-item-row .row-top {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.menu-item-row .row-top input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.menu-item-row .item-description-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.menu-item-row .sizes-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pair-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
}

.pair-row input {
  border: none;
  font-size: 0.85rem;
  width: 70px;
}

.pair-row input.pair-label {
  width: 90px;
}

.pair-row button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 2px;
}

.pair-add-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.item-image-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.item-image-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.item-image-thumb[hidden] {
  display: none;
}

.item-image-section input[type='file'] {
  font-size: 0.8rem;
  max-width: 180px;
}

.menu-item-row .row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-item-row .row-bottom label {
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu-item-row .row-actions {
  display: flex;
  gap: 8px;
}

.menu-item-row .row-actions button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}

.menu-item-row .row-actions button.danger {
  color: #c0392b;
  border-color: #f3c9c3;
}

.qr-code-img {
  display: block;
  width: 260px;
  height: 260px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
}

/* ---------- Click-to-order menu page ---------- */

.menu-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}

.menu-page .shop-header a {
  color: var(--brand);
  font-size: 0.85rem;
}

.menu-browse-category {
  margin-bottom: 22px;
  /* Keeps a category's heading below the sticky category bar when jumped to. */
  scroll-margin-top: 72px;
}

/* Sticky category bar (js/menu.js): stays at the top and follows the scroll. */
.category-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: 0 -16px 14px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.category-bar[hidden] {
  display: none;
}

.category-bar-track {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-bar-track::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.category-chip[aria-current='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.menu-browse-category h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: var(--text);
}

.menu-browse-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.item-description {
  margin: 2px 0 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.menu-browse-item-image {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.menu-browse-item .item-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.menu-browse-item .item-name {
  font-weight: 700;
}

.option-group {
  margin-bottom: 8px;
}

.option-group .option-group-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.option-chip input {
  margin: 0;
}

.option-chip.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.item-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-stepper button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.item-add-row .add-to-cart-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.item-add-row .add-to-cart-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.cart-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 528px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 20;
}

.checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}

.checkout-sheet {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.checkout-header h2 {
  margin: 0;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.cart-item-row .cart-item-desc {
  font-size: 0.9rem;
}

.cart-item-row .cart-item-desc .cart-item-name {
  font-weight: 600;
}

.cart-item-row .cart-item-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cart-item-row .cart-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.cart-item-row button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px 0;
  border-top: 2px solid var(--border);
  margin-bottom: 16px;
}

.confirmation-sheet {
  text-align: center;
}

.confirmation-sheet button {
  margin-top: 16px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Super admin table ---------- */

.super-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.super-admin-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}

.super-admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.status-pill {
  white-space: nowrap;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pill.active {
  background: #e3f3e3;
  color: var(--accent);
}

.status-pill.inactive {
  background: #f3e3e3;
  color: #c0392b;
}

.status-pill.pending {
  background: #fff6e0;
  color: #8a6400;
}

.super-admin-table .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.super-admin-table button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.reset-link-cell {
  font-size: 0.78rem;
  word-break: break-all;
  margin-top: 6px;
}

.reset-link-cell a {
  color: var(--brand);
}

.streets-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.streets-status .hint {
  flex: 1 1 240px;
  margin: 0;
}
.suburb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.suburb-chips .hint {
  margin: 0;
}

.suburb-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
}

.suburb-chip.unrecognised {
  border-color: #e0a09a;
  background: #fdecea;
  color: #8a2a20;
}

.suburb-chip button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.suburb-chip button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.suburb-search {
  position: relative;
}

.suburb-search input {
  width: 100%;
  box-sizing: border-box;
}

.suburb-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suburb-suggestion {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.suburb-suggestion:hover:not(:disabled),
.suburb-suggestion:focus-visible {
  background: var(--bg);
}

.suburb-suggestion:disabled,
.suburb-suggestion.none {
  color: var(--text-muted);
  cursor: default;
}

/* Settings: Logo */
.logo-preview {
  display: block;
  max-width: 200px;
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}

.logo-box .secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
