/* =============================================
   Sapphire 24 Fitness CRM — Main Stylesheet
   ============================================= */

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

:root {
  --navy:        #0a1128;
  --navy-light:  #121b3d;
  --sapphire:    #1e5aa8;
  --sapphire-lt: #2f6fd6;
  --gold:        #d4a843;
  --gold-lt:     #f0c860;
  --gold-glow:   rgba(212,168,67,0.3);
  --white:       #f0f0f0;
  --text:        #e0e0e0;
  --text-muted:  #8899bb;
  --card-bg:     #0f1935;
  --card-border: #1a2d55;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --error:       #ef4444;
  --radius:      12px;
  --rad-sm:      6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --shadow:      0 4px 20px rgba(0,0,0,0.4);
  --sidebar-w:   200px;
}

html, body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

body {
  width: 100%;
  flex-direction: row;
}

/* ── Sidebar ─────────────────────────────────── */
.crm-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy-light);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.crm-sidebar .logo-area {
  padding: 20px 16px 12px;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
}
.crm-sidebar .logo-area img {
  height: 48px;
  width: auto;
  margin-bottom: 8px;
}
.crm-sidebar .logo-area h1 {
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.crm-sidebar .nav-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
}
.crm-sidebar .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--rad-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.crm-sidebar .nav-links a:hover,
.crm-sidebar .nav-links a.active {
  color: var(--gold);
  background: rgba(212,168,67,0.12);
}
.crm-sidebar .log-link {
  margin-top: auto;
  padding: 8px;
}
.crm-sidebar .log-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Sidebar toggle (mobile) ────────────────── */
.sidebar-toggle-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 99999;
  background: var(--navy-light);
  border: 1px solid var(--card-border);
  color: var(--gold);
  font-size: 22px;
  padding: 6px 12px;
  border-radius: var(--rad-sm);
  cursor: pointer;
  display: none;
}

/* ── Sidebar overlay (mobile) ───────────────── */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  display: none;
}
.sidebar-overlay.open { display: block; }

/* ── Main content ───────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
}

/* ── Footer ──────────────────────────────────── */
.crm-footer {
  margin-top: auto;
  padding: 20px 24px;
  background: var(--navy-light);
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.crm-footer .footer-contact {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
}

/* ── Page ────────────────────────────────────── */
.page {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  width: 100%;
}

/* ── Hero ────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 60px 24px 40px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-bottom: 1px solid var(--card-border);
  width: 100%;
}
.hero img.hero-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px var(--gold-glow));
}
.hero img.hero-full {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 16px;
  border-radius: 0;
  box-shadow: none;
}
.hero h1 {
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 20px;
}
.hero .btn-cta {
  display: inline-block;
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--sapphire), var(--sapphire-lt));
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 0 20px rgba(30,90,168,0.4);
  transition: all 0.3s;
}
.hero .btn-cta:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(30,90,168,0.6);
}

/* ── Section Titles ──────────────────────────── */
.section-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--card-border);
}
.section-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Cards ───────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}
.card:hover {
  border-color: var(--sapphire);
  box-shadow: var(--shadow);
}
.card h3 {
  color: var(--gold);
  font-size: 18px;
  margin-bottom: 8px;
}
.card p, .card ul {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.card ul { padding-left: 18px; }
.card .price {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-lt);
  margin-bottom: 4px;
}
.card .price-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--rad-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--sapphire), var(--sapphire-lt));
  color: #fff;
}
.btn-primary:hover { transform: scale(1.02); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: var(--navy);
}
.btn-gold:hover { transform: scale(1.02); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--sapphire);
  color: var(--sapphire-lt);
}
.btn-outline:hover { background: rgba(30,90,168,0.15); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--error);   color: #fff; }

/* ── Forms ───────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 4px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--rad-sm);
  border: 1px solid var(--card-border);
  background: var(--navy-light);
  color: var(--text);
  font-size: 14px;
}
.form-group textarea { min-height: 80px; resize: vertical; }

/* ── FAQ Accordion ──────────────────────────── */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--rad-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-question {
  padding: 14px 18px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
  padding: 0 18px 14px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  display: none;
}
.faq-item.open .faq-answer { display: block; }

/* ── Tables ──────────────────────────────────── */
.crm-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
.crm-table th, .crm-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  font-size: 14px;
}
.crm-table th {
  color: var(--gold);
  font-weight: 600;
  background: var(--navy-light);
}
.crm-table td { color: var(--text); }
.crm-table tr:hover td { background: rgba(30,90,168,0.08); }

/* ── Status badges ───────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-paid    { background: rgba(34,197,94,0.2);  color: var(--success); }
.badge-overdue { background: rgba(239,68,68,0.2);  color: var(--error); }
.badge-pending { background: rgba(245,158,11,0.2); color: var(--warning); }
.badge-active  { background: rgba(30,90,168,0.2);  color: var(--sapphire-lt); }

/* ── Chart ───────────────────────────────────── */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 0 12px;
  margin-bottom: 20px;
}
.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  max-width: 50px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--sapphire), var(--gold));
  min-height: 4px;
  transition: height 0.4s;
}
.chart-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* ── Access console ──────────────────────────── */
.access-console {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.access-console h3 { color: var(--gold); margin-bottom: 12px; }
.access-result {
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
  border-radius: var(--rad-sm);
  margin: 16px 0;
}
.access-result.allowed {
  color: var(--success);
  background: rgba(34,197,94,0.1);
  border: 2px solid var(--success);
}
.access-result.denied {
  color: var(--error);
  background: rgba(239,68,68,0.1);
  border: 2px solid var(--error);
}

/* ── Toast ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--rad-sm);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: fadeInUp 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--error); }
.toast-info    { background: var(--sapphire); }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Misc ────────────────────────────────────── */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .crm-sidebar {
    transform: translateX(-100%);
  }
  .crm-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle-btn {
    display: block;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .hero h1 { font-size: 28px; }
  .hero img.hero-full { max-width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .chart-bar-container { height: 120px; }
}
