/* Shared shell chrome for coach/client/admin/public areas — loaded after theme.css */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px; background: var(--bg-elevated); border-bottom: 1px solid var(--border);
}
.topbar .brand {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-heading); font-weight: 900; font-size: 18px; letter-spacing: -0.02em;
  text-transform: uppercase;
}
.topbar .brand .brand-52 { color: var(--brand-red); }
.topbar .brand .brand-suffix { font-weight: 700; font-size: 12px; letter-spacing: 0.02em; color: var(--text-muted); text-transform: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 480px) {
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; gap: 8px; }
  .topbar .brand { font-size: 15px; }
  .topbar-actions { gap: 6px; }
  .theme-picker { padding: 3px; gap: 2px; }
  .theme-picker button { padding: 7px 8px; font-size: 9px; }
  .topbar-actions .btn-sm { padding: 8px 10px; font-size: 10px; }
}

.app-main { min-height: calc(100vh - 60px); padding-bottom: 92px; }
.app-main.no-bottom-pad { padding-bottom: 24px; }

/* Mobile bottom nav (coach/client) */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: var(--bg-subtle); border-top: 1px solid var(--border);
  min-height: 54px;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 44px; justify-content: center;
  padding: 4px; font-family: var(--font-heading); font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-muted); border-radius: var(--radius-sm); text-transform: uppercase;
}
.bottom-nav a.active { color: var(--brand-red); }
.bottom-nav svg { width: 22px; height: 22px; }

/* Desktop sidebar (coach/admin) */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0; background: var(--bg-subtle); border-right: 1px solid var(--border);
  padding: 20px 14px; display: none;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; color: var(--text-secondary); margin-bottom: 2px;
}
.sidebar a svg { width: 18px; height: 18px; flex: none; }
.sidebar a.active { background: var(--brand-red-soft); color: var(--brand-red-text); }
.sidebar a:hover:not(.active) { background: var(--surface-raised); color: var(--text-primary); }
.content-area { flex: 1; min-width: 0; }

@media (min-width: 900px) {
  .sidebar { display: block; }
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 24px; }
}

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-title h2 { font-size: 18px; margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stat-tile { padding: 16px; }
.stat-tile .label {
  font-family: var(--font-heading); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); font-weight: 700;
}
.stat-tile .value { font-family: var(--font-heading); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface-raised); color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 14px; flex-shrink: 0;
}

/* "Add to Home Screen" hint — iOS Safari gives no install prompt of its own,
   so clients never discover the Share-sheet route without being told. */
.install-hint {
  position: fixed; z-index: 60;
  left: 12px; right: 12px; bottom: calc(66px + env(safe-area-inset-bottom));
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
}
.install-hint p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
.install-hint strong { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 13px; color: var(--text-primary); }
.install-hint svg { width: 15px; height: 15px; vertical-align: -3px; color: var(--brand-red); }
.install-hint .dismiss {
  flex: none; margin-left: auto; padding: 4px 8px; border: none; background: none;
  color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer;
}
@media (min-width: 900px) { .install-hint { display: none; } }

/* Desktop client menu — the bottom tab bar is hidden at wide widths, so the same
   links sit in the top bar instead. Hidden on phones, where the tab bar wins. */
.topbar-nav { display: none; }
@media (min-width: 900px) {
  .topbar-nav { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
  .topbar-nav a {
    padding: 8px 9px; border-radius: 999px; font-family: var(--font-heading);
    font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); text-decoration: none; transition: color .15s, background .15s;
  }
  .topbar-nav a:hover { color: var(--text-primary); background: var(--bg-subtle); }
  .topbar-nav a.active { color: var(--brand-red); }
}
@media (min-width: 1100px) {
  .topbar-nav { gap: 4px; }
  .topbar-nav a { padding: 8px 14px; }
}
.topbar-actions .btn { white-space: nowrap; }
