/* ==========================================================================
   Yumply Admin – Home Dashboard (B-001: S-001 + F-001)
   Supports light and dark mode. Clean, modern layout.
   ========================================================================== */

:root {
  /* Light mode (default) */
  --bg-body: #f5f5f7;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-nav-active: rgba(213, 255, 39, 0.18);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #e5e5ea;
  --accent: #e91e63;
  --accent-hover: #c2185b;
  --yumply: #D5FF27;
  --yumply-hover: #b8e620;
  --yumply-rgb: 213, 255, 39;
  --shadow: rgba(0, 0, 0, 0.06);
  --live-dot: #e53935;
  --bg-hover: #eeeeef;
  --border-hover: #e0e0e3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #1c1c1e;
    --bg-sidebar: #bfbfbf;
    --bg-card: #2c2c2e;
    --bg-nav-active: rgba(212, 255, 46, 0.15);
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --border: #3a3a3c;
    --accent: #f06292;
    --accent-hover: #ec407a;
    --yumply: #d4ff2e;
    --yumply-hover: #b8e620;
    --yumply-rgb: 212, 255, 46;
    --shadow: rgba(0, 0, 0, 0.3);
    --live-dot: #ef5350;
    --bg-hover: #38383a;
    --border-hover: #48484a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Hide app until auth check (index.html) */
body.auth-pending #app-main {
  visibility: hidden;
  pointer-events: none;
}

/* ==========================================================================
   Auth – two-panel (optional; re-enable when connecting Supabase)
   ========================================================================== */
.auth-screen {
  display: flex;
  min-height: 100vh;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
}

.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-panel--left {
  background: #2d2d2d;
  min-width: 280px;
}

.auth-panel-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.auth-panel-logo-img {
  max-width: 180px;
  height: auto;
  object-fit: contain;
}

.auth-panel--right {
  background: #fff;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  max-width: 480px;
  margin-left: auto;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.auth-header-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.auth-header-signup {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #6e6e73;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-header-signup:hover {
  color: var(--yumply);
}

.auth-message {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border-radius: 10px;
  background: #d4edda;
  color: #155724;
}

.auth-message.auth-message--error {
  background: #f8d7da;
  color: #721c24;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.auth-form--hidden {
  display: none !important;
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1d1d1f;
}

.auth-field {
  position: relative;
}

.auth-field--password .auth-input {
  padding-right: 3rem;
}

.auth-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1d1d1f;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: var(--yumply);
}

.auth-input::placeholder {
  color: #6e6e73;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  padding: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #6e6e73;
  line-height: 0;
}

.auth-password-toggle:hover {
  color: #1d1d1f;
}

.auth-password-icon--show {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-password-icon--hide {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-password-icon--show {
  display: block;
}

.auth-forgot {
  align-self: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #e91e63;
  text-decoration: none;
  margin: -0.25rem 0 0;
  transition: color 0.2s;
}

.auth-forgot:hover {
  color: #c2185b;
}

.auth-submit {
  margin-top: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-submit--gradient {
  background: linear-gradient(90deg, var(--yumply-hover) 0%, var(--yumply) 100%);
  width: 100%;
  color: var(--text-primary);
}

.auth-submit--gradient:hover {
  opacity: 0.95;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-submit-arrow {
  font-size: 1.125rem;
  line-height: 1;
}

.auth-back-signin {
  align-self: center;
  font-size: 0.875rem;
  color: #6e6e73;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: color 0.2s;
}

.auth-back-signin:hover {
  color: var(--yumply);
}

.auth-dev-skip {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: #999;
  text-decoration: none;
}

.auth-dev-skip:hover {
  color: #666;
  text-decoration: underline;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.8125rem;
  color: #6e6e73;
}

.auth-footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-footer-link {
  color: #6e6e73;
  text-decoration: none;
}

.auth-footer-link:hover {
  color: #1d1d1f;
}

@media (max-width: 640px) {
  .auth-screen {
    flex-direction: column;
  }
  .auth-panel--left {
    min-height: 200px;
  }
  .auth-panel-logo-img {
    max-width: 140px;
  }
}

.btn-auth-signout {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-auth-signout:hover {
  color: #b71c1c;
  background: rgba(239, 83, 80, 0.25);
  border-color: rgba(239, 83, 80, 0.5);
}

.btn-auth-signout--header {
  margin-top: 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* App layout: sidebar + main */
.app {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar – pure black, rounded right, fixed so only main scrolls
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  height: 100vh;
  background: #000000;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 20px 20px 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  flex-shrink: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1rem;
}

.sidebar .nav-item {
  color: rgba(255, 255, 255, 0.92);
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-item--active {
  background: rgba(var(--yumply-rgb), 0.25);
  color: var(--yumply);
  font-weight: 600;
}

.sidebar .support-text {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar .support-link {
  color: var(--yumply);
}

.sidebar .logo-text {
  color: #ffffff;
}

.sidebar .sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.sidebar-logo .site-logo {
  height: 32px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.nav-item:hover {
  background: var(--border);
}

.nav-item--active {
  background: var(--bg-nav-active);
  color: var(--yumply);
}

.nav-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

.nav-icon--img {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar .nav-icon--img {
  filter: brightness(0) invert(1);
}

.nav-item--active .nav-icon--img {
  opacity: 1;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: auto;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.sidebar-user-card[hidden] {
  display: none !important;
}
.sidebar-user-card[hidden] + .sidebar-footer {
  margin-top: auto;
}
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}
.sidebar-user-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .sidebar-user-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.sidebar .sidebar-user-avatar {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
}
.sidebar .sidebar-user-name {
  color: rgba(255, 255, 255, 0.95);
}

.sidebar-footer {
  margin-top: 0;
  padding: 1.25rem 1.25rem 0;
  border-top: 1px solid var(--border);
}

.support-text {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.support-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--yumply);
  text-decoration: none;
}

.support-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Main content
   ========================================================================== */
.main {
  flex: 1;
  min-width: 0;
  margin-left: 240px;
  padding: 1.5rem 2rem 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Header */
.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

/* Hide entire top header on Settings page (no page name, name, avatar, gear) */
.main.page-is-settings .header {
  display: none !important;
  margin-bottom: 0;
}
/* Hide top header on Client Profiles so only the toolbar (name + gear) shows there */
.main[data-current-page="client-profiles"] #main-header {
  display: none !important;
  margin-bottom: 0;
}
/* Client Profiles: no page scroll – section fills viewport, table scrolls inside card */
.main[data-current-page="client-profiles"] {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.main[data-current-page="client-profiles"] #client-profiles {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Bring Settings content up when header is hidden */
.main.page-is-settings {
  padding-top: 0.5rem;
}
.main.page-is-settings .settings-page-inner {
  padding-top: 1rem;
}
@media (min-width: 1024px) {
  .main.page-is-settings .settings-page-inner {
    padding-top: 1.25rem;
  }
}

.header-greeting {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}
.header-page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.header-page-title[hidden] {
  display: none !important;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-user-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}
.header-user-avatar-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .header-user-avatar-wrap { background: #3a3a3c; }
}
.header-user-avatar {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}

.btn {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-primary {
  padding: 0.6rem 1.25rem;
  background: rgba(var(--yumply-rgb), 0.25);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid var(--yumply);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: rgba(var(--yumply-rgb), 0.4);
  border-color: var(--yumply-hover);
  box-shadow: 0 2px 8px rgba(var(--yumply-rgb), 0.25);
}

.btn-secondary {
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* ==========================================================================
   Dashboard (S-001): redesigned analytics dashboard
   ========================================================================== */
.dashboard { position: relative; }
.dashboard-error { padding: 1rem 1.25rem; background: #ffebee; color: #c62828; border-radius: 10px; margin-bottom: 1.5rem; font-weight: 500; }

/* Shop summary page */
.shop-summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  overflow: visible;
}
@media (max-width: 900px) {
  .shop-summary { gap: 1.35rem; }
}

/* Top row: KPI sections */
.shop-summary-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px var(--shadow);
}
.shop-summary-report-dates {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.shop-summary-report-date-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.shop-summary-report-date-input {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 9.5rem;
}
.shop-summary-report-date-input:focus-visible {
  outline: none;
  border-color: #7cb342;
  box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.18);
}
.shop-summary-report-date-sep {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.shop-summary-report-apply {
  border-radius: 999px;
}
.shop-summary-kpi-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: visible;
}
.shop-summary-kpi-section-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.shop-summary-kpi-section-note {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  opacity: 0.85;
}
.shop-summary-kpis--taxes,
.shop-summary-kpis--costs,
.shop-summary-kpis--period {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
}
.shop-summary-kpis--period {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  overflow: visible;
}
@media (max-width: 900px) {
  .shop-summary-kpis--period {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .shop-summary-kpis--period {
    grid-template-columns: 1fr;
  }
}
.shop-summary-kpi--hero {
  border-color: rgba(124, 179, 66, 0.45);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 179, 66, 0.1) 100%);
}
.shop-summary-kpi--compact {
  min-height: 88px;
  padding: 1rem 1.15rem;
}
.shop-summary-tax-breakdown,
.shop-summary-stripe-balance-note {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.shop-summary-tax-breakdown summary,
.shop-summary-stripe-balance-note summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}
.shop-summary-kpis--taxes-inline {
  margin-top: 0.85rem;
}
.shop-summary-explainer--compact {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
}
.shop-summary-stripe-balance-list {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.shop-summary-stripe-balance-list code {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.shop-summary-explainer {
  margin: 0;
  padding: 0.85rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(124, 179, 66, 0.08);
  border: 1px solid rgba(124, 179, 66, 0.22);
  border-radius: 12px;
}
.shop-summary-explainer strong {
  color: var(--text-primary);
  font-weight: 600;
}
.shop-summary-tax-rates {
  display: block;
  margin-top: 0.35rem;
  font-weight: 500;
  color: var(--text-primary);
}
.business-details-hint--combined {
  margin-top: 0.35rem;
  font-weight: 600;
  color: #558b2f;
}
.shop-summary-status {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.shop-summary-status--error {
  color: #c62828;
  background: #ffebee;
  border-color: #ffcdd2;
}
.shop-summary-kpi--net {
  border-color: rgba(124, 179, 66, 0.35);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 179, 66, 0.06) 100%);
}
.shop-summary-kpi-value--cost {
  color: #b45309;
}
.shop-summary-kpi-value--net {
  color: #558b2f;
}
.shop-summary-table-group-row th {
  padding-bottom: 0.35rem;
  border-bottom: none;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.shop-summary-table-group--customer {
  text-align: left;
  border-bottom: 2px solid rgba(41, 98, 255, 0.25);
}
.shop-summary-table-group--owner {
  text-align: left;
  border-bottom: 2px solid rgba(180, 83, 9, 0.28);
}
.shop-summary-th-divider {
  border-left: 2px solid var(--border);
}
.shop-summary-td-total-charged {
  font-weight: 600;
}
.shop-summary-th-net {
  font-weight: 700;
  color: #558b2f;
}
.shop-summary-table--financial tbody td:nth-child(7) {
  border-left: 2px solid var(--border);
}
.shop-summary-table--financial tbody td.shop-summary-td-total-charged {
  font-weight: 600;
}
.shop-summary-table--financial tbody td.shop-summary-td-net {
  font-weight: 700;
  color: #558b2f;
}
.shop-summary-table--financial tbody td.shop-summary-td-cost {
  color: #b45309;
}
.shop-summary-empty {
  text-align: center;
  padding: 2rem 1rem !important;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.shop-summary-top {
  display: none;
}
.shop-summary-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.65rem 1.45rem;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  min-height: 112px;
  overflow: visible;
}
.shop-summary-kpi-body {
  align-self: stretch;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: flex-end;
}
.shop-summary-kpi-badge {
  align-self: flex-start;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-summary-kpi-badge-img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  display: block;
}
.shop-summary-kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.shop-summary-kpi-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.shop-summary .info-tooltip-wrap .info-tooltip {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 0.45rem;
  left: 0;
  right: auto;
  max-width: min(280px, calc(100vw - 2rem));
  min-width: 0;
  width: max-content;
  transform: none;
  z-index: 200;
}
.shop-summary .info-tooltip-wrap:hover .info-tooltip,
.shop-summary .info-tooltip-wrap .info-tooltip[aria-hidden="false"] {
  transform: none;
}
.shop-summary-kpis--period > .shop-summary-kpi:last-child .info-tooltip-wrap .info-tooltip {
  left: auto;
  right: 0;
}
.shop-summary .info-tooltip-wrap--up .info-tooltip {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.45rem;
}
.shop-summary .info-tooltip-wrap .info-tooltip-icon {
  cursor: help;
  background: transparent;
  color: var(--text-secondary);
  opacity: 0.6;
  font-size: 0.75rem;
  width: auto;
  height: auto;
  min-width: auto;
  min-height: auto;
}
.shop-summary .info-tooltip-wrap .info-tooltip-icon:hover {
  background: transparent;
  color: var(--text-secondary);
  opacity: 1;
}
.shop-summary .info-tooltip-wrap .info-tooltip-icon:focus-visible {
  outline: none;
}
.shop-summary-chart-card {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1.85rem 1.65rem;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: visible;
}
@media (max-width: 900px) {
  .shop-summary-chart-card { grid-column: 1 / -1; grid-row: 2 / 3; }
}
.shop-summary-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  gap: 0.875rem;
}
.shop-summary-chart-title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.025em; }
.shop-summary-chart-period-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}
.shop-summary-chart-period {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 88px;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shop-summary-chart-period:hover { border-color: var(--border-hover); }
.shop-summary-chart-period:focus-visible {
  outline: none;
  border-color: #4A67FF;
  box-shadow: 0 0 0 3px rgba(74, 103, 255, 0.14);
}
.shop-summary-chart-period-chevron {
  font-size: 0.65rem;
  opacity: 0.85;
  transition: transform 0.2s ease;
}
.shop-summary-chart-period[aria-expanded="true"] .shop-summary-chart-period-chevron {
  transform: rotate(180deg);
}
.shop-summary-chart-period-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  margin: 0;
  padding: 0.3rem 0;
  min-width: 100%;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 40;
}
.shop-summary-chart-period-list[hidden] {
  display: none !important;
}
.shop-summary-chart-period-list li {
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}
.shop-summary-chart-period-list li:hover,
.shop-summary-chart-period-list li[aria-selected="true"] {
  background: var(--bg-hover);
}
.shop-summary-chart-wrap {
  flex: 1;
  position: relative;
  min-height: 235px;
  height: 255px;
}
.shop-summary-chart-wrap canvas { width: 100% !important; height: 100% !important; display: block; }

.shop-summary-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.65rem 1.85rem 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
  flex-shrink: 0;
}
.shop-summary-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.4rem;
}
.shop-summary-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.shop-summary-range-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.shop-summary-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.shop-summary-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.shop-summary-title { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.shop-summary-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 0;
  -webkit-overflow-scrolling: touch;
}
.shop-summary-table-wrap .shop-summary-table {
  min-width: 56rem;
}
.shop-summary-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 0.625rem;
}
.shop-summary-col--name { width: 12%; }
.shop-summary-col--email { width: 24%; }
.shop-summary-col--type { width: 8%; }
.shop-summary-col--product { width: 14%; }
.shop-summary-col--payment { width: 22%; }
.shop-summary-col--price { width: 10%; }
.shop-summary-col--discount { width: 10%; }
.shop-summary-table thead th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 1.125rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: bottom;
}
.shop-summary-table thead th:first-child { padding-left: 1.25rem; }
.shop-summary-table thead th:last-child { padding-right: 1.25rem; }
.shop-summary-table thead th:nth-child(6) {
  text-align: left;
}
.shop-summary-table thead th:nth-child(7) {
  text-align: left;
}
.shop-summary-table tbody tr {
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--shadow);
}
.shop-summary-table tbody tr:nth-child(even) { background: var(--bg-body); }
.shop-summary-table tbody td {
  padding: 1rem 1.125rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  vertical-align: middle;
}
.shop-summary-table tbody td:first-child {
  padding-left: 1.25rem;
  border-radius: 10px 0 0 10px;
  font-weight: 600;
}
.shop-summary-table tbody td:last-child { padding-right: 1.25rem; border-radius: 0 10px 10px 0; }
.shop-summary-table tbody td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-summary-payment {
  display: grid;
  grid-template-columns: 3rem 1fr;
  align-items: center;
  column-gap: 0.625rem;
  width: 100%;
  min-width: 0;
}
.shop-summary-payment .shop-summary-payment-icon--img {
  justify-self: start;
  width: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}
.shop-summary-payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 4px;
}
.shop-summary-payment--card {
  padding: 0;
  min-width: 1.75rem;
  background: var(--border);
  border-radius: 4px;
}
.shop-summary-payment--card::before {
  content: "";
  display: block;
  width: 1.25rem;
  height: 0.75rem;
  border: 1.5px solid var(--text-secondary);
  border-radius: 2px;
  opacity: 0.7;
}
.shop-summary-payment--mastercard {
  background: #eb001b;
  color: #fff;
}
.shop-summary-payment--klarna {
  background: #ffb3c7;
  color: #0a0a0a;
}
.shop-summary-payment--amex {
  background: #006fcf;
  color: #fff;
}
.shop-summary-payment-icon--img {
  padding: 0;
  min-width: 0;
  background: transparent;
  border-radius: 4px;
}
.shop-summary-payment-icon--img img {
  display: block;
  height: 22px;
  width: auto;
  max-width: 56px;
  object-fit: contain;
}
.shop-summary-payment-icon--img.shop-summary-payment-icon--apple img {
  max-width: 44px;
  height: 24px;
}
.shop-summary-payment-date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-summary-table tbody td:nth-child(5) {
  overflow: hidden;
}
.shop-summary-table tbody tr { cursor: default; }
.shop-summary-td-num {
  vertical-align: middle;
  white-space: nowrap;
}
.shop-summary-table tbody td.shop-summary-td-num:nth-child(6) {
  text-align: left;
  cursor: pointer;
}
.shop-summary-table tbody td.shop-summary-td-num:nth-child(7) {
  text-align: left;
}
.shop-summary-amount {
  display: inline-block;
  width: 100%;
  max-width: 6.5rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
}
.shop-summary-amount--discount {
  max-width: 6.75rem;
  text-align: left;
}
.shop-summary-table tbody td.shop-summary-td-num:nth-child(6) .shop-summary-amount {
  font-weight: 600;
}

.shop-summary-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
  padding-top: 0.35rem;
  flex-shrink: 0;
}
.shop-summary-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.shop-summary-pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.shop-summary-pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.shop-summary-pagination-ellipsis {
  padding: 0 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.shop-summary-pagination-arrow { font-size: 1rem; line-height: 1; }
.shop-summary-pagination-pages { display: flex; align-items: center; gap: 0.25rem; }
.shop-summary-pagination-num {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.shop-summary-pagination-num:hover { color: var(--text-primary); background: var(--bg-hover); }
.shop-summary-pagination-num--active {
  background: #1976d2;
  color: #fff;
}
.shop-summary-pagination-num--active:hover { background: #1565c0; color: #fff; }

/* Client Profiles page */
/* Client Profiles – list view */
/* Only show Client Profiles section and detail panel on the Client Profiles page */
.main:not([data-current-page="client-profiles"]) #client-profiles,
.main:not([data-current-page="client-profiles"]) #client-profiles-detail-popup {
  display: none !important;
  visibility: hidden !important;
}
/* Shop summary: only on that route — .shop-summary { display: flex } can override [hidden] for display */
.main:not([data-current-page="transaction-list"]) #transaction-list {
  display: none !important;
  visibility: hidden !important;
}
.client-profiles {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}
.client-profiles-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0;
  flex-shrink: 0;
  min-height: 2.5rem;
  width: 100%;
}
.client-profiles-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
  margin-right: 0;
}
.client-profiles-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
  margin-left: auto;
}
.client-profiles-list-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.client-profiles-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0;
}
.client-profiles-search {
  width: 220px;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.client-profiles-search::placeholder { color: var(--text-secondary); opacity: 0.8; }
.client-profiles-search-icon {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.client-profiles-dropdown,
.client-profiles-dropdown--entity {
  padding: 0.5rem 1rem;
  min-width: 160px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.client-profiles-chevron {
  font-size: 0.65rem;
  opacity: 0.8;
  display: inline-block;
  transition: transform 0.2s ease;
}
.client-profiles-dropdown[aria-expanded="true"] .client-profiles-chevron {
  transform: rotate(90deg);
}
.client-profiles-filter-wrap {
  position: relative;
  flex-shrink: 0;
}
.client-profiles-filter-list {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  margin: 0.25rem 0 0;
  padding: 0.35rem 0;
  min-width: 100%;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
}
.client-profiles-filter-list[hidden] {
  display: none !important;
}
.client-profiles-filter-list li {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  cursor: pointer;
}
.client-profiles-filter-list li:hover,
.client-profiles-filter-list li[aria-selected="true"] {
  background: var(--bg-hover);
}
.client-profiles-entity-icon { font-size: 1rem; }
.client-profiles-scan-qr {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--yumply);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.client-profiles-scan-qr:hover { background: var(--yumply-hover); }
.client-profiles-table-wrap {
  overflow: auto;
  margin-bottom: 1.25rem;
  flex: 1;
  min-height: 0;
}
.client-profiles-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}
.client-profiles-table thead th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-bottom: none;
  vertical-align: bottom;
}
.client-profiles-table tbody tr {
  background: rgba(var(--yumply-rgb), 0.08);
  cursor: pointer;
  border-radius: 8px;
}
[data-theme="dark"] .client-profiles-table tbody tr {
  background: rgba(var(--yumply-rgb), 0.11);
}
.client-profiles-table tbody tr:hover {
  background: rgba(var(--yumply-rgb), 0.13);
}
[data-theme="dark"] .client-profiles-table tbody tr:hover {
  background: var(--bg-hover);
}
.client-profiles-table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  vertical-align: middle;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: none;
  border-right: none;
}
.client-profiles-table tbody td:first-child {
  border-radius: 8px 0 0 8px;
  border-left: 1px solid var(--border);
}
.client-profiles-table tbody td:last-child {
  border-radius: 0 8px 8px 0;
  border-right: 1px solid var(--border);
}
.client-profiles-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  flex-shrink: 0;
}
.client-profiles-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.client-profiles-pagination-btn:hover { background: var(--bg-hover); border-color: var(--border-hover); }
.client-profiles-pagination-pages { display: flex; align-items: center; gap: 0.25rem; }
.client-profiles-pagination-num {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.client-profiles-pagination-num:hover { color: var(--text-primary); background: var(--bg-hover); }
.client-profiles-pagination-num--active { background: #1976d2; color: #fff; }
.client-profiles-pagination-num--active:hover { background: #1565c0; color: #fff; }
.client-profiles-pagination-ellipsis { padding: 0 0.25rem; font-size: 0.875rem; color: var(--text-secondary); }

/* Client Profiles – detail popup (blurred backdrop + slide panel, same as occasion edit) */
.client-profiles-detail-popup:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 10001;
  pointer-events: none;
}
.client-profiles-detail-popup.is-open {
  pointer-events: auto;
}

.client-profiles-detail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.client-profiles-detail-popup.is-open .client-profiles-detail-overlay {
  opacity: 1;
}

.client-profiles-detail-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 100%;
  max-width: 620px;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 1;
}
.client-profiles-detail-popup.is-open .client-profiles-detail-panel {
  transform: translateX(0);
}
.client-detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.client-detail-back {
  padding: 0.35rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.client-detail-back:hover { background: var(--bg-hover); }
.client-detail-name { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.client-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.client-detail-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.client-detail-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.client-detail-card-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}
.client-detail-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.client-detail-card-head-row .client-detail-card-title { margin: 0; }
.client-detail-cancel-membership {
  font-size: 0.8125rem;
  color: var(--yumply);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
}
.client-detail-cancel-membership:hover { text-decoration: underline; }
.client-detail-dl { margin: 0; display: grid; gap: 0.5rem; }
.client-detail-dl > div { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.client-detail-dl dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 7rem;
}
.client-detail-dl dd { margin: 0; font-size: 0.9375rem; color: var(--text-primary); }
.client-detail-with-copy { display: inline-flex; align-items: center; gap: 0.35rem; }
.client-detail-copy {
  padding: 0.2rem 0.4rem;
  font-size: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
}
.client-detail-copy:hover { color: var(--text-primary); }
.client-detail-points-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.client-detail-points-row dt { margin: 0; min-width: 7rem; }
.client-detail-points-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.client-detail-points-display { font-size: 0.9375rem; color: var(--text-primary); }
.client-detail-points-input {
  width: 5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
}
.client-detail-points-input:focus {
  outline: none;
  border-color: var(--text-secondary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
  .client-detail-points-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
  }
}
.client-detail-points-edit,
.client-detail-points-save {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.client-detail-points-edit {
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.client-detail-points-edit:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.client-detail-points-save {
  font-weight: 600;
  color: var(--bg-card);
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
}
.client-detail-points-save:hover {
  opacity: 0.9;
}
.client-detail-points-save:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}
.client-detail-points-edit:focus-visible {
  outline: 2px solid var(--border-hover);
  outline-offset: 2px;
}
.client-detail-status--subscribed {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #2e7d32;
  background: rgba(46, 125, 50, 0.12);
  border-radius: 6px;
}
.client-detail-history .client-detail-card-title { margin-bottom: 0.75rem; }
.client-detail-history-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-right: 0.15rem;
}
.client-detail-history-item {
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
button.client-detail-history-item {
  appearance: none;
  -webkit-appearance: none;
}
.client-detail-history-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 179, 66, 0.12);
  border-radius: 8px;
  position: relative;
}
.client-detail-history-icon::before {
  content: "";
  display: block;
  width: 0.72rem;
  height: 0.92rem;
  border: 1.5px solid #689f38;
  border-radius: 2px;
  background:
    linear-gradient(#689f38, #689f38) 0 0.22rem / 100% 1px no-repeat,
    linear-gradient(#689f38, #689f38) 0 0.44rem / 100% 1px no-repeat,
    linear-gradient(#689f38, #689f38) 0 0.66rem / 72% 1px no-repeat;
  opacity: 0.9;
}
.client-detail-history-item-main {
  flex: 1 1 8rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.client-detail-history-name {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.client-detail-history-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.35;
}
.client-detail-history-price {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}
.client-detail-history-item--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.client-detail-history-item--clickable:hover {
  border-color: rgba(124, 179, 66, 0.45);
  box-shadow: 0 4px 14px rgba(124, 179, 66, 0.1);
  transform: translateY(-1px);
}
.client-detail-history-item--clickable:focus-visible {
  outline: 2px solid rgba(124, 179, 66, 0.55);
  outline-offset: 2px;
}
.client-detail-history-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.65;
}
.client-detail-body.client-detail-body--order-open .client-detail-primary,
.client-detail-body.client-detail-body--order-open .client-detail-history {
  display: none;
}
.client-order-detail {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}
.client-detail-body.client-detail-body--order-open .client-order-detail {
  display: flex;
  flex: 1;
  min-height: 0;
}
.client-order-detail-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.15rem;
}
.client-order-detail-back {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.client-order-detail-back:hover {
  background: rgba(124, 179, 66, 0.08);
  border-color: rgba(124, 179, 66, 0.35);
}
.client-order-detail-back:focus-visible {
  outline: 2px solid rgba(124, 179, 66, 0.45);
  outline-offset: 2px;
}
.client-order-detail-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.client-order-detail-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 0.75rem;
}
.client-order-detail-hero {
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 14px;
  border: 1px solid rgba(124, 179, 66, 0.35);
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(124, 179, 66, 0.12) 100%);
  box-shadow: 0 6px 18px rgba(124, 179, 66, 0.08);
}
.client-order-detail-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.client-order-detail-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.client-order-detail-status--completed {
  color: #2e7d32;
  background: rgba(46, 125, 50, 0.14);
}
.client-order-detail-status--ready {
  color: #1565c0;
  background: rgba(21, 101, 192, 0.14);
}
.client-order-detail-status--preparing {
  color: #ef6c00;
  background: rgba(239, 108, 0, 0.14);
}
.client-order-detail-status--received {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.client-order-detail-order-id {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.client-order-detail-hero-date {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.client-order-detail-hero-total {
  margin: 0.45rem 0 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
}
.client-order-detail-hero-caption {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.client-order-detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.client-order-detail-section-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.client-order-detail-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.client-order-detail-item-card {
  padding: 0.85rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.client-order-detail-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}
.client-order-detail-item-main {
  flex: 1;
  min-width: 0;
}
.client-order-detail-item-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
}
.client-order-detail-line-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.client-order-detail-qty-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #558b2f;
  background: rgba(124, 179, 66, 0.16);
}
.client-order-detail-line-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.client-order-detail-line-price {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.client-order-detail-line-extras {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.client-order-detail-extra-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.client-order-detail-extra-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.client-order-detail-extra-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.client-order-detail-extra-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}
.client-order-detail-extra-name {
  color: var(--text-secondary);
  min-width: 0;
}
.client-order-detail-extra-price {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.client-order-detail-extra-price--included {
  font-weight: 500;
  color: var(--text-secondary);
}
.client-order-detail-line-note {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.28);
}
.client-order-detail-note-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8860b;
  margin-bottom: 0.2rem;
}
.client-order-detail-note-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-primary);
}
.client-order-detail-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.client-order-detail-section--totals .client-order-detail-totals {
  margin-top: 0;
}
.client-order-detail-totals {
  padding: 0.85rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.client-order-detail-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.client-order-detail-total-row span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-weight: 600;
}
.client-order-detail-total-row--discount span:last-child {
  color: #2e7d32;
}
.client-order-detail-total-row--grand {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.client-order-detail-total-row--grand span:first-child {
  color: var(--text-primary);
  font-weight: 700;
}
.client-order-detail-total-row--grand span:last-child {
  font-size: 1.05rem;
  font-weight: 800;
}

/* Settings full page (opened from header gear icon) */
.settings-page {
  position: relative;
  padding: 0;
}
.settings-page-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}
.settings-page-title {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}
.settings-page .settings-section { margin-bottom: 1.75rem; }
.settings-page .settings-section:last-child { margin-bottom: 0; }
.settings-section { margin-bottom: 0; }
.settings-section-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.settings-section-desc { margin: 0 0 1rem; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.4; }

/* Account card (info from signup) */
.settings-account-card {
  background: linear-gradient(180deg, var(--bg-body) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}
.settings-account-hero {
  text-align: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.settings-account-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}
.settings-account-name { font-size: 1.125rem; margin: 0 0 0.25rem; }
.settings-account-email { margin: 0; font-size: 0.8125rem; color: var(--text-secondary); }
.settings-account-email--muted { opacity: 0.85; }
.settings-account-form { margin: 0; }
.settings-form-actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.settings-save-btn {
  align-self: flex-start;
  padding: 0.6rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.settings-save-btn:hover { background: var(--accent-hover); }
.settings-save-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.settings-save-status { margin: 0; font-size: 0.8125rem; color: var(--text-secondary); }
.settings-save-status.settings-save-status--error { color: #c62828; }
.settings-save-status.settings-save-status--success { color: var(--text-primary); }
.settings-row--readonly { flex-direction: row; align-items: center; gap: 0.5rem; }
.settings-readonly { font-size: 0.9375rem; color: var(--text-secondary); }
.settings-info-dl { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.settings-info-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.settings-info-row dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 7rem;
}
.settings-info-row dd { margin: 0; font-size: 0.9375rem; color: var(--text-primary); }

/* POS integrations */
.settings-pos-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.settings-pos-grid--page {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 700px) {
  .settings-pos-grid--page { grid-template-columns: 1fr; }
}
.settings-pos-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-pos-card:hover { border-color: var(--border-hover); box-shadow: 0 2px 8px var(--shadow); }
.settings-pos-card-inner { padding: 1.25rem; }
.settings-pos-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.settings-pos-logo--square { background: #006AFF; }
.settings-pos-logo--toast { background: #E31837; }
.settings-pos-logo--clover { background: #00B140; }
.settings-pos-name { margin: 0 0 0.2rem; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.settings-pos-desc { margin: 0 0 1rem; font-size: 0.8125rem; color: var(--text-secondary); }
.settings-pos-connect {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--yumply);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
}
.settings-pos-connect:hover { background: var(--yumply-hover); }
.settings-pos-connect:active { transform: scale(0.98); }
.settings-pos-connected { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.settings-pos-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2e7d32;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.settings-pos-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2e7d32; }
.settings-pos-disconnect {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: underline;
}
.settings-pos-disconnect:hover { color: var(--yumply); }
.settings-stripe-disconnect {
  text-decoration: underline;
}
.settings-stripe-disconnect:hover { color: var(--yumply); }

/* Preferences */
.settings-preferences {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.settings-row { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.settings-row:last-child { margin-bottom: 0; }
.settings-row--toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.settings-label { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.settings-input,
.settings-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.settings-input::placeholder { color: var(--text-secondary); opacity: 0.7; }
.settings-select { cursor: pointer; min-width: 0; }
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.2s;
}
.settings-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.settings-toggle input:checked + .settings-toggle-slider { background: var(--yumply); }
.settings-toggle input:checked + .settings-toggle-slider::before { transform: translateX(20px); }

/* Settings page – modern minimal */
.settings-page {
  position: relative;
  padding: 0;
  min-height: 0;
  background: var(--bg-body);
}
.settings-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}
@media (min-width: 768px) {
  .settings-page-inner { padding-left: 2.5rem; padding-right: 2.5rem; }
}
@media (min-width: 1024px) {
  .settings-page-inner { padding: 3rem 3rem 6rem; }
}

.settings-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem 1.25rem 1.5rem 1.5rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}
.settings-page-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--yumply) 0%, var(--yumply-hover) 100%);
  border-radius: 4px 0 0 4px;
}
.settings-page-header-text {
  flex: 1;
  min-width: 0;
  padding-left: 0.5rem;
}
.settings-page-title {
  margin: 0 0 0.375rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.settings-page-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 48ch;
  font-weight: 400;
}
.settings-page-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) {
  .settings-page-header-avatar { width: 52px; height: 52px; font-size: 1.0625rem; }
}

/* Settings tabs: Info | Integration (same style as App Builder tabs) */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
  position: relative;
  border-bottom: none;
}
.settings-tabs::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--border);
}
.settings-tab {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.settings-tab:hover {
  color: var(--text-primary);
  background: rgba(var(--yumply-rgb), 0.15);
}
.settings-tab--active {
  color: var(--text-primary);
  background: rgba(var(--yumply-rgb), 0.35);
  border: 1px solid var(--yumply);
}
.settings-tab:focus-visible {
  outline: 2px solid var(--yumply);
  outline-offset: 2px;
}
.settings-tab-panels {
  margin-top: 0;
}
.settings-tab-panel {
  padding: 0.5rem 0 2rem;
}
.settings-tab-panel[hidden] {
  display: none !important;
}

/* Two-column row for Account + Business on large screens */
.settings-cards-row {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 960px) {
  .settings-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    align-items: stretch;
  }
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.2s ease;
}
@media (min-width: 768px) {
  .settings-card { padding: 2.25rem; }
}
.settings-card:hover { border-color: var(--border-hover); }
.settings-card--half {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.settings-card--half .settings-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.settings-card--half .settings-form-actions {
  margin-top: auto;
}
.settings-card--full { margin-bottom: 0; }
.settings-card--pos { overflow: visible; }
.settings-card-title {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.settings-card-desc {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.settings-form { margin: 0; }
.settings-field {
  margin-bottom: 1.75rem;
}
.settings-field:last-of-type { margin-bottom: 0; }
.settings-field--readonly {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}
.settings-field--readonly .settings-label {
  margin-bottom: 0;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.settings-field--readonly .settings-readonly {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}
.settings-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.settings-helper {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.settings-optional { font-weight: 400; color: var(--text-secondary); opacity: 0.85; }
.settings-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.settings-input:focus {
  outline: none;
  border-color: var(--accent);
}
.settings-input::placeholder { color: var(--text-secondary); opacity: 0.6; }
.settings-input[readonly] { opacity: 0.8; cursor: default; background: var(--bg-card); }
.settings-readonly { font-size: 0.9375rem; color: var(--text-secondary); }
.settings-password-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.settings-password-row .settings-input { flex: 1; min-width: 140px; }

.settings-form-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.settings-form-actions .settings-save-status {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: opacity 0.3s;
}
.settings-save-status[hidden] {
  display: none !important;
}
.settings-save-status.settings-save-status--success {
  color: #4caf50;
}
.settings-save-status.settings-save-status--error {
  color: #c62828;
}
.settings-btn-primary {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(var(--yumply-rgb), 0.2);
  border: 1.5px solid var(--yumply);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-btn-primary:hover {
  background: rgba(var(--yumply-rgb), 0.35);
  border-color: var(--yumply-hover);
  box-shadow: 0 2px 8px rgba(var(--yumply-rgb), 0.2);
}
.settings-btn-primary:active {
  transform: scale(0.98);
}
.settings-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.settings-btn-secondary {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.settings-btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-hover); }

/* Integrations page – UX/UI refined */
.integrations-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 3rem;
}
.integrations-header {
  margin-bottom: 2.75rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.integrations-title {
  margin: 0 0 0.625rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.integrations-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 48ch;
}
.integrations-subsection {
  margin-top: 0;
  padding: 1.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.integrations-subsection:first-of-type {
  margin-top: 0;
}
.integrations-subsection:not(:first-of-type) {
  margin-top: 1.75rem;
}
.integrations-subsection-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(var(--yumply-rgb), 0.25);
  display: inline-block;
}
.integrations-subsection-desc {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.integrations-payment-methods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin: -0.35rem 0 1.15rem;
}
.integrations-payment-methods-img {
  height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
}
.integrations-payment-methods-img--card {
  height: 28px;
}
.integrations-subsection .integrations-grid {
  margin-top: 0;
}
.settings-stripe-badge {
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}
.settings-stripe-badge--connected { background: rgba(46, 125, 50, 0.14); color: #2e7d32; }
.settings-stripe-badge--disconnected { background: rgba(0, 0, 0, 0.06); color: var(--text-secondary); }
.settings-stripe-badge--connecting { background: rgba(0, 0, 0, 0.06); color: var(--text-secondary); }
.settings-stripe-badge--error { background: rgba(220, 53, 69, 0.12); color: #c92a2a; }
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}
@media (max-width: 900px) {
  .integrations-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (max-width: 560px) {
  .integrations-grid { grid-template-columns: 1fr; gap: 1rem; }
}
/* Card = square box: white, subtle border, clean layout (reference style) */
.integration-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  min-height: 0;
}
.integration-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.integration-card:focus-within {
  border-color: var(--yumply);
  box-shadow: 0 0 0 2px rgba(var(--yumply-rgb), 0.15);
}
.integration-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.integration-card-icon--img {
  width: 88px;
  height: 88px;
  background: var(--bg-card);
  padding: 10px 10px 10px 2px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.integration-card[data-pos] .integration-card-icon--img {
  margin-left: 4px;
}
.integration-card-icon--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}
.integration-card[data-integration="stripe"] .integration-card-icon--img {
  align-items: center;
  justify-content: flex-start;
  padding: 10px 10px 10px 0;
  margin-left: -6px;
}
.integration-card[data-integration="stripe"] .integration-card-icon--img img {
  width: auto;
  height: 44px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.integration-card-name {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
}
.integration-card-desc {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  min-height: 3em;
}
.integration-card-learn {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: underline;
  margin-bottom: 1rem;
  align-self: flex-start;
}
.integration-card-learn:hover {
  color: var(--yumply);
}
.integration-card-learn:focus-visible {
  outline: 2px solid var(--yumply);
  outline-offset: 2px;
  border-radius: 2px;
}
.integration-card-badge {
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
}
/* Keep POS and Stripe badges identical inside integration cards */
.integration-card .settings-pos-badge,
.integration-card .settings-stripe-badge {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
}
.integration-card .settings-pos-badge::before,
.integration-card .settings-stripe-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2e7d32;
}
/* Connect button – pill shape, same colors as reference (light gray, dark text) */
.integration-card .integration-card-connect {
  margin-top: auto;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(var(--yumply-rgb), 0.34);
  border: 1px solid rgba(var(--yumply-rgb), 0.62);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  width: 100%;
}
.integration-card .integration-card-connect:hover {
  background: rgba(var(--yumply-rgb), 0.46);
  border-color: rgba(var(--yumply-rgb), 0.75);
  color: var(--text-primary);
}
.integration-card .integration-card-connect:focus-visible {
  outline: 1px solid var(--yumply);
  outline-offset: 2px;
}
.integration-card .integration-card-connect[style*="display: none"] {
  display: none !important;
}
.integration-card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.integration-card .integration-card-disconnect {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  width: 100%;
}
.integration-card .integration-card-disconnect:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.integration-card .integration-card-disconnect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* POS – Dropbox-style dropdown (legacy, kept for any refs) */
.settings-pos-dropdown { position: relative; margin-bottom: 1.5rem; }
.settings-pos-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease;
  text-align: left;
}
.settings-pos-trigger:hover { border-color: var(--border-hover); }
.settings-pos-trigger[aria-expanded="true"] { border-color: var(--yumply); }
.settings-pos-trigger-chevron {
  font-size: 0.6rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.settings-pos-trigger[aria-expanded="true"] .settings-pos-trigger-chevron { transform: rotate(180deg); }
.settings-pos-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 50;
  overflow: hidden;
  padding: 0.375rem;
}
.settings-pos-dropdown-panel[hidden] { display: none !important; }
.settings-pos-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}
.settings-pos-option:hover { background: var(--bg-hover); }
.settings-pos-option:focus { outline: none; background: var(--bg-hover); }
.settings-pos-option-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.settings-pos-option-name { flex: 1; }
.settings-pos-placeholder {
  margin: 0;
  padding: 1.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-body);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.settings-pos-presented[hidden] { display: none !important; }
.settings-pos-presented { margin-top: 0; }
.settings-pos-placeholder[hidden] { display: none !important; }
.settings-pos-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  background: var(--bg-body);
  transition: border-color 0.2s ease;
}
.settings-pos-tile--presented { border-color: var(--border-hover); }
.settings-pos-tile-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.settings-pos-logo--square { background: #006AFF; }
.settings-pos-logo--toast { background: #E31837; }
.settings-pos-logo--clover { background: #00B140; }
.settings-pos-tile-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.settings-pos-tile-desc {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.settings-pos-badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.settings-pos-badge--disconnected { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.settings-pos-badge--connected { background: rgba(46, 125, 50, 0.14); color: #2e7d32; }
.settings-pos-badge--error { background: rgba(198, 40, 40, 0.12); color: #c62828; }
.settings-pos-badge--connecting { background: rgba(25, 118, 210, 0.14); color: #1976d2; }
.settings-pos-connect {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--yumply);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s ease;
}
.settings-pos-connect:hover { background: var(--yumply-hover); }

.settings-pos-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.settings-pos-modal[hidden] { display: none !important; }
.settings-pos-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.settings-pos-modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}
.settings-pos-modal-title { margin: 0 0 0.75rem; font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
.settings-pos-modal-text { margin: 0 0 1.75rem; font-size: 1rem; color: var(--text-secondary); line-height: 1.5; }
.settings-pos-modal-steps { margin: 0.75rem 0 1rem; padding-left: 1.25rem; }
.settings-pos-modal-steps li { margin-bottom: 0.5rem; }
.settings-pos-modal-steps code { font-size: 0.875rem; word-break: break-all; }
.settings-pos-modal-note { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--text-secondary); }
.settings-pos-modal-actions { display: flex; gap: 1rem; justify-content: flex-end; flex-wrap: wrap; }
.settings-pos-modal .settings-btn-primary {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #f0f0f0;
  border: 1px solid #d8dadc;
  color: #333333;
  border-radius: 999px;
}
.settings-pos-modal .settings-btn-primary:hover {
  background: #e8e8e8;
  border-color: #d0d0d0;
  color: #1d1d1f;
}

/* POS redirect loading overlay */
.pos-redirect-loading {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.pos-redirect-loading[hidden] { display: none !important; }
.pos-redirect-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.pos-redirect-loading-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  max-width: 320px;
  background: var(--bg-card, #fff);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border, #e5e5e5);
}
.pos-redirect-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border, #e5e5e5);
  border-top-color: var(--yumply, #7cb342);
  border-radius: 50%;
  animation: pos-redirect-spin 0.8s linear infinite;
}
.pos-redirect-loading-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary, #1a1a1a);
  text-align: center;
}
@keyframes pos-redirect-spin {
  to { transform: rotate(360deg); }
}

/* Shared dashboard card */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.dash-card-header-right { display: flex; align-items: center; gap: 0.75rem; }
.dash-card-title-wrap { display: flex; align-items: center; gap: 0.4rem; }
.dash-card-title { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 0.35rem; margin: 0; }
.dash-card-info { font-size: 0.75rem; color: var(--text-secondary); opacity: 0.6; cursor: help; }
/* Dashboard card tooltips: show below the "i", grey icon like before, keep hover tooltip */
.dash-card .info-tooltip-wrap .info-tooltip {
  bottom: auto; top: 100%; margin-bottom: 0; margin-top: 0.5rem;
  left: auto; right: 0;
  max-width: min(360px, calc(100vw - 2rem));
  transform: none;
}
/* Left column: open tooltip to the right so it isn't cut off by the sidebar */
.dash-row--top > .dash-card:first-child .info-tooltip-wrap .info-tooltip,
.dash-grid--3 > [data-dash-module]:nth-child(3n+1) .info-tooltip-wrap .info-tooltip,
.dash-grid--2 > [data-dash-module]:nth-child(2n+1) .info-tooltip-wrap .info-tooltip {
  left: 0; right: auto;
}
.dash-card .info-tooltip-wrap .info-tooltip-icon { cursor: help; background: transparent; color: var(--text-secondary); opacity: 0.6; font-size: 0.75rem; }
.dash-card .info-tooltip-wrap .info-tooltip-icon:hover { background: transparent; color: var(--text-secondary); opacity: 1; }
.dash-card-refresh { background: none; border: none; color: var(--text-secondary); opacity: 0.5; cursor: pointer; padding: 4px; border-radius: 6px; transition: opacity 0.15s; }
.dash-card-refresh:hover { opacity: 1; }
.dash-card-link { font-size: 0.75rem; color: var(--yumply); text-decoration: none; font-weight: 500; }
.dash-card-link:hover { text-decoration: underline; }
/* Top clients: See All uses same neutral style as other secondary links, not green */
.dash-card--top-clients .dash-card-link { color: var(--text-secondary); }
.dash-card--top-clients .dash-card-link:hover { color: var(--text-primary); text-decoration: underline; }

/* Row 1: processing + feed – fixed sizes, not affected by removing other sections */
.dash-row--top {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 960px) { .dash-row--top { grid-template-columns: 1fr; } }

.dash-card--processing { min-height: 240px; }
.dash-processing-value { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; }
.dash-big-number { font-size: 2rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.dash-change { font-size: 0.8125rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 6px; }
.dash-change--up { background: #e8f5e9; color: #2e7d32; }
.dash-change--down { background: #ffebee; color: #c62828; }

.dash-chart-wrap--processing { flex: 1; position: relative; height: 100px; min-height: 100px; }
.dash-chart-wrap--processing canvas { width: 100% !important; height: 100% !important; }

/* Activity feed card */
.dash-card--activity-feed { min-height: 240px; }
.dash-card--activity-feed .dash-card-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live-dot); animation: pulse 1.5s ease-in-out infinite; margin-right: 2px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.activity-feed { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.activity-feed-empty { margin: 0; color: var(--text-secondary); font-size: 0.875rem; }
.dash-no-data-msg { margin: 0.75rem 0 0; padding: 0.5rem 0; color: var(--text-primary); font-size: 0.8125rem; font-weight: 900; }
.client-profiles-empty {
  margin: 0;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}
.client-profiles-empty[hidden] { display: none !important; }
.activity-item { padding: 0.65rem 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.15rem; }
.activity-item:last-child { border-bottom: none; }

/* Stats bar */
.dash-stats-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.dash-stats-title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.dash-stats-filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.dash-stats-date-composite {
  display: inline-flex; align-items: stretch; font-family: inherit; font-size: 0.8125rem; color: var(--text-primary);
  background: #fff; border: 1px solid #e0e0e0; border-radius: 999px; padding: 0; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dash-stats-date-composite:hover { border-color: #bdbdbd; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.dash-stats-date-composite:focus-visible { outline: none; border-color: #7cb342; box-shadow: 0 0 0 2px rgba(124, 179, 66, 0.25); }
.dash-stats-date-preset { padding: 0.5rem 1rem; font-weight: 500; color: var(--text-primary); border-radius: 999px 0 0 999px; }
.dash-stats-date-divider { width: 1px; background: #e8e8e8; margin: 0.25rem 0; flex-shrink: 0; }
.dash-stats-date-range-wrap { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem 0.5rem 0.75rem; border-radius: 0 999px 999px 0; }
.dash-stats-date-cal-icon { flex-shrink: 0; color: var(--text-secondary); }
.dash-stats-date-range { font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.dash-stats-compare { font-size: 0.8125rem; color: var(--text-secondary); }
.dash-stats-compare-select {
  font-family: inherit; font-size: 0.8125rem; padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid #e0e0e0; background: #fff; color: var(--text-primary); cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dash-stats-compare-select:hover { border-color: #bdbdbd; }
.dash-stats-compare-select:focus { outline: none; border-color: #7cb342; box-shadow: 0 0 0 2px rgba(124, 179, 66, 0.2); }
.dash-stats-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.dash-stats-action { font-family: inherit; font-size: 0.8125rem; font-weight: 500; padding: 0.35rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); cursor: pointer; transition: background 0.15s; }
.dash-stats-action:hover { background: var(--bg-body); }

/* Date range picker – clean and simple */
.dash-date-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.dash-date-modal[aria-hidden="true"] { pointer-events: none; }
.dash-date-modal[aria-hidden="true"] .dash-date-modal-overlay { opacity: 0; pointer-events: none; }
.dash-date-modal[aria-hidden="true"] .dash-date-modal-panel { opacity: 0; transform: scale(0.98); pointer-events: none; }
.dash-date-modal-overlay {
  position: absolute; inset: 0; z-index: 0; background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease;
}
.dash-date-modal-panel {
  position: relative; z-index: 1; background: #fff;
  border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  width: 100%; max-width: 640px; padding: 1.25rem 1.5rem; box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0; overflow-x: hidden;
}
@media (prefers-color-scheme: dark) {
  .dash-date-modal-panel { background: var(--bg-card); }
}
.dash-date-modal-inputs {
  display: flex; gap: 1rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid #f0f0f0;
}
.dash-date-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.dash-date-input-label { font-size: 0.75rem; font-weight: 500; color: #666; }
.dash-date-input {
  font-family: inherit; font-size: 0.75rem; padding: 0.4rem 0.6rem; border-radius: 10px;
  border: none; outline: none; background: #f8f8f8; color: var(--text-primary); width: 96px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.dash-date-input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px rgba(124, 179, 66, 0.35); }
.dash-date-modal-body { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: flex-start; flex-wrap: nowrap; }
.dash-date-presets { display: flex; flex-direction: column; gap: 0.15rem; min-width: 120px; flex-shrink: 0; }
.dash-date-preset {
  font-family: inherit; font-size: 0.75rem; padding: 0.5rem 0.75rem; border: none; border-radius: 8px;
  background: transparent; color: #888; text-align: left; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.dash-date-preset:hover { background: #eef7d5; color: #2e7d32; }
.dash-date-preset.dash-date-preset--active { background: #eef7d5; color: #2e7d32; font-weight: 500; }
.dash-date-calendars { flex: 1; min-width: 0; overflow: hidden; }
.dash-date-cals-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.dash-date-cal-prev, .dash-date-cal-next {
  width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent;
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #666; transition: color 0.2s ease, background 0.2s ease; flex-shrink: 0;
}
.dash-date-cal-prev:hover, .dash-date-cal-next:hover { color: #333; background: #f5f5f5; }
.dash-date-cal-month { font-size: 0.75rem; font-weight: 600; color: #333; }
.dash-date-cals-grids { display: flex; gap: 1rem; align-items: flex-start; justify-content: flex-start; flex-shrink: 0; }
.dash-date-cal { flex: 0 0 auto; width: 180px; }
.dash-date-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 24px); gap: 2px; margin-bottom: 0.35rem;
  justify-content: start;
}
.dash-date-cal-weekday {
  width: 24px; text-align: center; padding: 0.2rem 0; color: #666; font-weight: 500; font-size: 0.65rem;
}
.dash-date-cal-grid {
  display: grid; grid-template-columns: repeat(7, 24px); grid-auto-rows: 24px;
  gap: 2px; font-size: 0.7rem; font-weight: 700;
}
.dash-date-cal-day {
  width: 24px; height: 24px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  cursor: pointer; color: #444; padding: 0; flex-shrink: 0;
  font-weight: 700 !important; opacity: 1;
  border: none; outline: none; background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}
.dash-date-cal-day:focus { outline: none; }
.dash-date-cal-day:hover { background: #eef7d5; color: #2e7d32; }
.dash-date-cal-day.dash-date-cal-day--other { color: #888; opacity: 1; }
.dash-date-cal-day.dash-date-cal-day--in-range { background: #7cb342; color: #fff; font-weight: 700; border-radius: 0; }
.dash-date-cal-day.dash-date-cal-day--start,
.dash-date-cal-day.dash-date-cal-day--end { background: #7cb342; color: #fff; font-weight: 700; }
.dash-date-cal-day.dash-date-cal-day--start { border-radius: 50% 0 0 50%; }
.dash-date-cal-day.dash-date-cal-day--end { border-radius: 0 50% 50% 0; }
.dash-date-cal-day.dash-date-cal-day--start.dash-date-cal-day--end { border-radius: 50%; }
.dash-date-modal-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}
.dash-date-btn { font-family: inherit; font-size: 0.8125rem; font-weight: 500; padding: 0.5rem 1rem; border-radius: 10px; cursor: pointer; border: none; outline: none; transition: background 0.2s ease, color 0.2s ease; }
.dash-date-btn:focus { outline: none; }
.dash-date-btn--clear { background: transparent; color: #888; }
.dash-date-btn--clear:hover { background: #f5f5f5; color: #333; }
.dash-date-btn--apply { background: #7cb342; color: #fff; padding: 0.5rem 1.25rem; }
.dash-date-btn--apply:hover { background: #689f38; }

/* Dashboard modules modal (Add) */
.dash-modules-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; }
.dash-modules-modal[aria-hidden="true"] { pointer-events: none; }
.dash-modules-modal[aria-hidden="true"] .dash-modules-modal-panel { opacity: 0; transform: scale(0.96); }
.dash-modules-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); transition: opacity 0.2s ease; }
.dash-modules-modal[aria-hidden="false"] .dash-modules-modal-overlay { opacity: 1; }
.dash-modules-modal[aria-hidden="true"] .dash-modules-modal-overlay { opacity: 0; }
.dash-modules-modal-panel { position: relative; background: var(--bg-card); border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); max-width: 420px; width: 100%; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; transition: opacity 0.2s ease, transform 0.2s ease; padding: 1.25rem 1.5rem; }
.dash-modules-modal-title { margin: 0 0 0.25rem; font-size: 1.125rem; font-weight: 600; color: var(--text-primary); }
.dash-modules-modal-desc { margin: 0 0 1rem; font-size: 0.8125rem; color: var(--text-secondary); }
.dash-modules-list { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.dash-modules-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 10px; background: var(--bg-body); border: 1px solid transparent; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.dash-modules-item:hover { background: #f5f5f5; }
.dash-modules-item input { margin: 0; accent-color: #7cb342; }
.dash-modules-item label { flex: 1; cursor: pointer; font-size: 0.875rem; color: var(--text-primary); }
.dash-modules-modal-footer { display: flex; justify-content: flex-end; padding-top: 0.5rem; border-top: 1px solid #f0f0f0; }

/* Dashboard module visibility: unchecked = hidden */
#dashboard [data-dash-module][hidden] { display: none !important; }

/* Edit mode: delete button on cards */
.dash-edit-mode .dash-card[data-dash-module] { position: relative; }
.dash-edit-mode .dash-card-remove { display: flex; position: absolute; top: 0.5rem; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; align-items: center; justify-content: center; border: none; border-radius: 8px; background: #ffebee; color: #c62828; cursor: pointer; font-size: 1.25rem; line-height: 1; font-weight: 700; z-index: 2; transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.dash-edit-mode .dash-card-remove:hover { background: #c62828; color: #fff; transform: translateX(-50%) scale(1.15); box-shadow: 0 4px 12px rgba(198, 40, 40, 0.35); }
.dash-card-remove { display: none; }

/* KPI grids – flex so when a module is hidden, remaining cards fill the row (no empty spots) */
.dash-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.dash-grid > [data-dash-module],
.dash-grid > section.dash-card {
  flex: 1 1 280px;
  min-width: min(280px, 100%);
  max-width: 100%;
}
@media (max-width: 960px) {
  .dash-grid > [data-dash-module],
  .dash-grid > section.dash-card { min-width: 100%; }
}

/* KPI cards */
.dash-kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.dash-card--compact .dash-kpi-value { font-size: 1.5rem; }
.dash-chart-wrap--kpi { position: relative; flex: 0 0 70px; height: 70px; min-height: 70px; }
.dash-card--compact .dash-chart-wrap--kpi { flex: 0 0 50px; height: 50px; min-height: 50px; }
.dash-card[data-dash-module="app-ltv"] .dash-chart-wrap--kpi { padding-top: 20px; }
.dash-chart-wrap--kpi canvas { width: 100% !important; height: 100% !important; }
.dash-chart-wrap--medium { position: relative; height: 110px; min-height: 110px; }
.dash-card[data-dash-module="age-chart"] {
  display: flex;
  flex-direction: column;
}
.dash-card[data-dash-module="age-chart"] .dash-chart-wrap--medium {
  margin-top: auto;
  height: 110px;
  min-height: 110px;
}
.dash-card[data-dash-module="age-chart"] .dash-chart-wrap--medium canvas {
  height: 100% !important;
}
.dash-card[data-dash-module="hours-chart"] {
  display: flex;
  flex-direction: column;
}
.dash-card[data-dash-module="hours-chart"] .dash-chart-wrap--medium {
  margin-top: auto;
  height: 110px;
  min-height: 110px;
}
.dash-card[data-dash-module="hours-chart"] .dash-chart-wrap--medium canvas {
  height: 100% !important;
}
.dash-card[data-dash-module="gender-chart"] .dash-chart-wrap--medium { height: 180px; min-height: 180px; }
.dash-chart-wrap--medium canvas { width: 100% !important; height: 100% !important; }

/* Revenue breakdown card */
.dash-card--breakdown { justify-content: flex-start; }
.dash-breakdown-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 0.75rem; }
.dash-breakdown-bar span { display: block; height: 100%; transition: width 0.3s; }
.dash-breakdown-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.dash-breakdown-legend li { display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; color: var(--text-primary); }
.dash-breakdown-legend li::before { content: ''; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin-right: 0.5rem; }
.dash-breakdown-legend .dash-leg-label { flex: 1; }
.dash-breakdown-legend .dash-leg-value { font-weight: 600; text-align: right; min-width: 80px; }
.dash-breakdown-empty { margin: 0.5rem 0 0; font-size: 0.8125rem; color: var(--text-secondary, #888); }

/* Top clients table */
.dash-top-clients-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.dash-top-clients-table thead th { text-align: left; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); padding: 0 0 0.5rem; border-bottom: 1px solid var(--border); }
.dash-top-clients-table thead th:last-child { text-align: right; }
.dash-top-clients-table tbody td { padding: 0.5rem 0; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.dash-top-clients-table tbody td:last-child { text-align: right; font-weight: 600; }
.dash-top-clients-table tbody tr:last-child td { border-bottom: none; }

/* Top/bottom products */
.dash-products-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.dash-products-col-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.5rem; }
.dash-products-col-title--top { color: #2e7d32; }
.dash-products-col-title--bottom { color: #c62828; }
.dash-products-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; counter-reset: prod; }
.dash-products-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-primary); }
.dash-products-list li::before { counter-increment: prod; content: counter(prod); width: 20px; height: 20px; border-radius: 50%; background: #e8f5e9; color: #2e7d32; font-size: 0.6875rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-products-list--bottom li::before { background: #ffebee; color: #c62828; }
.dash-products-list .dash-prod-name { flex: 1; }
.dash-products-list .dash-prod-count { font-weight: 600; color: var(--text-secondary); font-size: 0.75rem; }

/* Export report section – table layout like Scheduled Reports */
.dash-export-section { margin-top: 2rem; padding: 1.5rem; background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); }
.dash-export-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.dash-export-title { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--text-primary); }
.dash-export-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.dash-export-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.dash-export-table thead { background: var(--bg-body); }
.dash-export-table th { text-align: left; padding: 0.75rem 1rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.6875rem; border-bottom: 1px solid var(--border); }
.dash-export-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.dash-export-table tbody tr:last-child td { border-bottom: none; }
.dash-export-table tbody tr:hover { background: rgba(0,0,0,0.02); }
.dash-export-format { display: inline-flex; align-items: center; }
.dash-export-pdf-icon { display: block; }
.dash-export-download { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.75rem; font-size: 0.8125rem; font-weight: 500; color: #7cb342; background: transparent; border: 1px solid #7cb342; border-radius: 8px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.dash-export-download:hover { background: #7cb342; color: #fff; }

/* Card base (keep for backward compat with other sections) */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 8px var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; }
.chart-select { font-family: inherit; font-size: 0.8125rem; padding: 0.35rem 0.6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-primary); cursor: pointer; }
.chart-wrap { position: relative; height: 200px; }

.activity-item strong {
  font-weight: 600;
  color: var(--text-primary);
}

.activity-item span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.activity-item time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.9;
}

.activity-item--order .activity-order-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.activity-order-pos-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  vertical-align: middle;
}

.activity-order-pos-badge--synced {
  background: rgba(46, 125, 50, 0.15);
  color: #2e7d32;
}

.activity-order-pos-badge--failed {
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
}

.activity-order-pos-error {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* ==========================================================================
   App Builder (B-002: S-002 + F-002)
   Tabs: Offers, Products, Rewards, Settings.
   ========================================================================== */
.app-builder {
  position: relative;
}

.app-builder-error {
  padding: 1rem 1.25rem;
  background: #ffebee;
  color: #c62828;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .app-builder-error {
    background: rgba(229, 57, 53, 0.2);
    color: #ef9a9a;
  }
}

.app-builder-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.app-builder-tabs-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-builder-tabs-row .tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.app-builder-preview-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.app-builder-preview-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-open-customer-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 0.625rem 1.25rem;
  min-height: 42px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-open-customer-app-icon {
  flex-shrink: 0;
  opacity: 0.72;
}

.btn-open-customer-app:hover {
  color: var(--text-primary);
  border-color: rgba(var(--yumply-rgb), 0.5);
  background: rgba(var(--yumply-rgb), 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-open-customer-app:hover .btn-open-customer-app-icon {
  opacity: 1;
}

.btn-open-customer-app:focus-visible {
  outline: 2px solid var(--yumply);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .btn-open-customer-app {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  }

  .btn-open-customer-app:hover {
    border-color: rgba(var(--yumply-rgb), 0.45);
    background: rgba(var(--yumply-rgb), 0.12);
  }
}

/* Tab list */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem 0;
  position: relative;
  border-bottom: none;
}

.tabs::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--border);
}

.tab {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab:hover {
  color: var(--text-primary);
  background: rgba(var(--yumply-rgb), 0.15);
}

.tab--active {
  color: var(--text-primary);
  background: rgba(var(--yumply-rgb), 0.35);
  border: 1px solid var(--yumply);
}

.tab:focus-visible {
  outline: 2px solid var(--yumply);
  outline-offset: 2px;
}

/* Tab panels */
.tab-panels {
  min-height: 200px;
}

.tab-panel {
  padding: 1.5rem 0 1.5rem 0;
}

.tab-panel[hidden] {
  display: none !important;
}

/* Offers panel: align sub-tabs and cards with title and tabs */
.tab-panel--offers {
  padding-top: 0.75rem;
  padding-left: 0;
  padding-right: 0;
}

.offers-sub-tabs {
  display: inline-flex;
  width: auto;
  min-width: 360px;
  gap: 0.5rem;
  margin-bottom: 0;
  padding: 0.375rem;
  background: var(--border);
  border-radius: 8px;
  position: relative;
}

.offers-sub-tabs-slider {
  position: absolute;
  top: 0.375rem;
  bottom: 0.375rem;
  left: 0.375rem;
  width: calc(50% - 0.375rem - 0.25rem);
  background: var(--bg-card);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.offers-sub-tabs--automated .offers-sub-tabs-slider {
  transform: translateX(calc(100% + 0.5rem));
}

.offers-panel-card {
  margin-top: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.offers-sub-tab {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 0.625rem 1rem;
  cursor: pointer;
  border-radius: 6px;
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  transition: color 0.25s ease;
  min-height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}
.offers-sub-tab:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

.offers-sub-tab:hover:not(.offers-sub-tab--active) {
  color: var(--text-secondary);
}

/* Active: rounded “inner” button, darker text */
.offers-sub-tab--active {
  color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
  .offers-sub-tabs-slider {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  }
  .offer-message-logo {
    background: #2c2c2e;
  }
}

/* Customer app preview modal (foggy backdrop, frameless phone viewport) */
.customer-preview-modal[hidden] {
  display: none !important;
}

.customer-preview-modal {
  --preview-phone-width: 375px;
  --preview-phone-ratio: 375 / 812;
  --preview-panel-pad-x: 1.5rem;
  --preview-panel-pad-y: 1.25rem;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.customer-preview-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 14, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.customer-preview-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(
    calc(var(--preview-phone-width) + (var(--preview-panel-pad-x) * 2)),
    calc(100vw - 2.5rem)
  );
  max-height: min(96vh, 900px);
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.28);
  padding: var(--preview-panel-pad-y) var(--preview-panel-pad-x) calc(var(--preview-panel-pad-y) + 0.25rem);
  overflow: hidden;
}

.customer-preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding-bottom: 1rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.customer-preview-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.customer-preview-modal-close {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.customer-preview-modal-close:hover {
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.03);
}

.customer-preview-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 1rem;
  width: 100%;
}

.customer-preview-modal-loading,
.customer-preview-modal-error {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
}

.customer-preview-modal-error {
  color: #c62828;
}

.customer-preview-device {
  position: relative;
  width: min(var(--preview-phone-width), 100%);
  max-height: min(812px, calc(100vh - 11.5rem));
  aspect-ratio: var(--preview-phone-ratio);
  margin-inline: auto;
  border-radius: 2rem;
  overflow: hidden;
  background: #0f0e0e;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 10px 36px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
}

.customer-preview-device .customer-app-preview-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

body.customer-preview-modal-open {
  overflow: hidden;
}

@media (max-height: 720px) {
  .customer-preview-modal {
    --preview-panel-pad-y: 1rem;
  }

  .customer-preview-modal-header {
    padding-bottom: 0.75rem;
  }

  .customer-preview-modal-body {
    padding-top: 0.75rem;
  }

  .customer-preview-device {
    max-height: calc(100vh - 10rem);
    border-radius: 1.5rem;
  }
}

.tab-panel-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tab-panel-placeholder {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   One-Time Offers (B-004: S-004 + F-004)
   Form to create a special limited offer.
   ========================================================================== */
.offers-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.offers-option-card {
  flex: 1;
  min-width: 200px;
  font-family: inherit;
  text-align: left;
  padding: 1.25rem;
  background: var(--bg-body);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.offers-option-card:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-nav-active);
}

.offers-option-card:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.offers-option-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.offers-option-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.offers-option-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Saved one-time offers list (D-005) – same structure as automated, no title, no top/header lines */
.saved-offers-wrap {
  margin: 0;
  padding: 0;
  border-top: none;
}

.one-time-offer-saved-wrap {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
}

/* One-time offer list: same 3-column grid as cards so columns align. Third column matches card's status+menu width.
   Higher specificity so we win over .occasion-list-header (50px 1fr 1fr) which appears later in the file. */
.one-time-offer-saved-wrap .one-time-offer-list-header {
  grid-template-columns: 1fr 1fr minmax(120px, auto);
  gap: 1rem;
  border-bottom: none;
  padding: 1rem 1.25rem 0.25rem 1.25rem;
}

.one-time-offer-list-header .occasion-col--name {
  grid-column: 1;
  text-align: left;
}

.one-time-offer-list-header .occasion-col--content {
  grid-column: 2;
  text-align: left;
  padding: 0;
  min-width: 0;
}

.one-time-offer-list-header .occasion-col--spacer {
  grid-column: 3;
  min-width: 0;
}

.one-time-offer-list {
  padding: 0.5rem 0 1rem;
}

/* Card: title (col 1) | discount (col 2) | status + menu (col 3). Same third column as header so column 2 aligns. */
.one-time-offer-list .occasion-card {
  grid-template-columns: 1fr 1fr minmax(120px, auto);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
}

/* Unselected one-time cards: grey border and background like automated offers */
.one-time-offer-view .one-time-offer-list .occasion-card:not(.occasion-card--selected) {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.one-time-offer-view .one-time-offer-list .occasion-card:not(.occasion-card--selected):hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-hover) !important;
  box-shadow: 0 2px 8px var(--shadow);
  transform: translateY(-1px);
}

.one-time-offer-list .occasion-card .occasion-name {
  grid-column: 1;
  min-width: 0;
}

.one-time-offer-list .occasion-card .occasion-content {
  grid-column: 2;
  min-width: 0;
  justify-self: start;
  text-align: left;
  padding: 0;
}

.one-time-offer-list .occasion-card .occasion-content-col {
  grid-column: 3;
}

.one-time-offer-list .occasion-content-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.one-time-offer-list .occasion-content-col .occasion-status {
  margin-left: 0;
}

.one-time-offer-list .occasion-card-thumb {
  display: none;
}

/* Selected one-time offer card: same as automated (light purple + border) */
.one-time-offer-list .occasion-card--selected {
  background: #f3e5f5;
  border: 1px solid #e1bee7;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.one-time-offer-list .occasion-card--selected:hover {
  background: #f3e5f5;
  border-color: #e1bee7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.one-time-offer-list .occasion-card--selected .occasion-name,
.one-time-offer-list .occasion-card--selected .occasion-content {
  color: #7b1fa2;
  font-weight: 500;
}

.occasion-status--scheduled {
  background: #e3f2fd;
  color: #1565c0;
}

.saved-offers-empty {
  list-style: none;
  margin-left: -1.25rem;
  color: var(--text-secondary);
}

.back-link {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 0.75rem;
  margin: 0 0 0.5rem;
  display: inline-block;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.one-time-offer-view .tab-panel-title {
  margin-top: 0;
}

.one-time-offer-error {
  padding: 1rem 1.25rem;
  background: #ffebee;
  color: #c62828;
  border-radius: 10px;
  margin: 1rem 0;
  font-weight: 500;
  border: 1px solid rgba(198, 40, 40, 0.35);
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.12);
}

.one-time-offer-error[hidden] {
  display: none !important;
}

/* Invalid sections: red border and tint until user fills them */
.one-time-offer-form-section--invalid {
  border: 2px solid #c62828;
  border-radius: 10px;
  padding: 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  background: rgba(198, 40, 40, 0.06);
}

.one-time-offer-form-section--invalid .one-time-offer-form-section-title {
  color: #c62828;
}

@media (prefers-color-scheme: dark) {
  .one-time-offer-error {
    background: rgba(229, 57, 53, 0.2);
    color: #ef9a9a;
    border-color: rgba(239, 154, 154, 0.4);
  }

  .one-time-offer-form-section--invalid {
    border-color: #ef5350;
    background: rgba(198, 40, 40, 0.12);
  }

  .one-time-offer-form-section--invalid .one-time-offer-form-section-title {
    color: #ef9a9a;
  }
}

/* One-Time Offers: same structure as Automated (header + two columns). Pull up so button and cards sit closer to toggle. */
.one-time-offer-view {
  margin-top: -3.1rem;
}

.one-time-offer-view .one-time-offer-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.one-time-offer-btn-create {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.one-time-offer-btn-create-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
}

.one-time-offer-view .one-time-offer-layout {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 700px);
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .one-time-offer-view .one-time-offer-layout {
    grid-template-columns: 1fr;
  }
}

.one-time-offer-view .one-time-offer-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  min-height: 0;
  overflow: visible;
}

.one-time-offer-view .one-time-offer-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  padding: 0.75rem 1.25rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.one-time-offer-view .offer-preview-block {
  padding-top: 1.25rem;
}

.one-time-offer-view .offer-preview-block .phone-preview-wrap--onetime {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0 1.75rem !important;
  padding: 0 0 1rem !important;
  border: none !important;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.one-time-offer-preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: min(320px, 100%);
  flex-shrink: 0;
  gap: 0.35rem;
  padding-bottom: 1.5rem;
}

.one-time-offer-preview-device {
  position: relative;
  width: min(320px, 100%);
  height: min(560px, 62vh);
  min-height: 420px;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  overflow: hidden;
  background: #1a1514;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
  isolation: isolate;
}

.one-time-offer-preview-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(236, 221, 218, 0.82);
  text-align: center;
  pointer-events: none;
}

.one-time-offer-preview-status[hidden] {
  display: none !important;
}

.one-time-offer-preview-status--error {
  color: #ff8a80;
}

.one-time-offer-preview-device .customer-app-preview-iframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #1a1514;
  pointer-events: auto;
}

.one-time-offer-preview-device .customer-app-preview-iframe[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.one-time-offer-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.one-time-offer-empty-icon--phone,
.one-time-offer-empty-icon--sparkles {
  width: 80px;
  height: 80px;
}

.one-time-offer-empty-state .one-time-offer-empty-icon--sparkles {
  width: 96px;
  height: 96px;
}

.one-time-offer-empty-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.one-time-offer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  width: 100%;
  flex: 1;
  min-height: 280px;
}

.one-time-offer-empty-state[hidden] {
  display: none !important;
}

.one-time-offer-empty-state-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.one-time-offer-saved-wrap:not([hidden]) {
  display: block;
}

/* One-time offer form modal – right-side panel (same as occasion edit, slide from right) */
.one-time-offer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.one-time-offer-modal[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.one-time-offer-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.one-time-offer-modal[aria-hidden="false"] .one-time-offer-modal-overlay {
  opacity: 1;
}

.one-time-offer-modal-content {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 100%;
  max-width: 520px;
  height: calc(100vh - 32px);
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.one-time-offer-modal[aria-hidden="false"] .one-time-offer-modal-content {
  transform: translateX(0);
}

.one-time-offer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.one-time-offer-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.one-time-offer-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.one-time-offer-modal-close:hover {
  background: var(--bg-body);
  color: var(--text-primary);
}

.one-time-offer-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.one-time-offer-modal-desc {
  margin-bottom: 1rem;
}

.one-time-offer-form {
  max-width: 100%;
  margin-top: 0;
}

/* One-time offer form: clean sections + fixed-size text fields (not resizable) */
.one-time-offer-form-section {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.one-time-offer-form-section-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.one-time-offer-form textarea {
  resize: none;
  min-height: 4.5rem;
  max-height: 4.5rem;
  height: 4.5rem;
  box-sizing: border-box;
  overflow-y: auto;
}

/* One-time offer form: clean modern style matching reference */
.one-time-offer-form .form-group input,
.one-time-offer-form .form-group select,
.one-time-offer-form .form-group textarea {
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding: 0.7rem 1rem;
}

.one-time-offer-form .form-group input::placeholder,
.one-time-offer-form .form-group textarea::placeholder {
  color: #b0b0b0;
}

.one-time-offer-form .form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.one-time-offer-form .form-group input:focus,
.one-time-offer-form .form-group select:focus,
.one-time-offer-form .form-group textarea:focus,
.one-time-offer-form .ot-value-wrap:focus-within {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
  outline: none;
}

/* OT pill toggle buttons */
.ot-pills {
  display: flex;
  gap: 0;
  width: 320px;
  max-width: 100%;
  background: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: -0.5rem;
}

.ot-pill {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.ot-pill--active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* OT value input wrap (number + suffix like "days" or "%") */
.ot-value-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #f8f8f8;
  min-height: 48px;
  box-sizing: border-box;
}

.ot-value-wrap input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
}

.ot-value-wrap input:focus {
  outline: none;
}

.ot-value-hint {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 0.25rem;
}

/* OT field label */
.ot-field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: -0.85rem;
}

/* OT product tags */
.ot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.ot-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: #f3e5f5;
  color: #7b1fa2;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.ot-tag-remove {
  border: none;
  background: none;
  color: #7b1fa2;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* OT product selector dropdown */
.ot-select-wrap {
  position: relative;
  width: 100%;
}

.ot-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.3rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #f8f8f8;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.ot-select-chevron {
  font-size: 0.625rem;
  margin-left: 0.5rem;
}

.ot-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  margin-top: 4px;
  display: none;
}

.ot-select-dropdown[aria-hidden="false"] {
  display: block;
}

.ot-select-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.ot-select-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ot-select-option:hover {
  background: #f5f5f5;
}

.ot-select-option[aria-selected="true"] {
  background: #f3e5f5;
  color: #7b1fa2;
  font-weight: 500;
}

.form-row {
  margin-bottom: 1rem;
}

.form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .form-row--two {
    grid-template-columns: 1fr;
  }
}

.form-section {
  margin-bottom: 1rem;
}

.form-section-title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group .required {
  color: var(--accent);
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-body);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-secondary);
}

.form-group textarea {
  resize: vertical;
  min-height: 4rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

/* One-time offer: Product(s) section matches automated (occasion-edit) spacing + room for dropdown */
.one-time-offer-products-section {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  gap: 0;
}

.one-time-offer-products-section .occasion-edit-field-label,
.one-time-offer-products-section .occasion-edit-tags {
  margin-bottom: 0.2rem;
}

.one-time-offer-form .form-actions.occasion-edit-footer {
  margin-top: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* One-time offer: Cancel/Save bar stays fixed at bottom while body scrolls */
.one-time-offer-modal-content > .one-time-offer-footer {
  flex-shrink: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.one-time-offer-footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Cancel: secondary, low emphasis, clear tap target */
.one-time-offer-footer .occasion-edit-cancel {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.one-time-offer-footer .occasion-edit-cancel:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: var(--text-primary);
}

.one-time-offer-footer .occasion-edit-cancel:active {
  background: #e5e7eb;
}

/* Delete: destructive outline, clearly separate from Cancel */
.one-time-offer-delete {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #dc2626;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.one-time-offer-delete:hover {
  background: #fef2f2;
  border-color: #b91c1c;
  color: #b91c1c;
}

.one-time-offer-delete:active {
  background: #fee2e2;
}

/* ==========================================================================
   B-006: Error messages for all features
   F-003: Automated Offers – "Offers failed to load."
   F-005: Phone preview – empty phone with message
   ========================================================================== */
.automated-offer-view .tab-panel-title {
  margin-top: 0;
}

.automated-offer-error {
  padding: 1rem 1.25rem;
  background: #ffebee;
  color: #c62828;
  border-radius: 10px;
  margin: 1rem 0;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .automated-offer-error {
    background: rgba(229, 57, 53, 0.2);
    color: #ef9a9a;
  }
}

/* Automated Offers: two-column layout (card + phone | occasion list) */
.automated-offer-layout {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 700px);
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .automated-offer-layout {
    grid-template-columns: 1fr;
  }
}

.automated-offer-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.offer-preview-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  overflow: visible;
}

/* Notification-style card - inside preview block */
.automated-offer-view .offer-message-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-height: 56px;
  width: 100%;
  max-width: 420px;
  margin-top: 2rem;
  margin-bottom: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
}

.offer-message-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  object-position: center center;
  flex-shrink: 0;
  display: block;
  align-self: center;
}

.offer-message-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 2px;
}

.automated-offer-view .offer-message-text {
  margin: 0 0 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.automated-offer-view .offer-message-brand {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.offer-message-card--onetime {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-height: 56px;
  width: 100%;
  max-width: 420px;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.offer-message-text--headline {
  margin: 0 0 0.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.offer-message-text--body {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.offer-message-card--onetime .offer-message-brand {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.offer-preview-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

/* Live Flutter offer preview in Automated Offers */
.automated-offer-view .phone-preview-wrap--automated {
  margin: 0.75rem 0 1.75rem !important;
  padding: 0 0 1rem !important;
  border: none !important;
  display: flex;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.automated-offer-preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: min(320px, 100%);
  flex-shrink: 0;
  gap: 0.35rem;
  padding-bottom: 1.5rem;
}

.automated-offer-preview-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

.automated-offer-preview-device {
  position: relative;
  width: min(320px, 100%);
  height: min(460px, 50vh);
  min-height: 360px;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  overflow: hidden;
  background: #1a1514;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
  isolation: isolate;
}

.automated-offer-preview-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(236, 221, 218, 0.82);
  text-align: center;
  pointer-events: none;
}

.automated-offer-preview-status:not([hidden]) {
  display: flex !important;
  background: #1a1514;
}

.automated-offer-preview-status[hidden] {
  display: none !important;
}

.automated-offer-preview-status--error {
  color: #ff8a80;
}

.automated-offer-preview-device .customer-app-preview-iframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #1a1514;
  pointer-events: auto;
  touch-action: manipulation;
}

.automated-offer-preview-device .customer-app-preview-iframe[hidden] {
  visibility: hidden;
  pointer-events: none;
}

/* Clip confetti so it disappears before the bottom of the phone mockup (no escape past frame) */
.phone-preview-confetti-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
  clip-path: inset(0 0 10% 0);
  max-width: 100%;
  max-height: 100%;
}

.phone-preview-confetti-wrap canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  pointer-events: none;
  overflow: hidden;
}

.phone-preview-occasion-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  min-height: 0;
  padding: 0 0.5rem;
  margin-top: 9rem;
  box-sizing: border-box;
  align-self: stretch;
  overflow: hidden;
}

.phone-preview-occasion-card-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  /* clip so product strip never draws outside phone */
  contain: layout style paint;
}

.phone-preview-occasion-block[data-dismissed="true"] .phone-preview-occasion-card-wrap {
  overflow: hidden;
}

.phone-preview-occasion-image {
  transition: opacity 0.35s ease-out;
  cursor: pointer;
}

.phone-preview-occasion-image--fading {
  opacity: 0;
  pointer-events: none;
}

.phone-preview-occasion-title {
  margin: 0 0 0.2rem 0;
  font-size: 1.95rem;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.4;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: pre-line;
  padding: 0 0.15rem;
  box-sizing: border-box;
}

.phone-preview-occasion-subtitle {
  margin: 0;
  margin-top: 0.05rem;
  font-size: 0.9375rem;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.35;
}

/* Occasion product cards – used by one-time offer phone mock */
.phone-preview-occasion-products {
  position: absolute;
  top: 0;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0;
  /* width from left/right only so strip stays inside card-wrap */
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  gap: 0.4rem;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0.5rem 0.5rem;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease-out;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: default;
  contain: layout style;
}

.phone-preview-occasion-products::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.phone-preview-occasion-block[data-dismissed="true"] .phone-preview-occasion-products {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
  z-index: 2;
}

.phone-preview-occasion-block[data-dismissed="true"] .phone-preview-occasion-products:active {
  cursor: default;
}

.phone-preview-occasion-products:empty {
  display: none;
}

.phone-preview-occasion-products-empty {
  flex: 1 1 auto;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.35;
}

.phone-preview-product-card {
  flex: 0 0 auto;
  width: calc((100% - 0.4rem) / 2);
  max-width: 8rem;
  min-width: 4.5rem;
  max-height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-body);
  border: 1px solid var(--border);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.phone-preview-product-card-image-wrap {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  overflow: hidden;
}

.phone-preview-product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-preview-product-card-body {
  flex: 0 0 auto;
  padding: 0.25rem 0.32rem 0.32rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.14rem;
}

.phone-preview-product-card-category {
  display: inline-block;
  padding: 0.08rem 0.26rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-preview-product-card-name {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.18;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Audio message card on phone preview – fixed length and padding, button size independent */
.phone-preview-audio-message {
  display: flex;
  align-items: center;
  gap: 0;
  width: 75%;
  max-width: 75%;
  min-width: 0;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.35rem 0.6rem;
  box-sizing: border-box;
  background: #f5f5f7;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700 !important;
}

/* Force every text node inside the card to same font and bold */
.phone-preview-audio-message .phone-preview-audio-text-wrap,
.phone-preview-audio-message .phone-preview-audio-text-wrap p,
.phone-preview-audio-message .phone-preview-audio-text,
.phone-preview-audio-message .phone-preview-audio-sender {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.8125rem !important;
  line-height: 1.25 !important;
}

.phone-preview-audio-play {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-preview-audio-play-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.phone-preview-audio-text-wrap {
  flex: 1;
  min-width: 0;
  font-weight: 700 !important;
}

.phone-preview-audio-text-wrap p,
.phone-preview-audio-text,
.phone-preview-audio-sender {
  font-weight: 700 !important;
}

.phone-preview-audio-text {
  margin: 0 0 1px;
  color: var(--text-secondary);
}

.phone-preview-audio-sender {
  margin: 0;
  color: var(--text-primary);
}

/* Occasion list (right column) */
.automated-offer-right {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  position: relative;
  z-index: 5;
  overflow: visible;
  isolation: isolate;
}

.occasion-list-title {
  margin: 0;
  padding: 1.25rem 1.25rem 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.occasion-list-header {
  display: grid;
  grid-template-columns: 50px 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}

.automated-offer-right .occasion-list-header {
  grid-template-columns: 50px minmax(0, 1fr) minmax(148px, auto);
}

.automated-offer-right .occasion-card {
  grid-template-columns: 50px minmax(0, 1fr) minmax(148px, auto);
  position: relative;
  z-index: 1;
}

.automated-offer-right .occasion-card:hover,
.automated-offer-right .occasion-card:focus-within {
  z-index: 2;
}

.automated-offer-right .occasion-content-col {
  grid-column: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: visible;
}

.automated-offer-right .occasion-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  position: relative;
  z-index: 15;
}

.automated-offer-right .occasion-list {
  overflow: visible;
}

.automated-offer-right .occasion-card {
  overflow: visible;
}

.automated-offer-right .occasion-content-col .occasion-status {
  grid-column: 2;
  margin-left: 0;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.automated-offer-right .occasion-content-col .occasion-card-actions {
  grid-column: 3;
}

.automated-offer-right .occasion-content {
  grid-column: 1;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.occasion-col--name {
  grid-column: 1 / 3;
  text-align: left;
}

.occasion-col--content {
  grid-column: 3;
  text-align: left;
}

.occasion-list {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.occasion-card {
  display: grid;
  grid-template-columns: 50px 1fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  margin-bottom: 0;
}

.occasion-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px var(--shadow);
  transform: translateY(-1px);
}

.occasion-card--selected {
  background: #f3e5f5;
  border: 1px solid #e1bee7;
  border-radius: 10px;
  padding: 1.25rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.occasion-card--selected:hover {
  background: #f3e5f5;
  border-color: #e1bee7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transform: none;
}

.occasion-card--selected .occasion-name {
  color: #7b1fa2;
  font-weight: 500;
}

.occasion-card--selected .occasion-content {
  color: #7b1fa2;
  font-weight: 500;
}

.occasion-card-thumb {
  width: 50px;
  height: 30px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.occasion-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-left: 0;
}

.occasion-content-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.occasion-content {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary);
  padding-right: 0;
  min-width: 5.5rem;
  flex-shrink: 0;
}

.occasion-content-col .occasion-status {
  margin-left: auto;
}

.occasion-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}

.occasion-status--active {
  background: #e8f5e9;
  color: #2e7d32;
}

.occasion-status--inactive {
  background: #ffebee;
  color: #c62828;
}

.occasion-chart-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #666;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.occasion-chart-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.occasion-chart-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.occasion-menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-body);
  color: var(--text-secondary);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 1px 3px var(--shadow);
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.occasion-menu-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.35);
}

.occasion-menu-btn:active {
  transform: scale(0.98);
}

/* Edit Occasion Popup – right-side panel, slide from right */
.occasion-edit-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.occasion-edit-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.occasion-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.occasion-edit-popup[aria-hidden="false"] .occasion-edit-overlay {
  opacity: 1;
}

.occasion-edit-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 100%;
  max-width: 620px;
  height: calc(100vh - 32px);
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.occasion-edit-popup[aria-hidden="false"] .occasion-edit-panel {
  transform: translateX(0);
}

.occasion-edit-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.occasion-edit-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.occasion-edit-back:hover {
  background: var(--bg-body);
}

.occasion-edit-panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.occasion-edit-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.occasion-edit-section {
  margin-bottom: 1.75rem;
}

.occasion-edit-section:last-child {
  margin-bottom: 0;
}

.occasion-edit-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Date section: same UX/UI as one-time offer form */
.occasion-edit-section--date {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.occasion-edit-section--date .occasion-edit-section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0;
}

.occasion-edit-section--date .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.occasion-edit-section--date .form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.occasion-edit-section--date .form-group input {
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding: 0.7rem 1rem;
}

.occasion-edit-section--date .form-group input:focus {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
  outline: none;
}

.occasion-edit-card-and-active {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0;
}

.occasion-edit-card-preview {
  width: 110px;
  height: 66px;
  border-radius: 8px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.occasion-edit-card-preview--img {
  padding: 0;
  background: var(--bg-body);
}

.occasion-edit-card-preview--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.occasion-edit-status-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.occasion-edit-status-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.occasion-edit-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.occasion-edit-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.occasion-edit-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: 0.25s;
}

.occasion-edit-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: 0.25s;
}

.occasion-edit-toggle input:checked + .occasion-edit-toggle-slider {
  background: #3b82f6;
  border-color: #3b82f6;
}

.occasion-edit-toggle input:checked + .occasion-edit-toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

.occasion-edit-status-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.occasion-edit-pills {
  display: flex;
  gap: 0;
  width: 320px;
  max-width: 100%;
  background: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 0.875rem;
}

.occasion-edit-pill {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.occasion-edit-pill--active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.occasion-edit-field--percentage {
  margin-bottom: 0;
}

.occasion-edit-value-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.occasion-edit-value-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  min-height: 48px;
  box-sizing: border-box;
}

.occasion-edit-value-wrap input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.occasion-edit-value-wrap input:focus {
  outline: none;
}

.occasion-edit-value-hint {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.occasion-edit-type-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.occasion-edit-field-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.occasion-edit-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
}

.occasion-edit-audio-sender-wrap {
  margin-bottom: 1rem;
}

.occasion-edit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.occasion-edit-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-body);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.occasion-edit-tag-remove {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.occasion-edit-tag-remove:hover {
  opacity: 1;
}

.occasion-edit-select-wrap {
  margin-bottom: 0;
  position: relative;
}

.occasion-edit-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  background: var(--bg-body);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  appearance: none;
}

.occasion-edit-select-trigger:hover {
  border-color: var(--border);
  background: var(--bg-body);
}

.occasion-edit-select-chevron {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.5rem;
}

.occasion-edit-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.occasion-edit-select-dropdown.is-open {
  display: block;
}

#ot-select-dropdown.is-open {
  max-height: 12.5rem;
}

.occasion-edit-select-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.occasion-edit-select-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.occasion-edit-select-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.occasion-edit-voice-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: #dcfce7;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.15);
  border-radius: 10px;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.occasion-edit-voice-banner-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23166534'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.occasion-edit-voice-banner-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: #166534;
}

.occasion-edit-audio-section .occasion-edit-section-title {
  margin-bottom: 0.75rem;
}

.occasion-edit-required {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.occasion-edit-audio-section--invalid {
  border: 2px solid #c62828;
  border-radius: 10px;
  padding: 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  background: rgba(198, 40, 40, 0.06);
}

.occasion-edit-audio-section--invalid .occasion-edit-section-title {
  color: #c62828;
}

.occasion-edit-voice-filename {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occasion-edit-audio-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 120px;
  padding: 1.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.occasion-edit-audio-upload:hover {
  border-color: var(--text-secondary);
  background: var(--bg-body);
}

.occasion-edit-audio-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.occasion-edit-audio-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ca3af'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3Cpath d='M12 19l4-4h-3V9h-2v6H8l4 4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.occasion-edit-audio-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.occasion-edit-audio-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: center;
}

.occasion-edit-audio-filename {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

.occasion-edit-audio-wrap {
  position: relative;
}

.occasion-edit-audio-upload.has-file {
  display: none;
}

.occasion-edit-voice-player {
  position: relative;
  padding: 2.5rem 1.25rem 1.25rem;
  min-height: 160px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 0;
}

.occasion-edit-voice-player-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #374151;
  color: #ef4444;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  z-index: 1;
}

.occasion-edit-voice-player-remove:hover {
  background: #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: scale(1.05);
}

.occasion-edit-voice-player-remove:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.occasion-edit-voice-player-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: #374151;
  border-radius: 8px;
  margin-top: 1rem;
}

.occasion-edit-voice-player-svg {
  display: block;
  color: inherit;
}

.occasion-edit-voice-player-btn {
  padding: 0.2rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.occasion-edit-voice-player-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.occasion-edit-voice-player-play {
  font-size: 1rem;
  padding: 0.35rem;
}

.occasion-edit-voice-player-icon-img {
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.occasion-edit-voice-player-15icon {
  width: 20px;
  height: 20px;
}

.occasion-edit-voice-player-time {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
  min-width: 2.25rem;
  flex-shrink: 0;
}

.occasion-edit-voice-player-progress-wrap {
  flex: 1;
  min-width: 0;
}

.occasion-edit-voice-player-progress {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
}

.occasion-edit-voice-player-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.occasion-edit-voice-player-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.occasion-edit-voice-player-volume {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-width: 0;
}

.occasion-edit-voice-player-volume-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.occasion-edit-voice-player-volume-slider {
  --volume-value: 100;
  width: 56px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #3b82f6 0%, #3b82f6 var(--volume-value), rgba(255, 255, 255, 0.3) var(--volume-value), rgba(255, 255, 255, 0.3) 100%);
  border-radius: 2px;
  cursor: pointer;
}

.occasion-edit-voice-player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.occasion-edit-voice-player-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.occasion-edit-voice-player-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.occasion-edit-voice-player-icon .occasion-edit-voice-player-svg {
  color: inherit;
}

.occasion-edit-audio-upload.has-file .occasion-edit-audio-text,
.occasion-edit-audio-upload.has-file .occasion-edit-audio-hint {
  display: none;
}

.occasion-edit-audio-upload.has-file .occasion-edit-audio-filename {
  display: block;
}

.occasion-edit-thumb--hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.occasion-edit-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.occasion-edit-cancel {
  padding: 0.5rem 0;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
}

.occasion-edit-cancel:hover {
  color: var(--text-primary);
}

.occasion-edit-save {
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(213, 255, 39, 0.4);
  background: rgba(213, 255, 39, 0.55);
  color: #1a1a1a;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.occasion-edit-save:hover {
  background: rgba(213, 255, 39, 0.7);
  border-color: rgba(213, 255, 39, 0.6);
  transform: translateY(-1px);
}

/* Delete Category Confirmation Popup */
.category-delete-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.2s ease;
}

.category-delete-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.category-delete-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-delete-popup[aria-hidden="false"] .category-delete-overlay {
  opacity: 1;
}

.category-delete-panel {
  position: relative;
  width: 90%;
  max-width: 360px;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.category-delete-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.category-delete-message {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.category-delete-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.category-delete-cancel {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.category-delete-cancel:hover {
  background: var(--bg-body);
}

.category-delete-confirm {
  padding: 0.5rem 1rem;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.category-delete-confirm:hover {
  background: #b91c1c;
}

/* Delete Item Confirmation Popup */
.item-delete-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.2s ease;
}

.item-delete-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.item-delete-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.item-delete-popup[aria-hidden="false"] .item-delete-overlay {
  opacity: 1;
}

.item-delete-panel {
  position: relative;
  width: 90%;
  max-width: 380px;
  padding: 1.75rem;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  animation: item-delete-panel-in 0.25s ease;
}

@keyframes item-delete-panel-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.item-delete-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.item-delete-message {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.item-delete-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.item-delete-cancel {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.item-delete-cancel:hover {
  background: var(--bg-body);
  border-color: var(--border-hover);
}

.item-delete-confirm {
  padding: 0.6rem 1.25rem;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.item-delete-confirm:hover {
  background: #b91c1c;
}

/* Create / Edit Category Popup */
.category-edit-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.category-edit-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.category-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-edit-popup[aria-hidden="false"] .category-edit-overlay {
  opacity: 1;
}

.category-edit-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 100%;
  max-width: 420px;
  height: calc(100vh - 32px);
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.category-edit-popup[aria-hidden="false"] .category-edit-panel {
  transform: translateX(0);
}

.category-edit-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.category-edit-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.category-edit-back:hover {
  background: var(--bg-body);
}

.category-edit-panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.category-edit-image-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.category-edit-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.category-edit-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.category-edit-image-wrap {
  flex-shrink: 0;
}

.category-edit-image-error {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #c62828;
}

.category-edit-image-error[hidden] {
  display: none;
}

.category-edit-image-preview {
  position: relative;
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-edit-image-placeholder {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0 0.5rem;
}

.category-edit-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-edit-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-edit-image-preview:hover .category-edit-image-overlay {
  opacity: 1;
}

.category-edit-image-action {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.category-edit-image-action:hover {
  background: #fff;
  transform: scale(1.1);
}

.category-edit-image-action img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.category-edit-image-delete img {
  filter: invert(16%) sepia(99%) saturate(7394%) hue-rotate(359deg) brightness(95%) contrast(118%);
}

.category-edit-display-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  max-width: 20ch;
  overflow-wrap: break-word;
  word-break: break-word;
}

.category-edit-section {
  margin-bottom: 1.25rem;
}

.category-edit-section:last-child {
  margin-bottom: 0;
}

.category-edit-section-row {
  display: flex;
  gap: 1rem;
}

.category-edit-field-half {
  flex: 1;
  min-width: 0;
}

.category-edit-field-label {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.category-edit-field-hint {
  margin: -0.25rem 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-secondary, #6b7280);
}

.category-edit-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #f5f5f7;
  transition: border-color 0.2s;
}

.category-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.category-edit-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: #f5f5f7;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.category-edit-status-box:has(#category-edit-active:checked) {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.category-edit-status-box:has(#category-edit-active:not(:checked)) {
  background: #ffebee;
  border-color: #c62828;
}

.category-edit-status-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.category-edit-status-box:has(#category-edit-active:checked) .category-edit-status-label {
  color: #2e7d32;
}

.category-edit-status-box:has(#category-edit-active:not(:checked)) .category-edit-status-label {
  color: #c62828;
}

.category-edit-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.category-edit-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.category-edit-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.category-edit-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.category-edit-toggle input:checked + .category-edit-toggle-slider {
  background-color: #2c3e50;
}

.category-edit-toggle input:checked + .category-edit-toggle-slider:before {
  transform: translateX(20px);
}

/* Item size selector */
.item-edit-sizes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease;
  margin-top: 0;
}

.item-edit-sizes-grid.item-edit-sizes-grid--visible {
  max-height: 160px;
  opacity: 1;
  margin-top: 0.75rem;
}

.item-edit-size-option {
  cursor: pointer;
}

.item-edit-size-option input {
  display: none;
}

.item-edit-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.25rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}

.item-edit-size-option input:checked + .item-edit-size-card {
  border-color: #00754a;
  background: #f0faf5;
}

.item-edit-size-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.item-edit-size-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
}

.item-edit-size-option input:checked + .item-edit-size-card .item-edit-size-label {
  color: #00754a;
  font-weight: 600;
}

/* Products: add-ons (modifier groups) */
.modifier-groups-popup-layer {
  z-index: 10002;
}

/* Item edit: preset image library picker */
.category-edit-profile--item-preset {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.item-edit-image-library-col {
  width: 100%;
  max-width: 20rem;
  margin: 0 auto;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.item-edit-library-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.7rem;
  text-align: left;
  font: inherit;
  color: var(--text-primary, #111827);
  background: var(--bg-card, #fff);
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.item-edit-library-trigger:hover {
  border-color: #00754a;
  box-shadow: 0 4px 14px rgba(0, 117, 74, 0.12);
  background: rgba(0, 117, 74, 0.03);
}

.item-edit-library-trigger:active {
  transform: scale(0.98);
}

.item-edit-library-trigger:focus {
  outline: none;
}

.item-edit-library-trigger:focus-visible {
  outline: 2px solid #00754a;
  outline-offset: 2px;
}

.item-edit-library-trigger-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(0, 117, 74, 0.1);
  color: #00754a;
}

.item-edit-library-trigger-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-start;
}

.item-edit-library-trigger-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.item-edit-library-trigger-cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: #00754a;
  line-height: 1.2;
}

.item-edit-library-trigger-hint {
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--text-secondary, #6b7280);
}

.item-edit-library-trigger-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #94a3b8;
  transition: color 0.18s ease, transform 0.18s ease;
}

.item-edit-library-trigger:hover .item-edit-library-trigger-chevron {
  color: #00754a;
  transform: translateX(2px);
}

.item-preset-image-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10003;
  display: flex;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.item-preset-image-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.item-preset-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.item-preset-image-popup[aria-hidden="false"] .item-preset-image-overlay {
  opacity: 1;
}

/* Same slide-in as item edit; parent is .item-preset-image-popup not .category-edit-popup */
.item-preset-image-popup[aria-hidden="false"] .category-edit-panel {
  transform: translateX(0);
}

.item-preset-image-panel.category-edit-panel {
  max-width: 460px;
}

.item-preset-image-panel-header {
  align-items: flex-start;
  padding-bottom: 0.85rem;
}

.item-preset-image-header-block {
  flex: 1;
  min-width: 0;
}

.item-preset-image-panel .category-edit-panel-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.item-preset-image-lead {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary, #6b7280);
}

.item-preset-image-toolbar {
  flex-shrink: 0;
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--bg-card, #fff);
}

.item-preset-image-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.item-preset-image-search-icon {
  position: absolute;
  left: 0.75rem;
  opacity: 0.4;
  pointer-events: none;
}

.item-preset-image-search-input {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text-primary, #111827);
  background: var(--bg-body, #f3f4f6);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.item-preset-image-search-input::placeholder {
  color: #9ca3af;
}

.item-preset-image-search-input:hover {
  background: #eef0f3;
}

.item-preset-image-search-input:focus {
  outline: none;
  background: var(--bg-card, #fff);
  border-color: rgba(0, 117, 74, 0.35);
  box-shadow: 0 0 0 3px rgba(0, 117, 74, 0.12);
}

.item-preset-image-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.item-preset-image-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.item-preset-image-no-results {
  margin: 1rem 0 0;
  padding: 0.75rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary, #64748b);
  text-align: center;
}

.item-preset-image-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  padding: 2rem 1.25rem;
}

.item-preset-image-state--loading .item-preset-image-loading {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
}

.item-preset-image-state--empty .item-preset-image-empty {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text-secondary, #64748b);
  text-align: center;
  max-width: 15rem;
}

.item-preset-image-cat {
  margin: 0;
  padding: 0.75rem 0.65rem 0.85rem;
  background: var(--bg-card, #fff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.item-preset-image-cat-title {
  margin: 0 0 0.65rem;
  padding: 0 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary, #334155);
}

.item-preset-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

@media (min-width: 380px) {
  .item-preset-image-grid {
    gap: 0.6rem;
  }
}

.item-preset-image-tile {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #e2e8f0;
  aspect-ratio: 1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.item-preset-image-tile:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 117, 74, 0.2);
  transform: translateY(-1px);
}

.item-preset-image-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #00754a;
}

.item-preset-image-tile:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}

.item-preset-image-tile-inner {
  display: block;
  width: 100%;
  height: 100%;
}

.item-preset-image-tile-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .item-edit-library-trigger,
  .item-preset-image-tile,
  .item-preset-image-search-input {
    transition: none;
  }
  .item-edit-library-trigger:hover .item-edit-library-trigger-chevron {
    transform: none;
  }
  .item-edit-library-trigger:active {
    transform: none;
  }
  .item-preset-image-tile:hover,
  .item-preset-image-tile:active {
    transform: none;
  }
}

.item-edit-addons-section {
  padding-top: 0.25rem;
}

.item-edit-addons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.item-edit-manage-addons-btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

.item-edit-addons-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.25rem 0 0.75rem;
  line-height: 1.4;
}

.item-edit-addons-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.item-edit-addons-subhead {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.item-edit-addons-subhead:first-child {
  margin-top: 0;
}

.item-edit-addons-subhead-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary, #111827);
}

.item-edit-addons-subhead-hint {
  font-size: 0.76rem;
  color: var(--text-secondary, #6b7280);
}

.addon-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.addon-type-badge--addon {
  background: rgba(0, 117, 74, 0.1);
  color: #00754a;
}

.addon-type-badge--variation {
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
}

.item-edit-addon-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.item-edit-addon-card--variation.item-edit-addon-card--on {
  border-color: #1e40af;
  box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.18);
}

.item-edit-addon-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--bg-card, #fff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-edit-addon-card--on {
  border-color: #00754a;
  box-shadow: 0 0 0 1px rgba(0, 117, 74, 0.18);
}

.item-edit-addon-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.item-edit-addon-cb {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.item-edit-addon-card-title-block {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.item-edit-addon-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.item-edit-addon-rule {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b7280);
}

.item-edit-addon-options {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0.45rem 0 0 1.45rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-edit-addon-options--bare {
  border-top: none;
  padding-top: 0;
  margin-top: 0.35rem;
  padding-left: 1.45rem;
}

.item-edit-addon-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.3;
}

.item-edit-addon-option-name {
  color: var(--text-primary, #111827);
}

.item-edit-addon-option-price {
  font-weight: 600;
  color: #00754a;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.item-edit-addon-option-price--included {
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
}

.item-edit-addon-option--empty {
  color: var(--text-secondary, #6b7280);
  font-size: 0.82rem;
  font-style: italic;
  list-style: none;
}

.item-edit-addons-empty,
.item-edit-addons-error {
  font-size: 0.8125rem;
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.item-edit-addons-error {
  color: #b91c1c;
}

.modifier-groups-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.modifier-groups-section-head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0.35rem 0 0.15rem;
}

.modifier-groups-section-head:first-child {
  margin-top: 0;
}

.modifier-group-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

.modifier-group-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.modifier-group-card-title-block {
  flex: 1;
  min-width: 0;
}

.modifier-group-card-edit {
  flex-shrink: 0;
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

.modifier-group-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.modifier-group-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.modifier-group-card-meta {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.modifier-group-card-preview {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 0.55rem;
}

.modifier-group-card-preview--empty {
  font-size: 0.8rem;
  color: var(--text-secondary, #6b7280);
  font-style: italic;
  border-top: none;
  padding-top: 0;
}

.modifier-group-card-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modifier-group-card-preview-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  line-height: 1.3;
}

.modifier-group-card-preview-name {
  color: var(--text-primary, #111827);
  min-width: 0;
}

.modifier-group-card-preview-price {
  font-weight: 600;
  color: #00754a;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.modifier-group-card-preview-more {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  color: var(--text-secondary, #6b7280);
}

.modifier-group-card--variation .modifier-group-card-preview-price {
  color: #1e40af;
}

.modifier-group-card--variation {
  border-left: 3px solid #1e40af;
}

.modifier-groups-new-btn {
  width: 100%;
}

.modifier-group-editor-wrap .category-edit-section {
  margin-bottom: 1rem;
}

.modifier-group-editor-wrap .category-edit-field-label {
  margin-bottom: 0.42rem;
  font-size: 0.79rem;
  font-weight: 600;
  color: #4b5563;
}

.modifier-group-editor-wrap .category-edit-input {
  min-height: 44px;
  border-radius: 10px;
  background: #fafafa;
}

.modifier-group-editor-wrap .category-edit-input:focus {
  border-color: rgba(0, 117, 74, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 117, 74, 0.12);
}

.mg-rules-row {
  gap: 0.7rem;
}

.mg-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.2rem;
}

.mg-type-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mg-type-btn-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary, #111827);
}

.mg-type-btn-desc {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-secondary, #6b7280);
}

.mg-type-btn--active {
  border-color: #00754a;
  background: rgba(0, 117, 74, 0.06);
  box-shadow: 0 0 0 1px rgba(0, 117, 74, 0.18);
}

#mg-type-variation.mg-type-btn--active {
  border-color: #1e40af;
  background: rgba(30, 64, 175, 0.06);
  box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.18);
}

.mg-variation-hint {
  margin: -0.35rem 0 1rem;
  padding: 0.6rem 0.75rem;
  background: rgba(30, 64, 175, 0.06);
  border: 1px solid rgba(30, 64, 175, 0.18);
  border-radius: 10px;
  color: #1e3a8a;
}

@media (max-width: 480px) {
  .mg-type-switch {
    grid-template-columns: 1fr;
  }
}

.mg-required-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mg-rules-hint,
.mg-options-hint {
  font-size: 0.76rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.42rem 0 0;
  line-height: 1.4;
}

.mg-modifiers-head {
  display: grid;
  grid-template-columns: 1fr 9rem 34px;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin-top: 0.65rem;
  padding: 0 0.35rem;
}

.mg-modifiers-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.mg-modifier-row {
  display: grid;
  grid-template-columns: 1fr 9rem 34px;
  gap: 0.55rem;
  align-items: center;
}

.mg-modifier-row .mg-mod-name {
  min-width: 0;
  height: 44px;
  background: #fff;
}

.mg-mod-price-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 0.55rem;
  height: 44px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mg-mod-price-wrap:focus-within {
  border-color: rgba(0, 117, 74, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 117, 74, 0.12);
}

.mg-mod-dollar {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
}

.mg-modifier-row .mg-mod-price {
  width: 100%;
  min-width: 0;
  border: none;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

.mg-modifier-row .mg-mod-price:focus {
  outline: none;
}

.mg-mod-remove {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  background: #f9fafb;
  color: var(--text-secondary, #6b7280);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 5px;
}

.mg-mod-remove:hover {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
}

.modifier-group-form-footer {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  justify-content: center;
}

/* Size icons in phone preview */
.menu-builder-preview-size-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin-top: 0.15rem;
}

.menu-builder-preview-size-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Item detail sheet (slide-up) */
.menu-builder-item-sheet {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: auto;
}

.menu-builder-item-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.menu-builder-item-sheet-backdrop--visible {
  background: rgba(0, 0, 0, 0.3);
}

.menu-builder-item-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 9%;
  background: #fff;
  border-radius: 14px 14px 0 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

.menu-builder-item-sheet-panel--visible {
  transform: translateY(0);
}

.menu-builder-item-sheet-close {
  position: absolute;
  top: 0.55rem;
  right: 0.75rem;
  z-index: 2;
  background: none;
  border: none;
  padding: 0.35rem;
  color: #1e1e1e;
  cursor: pointer;
  line-height: 0;
}

.menu-builder-item-sheet-close svg {
  width: 10px;
  height: 10px;
}

.menu-builder-item-sheet-close:hover {
  opacity: 0.5;
}

.menu-builder-item-sheet-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 1.85rem 1.1rem 2.5rem;
  box-sizing: border-box;
  scrollbar-width: none;
}

.menu-builder-item-sheet-scroll::-webkit-scrollbar {
  display: none;
}

.menu-builder-item-sheet-img-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e3932;
  margin: 0.25rem auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-builder-item-sheet-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.menu-builder-item-sheet-img--placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-body);
}

.menu-builder-item-sheet-meta {
  text-align: center;
  padding: 0 0.75rem;
  margin-top: 0.15rem;
}

.menu-builder-item-sheet-category {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b6b6b;
  line-height: 1.35;
}

.menu-builder-item-sheet-subgroup {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
  line-height: 1.35;
}

.menu-builder-item-sheet-name {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1e1e1e;
  text-align: center;
  line-height: 1.35;
  padding: 0 0.5rem;
}

.menu-builder-item-sheet-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: #00754a;
  text-align: center;
  margin: 0.35rem 0 0;
  padding: 0 0.5rem;
}

.menu-builder-item-sheet-desc {
  margin: 0.6rem 0 0;
  font-size: 0.7rem;
  color: #707070;
  text-align: center;
  line-height: 1.45;
  padding: 0 0.25rem;
}

.menu-builder-item-sheet-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 1rem 0 0.6rem;
}

.menu-builder-item-sheet-size-title {
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e1e1e;
}

.menu-builder-item-sheet-size-accent {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #00754a 0%, #d4e9e2 60%, #eee 100%);
  border-radius: 2px;
  margin-bottom: 0.85rem;
}

.menu-builder-item-sheet-size-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.menu-builder-item-sheet-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  max-width: 70px;
}

.menu-builder-item-sheet-size-icon-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.menu-builder-item-sheet-size-card--selected .menu-builder-item-sheet-size-icon-ring {
  border-color: #00754a;
  background: rgba(0, 117, 74, 0.06);
}

.menu-builder-item-sheet-size-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.menu-builder-item-sheet-size-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: #1e1e1e;
  text-align: center;
  line-height: 1.2;
}

.menu-builder-item-sheet-size-card--selected .menu-builder-item-sheet-size-label {
  color: #1e1e1e;
}

/* Item sheet: “What’s included” (fieldset cards, scrolls with content) */
.mb-sheet-addons-mount {
  min-height: 0;
}

.mb-sheet-addon-loading {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  color: #888;
  text-align: center;
}

.mb-sheet-included-divider {
  margin-top: 1.1rem;
}

.mb-sheet-included-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e1e1e;
  letter-spacing: -0.02em;
}

.mb-sheet-addons {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mb-sheet-fieldset {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  padding: 0.5rem 0.65rem 0.65rem;
  margin: 0 0 0.55rem;
  background: #fff;
  min-inline-size: 0;
}

.mb-sheet-fieldset-legend {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5c5c5c;
  padding: 0 0.35rem;
  margin: 0;
}

.mb-sheet-fieldset-body {
  margin-top: 0.15rem;
}

/* Reference-style: every option visible inside the bordered group */
.mb-sheet-include-list {
  display: flex;
  flex-direction: column;
  margin: 0 -0.15rem;
}

.mb-sheet-include-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.35rem 0.15rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  box-sizing: border-box;
}

.mb-sheet-include-list .mb-sheet-include-row:last-child {
  border-bottom: none;
  padding-bottom: 0.1rem;
}

.mb-sheet-include-row--single {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  border-radius: 8px;
  margin: 0;
  transition: background 0.15s ease;
}

.mb-sheet-include-row--single:hover {
  background: rgba(0, 0, 0, 0.03);
}

.mb-sheet-include-row--single.mb-sheet-include-row--selected {
  background: rgba(0, 117, 74, 0.07);
}

.mb-sheet-include-row--single.mb-sheet-include-row--selected .mb-sheet-include-row-label {
  color: #1e3932;
}

.mb-sheet-include-row-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.35;
}

.mb-sheet-include-row-extras {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #00754a;
  white-space: nowrap;
  margin-right: 0.1rem;
}

.mb-sheet-include-row-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #00754a;
  color: #00754a;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mb-sheet-include-row--multi {
  cursor: pointer;
  margin: 0;
}

.mb-sheet-include-row--multi:hover {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

.mb-sheet-include-row-cb {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0 0.15rem 0 0.05rem;
  accent-color: #00754a;
  cursor: pointer;
}

.mb-sheet-include-row--multi .mb-sheet-include-row-label {
  font-weight: 700;
}

/* Item sheet: modifications summary (minimal / hairline) */
.mb-mods-summary {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.mb-mods-summary .mb-sheet-included-divider {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.mb-mods-summary-title {
  margin: 0.45rem 0 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6d6d6d;
  text-align: center;
}

.mb-mods-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.mb-mods-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.mb-mods-summary-item-label {
  font-size: 0.56rem;
  color: #7c7c7c;
  line-height: 1.15;
  padding: 0 0.05rem;
}

.mb-mods-summary-row {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.28rem;
  padding: 0.14rem 0.34rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mb-mods-summary-row-value {
  flex: 1;
  min-width: 0;
  font-size: 0.62rem;
  font-weight: 500;
  color: #1f1f1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-mods-summary-row-meta {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.mb-mods-summary-row-extra {
  font-size: 0.52rem;
  font-weight: 700;
  color: #00754a;
}

.mb-mods-summary-row-chevron {
  width: 10px;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2f2f2f;
}

.mb-mods-summary-row-chevron svg {
  width: 7px;
  height: 4px;
}

/* Group picker: slide-up bottom sheet */
.mb-option-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.mb-option-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto;
}

.mb-option-sheet-backdrop--visible {
  opacity: 1;
}

.mb-option-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90%;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.16);
  transform: translateY(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.mb-option-sheet-panel--visible {
  transform: translateY(0);
}

.mb-option-sheet-header {
  position: relative;
  padding: 0.58rem 0.9rem 0.78rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.mb-option-sheet-close {
  position: absolute;
  left: 0.56rem;
  top: 0.32rem;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 1.2rem;
  line-height: 1;
  color: #202020;
  cursor: pointer;
}

.mb-option-sheet-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1b1b1b;
  padding: 0 1.7rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.mb-option-sheet-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.mb-option-sheet-row {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  text-align: left;
  padding: 0.58rem 0.78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
}

.mb-option-sheet-row-left {
  display: flex;
  flex-direction: column;
  gap: 0.09rem;
  min-width: 0;
}

.mb-option-sheet-row-name {
  font-size: 0.74rem;
  color: #252525;
  line-height: 1.26;
}

.mb-option-sheet-row-price {
  font-size: 0.62rem;
  font-weight: 600;
  color: #767676;
}

.mb-option-sheet-row-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.4px solid #d0d0d0;
  flex-shrink: 0;
  position: relative;
}

.mb-option-sheet-row--selected .mb-option-sheet-row-mark {
  border-color: #1b74e4;
}

.mb-option-sheet-row--selected .mb-option-sheet-row-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #1b74e4;
}

.mb-option-sheet-hint {
  margin: 0;
  padding: 0.62rem 0.85rem 0.56rem;
  font-size: 0.58rem;
  color: #8b8b8b;
  text-align: center;
  line-height: 1.4;
}

.mb-option-sheet-footer {
  padding: 0.24rem 0.85rem 0.72rem;
  display: flex;
  justify-content: center;
}

.mb-option-sheet-save {
  width: 88%;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: #00754a;
  color: #fff;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s;
}

.mb-option-sheet-save:hover {
  background: #005c3a;
}

.menu-builder-item-sheet-footer-wrap {
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.menu-builder-item-sheet-footer {
  padding: 0.65rem 1.1rem 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 6;
  background: #fff;
  box-sizing: border-box;
}

.menu-builder-item-sheet-add-btn {
  flex: 1;
  padding: 0.7rem 1.5rem;
  background: #00754a;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.2s;
}

.menu-builder-item-sheet-add-btn:hover {
  background: #005c3a;
}

.menu-builder-item-sheet-bag {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1e3932;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.menu-builder-item-sheet-bag--bump {
}

.menu-builder-item-sheet-bag-icon {
  width: 20px;
  height: 20px;
}

.menu-builder-item-sheet-bag-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #fff;
  color: #1e3932;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid #1e3932;
  line-height: 1;
}

.menu-builder-item-sheet-bag-peek-wrap {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(-50%) scale(0.3) translateY(14px);
}

.menu-builder-item-sheet-bag-peek-wrap--show {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(0);
}

.menu-builder-item-sheet-bag-peek-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.menu-builder-item-sheet-bag-peek-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff;
  margin: -1px auto 0;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.menu-builder-item-sheet-toast {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: #1e3932;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 400;
  text-align: left;
  padding: 0.5rem 0.75rem;
  z-index: 2;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.menu-builder-item-sheet-toast--show {
  opacity: 1;
  transform: translateY(-100%);
}

.category-edit-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.category-edit-cancel {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.category-edit-cancel:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.category-edit-save {
  padding: 0.6rem 1.25rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.category-edit-save:hover {
  background: #333;
}

/* Extra groups editor: center Cancel / Save (overrides .category-edit-footer flex-end) */
.modifier-group-form-footer.category-edit-footer {
  justify-content: center;
}

/* Occasion update success toast */
.occasion-update-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  padding: 0.75rem 1.25rem;
  background: #3b82f6;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10002;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.occasion-update-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.occasion-update-toast--error {
  background: #dc2626;
}

/* Performance Modal */
.performance-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.performance-modal[aria-hidden="false"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.performance-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.performance-modal-content {
  position: relative;
  width: 92%;
  max-width: 760px;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.performance-modal[aria-hidden="false"] .performance-modal-content {
  transform: scale(1);
}

.performance-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.performance-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.performance-modal-close:hover {
  background: var(--bg-body);
}

.performance-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.performance-modal-body {
  padding: 1.5rem;
  background: #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.performance-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
}

.performance-overview-card {
  margin-bottom: 0;
}

.performance-overview-card .performance-section-label {
  margin-bottom: 0.75rem;
}

.performance-funnel-note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.performance-funnel-note--error {
  color: #c62828;
}

.amount-status--cancelled {
  background: #f8d7da;
  color: #721c24;
}

.amount-status--cancelled::before {
  content: "×";
}

.performance-modal-loading {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.payment-method-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.performance-section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performance-funnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-radius: 10px;
  overflow: visible;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.funnel-segment {
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  border-radius: 8px;
  transition: width 0.35s ease;
  min-height: 44px;
}

.funnel-segment--1 {
  background: rgba(213, 255, 39, 0.95);
  border: 1px solid rgba(213, 255, 39, 0.6);
}

.funnel-segment--2 {
  background: rgba(213, 255, 39, 0.75);
  border: 1px solid rgba(213, 255, 39, 0.5);
}

.funnel-segment--3 {
  background: rgba(213, 255, 39, 0.55);
  border: 1px solid rgba(213, 255, 39, 0.4);
}

.funnel-segment--4 {
  background: rgba(213, 255, 39, 0.4);
  border: 1px solid rgba(213, 255, 39, 0.35);
}

.funnel-segment-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.funnel-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  min-width: 40px;
}

.funnel-icon {
  font-size: 1.125rem;
  width: 22px;
  text-align: center;
  color: #1a1a1a;
}

.funnel-text {
  font-size: 0.875rem;
  color: #1a1a1a;
  font-weight: 500;
}

.performance-history-card .performance-history-header {
  margin-bottom: 0.75rem;
}

.performance-history-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.performance-history-icon {
  font-size: 1rem;
  color: var(--text-primary);
}

.performance-history-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.performance-history-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.performance-history-row--header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1.3fr);
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.performance-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.performance-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1.3fr);
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: #f8f8f8;
  border-radius: 10px;
  align-items: center;
  min-width: 0;
}

.performance-history-item .history-col {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-col {
  font-size: 0.75rem;
  color: var(--text-primary);
}

.history-col--name {
  font-weight: 600;
}

.history-col--date {
  color: var(--text-secondary);
  font-size: 0.6875rem;
}

.history-col--amount {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.amount-value {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.75rem;
  white-space: nowrap;
}

.amount-currency {
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 400;
}

.amount-status {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.4rem;
  margin-left: auto;
  background: #d4edda;
  color: #155724;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.amount-status::before {
  content: "✓";
  font-size: 0.5625rem;
}

.history-col--payment {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
  min-width: 0;
}

.payment-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.payment-icon-img {
  height: 22px;
  width: auto;
  object-fit: contain;
  display: block;
}

.payment-icon {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background: var(--text-primary);
}

.payment-text {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .occasion-card--selected {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
  }
  .occasion-card--selected:hover {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transform: none;
  }
  .occasion-card--selected .occasion-name,
  .occasion-card--selected .occasion-content {
    color: #ce93d8;
  }
  .occasion-status--active {
    background: rgba(129, 199, 132, 0.3);
    color: #81c784;
  }
  .occasion-status--inactive {
    background: rgba(244, 67, 54, 0.25);
    color: #ef9a9a;
  }
  .occasion-chart-btn {
    background: #3a3a3c;
    color: #98989d;
  }
  .occasion-chart-btn:hover {
    background: #48484a;
    color: var(--text-primary);
  }
  .performance-modal-body {
    background: #1c1c1e;
  }
  .performance-card {
    background: #2c2c2e;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }
  .performance-history-item {
    background: #3a3a3c;
  }
  .funnel-segment--1 {
    background: rgba(213, 255, 39, 0.5);
    border-color: rgba(213, 255, 39, 0.4);
  }
  .funnel-segment--2 {
    background: rgba(213, 255, 39, 0.4);
    border-color: rgba(213, 255, 39, 0.35);
  }
  .funnel-segment--3 {
    background: rgba(213, 255, 39, 0.3);
    border-color: rgba(213, 255, 39, 0.25);
  }
  .funnel-segment--4 {
    background: rgba(213, 255, 39, 0.25);
    border-color: rgba(213, 255, 39, 0.2);
  }
  .funnel-count,
  .funnel-icon,
  .funnel-text {
    color: var(--text-primary);
  }
}

.customer-app-preview-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: #fff;
  flex: 1 1 0;
  min-height: 0;
}

.phone-preview-wrap:not(.phone-preview-wrap--automated) {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.phone-preview {
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  aspect-ratio: 9 / 19.5;
  background: url(../assets/phone-mockup.png) no-repeat center;
  background-size: contain;
  overflow: hidden;
}

.phone-preview-screen {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 6%;
  bottom: 5%;
  min-height: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.phone-preview-placeholder {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

.phone-preview-wrap--error .phone-preview {
  display: none;
}

.phone-preview-wrap--error .phone-preview-error {
  display: block;
  max-width: 280px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.phone-preview-error {
  display: none;
}

/* ==========================================================================
   Products Page (Menu Builder Style)
   ========================================================================== */

.tab-panel--products {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: transparent;
  margin-bottom: 0.75rem;
}

.products-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  flex-shrink: 0;
}

.products-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.products-header-search {
  position: relative;
  width: 280px;
}

.products-header-search .products-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.9375rem;
  color: #999;
}

.products-header-search .products-search-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.products-header-search .products-search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.25rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9375rem;
  background: #fff;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.products-header-search .products-search-input::placeholder {
  color: #999;
}

.products-header-search .products-search-input:focus {
  outline: none;
  border-color: #bbb;
}

.products-search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--bg-body);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.products-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.products-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1rem;
  opacity: 0.5;
}

.products-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.products-btn-add-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.products-btn-add-menu {
  background: #333;
  color: #fff;
  border-color: #555;
}

.products-btn-add-menu:hover {
  background: #222;
  border-color: #444;
}

.products-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  min-height: calc(100vh - 200px);
}

.products-management {
  background: #fff;
  border-right: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 0 0 1rem;
  padding: 1rem 1rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

.products-management-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.products-management-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.products-management-search {
  position: relative;
}

.products-management-search .products-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.products-management-search .products-search-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.products-management-search .products-search-input {
  padding-left: 2.25rem;
}

.products-search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  background: #fff;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.products-btn-create-category {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #d9ff4d !important;
  color: #1d1d1f !important;
  border: none !important;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.products-btn-create-category:hover {
  background: #D5FF27 !important;
}

.products-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

.products-category-list-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Empty states: new accounts have no demo data */
.products-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.75rem 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.04);
  flex: 1;
  min-height: 132px;
  box-sizing: border-box;
}

.products-empty-state--items {
  min-height: min(320px, 50vh);
  align-self: stretch;
}

.products-empty-state-inner {
  max-width: 22rem;
  margin: 0 auto;
}

.products-empty-state-title {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.products-empty-state-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.products-empty-state-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.products-category-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.products-category-card:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.products-category-card--selected {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid #000;
}

.products-category-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.products-category-icon--orange {
  background: #ffe0b2;
}

.products-category-icon--green {
  background: #c8e6c9;
}

.products-category-icon--pink {
  background: #f8bbd9;
}

.products-category-icon--blue {
  background: #bbdefb;
}

.products-category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.products-category-info {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.products-category-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.products-category-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.35;
  min-width: 0;
  flex: 1;
  max-width: 20ch;
  width: 20ch;
  display: block;
}

.products-category-status {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.products-category-status--active {
  background: #e8f5e9;
  color: #2e7d32;
}

.products-category-status--inactive {
  background: #ffebee;
  color: #c62828;
}

.products-category-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.products-management-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.products-management-actions-row {
  display: flex;
  gap: 0.5rem;
}

.products-management-actions-row .products-btn-delete-category,
.products-management-actions-row .products-btn-edit-category {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.products-btn-edit-category {
  background: #fff;
  border: 1px solid var(--border);
  color: #333;
}

.products-btn-edit-category:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.products-btn-duplicate {
  background: #fff;
  border: 1px solid var(--border);
  color: #333;
}

.products-btn-duplicate:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.products-btn-delete-category {
  background: #fff;
  border: 1px solid var(--border);
  color: #c62828;
}

.products-btn-delete-category:hover {
  background: #ffebee;
  border-color: var(--border-hover);
  color: #b71c1c;
}

.products-btn-icon-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.products-management-actions .products-btn-icon-img {
  width: 14px;
  height: 14px;
}

.products-btn-delete-category .products-btn-icon-img {
  filter: invert(16%) sepia(99%) saturate(7394%) hue-rotate(359deg) brightness(95%) contrast(118%);
}

.products-tags-manager {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.category-edit-tags-manager {
  margin-top: 0;
  background: #fff;
}

.products-tags-manager-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.products-tags-manager-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.products-tags-manager-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.products-tags-create {
  display: flex;
  gap: 0.5rem;
}

.products-tags-create-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  background: #fff;
}

.products-tags-create-input:focus {
  outline: none;
  border-color: #d9ff4d;
  box-shadow: 0 0 0 3px rgba(217, 255, 77, 0.24);
}

.products-tags-create-btn {
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
}

.products-tags-list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.products-tags-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #fff;
}

.products-tag-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.products-tag-name-input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.8125rem;
}

.products-tag-name-input:focus {
  outline: none;
  border-color: #d9ff4d;
}

.products-tag-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.products-tag-btn:hover {
  background: #f3f5f7;
}

.products-tag-btn--danger {
  color: #b3261e;
  border-color: #f2c0bc;
}

.products-tag-meta {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.btn-outline {
  flex: 1;
  padding: 0.625rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.products-items {
  background: #fff;
  border-radius: 16px;
  margin: 0 1rem 0 0;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

.products-items-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.products-items-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.products-items-actions {
  display: flex;
  gap: 0.75rem;
}

.products-btn-filter,
.products-btn-sort {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.products-btn-filter:hover,
.products-btn-sort:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.products-items-btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.products-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  align-items: start;
}

/* Center empty-state card in the Product Items panel (grid would pin it to cell 1,1) */
.products-items-grid.products-items-grid--empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
}

.products-items-grid.products-items-grid--empty-state .products-empty-state--items {
  flex: 0 1 auto;
  align-self: center;
  width: min(100%, 28rem);
  min-height: auto;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  position: relative;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  width: 100%;
  height: 12.5rem;
  box-sizing: border-box;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--border-hover);
}

.product-card-image {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-body);
  flex-shrink: 0;
  margin-bottom: 0;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.625rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.25rem;
}

.product-card-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.35rem;
  z-index: 1;
}

.product-card-edit,
.product-card-delete {
  width: auto;
  height: auto;
  padding: 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.product-card-edit img,
.product-card-delete img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.product-card-edit:hover {
  opacity: 0.7;
}

.product-card-delete:hover {
  opacity: 1;
}

.product-card-delete:hover img {
  filter: invert(16%) sepia(99%) saturate(7394%) hue-rotate(359deg) brightness(95%) contrast(118%);
}

.product-card-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.product-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 0 0 auto;
  padding-right: 2.75rem;
}

.product-card-name {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: calc(0.8125rem * 1.25 * 2);
  min-height: calc(0.8125rem * 1.25 * 2);
}

.product-card-description {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: calc(0.6875rem * 1.3 * 2);
  min-height: calc(0.6875rem * 1.3 * 2);
}

.product-card-description--empty {
  visibility: hidden;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: none;
  gap: 0.5rem;
}

.product-card-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-right: auto;
  flex: 0 0 auto;
}

.product-card-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  min-width: 44px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 44px;
  margin-left: auto;
  cursor: pointer;
}

.product-card-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.product-card-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.product-card-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.product-card-toggle input:checked + .product-card-toggle-slider {
  background-color: #2c3e50;
}

.product-card-toggle input:checked + .product-card-toggle-slider:before {
  transform: translateX(20px);
}

.product-card-toggle:hover .product-card-toggle-slider {
  box-shadow: 0 0 4px rgba(44, 62, 80, 0.3);
}

/* ==========================================================================
   Menu Builder (3-column: Library | Structure | Preview)
   ========================================================================== */

.tab-panel--menu-builder {
  padding: 1rem 1.5rem 1.5rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.tab-panel--menu-builder * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.menu-builder-page-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-builder-subtitle {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.menu-builder-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 1.25rem;
  min-height: calc(100vh - 220px);
  align-items: stretch;
}

.menu-builder-column {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  overflow: hidden;
  min-height: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.menu-builder-column-title {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.menu-builder-column-hint {
  margin: 0;
  padding: 0 1.25rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  line-height: 1.4;
}

.menu-builder-order-tags-panel {
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.menu-builder-order-tags-title {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-builder-order-tags-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.menu-builder-order-tags-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-builder-order-tags-empty {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
  padding: 0.25rem 0;
}

.menu-builder-order-tags-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
}

.menu-builder-order-tags-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0d4f36;
  flex: 1;
  min-width: 0;
}

.menu-builder-order-tags-delete {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
}

.menu-builder-order-tags-delete:hover {
  background: #fef2f2;
}

.menu-builder-order-tags-add {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.menu-builder-order-tags-input {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.menu-builder-order-tags-add-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.45rem 0.65rem;
}

.menu-builder-library-category-with-tag {
  margin-bottom: 0.5rem;
}

.menu-builder-order-tag-field {
  display: block;
  margin: 0.35rem 0 0 0.25rem;
}

.menu-builder-order-tag-select {
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
}

.menu-builder-library-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.menu-builder-library-category-block {
  margin-bottom: 1rem;
}

.menu-builder-library-category-block:last-child {
  margin-bottom: 0;
}

.menu-builder-library-section-label {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-builder-library-section-label:first-child {
  margin-top: 0;
}

.menu-builder-library-items {
  padding-left: 0.75rem;
  margin-top: 0.25rem;
  border-left: 2px solid var(--border);
}

.menu-builder-draggable.menu-builder-draggable--category {
  background: #f3e5f5 !important;
  border: 1px solid rgba(147, 112, 219, 0.15) !important;
  font-weight: 600;
  padding: 0.75rem 1rem;
  min-height: 48px;
  font-size: 1rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}

.menu-builder-draggable.menu-builder-draggable--category:hover {
  background: #e1bee7 !important;
  transform: translateY(-1px);
}

.menu-builder-draggable--category .menu-builder-draggable-icon,
.menu-builder-draggable--category .menu-builder-draggable-icon-placeholder {
  width: 28px;
  height: 28px;
}

.menu-builder-draggable--item {
  padding: 0.4rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 400;
  min-height: 36px;
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-builder-draggable--item .menu-builder-draggable-icon,
.menu-builder-draggable--item .menu-builder-draggable-icon-placeholder {
  width: 18px;
  height: 18px;
}

.menu-builder-draggable {
  cursor: grab;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.menu-builder-draggable:active {
  cursor: grabbing;
}

.menu-builder-draggable:hover {
  background: var(--bg-body);
  border-color: #bbb;
}

.menu-builder-draggable.dragging {
  opacity: 0.5;
  border-style: dashed;
  transform: scale(0.98);
}

.menu-builder-draggable-icon {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-body);
}

.menu-builder-draggable-icon-placeholder {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--bg-body);
  flex-shrink: 0;
}

.menu-builder-draggable-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-builder-draggable-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.menu-builder-draggable-price {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.menu-builder-draggable-usage {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(125, 193, 191, 0.12);
  color: rgba(45, 90, 88, 0.9);
}

.menu-builder-structure-actions {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.menu-builder-btn-add-section {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.menu-builder-btn-add-section:hover {
  transform: translateY(-1px);
}

.menu-builder-tree {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.menu-builder-node {
  margin-bottom: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-builder-node:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.menu-builder-node-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  cursor: default;
  min-height: 44px;
  transition: background 0.2s ease;
}

.menu-builder-node-header.droppable {
  background: rgba(217, 255, 77, 0.12);
}

.menu-builder-node--section.drag-over > .menu-builder-node-children {
  background: rgba(144, 202, 249, 0.15);
  border-radius: 8px;
}

.menu-builder-node-drag-handle {
  width: 20px;
  height: 20px;
  cursor: grab;
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.menu-builder-node-drag-handle:active {
  cursor: grabbing;
}

.menu-builder-node-icon {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f5f5f5;
}

.menu-builder-node-icon-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f0f0f0;
  flex-shrink: 0;
}

.menu-builder-node-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-builder-node-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.menu-builder-node-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease, transform 0.2s ease;
}

.menu-builder-node-btn:hover {
  background: var(--bg-body);
  color: var(--text-primary);
}

.menu-builder-node-btn[data-group-id]:not(.menu-builder-node-btn--delete) {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  border-radius: 8px;
  background: rgba(147, 112, 219, 0.12);
  color: #9370db;
  font-size: 1.125rem;
  font-weight: 600;
}

.menu-builder-node-btn[data-group-id]:not(.menu-builder-node-btn--delete):hover {
  background: var(--bg-body);
  color: var(--text-primary);
}

.menu-builder-node-toggle {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-builder-node-toggle:hover {
  color: var(--text-primary);
}

.menu-builder-node-children {
  padding-left: 1.5rem;
  padding-bottom: 0.75rem;
  padding-right: 0.75rem;
  background: rgba(0, 0, 0, 0.01);
}

.menu-builder-node--collapsed .menu-builder-node-children {
  display: none;
}

.menu-builder-drop-zone {
  min-height: 24px;
  margin: 2px 0;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: transparent;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.menu-builder-drop-zone.drag-over {
  background: rgba(217, 255, 77, 0.15);
  border-color: var(--accent);
}

.menu-builder-section-reorder-placeholder {
  position: relative;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

.menu-builder-section-reorder-placeholder::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 4px;
  background: #3b82f6;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.menu-builder-draggable-section {
  cursor: grab;
}

.menu-builder-draggable-section:active {
  cursor: grabbing;
}

.menu-builder-draggable-section.dragging {
  opacity: 0.6;
}

.menu-builder-draggable-group.dragging,
.menu-builder-draggable-subgroup.dragging {
  opacity: 0.6;
  border-radius: 12px;
}

.menu-builder-node--drag-child-active {
  overflow: visible !important;
}

.menu-builder-column.menu-builder-preview .menu-builder-column-title {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.menu-builder-phone-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.menu-builder-phone {
  width: 310px;
  max-width: 100%;
  position: relative;
  aspect-ratio: 9 / 19.5;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

.menu-builder-phone::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url(../assets/phone-mockup.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  z-index: 2;
  pointer-events: none;
}

/* Preview “screen”: phone-mockup.png is drawn on top (z-index 2). Insets keep the white
   layer in the transparent glass area. overflow:hidden + border-radius also clips the
   scroll area’s corners — use generous padding-bottom on .menu-builder-preview-scroll so
   the last carousel row clears the bottom curve (avoids “half circles” at the bottom). */
.menu-builder-phone-screen {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 13%;
  bottom: 15%;
  z-index: 0;
  min-height: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  box-sizing: border-box;
}

.menu-builder-phone-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.35rem;
  background: #fff;
  z-index: 1;
  pointer-events: none;
}

/* Force round finger-like cursor everywhere in phone preview */
.menu-builder-phone-screen,
.menu-builder-phone-screen * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="12" fill="%23000" opacity="0.5" stroke="%23fff" stroke-width="1.5"/></svg>') 16 16, grab !important;
}

.menu-builder-phone-screen.is-dragging,
.menu-builder-phone-screen.is-dragging * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="12" fill="%23000" opacity="0.7" stroke="%23fff" stroke-width="1.5"/></svg>') 16 16, grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}

.menu-builder-preview-scroll {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.35rem 0.95rem 4.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  word-wrap: break-word;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu-builder-preview-scroll::-webkit-scrollbar {
  display: none;
}

.menu-builder-preview-scroll--restoring {
  scroll-behavior: auto;
}

.menu-builder-preview-sticky-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding-bottom: 0.25rem;
  --scroll-ratio: 0;
  contain: layout style;
}

.menu-builder-preview-sticky-header--no-transition .menu-builder-preview-header-title {
  transition: none !important;
}

.menu-builder-preview-header {
  display: flex;
  align-items: center;
  padding-top: 0.5rem;
  justify-content: flex-end;
  margin-bottom: calc(0.5rem - 0.3rem * var(--scroll-ratio, 0));
  padding-bottom: 0;
  position: relative;
  min-height: calc(2.5rem - 1rem * var(--scroll-ratio, 0));
}

.menu-builder-preview-header-title {
  margin: 0;
  font-weight: 600;
  color: #000;
  transition: opacity 0.1s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.menu-builder-preview-header-title--left {
  left: 0;
  font-size: 1.25rem;
  opacity: calc(max(0, 1 - 2 * var(--scroll-ratio, 0)));
  pointer-events: none;
}

.menu-builder-preview-header-title--center {
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  opacity: calc(max(0, 2 * var(--scroll-ratio, 0) - 1));
  pointer-events: none;
}

.menu-builder-preview-search {
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-builder-preview-search-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

/* Search overlay – full-screen search UI */
.menu-builder-search-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 0.5rem 0.6rem;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.menu-builder-search-overlay.menu-builder-search-overlay--visible {
  opacity: 1;
}

.menu-builder-search-overlay-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
}

.menu-builder-search-overlay-close {
  align-self: flex-start;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: -0.35rem;
  background: none;
  border: none;
  font-size: 1.35rem;
  font-weight: 100;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: transparent;
  -webkit-text-stroke: 0.5px #666;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.menu-builder-search-overlay-close:hover {
  color: transparent;
  -webkit-text-stroke: 0.5px #000;
}

.menu-builder-search-overlay-field {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.menu-builder-search-overlay-input {
  flex: 1;
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.25rem 1.5rem 0.25rem 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}

.menu-builder-search-overlay-input::-webkit-search-cancel-button,
.menu-builder-search-overlay-input::-webkit-search-decoration {
  display: none;
}

.menu-builder-search-overlay-input::placeholder {
  color: #999;
  font-weight: 600;
}

.menu-builder-search-overlay-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

.menu-builder-search-overlay-underline--active {
  background: var(--yumply, #007a33);
  height: 1px;
}

.menu-builder-search-overlay-clear {
  position: absolute;
  right: 0;
  top: -0.15rem;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #999;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 200;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.menu-builder-search-overlay-clear:hover {
  background: #777;
}

.menu-builder-search-overlay-results {
  flex: 1;
  overflow-y: auto;
  margin-top: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.menu-builder-search-overlay-results::-webkit-scrollbar {
  display: none;
}

.menu-builder-search-overlay-empty {
  padding: 1rem 0;
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

.menu-builder-search-overlay-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.menu-builder-search-overlay-item:last-child {
  border-bottom: none;
}

.menu-builder-search-overlay-item-img-wrap {
  flex-shrink: 0;
}

.menu-builder-search-overlay-item-img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

.menu-builder-search-overlay-item-img--ph {
  background: rgba(0, 0, 0, 0.08);
}

.menu-builder-search-overlay-item-info {
  flex: 1;
  min-width: 0;
}

.menu-builder-search-overlay-item-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.menu-builder-search-overlay-item-desc {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.menu-builder-search-overlay-item-price {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.menu-builder-preview-tabs {
  position: relative;
  margin-bottom: 0.75rem;
  margin-top: calc(0.35rem - 0.5rem * var(--scroll-ratio, 0));
  padding-top: 0;
  padding-bottom: 0.5rem;
}

.menu-builder-preview-tabs::after {
  content: '';
  position: absolute;
  left: -0.75rem;
  right: -0.75rem;
  bottom: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.menu-builder-preview-tabs-track {
  display: flex;
  gap: 0.5rem;
}

.menu-builder-preview-tabs-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--yumply, #007a33);
  border-radius: 2px 2px 0 0;
  transition: left 0.25s ease, width 0.25s ease;
  z-index: 1;
}

.menu-builder-preview-panel {
  margin-top: 0;
}

.menu-builder-preview-empty-msg {
  padding: 2rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
}

.menu-builder-preview-tab {
  padding: 0 0.25rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
}

.menu-builder-preview-tab--active {
  color: var(--text-primary);
  font-weight: 500;
}

.menu-builder-preview-section-wrap {
  margin-bottom: 1.25rem;
}

.menu-builder-preview-section-wrap .menu-builder-preview-section-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  visibility: visible;
}

.menu-builder-preview-section {
  margin-bottom: 1rem;
}

.menu-builder-preview-section:last-child {
  margin-bottom: 0;
}

.menu-builder-preview-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.menu-builder-preview-category-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  visibility: visible;
}

.menu-builder-preview-see-all {
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  color: #9a9a9a;
  cursor: pointer;
}

.menu-builder-preview-see-all:hover {
  text-decoration: underline;
}

.menu-builder-preview-category-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.menu-builder-preview-category-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  padding: 0.25rem 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: opacity 0.2s ease;
}

.menu-builder-preview-category-card:hover {
  opacity: 0.8;
}

.menu-builder-preview-category-thumb-wrap {
  flex-shrink: 0;
}

.menu-builder-preview-category-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.menu-builder-preview-category-img--placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-body);
}

.menu-builder-preview-category-card-name {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.menu-builder-preview-subgroup-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.menu-builder-preview-subgroup-list .menu-builder-preview-subgroup-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  background: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  text-align: left;
}

.menu-builder-preview-subgroup-list .menu-builder-preview-subgroup-thumb-wrap {
  flex-shrink: 0;
}

.menu-builder-preview-subgroup-list .menu-builder-preview-subgroup-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.menu-builder-preview-subgroup-list .menu-builder-preview-subgroup-img--placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.menu-builder-preview-subgroup-row {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.menu-builder-preview-subgroup-row::-webkit-scrollbar {
  display: none;
}

.menu-builder-preview-subgroup-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 64px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: opacity 0.2s ease;
}

.menu-builder-preview-subgroup-card:hover {
  opacity: 0.85;
}

.menu-builder-preview-subgroup-card:active {
  opacity: 0.7;
}

.menu-builder-preview-subgroup-thumb-wrap {
  flex-shrink: 0;
}

.menu-builder-preview-subgroup-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.menu-builder-preview-subgroup-img--placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-body);
}

.menu-builder-preview-subgroup-card-name {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Category detail view (Starbucks-style) */
.menu-builder-preview-catdetail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 0.25rem;
}

.menu-builder-preview-catdetail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.25rem;
  color: #000;
  cursor: pointer;
  font-size: 0;
}

.menu-builder-preview-catdetail-back:hover {
  opacity: 0.6;
}

.menu-builder-preview-catdetail-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #000;
  line-height: 1.3;
}

.menu-builder-preview-catdetail-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin-bottom: 0.75rem;
}

.menu-builder-preview-catdetail-section {
  margin-bottom: 0.75rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.menu-builder-preview-catdetail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0.35rem;
}

.menu-builder-preview-catdetail-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  min-width: 0;
}

.menu-builder-preview-catdetail-section-name {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #000;
  min-width: 0;
  padding-right: 0.35rem;
}

.menu-builder-preview-catdetail-see-all {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  color: #9a9a9a;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.menu-builder-preview-catdetail-see-all:hover {
  text-decoration: underline;
}

.menu-builder-preview-catdetail-scroll-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 0.5rem 0.5rem 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-inline-end: 0.5rem;
}

.menu-builder-preview-catdetail-scroll-row::-webkit-scrollbar {
  display: none;
}

.menu-builder-preview-catdetail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  min-width: 60px;
  max-width: 68px;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
}

.menu-builder-preview-catdetail-card:hover {
  opacity: 0.8;
}

.menu-builder-preview-catdetail-card-img-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e3932;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-builder-preview-catdetail-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.menu-builder-preview-catdetail-card-img--placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-body);
}

.menu-builder-preview-catdetail-card-name {
  font-size: 0.5625rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* "See all" grid view */
.menu-builder-preview-seeall-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 0.5rem;
  padding-top: 0.25rem;
}

.menu-builder-preview-seeall-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.menu-builder-preview-seeall-img-wrap {
  width: 100%;
  max-width: 120px;
  height: 0;
  padding-bottom: 100%;
  max-height: 120px;
  position: relative;
}

.menu-builder-preview-seeall-img-wrap > img,
.menu-builder-preview-seeall-img-wrap > div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.menu-builder-preview-seeall-card-name {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 120px;
}

.menu-builder-preview-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0;
  margin: 0 0 0.75rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--accent, #007aff);
  cursor: pointer;
}

.menu-builder-preview-back:hover {
  text-decoration: underline;
}

.menu-builder-preview-detail-title {
  margin: 0 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-primary);
}

.menu-builder-preview-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-builder-preview-item {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.6875rem;
  border-radius: 6px;
}

.menu-builder-preview-item:last-child {
  border-bottom: none;
}

.menu-builder-preview-item-img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg-body);
}

.menu-builder-preview-item-info {
  flex: 1;
  min-width: 0;
}

.menu-builder-preview-item-name {
  font-weight: 400;
  color: var(--text-primary);
}

.menu-builder-preview-item-desc {
  margin: 0.15rem 0 0;
  font-size: 0.625rem;
  color: var(--text-secondary);
}

.menu-builder-preview-item-price {
  font-weight: 400;
  color: var(--text-primary);
  flex-shrink: 0;
}

.menu-builder-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.menu-builder-empty--lead {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
}

.menu-builder-empty-hint {
  margin: 0.5rem 0 0;
  padding: 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.menu-builder-node-btn--delete {
  font-size: 0.875rem;
}

.menu-builder-node-btn--delete img {
  width: 14px;
  height: 14px;
  display: block;
}

.menu-builder-node-btn--delete:hover {
  background: transparent;
}

.menu-builder-node-btn--delete:hover img {
  filter: invert(16%) sepia(99%) saturate(7394%) hue-rotate(359deg) brightness(95%) contrast(118%);
}

.menu-builder-loading {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Menu Builder: Delete Confirmation Popups (Section, Category, Sub-group, Item) */
.mb-delete-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.2s ease;
}

.mb-delete-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.mb-delete-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mb-delete-popup[aria-hidden="false"] .mb-delete-popup-overlay {
  opacity: 1;
}

.mb-delete-popup-panel {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 90%;
  max-width: 380px;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  text-align: center;
  transform: scale(0.94) translateY(-12px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.mb-delete-popup[aria-hidden="false"] .mb-delete-popup-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.mb-delete-popup-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.mb-delete-popup-icon svg {
  width: 28px;
  height: 28px;
}

.mb-delete-popup-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mb-delete-popup-message {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mb-delete-popup-footer {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mb-delete-popup-cancel {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mb-delete-popup-cancel:hover {
  background: var(--bg-body);
  border-color: rgba(0, 0, 0, 0.15);
}

.mb-delete-popup-confirm {
  padding: 0.625rem 1.25rem;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.mb-delete-popup-confirm:hover {
  background: #b91c1c;
}

.mb-delete-popup-confirm:active {
  transform: scale(0.98);
}

/* Menu Builder Popups (Add Section / Add Sub-group) */
.mb-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.2s ease;
}

.mb-popup[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.mb-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mb-popup[aria-hidden="false"] .mb-popup-overlay {
  opacity: 1;
}

.mb-popup-panel {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 90%;
  max-width: 400px;
  padding: 1.75rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.mb-popup[aria-hidden="false"] .mb-popup-panel {
  transform: scale(1);
  opacity: 1;
}

.mb-popup-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.mb-popup-hint {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.mb-popup-form {
  margin-bottom: 1.5rem;
}

.mb-popup-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mb-popup-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.mb-popup-input::placeholder {
  color: #999;
}

.mb-popup-input:focus {
  outline: none;
  border-color: #9370db;
  box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.15);
}

.mb-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.mb-popup-cancel {
  padding: 0.625rem 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mb-popup-cancel:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.2);
}

.mb-popup-submit {
  padding: 0.625rem 1.25rem;
  border: none;
  background: #9370db;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mb-popup-submit:hover {
  background: #7b5fb8;
}

/* ── Branding Settings ── */

#panel-settings {
  max-width: 820px;
  padding: 1.5rem 1.75rem;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-card.branding-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 1.5rem 1.75rem;
}

.branding-section {
  margin-top: 0;
}

.branding-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

.branding-row {
  margin-bottom: 1.25rem;
}

.branding-row--images {
  display: flex;
  gap: 1.125rem;
  align-items: flex-start;
}

.branding-image-field {
  flex: 1;
  min-width: 0;
}

.branding-row--images .branding-image-field:first-child .branding-label {
  min-height: 26px;
  display: flex;
  align-items: center;
}
.branding-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.branding-dimensions-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #5c5c5c;
  font-weight: 500;
}

.branding-dimensions-hint strong {
  font-weight: 700;
  color: #333;
}

.branding-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.branding-label-row .branding-label {
  margin-bottom: 0;
}

.branding-label-hint {
  font-weight: 700;
  color: #1a1a1a;
  font-size: 0.75rem;
}

.branding-generate-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #e2e2e2;
  border-radius: 50%;
  background: #fff;
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.branding-generate-btn:hover {
  background: #f5f5f5;
  color: #666;
  border-color: #ccc;
}

.branding-image-box {
  position: relative;
  width: 100%;
  height: 130px;
  padding: 1rem;
  border: 1.5px dashed #ddd;
  border-radius: 14px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.branding-image-box:hover {
  border-color: #bbb;
  background: #f5f6f8;
}

.branding-image-box--transparent {
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  border-style: dashed;
}

.branding-image-preview {
  max-width: 112px;
  max-height: 112px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.branding-image-box:has(.branding-image-preview:not([hidden])):not(.branding-image-box--transparent) {
  border-style: solid;
  border-color: #e8e8e8;
  background: #fff;
}

.branding-image-box--transparent:has(.branding-image-preview:not([hidden])) {
  border-style: solid;
  border-color: #e8e8e8;
}

.branding-image-placeholder {
  font-size: 0.75rem;
  color: #bbb;
  pointer-events: none;
  font-weight: 500;
}

.branding-image-actions {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.branding-image-box:has(.branding-image-preview:not([hidden])):hover .branding-image-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.branding-image-action {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.branding-image-action--edit {
  background: #fff;
  color: #1a1a1a;
}

.branding-image-action--edit:hover {
  background: #f0f0f0;
}

.branding-image-action--delete {
  background: rgba(255, 255, 255, 0.95);
  color: #c62828;
}

.branding-image-action--delete:hover {
  background: #ffebee;
  color: #b71c1c;
}

.branding-image-action--delete {
  display: none;
}

.branding-image-box:has(.branding-image-preview:not([hidden])) .branding-image-action--delete {
  display: inline-block;
}

.branding-image-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.branding-row--colors,
.branding-row--text {
  display: flex;
  gap: 1.125rem;
}

.branding-field--half {
  flex: 1;
  min-width: 0;
}

.branding-field--full {
  width: 100%;
}

.branding-color-field {
  display: flex;
  align-items: center;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  height: 44px;
  transition: border-color 0.2s ease;
}

.branding-color-field:focus-within {
  border-color: #bbb;
}

.branding-color-picker {
  width: 88px;
  height: 44px;
  border: none;
  padding: 7px;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
}

.branding-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.branding-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.branding-color-picker::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}

.branding-color-hex {
  flex: 1;
  min-width: 0;
  border: none;
  border-left: 1.5px solid #e8e8e8;
  border-radius: 0;
  outline: none;
  background: transparent;
  font-size: 0.8125rem;
  height: 100%;
  padding: 0 0.875rem;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.branding-select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23bbb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
  transition: border-color 0.2s ease;
}

.branding-select:hover {
  border-color: #ccc;
}

.branding-text-input {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.2s ease;
}

.branding-text-input:hover,
.branding-select:hover {
  border-color: #ccc;
}

.branding-text-input:focus,
.branding-select:focus {
  outline: none;
  border-color: #aaa;
}

.branding-color-hex:focus {
  outline: none;
}

.branding-banner-box {
  position: relative;
  width: 100%;
  height: 180px;
  border: 1.5px dashed #ddd;
  border-radius: 16px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.branding-banner-box:hover {
  border-color: #bbb;
  background: #f5f6f8;
}

.branding-banner-box:has(.branding-banner-preview:not([hidden])) {
  border-style: solid;
  border-color: #e8e8e8;
  background: #fff;
}

.branding-banner-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.branding-banner-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.branding-banner-remove:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.05);
}

.branding-build-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1b5e20;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 999px;
}

.branding-build-badge--dirty {
  color: #e65100;
  background: #fff3e0;
  border-color: #ffcc80;
}

.branding-actions--primary {
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.125rem;
  border: 2px solid #c5e1a5;
  border-radius: 12px;
  background: #f9fbe7;
}

.branding-actions--primary.branding-actions--dirty {
  border-color: #ffb74d;
  background: #fff8e1;
  box-shadow: 0 0 0 3px rgba(255, 183, 77, 0.25);
}

.branding-save-btn.branding-save-btn--pending {
  animation: branding-save-pulse 1.2s ease-in-out infinite;
}

@keyframes branding-save-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 179, 66, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(124, 179, 66, 0); }
}

.branding-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f0f0;
}

.branding-save-hint {
  flex: 1 1 100%;
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #666);
  line-height: 1.4;
}

.branding-actions .btn-primary {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  letter-spacing: 0.01em;
}

.branding-save-status {
  font-size: 0.8125rem;
  color: #4caf50;
  font-weight: 500;
  transition: opacity 0.3s;
}

/* ── Business details card ── */

.settings-card.business-details-card {
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.business-details-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

.business-details-row {
  margin-bottom: 1.25rem;
}

.business-details-phone-wrap {
  display: flex;
  align-items: stretch;
  height: 44px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #f5f5f5 !important;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.business-details-phone-wrap:focus-within {
  border-color: #aaa;
  background: #ffffff !important;
  outline: none;
  box-shadow: none;
}

.business-details-phone-country {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 100%;
  border: none;
  border-radius: 0;
  padding: 0 0.4rem 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1;
  color: #1a1a1a;
  background: transparent;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  flex-shrink: 0;
  text-align: left;
}

.business-details-phone-country:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.business-details-phone-country:focus {
  outline: none;
}

.business-details-phone-field {
  flex: 1;
  min-width: 0;
  height: 100%;
  border-left: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  background: transparent;
}

.business-details-phone-prefix {
  flex-shrink: 0;
  padding: 0 0 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
  pointer-events: none;
  white-space: pre;
}

.business-details-input--phone {
  flex: 1;
  min-width: 0;
  width: 0;
  height: 100%;
  border: none;
  border-radius: 0;
  padding: 0 0.75rem 0 0;
  margin-left: -0.15em;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
  background: transparent !important;
  appearance: none;
}

/* Remove any blue/colored background from browser autofill */
.business-details-input--phone:-webkit-autofill,
.business-details-input--phone:-webkit-autofill:hover,
.business-details-input--phone:-webkit-autofill:focus {
  background: transparent !important;
  background-color: transparent !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
}

.business-details-input--phone::placeholder {
  color: #999;
}

.business-details-input--phone:focus,
.business-details-input--phone:focus-visible {
  box-shadow: none !important;
  outline: none !important;
  outline-offset: 0;
  border: none;
  background: transparent !important;
  background-color: transparent !important;
}

.business-details-select--country option {
  padding: 0.25rem 0;
}

.business-details-field--full {
  width: 100%;
}

.business-details-field--fit {
  width: fit-content;
  max-width: 100%;
}

.business-details-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.business-details-input,
.business-details-select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.2s ease;
}

.business-details-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23bbb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.business-details-input:hover,
.business-details-select:hover {
  border-color: #ccc;
}

.business-details-input:focus,
.business-details-select:focus {
  outline: none;
  border-color: #aaa;
}

/* Phone input lives inside .business-details-phone-wrap: no own border/radius */
.business-details-input--phone,
.business-details-input--phone:hover,
.business-details-input--phone:focus,
.business-details-input--phone:focus-visible {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.business-details-row--toggle {
  margin-bottom: 1.25rem;
}

.business-details-fees-card-wrap {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

.business-details-fees-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 2rem 1.25rem 1.25rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

.business-details-fees-card-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1a1a1a;
  flex: 0 1 auto;
}

.business-details-fees-toggle-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.business-details-fees-heading {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Reusable info tooltip component */
.info-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.info-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  border: none;
  border-radius: 50%;
  background: #bbdefb;
  color: #1976d2;
  font-size: 0.75rem;
  font-weight: 700;
  font-style: normal;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}

.info-tooltip-icon:hover {
  background: #90caf9;
}

.info-tooltip-icon:focus-visible {
  outline: 2px solid #2196f3;
  outline-offset: 2px;
}

.info-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  max-width: 360px;
  width: max-content;
  min-width: 260px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.info-tooltip-wrap:hover .info-tooltip,
.info-tooltip-wrap .info-tooltip[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.info-tooltip-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-primary, #1a1a1a);
}

.business-details-fees-card:hover {
  background: #fff;
  border-color: #ccc;
}

.business-details-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.business-details-fees-card .business-details-toggle-slider {
  margin-left: 0;
}

.business-details-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.business-details-toggle-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  flex: 1;
  min-width: 0;
  order: 1;
}

.business-details-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #ccc;
  transition: background 0.2s ease;
  flex-shrink: 0;
  order: 2;
}

.business-details-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s ease, right 0.2s ease;
}

.business-details-toggle-input:checked + .business-details-toggle-slider::after {
  left: auto;
  right: 2px;
}

.business-details-toggle-input:checked + .business-details-toggle-slider {
  background: var(--accent, #9370db);
}

.business-details-actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0f0f0;
}

.business-details-actions .btn-primary {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
}

.business-details-save-status {
  font-size: 0.8125rem;
  color: #4caf50;
  font-weight: 500;
  transition: opacity 0.3s;
}

.business-details-hours-wrap {
  width: 100%;
}

.business-details-hours-trigger {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  text-align: left;
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.business-details-hours-trigger:hover {
  border-color: #ccc;
}

.business-details-hours-summary {
  color: var(--text-secondary);
}

.business-details-hours-trigger:not([data-empty="true"]) .business-details-hours-summary {
  color: var(--text-primary);
}

/* Opening hours popup */
.opening-hours-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  visibility: hidden;
  pointer-events: none;
}

.opening-hours-popup[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.opening-hours-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.opening-hours-popup[aria-hidden="false"] .opening-hours-overlay {
  opacity: 1;
}

.opening-hours-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow: auto;
  padding: 2.25rem 2.5rem;
  background: var(--bg-card, #fff);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border, #e5e5ea);
}

.opening-hours-title {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.opening-hours-hint {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.opening-hours-table-wrap {
  margin-bottom: 2rem;
}

.opening-hours-header {
  display: grid;
  grid-template-columns: 6.25rem minmax(7rem, 8rem) minmax(0, 1fr) 1.75rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0 0 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--border, #e5e5ea);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.opening-hours-header > * {
  min-width: 0;
}

.opening-hours-header .opening-hours-day {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.opening-hours-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.opening-hours-row {
  display: grid;
  grid-template-columns: 6.25rem minmax(7rem, 8rem) minmax(0, 1fr) 1.75rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem 0;
  border-radius: 12px;
  transition: background 0.15s ease;
  min-width: 0;
}

.opening-hours-row > * {
  min-width: 0;
}

.opening-hours-list .opening-hours-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.opening-hours-row .opening-hours-day {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Open / Closed slider button */
.opening-hours-col-toggle {
  min-width: 0;
  max-width: 100%;
  margin-left: 0.5rem;
}

.opening-hours-open-closed-toggle {
  display: block;
  cursor: pointer;
  user-select: none;
  min-width: 0;
  max-width: 100%;
}

.opening-hours-open-closed-toggle .opening-hours-closed-cb {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.opening-hours-toggle-track {
  display: flex;
  align-items: stretch;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 7rem;
  height: 34px;
  padding: 0;
  border-radius: 17px;
  background: #e0e0e0;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.opening-hours-open-closed-toggle .opening-hours-closed-cb:checked + .opening-hours-toggle-track {
  background: rgba(76, 175, 80, 0.35);
}

.opening-hours-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 6px);
  height: 28px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.opening-hours-open-closed-toggle .opening-hours-closed-cb:checked + .opening-hours-toggle-track::after {
  transform: translateX(calc(100% + 6px));
}

.opening-hours-toggle-label {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 0.2rem;
  text-align: center;
}

.opening-hours-toggle-closed {
  color: #666;
}

.opening-hours-open-closed-toggle .opening-hours-closed-cb:checked + .opening-hours-toggle-track .opening-hours-toggle-closed {
  color: #999;
}

.opening-hours-toggle-open {
  color: #999;
}

.opening-hours-open-closed-toggle .opening-hours-closed-cb:checked + .opening-hours-toggle-track .opening-hours-toggle-open {
  color: #2e7d32;
  font-weight: 700;
}

.opening-hours-col-open,
.opening-hours-col-close {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.opening-hours-col-open select,
.opening-hours-col-close select {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.35rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e5ea);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.opening-hours-col-open select:focus,
.opening-hours-col-close select:focus {
  outline: none;
  border-color: var(--accent, #e91e63);
  box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.15);
}

.opening-hours-col-open select:disabled,
.opening-hours-col-close select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--bg-body, #f5f5f7);
}

.opening-hours-col-to {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.opening-hours-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border, #e5e5ea);
}

.opening-hours-cancel,
.opening-hours-done {
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.opening-hours-cancel {
  background: transparent;
  color: var(--text-secondary);
}

.opening-hours-cancel:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.opening-hours-done {
  background: var(--accent, #e91e63);
  color: #fff;
}

.opening-hours-done:hover {
  background: var(--accent-hover, #c2185b);
}

/* ===== REWARDS ===== */

.rewards-view {
  padding: 0;
}

.rewards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.rewards-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.rewards-btn-create {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(213, 255, 39, 0.2);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid #8a9e1f;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.rewards-btn-create:hover {
  background: rgba(213, 255, 39, 0.35);
  border-color: #6b7a18;
  box-shadow: 0 2px 8px rgba(213, 255, 39, 0.2);
}

.rewards-btn-create-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.rewards-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .rewards-layout {
    grid-template-columns: 1fr;
  }
}

/* Empty state */
.rewards-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  min-height: 600px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
}

.rewards-empty-state[hidden] {
  display: none !important;
}

.rewards-empty-icon {
  width: 120px;
  height: 120px;
}

.rewards-empty-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.85;
}

.rewards-empty-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Saved rewards grid */
.rewards-saved-wrap:not([hidden]) {
  display: block;
  min-height: 340px;
}

.rewards-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 700px) {
  .rewards-list {
    grid-template-columns: 1fr;
  }
}

.rewards-list li {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid var(--border);
}

.rewards-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.reward-card-cover {
  position: relative;
  width: 100%;
  height: 160px;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
}

.reward-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reward-card-cover-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaeaef;
}

.reward-card-cover-empty svg {
  width: 44px;
  height: 44px;
  color: var(--text-secondary);
  opacity: 0.25;
}

.reward-card-body {
  padding: 0.85rem 1rem 0.75rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.reward-card-points {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.reward-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.15rem 0 0;
  line-height: 1.3;
}

.reward-card-footer {
  padding: 0.65rem 1rem;
  background: var(--bg-body);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
}

.reward-card-footer strong {
  color: var(--text-primary);
}

.reward-card-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(30, 30, 30, 0.55);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.rewards-list li:hover .reward-card-edit {
  opacity: 1;
}

.reward-card-edit:hover {
  background: rgba(30, 30, 30, 0.75);
}

/* Points configuration card */
.rewards-points-card {
  padding: 1.75rem 2rem;
  border-radius: 16px;
}

.rewards-points-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.rewards-points-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.rewards-points-save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--text-primary);
  color: var(--bg-card);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.rewards-points-save:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.rewards-points-row {
  margin-bottom: 2rem;
}

.rewards-points-row:last-child {
  margin-bottom: 0;
}

.rewards-points-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.rewards-points-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.rewards-points-info {
  font-size: 0.85rem;
  color: #2196f3;
  cursor: help;
  margin-left: 0.15rem;
}

.rewards-points-control {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rewards-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--text-primary) 0%, var(--text-primary) 0%, var(--border) 0%, var(--border) 100%);
  outline: none;
  cursor: pointer;
}

.rewards-slider::-moz-range-progress {
  background: var(--text-primary);
  height: 4px;
  border-radius: 2px;
}

.rewards-slider::-moz-range-track {
  background: var(--border);
  height: 4px;
  border-radius: 2px;
}

.rewards-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rewards-slider::-webkit-slider-thumb:hover {
  background: #f3e5f5;
  border-color: #ce93d8;
  box-shadow: 0 0 0 4px rgba(206, 147, 216, 0.25);
}

.rewards-slider::-webkit-slider-thumb:active {
  background: #f3e5f5;
  border-color: #ab47bc;
  box-shadow: 0 0 0 4px rgba(206, 147, 216, 0.35);
}

.rewards-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
}

.rewards-slider::-moz-range-thumb:hover {
  background: #f3e5f5;
  border-color: #ce93d8;
}

.rewards-slider::-moz-range-thumb:active {
  background: #f3e5f5;
  border-color: #ab47bc;
}

.rewards-points-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 100px;
}

.rewards-points-input {
  width: 60px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card);
  text-align: center;
  font-family: inherit;
}

.rewards-points-input:focus {
  outline: none;
  border-color: var(--accent);
}

.rewards-points-unit {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ===== Reward Modal ===== */
.reward-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.reward-modal[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.reward-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reward-modal[aria-hidden="false"] .reward-modal-overlay {
  opacity: 1;
}

.reward-modal-content {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 100%;
  max-width: 620px;
  background: var(--bg-body);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.reward-modal[aria-hidden="false"] .reward-modal-content {
  transform: translateX(0);
}

.reward-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.reward-modal-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease;
}

.reward-modal-back:hover {
  background: var(--bg-card);
}

.reward-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.reward-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.reward-modal-body .one-time-offer-error {
  margin-top: 0;
}

/* Match One-Time Offer invalid sections inside Rewards modal */
.reward-form-section.one-time-offer-form-section--invalid {
  border: 2px solid #c62828;
  border-radius: 10px;
  padding: 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  background: rgba(198, 40, 40, 0.06);
}

.reward-form-section.one-time-offer-form-section--invalid .reward-form-section-title {
  color: #c62828;
}

@media (prefers-color-scheme: dark) {
  .reward-form-section.one-time-offer-form-section--invalid {
    border-color: #ef5350;
    background: rgba(198, 40, 40, 0.12);
  }

  .reward-form-section.one-time-offer-form-section--invalid .reward-form-section-title {
    color: #ef9a9a;
  }
}

.reward-form {
  max-width: 100%;
}

.reward-form-section {
  margin-bottom: 2.5rem;
}

.reward-form-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.reward-form-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.75rem;
  border: 1px solid var(--border);
}

.reward-form-row--three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reward-form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reward-never-expire-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  gap: 0.5rem;
}

.reward-never-expire-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.reward-scope-tags {
  min-height: 2rem;
  margin-bottom: 0.65rem;
}

.reward-scope-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.reward-scope-add-row select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: inherit;
  box-sizing: border-box;
}

.reward-scope-add-row select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.reward-scope-add-btn {
  padding: 0.55rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.reward-scope-add-btn:hover {
  opacity: 0.9;
}

.reward-scope-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .reward-scope-add-row {
    grid-template-columns: 1fr 1fr;
  }
  .reward-scope-add-row select:last-of-type {
    grid-column: 1 / -1;
  }
  .reward-scope-add-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.reward-form .form-group {
  margin-bottom: 1.4rem;
}

.reward-form .form-group:last-child {
  margin-bottom: 0;
}

.reward-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.reward-form .form-group input[type="text"],
.reward-form .form-group input[type="number"],
.reward-form .form-group textarea,
.reward-form .form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.reward-form .form-group input:focus,
.reward-form .form-group textarea:focus,
.reward-form .form-group select:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.reward-form .form-group textarea {
  resize: vertical;
  min-height: 80px;
}


.reward-input-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.reward-input-suffix input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  padding-right: 4.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  -moz-appearance: textfield;
}

.reward-input-suffix input::-webkit-outer-spin-button,
.reward-input-suffix input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.reward-input-suffix input:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.reward-suffix {
  position: absolute;
  right: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.reward-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* SLA Cash row */
.reward-sla-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reward-sla-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.reward-sla-label {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.reward-sla-amount {
  min-width: 120px;
}

.reward-form .ot-pills {
  margin-bottom: 0.75rem;
}

.reward-form .ot-field-label {
  margin-bottom: 0.35rem;
}

.reward-form .ot-value-wrap {
  margin-top: 0;
  background: #fff;
}

/* Select wrap */
.reward-select-wrap {
  position: relative;
}

.reward-select-wrap select {
  width: 100%;
  padding: 1.3rem 0.85rem;
  padding-right: 2rem;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.reward-select-wrap::after {
  content: '⌄';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Cover upload */
.reward-cover-upload {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: var(--bg-card);
  position: relative;
}

.reward-cover-upload:hover {
  border-color: #2196f3;
  background: rgba(33, 150, 243, 0.03);
}

.reward-cover-upload.reward-cover-upload--dragover {
  border-color: #2196f3;
  background: rgba(33, 150, 243, 0.06);
}

.reward-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.reward-cover-icon {
  color: var(--text-secondary);
  opacity: 0.6;
  margin-bottom: 0.25rem;
}

.reward-cover-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.reward-scope-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.reward-scope-picker-row > .form-group {
  margin-bottom: 0;
}

.reward-scope-picker-row > .form-group:last-child {
  width: fit-content;
  justify-self: start;
}

.reward-scope-picker-row .reward-select-wrap select {
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  padding-right: 1.8rem;
  border-radius: 9px;
  font-size: 0.86rem;
}

.reward-scope-action-btn {
  min-height: 40px;
  padding: 0 0.75rem;
  border-radius: 9px;
  white-space: nowrap;
  border: 1px solid #dccbbd;
  background: #fff;
  color: #6f4a30;
  font-weight: 600;
  font-size: 0.84rem;
  width: auto;
  min-width: 106px;
  align-self: center;
}

.reward-scope-action-btn:hover {
  background: #faf6f1;
  border-color: #cfb8a5;
  transform: none;
}

.reward-scope-action-btn:active {
  transform: none;
}

.reward-form .ot-tags {
  margin-top: 0.2rem;
  margin-bottom: 0;
  gap: 0.3rem;
}

.reward-form .ot-tag {
  background: #f7f2ec;
  color: #765742;
  border-radius: 7px;
  padding: 0.24rem 0.52rem;
  font-size: 0.8rem;
}

.reward-form .ot-tag-remove {
  color: #765742;
  font-size: 0.9rem;
}

#reward-scope-categories-wrap,
#reward-scope-items-wrap {
  margin-top: -0.2rem;
}

#reward-scope-categories-wrap > .form-group,
#reward-scope-items-wrap > .form-group {
  margin-bottom: 0.55rem;
}

#reward-scope-categories-wrap > .form-group:last-of-type,
#reward-scope-items-wrap > .form-group:last-of-type {
  margin-bottom: 0;
}

.reward-cover-hint {
  font-size: 0.78rem;
  color: #2196f3;
}

.reward-cover-size-error {
  margin-top: 0.45rem;
  margin-bottom: 0;
  font-size: 0.78rem;
  color: #c62828;
  font-weight: 600;
}

.reward-cover-preview {
  position: relative;
  display: inline-block;
}

.reward-cover-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: cover;
}

.reward-cover-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-cover-preview[hidden] {
  display: none;
}

/* Reward modal footer – fixed at bottom of modal */
.reward-modal-content > .reward-footer {
  flex-shrink: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
}

.reward-footer .occasion-edit-cancel {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.reward-footer .occasion-edit-save {
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(213, 255, 39, 0.4);
  background: rgba(213, 255, 39, 0.55);
  color: #1a1a1a;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.reward-footer .occasion-edit-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.reward-footer .occasion-edit-save:disabled:hover {
  background: rgba(213, 255, 39, 0.55);
  border-color: rgba(213, 255, 39, 0.4);
}

/* ----- App Builder blog tab (single inline rhythm via --blog-inline) ----- */
.tab-panel--blog {
  padding: 0.5rem 1.25rem 2.5rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .tab-panel--blog {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.blog-page {
  --blog-inline: 1.25rem;
  --blog-block: 1rem;
  --blog-block-lg: 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 768px) {
  .blog-page {
    --blog-inline: 1.5rem;
  }
}

.blog-page-hero {
  margin: 0 0 var(--blog-block-lg);
  padding: 1.5rem var(--blog-inline) 1.5rem;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 90% 70% at 100% 0%, rgba(125, 193, 191, 0.18) 0%, transparent 55%),
    linear-gradient(145deg, rgba(125, 193, 191, 0.1) 0%, rgba(125, 193, 191, 0.03) 50%, transparent 100%);
  border: 1px solid rgba(125, 193, 191, 0.25);
  box-sizing: border-box;
}

.blog-page-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  max-width: 56rem;
}

@media (min-width: 900px) {
  .blog-page-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
    gap: 2rem;
  }
}

.blog-page-hero-main {
  min-width: 0;
}

.blog-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 0.875rem;
  padding: 0.3125rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(45, 90, 88, 0.95);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(125, 193, 191, 0.45);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  .blog-page-badge {
    color: rgba(200, 230, 228, 0.95);
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(125, 193, 191, 0.35);
  }
}

.blog-page-badge-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.blog-page-title {
  margin: 0 0 0.625rem;
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  line-height: 1.15;
}

.blog-page-tagline {
  margin: 0 0 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 38rem;
}

.blog-page-highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 38rem;
}

.blog-page-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.blog-page-highlights li strong {
  font-weight: 600;
  color: var(--text-primary);
}

.blog-page-highlight-icon {
  flex-shrink: 0;
  display: flex;
  margin-top: 0.1rem;
  color: rgba(45, 120, 115, 0.95);
}

.blog-page-highlight-icon svg {
  display: block;
}

@media (prefers-color-scheme: dark) {
  .blog-page-highlight-icon {
    color: rgba(125, 193, 191, 0.95);
  }
}

.blog-page-hero-aside {
  display: none;
}

@media (min-width: 900px) {
  .blog-page-hero-aside {
    display: block;
    justify-self: end;
    width: 100%;
    max-width: 14rem;
  }
}

.blog-page-hero-preview {
  border-radius: 12px;
  padding: 1rem 1rem 1.125rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(125, 193, 191, 0.28);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .blog-page-hero-preview {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(125, 193, 191, 0.22);
  }
}

.blog-page-hero-preview-bar {
  height: 6px;
  width: 40%;
  border-radius: 4px;
  background: rgba(125, 193, 191, 0.45);
  margin-bottom: 0.75rem;
}

.blog-page-hero-preview-row {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.blog-page-hero-preview-row:last-child {
  margin-bottom: 0;
}

.blog-page-hero-preview-row--accent {
  height: 10px;
  width: 100%;
  background: linear-gradient(90deg, rgba(125, 193, 191, 0.5), rgba(125, 193, 191, 0.2));
}

.blog-page-hero-preview-row--short {
  width: 72%;
}

.blog-page-surface {
  --blog-surface-inline: clamp(1.5rem, 4vw, 2.25rem);
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
}

.blog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.125rem 1.75rem;
  flex-wrap: wrap;
  min-height: 5.5rem;
  padding: 1.875rem var(--blog-surface-inline) 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.015);
  box-sizing: border-box;
}

.blog-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-toolbar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.blog-toolbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(125, 193, 191, 0.2);
  border: 1px solid rgba(125, 193, 191, 0.35);
  line-height: 1;
}

.blog-toolbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  border-radius: 999px;
  padding: 0.625rem 1.375rem;
  min-height: 2.625rem;
  box-sizing: border-box;
}

.blog-toolbar-cta-icon {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0.9;
}

.blog-signin-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin: 1rem var(--blog-surface-inline) 1.375rem;
  padding: 1.125rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.55;
  box-sizing: border-box;
}

.blog-signin-hint-icon {
  flex-shrink: 0;
  display: flex;
  margin-top: 0.125rem;
  color: rgba(180, 83, 9, 0.9);
}

.blog-signin-hint-icon svg {
  display: block;
}

.blog-signin-hint[hidden] {
  display: none;
}

.blog-empty-state {
  text-align: center;
  padding: 3.5rem clamp(1.5rem, 4vw, 2.5rem) 3.75rem;
  margin: 1.5rem var(--blog-surface-inline) 2.25rem;
  border-radius: 14px;
  border: 1px dashed rgba(125, 193, 191, 0.45);
  background: linear-gradient(180deg, rgba(125, 193, 191, 0.06) 0%, transparent 100%);
  box-sizing: border-box;
}

.blog-empty-state[hidden] {
  display: none;
}

.blog-empty-visual {
  display: flex;
  justify-content: center;
  margin: 0 0 1.75rem;
  color: rgba(125, 193, 191, 0.85);
}

.blog-empty-svg {
  opacity: 0.9;
  width: 80px;
  height: 80px;
}

.blog-empty-title {
  margin: 0 0 1rem;
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.blog-empty-text {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.blog-post-list {
  list-style: none;
  margin: 0;
  padding: 1.75rem var(--blog-surface-inline) 2.375rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 1.75rem;
  row-gap: 1.875rem;
  align-content: start;
}

.blog-post-list li {
  margin: 0;
  justify-self: start;
  width: 100%;
  max-width: min(100%, 24rem);
}

.blog-editor-card {
  --blog-card-pad-x: clamp(1.375rem, 5vw, 1.875rem);
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card, var(--bg-body));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: left;
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
}

.blog-editor-card:hover {
  border-color: rgba(125, 193, 191, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.blog-editor-card:focus-visible {
  outline: 2px solid rgba(125, 193, 191, 0.8);
  outline-offset: 2px;
}

.blog-editor-card-image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, var(--border), rgba(125, 193, 191, 0.1));
}

.blog-editor-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-editor-card-image--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.blog-editor-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem var(--blog-card-pad-x) 1.75rem;
}

.blog-editor-card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: left;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.blog-editor-card-subtitle {
  margin: 0;
  padding-top: 0.0625rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-editor-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  padding: 1rem var(--blog-card-pad-x) 1.0625rem;
  border-top: 1px solid var(--border);
  background: rgba(125, 193, 191, 0.06);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.blog-editor-card-footer span:first-child {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.9;
}

.blog-editor-card-footer span:last-child {
  font-size: 0.9375rem;
  line-height: 1;
  opacity: 0.45;
  transform: translateX(0);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.blog-editor-card:hover .blog-editor-card-footer span:last-child {
  transform: translateX(4px);
  opacity: 0.75;
}

/* Blog modal — layout & form */
.blog-post-modal-content {
  max-width: 720px;
  width: calc(100% - 2rem);
  --blog-modal-inline: 1.5rem;
  --blog-modal-gap: 1.25rem;
}

.blog-post-modal-header {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem var(--blog-modal-inline);
}

.blog-post-modal-header-text {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}

.blog-post-modal-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 400;
}

.blog-post-modal-body {
  padding: 1.25rem var(--blog-modal-inline) 1.5rem;
}

.blog-post-form-error.one-time-offer-error {
  margin: 0 0 var(--blog-modal-gap);
  border-radius: 10px;
}

.blog-form-layout {
  display: flex;
  flex-direction: column;
  gap: var(--blog-modal-gap);
}

.blog-form-section {
  padding: 1.25rem var(--blog-modal-inline) 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
  box-sizing: border-box;
}

.blog-form-section--media {
  background: rgba(125, 193, 191, 0.06);
  border-color: rgba(125, 193, 191, 0.2);
}

.blog-form-section-title {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 1.2;
}

.blog-form-section-lead {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.blog-form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 1.125rem;
}

.blog-form-section--content .blog-form-field:last-of-type {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .blog-form-row--split {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
}

.blog-form-field {
  margin-bottom: 0;
}

.blog-field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.blog-field-micro-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.blog-field-required {
  color: #e11d48;
  font-weight: 700;
}

.blog-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.blog-field-optional {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: lowercase;
}

.blog-post-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
  background: var(--bg-body);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.blog-post-input:hover {
  border-color: rgba(125, 193, 191, 0.45);
}

.blog-post-input:focus {
  outline: none;
  border-color: rgba(125, 193, 191, 0.75);
  box-shadow: 0 0 0 3px rgba(125, 193, 191, 0.2);
}

.blog-post-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  min-height: 240px;
  background: var(--bg-body);
  color: var(--text-primary);
  white-space: pre-wrap;
  tab-size: 4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.blog-post-textarea:hover {
  border-color: rgba(125, 193, 191, 0.45);
}

.blog-post-textarea:focus {
  outline: none;
  border-color: rgba(125, 193, 191, 0.75);
  box-shadow: 0 0 0 3px rgba(125, 193, 191, 0.2);
}

.blog-image-upload.blog-image-upload {
  max-width: 100%;
  border-radius: 10px;
}

.blog-post-modal .blog-image-preview img {
  max-height: 220px;
  border-radius: 10px;
}

/* Blog modal footer: align with --blog-modal-inline */
.reward-modal-content.blog-post-modal-content > .reward-footer {
  padding: 1rem var(--blog-modal-inline) 1.25rem;
  gap: 1.25rem;
}

.blog-post-modal-footer .occasion-edit-save {
  border-radius: 999px;
  padding: 0.625rem 1.35rem;
}
