/* ═══════════════════════════════════════════
   Zoomi Backend — Premium Control Hub
   ═══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --bo-bg: #f5f7f6;
  --bo-card: #ffffff;
  --bo-ink: #0f172a;
  --bo-muted: #617086;
  --bo-brand: #19c37d;
  --bo-brand-dark: #0e8f5c;
  --bo-line: #e3e9ef;
  --bo-primary: #19c37d;
  --bo-border: #e3e9ef;
  --bo-shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --bo-shadow-lg: 0 4px 12px rgba(15,23,42,.06), 0 16px 40px rgba(15,23,42,.1);

  --bo-space-xs: 8px;
  --bo-space-sm: 12px;
  --bo-space-md: 16px;
  --bo-space-lg: 24px;
  --bo-space-xl: 32px;

  --bo-radius-sm: 10px;
  --bo-radius-md: 16px;
  --bo-radius-lg: 20px;

  --bo-card-text: #1e293b;
  --bo-dark-card-text: #cbd5e1;

  --bo-sidebar-w: 272px;
  --bo-mobile-header-h: 56px;
  --bo-transition: .25s cubic-bezier(.4,0,.2,1);
}

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

body.backoffice-page {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--bo-ink);
  background: var(--bo-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.bo-scroll-locked {
  overflow: hidden;
  touch-action: none;
}

/* ═══════════════════════════════════════════
   SHELL — Desktop Grid
   ═══════════════════════════════════════════ */

.bo-shell {
  display: grid;
  grid-template-columns: var(--bo-sidebar-w) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

/* ── Mobile Header (hidden on desktop) ── */
.bo-mobile-header {
  display: none;
}

/* ── Backdrop (hidden by default) ── */
.bo-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(15, 23, 42, .4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--bo-transition);
}
.bo-drawer-backdrop.is-open {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   SIDEBAR — Desktop
   ═══════════════════════════════════════════ */

.bo-sidebar {
  background: #0f172a;
  color: #dbe4ef;
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
  z-index: 900;
}

.bo-sidebar::-webkit-scrollbar { width: 4px; }
.bo-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Sidebar head */
.bo-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.bo-brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bo-brand svg { color: var(--bo-brand); }

.bo-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  color: #94a3b8;
  cursor: pointer;
  transition: background .15s;
}
.bo-close-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* User card */
.bo-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--bo-radius-sm);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 24px;
}

.bo-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bo-brand), #34d399);
  color: #fff;
  font-weight: 700;
  font-size: .88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bo-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bo-user-name {
  font-size: .84rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-user-plan-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.bo-plan-lite { background: rgba(59,130,246,.15); color: #93c5fd; }
.bo-plan-health { background: rgba(25,195,125,.15); color: #7be7b8; }
.bo-plan-admin { background: rgba(251,191,36,.15); color: #fcd34d; }

/* Navigation */
.bo-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.bo-nav-group {
  margin-bottom: 8px;
}

.bo-nav-group-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: 0 12px;
  margin-bottom: 6px;
  margin-top: 8px;
}

.bo-nav-group:first-child .bo-nav-group-label {
  margin-top: 0;
}

.bo-nav a {
  color: #c8d3e0;
  border-radius: var(--bo-radius-sm);
  padding: 9px 12px;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s, color .15s, border-color .15s;
  border: 1px solid transparent;
}

.bo-nav a svg {
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .15s;
}

.bo-nav a:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
  color: #fff;
}
.bo-nav a:hover svg { opacity: 1; }

.bo-nav a.is-active {
  background: rgba(25,195,125,.12);
  border-color: rgba(25,195,125,.2);
  color: #7be7b8;
  font-weight: 600;
}
.bo-nav a.is-active svg { opacity: 1; color: var(--bo-brand); }

.bo-nav-health-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--bo-brand);
  background: rgba(25,195,125,.1);
  border: 1px solid rgba(25,195,125,.25);
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  margin-left: auto;
  white-space: nowrap;
}

/* Sidebar footer */
.bo-sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bo-sidebar-foot-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7c8da4;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--bo-radius-sm);
  transition: color .15s, background .15s;
}

.bo-sidebar-foot-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.06);
}

.bo-logout-link:hover { color: #fca5a5; }

/* ═══════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════ */

.bo-main {
  padding: var(--bo-space-lg) var(--bo-space-xl) 40px;
  min-width: 0;
}

/* ── Top Bar (desktop only) ── */
.bo-topbar {
  background: var(--bo-card);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  padding: 16px 20px;
  box-shadow: var(--bo-shadow);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.bo-topbar-left strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.bo-topbar p {
  margin: 4px 0 0;
  color: var(--bo-muted);
  font-size: .84rem;
}

.bo-top-link {
  text-decoration: none;
  color: var(--bo-brand-dark);
  font-weight: 600;
  font-size: .85rem;
  border: 1px solid #c8e9da;
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.bo-top-link:hover {
  background: #f0faf5;
  border-color: #a7dfc5;
}

/* ═══════════════════════════════════════════
   PAGE HEADER (standardised)
   ═══════════════════════════════════════════ */

.bo-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--bo-space-md);
  flex-wrap: wrap;
  margin-top: var(--bo-space-lg);
}

.bo-page-header-info h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}

.bo-page-header-info p {
  color: var(--bo-muted);
  margin: 0;
  font-size: .88rem;
  line-height: 1.5;
}

.bo-page-header-actions {
  display: flex;
  gap: var(--bo-space-xs);
  align-items: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   SECTIONS & GRIDS
   ═══════════════════════════════════════════ */

.bo-section { margin-top: var(--bo-space-lg); }
.bo-grid { display: grid; gap: var(--bo-space-md); }
.bo-grid.kpi { grid-template-columns: repeat(4, 1fr); }
.bo-grid.two { grid-template-columns: 1.2fr .8fr; }
.bo-grid.three { grid-template-columns: repeat(3, 1fr); }

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */

.bo-card {
  background: var(--bo-card);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  box-shadow: var(--bo-shadow);
  padding: 20px;
}

.bo-card h2, .bo-card h3 { margin: .2rem 0; }

/* KPI */
.bo-kpi-label {
  font-size: .78rem;
  color: var(--bo-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.bo-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */

.bo-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px -4px 0;
  padding: 0 4px;
}

.bo-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.bo-table th, .bo-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--bo-line);
  text-align: left;
  font-size: .88rem;
  white-space: nowrap;
}

.bo-table th {
  background: #f8fafb;
  border-top: none;
  color: var(--bo-muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.bo-table tbody tr {
  transition: background .1s;
}

.bo-table tbody tr:hover {
  background: #f8fafb;
}

/* ═══════════════════════════════════════════
   LISTS
   ═══════════════════════════════════════════ */

.bo-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.bo-list li {
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-sm);
  padding: 10px 12px;
  font-size: .88rem;
  color: #334155;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.bo-btn {
  text-decoration: none;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-sm);
  padding: 8px 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--bo-ink);
  background: var(--bo-card);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  font-family: inherit;
}

.bo-btn:hover {
  background: #f8fafb;
  border-color: #cbd5e1;
}

.bo-btn-active {
  background: var(--bo-brand);
  color: #fff;
  border-color: var(--bo-brand);
}

.bo-submit-btn {
  border: none;
  border-radius: var(--bo-radius-sm);
  padding: 12px 20px;
  font-weight: 700;
  font-size: .9rem;
  background: var(--bo-brand);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, box-shadow .15s;
  font-family: inherit;
}

.bo-submit-btn:hover {
  background: var(--bo-brand-dark);
  box-shadow: 0 4px 12px rgba(25,195,125,.25);
}

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

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */

.bo-form-grid { display: grid; gap: 10px; }
.bo-input {
  border: 1px solid #d5deea;
  border-radius: var(--bo-radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: .9rem;
  min-width: 140px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.bo-input:focus {
  outline: none;
  border-color: var(--bo-brand);
  box-shadow: 0 0 0 3px rgba(25,195,125,.12);
}

textarea.bo-input { min-height: 76px; resize: vertical; }

.bo-field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--bo-ink);
  margin-top: 4px;
}

/* Sticky mobile actions */
.bo-sticky-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   PILLS / BADGES
   ═══════════════════════════════════════════ */

.bo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .74rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ecf9f3;
  color: #197a5b;
  border: 1px solid #cbeedc;
  white-space: nowrap;
}

/* Status variants */
.bo-pill-unassigned { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.bo-pill-claimed { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.bo-pill-assigned { background: #ecf9f3; color: #197a5b; border-color: #cbeedc; }
.bo-pill-disabled { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.bo-pill-ready { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; font-weight: 700; }

/* Commerce */
.bo-pill-paid { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.bo-pill-failed { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.bo-pill-refunded { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.bo-pill-progress { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.bo-pill-shipped { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.bo-pill-pending { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.bo-pill-cancelled { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* Plan */
.bo-pill-lite { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.bo-pill-health { background: #ecf9f3; color: #166534; border-color: #cbeedc; }
.bo-pill-trialing { background: #faf5ff; color: #7c3aed; border-color: #e9d5ff; }
.bo-pill-connected { background: #ecf9f3; color: #166534; border-color: #cbeedc; }
.bo-pill-sandbox { background: #fef9c3; color: #854d0e; border-color: #fef08a; }

/* Active / Inactive */
.bo-pill-active { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.bo-pill-inactive { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.bo-pill-warning { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

/* Mode */
.bo-pill-live { background: #ecf9f3; color: #166534; border-color: #cbeedc; }
.bo-pill-test { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ═══════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════ */

.bo-auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--bo-space-lg);
  background: var(--bo-bg);
}

.bo-auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  padding: 28px 24px;
  box-shadow: var(--bo-shadow-lg);
}

.bo-auth-card h1 { font-size: 1.7rem; margin: .2rem 0 .7rem; }
.bo-auth-card p { color: var(--bo-muted); }
.bo-error { color: #b91c1c; font-size: .88rem; margin: 6px 0; }
.bo-auth-alt { margin: 12px 0 0; font-size: .88rem; color: var(--bo-muted); }
.bo-auth-alt a { color: var(--bo-brand-dark); font-weight: 600; }

/* ═══════════════════════════════════════════
   ONBOARDING CARD
   ═══════════════════════════════════════════ */

.bo-onboard-card {
  background: var(--bo-card);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  box-shadow: var(--bo-shadow);
  padding: var(--bo-space-lg);
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.bo-onboard-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ecf9f3;
  color: var(--bo-brand);
  flex-shrink: 0;
}

.bo-onboard-content { flex: 1; min-width: 200px; }
.bo-onboard-content h3 { margin: 0 0 4px; font-size: 1.05rem; }
.bo-onboard-content p { margin: 0; color: var(--bo-muted); font-size: .88rem; }
.bo-onboard-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */

.bo-empty-state {
  background: var(--bo-card);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  box-shadow: var(--bo-shadow);
  padding: 48px var(--bo-space-lg);
  text-align: center;
}

.bo-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #f0f4f8;
  color: #94a3b8;
  margin-bottom: 16px;
}

.bo-empty-state h3 { margin: 0 0 6px; font-size: 1.1rem; }
.bo-empty-state p { margin: 0 0 20px; color: var(--bo-muted); font-size: .9rem; }
.bo-empty-state .bo-submit-btn { display: inline-flex; text-decoration: none; margin-bottom: 10px; }

/* ═══════════════════════════════════════════
   SUCCESS CARD
   ═══════════════════════════════════════════ */

.bo-success-card {
  background: var(--bo-card);
  border: 1px solid #cbeedc;
  border-radius: var(--bo-radius-lg);
  box-shadow: var(--bo-shadow);
  padding: 40px var(--bo-space-lg);
  text-align: center;
}

.bo-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ecf9f3;
  color: var(--bo-brand);
  margin-bottom: 16px;
}

.bo-success-card h2 { margin: 0 0 8px; font-size: 1.4rem; }
.bo-success-card p { margin: 0 0 24px; color: var(--bo-muted); font-size: .92rem; }

.bo-success-details {
  background: #f8fafb;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-sm);
  padding: 14px;
  margin: 0 auto 24px;
  max-width: 360px;
  text-align: left;
}

.bo-success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.bo-success-row + .bo-success-row { border-top: 1px solid var(--bo-line); }
.bo-success-label { color: var(--bo-muted); font-size: .84rem; }
.bo-success-value { font-weight: 600; font-size: .88rem; }

.bo-success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bo-success-actions .bo-submit-btn { display: inline-flex; text-decoration: none; }
.bo-success-actions .bo-btn { display: inline-flex; }

/* ═══════════════════════════════════════════
   ENVIRONMENT BANNER
   ═══════════════════════════════════════════ */

.bo-env-banner {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--bo-radius-sm);
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
}

.bo-env-test { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.bo-env-live { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ═══════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════ */

.bo-flash {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--bo-radius-sm);
  font-size: .88rem;
  font-weight: 600;
}

.bo-flash-success { background: #ecf9f3; color: #166534; border: 1px solid #cbeedc; }
.bo-flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.bo-flash-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ═══════════════════════════════════════════
   STATUS GRID
   ═══════════════════════════════════════════ */

.bo-status-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: var(--bo-card);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  box-shadow: var(--bo-shadow);
  padding: 20px;
}

.bo-status-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.bo-status-label {
  font-size: .74rem;
  color: var(--bo-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ═══════════════════════════════════════════
   TOGGLE / MODE / SECRET
   ═══════════════════════════════════════════ */

.bo-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: .92rem;
}

.bo-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.bo-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bo-toggle-track {
  width: 42px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background .2s ease;
  position: relative;
}

.bo-toggle input:checked + .bo-toggle-track { background: var(--bo-brand); }

.bo-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .2s ease;
}

.bo-toggle input:checked + .bo-toggle-track .bo-toggle-thumb {
  transform: translateX(18px);
}

.bo-mode-selector {
  display: flex;
  gap: 0;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-sm);
  overflow: hidden;
}

.bo-mode-btn {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--bo-card);
  color: var(--bo-muted);
  border: none;
  transition: background .15s ease, color .15s ease;
  font-family: inherit;
}

.bo-mode-btn + .bo-mode-btn { border-left: 1px solid var(--bo-line); }
.bo-mode-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.bo-mode-btn.is-active { background: var(--bo-brand); color: #fff; }
.bo-mode-btn:hover:not(.is-active) { background: #f1f5f9; }

.bo-secret-field {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bo-secret-field .bo-input { flex: 1; }

.bo-secret-toggle,
.bo-secret-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--bo-line);
  background: var(--bo-card);
  color: var(--bo-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s ease;
}

.bo-secret-toggle:hover,
.bo-secret-copy:hover {
  border-color: #9ca3af;
  color: var(--bo-ink);
}

/* ═══════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════ */

.bo-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 14px;
}

.bo-filters select,
.bo-filters input {
  font-size: .88rem;
  padding: 8px 12px;
  border: 1px solid var(--bo-line);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
}

.bo-filters .bo-btn { padding: 8px 14px; font-size: .88rem; }

/* ═══════════════════════════════════════════
   LINKS
   ═══════════════════════════════════════════ */

.bo-link-subtle {
  display: inline-block;
  color: var(--bo-muted);
  font-size: .85rem;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}

.bo-link-subtle:hover { color: var(--bo-ink); }

.bo-url-cell {
  font-size: .78rem;
  color: var(--bo-muted);
  word-break: break-all;
  max-width: 260px;
  display: inline-block;
}

.bo-copy-btn { cursor: pointer; font: inherit; }

/* ═══════════════════════════════════════════
   DASHBOARD — Plan Card
   ═══════════════════════════════════════════ */

.bo-plan-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--bo-radius-lg);
  padding: var(--bo-space-lg);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.bo-plan-card::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  top: -60px;
  right: -60px;
  background: radial-gradient(circle, rgba(25,195,125,.2), transparent 70%);
  pointer-events: none;
}

.bo-plan-card h3 {
  margin: 0 0 4px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}

.bo-plan-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
}

.bo-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 6px;
}

.bo-plan-features li {
  font-size: .84rem;
  color: var(--bo-card-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bo-plan-card .bo-plan-features li {
  color: var(--bo-dark-card-text);
}

.bo-plan-features li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bo-brand);
  flex-shrink: 0;
}

.bo-plan-card .bo-submit-btn {
  background: var(--bo-brand);
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   DASHBOARD — Activity Timeline
   ═══════════════════════════════════════════ */

.bo-activity-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 0;
}

.bo-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bo-line);
  font-size: .88rem;
}

.bo-activity-item:last-child { border-bottom: none; }

.bo-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bo-brand);
  flex-shrink: 0;
  margin-top: 6px;
}

.bo-activity-dot.blue { background: #3b82f6; }
.bo-activity-dot.amber { background: #f59e0b; }
.bo-activity-dot.gray { background: #94a3b8; }

.bo-activity-text { flex: 1; color: #334155; }
.bo-activity-time { font-size: .78rem; color: var(--bo-muted); white-space: nowrap; }

/* ═══════════════════════════════════════════
   DASHBOARD — Action Cards
   ═══════════════════════════════════════════ */

.bo-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--bo-space-md);
}

.bo-action-card {
  background: var(--bo-card);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-radius-lg);
  padding: 20px;
  box-shadow: var(--bo-shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  color: var(--bo-ink);
  transition: transform .15s, box-shadow .15s;
}

.bo-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bo-shadow-lg);
}

.bo-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.bo-action-icon.green { background: var(--bo-brand); }
.bo-action-icon.blue { background: #3b82f6; }
.bo-action-icon.amber { background: #f59e0b; }
.bo-action-icon.purple { background: #8b5cf6; }

.bo-action-card h4 { margin: 0 0 2px; font-size: .92rem; }
.bo-action-card p { margin: 0; font-size: .82rem; color: var(--bo-muted); }

/* ═══════════════════════════════════════════
   RESPONSIVE — Tablet (max-width: 980px)
   ═══════════════════════════════════════════ */

@media (max-width: 980px) {
  .bo-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Mobile header — visible; extends behind notch with white bg */
  .bo-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top, 0px) 16px 0 16px;
    height: calc(var(--bo-mobile-header-h) + env(safe-area-inset-top, 0px));
    background: var(--bo-card);
    border-bottom: 1px solid var(--bo-line);
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .bo-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bo-radius-sm);
    border: 1px solid var(--bo-line);
    background: var(--bo-card);
    color: var(--bo-ink);
    cursor: pointer;
    transition: background .15s;
  }
  .bo-menu-btn:hover { background: #f1f5f9; }

  .bo-mobile-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
  }

  .bo-mobile-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--bo-radius-sm);
    color: var(--bo-muted);
    text-decoration: none;
    transition: color .15s;
  }
  .bo-mobile-action:hover { color: var(--bo-ink); }

  /* Sidebar becomes drawer */
  .bo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--bo-transition);
    z-index: 900;
    border-right: 1px solid rgba(255,255,255,.08);
  }

  .bo-sidebar.is-open {
    transform: translateX(0);
  }

  .bo-close-btn { display: flex; }

  .bo-drawer-backdrop {
    display: block;
    pointer-events: none;
  }

  .bo-drawer-backdrop.is-open {
    pointer-events: auto;
  }

  /* Hide desktop topbar on mobile */
  .bo-topbar { display: none; }

  /* Main content adjustments */
  .bo-main {
    padding: var(--bo-space-md) var(--bo-space-md) var(--bo-space-xl);
  }

  /* Grid stacking */
  .bo-grid.kpi { grid-template-columns: repeat(2, 1fr); }
  .bo-grid.two, .bo-grid.three { grid-template-columns: 1fr; }

  .bo-onboard-card { flex-direction: column; align-items: stretch; }
  .bo-status-grid { grid-template-columns: repeat(2, 1fr); }
  .bo-status-item:last-child { grid-column: 1 / -1; }

  .bo-action-grid { grid-template-columns: 1fr; }

  /* Page header stacks */
  .bo-page-header { flex-direction: column; gap: var(--bo-space-sm); }
  .bo-page-header-actions { width: 100%; }

  /* Forms larger touch targets */
  .bo-input { padding: 12px 14px; min-height: 44px; }
  .bo-btn { padding: 10px 16px; min-height: 44px; }
  .bo-submit-btn { padding: 14px 20px; width: 100%; justify-content: center; }

  /* Filters stack */
  .bo-filters { flex-direction: column; }
  .bo-filters select,
  .bo-filters input { width: 100%; min-height: 44px; }

  /* Sticky save bar */
  .bo-sticky-actions {
    position: sticky;
    bottom: 0;
    background: var(--bo-card);
    border-top: 1px solid var(--bo-line);
    padding: 12px 16px;
    margin: 24px -16px -24px;
    z-index: 20;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Small phone (max-width: 560px)
   ═══════════════════════════════════════════ */

@media (max-width: 560px) {
  .bo-grid.kpi { grid-template-columns: 1fr; }
  .bo-status-grid { grid-template-columns: 1fr; }
  .bo-status-item:last-child { grid-column: auto; }

  .bo-card { padding: 16px; overflow-x: hidden; }
  .bo-main { padding: var(--bo-space-sm) var(--bo-space-sm) var(--bo-space-lg); }
  .bo-page-header-info h2 { font-size: 1.15rem; }
  .bo-page-header-info p { font-size: .82rem; }
  .bo-action-grid { gap: var(--bo-space-sm); }

  .bo-onboard-actions { flex-direction: column; }
  .bo-onboard-actions .bo-submit-btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Wide desktop
   ═══════════════════════════════════════════ */

@media (min-width: 1440px) {
  .bo-main { padding: var(--bo-space-xl) 48px 48px; }
}

/* ═══════════════════════════════════════════
   Shared pet avatar component
   ═══════════════════════════════════════════ */

.pet-avatar {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #fff8eb, #dfaf7e 46%, #74513f);
}

.pet-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pet-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #64748b, #475569);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: .9rem;
}

.pet-avatar--xs { width: 32px; height: 32px; }
.pet-avatar--xs .pet-avatar-fallback { font-size: .68rem; }
.pet-avatar--sm { width: 42px; height: 42px; }
.pet-avatar--sm .pet-avatar-fallback { font-size: .76rem; }
.pet-avatar--md { width: 56px; height: 56px; }
.pet-avatar--md .pet-avatar-fallback { font-size: .95rem; }
.pet-avatar--lg { width: 72px; height: 72px; }
.pet-avatar--lg .pet-avatar-fallback { font-size: 1.2rem; }

/* ═══════════════════════════════════════════
   Cancellation confirmation modal
   ═══════════════════════════════════════════ */

.cancel-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cancel-modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cancel-modal {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(15, 23, 42, 0.08);
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s ease;
}

.cancel-modal-backdrop.is-visible .cancel-modal {
  transform: translateY(0) scale(1);
}

.cancel-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.cancel-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.cancel-modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #0f172a;
}

.cancel-modal-header p {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

.cancel-modal-date {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.84rem;
  color: #475569;
  margin-bottom: 20px;
}

.cancel-modal-date svg {
  flex-shrink: 0;
  color: #64748b;
}

.cancel-modal-date strong {
  color: #0f172a;
}

.cancel-modal-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.cancel-modal-list h4 {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.cancel-modal-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.cancel-modal-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.3;
}

.cancel-modal-list li svg {
  flex-shrink: 0;
}

.cancel-modal-list--lose {
  padding: 14px;
  background: #fef2f2;
  border-radius: 12px;
  border: 1px solid #fecaca;
}

.cancel-modal-list--lose h4 {
  color: #991b1b;
}

.cancel-modal-list--lose li svg {
  color: #dc2626;
}

.cancel-modal-list--keep {
  padding: 14px;
  background: #f0fdf4;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.cancel-modal-list--keep h4 {
  color: #166534;
}

.cancel-modal-list--keep li svg {
  color: #16a34a;
}

.cancel-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cancel-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: none;
  width: 100%;
  min-height: 48px;
}

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

.cancel-modal-btn--keep {
  background: #0f172a;
  color: #fff;
}

.cancel-modal-btn--keep:hover {
  background: #1e293b;
}

.cancel-modal-btn--cancel {
  background: transparent;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.cancel-modal-btn--cancel:hover {
  background: #fef2f2;
}

.cancel-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .cancel-modal {
    padding: 20px;
    border-radius: 16px;
  }

  .cancel-modal-lists {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cancel-modal-header h3 {
    font-size: 1.1rem;
  }

  .cancel-modal-list li {
    font-size: 0.82rem;
  }

  .cancel-modal-btn {
    padding: 14px 16px;
    font-size: 0.88rem;
  }
}
