:root {
  --gold: #c8922a;
  --gold-dark: #a8741e;
  --gold-light: #f5ede0;
  --gold-muted: #e8d5b5;
  --bg: #f4f4f5;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f0f2;
  --danger: #dc2626;
  --success: #059669;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow: 0 4px 24px rgb(0 0 0 / 0.06);
  --sidebar-w: 240px;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

.content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.main {
  flex: 1;
  padding: 0 2.5rem 2.5rem;
  max-width: 1200px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--gold-light);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--gold);
  flex-shrink: 0;
}

.brand-icon svg { width: 22px; height: 22px; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand-tagline {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav a:hover {
  background: var(--bg);
  color: var(--text);
}

.nav a.active {
  background: var(--gold-light);
  color: var(--gold-dark);
  font-weight: 600;
}

.nav a.active svg { opacity: 1; color: var(--gold); }

.sidebar-profile {
  margin: 0 0.75rem 0.5rem;
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-muted), var(--gold));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.profile-info { min-width: 0; flex: 1; }

.profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--muted);
}

.sidebar-logout {
  padding: 0.75rem 1.5rem 1.5rem;
}

.sidebar-logout button {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.sidebar-logout button:hover { color: var(--text); }
.sidebar-logout svg { width: 16px; height: 16px; }

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1.25rem;
}

.topbar-greeting {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.topbar-greeting strong { color: var(--text); font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.icon-btn svg { width: 18px; height: 18px; }

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.hero-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  max-width: 420px;
}

.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 220px;
  background: #ddd;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Quick actions ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s;
}

.quick-card:hover { box-shadow: var(--shadow-sm); }

.quick-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gold-light);
  display: grid;
  place-items: center;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.quick-card-icon svg { width: 18px; height: 18px; }

.quick-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.quick-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
}

.quick-card-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  margin-top: 0.25rem;
}

.quick-card-link:hover { color: var(--gold-dark); }

/* ── Section headers ── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.section-header p {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.section-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Search ── */
.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  padding: 0.6rem 0.875rem 0.6rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  width: 220px;
  background: var(--surface);
}

.search-box input:focus {
  outline: 2px solid var(--gold-muted);
  border-color: var(--gold);
}

/* ── Exercise layout ── */
.exercise-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.muscle-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.muscle-nav a {
  padding: 0.55rem 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.muscle-nav a:hover { background: var(--surface); color: var(--text); }

.muscle-nav a.active {
  background: var(--surface);
  color: var(--gold-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.exercise-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.exercise-list-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gold-muted);
}

.exercise-thumb {
  width: 100px;
  height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(135deg, #374151, #1f2937);
}

.exercise-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exercise-thumb .play-btn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.25);
}

.play-btn span {
  width: 32px;
  height: 32px;
  background: rgb(255 255 255 / 0.9);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.play-btn svg { width: 14px; height: 14px; margin-left: 2px; color: var(--text); }

.exercise-info { flex: 1; min-width: 0; }

.exercise-info h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.exercise-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exercise-chevron {
  color: var(--muted);
  flex-shrink: 0;
}

.exercise-chevron svg { width: 18px; height: 18px; }

/* ── Body part tags ── */
.body-part-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-chest { background: #fef3e2; color: #b45309; }
.tag-back { background: #e0f2fe; color: #0369a1; }
.tag-legs { background: #ede9fe; color: #6d28d9; }
.tag-shoulders { background: #fce7f3; color: #be185d; }
.tag-arms { background: #ecfdf5; color: #047857; }
.tag-core { background: #fff7ed; color: #c2410c; }
.tag-glutes { background: #fdf2f8; color: #9d174d; }
.tag-cardio { background: #eff6ff; color: #1d4ed8; }
.tag-default { background: var(--gold-light); color: var(--gold-dark); }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.pagination button,
.pagination a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.pagination button.active,
.pagination a.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 600;
}

.pagination button:hover:not(.active),
.pagination a:hover:not(.active) {
  border-color: var(--gold-muted);
  color: var(--text);
}

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── Forms ── */
.form-group { margin-bottom: 1.125rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea { min-height: 6rem; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgb(200 146 42 / 0.15);
}

/* ── Buttons ── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--gold);
  color: #fff;
}

.btn-primary:hover { background: var(--gold-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg); border-color: var(--muted); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Tables ── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}

th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: #fafafa; }

/* ── Workout builder ── */
.workout-builder {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
}

.exercise-picker {
  max-height: 70vh;
  overflow-y: auto;
}

.exercise-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.exercise-picker-item:last-child { border-bottom: none; }

.workout-exercise {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.workout-exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.workout-exercise h4 { margin: 0; font-size: 0.95rem; }

.set-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 1fr 1fr 2.5rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.set-row input {
  padding: 0.45rem;
  text-align: center;
  font-size: 0.85rem;
}

.set-num {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Exercise detail ── */
.exercise-detail { max-width: 760px; }

.exercise-detail .instructions {
  white-space: pre-line;
  line-height: 1.75;
  color: var(--text-secondary);
}

.detail-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-hero .exercise-thumb {
  width: 100%;
  height: 180px;
}

/* ── Empty / alerts ── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
}

.empty-state p { margin: 0 0 1rem; }

.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

.meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.text-link {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover { color: var(--gold-dark); }

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin-bottom: 2rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
  line-height: 1.6;
}

.footer-col h4 {
  margin: 0 0 0.875rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.2rem 0;
}

.footer-col a:hover { color: var(--gold); }

.footer-col p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  max-width: 1200px;
}

/* ── Auth ── */
.auth-container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--bg);
}

.auth-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
}

.auth-card h1 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.75rem;
}

.auth-switch {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

.auth-switch a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

/* ── Client form inline ── */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.inline-form input { flex: 1; min-width: 140px; }

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  margin: 0;
  color: var(--text-secondary);
}

.check-row input { width: auto; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-image { height: 180px; }
  .client-hero { grid-template-columns: 1fr; }
  .client-hero-media { height: 260px; }
  .client-feature-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .exercise-layout { grid-template-columns: 1fr; }
  .muscle-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Client website / portal ── */
.client-site {
  min-height: 100vh;
  background: var(--bg);
}

.client-site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.client-site-header .brand { padding: 0; }

.client-site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.client-site-nav a:not(.btn) {
  color: var(--text-secondary);
  text-decoration: none;
}

.client-site-nav a:not(.btn):hover { color: var(--text); }

.client-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 3rem;
  align-items: center;
}

.client-hero-copy h1 {
  margin: 0 0 1rem;
  max-width: 640px;
  font-size: 3rem;
  line-height: 1.05;
  font-weight: 700;
}

.client-hero-copy p {
  margin: 0;
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.client-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.client-hero-media {
  height: 360px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border);
  box-shadow: var(--shadow);
}

.client-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.client-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.client-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.client-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.client-feature h3 {
  margin: 0.8rem 0 0.4rem;
  font-size: 1rem;
}

.client-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.client-band {
  max-width: 1180px;
  margin: 1rem auto;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.client-band h2,
.client-contact h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.client-band p,
.client-contact p {
  margin: 0;
  color: var(--text-secondary);
}

.client-contact {
  text-align: center;
  padding-bottom: 4rem;
}

/* ── Portal ── */
.portal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: linear-gradient(160deg, #fafafa 0%, #f0ebe3 100%);
}

.portal-inner {
  text-align: center;
  max-width: 720px;
  width: 100%;
}

.portal-inner > h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.portal-inner > p {
  color: var(--text-secondary);
  margin: 0 0 2rem;
}

.portal-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.portal-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.portal-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.portal-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gold-light);
  color: var(--gold);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.portal-card-icon svg { width: 24px; height: 24px; }

.portal-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.portal-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

.portal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.portal-card-client .portal-card-icon {
  background: #eff6ff;
  color: #2563eb;
}

.role-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--gold-light);
  color: var(--gold-dark);
  margin-left: 0.5rem;
}

.role-badge.client {
  background: #eff6ff;
  color: #1d4ed8;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  background: var(--gold-light);
  color: var(--gold-dark);
  font-size: 0.7rem;
  font-weight: 700;
}

.status-live {
  background: #ecfdf5;
  color: #047857;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.bar-chart {
  min-height: 190px;
  display: flex;
  align-items: end;
  gap: 0.6rem;
  overflow-x: auto;
  padding-top: 1rem;
}

.bar-chart-col {
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}

.bar-chart-col span {
  font-size: 0.72rem;
  color: var(--muted);
}

.metric-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.metric-row {
  display: grid;
  grid-template-columns: 82px 1fr 2rem;
  align-items: center;
  gap: 0.75rem;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--gold);
}

@media (max-width: 600px) {
  .portal-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .client-site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }
  .client-site-nav {
    width: 100%;
    flex-wrap: wrap;
  }
  .client-hero {
    padding: 2rem 1rem;
  }
  .client-hero-copy h1 {
    font-size: 2.2rem;
  }
  .client-section {
    padding: 2rem 1rem;
  }
  .client-band {
    margin: 0;
    padding: 1.5rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .main { padding: 0 1rem 1.5rem; }
  .site-footer { padding: 2rem 1rem 1rem; }
  .quick-actions { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .workout-builder { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .progress-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
