/* ═══════════════════════════════════════════════════════════
   LABYRINTH BJJ — CRM STYLES
   Dark theme: #0A0A0A | Gold accent: #C8A24C
   Fonts: Clash Display (headings) + General Sans (body)
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --surface-2: #161616;
  --surface-3: #1A1A1A;
  --border: #222222;
  --border-hover: #333333;
  --gold: #C8A24C;
  --gold-dim: #9E7D33;
  --gold-glow: rgba(200, 162, 76, 0.15);
  --gold-glow-strong: rgba(200, 162, 76, 0.25);
  --text: #E8E8E8;
  --text-muted: #888888;
  --text-faint: #555555;
  --success: #34D399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --error: #F87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --warning: #FBBF24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --info: #60A5FA;
  --info-bg: rgba(96, 165, 250, 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'General Sans', 'Inter', -apple-system, sans-serif;
  --sidebar-width: 240px;
  --header-height: 56px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #DDB655; }

::selection {
  background: var(--gold-glow-strong);
  color: var(--text);
}

/* ── LOGIN ────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  margin-bottom: 24px;
  opacity: 0.9;
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.login-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 12px;
}

/* ── FORMS ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--text-faint);
}

select {
  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='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: #0A0A0A;
}
.btn-primary:hover {
  background: #DDB655;
  box-shadow: 0 0 20px var(--gold-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover {
  background: rgba(248,113,113,0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── APP SHELL ────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-item.active {
  color: var(--gold);
  background: var(--gold-glow);
}

.nav-item.active svg { stroke: var(--gold); }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.logout-btn:hover {
  color: var(--error) !important;
}

/* ── MOBILE HEADER ────────────────────────────────────── */
.mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.mobile-brand {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ── MAIN CONTENT ─────────────────────────────────────── */
.main-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

/* ── PAGE HEADER ──────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

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

/* ── CARDS ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── STAT CARDS ───────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-value.gold { color: var(--gold); }

.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--error); }

/* ── TABLES ───────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: var(--surface-2);
}

/* ── BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success);
}

.badge-trial {
  background: var(--info-bg);
  color: var(--info);
}

.badge-paused {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-cancelled, .badge-failed {
  background: var(--error-bg);
  color: var(--error);
}

.badge-frozen {
  background: rgba(147,197,253,0.1);
  color: #93C5FD;
}

/* ── SEARCH BAR ───────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input input {
  padding-left: 40px;
}

.search-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.filter-select {
  min-width: 140px;
}

/* ── FEED LIST ────────────────────────────────────────── */
.feed-list {
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.feed-icon.payment { background: var(--success-bg); color: var(--success); }
.feed-icon.booking { background: var(--info-bg); color: var(--info); }
.feed-icon.failed { background: var(--error-bg); color: var(--error); }

.feed-info {
  flex: 1;
  min-width: 0;
}

.feed-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.feed-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.feed-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.feed-date {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ── DASHBOARD GRID ───────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── EMAIL / SMS COMPOSER ─────────────────────────────── */
.composer {
  max-width: 720px;
}

.composer-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.toolbar-btn {
  padding: 6px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  transition: all var(--transition);
}

.toolbar-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

.composer-body {
  min-height: 200px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

.composer-body:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.char-counter {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.char-counter.warn { color: var(--warning); }
.char-counter.over { color: var(--error); }

/* ── RECIPIENT PICKER ─────────────────────────────────── */
.recipient-options {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.recipient-chip {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.recipient-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.recipient-chip.selected {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── SETTINGS ─────────────────────────────────────────── */
.settings-section {
  margin-bottom: 32px;
}

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

.api-key-field {
  position: relative;
}

.api-key-field .status-dot {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--error); }

.plan-row {
  display: grid;
  grid-template-columns: 1fr 100px 120px 40px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

/* ── TOAST ────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideIn 200ms ease-out;
  max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── MODAL ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── LOADING SPINNER ──────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 14px;
}

/* ── SKELETON ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
  }

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

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }

  .plan-row {
    grid-template-columns: 1fr 80px 80px 40px;
    font-size: 12px;
  }
}

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

/* ══════════════════════════════════════════════════════════
   NEW UX — Checkout Modal, Member Enhancements, etc.
   ══════════════════════════════════════════════════════════ */

/* ── SEGMENTED TAB SWITCHER ───────────────────────────── */
.tab-switcher {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 3px);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

.tab-btn.active {
  background: var(--surface-3);
  color: var(--gold);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── MEMBER TYPEAHEAD SEARCH ──────────────────────────── */
.member-search-wrap {
  position: relative;
}

.member-search-wrap input {
  width: 100%;
}

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}

.typeahead-dropdown.open {
  display: block;
}

.typeahead-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

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

.typeahead-item:hover,
.typeahead-item.focused {
  background: var(--surface-3);
}

.typeahead-item-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.typeahead-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── SELECTED MEMBER CARD ─────────────────────────────── */
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gold-glow);
  border: 1px solid rgba(200,162,76,0.3);
  border-radius: var(--radius);
  margin-top: 10px;
}

.member-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-glow-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.member-card-info {
  flex: 1;
  min-width: 0;
}

.member-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.member-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.member-card-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.member-card-clear:hover { color: var(--error); }

/* ── CHECKOUT LINK RESULT ─────────────────────────────── */
.checkout-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.checkout-result-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.checkout-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.checkout-link-row input {
  flex: 1;
  font-size: 12px;
  font-family: monospace;
  background: var(--surface-3);
}

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

.btn-send-email {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(96,165,250,0.2);
}
.btn-send-email:hover {
  background: rgba(96,165,250,0.15);
}

.btn-send-sms {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(52,211,153,0.2);
}
.btn-send-sms:hover {
  background: rgba(52,211,153,0.15);
}

/* ── BELT COLOR DOT ───────────────────────────────────── */
.belt-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
  vertical-align: middle;
  margin-right: 4px;
}

/* ── TYPE BADGE ───────────────────────────────────────── */
.badge-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-left: 4px;
  vertical-align: middle;
}

.badge-type-adult {
  background: rgba(200,162,76,0.1);
  color: var(--gold-dim);
}

.badge-type-kid {
  background: rgba(96,165,250,0.1);
  color: var(--info);
}

/* ── STAT BREAKDOWN ───────────────────────────────────── */
.stat-breakdown {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.stat-breakdown-item {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-breakdown-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.stat-breakdown-item.adult .dot { background: var(--gold-dim); }
.stat-breakdown-item.kid .dot { background: var(--info); }

/* ── CONFIRMATION DIALOG ──────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  animation: fadeIn 150ms ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: slideUp 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--warning-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── RECURRING TOGGLE ─────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.toggle-label {
  font-size: 13px;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition), background var(--transition);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--gold-glow-strong);
  border: 1px solid var(--gold-dim);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--gold);
}

/* ── UTILITY ──────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.font-mono { font-variant-numeric: tabular-nums lining-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════
   UNIFIED PAYMENT FLOW — POS-style modal
   ══════════════════════════════════════════════════════════ */

/* ── Payment Modal (wider) ────────────────────────────── */
.modal.payment-modal {
  max-width: 640px;
}

/* ── Flow Section ─────────────────────────────────────── */
.pay-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.pay-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pay-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.pay-section-label .pay-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.pay-section.active .pay-step-num {
  background: var(--gold-glow);
  border-color: var(--gold-dim);
  color: var(--gold);
}

/* ── Manual entry toggle ──────────────────────────────── */
.manual-entry-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 8px;
  transition: color var(--transition);
}

.manual-entry-link:hover {
  color: var(--gold);
}

.manual-entry-fields {
  display: none;
  margin-top: 12px;
}

.manual-entry-fields.visible {
  display: block;
  animation: fadeIn 150ms ease-out;
}

/* ── Plan Selector Cards ──────────────────────────────── */
.plan-type-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.plan-type-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-3);
}

.plan-type-card.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.plan-type-card .plan-type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.plan-type-card.selected .plan-type-icon {
  background: var(--gold-glow-strong);
  color: var(--gold);
}

.plan-type-card .plan-type-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.plan-type-card .plan-type-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Plan Selector Expandable ─────────────────────────── */
.plan-expand-area {
  display: none;
  margin-top: 12px;
  animation: fadeIn 150ms ease-out;
}

.plan-expand-area.visible {
  display: block;
}

/* ── Selected plan display ────────────────────────────── */
.selected-plan-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.selected-plan-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.selected-plan-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ── Tax Row ──────────────────────────────────────────── */
.tax-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.tax-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tax-rate-display {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Amount Breakdown ─────────────────────────────────── */
.amount-breakdown {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: none;
}

.amount-breakdown.visible {
  display: block;
  animation: fadeIn 150ms ease-out;
}

.amount-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.amount-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

/* ── Summary Bar (sticky bottom) ──────────────────────── */
.pay-summary {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pay-summary-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pay-summary-who {
  font-size: 13px;
  color: var(--text-muted);
}

.pay-summary-who strong {
  color: var(--text);
}

.pay-summary-total {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.pay-summary-actions {
  display: flex;
  gap: 8px;
}

.pay-summary-actions .btn {
  flex: 1;
}

.btn-cash {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}

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

/* ── Cash payment confirmation ────────────────────────── */
.cash-logged-confirm {
  text-align: center;
  padding: 24px;
}

.cash-logged-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--success);
}

.cash-logged-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.cash-logged-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Payment method select cards ──────────────────────── */
.payment-method-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.payment-method-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.payment-method-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.payment-method-chip.selected {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Responsive adjustments for payment modal ─────────── */
@media (max-width: 480px) {
  .plan-type-cards {
    grid-template-columns: 1fr;
  }

  .pay-summary-actions {
    flex-direction: column;
  }

  .pay-summary-info {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════
   EMBEDDED CHECKOUT + CARD ON FILE + TOAST WARNING
   ══════════════════════════════════════════════════════════ */

/* ── Stripe Embedded Checkout Container ──────────────── */
#stripeEmbedContainer {
  padding: 0;
}

.embed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.embed-header-info {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
  text-align: right;
}

.embed-header-info strong {
  color: var(--text);
}

.stripe-embed-mount {
  min-height: 400px;
  background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stripe-embed-mount iframe {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── "Generate Link" outline/secondary button ────────── */
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-2);
}

/* ── "Charge Card on File" button ────────────────────── */
.btn-charge-card {
  background: rgba(96, 165, 250, 0.08);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.2);
  flex: 1;
}

.btn-charge-card:hover {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.35);
}

/* ── Payment Success State ───────────────────────────── */
.payment-success {
  text-align: center;
  padding: 32px 24px;
}

.payment-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--success);
  animation: scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.payment-success-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.payment-success-detail {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Warning Toast ───────────────────────────────────── */
.toast.warning {
  border-left: 3px solid var(--warning);
}

/* ── Responsive: 3-button layout ─────────────────────── */
@media (max-width: 480px) {
  .pay-summary-actions {
    flex-direction: column;
  }

  .pay-summary-actions .btn {
    flex: none;
    width: 100%;
  }

  .embed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .embed-header-info {
    text-align: left;
  }
}
