:root {
  --gold: #C9A84C;
  --gold-dark: #b8952a;
  --gold-light: #e8c56e;
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-dim: #888;
  --green: #4CAF50;
  --red: #e53e3e;
  --sidebar-w: 240px;
}

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

body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; }

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; margin-left: var(--sidebar-w); padding: 2rem; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); position: fixed; top: 0; left: 0; height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.25rem; display: flex; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-logo span { font-family: 'Bebas Neue', sans-serif; color: var(--gold); font-size: 1rem; letter-spacing: 0.1em; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-section { padding: 1.25rem 1.25rem 0.4rem; font-size: 0.7rem; letter-spacing: 0.12em; color: var(--text-dim); font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1.25rem;
  color: var(--text-dim); text-decoration: none; transition: all 0.2s; font-size: 0.875rem;
}
.nav-item:hover { color: var(--text); background: rgba(201,168,76,0.07); }
.nav-item.active { color: var(--gold); background: rgba(201,168,76,0.12); border-right: 2px solid var(--gold); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem;
}
.sidebar-footer a { color: var(--text-dim); text-decoration: none; }
.sidebar-footer a:hover { color: var(--red); }

/* ── PAGE HEADER ── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.75rem; }
.page-header h1 { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; letter-spacing: 0.05em; color: var(--text); }
.page-sub { color: var(--text-dim); font-size: 0.85rem; }
.header-actions { display: flex; gap: 0.75rem; }

/* ── ALERTS ── */
.alert { padding: 0.875rem 1.25rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: rgba(76,175,80,0.15); border: 1px solid rgba(76,175,80,0.3); color: #81C784; }
.alert-error   { background: rgba(229,62,62,0.15);  border: 1px solid rgba(229,62,62,0.3);  color: #fc8181; }
.alert-warning { background: rgba(201,168,76,0.15); border: 1px solid rgba(201,168,76,0.3); color: var(--gold); }

/* ── IMPERSONATE BAR ── */
.impersonate-bar {
  background: rgba(201,168,76,0.15); border: 1px solid var(--gold);
  padding: 0.75rem 1.25rem; border-radius: 8px; margin-bottom: 1rem;
  color: var(--gold); font-size: 0.875rem;
}
.impersonate-bar a { color: var(--gold); font-weight: 600; }
.impersonate-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.75rem; }

/* ── STATS GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; text-align: center;
}
.stat-card.gold  { border-color: rgba(201,168,76,0.4); }
.stat-card.green { border-color: rgba(76,175,80,0.4);  }
.stat-card.red   { border-color: rgba(229,62,62,0.4);  }
.stat-value { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--gold); line-height: 1; }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red   .stat-value { color: var(--red);   }
.stat-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-sub { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.3rem; }

/* ── DASH GRID ── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }
.dash-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.dash-card-header h3 { font-family: 'Rajdhani', sans-serif; font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.dash-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.dash-row:last-child { border-bottom: none; }
.dash-row-name { font-size: 0.875rem; font-weight: 500; }
.dash-row-sub  { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.2rem; }

/* ── TABLE ── */
.table-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 0.875rem 1rem; text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-approved   { background: rgba(76,175,80,0.15);  color: #81C784; }
.badge-pending    { background: rgba(201,168,76,0.15); color: var(--gold); }
.badge-suspended  { background: rgba(229,62,62,0.15);  color: #fc8181; }
.badge-active     { background: rgba(76,175,80,0.15);  color: #81C784; }
.badge-unpaid     { background: rgba(229,62,62,0.15);  color: #fc8181; }
.badge-overdue    { background: rgba(229,62,62,0.25);  color: #fc8181; }
.badge-cancelled  { background: rgba(100,100,100,0.15);color: #888; }
.badge-paid       { background: rgba(76,175,80,0.15);  color: #81C784; }
.badge-open       { background: rgba(229,62,62,0.15);  color: #fc8181; }
.badge-resolved   { background: rgba(76,175,80,0.15);  color: #81C784; }
.badge-plan       { background: rgba(201,168,76,0.15); color: var(--gold); }
.badge-lead-new       { background: rgba(201,168,76,0.15); color: var(--gold); }
.badge-lead-contacted { background: rgba(33,150,243,0.15); color: #64B5F6; }
.badge-lead-converted { background: rgba(76,175,80,0.15);  color: #81C784; }
.badge-lead-lost      { background: rgba(100,100,100,0.15); color: #888; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text); cursor: pointer; font-size: 0.875rem;
  text-decoration: none; font-family: 'Inter', sans-serif; transition: all 0.2s; white-space: nowrap;
}
.btn:hover { border-color: #555; background: #222; }
.btn-gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold-light)); color: #000; border: none; font-weight: 700; }
.btn-gold:hover { opacity: 0.9; }
.btn-green { background: rgba(76,175,80,0.2); border-color: rgba(76,175,80,0.4); color: #81C784; }
.btn-red   { background: rgba(229,62,62,0.2);  border-color: rgba(229,62,62,0.4);  color: #fc8181; }
.btn-sm    { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
.btn-full  { width: 100%; }

/* ── FORMS ── */
.form-card  { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 2rem; max-width: 700px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  padding: 0.75rem; border-radius: 6px; font-family: 'Inter', sans-serif; font-size: 0.875rem;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--gold);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group small { display: block; margin-top: 0.4rem; color: var(--text-dim); font-size: 0.75rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── FILTER TABS ── */
.filter-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.tab { padding: 0.5rem 1.25rem; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer; text-decoration: none; font-size: 0.875rem; transition: all 0.2s; }
.tab:hover { color: var(--text); border-color: #555; }
.tab.active { background: rgba(201,168,76,0.15); border-color: rgba(201,168,76,0.4); color: var(--gold); }

/* ── DETAIL GRID ── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.detail-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }
.detail-card h3 { font-family: 'Rajdhani', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1.25rem; color: var(--gold); }
.detail-card.full-width { grid-column: 1 / -1; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-dim); }

/* ── MESSAGES ── */
.messages-layout { display: grid; grid-template-columns: 220px 1fr 280px; gap: 1.25rem; height: calc(100vh - 10rem); }
.trainer-list { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; overflow-y: auto; }
.trainer-list-header { padding: 1rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.trainer-list-item { display: block; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); transition: background 0.2s; }
.trainer-list-item:hover { background: rgba(255,255,255,0.03); }
.trainer-list-item.active { background: rgba(201,168,76,0.1); border-right: 2px solid var(--gold); }
.trainer-list-name { font-size: 0.875rem; font-weight: 500; }
.trainer-list-email { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.2rem; }
.message-thread { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; }
.thread-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.thread-header h3 { font-weight: 600; }
.thread-header span { font-size: 0.8rem; color: var(--text-dim); }
.thread-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.thread-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); }
.thread-compose { padding: 1rem; border-top: 1px solid var(--border); }
.thread-compose input { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 0.6rem; border-radius: 6px; margin-bottom: 0.5rem; font-family: 'Inter', sans-serif; }
.thread-compose textarea { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 0.6rem; border-radius: 6px; resize: none; height: 80px; font-family: 'Inter', sans-serif; }
.compose-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.message-bubble { padding: 0.875rem 1rem; border-radius: 8px; max-width: 85%; }
.message-bubble.admin { background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.2); align-self: flex-end; }
.message-bubble.trainer { background: var(--bg2); border: 1px solid var(--border); align-self: flex-start; }
.msg-subject { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.4rem; color: var(--gold); }
.msg-body { font-size: 0.875rem; line-height: 1.6; }
.msg-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.5rem; text-align: right; }
.broadcast-panel { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; overflow-y: auto; }
.broadcast-header { font-family: 'Rajdhani', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1.25rem; color: var(--gold); }

/* ── VIDEO GRID ── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.video-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.vimeo-wrapper { position: relative; padding-bottom: 56.25%; }
.vimeo-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-info { padding: 1rem; }
.video-title { font-weight: 600; margin-bottom: 0.4rem; }
.video-desc { font-size: 0.8rem; color: var(--text-dim); }

/* ── CHANGELOG ── */
.changelog-list { display: flex; flex-direction: column; gap: 1rem; }
.changelog-entry { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }
.changelog-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.changelog-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.5rem; }
.changelog-desc { color: var(--text-dim); font-size: 0.875rem; line-height: 1.6; }
.changelog-date, .changelog-author { font-size: 0.75rem; color: var(--text-dim); }
.changelog-type { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.2rem 0.5rem; border-radius: 4px; }
.type-major      { background: rgba(201,168,76,0.2); color: var(--gold); }
.type-improvement{ background: rgba(33,150,243,0.2); color: #64B5F6; }
.type-bugfix     { background: rgba(76,175,80,0.2);  color: #81C784; }
.version-tag { font-family: monospace; font-size: 0.8rem; background: rgba(201,168,76,0.15); color: var(--gold); padding: 0.2rem 0.5rem; border-radius: 4px; }
.version-guide { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.version-guide h4 { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.vguide-row { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0; font-size: 0.875rem; color: var(--text-dim); }
.vbadge { font-family: monospace; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.vbadge.major       { background: rgba(201,168,76,0.2); color: var(--gold); }
.vbadge.improvement { background: rgba(33,150,243,0.2); color: #64B5F6; }
.vbadge.bugfix      { background: rgba(76,175,80,0.2);  color: #81C784; }

/* ── BILLING ── */
.stripe-notice { display: flex; gap: 1rem; align-items: flex-start; background: rgba(33,150,243,0.08); border: 1px solid rgba(33,150,243,0.25); border-radius: 10px; padding: 1.25rem 1.5rem; margin-top: 2rem; }
.stripe-notice span { font-size: 1.5rem; }
.stripe-notice strong { display: block; margin-bottom: 0.3rem; color: #64B5F6; }
.stripe-notice p { color: var(--text-dim); font-size: 0.85rem; }

/* ── AI CARD ── */
.ai-card { border-color: rgba(76,175,80,0.3); background: rgba(76,175,80,0.05); }
.ai-card h3 { color: #81C784; }

/* ── CRM TABS ── */
.crm-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.crm-tab { padding: 0.5rem 1.25rem; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer; font-size: 0.875rem; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.crm-tab:hover { color: var(--text); }
.crm-tab.active { background: rgba(201,168,76,0.15); border-color: rgba(201,168,76,0.4); color: var(--gold); }
.section-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-actions h3 { font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.section-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 0.75rem; margin-top: 0.5rem; }

/* ── MODAL ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 100%; max-width: 500px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h3 { font-family: 'Rajdhani', sans-serif; font-size: 1.2rem; font-weight: 600; }
.modal-header button { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.2rem; }

/* ── LOGIN ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at top, #1a1500 0%, #0d0d0d 60%); }
.login-container { width: 100%; max-width: 420px; padding: 1.5rem; }
.login-card { background: var(--bg3); border: 1px solid rgba(201,168,76,0.3); border-radius: 16px; padding: 2.5rem; }
.login-logo { width: 80px; display: block; margin: 0 auto 1.25rem; }
.login-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.75rem; text-align: center; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.4rem; }
.login-sub { text-align: center; color: var(--text-dim); font-size: 0.8rem; margin-bottom: 2rem; }

/* ── MISC ── */
.empty { color: var(--text-dim); text-align: center; padding: 1.5rem; font-size: 0.875rem; }
.link-gold { color: var(--gold); text-decoration: none; font-size: 0.8rem; }
.link-gold:hover { text-decoration: underline; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
code { background: rgba(255,255,255,0.08); padding: 0.15rem 0.4rem; border-radius: 4px; font-family: monospace; font-size: 0.8rem; color: var(--gold); }
