/* ============================================================
   OLYMPIAN HEALTH SOLUTIONS — portal.css  (v3 · "Concierge")
   Prestigious, animated client portal: login · dashboard · admin.
   Inherits colour / type / shadow tokens from style.css
   (load style.css FIRST). Royal-navy + marble glass aesthetic.
   ============================================================ */

:root {
  --glass:        rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-line:   rgba(47, 109, 212, 0.16);
  --glass-blur:   saturate(1.3) blur(18px);
  --ring-track:   rgba(47, 109, 212, 0.14);
  --shadow-lift:  0 30px 80px rgba(15, 40, 95, 0.16);
  --shadow-card:  0 20px 55px rgba(20, 50, 110, 0.10);
  --radius-lg:    26px;
  --radius-md:    18px;
}

/* ============================================================
   0. SHARED SHELL
   ============================================================ */
.portal-main {
  min-height: 100vh;
  padding: calc(var(--topbar-h) + 96px) 0 96px;
  position: relative;
}

/* A second, richer aurora that lives only behind portal pages —
   slow-drifting royal light that reads as "premium software". */
.portal-main::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(30% 42% at 12% 18%, rgba(91, 147, 240, 0.22), transparent 70%),
    radial-gradient(26% 38% at 88% 12%, rgba(147, 192, 255, 0.20), transparent 72%),
    radial-gradient(34% 40% at 78% 88%, rgba(47, 109, 212, 0.14), transparent 74%),
    radial-gradient(28% 34% at 20% 92%, rgba(232, 162, 60, 0.10), transparent 72%);
  background-size: 180% 180%, 180% 180%, 180% 180%, 180% 180%;
  animation: portalAurora 34s ease-in-out infinite alternate;
  will-change: background-position;
}
@keyframes portalAurora {
  0%   { background-position: 0% 0%, 100% 0%, 80% 100%, 0% 100%; }
  50%  { background-position: 30% 40%, 70% 20%, 40% 60%, 60% 40%; }
  100% { background-position: 100% 100%, 0% 100%, 0% 0%, 100% 0%; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-main::before, .aurora-panel::after, .stat-tile, .fade-up, .brand-orb { animation: none !important; }
}

.portal-wrap { width: min(1120px, 92%); margin: 0 auto; }
.portal-wrap.narrow { width: min(1040px, 94%); }

/* Entrance choreography — panels rise + un-blur in sequence. */
.fade-up { opacity: 0; transform: translateY(16px); filter: blur(6px);
  animation: fadeUp .7s var(--ease) forwards; }
.fade-up.d1 { animation-delay: .06s; }
.fade-up.d2 { animation-delay: .14s; }
.fade-up.d3 { animation-delay: .22s; }
.fade-up.d4 { animation-delay: .30s; }
.fade-up.d5 { animation-delay: .38s; }
@keyframes fadeUp { to { opacity: 1; transform: none; filter: blur(0); } }

/* ---------- Glass cards ---------- */
.portal-card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.1rem 2.2rem;
  position: relative;
}
.portal-card + .portal-card { margin-top: 1.4rem; }

.section-label {
  font-family: var(--serif); font-size: 1.5rem; color: var(--marble);
  font-weight: 600; margin-bottom: 1rem; letter-spacing: .01em;
}
.card-lead { color: var(--muted); margin: -.25rem 0 1.1rem; }

/* ---------- Feedback banners ---------- */
.portal-msg { border-radius: 14px; padding: .85rem 1.1rem; font-size: .9rem; margin: 0 0 1.1rem; display: none; }
.portal-msg.show { display: block; }
.portal-msg.error   { background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
.portal-msg.success { background: #eafaf0; color: #14663a; border: 1px solid #bce8cf; }
.portal-msg.info    { background: rgba(255,255,255,.7); color: var(--text); border: 1px solid var(--glass-line); }

.empty-state { color: var(--muted); text-align: center; padding: 2.4rem 1rem; }

/* ============================================================
   1. LOGIN — cinematic split screen
   ============================================================ */
.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 560px;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
}

/* ---- Left: royal aurora showcase panel ---- */
.aurora-panel {
  position: relative;
  color: #eaf2ff;
  padding: 3rem 3.2rem;
  display: flex; flex-direction: column;
  background: linear-gradient(150deg, #0a1a38 0%, #10315f 55%, #1e40af 130%);
  overflow: hidden;
  isolation: isolate;
}
.aurora-panel::after {
  content: "";
  position: absolute; inset: -30%;
  z-index: -1;
  background:
    radial-gradient(30% 30% at 25% 25%, rgba(91,147,240,.55), transparent 70%),
    radial-gradient(26% 26% at 82% 30%, rgba(147,192,255,.45), transparent 72%),
    radial-gradient(34% 34% at 70% 85%, rgba(47,109,212,.5), transparent 72%),
    radial-gradient(24% 24% at 18% 88%, rgba(232,162,60,.28), transparent 72%);
  background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%;
  animation: portalAurora 30s ease-in-out infinite alternate;
  filter: blur(6px);
}
.aurora-panel .brand-lockup { display: flex; align-items: center; gap: .8rem; }
.aurora-panel .brand-lockup img { width: 46px; height: 46px; }
.aurora-panel .brand-lockup b { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: .01em; }
.aurora-panel .brand-lockup small { display: block; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; color: var(--warm-soft); font-weight: 600; }

.aurora-panel .panel-body { margin-top: auto; padding-top: 2.4rem; }
.aurora-eyebrow {
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  font-weight: 600; color: var(--warm-soft); margin-bottom: 1rem;
}
.aurora-panel h2 {
  font-family: var(--serif); font-weight: 600; line-height: 1.08;
  font-size: clamp(2rem, 3.4vw, 2.9rem); color: #fff; margin-bottom: 1rem;
}
.aurora-panel h2 em { font-style: italic; color: var(--warm-soft); }
.aurora-panel .lede { color: rgba(233,242,255,.82); max-width: 40ch; font-weight: 300; }

.aurora-benefits { list-style: none; display: grid; gap: .75rem; margin-top: 1.8rem; }
.aurora-benefits li { display: flex; align-items: flex-start; gap: .7rem; font-size: .95rem; color: rgba(233,242,255,.92); }
.aurora-benefits .tick {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; color: #0a1a38;
  background: linear-gradient(135deg, #f6c987, #e8a23c); box-shadow: 0 4px 14px rgba(232,162,60,.4);
}
.aurora-quote {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.14);
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: rgba(233,242,255,.92); line-height: 1.5;
}
.aurora-quote cite { display: block; margin-top: .5rem; font-style: normal; font-family: var(--sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--warm-soft); }

/* ---- Right: the auth form itself ---- */
.auth-pane { padding: 3rem 3rem; display: flex; flex-direction: column; justify-content: center; background: var(--glass-strong); }
.auth-pane .portal-head h1 { font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--marble); line-height: 1.1; }
.auth-pane .portal-head p { color: var(--muted); margin-top: .4rem; }

.auth-tabs { display: flex; gap: .35rem; margin: 1.4rem 0; background: rgba(47,109,212,.08); padding: .35rem; border-radius: 14px; }
.auth-tab {
  flex: 1; padding: .7rem 1rem; border: 0; border-radius: 11px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: .88rem; color: var(--muted);
  background: transparent; transition: all .25s var(--ease);
}
.auth-tab.active { background: #fff; color: var(--gold-deep); box-shadow: 0 6px 18px rgba(20,50,110,.10); }

.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { flex: 1; padding-right: 4.2rem; }
.pw-toggle {
  position: absolute; right: .5rem; background: transparent; border: 0; cursor: pointer;
  color: var(--gold-deep); font-family: var(--sans); font-weight: 600; font-size: .8rem; padding: .3rem .5rem;
}
.pw-strength { margin-top: .55rem; }
.pw-bar { height: 6px; border-radius: 999px; background: rgba(47,109,212,.12); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .3s var(--ease), background .3s; background: #e0574f; }
.pw-bar span.s0, .pw-bar span.s1 { background: #e0574f; }
.pw-bar span.s2 { background: var(--warm); }
.pw-bar span.s3 { background: var(--gold-light); }
.pw-bar span.s4 { background: #14663a; }
.pw-strength small { color: var(--muted); font-size: .78rem; display: block; margin-top: .3rem; }
.form-row label .opt { color: var(--muted); font-weight: 400; font-size: .8em; letter-spacing: 0; text-transform: none; }

.auth-switch { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1.1rem; }
.auth-switch a { color: var(--gold-deep); font-weight: 600; }
.trust-line { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--glass-line); }
.portal-foot-link { text-align: center; margin-top: 1.4rem; }
.portal-foot-link a { color: var(--gold-deep); font-size: .88rem; }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .aurora-panel { padding: 2.2rem 1.8rem; }
  .aurora-panel .panel-body { padding-top: 1.6rem; }
  .aurora-benefits, .aurora-quote { display: none; }
  .auth-pane { padding: 2.2rem 1.8rem; }
}

/* ============================================================
   2. DASHBOARD — hero, stats, segmented nav, panels
   ============================================================ */

/* ---- Greeting hero ---- */
.portal-hero {
  display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap;
  justify-content: space-between; margin-bottom: 1.5rem;
}
.hero-id { display: flex; align-items: center; gap: 1.1rem; }
.brand-orb {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 20px;
  display: grid; place-items: center; color: #fff; font-family: var(--serif);
  font-size: 1.5rem; font-weight: 600; letter-spacing: .02em;
  background: var(--gold-grad); box-shadow: 0 14px 34px rgba(47,109,212,.35);
  position: relative; overflow: hidden;
}
.brand-orb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 48%, transparent 60%);
  transform: translateX(-120%); animation: orbSheen 4.5s var(--ease) infinite;
}
@keyframes orbSheen { 0%,60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.hero-id h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3.2vw, 2.2rem); line-height: 1.1; color: var(--marble); }
.hero-id h1 .grad { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-id .subline { color: var(--muted); font-size: .95rem; margin-top: .15rem; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---- Stat tiles ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-tile {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: var(--radius-md); padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.stat-tile::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: var(--gold-grad); opacity: .9;
}
.stat-tile .stat-ico { font-size: 1.15rem; opacity: .9; }
.stat-tile .stat-num { font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--marble); line-height: 1.1; margin-top: .3rem; }
.stat-tile .stat-label { color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; margin-top: .1rem; }
@media (max-width: 720px) { .stat-row { grid-template-columns: 1fr 1fr; } }

/* ---- Segmented tab navigation ---- */
.seg-nav {
  display: flex; gap: .3rem; padding: .4rem; margin-bottom: 1.5rem;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: 16px; box-shadow: var(--shadow-card);
  position: sticky; top: calc(var(--topbar-h) + 66px); z-index: 20; overflow-x: auto;
}
.seg-btn {
  flex: 1 1 auto; white-space: nowrap; border: 0; cursor: pointer; background: transparent;
  font-family: var(--sans); font-weight: 600; font-size: .9rem; color: var(--muted);
  padding: .75rem 1.1rem; border-radius: 12px; transition: all .25s var(--ease);
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
}
.seg-btn .seg-ico { font-size: 1rem; }
.seg-btn:hover { color: var(--marble); }
.seg-btn.active { background: var(--gold-grad); color: #fff; box-shadow: 0 10px 24px rgba(47,109,212,.32); }
.seg-badge {
  min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px;
  background: var(--warm); color: #3a2604; font-size: .72rem; font-weight: 700;
  display: inline-grid; place-items: center;
}
.seg-btn.active .seg-badge { background: #fff; color: var(--gold-deep); }

/* ---- Tab panels ---- */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panelIn .45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   3. WORKOUTS
   ============================================================ */
.portal-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .portal-grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.wk-card {
  border: 1px solid var(--glass-line); border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem; background: var(--glass-strong);
  box-shadow: var(--shadow-card); transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.wk-card:hover { transform: translateY(-3px); border-color: rgba(47,109,212,.4); box-shadow: var(--shadow-lift); }
.wk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wk-head h3 { color: var(--marble); font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.wk-head .meta { color: var(--muted); font-size: .82rem; margin-top: .1rem; }

.mtag {
  display: inline-block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .28rem .6rem; border-radius: 999px; font-weight: 700;
}
.mtag.pdf     { background: rgba(47,109,212,.12);  color: var(--gold-deep); }
.mtag.workout { background: rgba(232,162,60,.16);  color: #9a6212; }
.mtag.note    { background: rgba(20,102,58,.12);   color: #14663a; }
.mtag.free    { background: var(--gold-grad); color: #fff; }

.body-note { color: var(--text); margin-top: .8rem; white-space: pre-wrap; line-height: 1.7; }

/* Workout table */
.workout-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .92rem; }
.workout-table thead th {
  color: var(--gold-deep); font-weight: 600; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .08em; text-align: left; padding: .55rem .7rem; border-bottom: 2px solid var(--glass-line);
}
.workout-table td { color: var(--text); padding: .6rem .7rem; border-bottom: 1px solid var(--glass-line); vertical-align: top; }
.workout-table tbody tr { transition: background .2s; }
.workout-table tbody tr:hover { background: rgba(47,109,212,.05); }
.workout-table td:nth-child(1) { color: var(--marble); font-weight: 600; }
.workout-table .col-num { width: 68px; white-space: nowrap; }

.wk-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: 1.2rem; }
.done-flag { color: #14663a; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }

/* ---- Progress ring (overview / progress tab) ---- */
.progress-split { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center; }
@media (max-width: 620px) { .progress-split { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.ring { --pct: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--ring-track) 0);
  transition: background .8s var(--ease);
}
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--glass-strong); box-shadow: inset 0 2px 10px rgba(20,50,110,.08); }
.ring .ring-val { position: relative; font-family: var(--serif); font-weight: 600; font-size: 1.8rem; color: var(--marble); }
.ring .ring-cap { position: relative; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Getting-started checklist */
.checklist-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.checklist-count { font-size: .8rem; font-weight: 600; color: var(--gold-deep); background: rgba(47,109,212,.1); padding: .3rem .7rem; border-radius: 999px; white-space: nowrap; }
.progress-track { height: 8px; border-radius: 999px; background: rgba(47,109,212,.12); overflow: hidden; margin-bottom: 1.2rem; }
.progress-track span { display: block; height: 100%; width: 25%; border-radius: 999px; background: var(--gold-grad); transition: width .5s var(--ease); }
.checklist { list-style: none; display: grid; gap: .7rem; }
.check-item { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem .95rem; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass-strong); transition: border-color .25s var(--ease), background .25s; }
.check-item.done { border-color: rgba(20,102,58,.3); background: rgba(20,102,58,.06); }
.check-item strong { display: block; color: var(--marble); font-size: .96rem; }
.check-item small { color: var(--muted); font-size: .82rem; }
.check-dot { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--glass-line); margin-top: .1rem; position: relative; transition: all .25s var(--ease); }
.check-item.done .check-dot { background: #14663a; border-color: #14663a; }
.check-item.done .check-dot::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

/* Goal picker */
.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (min-width: 720px) { .goal-grid { grid-template-columns: repeat(4, 1fr); } }
.goal-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; text-align: left;
  padding: 1.1rem; border: 1px solid var(--glass-line); border-radius: 16px; background: var(--glass-strong);
  cursor: pointer; transition: all .25s var(--ease); font-family: var(--sans);
}
.goal-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.goal-card.selected { border-color: var(--gold); background: rgba(47,109,212,.08); box-shadow: 0 0 0 2px var(--gold) inset; }
.goal-ico { font-size: 1.7rem; margin-bottom: .2rem; }
.goal-card strong { color: var(--marble); font-size: .96rem; }
.goal-card small { color: var(--muted); font-size: .78rem; }

/* Resource cards */
.resource-card {
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-start;
  padding: 1.2rem 1.3rem; border: 1px solid var(--glass-line); border-radius: 16px;
  background: var(--glass-strong); transition: border-color .25s var(--ease), transform .25s var(--ease); text-decoration: none;
}
.resource-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.resource-card h3 { color: var(--marble); font-size: 1.02rem; font-weight: 600; line-height: 1.3; }
.resource-go { color: var(--gold-deep); font-weight: 600; font-size: .85rem; margin-top: auto; }

/* ============================================================
   4. ASK COACH — message thread (dashboard + admin)
   ============================================================ */
.thread-shell { display: flex; flex-direction: column; gap: 1.1rem; }
.thread-intro { display: flex; align-items: center; gap: .9rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--glass-line); }
.coach-avatar {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 600; background: var(--gold-grad); box-shadow: 0 10px 24px rgba(47,109,212,.3);
  overflow: hidden;
}
.coach-avatar img { width: 100%; height: 100%; object-fit: cover; }
.thread-intro .who strong { color: var(--marble); display: block; font-size: 1.05rem; }
.thread-intro .who small { color: var(--muted); }
.thread-intro .who .dot-on { color: #14663a; font-weight: 600; }

.thread { display: flex; flex-direction: column; gap: .9rem; max-height: 460px; overflow-y: auto; padding: .3rem .2rem; scroll-behavior: smooth; }
.thread-empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

.msg-line { display: flex; gap: .6rem; max-width: 82%; }
.msg-line.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 700; color: #fff; }
.msg-line.coach .msg-avatar { background: var(--gold-grad); }
.msg-line.me .msg-avatar { background: linear-gradient(135deg, #9fb4cf, #64789a); }
.bubble {
  padding: .8rem 1rem; border-radius: 16px; font-size: .94rem; line-height: 1.55;
  position: relative; white-space: pre-wrap; word-break: break-word;
}
.msg-line.coach .bubble { background: #fff; border: 1px solid var(--glass-line); color: var(--text); border-top-left-radius: 5px; }
.msg-line.me .bubble { background: var(--gold-grad); color: #fff; border-top-right-radius: 5px; }
.bubble .ref { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .35rem; opacity: .85; }
.msg-line.coach .bubble .ref { color: var(--gold-deep); }
.bubble .stamp { display: block; margin-top: .35rem; font-size: .68rem; opacity: .7; }

.composer { display: flex; flex-direction: column; gap: .7rem; padding-top: 1.1rem; border-top: 1px solid var(--glass-line); }
.composer .ref-select { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.composer .ref-select label { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 0; }
.composer .ref-select select { flex: 1; min-width: 200px; width: auto; padding: .6rem .8rem; background: rgba(255,255,255,.7); border: 1px solid var(--glass-line); border-radius: 10px; color: var(--text); font-family: var(--sans); font-size: .88rem; appearance: none; cursor: pointer; }
.composer-row { display: flex; gap: .7rem; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--glass-line);
  background: rgba(255,255,255,.75); color: var(--text); font-family: var(--sans); font-size: .95rem; line-height: 1.5;
  transition: border-color .25s, box-shadow .25s; min-height: 52px;
}
.composer textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(47,109,212,.14); }
.composer .send-btn { flex: 0 0 auto; }

/* ============================================================
   5. ADMIN — console
   ============================================================ */
.portal-head h1 { color: var(--marble); font-family: var(--serif); font-weight: 600; line-height: 1.1; }
.portal-head p { color: var(--muted); margin-top: .4rem; }
.portal-head { margin-bottom: 1.5rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--glass-line); vertical-align: middle; }
.admin-table th { color: var(--gold-deep); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.admin-table td .pill { font-size: .78rem; color: var(--muted); }

.ex-row { display: grid; grid-template-columns: 2fr .7fr .7fr 2fr auto; gap: .5rem; margin-bottom: .5rem; align-items: center; }
.ex-row input { width: 100%; }
.btn-x { background: #fdecec; color: #9b1c1c; border: 0; border-radius: 8px; padding: .55rem .7rem; cursor: pointer; font-family: var(--sans); font-weight: 600; }
@media (max-width: 620px) { .ex-row { grid-template-columns: 1fr 1fr; } }

.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form select, .inline-form input { flex: 1; min-width: 150px; padding: .55rem .7rem; border: 1px solid var(--glass-line); border-radius: 10px; background: rgba(255,255,255,.7); font-family: var(--sans); color: var(--text); }

/* Admin inbox list */
.inbox-list { display: grid; gap: .7rem; }
.inbox-item {
  display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; cursor: pointer;
  padding: .9rem 1rem; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass-strong);
  transition: all .2s var(--ease); font-family: var(--sans);
}
.inbox-item:hover { border-color: var(--gold); transform: translateX(3px); }
.inbox-item.unread { border-color: rgba(232,162,60,.5); background: rgba(232,162,60,.07); }
.inbox-item .msg-avatar { width: 40px; height: 40px; font-size: .82rem; background: linear-gradient(135deg, #9fb4cf, #64789a); }
.inbox-item .ix-body { flex: 1; min-width: 0; }
.inbox-item .ix-name { color: var(--marble); font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.inbox-item .ix-snippet { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .ix-time { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warm); flex: 0 0 auto; }

.back-link { background: none; border: 0; color: var(--gold-deep); font-family: var(--sans); font-weight: 600; font-size: .88rem; cursor: pointer; padding: 0; margin-bottom: .3rem; display: inline-flex; align-items: center; gap: .3rem; }

/* Shared small helpers reused across pages */
.portal-userbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }

/* ---- Welcome hero band (onboarding) ---- */
.welcome-hero {
  position: relative; overflow: hidden; border: 0; color: #fff;
  background: linear-gradient(140deg, #0a1a38 0%, #1e40af 70%, #2f6dd4 120%);
}
.welcome-hero::after {
  content: ""; position: absolute; inset: -40%;
  background: radial-gradient(30% 40% at 80% 20%, rgba(232,162,60,.4), transparent 70%),
              radial-gradient(34% 40% at 20% 90%, rgba(91,147,240,.5), transparent 70%);
  animation: portalAurora 28s ease-in-out infinite alternate; z-index: 0;
}
.welcome-hero > * { position: relative; z-index: 1; }
.promo-badge {
  display: inline-block; background: rgba(255,255,255,.18); color: #fff;
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .75rem; border-radius: 999px; margin-bottom: .7rem; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.welcome-hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.1; color: #fff; margin-bottom: .5rem; }
.welcome-hero p { color: rgba(233,242,255,.92); max-width: 48ch; }
.welcome-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.welcome-hero .btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.welcome-hero .btn-ghost:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ============================================================
   QUESTIONNAIRES / ASSIGNMENTS — cards
   ============================================================ */
.q-card-list { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .q-card-list { grid-template-columns: 1fr 1fr; } }

.q-card {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.1rem 1.2rem; border: 1px solid var(--glass-line); border-radius: 16px;
  background: var(--glass-strong); transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.q-card:hover { transform: translateY(-3px); border-color: rgba(47,109,212,.4); box-shadow: var(--shadow-card); }
.q-card.is-done { background: rgba(20,102,58,.05); border-color: rgba(20,102,58,.25); }
.q-card-ico { font-size: 1.7rem; flex: 0 0 auto; line-height: 1.4; }
.q-card-body { flex: 1; min-width: 0; }
.q-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.q-card-head h3 { color: var(--marble); font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.15; }
.q-card-tag { color: var(--muted); font-size: .86rem; margin-top: .25rem; }
.q-card-note { color: var(--gold-deep); font-size: .82rem; margin-top: .4rem; font-weight: 500; }
.q-card-meta { color: var(--muted); font-size: .76rem; margin-top: .5rem; letter-spacing: .01em; }
.q-card-bar { height: 6px; border-radius: 999px; background: rgba(47,109,212,.14); overflow: hidden; margin-top: .6rem; }
.q-card-bar span { display: block; height: 100%; background: var(--gold-grad); border-radius: 999px; }
.q-card-foot { margin-top: .8rem; }

.q-status { font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: .28rem .6rem; border-radius: 999px; white-space: nowrap; }
.q-status.done { background: rgba(20,102,58,.14); color: #14663a; }
.q-status.in-progress { background: rgba(232,162,60,.18); color: #9a6212; }
.q-status.not-started { background: rgba(47,109,212,.1); color: var(--gold-deep); }

/* ============================================================
   SHARED MODAL SHELL
   ============================================================ */
.ohs-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.ohs-modal[hidden] { display: none; }   /* the hidden attribute must win over display:flex */
@media (min-width: 720px) { .ohs-modal { align-items: center; padding: 2rem; } }
.ohs-backdrop { position: absolute; inset: 0; background: rgba(10,20,45,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ohs-dialog {
  position: relative; z-index: 1; width: min(680px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(10,30,70,.35);
  animation: sheetUp .32s var(--ease);
}
@media (min-width: 720px) { .ohs-dialog { border-radius: 22px; animation: dialogPop .3s var(--ease); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes dialogPop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ohs-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.4rem 1rem; border-bottom: 1px solid var(--glass-line); }
.ohs-top h2 { color: var(--marble); font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.ohs-body { padding: 1.2rem 1.4rem; overflow-y: auto; }
.ohs-foot { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; padding: 1rem 1.4rem; border-top: 1px solid var(--glass-line); }
.q-close { background: rgba(47,109,212,.08); border: 0; width: 38px; height: 38px; border-radius: 50%; color: var(--gold-deep); font-size: 1.1rem; cursor: pointer; flex: 0 0 auto; transition: background .2s; }
.q-close:hover { background: rgba(47,109,212,.18); }

/* ---- Questionnaire modal specifics ---- */
.q-top-id { display: flex; gap: .9rem; align-items: flex-start; }
.q-ico { font-size: 1.9rem; line-height: 1.2; }
.q-tagline { color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.q-progress { height: 6px; background: rgba(47,109,212,.12); }
.q-progress span { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .3s var(--ease); }
.q-progress-meta { display: flex; justify-content: space-between; align-items: center; padding: .5rem 1.4rem; font-size: .76rem; color: var(--muted); }
.q-save { font-weight: 600; }
.q-save.saving { color: var(--muted); }
.q-save.ok { color: #14663a; }
.q-save.err { color: #9b1c1c; }
.q-body { padding: .4rem 1.4rem 1.4rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.q-intro { background: rgba(47,109,212,.06); border: 1px solid var(--glass-line); border-radius: 14px; padding: .9rem 1rem; color: var(--text); font-size: .9rem; line-height: 1.55; margin-bottom: 1.4rem; }

.q-section { margin-bottom: 1.8rem; }
.q-section-title { font-family: var(--serif); color: var(--marble); font-size: 1.35rem; font-weight: 600; padding-bottom: .5rem; border-bottom: 2px solid rgba(47,109,212,.12); margin-bottom: 1rem; }
.q-section-help { color: var(--muted); font-size: .86rem; margin: -.5rem 0 1rem; line-height: 1.5; }

.q-question { margin-bottom: 1.4rem; padding: .2rem; border-radius: 12px; transition: box-shadow .2s, background .2s; }
.q-question.q-missing { box-shadow: 0 0 0 2px #e8a23c; background: rgba(232,162,60,.06); }
.q-label { color: var(--marble); font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.q-required { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-deep); background: rgba(47,109,212,.1); padding: .18rem .45rem; border-radius: 6px; }
.q-help { color: var(--muted); font-size: .82rem; margin: .3rem 0 .1rem; line-height: 1.5; }

/* options (single / multi) */
.q-opts { display: grid; gap: .55rem; margin-top: .7rem; }
.q-opt {
  text-align: left; width: 100%; cursor: pointer; font-family: var(--sans);
  padding: .8rem .95rem; border: 1.5px solid var(--glass-line); border-radius: 13px; background: #fff;
  transition: border-color .18s, background .18s, transform .12s; display: block;
}
.q-opt:hover { border-color: var(--gold-light); }
.q-opt:active { transform: scale(.99); }
.q-opt.selected { border-color: var(--gold); background: rgba(47,109,212,.08); box-shadow: 0 0 0 1px var(--gold) inset; }
.q-opt-main { display: block; color: var(--marble); font-weight: 500; font-size: .94rem; }
.q-opt-desc { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }

/* scale */
.q-scale { margin-top: .8rem; }
.q-scale-track { display: flex; gap: .4rem; flex-wrap: wrap; }
.q-scale-btn {
  flex: 1 1 auto; min-width: 42px; height: 46px; border: 1.5px solid var(--glass-line); border-radius: 11px;
  background: #fff; color: var(--marble); font-family: var(--sans); font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.q-scale-btn:hover { border-color: var(--gold-light); }
.q-scale-btn.selected { border-color: var(--gold); background: var(--gold-grad); color: #fff; transform: translateY(-1px); }
.q-scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .74rem; margin-top: .45rem; }

/* grid */
.q-grid { margin-top: .8rem; display: grid; gap: .7rem; }
.q-grid-row { padding: .7rem .2rem; border-bottom: 1px solid var(--glass-line); }
.q-grid-row:last-child { border-bottom: 0; }
.q-grid-label strong { display: block; color: var(--marble); font-size: .92rem; font-weight: 500; }
.q-grid-label small { display: block; color: var(--muted); font-size: .78rem; }
.q-grid-opts { display: flex; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.q-grid-opt {
  flex: 1 1 0; min-width: 52px; padding: .5rem .3rem; border: 1.5px solid var(--glass-line); border-radius: 10px;
  background: #fff; color: var(--text); font-family: var(--sans); font-size: .78rem; font-weight: 500; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.q-grid-opts.scale .q-grid-opt { flex: 1 1 auto; font-weight: 600; }
.q-grid-opt:hover { border-color: var(--gold-light); }
.q-grid-opt.selected { border-color: var(--gold); background: var(--gold-grad); color: #fff; }

/* number / text */
.q-num-row { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }
.q-num { width: 130px; }
.q-unit { color: var(--muted); font-size: .88rem; }
.q-num, .q-text, .q-textarea {
  padding: .7rem .9rem; border: 1.5px solid var(--glass-line); border-radius: 11px; background: #fff;
  font-family: var(--sans); font-size: .92rem; color: var(--text); width: 100%;
}
.q-text, .q-textarea { margin-top: .7rem; }
.q-textarea { resize: vertical; line-height: 1.5; }
.q-num:focus, .q-text:focus, .q-textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(47,109,212,.14); }

/* info card (exercise-type intros) */
.q-info { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; margin: 0 0 1rem; border-radius: 14px;
  background: linear-gradient(140deg, rgba(47,109,212,.07), rgba(232,162,60,.06)); border: 1px solid var(--glass-line); }
.q-info-ico { font-size: 1.6rem; flex: 0 0 auto; }
.q-info strong { color: var(--marble); font-size: 1.02rem; display: block; margin-bottom: .2rem; }
.q-info p { color: var(--text); font-size: .87rem; line-height: 1.55; }

.q-foot { justify-content: space-between; }
.q-foot-hint { color: #9a6212; font-size: .8rem; }
.q-foot-btns { display: flex; gap: .6rem; align-items: center; margin-left: auto; }

/* ============================================================
   NUTRITION tab
   ============================================================ */
.nutrition-hero { position: relative; overflow: hidden; border: 0; color: #fff;
  background: linear-gradient(140deg, #0a1a38 0%, #14663a 130%); }
.nutrition-hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.12; color: #fff; margin: .5rem 0; }
.nutrition-hero p { color: rgba(233,245,238,.92); max-width: 52ch; }
.snapshot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; margin-top: .4rem; }
.snap-tile { padding: .85rem .9rem; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass-strong); }
.snap-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.snap-val { color: var(--marble); font-weight: 600; font-size: 1.05rem; margin-top: .2rem; }

/* ============================================================
   SESSIONS + rating / feedback
   ============================================================ */
.session-card .session-date { color: var(--gold-deep); font-weight: 500; }
.coach-note { margin-top: 1rem; padding: .85rem 1rem; background: rgba(47,109,212,.06); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; }
.coach-note-tag { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: .25rem; }
.coach-note p { color: var(--text); font-size: .9rem; line-height: 1.55; }

.session-fb { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--glass-line); }
.session-fb-label { color: var(--marble); font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.stars { display: inline-flex; gap: .15rem; }
.star { background: none; border: 0; cursor: pointer; font-size: 1.5rem; line-height: 1; color: #d7deea; padding: .1rem; transition: color .12s, transform .1s; }
.star:hover { transform: scale(1.12); }
.star.on { color: var(--warm); }
.session-comment { margin-top: .7rem; }
.session-fb-foot { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; }
.session-fb-status { color: #14663a; font-size: .8rem; font-weight: 600; }

/* ============================================================
   FLOATING FEEDBACK button + modal
   ============================================================ */
.fab-feedback {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 1500;
  background: var(--gold-grad); color: #fff; border: 0; border-radius: 999px;
  padding: .8rem 1.2rem; font-family: var(--sans); font-weight: 600; font-size: .9rem; cursor: pointer;
  box-shadow: 0 12px 30px rgba(47,109,212,.4); transition: transform .2s var(--ease), box-shadow .2s;
}
.fab-feedback:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(47,109,212,.5); }
@media (max-width: 520px) { .fab-feedback { padding: .75rem .95rem; font-size: 0; gap: 0; }
  .fab-feedback::before { content: "💬"; font-size: 1.3rem; } }
.fb-dialog .stars .star { font-size: 1.8rem; }

.fb-item { padding: 1rem 1.1rem; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass-strong); margin-bottom: .8rem; }
.fb-item.unread { border-color: rgba(232,162,60,.5); background: rgba(232,162,60,.07); }
.fb-item-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.fb-item-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fb-item-id strong { color: var(--marble); }
.fb-cat { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-deep); background: rgba(47,109,212,.1); padding: .2rem .5rem; border-radius: 999px; }
.fb-stars-inline { color: var(--warm); font-size: .9rem; letter-spacing: .05em; }
.fb-body { color: var(--text); font-size: .9rem; line-height: 1.55; white-space: pre-wrap; }
.fb-item .btn { margin-top: .6rem; }

/* ============================================================
   ADMIN — client detail
   ============================================================ */
.client-detail-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.client-detail-head .msg-avatar { width: 52px; height: 52px; font-size: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-grid-2 { grid-template-columns: 1fr; } }

.cd-assign-list { margin-top: 1.1rem; display: grid; gap: .5rem; }
.cd-assign-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border: 1px solid var(--glass-line); border-radius: 11px; background: var(--glass-strong); }
.cd-assign-item > span:first-child { flex: 1; color: var(--marble); font-size: .9rem; }

.ex-head, .ex-head-load { display: none; }
@media (min-width: 680px) {
  .ex-head-load { display: grid; grid-template-columns: 2fr .6fr .6fr .8fr 1.8fr auto; gap: .5rem; margin-bottom: .35rem; }
  .ex-head-load span { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold-deep); font-weight: 700; }
}
.ex-row-load { grid-template-columns: 2fr .6fr .6fr .8fr 1.8fr auto; }
@media (max-width: 680px) { .ex-row-load { grid-template-columns: 1fr 1fr; } }

/* rendered responses */
.resp-card { border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass-strong); margin-bottom: .8rem; overflow: hidden; }
.resp-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none; }
.resp-head::-webkit-details-marker { display: none; }
.resp-head > span:first-child { color: var(--marble); font-weight: 600; font-family: var(--serif); font-size: 1.15rem; }
.resp-body { padding: 0 1.1rem 1rem; }
.resp-qa { padding: .6rem 0; border-top: 1px solid var(--glass-line); }
.resp-q { color: var(--muted); font-size: .82rem; }
.resp-a { color: var(--marble); font-weight: 500; margin-top: .15rem; }
.resp-grid { list-style: none; margin: .2rem 0 0; display: grid; gap: .2rem; }
.resp-grid li { color: var(--text); font-size: .88rem; }
.resp-grid strong { color: var(--marble); font-weight: 500; }
.resp-raw { font-size: .78rem; white-space: pre-wrap; color: var(--text); }

.client-fb { margin-top: .8rem; padding: .7rem .9rem; background: rgba(232,162,60,.08); border-radius: 12px; }
.client-fb-tag { display: block; font-size: .72rem; font-weight: 700; color: #9a6212; letter-spacing: .03em; margin-bottom: .2rem; }
.client-fb p { color: var(--text); font-size: .88rem; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .ohs-dialog { animation: none; }
}
