/* ============================================================
   Carolina Elite Performance Platform — design system
   Premium athletic SaaS. Dark navy command sidebar, Carolina
   blue accent, calm off-white workspace, rating pills as the
   signature element.
   ============================================================ */

:root {
  /* Brand */
  --navy:        #0E1726;
  --navy-2:      #16233A;
  --navy-3:      #1E3050;
  --carolina:    #2F80C3;
  --carolina-dk: #256AA3;
  --carolina-lt: #E5F0F9;

  /* Neutrals */
  --bg:          #F5F7FA;
  --surface:     #FFFFFF;
  --surface-2:   #F0F3F7;
  --line:        #E2E8F0;
  --line-2:      #CBD5E1;
  --ink:         #1A2433;
  --ink-2:       #4A5768;
  --ink-3:       #8494A8;

  /* Signals */
  --good:        #5B9E6F;
  --warn:        #D9A23B;
  --bad:         #DC6B4A;
  --danger:      #C7443A;

  /* Shape */
  --r-sm: 7px;
  --r:    11px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,27,45,.06), 0 1px 3px rgba(15,27,45,.05);
  --shadow:    0 2px 6px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
  --shadow-lg: 0 12px 40px rgba(15,27,45,.14);

  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; }
a { color: var(--carolina-dk); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 .8em; }
small { font-size: .82rem; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, #0B1220 100%);
  color: #C6D2E2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-brand strong { display: block; color: #fff; font-size: .98rem; letter-spacing: -.01em; }
.side-brand span { display: block; font-size: .74rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }

.monogram {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--carolina) 0%, var(--carolina-dk) 100%);
  color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.monogram.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: .78rem; border-radius: 8px; }

.side-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 1px; }
.side-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: #64748F; padding: 14px 10px 5px; font-weight: 600;
}
.side-link {
  display: block; padding: 8px 11px; border-radius: var(--r-sm);
  color: #B9C6D8; font-size: .9rem; font-weight: 500;
  transition: background .12s, color .12s;
}
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-link.on {
  background: linear-gradient(90deg, rgba(47,128,195,.22), rgba(47,128,195,.06));
  color: #fff; box-shadow: inset 2px 0 0 var(--carolina);
}

.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; margin: 8px;
  background: rgba(255,255,255,.04); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.06);
}
.side-user-meta { flex: 1; min-width: 0; }
.side-user-meta strong { display: block; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta span { font-size: .74rem; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 15px 28px;
  background: rgba(245,247,250,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.page-title { margin: 0; font-size: 1.24rem; font-weight: 680; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.35rem; cursor: pointer; color: var(--ink-2); padding: 0; }
.page { padding: 26px 28px 56px; max-width: 1240px; width: 100%; }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-head h3, .card-head h4 { margin: 0; }
.sub-head { margin: 20px 0 10px; color: var(--ink-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.center-card { max-width: 460px; margin: 8vh auto; text-align: center; }
.form-card { max-width: 780px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.top-gap { margin-top: 14px; }
.hidden { display: none; }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 13px; }
label { font-size: .84rem; font-weight: 550; color: var(--ink-2); display: block; }
.stack > label { display: flex; flex-direction: column; gap: 5px; }
input, select, textarea {
  font-family: inherit; font-size: .92rem; color: var(--ink);
  padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); width: 100%; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--carolina);
  box-shadow: 0 0 0 3px rgba(47,128,195,.16);
}
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=color] { padding: 3px; height: 38px; width: 54px; cursor: pointer; }
input[type=range] { padding: 0; accent-color: var(--carolina); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; margin: 4px 0; }
.fieldset legend { font-size: .8rem; font-weight: 650; color: var(--ink-2); padding: 0 7px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 7px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.inline-form { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; font-size: .88rem; font-weight: 600; font-family: inherit;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  cursor: pointer; transition: all .12s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); text-decoration: none; }
.btn-primary {
  color: #fff; background: linear-gradient(180deg, var(--carolina), var(--carolina-dk));
  border-color: var(--carolina-dk);
  box-shadow: 0 1px 2px rgba(37,106,163,.35), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #3389cd, var(--carolina-dk)); filter: brightness(1.03); }
.btn-sm { padding: 5px 11px; font-size: .8rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 7px; flex-wrap: wrap; }
.link-btn {
  background: none; border: 0; color: var(--carolina); font: inherit; font-size: .82rem;
  cursor: pointer; padding: 0; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 650; padding: 9px 11px; border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table .dim td { opacity: .55; }
.table .avatar.sm { margin-right: 8px; vertical-align: middle; }

/* ---------- Pills — the signature element ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 650; letter-spacing: .01em; line-height: 1.4;
  color: color-mix(in srgb, var(--pill, #64748F) 82%, #000 18%);
  background: color-mix(in srgb, var(--pill, #64748F) 16%, #fff);
  border: 1px solid color-mix(in srgb, var(--pill, #64748F) 34%, #fff);
  white-space: nowrap;
}
.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--pill, #64748F); flex: 0 0 7px;
}
.pill-none { --pill: #94A3B8; font-style: normal; }
.pill-conflict {
  --pill: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, #fff);
}
.pill-conflict::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px;
  font-size: .74rem; font-weight: 600; background: var(--surface-2);
  color: var(--ink-2); border: 1px solid var(--line); text-transform: capitalize;
}
.chip-alt { background: var(--carolina-lt); color: var(--carolina-dk); border-color: #C5DEF1; }
.chip-rank { background: #EEF2F7; color: var(--navy-3); text-transform: capitalize; }
a.chip:hover { text-decoration: none; border-color: var(--line-2); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%; font-size: .8rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3E5878, var(--navy-3));
}
.avatar.sm { width: 28px; height: 28px; flex-basis: 28px; font-size: .68rem; }
.avatar.lg { width: 58px; height: 58px; flex-basis: 58px; font-size: 1.25rem; }

/* ---------- Stats & attention ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.stat strong { display: block; font-size: 1.9rem; font-weight: 720; color: var(--navy); letter-spacing: -.02em; line-height: 1; }
.stat span { display: block; font-size: .8rem; color: var(--ink-3); margin-top: 6px; }

.attn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.attn {
  flex: 1; min-width: 240px; display: block;
  padding: 13px 16px; border-radius: var(--r); font-size: .9rem; font-weight: 550;
  background: var(--carolina-lt); color: var(--carolina-dk); border: 1px solid #C5DEF1;
}
.attn:hover { text-decoration: none; filter: brightness(.985); }
.attn strong { font-size: 1.05rem; }
.attn-warn { background: #FBF3E1; color: #92651A; border-color: #EFD9A8; }

/* ---------- Rows / lists ---------- */
.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.row-side { display: flex; align-items: center; gap: 12px; }
.empty { color: var(--ink-3); padding: 18px 0; text-align: center; font-size: .92rem; }
.muted { color: var(--ink-3); }
.def-list { display: grid; gap: 8px; margin: 0; }
.def-list > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.def-list dt { font-size: .82rem; color: var(--ink-3); }
.def-list dd { margin: 0; font-size: .9rem; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: .9rem; font-weight: 550; }
.flash-success { background: #E9F4EC; color: #2C6A42; border: 1px solid #BFE0C9; }
.flash-error { background: #FBEAE6; color: #A03828; border: 1px solid #F0C6BC; }

/* ---------- Deltas ---------- */
.delta { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .84rem; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 3px; }
.checklist li { padding: 8px 10px 8px 34px; position: relative; border-radius: var(--r-sm); }
.checklist li::before {
  content: ""; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line-2);
}
.checklist li.done::before {
  content: "✓"; border-color: var(--good); background: var(--good); color: #fff;
  font-size: .7rem; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
.checklist li.done { color: var(--ink-3); }
.checklist li.done a { color: var(--ink-3); }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-meta { flex: 1; }
.profile-meta h2 { margin: 0 0 4px; }
.meta-line { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; font-size: .88rem; margin-top: 5px; }
.profile-actions { display: flex; gap: 8px; }
.restriction-banner {
  background: #FBF3E1; border: 1px solid #EFD9A8; border-left: 4px solid var(--warn);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 20px; font-size: .9rem;
}
.restriction-banner strong { display: block; margin-bottom: 6px; color: #92651A; }

/* ---------- Priorities ---------- */
.priority-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.priority-item:last-child { border-bottom: 0; }
.priority-item.suggested {
  background: linear-gradient(90deg, rgba(47,128,195,.05), transparent);
  margin: 0 -22px; padding: 12px 22px; border-bottom: 1px solid var(--line);
}
.why { margin-top: 6px; font-size: .84rem; }
.why summary { cursor: pointer; color: var(--carolina-dk); font-weight: 600; }
.why ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.why p { margin: 6px 0 0; color: var(--ink-2); }
.note { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.note:last-child { border-bottom: 0; }
.note .muted { font-size: .78rem; margin-bottom: 3px; }

/* ---------- Rules / thresholds ---------- */
.rule { padding: 13px 0; border-bottom: 1px solid var(--line); }
.rule:last-child { border-bottom: 0; }
.threshold-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.threshold-strip .pill { font-size: .72rem; }
.threshold-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.threshold-row .pill { flex: 0 0 auto; min-width: 128px; }
.threshold-row input { width: auto; flex: 1; }
.conflict-card { border-color: #F0C6BC; background: linear-gradient(180deg, #FDF6F4, #fff); }
.conflict-card h3 { color: var(--danger); }

/* ---------- Charts ---------- */
.chart-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.chart-block .card-head { align-items: center; }
.chart-block select { width: auto; }

/* ---------- Pager ---------- */
.pager { display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; }
.pager a {
  padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 6px;
  font-size: .84rem; color: var(--ink-2); font-weight: 600;
}
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager a.on { background: var(--carolina); color: #fff; border-color: var(--carolina-dk); }

/* ---------- Distribution bars (team analysis) ---------- */
.dist-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.dist-row .pill { flex: 0 0 150px; }
.dist-bar { flex: 1; height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.dist-row .muted { flex: 0 0 74px; text-align: right; font-size: .82rem; }

/* ============================================================
   Bulk entry grid & matrix
   ============================================================ */
.entry-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 16px;
}
.save-status {
  font-size: .82rem; font-weight: 650; padding: 6px 13px; border-radius: 999px;
  background: #E9F4EC; color: #2C6A42; border: 1px solid #BFE0C9; white-space: nowrap;
}
.save-status.pending { background: #FBF3E1; color: #92651A; border-color: #EFD9A8; }
.save-status.error { background: #FBEAE6; color: #A03828; border-color: #F0C6BC; }
kbd {
  font-family: var(--mono); font-size: .74rem; background: var(--surface);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; color: var(--ink-2);
}

.grid-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch;
}
.entry-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .88rem; }
.entry-grid th, .entry-grid td {
  padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
.entry-grid thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface-2);
  font-size: .74rem; font-weight: 650; color: var(--ink-2);
  border-bottom: 2px solid var(--line-2);
}
.entry-grid .th-meta { display: block; font-size: .68rem; color: var(--ink-3); font-weight: 500; text-transform: none; letter-spacing: 0; margin-top: 2px; }
.sticky-col {
  position: sticky; left: 0; z-index: 4; background: var(--surface);
  border-right: 2px solid var(--line-2) !important; min-width: 170px;
}
.sticky-col strong { display: block; }
.sticky-col .muted { font-size: .76rem; }
.entry-grid thead .sticky-col { z-index: 6; background: var(--surface-2); }
.entry-grid tbody tr:hover td { background: #FaFbFc; }
.entry-grid tbody tr:hover .sticky-col { background: #F4F7FA; }

.cell { min-width: 130px; }
.cell-inputs { display: flex; gap: 5px; flex-wrap: wrap; }
.cell-input {
  width: 60px; padding: 6px 8px; font-size: .86rem; text-align: center;
  font-variant-numeric: tabular-nums; border-radius: 6px;
}
.cell-input.saved { border-color: var(--good); background: #F4FBF6; }
.cell-input.err { border-color: var(--danger); background: #FDF3F1; }
.cell-result { display: flex; align-items: center; gap: 7px; margin-top: 6px; min-height: 22px; }
.cell-official { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.matrix-cell { text-align: center; }
.matrix-cell .cell-official { display: block; margin-bottom: 4px; }

/* ============================================================
   Guest / auth
   ============================================================ */
.guest-body {
  min-height: 100vh; margin: 0;
  background:
    radial-gradient(1100px 600px at 15% -5%, rgba(47,128,195,.18), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(30,48,80,.22), transparent 55%),
    linear-gradient(160deg, #0E1726, #16233A);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.guest-wrap { width: 100%; max-width: 420px; }
.guest-brand { display: flex; align-items: center; gap: 13px; justify-content: center; margin-bottom: 22px; }
.guest-brand strong { display: block; color: #fff; font-size: 1.1rem; }
.guest-brand span { display: block; color: #90A0B8; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.auth-card { box-shadow: var(--shadow-lg); border: 0; }
.auth-card h2 { margin-bottom: 16px; }

/* ============================================================
   Athlete portal (mobile-first)
   ============================================================ */
.portal-body {
  margin: 0; background: var(--bg); min-height: 100vh;
  padding-bottom: 74px; max-width: 560px; margin: 0 auto;
  box-shadow: 0 0 60px rgba(15,27,45,.08);
}
.portal-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 11px;
  padding: 13px 18px; background: var(--navy); color: #fff;
}
.portal-top strong { flex: 1; font-size: 1rem; }
.portal-top .link-btn { color: #9FB2CC; }
.portal-page { padding: 18px 16px 24px; }
.portal-greet { font-size: 1.35rem; margin-bottom: 14px; }
.portal-section { margin: 22px 4px 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  padding: 12px 0 15px; text-align: center; font-size: .78rem; font-weight: 600;
  color: var(--ink-3); position: relative;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a.on { color: var(--carolina-dk); }
.tabbar a.on::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 30px; height: 3px; border-radius: 0 0 3px 3px; background: var(--carolina);
}

.workout-tile {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; margin-bottom: 11px; box-shadow: var(--shadow-sm);
}
.workout-tile:hover { text-decoration: none; border-color: var(--line-2); }
.workout-tile strong { display: block; }
.workout-tile > div { display: flex; align-items: center; gap: 11px; }

.progress-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.progress-row:last-child { border-bottom: 0; }
.progress-num { text-align: right; }
.progress-num > strong { font-size: 1.3rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.progress-num .pill { margin-top: 4px; }

/* Set logging */
.ex-card { padding: 16px; }
.ex-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.ex-head .muted { font-size: .84rem; }
.ex-note { font-size: .84rem; margin: 4px 0; }
.set-table { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.set-row { display: grid; grid-template-columns: 34px repeat(auto-fit, minmax(0, 1fr)) 58px; gap: 8px; align-items: center; }
.set-head { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; }
.set-head span { text-align: center; }
.set-no { font-weight: 700; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.set-row input { text-align: center; padding: 9px 6px; font-size: 1rem; }
.set-row input:disabled { background: var(--surface-2); color: var(--ink-2); }
.log-set { padding: 8px; }
.log-set.done { background: var(--good); color: #fff; border-color: var(--good); }
#finishCard output { font-weight: 700; color: var(--carolina-dk); margin-left: 8px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
  .sidebar {
    position: fixed; z-index: 60; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: block; }
  .page { padding: 18px 16px 48px; }
  .topbar { padding: 13px 16px; }
}
@media (max-width: 560px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
  .stat strong { font-size: 1.6rem; }
}
