/* =============================================================================
   Athlete Condition — Phase 2
   Prefixes: ac- (tab) · ac-panel- (Add Test) · ac-pred- (Predictions panel)
   border-radius: 0 everywhere. Teal #14b8a6. Coach #0F6E56. Athlete #185FA5.
   ============================================================================= */

/* ============================== TAB SHELL ================================== */

.ac-tab { font-size: 14px; color: #1a1a18; }

.ac-banner {
  padding: 10px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 0.5px solid;
  border-radius: 0;
}
.ac-banner-amber { background: #FAEEDA; border-color: #FAC775; }
.ac-banner-green { background: #E1F5EE; border-color: #9FE1CB; }
.ac-banner-blue  { background: #E6F1FB; border-color: #B5D4F4; font-size: 12px; color: #0C447C; }
.ac-banner-title { font-size: 12px; font-weight: 500; }
.ac-banner-amber .ac-banner-title { color: #633806; }
.ac-banner-green .ac-banner-title { color: #085041; }
.ac-banner-body { font-size: 11px; margin-top: 2px; }
.ac-banner-amber .ac-banner-body { color: #854F0B; }
.ac-banner-green .ac-banner-body { color: #0F6E56; }
.ac-banner i.ph { font-size: 16px; flex-shrink: 0; margin-top: 1px; color: inherit; }

.ac-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}
.ac-page-title { font-size: 15px; font-weight: 500; }
.ac-page-subtitle { font-size: 12px; color: #666; margin-top: 2px; }
.ac-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0.5px solid #aaa;
  background: transparent;
  color: #1a1a18;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0;
  font-family: inherit;
}
.ac-add-btn:hover { background: #f0f0ee; }

.ac-section-label {
  font-size: 10px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.ac-test-grid { display: grid; gap: 10px; margin-bottom: 22px; }
.ac-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Tablet and up: pack cards across the full row (3–4 across on laptop).
   auto-fill keeps empty tracks at min-width so a single card doesn't
   stretch to the whole row when its section only has one metric. */
@media (min-width: 641px) {
  .ac-test-grid.ac-g2,
  .ac-test-grid.ac-g3 {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Mobile: each metric card takes the full row */
@media (max-width: 640px) {
  .ac-test-grid,
  .ac-test-grid.ac-g2,
  .ac-test-grid.ac-g3 {
    grid-template-columns: 1fr !important;
  }
  .ac-card { min-height: 0; }
}

/* ============================== TEST CARD ================================== */

.ac-card {
  background: #fff;
  border: 0.5px solid #e0e0dc;
  padding: 12px 14px;
  position: relative;
  border-radius: 0;
  min-height: 110px;
}
.ac-card.ac-required { border-left: 2px solid #14b8a6; }
.ac-card.ac-private { opacity: 0.5; }
.ac-card-label { font-size: 10px; color: #666; margin-bottom: 3px; }
.ac-card-value { font-size: 19px; font-weight: 500; line-height: 1.2; }
.ac-card-unit  { font-size: 11px; color: #666; font-weight: 400; }
.ac-card-meta  { font-size: 10px; color: #888; margin-top: 5px; }
.ac-card-explain {
  font-size: 10px;
  color: #888;
  margin-top: 6px;
}
.ac-card-explain strong { color: #085041; font-weight: 500; }

.ac-req-label {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  color: #14b8a6;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ac-card-link {
  margin-top: 8px;
  font-size: 10px;
  color: #14b8a6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

/* Validity bar */
.ac-vbar { height: 3px; background: #e0e0dc; margin-top: 8px; overflow: hidden; }
.ac-vfill { height: 3px; }
.ac-vfill-good { background: #14b8a6; }
.ac-vfill-warn { background: #EF9F27; }
.ac-vfill-exp  { background: #E24B4A; }
.ac-vtime { display: flex; justify-content: space-between; margin-top: 3px; font-size: 10px; }
.ac-vtime-good { color: #0F6E56; }
.ac-vtime-warn { color: #BA7517; }
.ac-vtime-exp  { color: #E24B4A; }

/* Sparkline */
.ac-spark { display: flex; align-items: flex-end; gap: 2px; height: 18px; margin-top: 6px; }
.ac-sb { width: 5px; background: #9FE1CB; }
.ac-sb-last { background: #0F6E56; }

/* Privacy toggle */
.ac-share-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.ac-toggle-label { font-size: 10px; color: #888; }
.ac-tt { width: 28px; height: 15px; border-radius: 8px; position: relative; }
.ac-tt.on  { background: #14b8a6; }
.ac-tt.off { background: #bbb; }
.ac-tt-thumb {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  transition: left 0.15s ease;
}
.ac-tt.on  .ac-tt-thumb { left: 15px; }
.ac-tt.off .ac-tt-thumb { left: 2px; }

/* Guardian lock */
.ac-guardian-lock {
  font-size: 10px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 6px;
}

/* Readiness pill (HRV) */
.ac-readiness {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
}
.ac-r-ready    { background: #E1F5EE; color: #085041; }
.ac-r-normal   { background: #E6F1FB; color: #0C447C; }
.ac-r-caution  { background: #FAEEDA; color: #633806; }
.ac-r-suppress { background: #FCEBEB; color: #791F1F; }
.ac-r-insufficient_data { background: #f0f0ee; color: #888; }

/* Blood pressure split */
.ac-tod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid #e0e0dc;
}
.ac-tod-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.ac-tod-val { font-size: 15px; font-weight: 500; }

/* ============================ WELLNESS INPUTS ============================== */

.ac-face-row { display: flex; gap: 4px; margin-top: 8px; }
.ac-fb {
  flex: 1;
  padding: 7px 0;
  border: 0.5px solid #e0e0dc;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  border-radius: 0;
  font-family: inherit;
}
.ac-fb.sel { border-color: #14b8a6; background: #E1F5EE; }
.ac-face-scale { display: flex; justify-content: space-between; font-size: 10px; color: #888; margin-top: 3px; }

.ac-num-row { display: flex; gap: 2px; margin-top: 8px; }
.ac-nb {
  flex: 1;
  height: 30px;
  border: 0.5px solid #e0e0dc;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  border-radius: 0;
  font-family: inherit;
}
.ac-nb.sel { border-color: #14b8a6; background: #E1F5EE; color: #085041; font-weight: 500; }

.ac-note-area { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid #e0e0dc; }
.ac-note-textarea {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid #e0e0dc;
  background: transparent;
  color: #1a1a18;
  font-size: 12px;
  font-family: inherit;
  resize: none;
  height: 48px;
  border-radius: 0;
}
.ac-note-link {
  font-size: 10px;
  color: #14b8a6;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.ac-sharing-header {
  font-size: 10px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 8px 0 5px;
}
.ac-sharing-row { display: flex; align-items: center; justify-content: space-between; }
.ac-sharing-row-label { font-size: 11px; color: #555; }

.ac-coach-note {
  font-size: 11px;
  color: #555;
  padding: 5px 8px;
  background: #f5f5f3;
  border-left: 2px solid #ccc;
  margin-top: 6px;
}

.ac-private-notice {
  background: #f5f5f3;
  border: 0.5px dashed #ccc;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #666;
}

.ac-empty-section {
  padding: 14px;
  background: #f9f9f7;
  border: 0.5px dashed #ccc;
  text-align: center;
  font-size: 12px;
  color: #888;
  margin-bottom: 22px;
}
.ac-empty-section button {
  margin-top: 8px;
  font-size: 11px;
  color: #14b8a6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

/* ============================== HISTORY TABLE ============================== */

.ac-divider { border: none; border-top: 0.5px solid #e0e0dc; margin: 20px 0; }
.ac-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ac-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ac-history-table th {
  text-align: left;
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 500;
  color: #888;
  border-bottom: 0.5px solid #e0e0dc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ac-history-table td {
  padding: 9px 8px;
  border-bottom: 0.5px solid #e0e0dc;
  vertical-align: middle;
}
.ac-history-table tr:last-child td { border-bottom: none; }
.ac-history-table tr:hover td { background: #f9f9f7; }
.ac-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 0;
}
.ac-badge-active   { background: #E1F5EE; color: #085041; }
.ac-badge-expired  { background: #f0f0ee; color: #666; }
.ac-badge-race     { background: #EEEDFE; color: #3C3489; }
.ac-badge-lab      { background: #E6F1FB; color: #0C447C; }
.ac-badge-self     { background: #E1F5EE; color: #085041; }
.ac-badge-garmin,
.ac-badge-polar,
.ac-badge-whoop,
.ac-badge-oura     { background: #E6F1FB; color: #0C447C; }
.ac-trend-up   { color: #0F6E56; font-size: 11px; }
.ac-trend-down { color: #E24B4A; font-size: 11px; }
.ac-history-table select {
  padding: 4px 8px;
  border: 0.5px solid #aaa;
  background: transparent;
  font-size: 12px;
  font-family: inherit;
  border-radius: 0;
}

/* =========================== ADD TEST PANEL =============================== */

.ac-panel-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ac-panel-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.ac-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: #fff;
  border-left: 0.5px solid #e0e0dc;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.ac-panel.open { transform: translateX(0); }

.ac-panel-hdr {
  padding: 16px 18px;
  border-bottom: 0.5px solid #e0e0dc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.ac-panel-hdr-title { font-size: 14px; font-weight: 500; }
.ac-panel-hdr-sub { font-size: 11px; color: #666; margin-top: 1px; }
.ac-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #666;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.ac-panel-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.ac-panel-ftr {
  padding: 14px 18px;
  border-top: 0.5px solid #e0e0dc;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ac-btn-primary {
  flex: 1;
  padding: 9px;
  background: #0F6E56;
  color: #fff;
  border: none;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 0;
}
.ac-btn-primary:disabled { background: #b2c8c0; cursor: not-allowed; }
.ac-btn-secondary {
  padding: 9px 16px;
  background: transparent;
  border: 0.5px solid #aaa;
  color: #1a1a18;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 0;
}
.ac-btn-calculate {
  width: 100%;
  padding: 8px;
  background: #f5f5f3;
  border: 0.5px solid #aaa;
  color: #1a1a18;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 0;
  margin-bottom: 12px;
}
.ac-btn-calculate:hover { background: #ebebea; }

/* Steps */
.ac-panel-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.ac-panel-step {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
}
.ac-panel-step-done    { background: #0F6E56; color: #fff; }
.ac-panel-step-active  { background: #14b8a6; color: #fff; }
.ac-panel-step-pending { background: #f0f0ee; color: #888; border: 0.5px solid #ccc; }
.ac-panel-step-line { flex: 1; height: 0.5px; background: #ccc; }

/* Type selection */
.ac-panel-cat-label {
  font-size: 10px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.ac-panel-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.ac-panel-type-card {
  padding: 10px 12px;
  border: 0.5px solid #e0e0dc;
  cursor: pointer;
  background: #fff;
  border-radius: 0;
}
.ac-panel-type-card:hover { border-color: #aaa; background: #f9f9f7; }
.ac-panel-type-card.sel { border-color: #14b8a6; background: #E1F5EE; }
.ac-panel-type-card.sel .ac-panel-type-name { color: #14b8a6; }
.ac-panel-type-cat { font-size: 10px; color: #888; margin-bottom: 3px; }
.ac-panel-type-name { font-size: 12px; font-weight: 500; }

/* Form fields */
.ac-panel-field { margin-bottom: 14px; }
.ac-panel-label { font-size: 11px; color: #555; margin-bottom: 5px; display: block; }
.ac-panel input[type=text],
.ac-panel input[type=number],
.ac-panel input[type=date],
.ac-panel select,
.ac-panel textarea {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid #ccc;
  background: transparent;
  color: #1a1a18;
  font-size: 13px;
  font-family: inherit;
  border-radius: 0;
}
.ac-panel-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ac-panel-calc-result {
  background: #f5f5f3;
  border: 0.5px solid #e0e0dc;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.ac-panel-calc-label { font-size: 11px; color: #666; margin-bottom: 4px; }
.ac-panel-calc-score { font-size: 28px; font-weight: 500; color: #14b8a6; }
.ac-panel-calc-sub { font-size: 11px; color: #888; margin-top: 4px; }

.ac-panel-validity-hint { font-size: 11px; color: #888; margin-top: 6px; }
.ac-panel-error {
  font-size: 12px;
  color: #791F1F;
  background: #FCEBEB;
  border: 0.5px solid #f5c0c0;
  padding: 8px 10px;
  margin: 8px 0;
}
.ac-panel-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 0.5px solid #e0e0dc;
  font-size: 10px;
  color: #666;
  margin-bottom: 12px;
}
.ac-panel-section-label {
  font-size: 11px;
  font-weight: 500;
  color: #555;
  margin: 16px 0 12px;
}

/* ========================== PREDICTIONS PANEL ============================== */

.ac-pred-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100vw;
  background: #fff;
  border-left: 0.5px solid #e0e0dc;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.ac-pred-panel.open { transform: translateX(0); }
.ac-pred-hdr {
  padding: 16px 18px;
  border-bottom: 0.5px solid #e0e0dc;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}
.ac-pred-hdr-title { font-size: 14px; font-weight: 500; }
.ac-pred-hdr-sub { font-size: 11px; color: #666; margin-top: 2px; }
.ac-pred-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.ac-pred-section-label {
  font-size: 10px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 0.5px solid #e0e0dc;
}
.ac-pred-section-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Goal race block */
.ac-pred-goal-race { border: 0.5px solid #e0e0dc; padding: 14px; margin-bottom: 16px; }
.ac-pred-goal-title { font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.ac-pred-goal-meta { font-size: 12px; color: #555; margin-bottom: 8px; }
.ac-pred-goal-gap { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ac-pred-gap-pill { padding: 4px 12px; font-size: 12px; font-weight: 500; }
.ac-pred-gap-green { background: #E1F5EE; color: #085041; }
.ac-pred-gap-amber { background: #FAEEDA; color: #633806; }
.ac-pred-gap-red   { background: #FCEBEB; color: #791F1F; }
.ac-pred-gap-detail { font-size: 11px; color: #666; }

/* Unit toggle */
.ac-pred-unit-toggle {
  display: flex;
  border: 0.5px solid #ccc;
  width: fit-content;
  margin-bottom: 14px;
}
.ac-pred-ut {
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #666;
  font-family: inherit;
}
.ac-pred-ut.act { background: #f0f0ee; color: #1a1a18; font-weight: 500; }

/* Predictions table */
.ac-pred-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ac-pred-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 500;
  color: #888;
  border-bottom: 0.5px solid #e0e0dc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ac-pred-table td {
  padding: 8px;
  border-bottom: 0.5px solid #e0e0dc;
}
.ac-pred-table tr:last-child td { border-bottom: none; }
.ac-pred-table tr:hover td { background: #f9f9f7; }
.ac-pred-goal-row td {
  border-left: 2px solid #14b8a6;
  background: #f0faf8;
}
.ac-pred-zone-pill {
  display: inline-flex;
  padding: 1px 6px;
  font-size: 10px;
}
.ac-pred-z-Endurance { background: #E1F5EE; color: #085041; }
.ac-pred-z-Stamina   { background: #E6F1FB; color: #0C447C; }
.ac-pred-z-Strength  { background: #FAEEDA; color: #633806; }
.ac-pred-z-Power     { background: #FCEBEB; color: #791F1F; }

/* Training paces */
.ac-pred-zone-group { margin-bottom: 16px; }
.ac-pred-zone-header {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #f5f5f3;
  border-left: 3px solid;
}
.ac-pred-zh-Endurance { border-color: #0F6E56; }
.ac-pred-zh-Stamina   { border-color: #185FA5; }
.ac-pred-zh-Strength  { border-color: #BA7517; }
.ac-pred-zh-Power     { border-color: #A32D2D; }
.ac-pred-pace-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.ac-pred-pace-table th {
  text-align: left;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 500;
  color: #888;
  border-bottom: 0.5px solid #e0e0dc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ac-pred-pace-table td {
  padding: 7px 8px;
  border-bottom: 0.5px solid #e0e0dc;
}
.ac-pred-pace-table tr:last-child td { border-bottom: none; }

.ac-pred-no-hr-link {
  color: #14b8a6;
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

.ac-pred-chart-container { height: 200px; margin-top: 12px; position: relative; }
.ac-pred-chart-empty {
  height: 120px;
  background: #f5f5f3;
  border: 0.5px solid #e0e0dc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #888;
  text-align: center;
  padding: 16px;
}

.ac-pred-loading,
.ac-tab-loading {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: #888;
}

.ac-pred-error,
.ac-tab-error {
  padding: 14px;
  background: #FCEBEB;
  border: 0.5px solid #f5c0c0;
  font-size: 12px;
  color: #791F1F;
}
