/* The Guard BJJ — Coach web dashboard
   Dark theme tokens lifted verbatim from the approved mockup
   (artifact 1d28adf3, section 6 "Coach dashboard (web)"). */

:root {
  --bg: #0b0e13;
  --card: #151a22;
  --card2: #1e2530;
  --line: #2a3240;
  --navy: #1f2a44;
  --gold: #c9a24c;
  --gold-dim: #8a7233;
  --txt: #e8eaed;
  --muted: #9aa3b0;
  --muted2: #6b7482;
  --green: #3fb27f;
  --red: #e0574a;
  --amber: #e0a13f;
  --z1: #4a90d9;
  --z2: #3fb27f;
  --z3: #e8c15a;
  --z4: #e08b3f;
  --z5: #e0574a;
  --belt: #5b6cff;
  --perf: #9ede3a; /* lime — reserved for athlete/performance data only */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -5%, #17202e 0%, transparent 55%),
    radial-gradient(800px 500px at 100% 0%, #1a1710 0%, transparent 50%),
    var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

#app { min-height: 100vh; }

/* ---------- Centered auth/status screens ---------- */
.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}

.brandrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.brandmark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gold);
  color: #141414;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: 0 0 auto;
}

.brandrow .bt { font-size: 14px; font-weight: 700; }
.brandrow .bs { font-size: 11px; color: var(--muted2); }

.auth-card h1 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.auth-card .sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  background: #0e131b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--txt);
}
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.btn-primary {
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px;
  border-radius: 12px;
  background: var(--gold);
  color: #141414;
  border: none;
  margin-top: 6px;
}
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .athrow:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 10px;
  border-radius: 10px;
  margin-top: 8px;
  width: 100%;
}

.error-banner {
  background: rgba(224, 87, 74, .12);
  border: 1px solid rgba(224, 87, 74, .3);
  color: #f08a80;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  padding: 40px 20px;
}
.empty-state .icon { font-size: 30px; margin-bottom: 10px; }

/* ---------- App shell (post-login) ---------- */
.appshell { display: flex; min-height: 100vh; }

.sidebar {
  width: 280px;
  flex: 0 0 auto;
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar .brandrow { margin-bottom: 18px; }
.sidebar .sect-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted2);
  margin: 10px 4px 8px;
}

.athrow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
}
.athrow:hover { background: var(--card); }
.athrow.sel { background: var(--card2); border-color: var(--line); }
.av {
  width: 34px; height: 34px; border-radius: 50%;
  background: #26304a; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #cfd6e4; flex: 0 0 auto;
}
.athrow .an { font-size: 13.5px; font-weight: 650; }
.athrow .as { font-size: 11px; color: var(--muted2); }
.adh { margin-left: auto; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.adh.hi { color: var(--green); }
.adh.mid { color: var(--amber); }
.adh.lo { color: var(--red); }
.adh.unknown { color: var(--muted2); }

.sidebar .note {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--muted2);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding-top: 14px;
}

.sidebar .footer-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.link-btn {
  background: none; border: none; color: var(--muted); font-size: 12.5px; font-weight: 600;
  text-align: left; padding: 6px 4px;
}
.link-btn:hover { color: var(--txt); }

.main-area { flex: 1; min-width: 0; padding: 22px 26px; overflow-y: auto; }

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.topnav .seg {
  display: flex;
  background: #0e131b;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.topnav .seg .opt {
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--muted);
  border: none;
  background: none;
}
.topnav .seg .opt.sel { background: var(--navy); color: #fff; }

.not-coach-screen { max-width: 420px; }
.not-coach-screen h1 { font-size: 20px; margin-bottom: 8px; }
.not-coach-screen p { color: var(--muted); font-size: 13.5px; }

/* ---------- Generic row/card list (invites, etc.) ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row .ico { width: 30px; height: 30px; border-radius: 9px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
.row .main { flex: 1; min-width: 0; }
.row .main .l1 { font-size: 14px; font-weight: 600; }
.row .main .l2 { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Athlete detail (KPIs, prescribed-vs-executed, per-block, HR chart) ---------- */
.kpis { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kpi { flex: 1; min-width: 120px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi .kv { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi .kl { font-size: 11px; color: var(--muted); margin-top: 2px; }

.panel { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.panel h4 { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.panel .psub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp .box { background: #0e131b; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.cmp .box .bt { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted2); margin-bottom: 9px; }
.planrow { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 0; }
.planrow .pi { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }

.verdict { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; padding: 8px 12px; border-radius: 10px; margin-top: 4px; }
.verdict.warn { background: rgba(224,87,74,.12); color: #f08a80; border: 1px solid rgba(224,87,74,.3); }

.blocklist .statblk { padding: 11px 12px; }
.blocklist .statblk + .statblk { border-top: 1px solid var(--line); }
.statblk .top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 650; }
.bignum { font-size: 15px; font-weight: 750; color: var(--gold); font-variant-numeric: tabular-nums; }
.zonebar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; margin-top: 8px; gap: 0; }
.zonebar span { display: block; height: 100%; }

@media (max-width: 860px) {
  .cmp { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .appshell { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .main-area { padding: 16px; }
}

/* ---------- Plan builder ---------- */
.planrow { padding: 10px 11px; border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.planrow:hover { background: var(--card); }
.planrow.sel { background: var(--card2); border: 1px solid var(--line); }
.planrow .pn { font-size: 13.5px; font-weight: 650; }
.planrow .pm { font-size: 11px; color: var(--muted2); margin-top: 2px; }
.newbtn {
  margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--gold);
  padding: 9px 11px; border: 1px dashed #c9a24c66; border-radius: 10px; text-align: center; cursor: pointer;
}
.newbtn:hover { background: rgba(201, 162, 76, .08); }

.nameinput {
  width: 100%; background: #0e131b; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 15px; font-weight: 650; color: var(--txt);
}
.seclbl { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted2); margin: 18px 0 9px; }

.weekwrap { overflow-x: auto; }
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 9px; min-width: 860px; }
.day { background: var(--card2); border: 1px solid var(--line); border-radius: 11px; padding: 10px; min-height: 108px; display: flex; flex-direction: column; gap: 7px; }
.day .dn { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.day .z { font-size: 10px; color: var(--muted); margin-top: auto; }
.day .rest { color: var(--muted2); font-size: 12px; font-weight: 600; margin: auto 0; }
.dayintent {
  font-size: 12px; font-weight: 650; padding: 6px 7px; border-radius: 7px;
  background: #0e131b; border: 1px solid var(--line); color: var(--txt);
}
.ivfields { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.ivfield {
  width: 100%; font-size: 11px; background: #0e131b; border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 6px; color: var(--txt);
}

.assign { display: flex; gap: 8px; flex-wrap: wrap; }
.ath {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; background: #0e131b; border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
}
.ath.on { background: rgba(201, 162, 76, .14); border-color: var(--gold); color: var(--gold); }
.ath .ck {
  width: 14px; height: 14px; border-radius: 4px; border: 1px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}
.save {
  margin-top: 20px; display: inline-block; background: var(--gold); color: #141414;
  font-weight: 700; font-size: 14px; padding: 11px 22px; border-radius: 11px; border: none; cursor: pointer;
}
.save:disabled { opacity: .6; cursor: default; }
