/* ==========================================================================
   Portal surfaces — Login + Trainer dashboard
   ========================================================================== */

/* ---- Login ------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.auth-aside {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--glass-line);
}
.auth-aside::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 70% at 20% 10%, rgba(59, 103, 244, 0.34), transparent 60%),
    radial-gradient(70% 60% at 90% 100%, rgba(51, 179, 166, 0.18), transparent 62%);
}
.auth-aside .brand { font-size: 21px; }
.auth-quote {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.12;
  max-width: 16ch; text-wrap: balance;
}
.auth-quote span { color: var(--accent-bright); }
.auth-aside .who { margin-top: 18px; color: var(--ink-2); font-size: 14px; }
.auth-mini {
  display: flex; gap: 22px; margin-top: 26px; flex-wrap: wrap;
}
.auth-mini .am .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-feature-settings: var(--num-feat); }
.auth-mini .am .k { font-size: 12px; color: var(--ink-3); }

.auth-main {
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 48px);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .top { display: flex; justify-content: flex-end; margin-bottom: clamp(20px, 8vh, 64px); }
.auth-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.auth-card .sub { color: var(--ink-2); margin-top: 8px; font-size: 15px; }

.form { margin-top: 28px; display: grid; gap: 16px; }
.field-group { display: grid; gap: 7px; }
.field-group label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%;
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-field);
  padding: 13px 14px;
  transition: border-color 0.16s var(--ease-out), background 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--glass-line-2); }
.input:focus {
  outline: none;
  border-color: var(--accent-bright);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: flex; align-items: center; justify-content: space-between; }
.field-row .lk { font-size: 13px; color: var(--accent-bright); font-weight: 500; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.checkbox input { accent-color: var(--accent); width: 15px; height: 15px; }
.form .btn-primary { width: 100%; padding: 14px; margin-top: 4px; }
.demo-note {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; color: var(--ink-3);
  background: var(--accent-soft);
  border: 1px solid rgba(106, 141, 255, 0.22);
  border-radius: var(--r-field);
  padding: 11px 13px;
}
.demo-note b { color: var(--ink-2); font-weight: 600; }
.auth-alt { margin-top: 22px; font-size: 14px; color: var(--ink-3); text-align: center; }
.auth-alt a { color: var(--accent-bright); font-weight: 600; }

@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.side {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 16px;
  border-right: 1px solid var(--glass-line);
  background: rgba(13, 16, 26, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.side .brand { padding: 8px 10px; margin-bottom: 18px; }
.side-nav { display: grid; gap: 3px; }
.side-nav .nl {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.side-nav .nl svg { width: 19px; height: 19px; flex: none; opacity: 0.85; }
.side-nav .nl:hover { background: var(--glass); color: var(--ink); }
.side-nav .nl.active { background: var(--accent-soft); color: #fff; }
.side-nav .nl.active svg { opacity: 1; color: var(--accent-bright); }
.side-nav .nl .badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: 1px 7px; border-radius: 999px;
}
.side-sep { margin: 16px 10px; height: 1px; background: var(--glass-line); }
.side-foot { margin-top: auto; }
.side-upgrade {
  padding: 15px; border-radius: 16px;
  background: linear-gradient(150deg, rgba(59,103,244,0.18), rgba(89,60,230,0.10));
  border: 1px solid var(--glass-line-2);
}
.side-upgrade .ut { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.side-upgrade .us { font-size: 12.5px; color: var(--ink-2); margin: 5px 0 12px; line-height: 1.4; }
.side-upgrade .btn { width: 100%; padding: 9px; font-size: 13px; }

/* Topbar */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--glass-line);
  background: rgba(15, 18, 30, 0.66);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.topbar .side-toggle {
  display: none; width: 40px; height: 40px; border-radius: 11px;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer;
}
.search {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-pill);
  padding: 9px 16px; flex: 1; max-width: 360px; min-width: 0;
  color: var(--ink-3);
}
.search input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  font-family: inherit; font-size: 14px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.icon-btn:hover { background: var(--glass-2); color: var(--ink); }
.icon-btn .ping {
  position: absolute; top: 9px; right: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--cat-chest);
  border: 2px solid #131722;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--cat-shoulders), var(--accent), var(--cat-hamstrings));
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.16);
}

/* Content */
.content { padding: clamp(22px, 3vw, 36px); display: grid; gap: clamp(18px, 2.4vw, 26px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem); font-weight: 700; letter-spacing: -0.03em; }
.page-head .ph-sub { color: var(--ink-2); margin-top: 6px; font-size: 15px; }
.page-head .ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-l); }
.stat {
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat .si { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.stat .delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.stat .delta.up { color: var(--cat-quads); }
.stat .delta.down { color: var(--cat-chest); }
.stat .delta.flat { color: var(--ink-3); }
.stat .sv { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; font-feature-settings: var(--num-feat); line-height: 1; }
.stat .sv small { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.stat .sk { font-size: 13px; color: var(--ink-2); }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* Dashboard grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(18px, 2.4vw, 26px);
  align-items: start;
}
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.panel-head .arrow-link { font-size: 13.5px; }

/* Quick actions */
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.action {
  display: flex; align-items: center; gap: 13px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-tile);
  cursor: pointer; text-align: left;
  font-family: inherit; color: var(--ink);
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.action:hover { transform: translateY(-2px); border-color: var(--glass-line-2); background: var(--glass-2); }
.action .ai { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.action .at { display: block; font-weight: 600; font-size: 15px; }
.action .as { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 560px) { .actions { grid-template-columns: 1fr; } }

/* Client list */
.client-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 0.16s var(--ease-out);
}
.client-row:hover { background: var(--glass); }
.client-row + .client-row { border-top: 1px solid rgba(255,255,255,0.05); }
.client-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
}
.client-meta { min-width: 0; }
.client-meta .cn { font-weight: 600; font-size: 15px; }
.client-meta .cd { font-size: 12.5px; color: var(--ink-3); }
.client-prog { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.client-prog .pct { width: 96px; }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.09); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; }
.client-prog .pv { font-size: 13px; font-weight: 700; color: var(--ink-2); font-feature-settings: var(--num-feat); width: 38px; text-align: right; }
.tag-pill {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--glass-line-2);
}
@media (max-width: 560px) { .client-prog .pct { display: none; } }

/* Schedule list */
.sched-item { display: flex; gap: 14px; padding: 12px 6px; }
.sched-item + .sched-item { border-top: 1px solid rgba(255,255,255,0.05); }
.sched-time {
  flex: none; width: 58px; text-align: center;
}
.sched-time .t { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; font-feature-settings: var(--num-feat); }
.sched-time .ap { font-size: 11px; color: var(--ink-3); }
.sched-body { flex: 1; padding-left: 14px; border-left: 1px solid var(--glass-line); min-width: 0; }
.sched-body .st { font-weight: 600; font-size: 14.5px; }
.sched-body .ss { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.sched-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }

/* Revenue / momentum chart panel */
.rev-head { display: flex; align-items: baseline; gap: 12px; }
.rev-val { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; font-feature-settings: var(--num-feat); }
.rev-delta { font-size: 13px; font-weight: 600; color: var(--cat-quads); }
.rev-chart { margin-top: 16px; width: 100%; height: 150px; display: block; }
.rev-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }

.empty-hint { color: var(--ink-3); font-size: 13.5px; text-align: center; padding: 18px; }

/* Mobile sidebar */
.scrim {
  display: none; position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(6, 8, 14, 0.6); backdrop-filter: blur(2px);
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; z-index: calc(var(--z-overlay) + 1);
    width: 270px; transform: translateX(-100%);
    transition: transform 0.32s var(--ease-out);
  }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; }
  .topbar .side-toggle { display: grid; }
  .search { max-width: none; }
}
@media (max-width: 600px) {
  .search .sx { display: none; }
  .page-head .ph-actions .btn span.lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}
