@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Inter:wght@400;500;600&display=swap');

:root {
  --brand-dark: #1c1410;
  --brand-burgundy: #3d0c0c;
  --brand-brown: #6b3a2a;
  --brand-gold: #c9a84c;
  --brand-ember: #f59e0b;
  --brand-cream: #f5f0e8;
  --bg: #f2ece0;
  --surface: #faf7f2;
  --text: #1c1410;
  --muted: #7a6a5a;
  --border: #ddd0bb;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--brand-burgundy);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app { min-height: 100vh; position: relative; }

/* ── WATERMARK ─────────────────────────────────────────── */
.tfs-watermark {
  position: fixed;
  bottom: 14px;
  right: 18px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(201,168,76,0.3);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 9999;
}

/* ── PARTICLE CANVAS ───────────────────────────────────── */
#particle-canvas, #particle-canvas-2 {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ── CINEMATIC WELCOME ─────────────────────────────────── */
.scene-wrapper {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #2d0808 0%, #1a0404 50%, #0d0202 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(201,168,76,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

/* ── BOOK ──────────────────────────────────────────────── */
.book-container {
  position: relative;
  z-index: 10;
  cursor: default;
  will-change: transform, opacity;
}

.book-cover {
  position: relative;
  width: 260px;
  height: 340px;
  transform-style: preserve-3d;
}

.book-face {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, #2a0808 0%, #1a0404 40%, #0d0202 100%);
  border: 1.5px solid rgba(201,168,76,0.4);
  border-radius: 4px 10px 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow:
    inset -4px 0 12px rgba(0,0,0,0.5),
    0 0 60px rgba(201,168,76,0.12),
    0 20px 80px rgba(0,0,0,0.7);
}

.book-spine {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, #1a0404, #3d0c0c);
  border-radius: 4px 0 0 4px;
  border-right: 1px solid rgba(201,168,76,0.3);
}

.book-page {
  position: absolute;
  top: 4px; bottom: 4px;
  width: 250px;
  border-radius: 4px 8px 8px 4px;
  background: #f5f0e8;
}
.book-page-1 { right: -4px; opacity: 0.08; }
.book-page-2 { right: -8px; opacity: 0.04; }

.book-emblem {
  width: 110px;
  height: 110px;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.5));
  animation: emberPulse 3s ease-in-out infinite;
}

.book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand-cream);
  letter-spacing: 0.2em;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}

.book-subtitle {
  font-size: 0.6rem;
  color: var(--brand-gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 1rem;
}

@keyframes emberPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(201,168,76,0.4)); }
  50% { filter: drop-shadow(0 0 28px rgba(245,158,11,0.7)); }
}

/* ── ENTER CTA ─────────────────────────────────────────── */
.enter-cta {
  position: relative;
  z-index: 10;
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.enter-cta.visible { opacity: 1; transform: translateY(0); }

.btn-enter {
  background: transparent;
  border: 1.5px solid var(--brand-gold);
  color: var(--brand-gold);
  padding: 0.75rem 2.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn-enter:hover {
  background: rgba(201,168,76,0.12);
  box-shadow: 0 0 20px rgba(201,168,76,0.25);
}

/* ── LOUNGE BACKGROUND (login + dashboard) ─────────────── */
.lounge-bg {
  background:
    linear-gradient(rgba(28,20,16,0.78), rgba(28,20,16,0.85)),
    url('https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1400&q=80') center/cover no-repeat fixed;
}

.lounge-shell {
  min-height: 100vh;
  background:
    linear-gradient(rgba(20,10,8,0.72), rgba(20,10,8,0.65)),
    url('https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1400&q=80') center/cover no-repeat fixed;
  position: relative;
}

.lounge-ambience {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(201,168,76,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── FADE IN ───────────────────────────────────────────── */
.fade-in {
  animation: fadeUp 0.6s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── AUTH ──────────────────────────────────────────────── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
}

.auth-card {
  position: relative;
  z-index: 10;
  background: rgba(250,247,242,0.97);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  border-top: 3px solid var(--brand-gold);
}

.auth-card .logo { text-align: center; margin-bottom: 1.75rem; }
.logo-emblem { width: 64px; height: 64px; margin: 0 auto 0.75rem; }
.auth-card .logo h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--brand-dark);
}
.auth-card .logo p {
  color: var(--brand-brown);
  font-size: 0.72rem;
  margin-top: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.btn {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--brand-brown); color: var(--brand-cream); }

.auth-toggle { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--muted); }
.auth-toggle a { color: var(--brand-brown); cursor: pointer; font-weight: 700; }
.error-msg { color: #b91c1c; font-size: 0.82rem; margin-top: 0.5rem; font-weight: 500; }

/* ── HEADER ────────────────────────────────────────────── */
.header {
  position: relative;
  z-index: 100;
  background: rgba(28,20,16,0.95);
  backdrop-filter: blur(10px);
  color: var(--brand-cream);
  padding: 0.875rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(201,168,76,0.3);
}
.header-brand { display: flex; align-items: center; gap: 0.875rem; }
.header-emblem { width: 38px; height: 38px; flex-shrink: 0; }
.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--brand-cream);
}
.header .slogan { font-size: 0.62rem; opacity: 0.5; letter-spacing: 0.06em; margin-top: 1px; }
.header-right { display: flex; align-items: center; gap: 0.875rem; }
.header-name { color: var(--brand-cream); font-size: 0.82rem; opacity: 0.85; }
.badge {
  background: var(--brand-gold);
  color: var(--brand-dark);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── DASHBOARD ─────────────────────────────────────────── */
.dashboard {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}

.welcome-bar {
  background: rgba(28,20,16,0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--brand-gold);
  color: var(--brand-cream);
}
.welcome-bar h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--brand-cream);
}
.welcome-bar p { color: rgba(245,240,232,0.6); font-size: 0.875rem; margin-top: 5px; }

/* ── GRID / CARDS ──────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.card {
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.card:hover {
  box-shadow: 0 10px 32px rgba(0,0,0,0.3), 0 0 0 1px var(--brand-gold);
  transform: translateY(-3px);
  border-color: var(--brand-gold);
}
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--brand-dark); }
.card p { font-size: 0.875rem; color: var(--muted); }

/* ── COURT-APPROVED CARD ───────────────────────────────── */
.card-court {
  background: rgba(28,20,16,0.92);
  border-color: rgba(201,168,76,0.5);
  position: relative;
  overflow: hidden;
}
.card-court::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(201,168,76,0.08) 0%, transparent 70%);
}
.card-court h3 { color: var(--brand-cream); }
.card-court p { color: rgba(245,240,232,0.6); }
.card-court:hover {
  border-color: var(--brand-gold);
  box-shadow: 0 10px 40px rgba(201,168,76,0.2), 0 0 0 1px var(--brand-gold);
}

.card-phoenix-emblem {
  width: 72px;
  height: 72px;
  margin-bottom: 0.75rem;
  animation: emberPulse 3s ease-in-out infinite;
}

/* ── TAGS ──────────────────────────────────────────────── */
.card .tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tag-community { background: #e8f4e8; color: #2d6a2d; }
.tag-practitioner { background: #fef3cd; color: #7a5a00; }
.tag-all { background: #ede8df; color: #5a4a3a; }
.tag-court { background: rgba(201,168,76,0.2); color: var(--brand-gold); border: 1px solid rgba(201,168,76,0.4); }

/* ── MISC ──────────────────────────────────────────────── */
.logout-btn {
  background: none;
  border: 1px solid rgba(245,240,232,0.25);
  color: var(--brand-cream);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s;
}
.logout-btn:hover { background: rgba(201,168,76,0.12); border-color: var(--brand-gold); }

.coming-soon {
  text-align: center;
  padding: 3rem;
  color: rgba(245,240,232,0.5);
  background: rgba(28,20,16,0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  border: 2px dashed rgba(201,168,76,0.2);
}

/* ── AUTH NOTE (invite-only message) ───────────────────── */
.auth-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
.auth-note a { color: var(--brand-brown); font-weight: 600; }

/* ── INVITE ACTIVATION ─────────────────────────────────── */
.invite-info {
  background: #f2ece0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
}
.invite-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.invite-row:last-child { border-bottom: none; }
.invite-row span { color: var(--muted); }

/* ── ADMIN PANEL ───────────────────────────────────────── */
.admin-form {
  background: rgba(250,247,242,0.95);
  padding: 2rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:640px) { .form-row { grid-template-columns: 1fr; } }

.invite-result { margin-top: 1.5rem; }
.invite-success {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.875rem;
}
.invite-link-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.invite-link-box input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  background: #fff;
  color: var(--text);
}
.invite-link-box button {
  padding: 0.5rem 1rem;
  background: var(--brand-brown);
  color: var(--brand-cream);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.invite-success small { display: block; margin-top: 0.75rem; color: var(--muted); font-size: 0.72rem; }

/* ── ROLE SECTION LABEL ────────────────────────────────── */
.role-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-gold);
  margin-bottom: 1rem;
  opacity: 0.8;
}

/* ── CARD LINK + EXTERNAL ──────────────────────────────── */
.card-link { position: relative; }
.card-external {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 0.75rem;
  color: var(--brand-gold);
  opacity: 0.6;
}
.card-link:hover .card-external { opacity: 1; }

/* ── ROLE TAG COLORS ───────────────────────────────────── */
.tag-participant  { background: #e8f4e8; color: #2d6a2d; }
.tag-professional { background: #fef3cd; color: #7a5a00; }
.tag-partner      { background: #e0e7ff; color: #3730a3; }
.tag-admin        { background: #fee2e2; color: #991b1b; }
.tag-staff        { background: #fef3e2; color: #92400e; }
.tag-tester       { background: #f3f4f6; color: #374151; }
.tag-court        { background: #1c1410; color: var(--brand-gold); }

/* ── MODE TOGGLE ────────────────────────────────────────── */
.mode-toggle-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: transparent;
  border: 1.5px solid var(--brand-gold);
  color: var(--brand-gold);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.mode-toggle-btn:hover { background: rgba(201,168,76,0.12); }
.mode-icon { font-size: 0.95rem; }
.mode-label { display: none; }
@media (min-width: 600px) { .mode-label { display: inline; } }

.mode-bar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 0.5rem; flex-wrap: wrap;
}
.mode-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  border: 1px solid;
}
.mode-pill-academy { background: rgba(245,158,11,0.12); border-color: #f59e0b; color: #92400e; }
.mode-pill-lounge  { background: rgba(61,12,12,0.15); border-color: #6b3a2a; color: var(--brand-gold); }
.mode-desc { font-size: 0.78rem; color: var(--muted); }

/* ── CARD TYPE VARIANTS ─────────────────────────────────── */
.card-type-drive { border-left: 3px solid #1d4ed8; }
.card-type-internal { opacity: 0.72; }
.card-drive-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: #1d4ed8; color: #fff;
  font-size: 0.6rem; font-weight: 700;
  padding: 0.15rem 0.4rem; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ── ADMIN TABS ─────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 0; padding: 0 2rem;
  background: #1c1410; border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.admin-tab {
  padding: 0.85rem 1.25rem;
  background: transparent; border: none;
  color: var(--muted); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent; transition: all 0.2s;
}
.admin-tab:hover { color: var(--brand-cream); }
.admin-tab.active { color: var(--brand-gold); border-bottom-color: var(--brand-gold); }

/* ── ADMIN FORM HELPERS ─────────────────────────────────── */
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

.roles-checkboxes { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.4rem; }
.checkbox-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  color: var(--text);
}
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--brand-gold); cursor: pointer; }

.btn-seed {
  background: transparent; border: 1.5px solid #15803d;
  color: #15803d; padding: 0.5rem 1rem; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-seed:hover { background: rgba(21,128,61,0.1); }

/* ── TOGGLE SWITCH ──────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 38px; height: 22px; margin-right: 0.4rem; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0; background: #ccc; border-radius: 22px; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand-gold); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ── MINI BADGES ────────────────────────────────────────── */
.mini-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 10px;
  color: #fff; text-transform: capitalize; margin-right: 3px;
  vertical-align: middle;
}
.mode-badge-academy { background: #d97706; }
.mode-badge-lounge  { background: #7c3aed; }
.mode-badge-both    { background: #6b5c45; }

/* ── CARDS ADMIN TABLE ──────────────────────────────────── */
.cards-admin-table { display: flex; flex-direction: column; gap: 0.75rem; }
.cards-admin-header {
  display: grid; grid-template-columns: 1fr 140px 90px 100px 120px;
  padding: 0.5rem 1rem; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.cards-admin-row {
  display: grid; grid-template-columns: 1fr 140px 90px 100px 120px;
  align-items: center; padding: 0.85rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; gap: 0.5rem; transition: box-shadow 0.2s;
}
.cards-admin-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card-admin-info { display: flex; align-items: flex-start; gap: 0.6rem; }
.card-admin-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.card-admin-info > div { display: flex; flex-direction: column; gap: 2px; }
.card-admin-info strong { font-size: 0.875rem; }
.card-admin-desc { font-size: 0.72rem; color: var(--muted); }
.card-admin-url { font-size: 0.68rem; color: #1d4ed8; text-decoration: none; word-break: break-all; }
.card-admin-roles { display: flex; flex-wrap: wrap; gap: 3px; }

.btn-sm {
  padding: 0.3rem 0.65rem; font-size: 0.75rem; font-weight: 600;
  border-radius: 6px; border: 1.5px solid var(--border);
  background: transparent; cursor: pointer; transition: all 0.15s;
  color: var(--text);
}
.btn-sm:hover { background: var(--bg); }
.btn-sm-danger { border-color: #fca5a5; color: #b91c1c; }
.btn-sm-danger:hover { background: #fff1f2; }

/* ── MEMBERS TABLE ──────────────────────────────────────── */
.members-table { display: flex; flex-direction: column; gap: 0.6rem; }
.member-row {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.member-email { font-size: 0.78rem; color: var(--muted); }
.member-date { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* ── ANALYTICS ──────────────────────────────────────────── */
.analytics-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.analytics-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem; text-align: center;
}
.stat-number { font-size: 2.2rem; font-weight: 900; color: var(--brand-gold); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-sublabel { font-size: 0.72rem; color: var(--text); margin-top: 0.25rem; font-style: italic; }

.analytics-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.analytics-table th {
  padding: 0.65rem 0.85rem; text-align: left;
  border-bottom: 2px solid var(--border);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.analytics-table td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); }
.analytics-table tr:last-child td { border-bottom: none; }
.analytics-table tr:hover td { background: rgba(201,168,76,0.05); }

/* ── CARD LOADING ───────────────────────────────────────── */
.card-loading {
  text-align: center; padding: 3rem;
  color: var(--muted); font-style: italic;
}

@media (max-width: 640px) {
  .header { flex-direction: column; gap: 0.75rem; }
  .dashboard { padding: 1rem 1rem 5rem; }
  .auth-card { padding: 1.75rem; }
  .book-cover { width: 200px; height: 260px; }
}
