/* ═══════════════════════════════════════════════════════════
   LABYRINTH BJJ — CRM STYLES (Premium Overhaul)
   Dark theme: #09090B | Gold accent: #C8A24C
   Fonts: General Sans (headings) + Inter (body)
   Apple/Linear quality — glassmorphism, spring physics, depth
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg: #09090B;
  --surface: #0F0F12;
  --surface-2: #141418;
  --surface-3: #1A1A1E;
  --border: #1F1F23;
  --border-hover: #2A2A30;
  --gold: #C8A24C;
  --gold-dim: #9E7D33;
  --gold-glow: rgba(200, 162, 76, 0.12);
  --gold-glow-strong: rgba(200, 162, 76, 0.22);
  --text: #EAEAEA;
  --text-muted: #8A8A94;
  --text-faint: #6A6A74;
  --success: #34D399;
  --success-bg: rgba(52, 211, 153, 0.08);
  --error: #F87171;
  --error-bg: rgba(248, 113, 113, 0.08);
  --warning: #FBBF24;
  --warning-bg: rgba(251, 191, 36, 0.08);
  --info: #60A5FA;
  --info-bg: rgba(96, 165, 250, 0.08);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'General Sans', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', 'General Sans', -apple-system, sans-serif;
  --sidebar-width: 240px;
  --header-height: 56px;

  /* Layered shadow tokens */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.24), 0 0 0 1px rgba(255,255,255,0.03) inset;
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.32), 0 0 0 1px rgba(200,162,76,0.1);
  --shadow-elevated: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04) inset;
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

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;
  font-feature-settings: 'cv11', 'ss01';
  font-variant-numeric: tabular-nums;
}

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

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

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ── LOGIN ────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
  background-image: radial-gradient(ellipse 600px 400px at 50% 40%, rgba(200,162,76,0.04) 0%, transparent 70%);
}

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

.login-logo {
  margin-bottom: 28px;
  opacity: 0.9;
  filter: drop-shadow(0 0 24px rgba(200,162,76,0.15));
}

.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: 36px;
  font-weight: 500;
}

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

/* ── 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-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 200ms var(--smooth), box-shadow 200ms var(--smooth);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(200,162,76,0.3);
}

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='%236A6A74' 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: background 200ms var(--smooth), color 200ms var(--smooth), transform 200ms var(--smooth), box-shadow 200ms var(--smooth);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--gold);
  color: #0A0A0A;
}
.btn-primary:hover {
  background: #DDB655;
  box-shadow: 0 4px 16px rgba(200,162,76,0.3);
  transform: translateY(-1px);
}

.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.15);
}
.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;
  transform: none;
}

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

/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  background: rgba(15, 15, 18, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  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);
  position: relative;
}

.sidebar-header::after {
  content: '';
  position: absolute;
  left: 16px;
  bottom: -1px;
  width: 32px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  opacity: 0.3;
}

.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: color 200ms var(--smooth), background 200ms var(--smooth);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: var(--gold);
  background: var(--gold-glow);
  box-shadow: inset 0 0 0 1px rgba(200,162,76,0.12);
}

.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: rgba(15, 15, 18, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  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);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  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);
  letter-spacing: -0.2px;
}

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

/* ── CARDS ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 250ms var(--smooth), transform 250ms var(--smooth);
}

.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: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 250ms var(--smooth), transform 250ms var(--smooth);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  pointer-events: none;
}

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

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

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

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

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

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

/* ── TABLES ───────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

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: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

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

tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ── 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.08);
  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 rgba(31,31,35,0.5);
  transition: background 150ms var(--smooth);
}

.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: 6px;
  font-size: 13px;
  transition: color 150ms var(--smooth), background 150ms var(--smooth);
}

.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 2px var(--bg), 0 0 0 4px rgba(200,162,76,0.3);
}

.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: border-color 200ms var(--smooth), color 200ms var(--smooth), background 200ms var(--smooth);
  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); box-shadow: 0 0 6px rgba(52,211,153,0.4); }
.status-dot.disconnected { background: var(--error); box-shadow: 0 0 6px rgba(248,113,113,0.4); }

.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: rgba(20, 20, 24, 0.9);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-elevated);
  animation: toastSpring 400ms var(--spring);
  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 toastSpring {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Keep original name for JS compatibility */
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── MODAL ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeOverlay 200ms var(--smooth);
}

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

.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;
  box-shadow: var(--shadow-modal);
  animation: modalEntrance 300ms var(--spring);
}

@keyframes modalEntrance {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.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;
  letter-spacing: -0.2px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 150ms var(--smooth), background 150ms var(--smooth);
}

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

.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 rgba(31,31,35,0.5);
  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: 32px;
  color: var(--text-faint);
  font-size: 13px;
}

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

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

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

/* ── SKELETON ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, rgba(200,162,76,0.04) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s 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: color 200ms var(--smooth), background 200ms var(--smooth), box-shadow 200ms var(--smooth);
  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 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

.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: var(--shadow-elevated);
  display: none;
}

.typeahead-dropdown.open {
  display: block;
  animation: modalEntrance 150ms var(--smooth);
}

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

.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.2);
  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 150ms var(--smooth);
  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.15);
}
.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.15);
}
.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.08);
  color: var(--gold-dim);
}

.badge-type-kid {
  background: rgba(96,165,250,0.08);
  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.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  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: var(--shadow-modal);
  animation: modalEntrance 250ms var(--spring);
}

@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;
  letter-spacing: -0.2px;
}

.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 200ms var(--smooth);
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 250ms var(--spring), background 200ms var(--smooth);
}

.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 150ms var(--smooth);
}

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

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

.manual-entry-fields.visible {
  display: block;
  animation: fadeSlideIn 200ms var(--smooth);
}

/* ── 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: border-color 200ms var(--smooth), background 200ms var(--smooth), transform 200ms var(--smooth), box-shadow 200ms var(--smooth);
  text-align: center;
}

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

.plan-type-card.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
  box-shadow: 0 0 16px rgba(200,162,76,0.1);
}

.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: background 200ms var(--smooth), color 200ms var(--smooth);
}

.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: fadeSlideIn 200ms var(--smooth);
}

.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: fadeSlideIn 200ms var(--smooth);
}

.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: border-color 200ms var(--smooth), color 200ms var(--smooth), background 200ms var(--smooth);
  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.06);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.15);
  flex: 1;
}

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

/* ── 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 var(--spring);
}

@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);
}

/* ══════════════════════════════════════════════════════════
   FEATURE 1 — CARD STATUS INDICATOR
   ══════════════════════════════════════════════════════════ */

.card-status {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.card-status.has-card {
  color: #22c55e;
}

.card-status.no-card {
  color: #6A6A74;
}

/* ══════════════════════════════════════════════════════════
   FEATURE 2 — FAMILY GROUPING
   ══════════════════════════════════════════════════════════ */

.family-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-left: 5px;
  vertical-align: middle;
  background: rgba(200, 162, 76, 0.06);
  border: 1px solid rgba(200, 162, 76, 0.15);
  color: var(--gold-dim);
  cursor: pointer;
  transition: background 200ms var(--smooth), border-color 200ms var(--smooth), color 200ms var(--smooth);
  white-space: nowrap;
}

.family-badge:hover {
  background: rgba(200, 162, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

/* ══════════════════════════════════════════════════════════
   FEATURE 3 — UPCOMING TRIALS / TRIAL CARDS
   ══════════════════════════════════════════════════════════ */

.trial-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(31,31,35,0.5);
}

.trial-card:last-child {
  border-bottom: none;
}

.trial-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 8px 6px;
  background: rgba(200, 162, 76, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(200, 162, 76, 0.12);
  flex-shrink: 0;
}

.trial-day {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 2px;
}

.trial-date-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.trial-month {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
}

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

.trial-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trial-class {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trial-contact {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Trial card — soon/today/tomorrow highlighting */
.trial-card.trial-soon {
  border-left: 2px solid var(--gold);
  padding-left: 12px;
}

.trial-date-block.trial-today {
  background: rgba(200, 162, 76, 0.15);
  border-color: var(--gold);
}

.trial-date-block.trial-tomorrow {
  background: rgba(200, 162, 76, 0.08);
}

/* Trial card actions column */
.trial-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.trial-quick-actions {
  display: flex;
  gap: 4px;
}

.trial-action-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  transition: background 150ms var(--smooth), color 150ms var(--smooth);
  padding: 0;
  line-height: 1;
}

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

.trial-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 24px;
  color: var(--text-faint);
  text-align: center;
}

.trial-empty svg {
  opacity: 0.2;
}

.trial-empty p {
  font-size: 13px;
}

/* Trial card — new redesigned elements */
.trial-name-link {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 150ms var(--smooth);
}

.trial-name-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

.trial-details {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.trial-class-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.trial-time {
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
  font-weight: 500;
}

.trial-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.trial-phone,
.trial-email {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

@media (max-width: 480px) {
  .trial-contact-row {
    display: none;
  }
  .trial-contact {
    display: none;
  }
}

/* ── 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;
  }
}

/* ══════════════════════════════════════════════════════════
   MEMBER PROFILE VIEW
   ══════════════════════════════════════════════════════════ */

/* Clickable member name in table */
.member-name-link {
  color: var(--text);
  text-decoration: none;
  transition: color 150ms var(--smooth);
}
.member-name-link:hover {
  color: var(--gold);
  text-decoration: none;
}

/* Profile page container */
.profile-container {
  padding: 0;
  max-width: 900px;
}

/* Top bar: back link + action buttons */
.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.profile-topbar-actions {
  display: flex;
  gap: 8px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 150ms var(--smooth);
}
.back-link:hover {
  color: var(--gold);
}

/* Profile header card */
.profile-header {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.profile-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.profile-belt-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}

.profile-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.2;
}

.profile-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  margin-left: 26px;
}

/* Info grid */
.profile-info-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 26px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.profile-info-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* Card info display */
.profile-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

/* Quick action buttons row */
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.profile-actions .btn {
  font-size: 12px;
  padding: 6px 14px;
}

/* Payment history section */
.profile-payments {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

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

/* Refund button */
.refund-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--error);
  background: transparent;
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms var(--smooth), color 150ms var(--smooth);
  white-space: nowrap;
}
.refund-btn:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* Receipt link */
.receipt-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 150ms var(--smooth), border-color 150ms var(--smooth);
  white-space: nowrap;
}
.receipt-link:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* Badge for refunded status */
.badge-refunded {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(251,191,36,0.15);
}

/* btn-error for confirm dialogs */
.btn-error {
  background: var(--error);
  color: #fff;
  border: none;
}
.btn-error:hover {
  background: #ef4444;
}

/* Responsive: mobile profile adjustments */
@media (max-width: 600px) {
  .profile-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .profile-sub,
  .profile-info-grid {
    margin-left: 0;
  }
  .profile-actions {
    gap: 6px;
  }
}

/* ── Communication History ─────────────────────────────── */
.comm-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31,31,35,0.5);
}

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

.comm-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 14px;
  flex-shrink: 0;
}

.comm-icon.comm-email {
  background: rgba(200, 162, 76, 0.08);
}

.comm-icon.comm-sms {
  background: rgba(100, 180, 120, 0.08);
}

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

.comm-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-preview {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-meta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ── WAIVER SYSTEM ──────────────────────────────────────── */

/* Wider modal for waiver */
.waiver-modal {
  max-width: 700px;
  width: 95%;
}

/* Waiver legal text block */
.waiver-text {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 16px;
  white-space: pre-line;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.waiver-text::-webkit-scrollbar { width: 5px; }
.waiver-text::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Signer info fields — horizontal row */
.waiver-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.waiver-fields .form-group {
  margin-bottom: 0;
}

/* Signature canvas container */
.waiver-canvas-wrap {
  margin-bottom: 16px;
}

/* The canvas itself */
.waiver-canvas {
  display: block;
  width: 100%;
  height: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
}
.waiver-canvas:hover {
  border-color: var(--gold-dim);
}

/* Clear button above canvas */
.waiver-clear-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 150ms var(--smooth), color 150ms var(--smooth);
}
.waiver-clear-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

/* "I Agree & Sign" button — gold, prominent */
.waiver-agree-btn {
  background: var(--gold);
  color: #000;
  font-weight: 700;
  border: none;
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: opacity 150ms var(--smooth), box-shadow 200ms var(--smooth);
}
.waiver-agree-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.waiver-agree-btn:not(:disabled):hover {
  opacity: 0.9;
  box-shadow: 0 4px 16px rgba(200,162,76,0.25);
}

/* Waiver status badges — used in profiles and inline */
.waiver-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
}
.waiver-signed {
  color: var(--success);
  background: var(--success-bg);
}
.waiver-unsigned {
  color: var(--warning);
  background: var(--warning-bg);
}

/* Inline waiver status bar inside modals */
.waiver-status-inline {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  font-size: 13px;
}

/* Profile waiver row — flex so buttons align right */
#profileWaiverStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — PAYMENT PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */
.payment-progress-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.payment-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.payment-bar-container { padding: 0 4px; }
.payment-bar { 
  height: 24px; 
  background: var(--surface-2); 
  border-radius: 12px; 
  overflow: hidden; 
  display: flex;
  margin: 16px 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.payment-bar-collected { 
  background: linear-gradient(90deg, #22c55e, #16a34a); 
  border-radius: 12px 0 0 12px;
  transition: width 0.8s var(--smooth);
  min-width: 0;
}
.payment-bar-overdue { 
  background: linear-gradient(90deg, #ef4444, #dc2626);
  transition: width 0.8s var(--smooth);
  min-width: 0;
}

.payment-bar-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.payment-bar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.payment-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-bar-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.payment-bar-value.gold { color: var(--gold); }
.payment-bar-value.green { color: var(--success); }
.payment-bar-value.red { color: var(--error); }

.stats-grid-compact {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — OVERDUE PAYMENTS
   ═══════════════════════════════════════════════════════════ */
.overdue-card {
  border-color: rgba(248, 113, 113, 0.15) !important;
  background: var(--surface) !important;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(248,113,113,0.08) !important;
}

.overdue-card .card-header {
  border-bottom: 1px solid rgba(248, 113, 113, 0.1);
}

.overdue-card .card-title {
  color: var(--error);
}

.overdue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--error);
  color: #000;
  font-size: 11px;
  font-weight: 700;
}

.overdue-list {
  padding: 8px 16px;
}

.overdue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31,31,35,0.5);
}

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

.overdue-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.overdue-info .member-name-link {
  font-weight: 600;
  font-size: 14px;
}

.overdue-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overdue-amount-block {
  text-align: right;
  flex-shrink: 0;
}

.overdue-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--error);
  background: rgba(248, 113, 113, 0.06);
  padding: 2px 10px;
  border-radius: 12px;
}

.overdue-date {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   POINT OF SALE
   ═══════════════════════════════════════════════════════════ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

/* ── Left: Product Catalog ── */
.pos-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pos-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 200ms var(--smooth), color 200ms var(--smooth), background 200ms var(--smooth);
  font-family: var(--font-body);
}

.pos-tab:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.pos-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 600;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pos-product-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: transform 250ms var(--smooth), box-shadow 250ms var(--smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.pos-product-image {
  width: 100%;
  height: 120px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-2);
  flex-shrink: 0;
}

.pos-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pos-product-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.pos-product-card.in-cart {
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-card);
}

.pos-product-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.pos-product-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.pos-product-cat {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pos-product-qty {
  font-size: 11px;
  color: var(--gold);
  margin-top: 4px;
  font-weight: 600;
}

.pos-add-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(15,15,18,0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms var(--smooth), color 200ms var(--smooth), border-color 200ms var(--smooth);
}

.pos-add-btn:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* ── Right: Cart Sidebar ── */
.pos-cart {
  position: sticky;
  top: 0;
}

.pos-cart-inner {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.pos-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.pos-cart-title {
  font-weight: 700;
  font-size: 14px;
}

.pos-cart-clear {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 150ms var(--smooth);
}

.pos-cart-clear:hover {
  color: var(--error);
}

.pos-cart-items {
  padding: 8px 16px;
  max-height: 260px;
  overflow-y: auto;
}

.pos-cart-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.pos-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(31,31,35,0.5);
}

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

.pos-cart-item-info {
  flex: 1;
  min-width: 0;
}

.pos-cart-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-cart-item-price {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'General Sans', monospace;
}

.pos-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.pos-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pos-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms var(--smooth), color 150ms var(--smooth);
  font-family: var(--font-body);
}

.pos-qty-btn:hover {
  background: var(--surface-3);
  color: var(--gold);
}

.pos-qty-num {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
}

.pos-remove-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 150ms var(--smooth);
}

.pos-remove-btn:hover {
  color: var(--error);
}

/* ── Cart Totals ── */
.pos-totals {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.pos-tax-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.toggle-sm .toggle-track {
  width: 34px !important;
  height: 18px !important;
}

.toggle-sm .toggle-track::before {
  width: 14px !important;
  height: 14px !important;
}

.toggle-sm input:checked + .toggle-track::before {
  transform: translateX(16px) !important;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  padding: 3px 0;
}

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

/* ── Customer Selection ── */
.pos-customer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

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

.pos-customer-search {
  position: relative;
  margin-bottom: 8px;
}

.pos-customer-search input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.pos-customer-search input:focus {
  outline: none;
  border-color: var(--gold);
}

.pos-walkin-field input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.pos-walkin-field input:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.pos-selected-customer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gold-glow);
  border: 1px solid rgba(200,162,76,0.15);
  border-radius: var(--radius-sm);
}

.pos-cust-name {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}

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

.pos-cust-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  transition: color 150ms var(--smooth);
}

.pos-cust-clear:hover {
  color: var(--error);
}

/* ── Cart Actions ── */
.pos-actions {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Mobile Cart Footer ── */
.pos-mobile-footer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 2px solid var(--gold);
  padding: 14px 20px;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  z-index: 100;
  cursor: pointer;
}

.pos-mobile-footer:not(.has-items) {
  opacity: 0.5;
}

#posMobileTotal {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .pos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .pos-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
  }

  .pos-cart.mobile-open {
    transform: translateY(0);
  }

  .pos-mobile-footer {
    display: flex;
  }

  .stats-grid-compact {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .payment-bar-stats {
    gap: 16px;
  }

  .payment-bar-value {
    font-size: 17px;
  }
}

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

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

  .payment-bar-stats {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════
   LOCATION SWITCHER
   ═══════════════════════════════════════════════════════════ */
.location-switcher {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.location-switcher select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.location-switcher select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(200,162,76,0.3);
}

/* ═══════════════════════════════════════════════════════════
   FRANCHISE MODE
   ═══════════════════════════════════════════════════════════ */
.franchise-grid {
  display: grid;
  gap: 16px;
}

.franchise-card {
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid var(--loc-color, var(--border));
  box-shadow: var(--shadow-card);
  transition: transform 250ms var(--smooth), box-shadow 250ms var(--smooth);
}

.franchise-card:hover:not(.coming-soon) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.franchise-card.coming-soon {
  opacity: 0.5;
}

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

.franchise-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.franchise-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.franchise-hq {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-glow);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.franchise-stats {
  display: flex;
  gap: 24px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.franchise-stats span {
  font-size: 13px;
  color: var(--text-muted);
}

.franchise-stats strong {
  color: var(--text);
  font-weight: 600;
}

.franchise-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.badge-coming-soon {
  background: var(--surface-2);
  color: var(--text-faint);
  border: 1px solid var(--border);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Franchise Settings */
.franchise-settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.franchise-settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.franchise-settings-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  font-size: 13px;
}

.badge-sm {
  font-size: 10px;
  padding: 1px 6px;
}

@media (max-width: 768px) {
  .franchise-settings-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .franchise-settings-info {
    min-width: auto;
  }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE OPTIMIZATIONS  (iPhone 14 Pro — 390 × 844)
   ═══════════════════════════════════════════════════════════ */


/* ─── ISSUE 1 — Members table: hide low-priority columns ── */
@media (max-width: 768px) {
  .members-table th:nth-child(2),
  .members-table td:nth-child(2),
  .members-table th:nth-child(3),
  .members-table td:nth-child(3),
  .members-table th:nth-child(6),
  .members-table td:nth-child(6),
  .members-table th:nth-child(7),
  .members-table td:nth-child(7) {
    display: none;
  }

  .members-table th,
  .members-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .members-table td:first-child {
    font-size: 13px;
  }
}


/* ─── ISSUE 2 — Payments table: hide Type & Date columns ── */
@media (max-width: 768px) {
  .payments-table th:nth-child(4),
  .payments-table td:nth-child(4),
  .payments-table th:nth-child(5),
  .payments-table td:nth-child(5) {
    display: none;
  }

  .payments-table th,
  .payments-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}


/* ─── ISSUE 3 — Dashboard stat cards 2-col on mobile ────── */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 24px;
  }
}

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


/* ─── ISSUE 4 — Dashboard two-column grid → single col ──── */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* ─── ISSUE 6 — Modals full-screen on mobile ────────────── */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  .modal-body {
    max-height: calc(92vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* ─── ISSUE 7 — Mobile header: sticky + solid background ── */
@media (max-width: 768px) {
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
}


/* ─── ISSUE 8 — Touch targets: 44px minimum ─────────────── */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
  }

  .nav-item {
    min-height: 44px;
    padding: 10px 16px;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  select {
    padding-right: 36px;
  }

  .hamburger {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}


/* ─── ISSUE 9 — Search/filter bar: horizontal scroll ────── */
@media (max-width: 768px) {
  .search-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .search-bar::-webkit-scrollbar {
    display: none;
  }

  .search-input {
    min-width: 160px;
    flex-shrink: 1;
  }

  .filter-select {
    min-width: 120px;
    flex-shrink: 0;
  }
}


/* ─── ISSUE 10 — Sidebar overlay backdrop ───────────────── */
@media (max-width: 768px) {
  #sidebar {
    z-index: 200;
  }

  .sidebar-overlay {
    z-index: 199;
    background: rgba(0, 0, 0, 0.6);
    display: none;
  }

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


/* ─── ISSUE 11 — Payment progress bar stats ─────────────── */
@media (max-width: 768px) {
  .payment-bar-stats {
    flex-wrap: wrap;
    gap: 12px;
  }

  .payment-bar-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
}


/* ─── ISSUE 12 — Member profile: single-column grid ─────── */
@media (max-width: 768px) {
  .profile-info-grid {
    grid-template-columns: 1fr;
  }

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

  .profile-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 4px);
    text-align: center;
    justify-content: center;
  }
}


/* ── FRANCHISE COMBINED STATS ─────────────────────────── */
.franchise-combined-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.franchise-stat-card {
  background: var(--surface);
  border: none;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.franchise-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.franchise-stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}
.franchise-stat-value.gold { color: var(--gold); }

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

/* ── DASHBOARD FEED CARDS — HALF HEIGHT ───────────────── */
.dashboard-feed-card { max-height: 320px; overflow: hidden; }
.dashboard-feed-card .feed-list,
.dashboard-feed-card .trial-feed-list { max-height: 260px; overflow-y: auto; }

/* ── SIDEBAR FRANCHISE DIVIDER & GOLD NAV ─────────────── */
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 16px; }

.nav-franchise { color: var(--gold-dim) !important; }
.nav-franchise svg { stroke: var(--gold-dim); }
.nav-franchise:hover { color: var(--gold) !important; background: var(--gold-glow) !important; }
.nav-franchise:hover svg { stroke: var(--gold); }
.nav-franchise.active { color: var(--gold) !important; background: var(--gold-glow) !important; }
.nav-franchise.active svg { stroke: var(--gold); }

/* ── STAT CARD CLICKABLE ──────────────────────────────── */
.stat-card.clickable { cursor: pointer; transition: box-shadow 250ms var(--smooth), transform 250ms var(--smooth); }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }

/* ── TRIAL LEADS POPUP ────────────────────────────────── */
.modal-wide { max-width: 560px !important; width: 100% !important; }

.lead-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(31,31,35,0.5);
}
.lead-item:last-child { border-bottom: none; }
.lead-checkbox { margin-top: 4px; accent-color: var(--gold); }
.lead-info { flex: 1; min-width: 0; }
.lead-name { font-size: 14px; font-weight: 600; }
.lead-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lead-contact { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.lead-actions { display: flex; gap: 4px; margin-top: 6px; }

.leads-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  height: auto;
  min-height: unset;
}


/* ══════════════════════════════════════════════════════════
   UX OVERHAUL — NEW STYLES
   ══════════════════════════════════════════════════════════ */

/* ── ITEM 1: MORNING BRIEFING CARD ───────────────────── */
.briefing-card {
  background: linear-gradient(135deg, rgba(200,162,76,0.06), rgba(200,162,76,0.01));
  border: 1px solid rgba(200,162,76,0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.briefing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.briefing-day { font-size: 18px; font-weight: 700; color: var(--text); font-family: var(--font-display); letter-spacing: -0.2px; }
.briefing-greeting { font-size: 13px; color: var(--text-muted); }
.briefing-items { display: flex; flex-direction: column; gap: 8px; }
.briefing-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); padding: 6px 0; }
.briefing-item.highlight { color: var(--gold); font-weight: 500; }
.briefing-item.alert { color: var(--error); font-weight: 500; }
.briefing-icon { font-size: 16px; width: 24px; text-align: center; }

/* ── ITEM 3: ONBOARDING WIZARD ───────────────────────── */
.onboarding-wizard {
  width: 100%; max-width: 600px; height: 90vh;
  display: flex; flex-direction: column;
}
.wizard-steps {
  display: flex; padding: 16px 24px; border-bottom: 1px solid var(--border);
  gap: 4px; overflow-x: auto;
}
.wizard-step {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-faint); white-space: nowrap;
}
.wizard-step.active { color: var(--gold); font-weight: 600; }
.wizard-step.completed { color: var(--success); }
.wizard-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-size: 11px; font-weight: 700;
}
.wizard-step.active .wizard-step-num { background: var(--gold); color: #000; }
.wizard-step.completed .wizard-step-num { background: var(--success); color: #fff; }
.wizard-step-arrow { color: var(--text-faint); font-size: 10px; margin: 0 2px; }
.wizard-body { flex: 1; overflow-y: auto; padding: 24px; }
.wizard-footer {
  display: flex; justify-content: space-between; padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.wizard-body .form-group { margin-bottom: 16px; }
.wizard-body .waiver-text { max-height: 200px; overflow-y: auto; font-size: 12px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; line-height: 1.6; }
.wizard-body .waiver-canvas { width: 100%; height: 120px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: crosshair; touch-action: none; }
.wizard-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wizard-plan-card {
  padding: 14px; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 200ms var(--smooth), background 200ms var(--smooth), transform 200ms var(--smooth); text-align: center;
}
.wizard-plan-card:hover { border-color: var(--border-hover); background: var(--surface-2); transform: translateY(-1px); }
.wizard-plan-card.selected { border-color: var(--gold); background: var(--gold-glow); }
.wizard-plan-name { font-size: 13px; font-weight: 600; color: var(--text); }
.wizard-plan-price { font-size: 16px; font-weight: 700; color: var(--gold); margin-top: 4px; font-family: var(--font-display); }
.wizard-plan-interval { font-size: 11px; color: var(--text-muted); }
.wizard-done { text-align: center; padding: 32px 0; }
.wizard-done-icon { font-size: 48px; margin-bottom: 16px; }
.wizard-done-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.wizard-done-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
.wizard-setup-option {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: border-color 200ms var(--smooth), background 200ms var(--smooth); margin-bottom: 8px;
}
.wizard-setup-option:hover { border-color: var(--gold); background: var(--gold-glow); }
.wizard-setup-option .setup-icon { font-size: 20px; }
.wizard-setup-option .setup-label { font-size: 14px; font-weight: 600; color: var(--text); }
.wizard-setup-option .setup-desc { font-size: 12px; color: var(--text-muted); }

@media (max-width: 768px) {
  .onboarding-wizard { height: 100vh; max-width: 100%; }
  .wizard-plan-grid { grid-template-columns: 1fr; }
}

/* ── ITEM 4: GROUPED MEMBERS TABLE ───────────────────── */
.group-header td {
  background: var(--surface-2);
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.group-header:hover td { background: var(--surface-3); }
.group-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.group-count { font-size: 11px; color: var(--text-faint); margin-left: 4px; }
.group-toggle { font-size: 10px; color: var(--text-faint); margin-right: 8px; transition: transform 0.2s; display: inline-block; }
.group-header.collapsed .group-toggle { transform: rotate(-90deg); }
.group-header.collapsed ~ tr.group-row { display: none; }

/* ── ITEM 5: GLOBAL SEARCH ───────────────────────────── */
.global-search-trigger {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 12px 4px;
  background: rgba(200,162,76,0.03); border: 1px solid rgba(200,162,76,0.12);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  transition: border-color 200ms var(--smooth), background 200ms var(--smooth);
  width: calc(100% - 24px); box-sizing: border-box;
}
.global-search-trigger:hover { border-color: var(--gold); background: rgba(200,162,76,0.06); color: var(--text); }
.global-search-trigger kbd {
  font-size: 10px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-family: monospace;
}
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 120px; z-index: 500;
}
.search-overlay.active { display: flex; }
.search-modal {
  width: 560px; max-width: 90%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow-modal);
  animation: modalEntrance 200ms var(--spring);
}
.search-modal input {
  width: 100%; padding: 16px 20px; background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 16px; outline: none;
}
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-group { padding: 8px 16px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer; transition: background 150ms var(--smooth);
}
.search-result-item:hover, .search-result-item.focused { background: var(--surface-2); }
.search-result-name { font-size: 14px; font-weight: 500; color: var(--text); }
.search-result-sub { font-size: 12px; color: var(--text-muted); }
.search-result-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.search-empty { padding: 24px; text-align: center; color: var(--text-faint); font-size: 14px; }

@media (max-width: 768px) {
  .search-overlay { padding-top: 20px; }
  .search-modal { max-width: 96%; }
  .global-search-trigger kbd { display: none; }
}

/* ── ITEM 6: POS FAVORITES ───────────────────────────── */
.pos-product-card.favorite {
  box-shadow: 0 0 0 1px rgba(200,162,76,0.2), var(--shadow-card);
}
.pos-product-card.favorite:hover {
  box-shadow: 0 0 0 1px rgba(200,162,76,0.35), var(--shadow-card-hover);
}
.pos-fav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── ITEM 7: UNIFIED COMMUNICATION TIMELINE ──────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding: 8px 0; }
.timeline-dot {
  position: absolute; left: -20px; top: 12px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--border);
}
.timeline-dot.email { background: var(--gold); }
.timeline-dot.sms { background: #22c55e; }
.timeline-dot.note { background: #3B82F6; }
.timeline-title { font-size: 13px; color: var(--text); }
.timeline-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.timeline-preview { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.quick-note { display: flex; gap: 8px; margin-bottom: 16px; }
.quick-note input { flex: 1; }

/* ── ITEM 8: POLISH ──────────────────────────────────── */
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable::after {
  content: 'View \2192';
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  transition: color 150ms var(--smooth);
}
.stat-card.clickable:hover::after { color: var(--gold); }
.stat-card.clickable:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(200,162,76,0.15), inset 0 0 12px rgba(200,162,76,0.03);
}

/* Contrast fix: ensure small text minimum #AAA */
.feed-date, .lead-contact, .timeline-meta,
.comm-meta, .search-result-group {
  color: #AAAAAA;
}

/* ── SIDEBAR SEARCH TRIGGER ──────────────────────────── */
.sidebar-search-wrap {
  padding: 8px 8px 0;
}

/* ── PAGE TRANSITIONS ────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

#mainContent > * {
  animation: fadeSlideIn 250ms var(--smooth);
}

/* ── CARD HOVER EFFECTS ──────────────────────────────── */
.franchise-card:hover, .pos-product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* ── ROLE TOGGLE ─────────────────────────────────────── */
.dashboard-role-toggle {
  display: flex; gap: 4px; background: var(--surface-2);
  border-radius: 10px; padding: 4px; margin-bottom: 16px;
  width: fit-content;
}
.role-btn {
  background: transparent; border: none; color: var(--text-muted);
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; transition: color 200ms var(--smooth), background 200ms var(--smooth), box-shadow 200ms var(--smooth);
  font-family: var(--font-body);
}
.role-btn.active {
  background: var(--surface); color: var(--gold);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.role-btn:hover:not(.active) { color: var(--text); }

/* ── DASHBOARD VIEW TOGGLE ───────────────────────────── */
.dashboard-view-toggle {
  display: flex; gap: 4px; background: var(--surface-2);
  border-radius: 10px; padding: 4px;
  width: fit-content;
}
.view-btn {
  background: transparent; border: none; color: var(--text-muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 600; transition: color 200ms var(--smooth), background 200ms var(--smooth), box-shadow 200ms var(--smooth);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-family: var(--font-body);
}
.view-btn.active {
  background: var(--surface); color: var(--gold);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.view-btn:hover:not(.active) { color: var(--text); }

/* ── RETENTION VIEW ──────────────────────────────────── */
.retention-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.retention-card {
  background: var(--surface); border: none;
  border-radius: 10px; padding: 16px;
  box-shadow: var(--shadow-card);
}
.retention-value {
  font-size: 28px; font-weight: 700; margin-top: 4px;
  letter-spacing: -0.5px;
}
.retention-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.at-risk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(31,31,35,0.5);
}
.at-risk-item:last-child { border-bottom: none; }
.at-risk-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); display: flex;
  align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.at-risk-info { flex: 1; min-width: 0; }
.at-risk-name { font-weight: 600; font-size: 14px; }
.at-risk-meta { font-size: 12px; color: var(--text-muted); }
.at-risk-action {
  flex-shrink: 0;
}
.month-comparison {
  background: var(--surface); border: none;
  border-radius: 10px; padding: 16px; margin-top: 16px;
  box-shadow: var(--shadow-card);
}
.month-comparison-title {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.month-comparison-value {
  font-size: 18px; font-weight: 600;
}
.month-comparison-value.positive { color: var(--success); }
.month-comparison-value.negative { color: var(--error); }
.month-comparison-value.neutral { color: var(--text-muted); }

/* ── FRONT DESK VIEW ─────────────────────────────────── */
.quick-actions-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.quick-action-card {
  background: var(--surface); border: none;
  border-radius: 10px; padding: 16px; text-align: center;
  cursor: pointer; transition: transform 200ms var(--smooth), box-shadow 200ms var(--smooth);
  box-shadow: var(--shadow-card);
}
.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.quick-action-icon { font-size: 24px; margin-bottom: 6px; }
.quick-action-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ── INSTRUCTOR VIEW ─────────────────────────────────── */
.belt-overview-grid {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.belt-overview-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
}
.belt-overview-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
}
.belt-overview-count { font-weight: 700; }

/* ── MOBILE RESPONSIVE: ROLE TOGGLE + RETENTION ─────── */
@media (max-width: 768px) {
  .dashboard-role-toggle {
    overflow-x: auto; width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .role-btn { white-space: nowrap; }
  .retention-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── BELT SVG ─────────────────────────────────────────── */
.belt-svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── POS PRODUCT IMAGE MOBILE ─────────────────────────── */
@media (max-width: 768px) {
  .pos-product-image {
    height: 80px;
  }
}

/* ── ADMIN USERS LIST ─────────────────────────────────── */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-user-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.admin-user-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ══ SCHEDULE PAGE ══════════════════════════════════════════ */
.schedule-day-tabs {
  display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.schedule-day-tabs::-webkit-scrollbar { display: none; }
.schedule-day-tab {
  padding: 8px 14px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 200ms var(--smooth), color 200ms var(--smooth), border-color 200ms var(--smooth);
}
.schedule-day-tab.active { background: var(--gold); color: #000; border-color: var(--gold); }
.schedule-day-tab.today:not(.active)::after { content: '•'; margin-left: 4px; color: var(--gold); }

.schedule-filters {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.schedule-filter {
  padding: 5px 12px; border-radius: 6px; background: transparent;
  border: 1px solid var(--border); color: var(--text-faint); cursor: pointer;
  font-size: 12px; font-weight: 500;
  transition: border-color 200ms var(--smooth), color 200ms var(--smooth);
}
.schedule-filter.active { border-color: var(--gold); color: var(--gold); }

.schedule-classes {
  background: var(--surface); border-radius: 12px;
  border: none; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.schedule-class {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border-bottom: 1px solid rgba(31,31,35,0.5);
  transition: background 150ms var(--smooth);
}
.schedule-class:last-child { border-bottom: none; }
.schedule-class:hover { background: rgba(255,255,255,0.02); }
.schedule-class.now {
  border-left: 3px solid var(--gold);
  background: rgba(200,162,76,0.03);
}
.schedule-class.past { opacity: 0.4; }

.schedule-time {
  font-size: 14px; font-weight: 700; color: var(--gold);
  min-width: 80px; font-family: var(--font-display); flex-shrink: 0;
}
.schedule-info { flex: 1; min-width: 0; }
.schedule-class-name { font-size: 14px; font-weight: 600; color: var(--text); }
.schedule-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.schedule-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;
}
.schedule-badge.gi { background: rgba(59,130,246,0.1); color: #3B82F6; }
.schedule-badge.no-gi { background: rgba(168,85,247,0.1); color: #A855F7; }
.schedule-badge.wrestling { background: rgba(239,68,68,0.1); color: #EF4444; }
.schedule-badge.open { background: rgba(34,197,94,0.1); color: #22C55E; }
.schedule-badge.age-adult { background: rgba(200,162,76,0.08); color: var(--gold); }
.schedule-badge.age-kids { background: rgba(34,197,94,0.08); color: #22C55E; }
.schedule-badge.age-teens { background: rgba(168,85,247,0.08); color: #A855F7; }
.schedule-badge.age-all { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.schedule-note { font-size: 10px; color: var(--text-faint); font-style: italic; }
.schedule-live {
  background: #EF4444; color: white; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
  flex-shrink: 0; animation: pulse 1.5s ease infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ══ MESSAGES PAGE ══════════════════════════════════════════ */
.messages-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  background: var(--surface-2); border-radius: 10px; padding: 4px;
  width: fit-content;
}
.messages-tab {
  display: flex; align-items: center;
  padding: 8px 20px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: transparent; border: none;
  transition: background 200ms var(--smooth), color 200ms var(--smooth), box-shadow 200ms var(--smooth);
}
.messages-tab.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.recent-comms-list { margin-top: 24px; }
.recent-comm-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(31,31,35,0.5); align-items: flex-start;
}
.recent-comm-item:last-child { border-bottom: none; }
.recent-comm-type {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.recent-comm-type.email { background: rgba(200,162,76,0.08); }
.recent-comm-type.sms { background: rgba(34,197,94,0.08); }

/* ══ MAIN SEARCH BAR (dashboard) ══════════════════════════ */
.main-search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; cursor: pointer;
  margin-bottom: 16px; transition: border-color 200ms var(--smooth), box-shadow 200ms var(--smooth);
  color: var(--text-faint);
  box-shadow: var(--shadow-card);
}
.main-search-bar:hover { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(200,162,76,0.08); }
.main-search-bar span { font-size: 14px; flex: 1; }
.main-search-bar kbd {
  font-size: 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; color: var(--text-faint);
  font-family: monospace;
}

/* ══ DASHBOARD SECTIONS ══════════════════════════════════════ */
.dashboard-section {
  margin-bottom: 20px;
}
.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dashboard-section-header a {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.dashboard-section-header a:hover {
  text-decoration: underline;
}

/* ══ TODAY'S CLASSES ROW ═════════════════════════════════════ */
.today-classes-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.today-classes-row::-webkit-scrollbar { display: none; }
.today-class-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 100px;
  position: relative;
  transition: border-color 200ms var(--smooth), box-shadow 200ms var(--smooth);
  box-shadow: var(--shadow-card);
}
.today-class-chip.live {
  border-color: var(--gold);
  background: rgba(200,162,76,0.03);
  box-shadow: 0 0 8px rgba(200,162,76,0.1);
}
.today-class-chip.past {
  opacity: 0.3;
}
.today-class-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.today-class-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: center;
}
.live-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #EF4444;
  animation: pulse 1.5s ease infinite;
}

/* ══ BELT RANK BAR ═══════════════════════════════════════════ */
.belt-rank-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}
.belt-rank-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.belt-rank-item strong {
  color: var(--text);
  font-weight: 700;
}
.belt-dot-sm {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* ══ PAYMENTS PAGE TABS ══════════════════════════════════════ */
.payments-page-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 16px;
}
.payments-page-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 200ms var(--smooth), background 200ms var(--smooth), box-shadow 200ms var(--smooth);
  font-family: var(--font-body);
}
.payments-page-tab.active {
  background: var(--surface);
  color: var(--gold);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.payments-page-tab:hover:not(.active) {
  color: var(--text);
}

/* ══ MOBILE: DASHBOARD QUICK ACTIONS & BELT BAR ══════════════ */
@media (max-width: 768px) {
  .belt-rank-bar {
    gap: 8px;
    padding: 10px 12px;
  }
  .belt-rank-item {
    font-size: 12px;
  }
  .payments-page-tabs {
    width: 100%;
  }
  .payments-page-tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
  }
}

/* ══════════════════════════════════════════════════════════
   ACCESSIBILITY — prefers-reduced-motion
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════
   FOCUS ACCESSIBILITY — visible outlines
   ══════════════════════════════════════════════════════════ */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(200,162,76,0.4);
}
/* ═══════════════════════════════════════════════════════════
   LABYRINTH BJJ — ROUND 2 DEEP PREMIUM POLISH
   Apple/Linear-level quality: liquid glass, depth, motion
   Layered on top of Round 1 — no class name changes
   ═══════════════════════════════════════════════════════════ */

/* ── 1. DESIGN SYSTEM — REFINED TOKENS ─────────────────── */
:root {
  /* Enhanced color palette with more nuance */
  --glass: rgba(15, 15, 18, 0.72);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shine: rgba(255, 255, 255, 0.04);
  --gold-subtle: rgba(200, 162, 76, 0.06);
  --gold-medium: rgba(200, 162, 76, 0.15);
  
  /* Refined easing system (replacing generic spring) */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.3, 0.64, 1);
  --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Shadow system — more cinematic depth */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.02) inset;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.03) inset;
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.05) inset;
  --shadow-gold: 0 4px 16px rgba(200,162,76,0.15), 0 0 0 1px rgba(200,162,76,0.08);
  --shadow-gold-lg: 0 8px 32px rgba(200,162,76,0.2), 0 0 0 1px rgba(200,162,76,0.12);
  
  /* Noise texture for surfaces */
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}


/* ── 2. TYPOGRAPHY REFINEMENTS ─────────────────────────── */

/* Optical sizing and refined letter-spacing */
.page-title {
  font-weight: 700;
  letter-spacing: -0.4px;
  font-feature-settings: 'cv11', 'ss01', 'salt';
}

.stat-value {
  letter-spacing: -0.75px;
  font-feature-settings: 'tnum', 'lnum', 'cv11';
}

.card-title {
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: 0.75px;
}

/* Monospace numbers everywhere financial */
.feed-amount, .pos-product-price, .pay-summary-total,
.overdue-amount, .payment-bar-value, .pos-total-final,
.selected-plan-price, .amount-row {
  font-feature-settings: 'tnum', 'lnum';
  letter-spacing: -0.3px;
}


/* ── 3. LIQUID GLASS SURFACES ──────────────────────────── */

/* Sidebar — deeper glass effect with subtle grain */
.sidebar {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%) brightness(1.02);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.02);
  border-right: 1px solid var(--glass-border);
  box-shadow: 1px 0 24px rgba(0,0,0,0.2);
}

/* Add subtle top shine to sidebar header */
.sidebar-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

/* Stat cards — glass with inner glow */
.stat-card {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(15,15,18,0.95) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.stat-card:hover {
  border-color: rgba(200,162,76,0.12);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* Card base — unified glass effect */
.card {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.97) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

/* Dashboard feed cards */
.dashboard-feed-card {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.97) 100%);
  border: 1px solid var(--glass-border);
}

/* Profile header — premium glass */
.profile-header {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.97) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

/* Profile actions bar */
.profile-actions {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.97) 100%);
  border: 1px solid var(--glass-border);
}

/* Profile payments section */
.profile-payments {
  border: 1px solid var(--glass-border);
}

/* Payment progress card */
.payment-progress-card {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.97) 100%);
  border: 1px solid var(--glass-border);
}


/* ── 4. ENHANCED MOTION SYSTEM ─────────────────────────── */

/* Page transitions — smoother with opacity */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

#mainContent > * {
  animation: fadeSlideIn 350ms var(--ease-out-expo);
}

/* Modal entrance — more cinematic */
@keyframes modalEntrance {
  from {
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

.modal {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.98) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  animation: modalEntrance 400ms var(--ease-out-expo);
}

/* Overlay backdrop — cinematic blur */
.modal-overlay {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  animation: overlayFadeIn 250ms var(--ease-out-expo);
}

@keyframes overlayFadeIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; }
}

/* Toast — slide in with spring bounce */
@keyframes toastSpring {
  0% {
    transform: translateX(110%);
    opacity: 0;
  }
  60% {
    transform: translateX(-4%);
    opacity: 1;
  }
  80% {
    transform: translateX(1%);
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Keep original slideIn keyframes working for JS */
@keyframes slideIn {
  0% {
    transform: translateX(110%);
    opacity: 0;
  }
  60% {
    transform: translateX(-4%);
    opacity: 1;
  }
  80% {
    transform: translateX(1%);
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast {
  background: linear-gradient(145deg, rgba(20, 20, 24, 0.92), rgba(15, 15, 18, 0.95));
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  animation: toastSpring 500ms var(--ease-out-expo);
}

/* Confirmation dialog — spring entrance */
.confirm-dialog {
  background: linear-gradient(145deg, var(--surface) 0%, rgba(12,12,15,0.98) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  animation: modalEntrance 350ms var(--ease-out-expo);
}

.confirm-overlay {
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

/* Typeahead dropdown — smooth appearance */
.typeahead-dropdown.open {
  animation: dropdownAppear 200ms var(--ease-out-expo);
}

@keyframes dropdownAppear {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.typeahead-dropdown {
  background: linear-gradient(145deg, var(--surface-2), rgba(18,18,22,0.98));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* Sidebar mobile slide — smoother */
@media (max-width: 768px) {
  .sidebar {
    transition: transform 300ms var(--ease-out-expo);
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }
  
  .sidebar-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 250ms var(--ease-out-expo);
  }
}


/* ── 5. REFINED INTERACTIVE STATES ─────────────────────── */

/* Buttons — tactile spring press */
.btn {
  transition: 
    background 200ms var(--ease-out-expo),
    color 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo);
}

.btn:active {
  transform: scale(0.96);
  transition-duration: 100ms;
}

.btn-primary {
  background: linear-gradient(135deg, #D4AD52 0%, var(--gold) 50%, #B8922F 100%);
  box-shadow: var(--shadow-sm), 0 1px 0 rgba(255,255,255,0.1) inset;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #DDB655 0%, #D4AD52 50%, #C8A24C 100%);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.96) translateY(0);
  box-shadow: var(--shadow-xs);
}

/* Secondary button refinement */
.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Nav items — fluid highlight */
.nav-item {
  transition: 
    color 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo);
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--gold);
  background: var(--gold-glow);
  box-shadow: inset 0 0 0 1px rgba(200,162,76,0.12), var(--shadow-xs);
  transform: translateX(0);
}

/* Toggle switch — smoother spring */
.toggle-track::after {
  transition: 
    transform 300ms var(--ease-spring),
    background 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(255,255,255,0.1);
}

.toggle-switch input:checked + .toggle-track::after {
  box-shadow: 0 1px 4px rgba(200,162,76,0.4), 0 0 0 0.5px rgba(200,162,76,0.2);
}

/* Links — smooth underline reveal */
a {
  transition: color 180ms var(--ease-out-expo);
}


/* ── 6. DATA-DENSE VIEW REFINEMENTS ────────────────────── */

/* Tables — refined depth & hierarchy */
.table-wrapper {
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

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

th {
  background: rgba(15, 15, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200,162,76,0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 16px;
}

td {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 150ms var(--ease-out-expo);
}

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

tr:hover td {
  background: rgba(200,162,76,0.02);
}

/* Row hover — subtle gold highlight for active rows */
tr:active td {
  background: rgba(200,162,76,0.04);
}

/* Member name links in tables — better interaction */
.member-name-link {
  font-weight: 600;
  transition: color 180ms var(--ease-out-expo);
  position: relative;
}

.member-name-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 250ms var(--ease-out-expo);
}

.member-name-link:hover::after {
  width: 100%;
}

/* Badge refinements — subtle glass */
.badge {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid transparent;
  font-feature-settings: 'cv11', 'ss01';
}

.badge-active {
  border-color: rgba(52,211,153,0.15);
}

.badge-trial {
  border-color: rgba(96,165,250,0.15);
}

.badge-paused {
  border-color: rgba(251,191,36,0.15);
}

.badge-cancelled, .badge-failed {
  border-color: rgba(248,113,113,0.15);
}

.badge-frozen {
  border-color: rgba(147,197,253,0.15);
}


/* ── 7. SKELETON LOADER REFINEMENTS ────────────────────── */

/* More subtle, gold-tinted shimmer */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    rgba(200,162,76,0.04) 20%,
    rgba(200,162,76,0.06) 50%,
    rgba(200,162,76,0.04) 80%,
    var(--surface-2) 100%
  );
  background-size: 250% 100%;
  animation: shimmer 2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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


/* ── 8. EMPTY STATE ELEVATION ──────────────────────────── */

.empty-state {
  padding: 56px 32px;
  color: var(--text-muted);
}

.empty-state svg {
  margin: 0 auto 20px;
  opacity: 0.15;
  filter: drop-shadow(0 0 12px rgba(200,162,76,0.1));
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* Trial empty state — warmer */
.trial-empty {
  padding: 44px 28px;
}

.trial-empty svg {
  opacity: 0.15;
  filter: drop-shadow(0 0 8px rgba(200,162,76,0.1));
}


/* ── 9. FORM INPUT REFINEMENTS ─────────────────────────── */

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.06);
  transition: 
    border-color 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo);
}

input:hover, select:hover, textarea:hover {
  border-color: rgba(255,255,255,0.1);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 
    0 0 0 3px var(--bg),
    0 0 0 5px rgba(200,162,76,0.25);
  background: rgba(20,20,24,0.95);
}

/* Search input icon — subtle animation */
.search-input svg {
  transition: color 200ms var(--ease-out-expo);
}

.search-input input:focus ~ svg,
.search-input:focus-within svg {
  color: var(--gold);
}


/* ── 10. ENHANCED SIDEBAR DETAILS ──────────────────────── */

/* Sidebar brand — subtle gold glow */
.sidebar-brand {
  text-shadow: 0 0 20px rgba(200,162,76,0.15);
}

/* Gold accent line under header — animated on load */
.sidebar-header::after {
  width: 0;
  animation: sidebarAccent 600ms var(--ease-out-expo) 300ms forwards;
}

@keyframes sidebarAccent {
  to { width: 32px; }
}

/* Location switcher — better styling */
.location-switcher select {
  background: rgba(15,15,18,0.6);
  border-color: var(--glass-border);
  transition: 
    border-color 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.location-switcher select:hover {
  border-color: rgba(255,255,255,0.1);
}

/* Global search trigger — premium glass */
.global-search-trigger {
  background: rgba(200,162,76,0.02);
  border: 1px solid rgba(200,162,76,0.08);
  transition: 
    border-color 250ms var(--ease-out-expo),
    background 250ms var(--ease-out-expo),
    box-shadow 250ms var(--ease-out-expo),
    color 250ms var(--ease-out-expo);
}

.global-search-trigger:hover {
  border-color: rgba(200,162,76,0.2);
  background: rgba(200,162,76,0.05);
  box-shadow: 0 0 12px rgba(200,162,76,0.06);
}

.global-search-trigger kbd {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}


/* ── 11. SEARCH OVERLAY — PREMIUM ──────────────────────── */

.search-overlay {
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.search-modal {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.98));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  animation: modalEntrance 250ms var(--ease-out-expo);
}

.search-modal input {
  font-weight: 500;
  letter-spacing: -0.2px;
}

.search-result-item {
  transition: background 150ms var(--ease-out-expo), transform 150ms var(--ease-out-expo);
  border-radius: var(--radius-sm);
  margin: 0 4px;
}

.search-result-item:hover,
.search-result-item.focused {
  background: rgba(200,162,76,0.04);
  transform: translateX(2px);
}


/* ── 12. LOGIN SCREEN — CINEMATIC ──────────────────────── */

.login-screen {
  background-image: 
    radial-gradient(ellipse 800px 500px at 50% 35%, rgba(200,162,76,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 400px 300px at 30% 70%, rgba(200,162,76,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 400px 300px at 70% 80%, rgba(200,162,76,0.02) 0%, transparent 60%);
}

.login-card {
  animation: loginCardAppear 600ms var(--ease-out-expo);
}

@keyframes loginCardAppear {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    filter: blur(4px);
  }
  60% {
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  animation: loginLogoAppear 800ms var(--ease-out-expo) 100ms both;
}

@keyframes loginLogoAppear {
  from {
    opacity: 0;
    transform: scale(0.9) rotate(-2deg);
  }
  to {
    opacity: 0.9;
    transform: scale(1) rotate(0);
  }
}

.login-title {
  text-shadow: 0 0 32px rgba(200,162,76,0.2);
}


/* ── 13. DASHBOARD — PREMIUM CARD EFFECTS ──────────────── */

/* Briefing card — warm glass */
.briefing-card {
  background: linear-gradient(135deg, rgba(200,162,76,0.06), rgba(200,162,76,0.01));
  border: 1px solid rgba(200,162,76,0.08);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.briefing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,162,76,0.15), transparent);
}

/* Today's class chips — premium */
.today-class-chip {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: 
    border-color 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo);
}

.today-class-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.today-class-chip.live {
  border-color: rgba(200,162,76,0.2);
  box-shadow: var(--shadow-gold);
}

/* Belt rank bar */
.belt-rank-bar {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}


/* ── 14. SCHEDULE PAGE — REFINED ───────────────────────── */

.schedule-classes {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

.schedule-class {
  transition: background 180ms var(--ease-out-expo);
}

.schedule-class:hover {
  background: rgba(200,162,76,0.02);
}

.schedule-class.now {
  background: rgba(200,162,76,0.04);
  border-left: 3px solid var(--gold);
  box-shadow: inset 2px 0 8px rgba(200,162,76,0.06);
}

/* Day tabs — smoother */
.schedule-day-tab {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  transition: 
    background 200ms var(--ease-out-expo),
    color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo);
}

.schedule-day-tab:hover:not(.active) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.schedule-day-tab.active {
  background: linear-gradient(135deg, #D4AD52, var(--gold));
  box-shadow: var(--shadow-gold);
  border-color: var(--gold);
}

/* Live indicator — more visible pulse */
.schedule-live {
  box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(239,68,68,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 12px rgba(239,68,68,0.6); }
}


/* ── 15. POS (POINT OF SALE) — PREMIUM ─────────────────── */

.pos-product-card {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: 
    transform 250ms var(--ease-out-expo),
    box-shadow 250ms var(--ease-out-expo),
    border-color 250ms var(--ease-out-expo);
}

.pos-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255,255,255,0.08);
}

.pos-product-card.in-cart {
  border-color: rgba(200,162,76,0.3);
  box-shadow: var(--shadow-gold), 0 0 0 1px rgba(200,162,76,0.2);
}

/* Cart sidebar — glass */
.pos-cart-inner {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* Add button — premium */
.pos-add-btn {
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(200,162,76,0.2);
  transition: 
    background 200ms var(--ease-out-expo),
    color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.pos-add-btn:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(200,162,76,0.3);
}


/* ── 16. PAYMENT MODAL — PREMIUM FLOW ──────────────────── */

.modal.payment-modal {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.98));
}

/* Plan type cards — refined selection */
.plan-type-card {
  background: var(--surface-2);
  border: 2px solid rgba(255,255,255,0.04);
  transition: 
    border-color 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.plan-type-card:hover {
  border-color: rgba(255,255,255,0.08);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

/* Payment success animation — celebration */
.payment-success-icon {
  animation: successBounce 500ms var(--ease-spring);
}

@keyframes successBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}


/* ── 17. FRANCHISE PAGE — DEPTH ────────────────────────── */

.franchise-card {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: none;
  border-left: 4px solid var(--loc-color, var(--border));
  box-shadow: var(--shadow-md);
  transition: 
    transform 250ms var(--ease-out-expo),
    box-shadow 250ms var(--ease-out-expo);
}

.franchise-card:hover:not(.coming-soon) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.franchise-stat-card {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}


/* ── 18. OVERDUE PAYMENTS — ATTENTION ──────────────────── */

.overdue-card {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97)) !important;
  border: 1px solid rgba(248,113,113,0.1) !important;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(248,113,113,0.06) !important;
}

/* Overdue amount — pulse subtly */
.overdue-amount {
  animation: overdueGlow 3s ease-in-out infinite;
}

@keyframes overdueGlow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(248,113,113,0.15); }
}


/* ── 19. PAYMENT BAR — PREMIUM ─────────────────────────── */

.payment-bar {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.3);
  overflow: hidden;
}

.payment-bar-collected {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  box-shadow: 0 0 8px rgba(34,197,94,0.3);
  transition: width 1s var(--ease-out-expo);
}

.payment-bar-overdue {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 0 8px rgba(239,68,68,0.2);
  transition: width 1s var(--ease-out-expo);
}


/* ── 20. TAB SYSTEMS — UNIFIED PREMIUM ─────────────────── */

/* Segmented tabs — glass effect */
.tab-switcher {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xs);
}

.tab-btn {
  transition: 
    color 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

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

/* Messages/Payments/Role tabs */
.messages-tabs, .payments-page-tabs, .dashboard-role-toggle, .dashboard-view-toggle {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xs);
}

.messages-tab.active, .payments-page-tab.active, .role-btn.active, .view-btn.active {
  background: linear-gradient(145deg, var(--surface), rgba(18,18,22,0.95));
  box-shadow: 0 1px 6px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}


/* ── 21. FEED ITEMS — REFINED ──────────────────────────── */

.feed-item {
  transition: 
    background 150ms var(--ease-out-expo),
    transform 150ms var(--ease-out-expo);
  border-radius: var(--radius-sm);
  padding: 12px 4px;
}

.feed-item:hover {
  background: rgba(200,162,76,0.02);
}

/* Feed icons — subtle glow */
.feed-icon.payment {
  box-shadow: 0 0 8px rgba(52,211,153,0.1);
}

.feed-icon.booking {
  box-shadow: 0 0 8px rgba(96,165,250,0.1);
}

.feed-icon.failed {
  box-shadow: 0 0 8px rgba(248,113,113,0.1);
}


/* ── 22. RECIPIENT CHIPS — REFINED ─────────────────────── */

.recipient-chip {
  border: 1px solid var(--glass-border);
  transition: 
    border-color 200ms var(--ease-out-expo),
    color 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.recipient-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.recipient-chip.selected {
  box-shadow: var(--shadow-gold);
}

/* Payment method chips — same treatment */
.payment-method-chip {
  border: 1px solid var(--glass-border);
  transition: 
    border-color 200ms var(--ease-out-expo),
    color 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.payment-method-chip.selected {
  box-shadow: var(--shadow-gold);
}


/* ── 23. MODAL REFINEMENTS ─────────────────────────────── */

.modal-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.modal-close {
  transition: 
    color 150ms var(--ease-out-expo),
    background 150ms var(--ease-out-expo),
    transform 150ms var(--ease-out-expo);
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
  transform: rotate(90deg);
}

.modal-footer {
  background: rgba(15,15,18,0.5);
  border-top: 1px solid rgba(255,255,255,0.04);
}


/* ── 24. SCROLLBAR REFINEMENTS ─────────────────────────── */

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  transition: background 200ms;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}


/* ── 25. LOADING SPINNER — PREMIUM ─────────────────────── */

.spinner {
  border: 2px solid rgba(200,162,76,0.1);
  border-top-color: var(--gold);
  animation: spin 700ms linear infinite;
}

.loading-state {
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}


/* ── 26. WAIVER SYSTEM — PREMIUM ───────────────────────── */

.waiver-canvas {
  border: 1px solid var(--glass-border);
  transition: border-color 200ms var(--ease-out-expo), box-shadow 200ms var(--ease-out-expo);
}

.waiver-canvas:hover {
  border-color: rgba(200,162,76,0.2);
  box-shadow: 0 0 8px rgba(200,162,76,0.06);
}

.waiver-agree-btn {
  background: linear-gradient(135deg, #D4AD52 0%, var(--gold) 50%, #B8922F 100%);
}

.waiver-agree-btn:not(:disabled):hover {
  box-shadow: var(--shadow-gold-lg);
}


/* ── 27. RETENTION & FRONT DESK VIEWS ──────────────────── */

.retention-card {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.quick-action-card {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.97));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: 
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo);
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(200,162,76,0.1);
}


/* ── 28. WIZARD — ONBOARDING REFINEMENT ────────────────── */

.onboarding-wizard {
  background: linear-gradient(145deg, var(--surface), rgba(12,12,15,0.98));
}

.wizard-step-num {
  transition: 
    background 200ms var(--ease-out-expo),
    color 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.wizard-step.active .wizard-step-num {
  box-shadow: 0 0 8px rgba(200,162,76,0.3);
}

.wizard-step.completed .wizard-step-num {
  box-shadow: 0 0 8px rgba(52,211,153,0.2);
}

.wizard-plan-card {
  background: var(--surface-2);
  border: 2px solid var(--glass-border);
  transition: 
    border-color 200ms var(--ease-out-expo),
    background 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

.wizard-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.wizard-plan-card.selected {
  box-shadow: var(--shadow-gold);
}

.wizard-done-title {
  text-shadow: 0 0 24px rgba(200,162,76,0.15);
}


/* ── 29. SETTINGS PAGE — REFINED ───────────────────────── */

.api-key-field .status-dot {
  transition: box-shadow 300ms var(--ease-out-expo);
}

.status-dot.connected {
  animation: statusPulse 2.5s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(52,211,153,0.4); }
  50% { box-shadow: 0 0 10px rgba(52,211,153,0.6); }
}


/* ── 30. MOBILE BOTTOM SHEET — PREMIUM ─────────────────── */

@media (max-width: 900px) {
  .pos-cart {
    background: linear-gradient(180deg, var(--surface), rgba(12,12,15,0.99));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    transition: transform 350ms var(--ease-out-expo);
  }
}

/* Mobile modal bottom sheet — smoother */
@media (max-width: 768px) {
  .modal {
    border-radius: 20px 20px 0 0;
    animation: bottomSheetUp 400ms var(--ease-out-expo);
  }
  
  @keyframes bottomSheetUp {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}


/* ── 31. SUBTLE SURFACE TEXTURE ────────────────────────── */

/* Very subtle noise grain on main background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  background-repeat: repeat;
  background-size: 256px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* Ensure content renders above noise */
.login-screen, .app-shell, .modal-overlay, .confirm-overlay,
.search-overlay, .toast-container {
  position: relative;
  z-index: 1;
}

.toast-container {
  z-index: 9999;
}

.modal-overlay {
  z-index: 1000;
}

.confirm-overlay {
  z-index: 2000;
}

.search-overlay {
  z-index: 500;
}


/* ── 32. FOCUS ACCESSIBILITY — REFINED ─────────────────── */

*:focus-visible {
  outline: 2px solid rgba(200,162,76,0.6);
  outline-offset: 2px;
  border-radius: 2px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 
    0 0 0 3px var(--bg),
    0 0 0 5px rgba(200,162,76,0.3);
}


/* ── 33. PREFERS REDUCED MOTION ────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  /* Keep critical layout but remove decorative motion */
  .stat-card:hover,
  .pos-product-card:hover,
  .franchise-card:hover,
  .quick-action-card:hover,
  .today-class-chip:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}


/* ── 34. SELECTION & TEXT REFINEMENTS ──────────────────── */

::selection {
  background: rgba(200,162,76,0.25);
  color: var(--text);
}

::placeholder {
  color: var(--text-faint);
  opacity: 0.7;
}

/* Better contrast for text-faint contexts */
.feed-date, .lead-contact, .timeline-meta,
.comm-meta, .search-result-group {
  color: #ABABAB;
}

/* Subtle gold tint on primary text in cards */
.stat-value {
  color: rgba(234,234,234,0.97);
}


/* ── 35. STAGGER ANIMATIONS FOR LISTS ──────────────────── */

/* Stats grid — staggered reveal */
.stats-grid .stat-card {
  animation: cardReveal 400ms var(--ease-out-expo) backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 50ms; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 100ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 150ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 200ms; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 250ms; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 300ms; }

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

/* Dashboard grid cards — staggered */
.dashboard-grid > .card {
  animation: cardReveal 400ms var(--ease-out-expo) backwards;
}

.dashboard-grid > .card:nth-child(1) { animation-delay: 100ms; }
.dashboard-grid > .card:nth-child(2) { animation-delay: 200ms; }

/* Franchise cards — staggered */
.franchise-grid > .franchise-card {
  animation: cardReveal 400ms var(--ease-out-expo) backwards;
}

.franchise-grid > .franchise-card:nth-child(1) { animation-delay: 50ms; }
.franchise-grid > .franchise-card:nth-child(2) { animation-delay: 100ms; }
.franchise-grid > .franchise-card:nth-child(3) { animation-delay: 150ms; }
.franchise-grid > .franchise-card:nth-child(4) { animation-delay: 200ms; }

/* Retention grid — staggered */
.retention-grid > .retention-card {
  animation: cardReveal 400ms var(--ease-out-expo) backwards;
}

.retention-grid > .retention-card:nth-child(1) { animation-delay: 50ms; }
.retention-grid > .retention-card:nth-child(2) { animation-delay: 100ms; }
.retention-grid > .retention-card:nth-child(3) { animation-delay: 150ms; }
.retention-grid > .retention-card:nth-child(4) { animation-delay: 200ms; }


/* ═══════════════════════════════════════════════════════════════════════
   PREMIUM VISUAL OVERHAUL — "Linear × visionOS × Luxury BJJ"
   Appended override layer. All selectors leverage cascade position
   to override existing rules without !important.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 0. ADDITIONAL CUSTOM PROPERTIES ──────────────────────── */
:root {
  --premium-blue: rgba(96, 165, 250, 0.12);
  --premium-green: rgba(52, 211, 153, 0.12);
  --premium-gold-tint: rgba(200, 162, 76, 0.12);
  --premium-purple: rgba(168, 85, 247, 0.12);
  --premium-amber: rgba(251, 191, 36, 0.12);
  --premium-teal: rgba(45, 212, 191, 0.12);
  --premium-neutral: rgba(255, 255, 255, 0.04);
  --premium-indigo: rgba(99, 102, 241, 0.12);
  --glass-heavy: rgba(15, 15, 18, 0.72);
  --glass-light: rgba(255, 255, 255, 0.025);
  --shimmer-gold: linear-gradient(90deg, transparent 0%, rgba(200,162,76,0.06) 50%, transparent 100%);
}

/* ── 1. QUICK ACTION GRID — Complete Redesign ─────────────── */
.quick-actions-grid {
  gap: 10px;
  margin-bottom: 24px;
}

.quick-action-card {
  background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(12,12,15,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 280ms cubic-bezier(0.16, 1, 0.3, 1);
  animation: qaReveal 400ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.quick-action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.quick-action-card:hover::before { opacity: 1; }

.quick-action-card:hover {
  transform: translateY(-4px);
}

.quick-action-card:active {
  transform: scale(0.95);
  transition-duration: 100ms;
}

.quick-action-icon {
  font-size: 26px;
  margin-bottom: 8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-action-card:hover .quick-action-icon {
  transform: scale(1.1);
}

.quick-action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  transition: color 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-action-card:hover .quick-action-label {
  color: var(--text);
}

/* Tint per card via nth-child */
.quick-action-card:nth-child(1) { border-color: rgba(96,165,250,0.1); }
.quick-action-card:nth-child(1)::before { background: radial-gradient(ellipse at 50% 0%, rgba(96,165,250,0.08), transparent 70%); }
.quick-action-card:nth-child(1) .quick-action-icon { background: rgba(96,165,250,0.1); }
.quick-action-card:nth-child(1):hover { border-color: rgba(96,165,250,0.25); box-shadow: 0 8px 24px rgba(96,165,250,0.12), 0 0 0 1px rgba(96,165,250,0.08); }

.quick-action-card:nth-child(2) { border-color: rgba(52,211,153,0.1); }
.quick-action-card:nth-child(2)::before { background: radial-gradient(ellipse at 50% 0%, rgba(52,211,153,0.08), transparent 70%); }
.quick-action-card:nth-child(2) .quick-action-icon { background: rgba(52,211,153,0.1); }
.quick-action-card:nth-child(2):hover { border-color: rgba(52,211,153,0.25); box-shadow: 0 8px 24px rgba(52,211,153,0.12), 0 0 0 1px rgba(52,211,153,0.08); }

.quick-action-card:nth-child(3) { border-color: rgba(200,162,76,0.1); }
.quick-action-card:nth-child(3)::before { background: radial-gradient(ellipse at 50% 0%, rgba(200,162,76,0.08), transparent 70%); }
.quick-action-card:nth-child(3) .quick-action-icon { background: rgba(200,162,76,0.1); }
.quick-action-card:nth-child(3):hover { border-color: rgba(200,162,76,0.25); box-shadow: 0 8px 24px rgba(200,162,76,0.12), 0 0 0 1px rgba(200,162,76,0.08); }

.quick-action-card:nth-child(4) { border-color: rgba(168,85,247,0.1); }
.quick-action-card:nth-child(4)::before { background: radial-gradient(ellipse at 50% 0%, rgba(168,85,247,0.08), transparent 70%); }
.quick-action-card:nth-child(4) .quick-action-icon { background: rgba(168,85,247,0.1); }
.quick-action-card:nth-child(4):hover { border-color: rgba(168,85,247,0.25); box-shadow: 0 8px 24px rgba(168,85,247,0.12), 0 0 0 1px rgba(168,85,247,0.08); }

.quick-action-card:nth-child(5) { border-color: rgba(251,191,36,0.1); }
.quick-action-card:nth-child(5)::before { background: radial-gradient(ellipse at 50% 0%, rgba(251,191,36,0.08), transparent 70%); }
.quick-action-card:nth-child(5) .quick-action-icon { background: rgba(251,191,36,0.1); }
.quick-action-card:nth-child(5):hover { border-color: rgba(251,191,36,0.25); box-shadow: 0 8px 24px rgba(251,191,36,0.12), 0 0 0 1px rgba(251,191,36,0.08); }

.quick-action-card:nth-child(6) { border-color: rgba(45,212,191,0.1); }
.quick-action-card:nth-child(6)::before { background: radial-gradient(ellipse at 50% 0%, rgba(45,212,191,0.08), transparent 70%); }
.quick-action-card:nth-child(6) .quick-action-icon { background: rgba(45,212,191,0.1); }
.quick-action-card:nth-child(6):hover { border-color: rgba(45,212,191,0.25); box-shadow: 0 8px 24px rgba(45,212,191,0.12), 0 0 0 1px rgba(45,212,191,0.08); }

.quick-action-card:nth-child(7) { border-color: rgba(255,255,255,0.06); }
.quick-action-card:nth-child(7)::before { background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.04), transparent 70%); }
.quick-action-card:nth-child(7) .quick-action-icon { background: rgba(255,255,255,0.06); }
.quick-action-card:nth-child(7):hover { border-color: rgba(255,255,255,0.12); box-shadow: 0 8px 24px rgba(255,255,255,0.04), 0 0 0 1px rgba(255,255,255,0.06); }

.quick-action-card:nth-child(8) { border-color: rgba(99,102,241,0.1); }
.quick-action-card:nth-child(8)::before { background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.08), transparent 70%); }
.quick-action-card:nth-child(8) .quick-action-icon { background: rgba(99,102,241,0.1); }
.quick-action-card:nth-child(8):hover { border-color: rgba(99,102,241,0.25); box-shadow: 0 8px 24px rgba(99,102,241,0.12), 0 0 0 1px rgba(99,102,241,0.08); }

/* Staggered entrance */
.quick-action-card:nth-child(1) { animation-delay: 0ms; }
.quick-action-card:nth-child(2) { animation-delay: 50ms; }
.quick-action-card:nth-child(3) { animation-delay: 100ms; }
.quick-action-card:nth-child(4) { animation-delay: 150ms; }
.quick-action-card:nth-child(5) { animation-delay: 200ms; }
.quick-action-card:nth-child(6) { animation-delay: 250ms; }
.quick-action-card:nth-child(7) { animation-delay: 300ms; }
.quick-action-card:nth-child(8) { animation-delay: 350ms; }

@keyframes qaReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}


/* ── 2. TODAY'S CLASSES ROW ───────────────────────────────── */
.today-classes-row {
  gap: 10px;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.today-class-chip {
  background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(12,12,15,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 20px;
  min-width: 120px;
  scroll-snap-align: start;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 250ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 250ms cubic-bezier(0.16,1,0.3,1),
              transform 250ms cubic-bezier(0.16,1,0.3,1);
}

.today-class-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(200,162,76,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.today-class-chip.live {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(200,162,76,0.06), rgba(200,162,76,0.02));
  box-shadow: 0 0 16px rgba(200,162,76,0.12), 0 0 4px rgba(200,162,76,0.08);
  animation: liveGlow 2.5s ease-in-out infinite;
  transform: scale(1.02);
}

.today-class-chip.past {
  opacity: 0.25;
  filter: grayscale(0.5);
}

.today-class-time {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.3px;
}

.today-class-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.live-dot {
  width: 8px;
  height: 8px;
  top: 8px;
  right: 8px;
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(200,162,76,0.12), 0 0 4px rgba(200,162,76,0.08); }
  50%      { box-shadow: 0 0 24px rgba(200,162,76,0.2), 0 0 8px rgba(200,162,76,0.12); }
}


/* ── 3. BRIEFING CARD — Premium Glass ─────────────────────── */
.briefing-card {
  background: linear-gradient(135deg, rgba(200,162,76,0.05), rgba(200,162,76,0.01), rgba(15,15,18,0.6));
  border: 1px solid rgba(200,162,76,0.1);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  position: relative;
  overflow: hidden;
}

.briefing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(200,162,76,0.3) 50%, transparent 90%);
}

.briefing-card::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,162,76,0.04), transparent 70%);
  pointer-events: none;
}

.briefing-day {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.briefing-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.briefing-item {
  padding: 8px 0;
  font-size: 14px;
}

.briefing-item.highlight .briefing-icon {
  background: rgba(200,162,76,0.1);
}

.briefing-item.alert .briefing-icon {
  background: rgba(248,113,113,0.1);
  animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% { box-shadow: none; }
  50%      { box-shadow: 0 0 8px rgba(248,113,113,0.3); }
}

.briefing-item:not(.highlight):not(.alert) .briefing-icon {
  background: rgba(52,211,153,0.1);
}


/* ── 4. DASHBOARD SECTIONS ────────────────────────────────── */
.dashboard-section {
  margin-bottom: 24px;
  animation: sectionReveal 500ms cubic-bezier(0.16,1,0.3,1) backwards;
}

.dashboard-section:nth-child(1) { animation-delay: 0ms; }
.dashboard-section:nth-child(2) { animation-delay: 80ms; }
.dashboard-section:nth-child(3) { animation-delay: 160ms; }
.dashboard-section:nth-child(4) { animation-delay: 240ms; }
.dashboard-section:nth-child(5) { animation-delay: 320ms; }
.dashboard-section:nth-child(6) { animation-delay: 400ms; }

@keyframes sectionReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.dashboard-section-header {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: -0.2px;
  margin-bottom: 12px;
}

.dashboard-section-header span {
  font-weight: 600;
}

.dashboard-section-header a {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  transition: background 200ms cubic-bezier(0.16,1,0.3,1), color 200ms cubic-bezier(0.16,1,0.3,1);
  text-decoration: none;
}

.dashboard-section-header a:hover {
  background: rgba(200,162,76,0.08);
  color: #DDB655;
  text-decoration: none;
}

/* Feed items — elevated hover */
.feed-item {
  padding: 14px 8px;
  border-radius: 10px;
  margin: 0 -8px;
  transition: background 180ms cubic-bezier(0.16,1,0.3,1),
              transform 180ms cubic-bezier(0.16,1,0.3,1);
}

.feed-item:hover {
  background: rgba(255,255,255,0.02);
  transform: translateX(2px);
}

.feed-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}

.feed-icon.payment {
  background: rgba(52,211,153,0.1);
  box-shadow: 0 0 12px rgba(52,211,153,0.08);
}

.feed-icon.failed {
  background: rgba(248,113,113,0.1);
  box-shadow: 0 0 12px rgba(248,113,113,0.08);
}

.feed-icon.booking {
  background: rgba(96,165,250,0.1);
  box-shadow: 0 0 12px rgba(96,165,250,0.08);
}


/* ── 5. SIDEBAR — Refined Deep Glass ──────────────────────── */
.sidebar {
  background: rgba(12, 12, 15, 0.78);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-header::after {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(200,162,76,0.2));
  opacity: 0.5;
  transition: width 300ms cubic-bezier(0.16,1,0.3,1), opacity 300ms;
}

.sidebar:hover .sidebar-header::after {
  width: 60px;
  opacity: 0.7;
}

.nav-item {
  border-radius: 10px;
  padding: 10px 16px;
  transition: color 200ms cubic-bezier(0.16,1,0.3,1),
              background 200ms cubic-bezier(0.16,1,0.3,1),
              transform 200ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  transform: translateX(4px);
}

.nav-item.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(200,162,76,0.08), transparent);
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item.active:hover {
  transform: none;
}


/* ── 6. STAT CARDS ────────────────────────────────────────── */
.stat-card {
  background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(12,12,15,0.95));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 280ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 280ms cubic-bezier(0.16,1,0.3,1),
              border-color 280ms cubic-bezier(0.16,1,0.3,1);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 280ms;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card:hover::before { opacity: 1; }

.stat-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

/* Tinted stat cards — revenue, members, failed, trials */
.stats-grid .stat-card:nth-child(1)::before { background: radial-gradient(ellipse at 30% 20%, rgba(52,211,153,0.06), transparent 70%); }
.stats-grid .stat-card:nth-child(1):hover { border-color: rgba(52,211,153,0.15); box-shadow: 0 8px 24px rgba(52,211,153,0.08); }

.stats-grid .stat-card:nth-child(2)::before { background: radial-gradient(ellipse at 30% 20%, rgba(96,165,250,0.06), transparent 70%); }
.stats-grid .stat-card:nth-child(2):hover { border-color: rgba(96,165,250,0.15); box-shadow: 0 8px 24px rgba(96,165,250,0.08); }

.stats-grid .stat-card:nth-child(3)::before { background: radial-gradient(ellipse at 30% 20%, rgba(248,113,113,0.06), transparent 70%); }
.stats-grid .stat-card:nth-child(3):hover { border-color: rgba(248,113,113,0.15); box-shadow: 0 8px 24px rgba(248,113,113,0.08); }

.stats-grid .stat-card:nth-child(4)::before { background: radial-gradient(ellipse at 30% 20%, rgba(200,162,76,0.06), transparent 70%); }
.stats-grid .stat-card:nth-child(4):hover { border-color: rgba(200,162,76,0.15); box-shadow: 0 8px 24px rgba(200,162,76,0.08); }


/* ── 7. TABLES — Modern Borderless ────────────────────────── */
.table-wrapper {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
}

thead {
  background: rgba(15, 15, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

th {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  border-bottom: 1px solid rgba(200,162,76,0.08);
  background: transparent;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.025);
}

tr {
  transition: background 150ms cubic-bezier(0.16,1,0.3,1);
  position: relative;
}

tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.01);
}

tbody tr:hover {
  background: rgba(200,162,76,0.02);
}

tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}


/* ── 8. MODALS — Premium Glass ────────────────────────────── */
.modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  animation: premiumOverlayIn 250ms cubic-bezier(0.16,1,0.3,1);
}

@keyframes premiumOverlayIn {
  from { opacity: 0; backdrop-filter: blur(0) saturate(100%); }
  to   { opacity: 1; }
}

.modal {
  background: linear-gradient(160deg, rgba(20,20,25,0.95), rgba(12,12,15,0.98));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: premiumModalIn 400ms cubic-bezier(0.16,1,0.3,1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@keyframes premiumModalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    filter: blur(8px);
  }
  60% {
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.modal-header {
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms cubic-bezier(0.16,1,0.3,1),
              background 200ms cubic-bezier(0.16,1,0.3,1),
              transform 300ms cubic-bezier(0.16,1,0.3,1);
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
}


/* ── 9. BUTTONS — Tactile ─────────────────────────────────── */
.btn {
  border-radius: 10px;
  font-weight: 600;
  transition: background 200ms cubic-bezier(0.16,1,0.3,1),
              color 200ms cubic-bezier(0.16,1,0.3,1),
              transform 200ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
}

.btn-primary {
  background: linear-gradient(135deg, #D4AD52, var(--gold), #B8903E);
  color: #0A0A0A;
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #DDB655, #D4AD52, #C8A24C);
  box-shadow: 0 6px 20px rgba(200,162,76,0.3);
  transform: translateY(-1px) scale(1.02);
}

.btn-primary:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(200,162,76,0.15);
  transition-duration: 100ms;
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(200,162,76,0.06);
  border-color: rgba(200,162,76,0.15);
}

.btn-secondary:active {
  transform: scale(0.95);
  transition-duration: 100ms;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  text-decoration: none;
  position: relative;
}


/* ── 10. LOGIN SCREEN — Cinematic ─────────────────────────── */
.login-screen {
  background-image:
    radial-gradient(ellipse 900px 600px at 50% 35%, rgba(200,162,76,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 25% 75%, rgba(200,162,76,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 75% 80%, rgba(200,162,76,0.02) 0%, transparent 60%);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 1px solid rgba(200,162,76,0.04);
  animation: loginRing1 12s linear infinite;
  pointer-events: none;
}

.login-screen::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 700px;
  height: 700px;
  border-radius: 50%;
  border: 1px solid rgba(200,162,76,0.025);
  animation: loginRing2 18s linear infinite reverse;
  pointer-events: none;
}

@keyframes loginRing1 {
  from { transform: translate(-50%, -55%) rotate(0deg); }
  to   { transform: translate(-50%, -55%) rotate(360deg); }
}

@keyframes loginRing2 {
  from { transform: translate(-50%, -55%) rotate(0deg); }
  to   { transform: translate(-50%, -55%) rotate(360deg); }
}

.login-card {
  position: relative;
  z-index: 1;
  animation: loginCardAppearPremium 800ms cubic-bezier(0.16,1,0.3,1);
}

@keyframes loginCardAppearPremium {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
    filter: blur(8px);
  }
  50% { filter: blur(0); }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  margin-bottom: 32px;
  filter: drop-shadow(0 0 32px rgba(200,162,76,0.2));
}

.login-logo img,
.login-logo svg {
  width: 100px;
  height: auto;
}

.login-title {
  font-size: 30px;
  letter-spacing: 6px;
  text-shadow: 0 0 40px rgba(200,162,76,0.2);
}

.login-card .form-group input,
.login-card input[type="password"],
.login-card input[type="text"],
.login-card input[type="email"] {
  height: 52px;
  border-radius: 12px;
  font-size: 15px;
  padding: 0 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 200ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
}

.login-card .form-group input:focus,
.login-card input:focus {
  border-color: rgba(200,162,76,0.3);
  box-shadow: 0 0 0 3px rgba(200,162,76,0.08);
}

/* Pulsing gold border on login card container */
.login-card .card,
.login-card > div:first-of-type {
  border: 1px solid rgba(200,162,76,0.1);
  border-radius: 20px;
  animation: loginCardPulse 4s ease-in-out infinite;
}

@keyframes loginCardPulse {
  0%, 100% { border-color: rgba(200,162,76,0.1); }
  50%      { border-color: rgba(200,162,76,0.2); }
}


/* ── 11. GLOBAL TYPOGRAPHY ────────────────────────────────── */
h1, h2, h3, .page-title, .modal-title, .card-title {
  letter-spacing: -0.5px;
}

body {
  font-variant-numeric: tabular-nums lining-nums;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Improve muted text minimum contrast */
.text-muted,
.feed-detail,
.stat-label,
.briefing-greeting {
  color: #999;
}


/* ── 12. MOTION — Fluid ───────────────────────────────────── */

/* Page content transition */
#mainContent {
  animation: pageTransition 300ms cubic-bezier(0.16,1,0.3,1);
}

@keyframes pageTransition {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Toast — spring overshoot from right */
.toast {
  background: linear-gradient(145deg, rgba(20,20,24,0.94), rgba(12,12,15,0.97));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  animation: toastSpringPremium 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSpringPremium {
  from {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Skeleton shimmer — gold-tinted */
.skeleton,
.loading-state .spinner,
[class*="shimmer"] {
  background-image: linear-gradient(
    90deg,
    rgba(200,162,76,0.02) 0%,
    rgba(200,162,76,0.06) 40%,
    rgba(200,162,76,0.02) 100%
  );
  background-size: 200% 100%;
  animation: goldShimmer 2.5s ease-in-out infinite;
}

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

/* Reduced motion: kill all transforms and animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
  .quick-action-card,
  .today-class-chip,
  .stat-card,
  .feed-item,
  .nav-item,
  .btn,
  .modal,
  .toast {
    transform: none;
    animation: none;
  }
}


/* ── 13. SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(200, 162, 76, 0.2);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 162, 76, 0.35);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(200,162,76,0.2) transparent;
}


/* ── 14. SCHEDULE PAGE — Glass Cards with Type Borders ────── */
.schedule-classes {
  background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(12,12,15,0.95));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  overflow: hidden;
}

.schedule-class {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  border-left: 3px solid transparent;
  transition: background 180ms cubic-bezier(0.16,1,0.3,1),
              border-left-color 180ms cubic-bezier(0.16,1,0.3,1);
}

.schedule-class:hover {
  background: rgba(255,255,255,0.02);
}

/* Type-colored left borders */
.schedule-class .schedule-badge.gi ~ .schedule-badge,
.schedule-class:has(.schedule-badge.gi) {
  border-left-color: rgba(59,130,246,0.5);
}

.schedule-class:has(.schedule-badge.no-gi) {
  border-left-color: rgba(168,85,247,0.5);
}

.schedule-class:has(.schedule-badge.wrestling) {
  border-left-color: rgba(239,68,68,0.5);
}

.schedule-class:has(.schedule-badge.open) {
  border-left-color: rgba(34,197,94,0.5);
}

.schedule-class.now {
  border-left: 3px solid var(--gold);
  background: rgba(200,162,76,0.03);
  animation: schedNowPulse 3s ease-in-out infinite;
}

@keyframes schedNowPulse {
  0%, 100% { background: rgba(200,162,76,0.03); }
  50%      { background: rgba(200,162,76,0.05); }
}

/* Day tabs — pill-shaped */
.schedule-day-tab {
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  transition: all 250ms cubic-bezier(0.16,1,0.3,1);
}

.schedule-day-tab.active {
  background: linear-gradient(135deg, #D4AD52, var(--gold));
  border-color: var(--gold);
  color: #000;
  box-shadow: 0 4px 12px rgba(200,162,76,0.2);
}

.schedule-day-tab:hover:not(.active) {
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.schedule-filter {
  border-radius: 16px;
  padding: 6px 14px;
  transition: all 200ms cubic-bezier(0.16,1,0.3,1);
}

.schedule-filter.active {
  background: rgba(200,162,76,0.08);
  border-color: rgba(200,162,76,0.3);
  color: var(--gold);
}


/* ── 15. MOBILE REFINEMENTS ───────────────────────────────── */
@media (max-width: 768px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .quick-action-card,
  .btn,
  .nav-item,
  .schedule-day-tab,
  .recipient-chip,
  .messages-tab {
    min-height: 48px;
  }

  .sidebar {
    transition: transform 350ms cubic-bezier(0.16,1,0.3,1);
  }

  .sidebar-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .modal {
    border-radius: 20px 20px 0 0;
    animation: premiumModalMobileIn 350ms cubic-bezier(0.16,1,0.3,1);
  }

  @keyframes premiumModalMobileIn {
    from {
      transform: translateY(100%);
      opacity: 0.8;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .today-classes-row {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .today-class-chip {
    scroll-snap-align: start;
    min-width: 110px;
  }

  .page-title {
    font-size: 20px;
  }
}


/* ── 16. SEARCH OVERLAY — Elevated ────────────────────────── */
.search-overlay {
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.search-modal {
  background: linear-gradient(160deg, rgba(20,20,25,0.96), rgba(12,12,15,0.98));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
  animation: premiumModalIn 300ms cubic-bezier(0.16,1,0.3,1);
}

.search-modal input {
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.search-result-item {
  padding: 12px 20px;
  border-radius: 10px;
  margin: 2px 6px;
  transition: background 150ms cubic-bezier(0.16,1,0.3,1),
              transform 150ms cubic-bezier(0.16,1,0.3,1);
}

.search-result-item:hover,
.search-result-item.focused {
  background: rgba(200,162,76,0.04);
  transform: translateX(2px);
}

.search-result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(200,162,76,0.1), rgba(200,162,76,0.04));
  font-size: 13px;
}


/* ── 17. FORM INPUTS — Elevated ───────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 200ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(200,162,76,0.3);
  box-shadow: 0 0 0 3px rgba(200,162,76,0.06);
  outline: none;
}


/* ── 18. CARDS — Base Glass Lift ──────────────────────────── */
.card {
  background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(12,12,15,0.95));
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-header {
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: -0.1px;
}


/* ── 19. BELT RANK BAR — Polished ─────────────────────────── */
.belt-rank-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.belt-rank-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  transition: border-color 200ms cubic-bezier(0.16,1,0.3,1),
              background 200ms cubic-bezier(0.16,1,0.3,1);
}

.belt-rank-item:hover {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.belt-dot-sm {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}


/* ── 20. RECIPIENT CHIPS — Pill polish ────────────────────── */
.recipient-chip {
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.16,1,0.3,1);
}

.recipient-chip:hover {
  background: rgba(200,162,76,0.06);
  border-color: rgba(200,162,76,0.15);
  color: var(--text);
}

.recipient-chip.selected {
  background: rgba(200,162,76,0.1);
  border-color: rgba(200,162,76,0.3);
  color: var(--gold);
}


/* ── 21. MESSAGES TABS — Elevated ─────────────────────────── */
.messages-tab {
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all 200ms cubic-bezier(0.16,1,0.3,1);
}

.messages-tab.active {
  background: rgba(200,162,76,0.1);
  color: var(--gold);
  border-color: rgba(200,162,76,0.2);
}


/* ── 22. MEMBER NAME LINKS ────────────────────────────────── */
.member-name-link {
  font-weight: 600;
  transition: color 150ms cubic-bezier(0.16,1,0.3,1);
}

.member-name-link:hover {
  color: #DDB655;
  text-decoration: none;
}


/* ── 23. STATUS BADGES — Glass pills ─────────────────────── */
.status-badge,
.badge {
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}


/* ── 24. CONFIRM DIALOG — Premium ─────────────────────────── */
.confirm-overlay {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.confirm-dialog {
  background: linear-gradient(160deg, rgba(20,20,25,0.96), rgba(12,12,15,0.98));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55);
}


/* ── 25. GLOBAL FOCUS RING ────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(200,162,76,0.4);
  outline-offset: 2px;
}

/* ── QUICK ACTION CARD CLICK FIX ────────────────────────── */
.quick-action-card[data-qa] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.quick-action-card[data-qa] * {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   KIOSK MODE — iPad Front Desk
   Accessed via admin.labyrinth.vision?kiosk=1
   Full screen, two big buttons, zero distractions
   ═══════════════════════════════════════════════════════════ */

.kiosk-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 48px);
  padding: 40px 24px;
  text-align: center;
  animation: kioskFadeIn 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kioskFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.kiosk-header {
  margin-bottom: 48px;
}

.kiosk-header svg {
  margin-bottom: 16px;
  filter: drop-shadow(0 0 24px rgba(200,162,76,0.2));
  animation: kioskLogoPulse 3s ease-in-out infinite;
}

@keyframes kioskLogoPulse {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(200,162,76,0.15)); }
  50% { filter: drop-shadow(0 0 32px rgba(200,162,76,0.3)); }
}

.kiosk-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 6px;
  margin-bottom: 8px;
  text-shadow: 0 0 24px rgba(200,162,76,0.15);
}

.kiosk-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
}

.kiosk-actions {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 700px;
  margin-bottom: 48px;
}

.kiosk-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 32px;
  background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(12,12,15,0.95));
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 300ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  font-family: inherit;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.kiosk-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(200,162,76,0.06), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.kiosk-btn:hover::before,
.kiosk-btn:active::before { opacity: 1; }

.kiosk-btn:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(200,162,76,0.2);
  box-shadow: 0 16px 48px rgba(0,0,0,0.3), 0 0 0 1px rgba(200,162,76,0.1);
}

.kiosk-btn:active {
  transform: scale(0.97);
  transition-duration: 100ms;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.kiosk-btn-waiver { border-color: rgba(251,191,36,0.12); }
.kiosk-btn-waiver:hover { border-color: rgba(251,191,36,0.3); box-shadow: 0 16px 48px rgba(251,191,36,0.08), 0 0 0 1px rgba(251,191,36,0.15); }
.kiosk-btn-waiver::before { background: radial-gradient(ellipse at 50% 0%, rgba(251,191,36,0.08), transparent 60%); }

.kiosk-btn-member { border-color: rgba(59,130,246,0.12); }
.kiosk-btn-member:hover { border-color: rgba(59,130,246,0.3); box-shadow: 0 16px 48px rgba(59,130,246,0.08), 0 0 0 1px rgba(59,130,246,0.15); }
.kiosk-btn-member::before { background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.08), transparent 60%); }

.kiosk-btn-icon {
  font-size: 56px;
  line-height: 1;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              background 300ms ease;
}

.kiosk-btn:hover .kiosk-btn-icon {
  transform: scale(1.1);
  background: rgba(200,162,76,0.08);
}

.kiosk-btn-text { text-align: center; }

.kiosk-btn-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.kiosk-btn-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 240px;
}

.kiosk-footer {
  margin-top: auto;
}

.kiosk-exit-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
  -webkit-appearance: none;
}

.kiosk-exit-btn:hover {
  color: var(--text-muted);
  border-color: var(--border-hover);
}

/* Responsive: stack buttons vertically on phone */
@media (max-width: 600px) {
  .kiosk-actions {
    flex-direction: column;
    gap: 16px;
  }
  .kiosk-btn {
    padding: 36px 24px;
  }
  .kiosk-btn-icon {
    font-size: 44px;
    width: 80px;
    height: 80px;
  }
  .kiosk-btn-title {
    font-size: 20px;
  }
  .kiosk-title {
    font-size: 22px;
    letter-spacing: 4px;
  }
}

/* iPad landscape optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .kiosk-container {
    padding: 60px 40px;
  }
  .kiosk-btn {
    padding: 56px 40px;
  }
  .kiosk-btn-icon {
    font-size: 64px;
    width: 108px;
    height: 108px;
  }
  .kiosk-btn-title {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kiosk-container,
  .kiosk-btn,
  .kiosk-btn-icon,
  .kiosk-header svg {
    animation: none;
    transition: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE OPTIMIZATION — iPhone/Android
   Fixes: layout spacing, button grid, modals as bottom sheets,
   class chips scroll, header condensing, touch targets
   ═══════════════════════════════════════════════════════════ */

/* ── Condensed mobile header ── */
@media (max-width: 768px) {
  .page-header {
    padding: 12px 0;
    margin-bottom: 12px;
  }
  .page-title {
    font-size: 20px;
  }
  .page-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 32px;
  }

  /* Hide the Dashboard/Financials toggle text, make it compact */
  .dashboard-view-toggle {
    margin-bottom: 8px !important;
  }
  .view-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* Main content tighter padding */
  .main-content {
    padding: 12px;
  }

  /* Dashboard sections tighter spacing */
  .dashboard-section {
    margin-bottom: 14px;
  }
  .dashboard-section-header {
    font-size: 12px;
    margin-bottom: 8px;
  }
}

/* ── Quick action grid: 2 columns, compact on mobile ── */
@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .quick-action-card {
    padding: 14px 8px;
    border-radius: 12px;
  }
  .quick-action-card[data-qa] {
    min-height: 80px;
  }
  .quick-action-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
  }
  .quick-action-label {
    font-size: 11px;
  }
}

/* ── Today's classes: horizontal scroll with fade hint ── */
@media (max-width: 768px) {
  .today-classes-row {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 2px;
    gap: 8px;
  }
  .today-class-chip {
    scroll-snap-align: start;
    min-width: 100px;
    padding: 10px 12px;
  }
  .today-class-time {
    font-size: 13px;
  }
  .today-class-name {
    font-size: 10px;
  }
}

/* ── Briefing card compact ── */
@media (max-width: 768px) {
  .briefing-card {
    padding: 14px;
    margin-bottom: 12px;
  }
  .briefing-day {
    font-size: 15px;
  }
  .briefing-greeting {
    font-size: 11px;
  }
  .briefing-item {
    font-size: 13px;
    padding: 4px 0;
  }
}

/* ── Trial feed compact ── */
@media (max-width: 768px) {
  .trial-card {
    padding: 10px 0;
    gap: 10px;
  }
  .trial-date-block {
    min-width: 46px;
    padding: 6px 4px;
  }
  .trial-date-num {
    font-size: 18px;
  }
  .trial-name, .trial-name-link {
    font-size: 13px;
  }
  .trial-class-name, .trial-time {
    font-size: 11px;
  }
  .trial-quick-actions {
    gap: 2px;
  }
  .trial-action-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* ── Feed items compact ── */
@media (max-width: 768px) {
  .feed-item {
    padding: 8px 2px;
    gap: 8px;
  }
  .feed-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .feed-name {
    font-size: 12px;
  }
  .feed-detail {
    font-size: 11px;
  }
  .feed-amount {
    font-size: 13px;
  }
  .feed-date {
    font-size: 10px;
  }
}

/* ── Belt rank bar compact ── */
@media (max-width: 768px) {
  .belt-rank-bar {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .belt-rank-item {
    font-size: 11px;
    gap: 4px;
  }
}

/* ── Modals as bottom sheets on mobile ── */
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    animation: mobileSheetUp 350ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes mobileSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-header {
    padding: 16px 16px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: inherit;
  }
  .modal-title {
    font-size: 16px;
  }
  .modal-body {
    padding: 16px;
    max-height: calc(92vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    background: inherit;
  }

  /* Onboarding wizard mobile */
  .onboarding-wizard {
    height: 92vh;
    max-width: 100%;
  }
  .wizard-body {
    padding: 16px;
  }
  .wizard-plan-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Kiosk mode mobile ── */
@media (max-width: 768px) {
  .kiosk-container {
    padding: 24px 16px;
    justify-content: flex-start;
    padding-top: 40px;
  }
  .kiosk-header {
    margin-bottom: 32px;
  }
  .kiosk-header img {
    max-height: 100px !important;
  }
  .kiosk-title {
    font-size: 20px;
    letter-spacing: 4px;
  }
  .kiosk-subtitle {
    font-size: 14px;
  }
  .kiosk-actions {
    flex-direction: column;
    gap: 12px;
  }
  .kiosk-btn {
    padding: 28px 20px;
    flex-direction: row;
    gap: 16px;
    text-align: left;
  }
  .kiosk-btn-icon {
    font-size: 36px;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }
  .kiosk-btn-title {
    font-size: 18px;
  }
  .kiosk-btn-desc {
    font-size: 12px;
    max-width: none;
  }
}

/* ── Mobile sidebar refinement ── */
@media (max-width: 768px) {
  .sidebar {
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
  }
  .sidebar-header {
    padding: 14px 16px 12px;
  }
  .nav-item {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* ── iOS safe areas ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .main-content {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .modal {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .pos-mobile-footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .kiosk-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Touch feedback on mobile ── */
@media (hover: none) and (pointer: coarse) {
  .quick-action-card[data-qa]:active {
    transform: scale(0.95);
    transition-duration: 80ms;
    opacity: 0.85;
  }
  .nav-item:active {
    background: rgba(200,162,76,0.1);
  }
  .today-class-chip:active {
    transform: scale(0.97);
  }
  .btn:active {
    transform: scale(0.96);
  }
}

/* ── Login mobile tweaks ── */
@media (max-width: 480px) {
  .login-logo-img, .login-logo img {
    max-height: 100px !important;
  }
  .login-title {
    font-size: 22px;
    letter-spacing: 3px;
  }
  .login-subtitle {
    font-size: 11px;
  }
}

/* ── Search overlay mobile ── */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 0;
    align-items: flex-start;
  }
  .search-modal {
    max-width: 100%;
    width: 100%;
    border-radius: 0 0 16px 16px;
    max-height: 80vh;
  }
  .search-modal input {
    padding: 14px 16px;
    font-size: 16px;
  }
}

/* ── Schedule page mobile ── */
@media (max-width: 768px) {
  .schedule-day-tabs {
    gap: 3px;
  }
  .schedule-day-tab {
    padding: 6px 10px;
    font-size: 12px;
  }
  .schedule-class {
    padding: 10px 12px;
    gap: 10px;
  }
  .schedule-time {
    font-size: 12px;
    min-width: 64px;
  }
  .schedule-class-name {
    font-size: 13px;
  }
  .schedule-badge {
    font-size: 9px;
    padding: 1px 6px;
  }
}

/* ── Members table mobile ── */
@media (max-width: 768px) {
  .search-bar {
    margin-bottom: 8px;
  }
  .filter-select {
    min-width: 100px;
    font-size: 12px;
  }
}

/* ── Messages page mobile ── */
@media (max-width: 768px) {
  .messages-tabs {
    width: 100%;
  }
  .messages-tab {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 12px;
  }
  .composer-toolbar {
    flex-wrap: wrap;
  }
  .composer-body {
    min-height: 120px;
  }
}
