/* ============================================================
   CoachPro – Main Stylesheet  v2
   Design system: fitness_coaching_saas_full_ui.html
   Font: DM Sans + DM Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --brand:        #0052FF;
  --brand-light:  #EBF0FF;
  --brand-dark:   #0039B5;

  --success:      #00C48C;
  --success-bg:   #E6FBF5;
  --warning:      #FF9500;
  --warning-bg:   #FFF4E6;
  --danger:       #FF3B30;
  --danger-bg:    #FFE9E8;
  --neutral:      #8E8E93;

  --bg:           #F2F2F7;
  --surface:      #FFFFFF;
  --surface-2:    #F8F8FA;
  --border:       rgba(0,0,0,0.08);
  --border-strong:rgba(0,0,0,0.14);
  --text:         #1C1C1E;
  --text-muted:   #6D6D72;
  --text-faint:   #AEAEB2;

  --radius-sm:    10px;
  --radius:       14px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);

  --font:         'DM Sans', -apple-system, sans-serif;
  --font-heading: 'DM Sans', -apple-system, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;
  --mono:         'DM Mono', monospace;

  --sidebar-w:    250px;
  --nav-h:        56px;
  --topbar-h:     56px;
  --bottom-nav-h: 80px;
  --max-w:        1100px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p  { color: var(--text-muted); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* ══════════════════════════════════════════════════════════════
   PUBLIC NAVBAR  (home, guide, contact, terms, privacy)
══════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  padding: 0 1.25rem;
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.nav-logo { height: 28px; width: auto; }
.nav-brand a {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1rem;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.03em;
}
.nav-brand span { font-size: 1.25rem; }

.nav-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; color: var(--text);
  padding: .25rem .5rem;
}
.nav-links {
  display: flex; align-items: center; gap: 1.25rem;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500; font-size: .875rem;
  transition: color .15s;
}
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-cta { display: flex; align-items: center; gap: .5rem; margin-left: .5rem; }
.nav-user {
  display: flex; align-items: center; gap: .75rem;
  border-left: 1px solid var(--border);
  padding-left: 1rem; margin-left: .5rem;
  font-size: .85rem; font-weight: 500; color: var(--text-muted);
}

/* Language switcher */
.lang-switch {
  display: flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600;
  border-left: 1px solid var(--border);
  padding-left: .85rem; margin-left: .5rem;
}
.lang-switch a { color: var(--text-muted); }
.lang-switch a.active { color: var(--brand); }
.lang-switch span { color: var(--text-faint); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    gap: .75rem;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-user { border-left: none; padding-left: 0; margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════
   COACH SIDEBAR LAYOUT
   nav.php adds html.has-sidebar and renders <aside class="app-sidebar">
══════════════════════════════════════════════════════════════ */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 150;
  scrollbar-width: none;
}
.app-sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
  padding: 18px 16px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--brand);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  color: #fff; letter-spacing: -0.05em;
  flex-shrink: 0;
}
.sidebar-logo img.nav-logo { height: 22px; width: auto; }
.logo-text {
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text);
  white-space: nowrap;
}
.logo-badge {
  margin-left: auto;
  background: var(--brand-light); color: var(--brand);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 5px;
}

.sidebar-section {
  padding: 4px 10px;
  flex-shrink: 0;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 6px 4px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  transition: all 0.12s ease;
  border: none; background: none;
  width: 100%; text-align: left;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.sidebar-item.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.sidebar-item .si-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-badge.warn { background: var(--warning); }
.sidebar-badge.info { background: var(--brand); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.coach-profile-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  text-decoration: none;
}
.coach-profile-mini:hover { background: var(--bg); }
.coach-av-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0052FF, #00C48C);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.coach-mini-name { font-size: 13px; font-weight: 600; color: var(--text); }
.coach-mini-role { font-size: 11px; color: var(--text-muted); }

/* Sidebar toggle button (mobile) */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 300;
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* When coach sidebar is present: offset main content */
html.has-sidebar .main-content {
  margin-left: var(--sidebar-w);
  max-width: none;
}
html.has-sidebar .main-content {
  padding: 1.5rem 1.5rem 3rem;
}

@media (max-width: 900px) {
  html.has-sidebar .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  html.has-sidebar.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  html.has-sidebar .main-content {
    margin-left: 0;
  }
  .sidebar-toggle-btn { display: flex; }
  html.has-sidebar .main-content {
    padding: 1rem;
    padding-top: 3.5rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   CLIENT BOTTOM NAV
   nav.php adds html.has-bottom-nav and renders .client-bottom-nav
══════════════════════════════════════════════════════════════ */
.client-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: var(--bottom-nav-h);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 150;
  backdrop-filter: blur(12px);
}
.client-bottom-nav .nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 6px 14px;
  border: none; background: none;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.client-bottom-nav .nav-item:hover { text-decoration: none; }
.client-bottom-nav .nav-icon {
  width: 42px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; border-radius: 10px;
  transition: background 0.15s;
}
.client-bottom-nav .nav-item.active .nav-icon { background: var(--brand-light); }
.client-bottom-nav .nav-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-faint); letter-spacing: 0.01em;
}
.client-bottom-nav .nav-item.active .nav-label { color: var(--brand); }

/* Client header bar */
.client-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.client-topbar .brand-name {
  font-size: 16px; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text);
}
.client-topbar-right {
  display: flex; align-items: center; gap: 8px;
}
.client-avatar-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #0052FF, #00C48C);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  text-decoration: none;
  border: none; cursor: pointer;
}
.unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

html.has-bottom-nav .main-content {
  padding-bottom: calc(var(--bottom-nav-h) + 1rem);
}
html.has-bottom-nav {
  background: var(--bg);
}

/* ── Main Content Layout ─────────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.main-content > * + * { margin-top: 1rem; }

/* ══════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: .875rem;
  border: 1.5px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
  min-height: 44px;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; }
.btn img { width: 1rem !important; height: 1rem !important; object-fit: contain; flex-shrink: 0; }

.btn-primary {
  background: var(--brand); color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,82,255,.2);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline {
  background: transparent; color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover { background: var(--brand-light); }
.btn-danger {
  background: var(--danger); color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { opacity: .9; }
.btn-ghost {
  background: var(--bg); color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-full { width: 100%; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; min-height: 34px; }
.btn-icon { background: none; border: none; padding: .25rem; color: var(--text-muted); font-size: 1rem; }
.btn-icon:hover { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600; font-size: .82rem;
  color: var(--text); margin-bottom: .35rem;
  letter-spacing: 0.01em;
}
.form-group label small { font-weight: 400; color: var(--text-muted); }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  min-height: 44px;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,82,255,.1);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* Plan selection */
.plan-options {
  display: flex; gap: .75rem; align-items: stretch;
  margin: .5rem 0 1rem;
}
.plan-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: .5rem;
  padding: .9rem 1rem; border-radius: 12px; border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer; transition: all .18s ease;
  flex: 1 1 0;
}
.plan-option:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,82,255,.08); }
.plan-option input[type="radio"] { accent-color: var(--brand); }
.plan-option strong { font-weight: 700; color: var(--text); font-size: .9rem; }
.plan-price { color: var(--text-muted); font-weight: 600; margin-top: .2rem; font-size: .85rem; }
@media (max-width: 680px) { .plan-options { flex-direction: column; } }

/* ══════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════ */
.alert {
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 500; font-size: .875rem;
}
.alert-error   { background: var(--danger-bg); color: #c0392b; border: 1px solid rgba(255,59,48,.2); }
.alert-success { background: var(--success-bg); color: #057a55; border: 1px solid rgba(0,196,140,.2); }
.alert-warning { background: var(--warning-bg); color: #9a6800; border: 1px solid rgba(255,149,0,.2); }
.alert-danger  { background: var(--danger-bg); color: #c0392b; border: 1px solid rgba(255,59,48,.2); }
.notice-success { border-left: 4px solid var(--success); background: var(--success-bg); }
.error-list { color: var(--danger); padding-left: 1.15rem; }
.text-danger { color: var(--danger) !important; }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .03em;
}
.badge-warning { background: var(--warning-bg); color: #9a6800; }
.badge-danger  { background: var(--danger-bg); color: #c0392b; }
.badge-success { background: var(--success-bg); color: #057a55; }
.badge-info    { background: var(--brand-light); color: var(--brand); }

/* Payment status */
.payment-status { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.status-paid    { background: var(--success-bg); color: #057a55; }
.status-unpaid  { background: var(--danger-bg); color: #c0392b; }
.status-pending { background: var(--warning-bg); color: #9a6800; }
.status-unknown { background: var(--surface-2); color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  background: var(--surface-2);
  font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint);
  padding: .6rem .85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════════ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 1.5rem;
}
.auth-container {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-md);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo .logo-icon { width: 56px; height: 56px; display: block; margin: 0 auto .6rem; border-radius: 14px; }
.auth-logo h1 { font-size: 1.5rem; letter-spacing: -0.03em; }
.auth-logo p  { color: var(--text-muted); font-size: .875rem; margin-top: .3rem; }
.auth-form { display: flex; flex-direction: column; gap: .25rem; }
.auth-links { text-align: center; margin-top: .75rem; font-size: .85rem; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
══════════════════════════════════════════════════════════════ */

/* Dashboard header */
.dashboard-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem;
}
.dashboard-header .subtitle { color: var(--text-muted); font-size: .875rem; margin-top: .2rem; }
.header-stats { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* KPI cards */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.kpi-icon.blue { background: var(--brand-light); }
.kpi-icon.green { background: var(--success-bg); }
.kpi-icon.warn { background: var(--warning-bg); }
.kpi-icon.red { background: var(--danger-bg); }
.kpi-val { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; color: var(--text); line-height: 1; margin-bottom: 4px; }
.kpi-delta { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.warn { color: var(--warning); }

/* Welcome bar */
.welcome-bar { margin-bottom: 1.25rem; }
.welcome-bar h2 { font-size: 1.35rem; letter-spacing: -0.03em; }
.welcome-bar p  { color: var(--text-muted); font-size: .875rem; margin-top: .15rem; }
.welcome-bar-link { display: block; text-decoration: none; }

/* Section header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.section-header h3 { font-size: .95rem; letter-spacing: -0.01em; }
.section-link { font-size: .82rem; font-weight: 600; color: var(--brand); }
.dashboard-section { margin-bottom: 1.5rem; }

/* Section with card-hd style */
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.card-hd h3 { font-size: .9rem; font-weight: 700; letter-spacing: -0.01em; }
.card-hd-actions { display: flex; gap: 6px; align-items: center; }

/* Quick stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  display: flex; align-items: center; gap: .65rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon { font-size: 1.4rem; flex-shrink: 0; }
.stat-body { display: flex; flex-direction: column; gap: .05rem; }
.stat-num  { font-weight: 700; font-size: 1.1rem; color: var(--text); letter-spacing: -0.02em; }
.stat-label{ font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.stat-card-link { text-decoration: none; color: inherit; display: block; }
.stat-card-link:hover .stat-card { box-shadow: var(--shadow); }

/* Client grid (coach) */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
  position: relative;
}
.client-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.client-card-header {
  display: flex; align-items: flex-start; gap: .85rem;
  margin-bottom: 1rem; position: relative;
}
.client-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.client-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { font-weight: 700; font-size: .9rem; color: var(--brand); }
.client-info h3 { font-size: .92rem; margin-bottom: .1rem; letter-spacing: -0.01em; }
.client-info p  { font-size: .78rem; color: var(--text-muted); }
.unread-badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: #fff;
  border-radius: 999px; min-width: 20px; height: 20px;
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.client-card-stats {
  display: flex; gap: .75rem;
  margin-bottom: 1rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.client-card-stats .stat { flex: 1; }
.stat-value { font-weight: 600; font-size: .85rem; }
.client-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.client-card-actions .btn { font-size: .78rem; padding: .4rem .6rem; }

/* Invite card */
.invite-card {
  border: 2px dashed var(--brand); background: var(--brand-light);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem;
}
.invite-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700;
}
.invite-result { width: 100%; display: flex; flex-direction: column; gap: .5rem; align-items: center; margin-top: .5rem; }
.invite-result input { font-size: .75rem; text-align: center; }
.copy-confirm { color: var(--success); font-size: .82rem; font-weight: 600; }

/* Client list row style (for coach dashboard list view) */
.client-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s ease;
}
.client-list-row:last-child { border-bottom: none; }
.client-list-row:hover { background: var(--bg); }
.client-list-row.flagged { background: var(--warning-bg); }
.client-av {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.client-av.a1 { background: linear-gradient(135deg,#0052FF,#00C48C); }
.client-av.a2 { background: linear-gradient(135deg,#FF6B6B,#FF9500); }
.client-av.a3 { background: linear-gradient(135deg,#A855F7,#EC4899); }
.client-av.a4 { background: linear-gradient(135deg,#14B8A6,#3B82F6); }
.client-av.a5 { background: linear-gradient(135deg,#F59E0B,#EF4444); }
.client-row-info { flex: 1; min-width: 0; }
.client-row-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.client-row-status { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.client-row-status.alert { color: var(--danger); font-weight: 600; }
.client-row-status.warn  { color: var(--warning); font-weight: 600; }
.activity-bar { display: flex; gap: 2px; align-items: flex-end; height: 20px; }
.ab-bar { width: 4px; border-radius: 2px; background: var(--border-strong); transition: all .2s; }
.ab-bar.active { background: var(--success); }
.ab-bar.low    { background: var(--warning); }
.ab-bar.none   { background: var(--danger); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green  { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red    { background: var(--danger); }
.quick-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.client-list-row:hover .quick-actions { opacity: 1; }
.qa-btn {
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; transition: all .1s;
}
.qa-btn:hover { background: var(--brand-light); border-color: var(--brand); }

/* Progress bar utility */
.mini-prog { background: var(--border); border-radius: 99px; height: 4px; overflow: hidden; }
.mini-prog-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.mini-prog-fill.green { background: var(--success); }
.mini-prog-fill.warn  { background: var(--warning); }
.mini-prog-fill.red   { background: var(--danger); }

/* ── Misc utils ─────────────────────────────────────────────── */
.hidden        { display: none !important; }
.empty-state   { grid-column: 1 / -1; text-align: center; padding: 2.5rem; color: var(--text-muted); }
.empty-day     { text-align: center; padding: 1.75rem; }
.empty-day .hint { font-size: .85rem; margin-top: .4rem; }
.chart-card    { padding: 1.25rem; }
.chart-card canvas { max-height: 260px; }
.inline-form   { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.form-input-inline { width: 120px !important; padding: .45rem .75rem !important; }
.inline-msg    { font-weight: 600; font-size: .875rem; margin-top: .5rem; }
.inline-msg.success { color: var(--success); }
.inline-msg.error   { color: var(--danger); }
.month-nav { display: flex; align-items: center; gap: .75rem; font-weight: 600; }
.has-badge { position: relative; }
.has-badge::after {
  content: ''; position: absolute; top: .4rem; right: .4rem;
  width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,0.35);
}
.modal-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.35); }
.modal-content {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: var(--radius-xl);
  padding: 2rem; width: 100%; max-width: 460px;
  box-shadow: var(--shadow-md);
}
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }
.close-button {
  color: var(--text-muted); float: right;
  font-size: 24px; font-weight: bold; cursor: pointer;
  position: absolute; top: 12px; right: 16px; z-index: 2;
}
.close-button:hover { color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .main-content { padding: 1rem .75rem 2rem; }
  .client-grid  { grid-template-columns: 1fr; }
  .quick-stats  { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .dashboard-header { flex-direction: column; align-items: stretch; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .card { padding: 1rem; }
}
@media (max-width: 480px) {
  .main-content { padding: .75rem .5rem 1.5rem; }
  .quick-stats  { grid-template-columns: 1fr; }
}