*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand:       #FF6B2C;
  --brand-dark:  #CC4800;
  --brand-light: #FFF0E8;
  --sidebar-bg:  #1A0A00;
  --page-bg:     #F4F1ED;
  --surface:     #FFFFFF;
  --border:      rgba(0,0,0,0.07);
  --text:        #1C1917;
  --text-muted:  #8C8680;
  --green:       #16A34A;
  --green-bg:    #DCFCE7;
  --amber:       #D97706;
  --amber-bg:    #FEF3C7;
  --blue:        #1D4ED8;
  --blue-bg:     #DBEAFE;
  --red:         #DC2626;
  --red-bg:      #FEE2E2;
  --gray:        #6B7280;
  --gray-bg:     #F3F4F6;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 20px 48px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.06);
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; height: 100vh; overflow: hidden; }

/* ------------------------------------------------------------------ */
/* SIDEBAR                                                             */
/* ------------------------------------------------------------------ */
.sidebar {
  width: 224px;
  min-width: 224px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0 0 20px;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 10px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--brand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.sidebar-logo-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.sidebar-logo-tenant { color: rgba(255,255,255,0.3); font-size: 11px; margin-top: 1px; font-weight: 500; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.2);
  padding: 12px 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-radius: var(--r-md);
  margin: 1px 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.nav-item.active {
  background: linear-gradient(135deg, var(--brand), #FF8C54);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,107,44,0.35);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-sep {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 10px 18px;
}

.nav-logout { margin-top: auto; }
.nav-logout:hover { background: rgba(255,80,40,0.12); color: var(--brand); }

.nav-group-header .nav-chevron {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  transition: transform 0.2s ease;
}
.nav-group--collapsed .nav-chevron { transform: rotate(-90deg); }

.nav-sub-items {
  overflow: hidden;
  max-height: 200px;
  transition: max-height 0.2s ease, opacity 0.2s ease;
  opacity: 1;
}
.nav-group--collapsed .nav-sub-items {
  max-height: 0;
  opacity: 0;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px 7px 40px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  border-radius: var(--r-md);
  margin: 1px 10px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-sub-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }
.nav-sub-item.active { background: rgba(255,107,44,0.15); color: var(--brand); font-weight: 600; }
.nav-sub-icon { font-size: 14px; width: 18px; text-align: center; }

/* ------------------------------------------------------------------ */
/* MAIN CONTENT                                                        */
/* ------------------------------------------------------------------ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ------------------------------------------------------------------ */
/* TOPBAR                                                              */
/* ------------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 64px;
  min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.topbar-left  { flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; }
.topbar-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ------------------------------------------------------------------ */
/* BUTTONS                                                             */
/* ------------------------------------------------------------------ */
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #FF8C54);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(255,107,44,0.3);
  font-family: inherit;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.btn-ghost:hover { background: var(--gray-bg); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--gray-bg); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: var(--r-md);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-danger:hover { background: var(--red-bg); }

/* Publish URL link */
.publish-url-link {
  display: block;
  padding: 12px 16px;
  background: var(--gray-bg);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  word-break: break-all;
  border: 1px solid var(--border);
}
.publish-url-link:hover { background: var(--brand-light); }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1C1917;
  color: #fff;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toast-in 0.2s ease;
}
.toast-error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.btn-icon:hover { color: var(--brand); border-color: rgba(255,107,44,0.4); }

/* ------------------------------------------------------------------ */
/* CARDS                                                               */
/* ------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-title {
  padding: 18px 22px 14px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.2px;
}

/* ------------------------------------------------------------------ */
/* STATS GRID                                                          */
/* ------------------------------------------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #FF8C54);
  border-radius: 3px 3px 0 0;
}
.stat-icon {
  font-size: 24px;
  position: absolute;
  top: 18px; right: 18px;
  opacity: 0.18;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  margin: 8px 0 6px;
  letter-spacing: -1.5px;
  color: var(--text);
}
.stat-delta { font-size: 12px; font-weight: 500; }
.stat-delta.positive { color: var(--green); }
.stat-delta.negative { color: var(--amber); }

/* ------------------------------------------------------------------ */
/* ORDERS                                                              */
/* ------------------------------------------------------------------ */
.order-wrap { border-bottom: 1px solid var(--border); }
.order-wrap:last-child { border-bottom: none; }

.order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  font-size: 13px;
  transition: background 0.1s;
}
.order-row--clickable { cursor: pointer; }
.order-row--clickable:hover { background: #FDFCFB; }

.order-expand-arrow {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.18s;
  display: inline-block;
  transform: rotate(0deg);
}
.order-expand-arrow.open { transform: rotate(90deg); }

.order-id { font-weight: 700; color: var(--text-muted); width: 50px; flex-shrink: 0; font-size: 12px; }
.order-customer { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.order-customer-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-customer-phone { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.order-items-count { color: var(--text-muted); width: 54px; flex-shrink: 0; font-size: 12px; }
.order-total { font-weight: 700; width: 76px; text-align: right; flex-shrink: 0; }
.order-time { color: var(--text-muted); font-size: 12px; width: 64px; text-align: right; flex-shrink: 0; }

.order-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.order-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}
.status-pending    { background: #FEF3C7; color: #D97706; }
.status-preparing  { background: #DBEAFE; color: #1D4ED8; }
.status-ready      { background: #DCFCE7; color: #16A34A; }
.status-delivering { background: #FFF7ED; color: #EA580C; }
.status-delivered  { background: var(--gray-bg); color: var(--gray); }
.status-cancelled  { background: #FEE2E2; color: #DC2626; }

/* order detail panel */
.order-detail {
  background: #FDFCFB;
  border-top: 1px solid var(--border);
  padding: 14px 22px 14px 44px;
}
.order-detail-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
}
.order-detail-qty { color: var(--text-muted); font-size: 12px; width: 28px; flex-shrink: 0; }
.order-detail-name { flex: 1; }
.order-detail-price { font-weight: 600; text-align: right; flex-shrink: 0; }
.order-detail-empty { color: var(--text-muted); font-size: 13px; }

.order-detail-totals {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 260px;
  margin-left: auto;
}
.order-detail-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
}
.order-detail-total-row.grand {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 2px;
}
.order-detail-notes {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}
.order-detail-address {
  font-size: 12.5px;
  color: #555;
  margin-bottom: 6px;
}
.order-detail-driver {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Driver picker modal */
.driver-pick-list { gap: 4px; }
.driver-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.driver-pick-row:hover { background: var(--gray-bg); }
.driver-pick-row.selected {
  border-color: var(--brand);
  background: rgba(255,107,44,0.06);
}
.driver-pick-emoji { font-size: 22px; flex-shrink: 0; }
.driver-pick-info  { display: flex; flex-direction: column; gap: 2px; }
.driver-pick-name  { font-weight: 700; font-size: 14px; }
.driver-pick-vehicle {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* small action buttons */
.btn-sm {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-sm:disabled { opacity: 0.45; cursor: default; }
.btn-sm.btn-primary { background: var(--brand); color: #fff; }
.btn-sm.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-sm.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }
.btn-sm.btn-ghost:hover:not(:disabled) { border-color: #DC2626; color: #DC2626; }
.btn-sm.btn-cancel { color: #DC2626; border-color: #fecaca; }
.btn-sm.btn-cancel:hover:not(:disabled) { background: #FEE2E2; }

/* ------------------------------------------------------------------ */
/* MENU CATEGORY TABS                                                  */
/* ------------------------------------------------------------------ */
.cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 0 20px 0;
}
.cat-tab {
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.cat-tab:hover { border-color: var(--brand); color: var(--brand); }
.cat-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/* MENU SECTIONS (All view)                                            */
/* ------------------------------------------------------------------ */
.menu-content { display: flex; flex-direction: column; gap: 36px; }
.menu-section { display: flex; flex-direction: column; gap: 16px; }
.menu-section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--brand-dark);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

/* ------------------------------------------------------------------ */
/* MENU ITEMS                                                          */
/* ------------------------------------------------------------------ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: 16px;
}
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.item-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.item-emoji {
  font-size: 38px;
  width: 54px;
  height: 54px;
  display: flex; align-items: center; justify-content: center;
  background: var(--page-bg);
  border-radius: var(--r-md);
  flex-shrink: 0;
}
.item-emoji.unavailable { opacity: 0.35; filter: grayscale(1); }
.item-thumb {
  width: 72px; height: 72px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--page-bg);
}
.item-thumb.unavailable { opacity: 0.35; filter: grayscale(1); }
.item-body { flex: 1; min-width: 0; }
.item-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.item-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.item-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.item-price { font-weight: 800; font-size: 16px; color: var(--brand-dark); letter-spacing: -0.5px; }
.item-actions { display: flex; align-items: center; gap: 8px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Image upload area */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.image-upload-area:hover {
  border-color: var(--brand);
  background: #fff5f0;
}
.image-upload-hint { color: var(--text-muted); font-size: 13px; }
.image-upload-hint span { display: block; }
.image-upload-sub { font-size: 11px; margin-top: 2px; }
.image-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
}

.toggle {
  width: 38px; height: 22px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle.on  { background: var(--brand); }
.toggle.off { background: #D1CEC9; }
.toggle-thumb {
  position: absolute;
  top: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on  .toggle-thumb { left: 19px; }
.toggle.off .toggle-thumb { left: 3px; }

.auto-publish-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  cursor: default;
}
.auto-publish-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* DRIVERS                                                             */
/* ------------------------------------------------------------------ */
.driver-chips {
  display: flex;
  gap: 14px;
}
.driver-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.driver-chip-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.driver-chip-dot--available   { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.driver-chip-dot--on_delivery { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.driver-chip-dot--offline     { background: #B0ADA9;      box-shadow: 0 0 0 3px #EFEDEA; }
.driver-chip-label { flex: 1; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.driver-chip-count { font-size: 26px; font-weight: 800; letter-spacing: -1px; }

.driver-status-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 5px 28px 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238C8680'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.driver-status-select.status-available   { background-color: var(--green-bg); color: var(--green); border-color: transparent; }
.driver-status-select.status-on_delivery { background-color: var(--amber-bg); color: var(--amber); border-color: transparent; }
.driver-status-select.status-offline     { background-color: var(--gray-bg);  color: var(--gray);  border-color: transparent; }

/* Driver delivery history modal */
.history-table {
  table-layout: fixed;
  width: 100%;
}
.history-table th:nth-child(1) { width: 64px; }   /* Order  */
.history-table th:nth-child(2) { width: 22%; }    /* Customer */
.history-table th:nth-child(3) { width: auto; }   /* Address — takes remaining space */
.history-table th:nth-child(4) { width: 72px; }   /* Total */
.history-table th:nth-child(5) { width: 90px; }   /* Status */
.history-table th:nth-child(6) { width: 80px; }   /* Date */
.history-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.history-summary {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.history-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px;
  gap: 3px;
  border-right: 1px solid var(--border);
}
.history-stat:last-child { border-right: none; }
.history-stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.8px; }
.history-stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ------------------------------------------------------------------ */
/* CUSTOMERS                                                           */
/* ------------------------------------------------------------------ */
.search-row { display: flex; gap: 12px; }
.search-input {
  flex: 1;
  max-width: 400px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  background: var(--surface);
  outline: none;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,44,0.12); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th,
.data-table td { padding: 12px 22px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FDFCFB; }
.th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
.td-name { font-weight: 600; font-size: 13.5px; }
.td-muted { color: var(--text-muted); font-size: 13px; }
.td-num { font-weight: 700; font-size: 13px; }
.td-revenue { color: var(--brand-dark); font-weight: 700; }
.td-address { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.loading-row { padding: 28px 22px; color: var(--text-muted); font-size: 13px; }
.empty-state  { padding: 48px 22px; text-align: center; color: var(--text-muted); font-size: 14px; }
.error-state  { padding: 24px 22px; color: var(--red); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* MODAL                                                               */
/* ------------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal--wide { width: 720px; }
.modal-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; margin: 0; }
.modal-close-x {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close-x:hover { color: var(--text); }
.modal-body {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-body label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 12px;
}
.modal-body label:first-child { margin-top: 0; }
.modal-body input,
.modal-body textarea,
.modal-body select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--page-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,107,44,0.12);
  background: #fff;
}
.modal-body textarea { resize: vertical; min-height: 80px; }
.modal-error {
  margin: 0 26px;
  padding: 10px 14px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 26px 22px;
  border-top: 1px solid var(--border);
}
.modal-foot .btn-danger { margin-right: auto; }

/* ------------------------------------------------------------------ */
/* LOGIN PAGE                                                          */
/* ------------------------------------------------------------------ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--surface);
}

.login-hero {
  flex: 1;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,44,0.18) 0%, transparent 70%);
}
.login-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,44,0.1) 0%, transparent 70%);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,107,44,0.15);
  border: 1px solid rgba(255,107,44,0.25);
  border-radius: 20px;
  padding: 6px 14px;
  margin-bottom: 32px;
  width: fit-content;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.hero-badge-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.3px;
}
.hero-title {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 16px;
}
.hero-title span { color: var(--brand); }
.hero-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  max-width: 340px;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  gap: 32px;
}
.hero-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}
.hero-stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  margin-top: 2px;
}

.login-panel {
  width: 460px;
  min-width: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 52px;
  background: #fff;
}

.login-panel-logo {
  font-size: 28px;
  margin-bottom: 32px;
}
.login-panel-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 6px;
}
.login-panel-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-form label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  display: block;
}
.login-form .field { display: flex; flex-direction: column; }
.login-form input {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--page-bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.login-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,107,44,0.12);
  background: #fff;
}
.login-form .btn-primary {
  margin-top: 6px;
  width: 100%;
  padding: 13px;
  font-size: 15px;
  border-radius: var(--r-md);
}
.login-error {
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  background: var(--red-bg);
  padding: 10px 14px;
  border-radius: var(--r-md);
  display: none;
}
.login-error.visible { display: block; }

@media (max-width: 768px) {
  .login-hero { display: none; }
  .login-panel { width: 100%; padding: 40px 28px; }
}

/* ================================================================== */
/* PUBLIC MENU                                                         */
/* ================================================================== */

body.public-body {
  background: #F8F4EF;
  color: #1A0A00;
  min-height: 100vh;
}
body.public-body #app {
  display: block;
  height: auto;
  overflow: visible;
}

/* Hero — scrolls away with the page */
.pm-hero {
  background: #FFF8F3;
  border-bottom: 1px solid rgba(255,107,44,0.15);
  padding: 20px 20px 16px;
  text-align: center;
}
.pm-hero-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}
.pm-logo-ring {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,107,44,0.12);
  border: 1.5px solid rgba(255,107,44,0.35);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pm-restaurant-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin: 0;
  color: #1A0A00;
}
.pm-restaurant-sub {
  font-size: 11px;
  color: #A07850;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: block;
}

/* Category nav — sticky, slim */
.pm-cat-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pm-cat-nav::-webkit-scrollbar { display: none; }
.pm-cat-nav-inner {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  width: max-content;
  min-width: 100%;
}
.pm-cat-tab {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: #6B4C30;
  background: transparent;
  border: 1.5px solid transparent;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  display: inline-block;
}
.pm-cat-tab:hover { background: #FFF0E8; color: #FF6B2C; }
.pm-cat-tab.active {
  background: #FF6B2C;
  color: #fff;
  border-color: #FF6B2C;
}

/* Body */
.pm-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 10px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
@media (min-width: 600px) {
  .pm-body { padding: 28px 20px 80px; }
}

/* Section */
.pm-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #EDE5D8;
}
.pm-section-emoji { font-size: 20px; line-height: 1; }
.pm-section-title {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #1A0A00;
  margin: 0;
}

/* Grid */
/* 2-column grid on all screen sizes, 3 on wide */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 900px) {
  .pm-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* Card — vertical (image on top) on all sizes */
.pm-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
  cursor: pointer;
}
.pm-card:active { opacity: 0.88; }
.pm-card--unavailable { opacity: 0.5; }

.pm-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: #EDE5D8;
  position: relative;
  flex-shrink: 0;
}
.pm-card-img-empty {
  background: linear-gradient(135deg, #EDE5D8 0%, #D9CEBD 100%);
}
.pm-badge-agotado {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.pm-card-info {
  flex: 1;
  padding: 10px 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pm-card-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #1A0A00;
}
.pm-card-desc {
  font-size: 11px;
  color: #8B6B4A;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.pm-card-price {
  font-size: 14px;
  font-weight: 800;
  color: #FF6B2C;
  letter-spacing: -0.2px;
  margin-top: 4px;
}

@media (min-width: 600px) {
  .pm-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
  }
  .pm-card-name { font-size: 14px; }
  .pm-card-desc { font-size: 12px; }
  .pm-card-price { font-size: 15px; }
  .pm-badge-agotado {
    inset: auto;
    top: 10px; right: 10px;
    border-radius: 99px;
    padding: 4px 10px;
    font-size: 10px;
  }
}

/* Footer */
.pm-footer {
  text-align: center;
  padding: 20px 16px 40px;
  font-size: 12px;
  color: #B09070;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pm-footer strong { color: #7A5C40; font-weight: 700; }

/* Spinner */
.pm-spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}
.pm-spinner {
  width: 36px; height: 36px;
  border: 3px solid #EDE5D8;
  border-top-color: #FF6B2C;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pm-error {
  text-align: center;
  padding: 80px 20px;
  color: #8B6B4A;
  font-size: 15px;
}

/* ------------------------------------------------------------------ */
/* WIZARD                                                              */
/* ------------------------------------------------------------------ */
.wizard-steps {
  display: flex;
  align-items: flex-start;
  padding: 20px 30px 0;
  gap: 0;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wizard-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  transition: background 0.2s, color 0.2s;
}
.wizard-step--upcoming .wizard-step-dot { background: var(--border); color: var(--text-muted); }
.wizard-step--active   .wizard-step-dot { background: var(--brand);  color: #fff; }
.wizard-step--done     .wizard-step-dot { background: #16A34A;        color: #fff; }
.wizard-step-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  white-space: nowrap;
}
.wizard-step--active .wizard-step-label { color: var(--brand); }
.wizard-step--done   .wizard-step-label { color: #16A34A; }
.wizard-step-line {
  flex: 1;
  height: 2px;
  margin-top: 14px;   /* aligns to dot center (28px / 2) */
  background: var(--border);
  transition: background 0.2s;
}
.wizard-step-line--done { background: #16A34A; }

/* Category picker — step 3 */
.wizard-cat-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}
.cat-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 10px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
  user-select: none;
}
.cat-card:hover { border-color: var(--brand); }
.cat-card.selected {
  border-color: var(--brand);
  background: rgba(255,107,44,0.07);
}
.cat-card-emoji { font-size: 26px; line-height: 1; }
.cat-card-name  { font-size: 11.5px; font-weight: 700; text-align: center; color: var(--text); }

/* ------------------------------------------------------------------ */
/* TENANT PAGE                                                         */
/* ------------------------------------------------------------------ */
.tenant-form { display: flex; flex-direction: column; gap: 16px; }
.form-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--brand); }
.form-error {
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  background: var(--red-bg);
  border-radius: var(--r-md);
}
.card-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.badge-plan {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-light);
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ------------------------------------------------------------------ */
/* USERS PAGE                                                          */
/* ------------------------------------------------------------------ */
.badge-role {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-role--owner   { background: #FFF0E8; color: #FF6B2C; }
.badge-role--manager { background: var(--blue-bg); color: var(--blue); }
.badge-role--staff   { background: var(--gray-bg); color: var(--gray); }

.user-status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.user-status-dot.active   { background: var(--green); }
.user-status-dot.inactive { background: var(--gray); }

.user-superadmin-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

/* ------------------------------------------------------------------ */
/* AUDIT LOG                                                           */
/* ------------------------------------------------------------------ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--brand); }

.badge-action {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-action--create { background: var(--green-bg); color: var(--green); }
.badge-action--update { background: #FFF0E8;         color: #FF6B2C;     }
.badge-action--delete { background: var(--red-bg);   color: var(--red);  }

.audit-row:hover td { background: var(--bg); }
.audit-when   { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.audit-type   { color: var(--text-muted); font-size: 13px; }
.audit-summary {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-muted);
}

.audit-detail-row td { padding: 0 !important; }
.audit-detail-cell {
  padding: 0 !important;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.audit-diff-wrap {
  display: flex;
  gap: 0;
  padding: 16px 24px;
}
.audit-diff-block {
  flex: 1;
  min-width: 0;
}
.audit-diff-block + .audit-diff-block {
  border-left: 1px solid var(--border);
  padding-left: 24px;
  margin-left: 24px;
}
.audit-diff-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.audit-diff-pre {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  background: none;
}
.audit-diff-changed {
  background: #FFF3CD;
  border-radius: 3px;
  padding: 0 2px;
  color: #7C4D00;
}

/* ── Settings page ────────────────────────────────────────────────────────── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.settings-card-icon { font-size: 18px; }

.settings-form { display: flex; flex-direction: column; gap: 16px; }

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-field { display: flex; flex-direction: column; gap: 6px; }

.settings-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.settings-input,
.settings-select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  width: 100%;
  transition: border-color 0.15s;
}
.settings-input:focus,
.settings-select:focus {
  outline: none;
  border-color: var(--brand);
}
.settings-input:disabled,
.settings-select:disabled { background: var(--gray-bg); color: var(--text-muted); }

.settings-days {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-day-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.settings-day-wrap input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
.settings-day-label { font-size: 11px; font-weight: 500; color: var(--text-muted); cursor: pointer; }

.settings-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.settings-msg { font-size: 13px; font-weight: 500; }
.settings-msg--ok    { color: var(--green); }
.settings-msg--error { color: var(--red); }

/* ── Public menu — add to cart ──────────────────────────────────────────── */
.pm-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}
.pm-add-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.pm-add-btn:hover { background: var(--brand-dark); transform: scale(1.1); }
.pm-add-btn--pulse { transform: scale(1.3) !important; }

/* ── Cart bar (sticky bottom) ───────────────────────────────────────────── */
.pm-cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  background: #1A0A00;
  color: #fff;
  display: flex; align-items: center;
  padding: 14px 20px;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.25s;
}
.pm-cart-bar--hidden { transform: translateY(100%); }
.pm-cart-bar-count {
  background: var(--brand);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
}
.pm-cart-bar-label { flex: 1; font-size: 14px; font-weight: 600; }
.pm-cart-bar-total { font-size: 15px; font-weight: 700; color: var(--brand); }

/* ── Cart overlay + drawer ──────────────────────────────────────────────── */
.pm-cart-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000;
}
.pm-cart-overlay.open { display: block; }
.pm-cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 100vw);
  background: #fff;
  z-index: 1001;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
}
.pm-cart-drawer.open { transform: translateX(0); }
.pm-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.pm-drawer-title { font-size: 17px; font-weight: 700; color: #1C1917; }
.pm-drawer-close {
  background: none; border: none; font-size: 18px; cursor: pointer; color: #888;
  padding: 4px 8px; border-radius: 6px;
}
.pm-drawer-close:hover { background: #f3f4f6; }
.pm-drawer-empty { padding: 40px 20px; text-align: center; color: #888; font-size: 15px; }
.pm-drawer-items { flex: 1; overflow-y: auto; padding: 8px 0; }
.pm-drawer-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.pm-drawer-item-name { flex: 1; font-size: 14px; font-weight: 500; color: #1C1917; }
.pm-drawer-item-price { font-size: 14px; font-weight: 600; color: #1C1917; white-space: nowrap; }
.pm-drawer-controls { display: flex; align-items: center; gap: 6px; }
.pm-drawer-ctrl {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid #e5e7eb; background: #fff;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pm-drawer-ctrl:hover { background: #f9fafb; }
.pm-drawer-qty { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.pm-drawer-foot { padding: 16px 20px; border-top: 1px solid rgba(0,0,0,0.08); }
.pm-drawer-subtotal {
  display: flex; justify-content: space-between;
  font-size: 15px; margin-bottom: 14px; color: #1C1917;
}

/* ── Customer auth page ─────────────────────────────────────────────────── */
.pm-auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--page-bg, #F4F1ED); padding: 24px;
}
.pm-auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  padding: 36px 32px;
  width: 100%; max-width: 400px;
}
.pm-auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.pm-auth-logo-name { font-size: 22px; font-weight: 800; color: #1A0A00; letter-spacing: -0.5px; }
.pm-auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; }
.pm-auth-tab {
  flex: 1; text-align: center; padding: 9px;
  border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
  color: #888; transition: background 0.15s, color 0.15s;
}
.pm-auth-tab:hover { background: #f9fafb; }
.pm-auth-tab.active { background: var(--brand); color: #fff; }
.pm-auth-form { display: flex; flex-direction: column; gap: 14px; }
.pm-auth-field { display: flex; flex-direction: column; }
.pm-auth-input {
  height: 42px; padding: 0 14px;
  border: 1.5px solid #e5e7eb; border-radius: 9px;
  font-size: 14px; color: #1C1917; background: #fff;
  transition: border-color 0.15s;
}
.pm-auth-input:focus { outline: none; border-color: var(--brand); }
.pm-auth-btn {
  height: 46px; border: none; border-radius: 10px;
  background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.pm-auth-btn:hover:not(:disabled) { background: var(--brand-dark); }
.pm-auth-btn:disabled { opacity: 0.6; cursor: default; }
.pm-auth-error { font-size: 13px; color: #DC2626; min-height: 18px; }
.pm-auth-back {
  text-align: center; font-size: 13px; color: #888; cursor: pointer;
  text-decoration: none; display: block; margin-top: 4px;
}
.pm-auth-back:hover { color: var(--brand); }

/* ── Checkout + confirmation pages ──────────────────────────────────────── */
.pm-checkout-wrap, .pm-confirm-wrap {
  max-width: 560px; margin: 0 auto; padding: 0 16px 100px;
}
.pm-checkout-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0; margin-bottom: 8px;
}
.pm-checkout-back {
  font-size: 14px; color: var(--brand); text-decoration: none; font-weight: 500;
}
.pm-checkout-title { flex: 1; font-size: 20px; font-weight: 800; color: #1A0A00; }
.pm-checkout-user { font-size: 13px; color: #888; white-space: nowrap; }
.pm-checkout-logout {
  margin-left: 6px; color: var(--brand); cursor: pointer; font-size: 12px;
  text-decoration: underline;
}
.pm-checkout-body { display: flex; flex-direction: column; gap: 16px; }
.pm-checkout-card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pm-checkout-section-title { font-size: 15px; font-weight: 700; color: #1A0A00; margin-bottom: 14px; }
.pm-checkout-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
}
.pm-checkout-item:last-of-type { border-bottom: none; }
.pm-checkout-item-qty { color: #888; font-weight: 600; width: 28px; }
.pm-checkout-item-name { flex: 1; color: #1C1917; }
.pm-checkout-item-price { font-weight: 600; color: #1C1917; }
.pm-checkout-input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1.5px solid #e5e7eb; border-radius: 9px;
  font-size: 14px; color: #1C1917; margin-bottom: 10px;
  transition: border-color 0.15s;
}
.pm-checkout-input:focus { outline: none; border-color: var(--brand); }
.pm-checkout-textarea {
  width: 100%; height: 72px; padding: 10px 12px;
  border: 1.5px solid #e5e7eb; border-radius: 9px;
  font-size: 14px; color: #1C1917; resize: vertical; font-family: inherit;
}
.pm-checkout-textarea:focus { outline: none; border-color: var(--brand); }
.pm-checkout-totals { display: flex; flex-direction: column; gap: 8px; }
.pm-checkout-total-row {
  display: flex; justify-content: space-between;
  font-size: 14px; color: #1C1917;
}
.pm-checkout-grand { font-size: 17px; font-weight: 700; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.08); }
.pm-checkout-divider { border: none; border-top: 1px solid rgba(0,0,0,0.08); margin: 12px 0; }
.pm-checkout-btn {
  display: block; width: 100%;
  height: 50px; border: none; border-radius: 12px;
  background: var(--brand); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background 0.15s; text-decoration: none; text-align: center; line-height: 50px;
}
.pm-checkout-btn:hover:not(:disabled) { background: var(--brand-dark); }
.pm-checkout-btn:disabled { opacity: 0.6; cursor: default; }

/* ── Saved address picker ────────────────────────────────────────────────── */
.pm-addr-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  border: 2px solid rgba(0,0,0,0.10); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.pm-addr-card:hover { border-color: var(--brand); }
.pm-addr-card.selected {
  border-color: var(--brand); background: #FFF4EF;
}
.pm-addr-card-body { flex: 1; }
.pm-addr-label {
  display: inline-block; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em;
}
.pm-addr-street { font-size: 14px; font-weight: 600; color: #1C1917; }
.pm-addr-city   { font-size: 13px; color: #888; margin-top: 2px; }
.pm-addr-remove {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: #bbb; padding: 0 0 0 12px;
  line-height: 1; flex-shrink: 0; align-self: center;
  transition: color 0.15s;
}
.pm-addr-remove:hover { color: #e53e3e; }
.pm-addr-new-toggle {
  font-size: 13px; color: var(--brand); font-weight: 600;
  cursor: pointer; margin-top: 4px; padding: 6px 0;
  display: inline-block;
}
.pm-addr-new-toggle:hover { text-decoration: underline; }
.pm-addr-form {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 12px;
}
.pm-addr-form input {
  width: 100%; box-sizing: border-box;
  height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,0.14); font-size: 14px;
  background: #fff; color: #1C1917;
}
.pm-addr-form input:focus { outline: none; border-color: var(--brand); }
.pm-addr-save-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #555;
}
.pm-addr-save-row input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0;
}

/* ── Order confirmation ──────────────────────────────────────────────────── */
.pm-confirm-hero {
  text-align: center; padding: 40px 0 24px;
}
.pm-confirm-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: #DCFCE7; color: #16A34A;
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.pm-confirm-title { font-size: 26px; font-weight: 800; color: #1A0A00; margin-bottom: 6px; }
.pm-confirm-sub   { font-size: 14px; color: #888; }
.pm-confirm-addr  { font-size: 14px; color: #555; }
.pm-confirm-loading { padding: 40px; text-align: center; color: #888; }
