
/* ==========================================
   TS FIT — PUBLIC ATHLETE PORTAL
   Tapak Suci 189 KRWG
   Responsive Desktop, Tablet & Mobile
   Font: Segoe UI
========================================== */

:root {
  --red: #c8102e;
  --red-dark: #970b22;
  --red-light: #fff0f2;

  --yellow: #ffd447;
  --yellow-light: #fff8df;

  --blue: #2368b4;
  --blue-light: #edf5ff;

  --white: #ffffff;
  --background: #f5f6fa;
  --text: #20232b;
  --muted: #737987;
  --border: #e8eaf0;

  --radius: 18px;
  --shadow: 0 10px 30px rgba(37, 27, 32, 0.07);

  --chart-old: #c8102e;
  --chart-latest: #2368b4;
}

/* ==========================================
   RESET
========================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.athlete-page,
.athlete-page *,
.profile-card,
.profile-card * {
  font-family: "Segoe UI", Arial, sans-serif;
}

/* ==========================================
   HEADER
========================================== */

.athlete-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;

  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(5%, calc((100% - 1120px) / 2));
  margin-bottom: 35px;

  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.athlete-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--red) 0%,
    var(--red) 55%,
    var(--yellow) 55%,
    var(--yellow) 85%,
    var(--blue) 85%,
    var(--blue) 100%
  );
}

.athlete-brand,
.profile-card-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 49px;
  height: 49px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--red);
  border: 3px solid var(--yellow);
  border-radius: 14px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -1px;
  box-shadow: 0 4px 10px rgba(200, 16, 46, 0.15);
}

.athlete-brand > div:last-child,
.profile-card-brand > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.athlete-brand strong {
  color: var(--red-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.3;
}

.athlete-brand span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.back-home {
  flex-shrink: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  transition: color 0.2s ease;
}

.back-home:hover {
  color: var(--red-dark);
}

/* ==========================================
   MAIN CONTENT
========================================== */

.athlete-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 0 60px;
}

.athlete-search-section,
.athlete-profile {
  width: 90%;
  max-width: 1120px;
  margin-right: auto;
  margin-left: auto;
}

/* ==========================================
   SEARCH SECTION
========================================== */

.athlete-search-section {
  max-width: 720px;
}

.search-heading {
  margin-bottom: 25px;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.search-heading h1 {
  color: var(--text);
  font-size: clamp(28px, 4.5vw, 39px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -1px;
}

.search-heading p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.athlete-search-box {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 17px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border 0.2s ease;
}

.athlete-search-box:focus-within {
  border-color: var(--red);
}

.search-icon {
  flex-shrink: 0;
  color: var(--red);
  font-size: 24px;
}

.athlete-search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.athlete-search-box input::placeholder {
  color: #a0a4ae;
}

.athlete-search-box button {
  width: 29px;
  height: 29px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  font-size: 18px;
}

.search-result-count {
  margin: 13px 2px;
  color: var(--muted);
  font-size: 12px;
}

/* ==========================================
   SEARCH RESULTS
========================================== */

.athlete-search-results {
  display: grid;
  gap: 10px;
}

.athlete-result-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 5px 15px rgba(37, 27, 32, 0.025);
  transition: 0.2s ease;
}

.athlete-result-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
}

.result-avatar {
  width: 47px;
  height: 47px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #f5d9de;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 900;
}

.result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-information {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-information strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-team,
.result-test-count {
  color: var(--muted);
  font-size: 11px;
}

.result-arrow {
  flex-shrink: 0;
  color: var(--red);
  font-size: 24px;
}

.search-empty,
.athlete-loading,
.athlete-error,
.athlete-no-data {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
}

.search-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.search-empty p {
  margin: 0;
}

.empty-icon {
  margin-bottom: 8px;
  font-size: 30px;
}

/* ==========================================
   PROFILE SECTION
========================================== */

.athlete-profile {
  margin-top: 38px;
}

.profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.back-button {
  padding: 9px 14px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  transition: 0.2s ease;
}

.back-button:hover {
  color: var(--red);
  border-color: var(--red);
}

.profile-toolbar-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

/* ==========================================
   PROFILE CARD
========================================== */

.profile-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 14px 38px rgba(32, 35, 43, 0.09);
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--red) 0%,
    var(--red) 60%,
    var(--yellow) 60%,
    var(--yellow) 82%,
    var(--blue) 82%,
    var(--blue) 100%
  );
}

/* CARD HEADER */

.profile-card-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 23px;
  background: linear-gradient(110deg, #fff5f6, #ffffff 80%);
  border-bottom: 1px solid #f1dfe3;
}

.profile-card-brand {
  gap: 10px;
}

.profile-card-brand .brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 11px;
  font-size: 15px;
}

.profile-card-brand strong {
  color: var(--red-dark);
  font-size: 14px;
  font-weight: 900;
}

.profile-card-brand span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.profile-status {
  flex-shrink: 0;
  padding: 7px 11px;
  color: var(--red);
  background: var(--red-light);
  border-radius: 20px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

/* ==========================================
   PROFILE CONTENT — DESKTOP
========================================== */

.profile-card-content {
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 0.62fr);
  align-items: stretch;
  gap: 20px;
  min-height: 410px;
  padding: 22px;
}

/* ==========================================
   LEFT PANEL — ATHLETE IDENTITY
========================================== */

.profile-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 23px 18px;
  background: linear-gradient(160deg, #fff2f4, #ffffff);
  border: 1px solid #f3dce1;
  border-radius: 16px;
}

.profile-photo-wrapper {
  position: relative;
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--red-light);
  border: 3px solid var(--white);
  border-radius: 17px;
  box-shadow: 0 5px 18px rgba(200, 16, 46, 0.12);
}

.profile-photo,
.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  color: var(--white);
  font-size: 43px;
  font-weight: 900;
  letter-spacing: -2px;
}

.profile-identity {
  width: 100%;
  margin: 15px 0 19px;
  text-align: center;
}

.profile-identity h2 {
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-identity p {
  margin-top: 6px;
  color: var(--red-dark);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ==========================================
   PHYSICAL DATA
========================================== */

.profile-physical-data {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.physical-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.physical-item > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.physical-item > strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.bmi-item {
  grid-column: 1 / -1;
  background: var(--yellow-light);
  border-color: #f4e5a8;
}

.bmi-item > strong {
  color: var(--red-dark);
  font-size: 21px;
}

.bmi-item small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

/* ==========================================
   RIGHT PANEL — RADAR
========================================== */

.profile-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 21px;
  background: linear-gradient(145deg, #f7faff, #ffffff);
  border: 1px solid #e1eaf6;
  border-radius: 16px;
}

.radar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.radar-heading > div:first-child {
  min-width: 0;
}

.radar-heading .section-eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
}

.radar-heading h3 {
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.radar-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.radar-test-date {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}

.radar-test-date span {
  color: var(--muted);
  font-size: 9px;
}

.radar-test-date strong {
  color: var(--text);
  font-size: 11px;
}

/* ==========================================
   RADAR LEGEND
========================================== */

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 17px;
  margin-top: 15px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
}

.previous-dot {
  background: var(--chart-old);
}

.latest-dot {
  background: var(--chart-latest);
}

/* ==========================================
   RADAR CHART
========================================== */

.public-radar-chart {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 285px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.public-radar-chart svg {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  max-height: 340px;
  overflow: visible;
}

/*
  Catatan:
  Skala 1–5 pada radar diatur oleh SVG/JavaScript.
  CSS ini hanya mengatur ukuran dan ruang grafik.
*/

.chart-note {
  width: 100%;
  margin: 0;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.radar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
}

/* ==========================================
   CARD FOOTER
========================================== */

.profile-card-footer {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: var(--red-dark);
  border-top: 1px solid var(--red-dark);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ==========================================
   PROFILE ACTIONS
========================================== */

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.profile-action-button {
  min-height: 43px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  transition: 0.2s ease;
}

.profile-action-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.download-button {
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
}

.download-button:hover {
  color: var(--red);
  border-color: var(--red);
}

.share-button {
  color: var(--white);
  background: var(--red);
  border: 1px solid var(--red);
}

.share-button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

/* ==========================================
   HISTORY
========================================== */

.athlete-history-section {
  margin-top: 38px;
}

.history-heading {
  margin-bottom: 17px;
}

.history-heading h3 {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.public-history-card {
  margin-bottom: 12px;
  padding: 17px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 0 5px 15px rgba(37, 27, 32, 0.025);
}

.public-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}

.public-history-heading strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.public-history-heading span {
  color: var(--muted);
  font-size: 10px;
}

.public-history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 13px;
}

.public-history-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.public-history-item span {
  color: var(--muted);
  font-size: 10px;
}

.public-history-item strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ==========================================
   NOTIFICATION
========================================== */

.athlete-notification {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 9999;
  max-width: calc(100% - 30px);
  padding: 12px 19px;
  transform: translateX(-50%);
  color: var(--white);
  background: var(--text);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  font-size: 12px;
  text-align: center;
}

/* ==========================================
   TABLET
========================================== */

@media (max-width: 900px) {
  .athlete-page {
    padding-bottom: 45px;
  }

  .profile-card-content {
    grid-template-columns: minmax(200px, 0.38fr) minmax(0, 0.62fr);
    gap: 13px;
    padding: 15px;
  }

  .profile-left {
    padding: 18px 12px;
  }

  .profile-right {
    padding: 16px 13px;
  }

  .profile-photo-wrapper {
    width: 100px;
    height: 100px;
  }

  .radar-heading h3 {
    font-size: 18px;
  }

  .public-radar-chart {
    min-height: 250px;
  }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

  /* HEADER */

  .athlete-header {
    min-height: 68px;
    padding: 11px 4%;
    margin-bottom: 25px;
  }

  .athlete-brand {
    gap: 9px;
  }

  .athlete-brand .brand-mark {
    width: 41px;
    height: 41px;
    border-radius: 12px;
    font-size: 16px;
  }

  .athlete-brand strong {
    font-size: 18px;
  }

  .athlete-brand span {
    font-size: 8px;
    letter-spacing: 0.6px;
  }

  .back-home {
    font-size: 11px;
  }

  /* MAIN */

  .athlete-search-section,
  .athlete-profile {
    width: 94%;
  }

  .search-heading {
    margin-bottom: 19px;
  }

  .search-heading h1 {
    font-size: 26px;
  }

  .search-heading p {
    font-size: 12px;
    line-height: 1.65;
  }

  .athlete-search-box {
    min-height: 51px;
    padding: 0 12px;
    gap: 9px;
  }

  .athlete-search-box input {
    font-size: 13px;
  }

  /* TOOLBAR */

  .athlete-profile {
    margin-top: 27px;
  }

  .profile-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .back-button {
    padding: 8px 11px;
    font-size: 11px;
  }

  .profile-toolbar-label {
    font-size: 8px;
  }

  /* CARD HEADER */

  .profile-card {
    border-radius: 15px;
  }

  .profile-card-header {
    min-height: 57px;
    padding: 10px 12px;
    gap: 7px;
  }

  .profile-card-brand {
    gap: 7px;
  }

  .profile-card-brand .brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 9px;
    font-size: 12px;
  }

  .profile-card-brand strong {
    font-size: 10px;
  }

  .profile-card-brand span {
    font-size: 7px;
  }

  .profile-status {
    padding: 5px 7px;
    font-size: 7px;
    letter-spacing: 0.2px;
  }

  /* HORIZONTAL PROFILE */

  .profile-card-content {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    align-items: stretch;
    gap: 8px;
    min-height: 0;
    padding: 9px;
  }

  /* LEFT */

  .profile-left {
    min-width: 0;
    padding: 12px 7px;
    border-radius: 11px;
  }

  .profile-photo-wrapper {
    width: min(100%, 76px);
    height: auto;
    aspect-ratio: 1;
    margin-bottom: 3px;
    border-radius: 11px;
  }

  .profile-avatar {
    font-size: 29px;
  }

  .profile-identity {
    margin: 9px 0 11px;
  }

  .profile-identity h2 {
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .profile-identity p {
    margin-top: 4px;
    font-size: 9px;
    line-height: 1.4;
  }

  /* PHYSICAL DATA */

  .profile-physical-data {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .physical-item {
    gap: 3px;
    padding: 8px 7px;
    border-radius: 8px;
  }

  .physical-item > span {
    font-size: 8px;
  }

  .physical-item > strong {
    font-size: 13px;
  }

  .bmi-item {
    grid-column: auto;
  }

  .bmi-item > strong {
    font-size: 15px;
  }

  .bmi-item small {
    font-size: 8px;
    line-height: 1.4;
  }

  /* RIGHT */

  .profile-right {
    min-width: 0;
    padding: 11px 7px 9px;
    border-radius: 11px;
  }

  .radar-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .radar-heading .section-eyebrow {
    margin-bottom: 3px;
    font-size: 7px;
    letter-spacing: 0.7px;
  }

  .radar-heading h3 {
    font-size: 13px;
    line-height: 1.35;
  }

  .radar-heading p {
    margin-top: 4px;
    font-size: 8px;
    line-height: 1.4;
  }

  .radar-test-date {
    gap: 2px;
    text-align: left;
  }

  .radar-test-date span {
    font-size: 7px;
  }

  .radar-test-date strong {
    font-size: 9px;
  }

  /* LEGEND */

  .radar-legend {
    gap: 6px 9px;
    margin-top: 9px;
    padding: 7px 5px;
    border-radius: 7px;
  }

  .legend-item {
    gap: 4px;
    font-size: 7px;
  }

  .legend-dot {
    width: 7px;
    height: 7px;
  }

  /* CHART — MOBILE DIPERBESAR */

  .public-radar-chart {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    flex: none;
    overflow: visible;
    padding: 0;
    margin: 10px 0;
  }

  .public-radar-chart svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .radar-footer {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px;
    padding-top: 8px;
    font-size: 7px;
  }

  /* FOOTER */

  .profile-card-footer {
    min-height: 37px;
    gap: 6px;
    padding: 9px 10px;
    font-size: 7px;
    letter-spacing: 0.1px;
  }

  /* ACTIONS */

  .profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 11px;
  }

  .profile-action-button {
    width: 100%;
    min-width: 0;
    min-height: 41px;
    padding: 8px 5px;
    font-size: 10px;
    border-radius: 9px;
  }

  /* HISTORY */

  .athlete-history-section {
    margin-top: 28px;
  }

  .history-heading {
    margin-bottom: 12px;
  }

  .history-heading h3 {
    font-size: 18px;
  }

  .public-history-card {
    padding: 12px;
    border-radius: 11px;
  }

  .public-history-heading {
    gap: 7px;
    padding-bottom: 10px;
  }

  .public-history-heading strong {
    font-size: 11px;
  }

  .public-history-heading span {
    font-size: 8px;
  }

  .public-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 8px;
    padding-top: 11px;
  }

  .public-history-item {
    gap: 3px;
  }

  .public-history-item span {
    font-size: 8px;
  }

  .public-history-item strong {
    font-size: 10px;
  }
}

/* ==========================================
   SMALL MOBILE
========================================== */

@media (max-width: 380px) {

  .athlete-header {
    padding-right: 3%;
    padding-left: 3%;
  }

  .athlete-brand {
    gap: 7px;
  }

  .athlete-brand strong {
    font-size: 16px;
  }

  .athlete-brand span {
    font-size: 7px;
  }

  .back-home {
    font-size: 10px;
  }

  .profile-card-content {
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
    gap: 6px;
    padding: 7px;
  }

  .profile-left {
    padding: 10px 5px;
  }

  .profile-right {
    padding: 9px 5px;
  }

  .profile-identity h2 {
    font-size: 11px;
  }

  .profile-identity p {
    font-size: 8px;
  }

  .physical-item {
    padding: 7px 5px;
  }

  .physical-item > strong {
    font-size: 12px;
  }

  .bmi-item > strong {
    font-size: 14px;
  }

  .radar-heading h3 {
    font-size: 12px;
  }

  .radar-legend {
    gap: 5px;
  }

  .legend-item {
    font-size: 6px;
  }

  .public-radar-chart {
    min-height: 165px;
  }

  .profile-card-footer {
    font-size: 6px;
  }
}

/* ==========================================
   VERY SMALL SCREEN
========================================== */

@media (max-width: 320px) {

  .profile-card-header {
    padding: 9px;
  }

  .profile-card-brand strong {
    font-size: 9px;
  }

  .profile-status {
    font-size: 6px;
  }

  .profile-card-content {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  }

  .profile-photo-wrapper {
    width: 60px;
  }

  .profile-identity h2 {
    font-size: 10px;
  }

  .physical-item > span {
    font-size: 7px;
  }

  .physical-item > strong {
    font-size: 11px;
  }

  .public-radar-chart {
    min-height: 150px;
  }
}

/* ==========================================
   PRINT
========================================== */

@media print {

  body {
    background: var(--white);
  }

  .athlete-header,
  .profile-toolbar,
  .profile-actions,
  .athlete-search-section,
  .athlete-history-section {
    display: none !important;
  }

  .athlete-page,
  .athlete-profile {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .profile-card {
    border: 1px solid var(--border);
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ==========================================
   ACCESSIBILITY
========================================== */

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   TS FIT — FINAL LAYOUT CORRECTION
========================================== */

/* 1. HEADER FULL WIDTH DI LAPTOP */
.athlete-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 60px;
}

.athlete-header {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 78px;
  padding: 14px max(5%, calc((100% - 1120px) / 2));
  margin: 0 0 35px;
  box-sizing: border-box;
  overflow: visible;
}

.athlete-brand {
  flex: 0 1 auto;
  min-width: 0;
}

.athlete-brand > div:last-child {
  min-width: 0;
}

.back-home {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* KONTEN TETAP TERPUSAT */
.athlete-search-section,
.athlete-profile {
  width: 90%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

/* 2. KARTU TIDAK BOLEH MELEBIHI LAYAR */
.profile-card,
.profile-card-content,
.profile-left,
.profile-right,
.public-radar-chart {
  min-width: 0;
  max-width: 100%;
}

.profile-card {
  width: 100%;
  overflow: hidden;
}

.profile-card-content {
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
}

.profile-left,
.profile-right {
  overflow: hidden;
}

.public-radar-chart {
  width: 100%;
  overflow: visible;
}

.public-radar-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 3. HILANGKAN TEKS TAMBAHAN DI AREA CHART */
.radar-heading p,
.radar-test-date {
  display: none !important;
}

/* 4. MOBILE */
@media (max-width: 600px) {
  .athlete-header {
    width: 100%;
    min-height: 68px;
    padding: 10px 14px;
    margin-bottom: 25px;
    gap: 8px;
  }

  .athlete-brand {
    flex: 1 1 auto;
    gap: 8px;
  }

  .athlete-brand .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .athlete-brand strong {
    font-size: 16px;
  }

  .athlete-brand span {
    font-size: 8px;
    letter-spacing: 0.4px;
  }

  .back-home {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .athlete-search-section,
  .athlete-profile {
    width: 94%;
  }

  .profile-card-content {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: 7px;
    padding: 8px;
  }

  .profile-left,
  .profile-right {
    min-width: 0;
    padding: 9px 6px;
  }

  .profile-right {
    overflow: visible;
  }

  .radar-heading {
    display: block;
  }

  .radar-heading h3 {
    font-size: 13px;
  }

  .public-radar-chart {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: 0;
    margin: 10px 0;
  }

  .public-radar-chart svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .profile-card-footer {
    padding: 9px;
    font-size: 7px;
  }
}

/* HP SANGAT KECIL */
@media (max-width: 360px) {
  .athlete-header {
    padding-left: 9px;
    padding-right: 9px;
  }

  .athlete-brand {
    gap: 6px;
  }

  .athlete-brand strong {
    font-size: 14px;
  }

  .back-home {
    font-size: 9px;
  }

  .profile-card-content {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 5px;
    padding: 6px;
  }
}
/* SEARCH BOX — HILANGKAN GARIS FOKUS ANEH */
#athlete-search,
#athlete-search:hover,
#athlete-search:focus,
#athlete-search:focus-visible,
#athlete-search:active {
  outline: none !important;
  box-shadow: none !important;
}

#athlete-search {
  -webkit-appearance: none;
  appearance: none;
  border-color: #e5e7eb;
}

#athlete-search:focus,
#athlete-search:focus-visible {
  border-color: #C8102E !important;
}
/* LOGO TAPAK SUCI */
img.brand-mark {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
/* =====================================================
   TS FIT — MOBILE RESPONSIVE FINAL
   PORTAL ATLET
   Tempel di bagian PALING BAWAH css/atlet.css
===================================================== */

/* 1. KEAMANAN LAYOUT */
html {
  width: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  min-width: 0;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

.athlete-page,
.athlete-search-section,
.athlete-profile,
.profile-card,
.profile-card-content,
.profile-left,
.profile-right {
  min-width: 0;
  max-width: 100%;
}

/* 2. WARNA GRAFIK SESUAI RIWAYAT PELATIH */
:root {
  --chart-old: #2563eb;
  --chart-latest: #dc2626;
}

.previous-dot {
  background-color: #2563eb;
}

.latest-dot {
  background-color: #dc2626;
}

/* 3. TABLET DAN HP */
@media (max-width: 768px) {

  .athlete-page {
    width: 100%;
    padding-bottom: 35px;
  }

  .athlete-header {
    width: 100%;
    min-height: 66px;
    padding: 10px 16px;
    margin-bottom: 24px;
  }

  .athlete-search-section,
  .athlete-profile {
    width: calc(100% - 28px);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  /* PENCARIAN */
  .search-heading {
    margin-bottom: 20px;
  }

  .search-heading h1 {
    font-size: clamp(25px, 6vw, 32px);
    line-height: 1.25;
  }

  .search-heading p {
    font-size: 13px;
    line-height: 1.6;
  }

  .athlete-search-box {
    min-height: 54px;
    padding: 0 14px;
    border-radius: 14px;
  }

  .athlete-search-box input {
    min-width: 0;
    font-size: 16px;
  }

  .athlete-result-card {
    min-height: 72px;
    padding: 12px;
    gap: 12px;
  }

  .result-avatar {
    width: 48px;
    height: 48px;
  }

  .result-information strong {
    font-size: 14px;
  }

  /* KARTU PROFIL */
  .athlete-profile {
    margin-top: 26px;
  }

  .profile-card {
    width: 100%;
    border-radius: 17px;
    overflow: hidden;
  }

  .profile-card-header {
    min-height: 65px;
    padding: 12px 14px;
    gap: 8px;
  }

  .profile-card-brand {
    min-width: 0;
  }

  .profile-card-brand span {
    font-size: 9px;
    overflow-wrap: anywhere;
  }

  .profile-status {
    font-size: 9px;
    padding: 6px 9px;
  }

  /*
   * PENTING:
   * Pada HP profil dan chart disusun ke bawah.
   */
  .profile-card-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    min-height: 0;
    padding: 13px;
  }

  /* PROFIL ATLET */
  .profile-left {
    width: 100%;
    min-width: 0;
    padding: 20px 14px;
    overflow: hidden;
    border-radius: 14px;
  }

  .profile-photo-wrapper {
    width: 106px;
    height: 106px;
    border-radius: 18px;
  }

  .profile-identity {
    margin: 14px 0 18px;
  }

  .profile-identity h2 {
    font-size: 20px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .profile-identity p {
    font-size: 12px;
  }

  /* BB, TB, BMI */
  .profile-physical-data {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .physical-item {
    min-width: 0;
    padding: 13px 12px;
    border-radius: 12px;
  }

  .physical-item > span {
    font-size: 11px;
    line-height: 1.4;
  }

  .physical-item > strong {
    font-size: 19px;
    line-height: 1.3;
  }

  .bmi-item {
    grid-column: 1 / -1;
  }

  .bmi-item > strong {
    font-size: 24px;
  }

  .bmi-item small {
    font-size: 12px;
    line-height: 1.5;
  }

  /* SPIDER CHART */
  .profile-right {
    width: 100%;
    min-width: 0;
    padding: 17px 12px;
    overflow: hidden;
    border-radius: 14px;
  }

  .radar-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .radar-heading h3 {
    font-size: 20px;
  }

  .radar-heading p {
    display: block !important;
    font-size: 11px;
    line-height: 1.5;
  }

  .radar-test-date {
    display: flex !important;
    flex-shrink: 0;
    text-align: right;
  }

  .radar-test-date span {
    font-size: 10px;
  }

  .radar-test-date strong {
    font-size: 11px;
  }

  .radar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 15px;
    padding: 10px;
  }

  .legend-item {
    font-size: 11px;
  }

  .public-radar-chart {
    width: 100%;
    min-width: 0;
    min-height: 280px;
    height: auto;
    margin: 12px 0;
    padding: 0;
    overflow: hidden;
  }

  .public-radar-chart svg {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    max-height: none;
    margin: 0 auto;
    overflow: visible;
  }

  .radar-footer {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 10px;
  }

  /* FOOTER KARTU */
  .profile-card-footer {
    min-height: 42px;
    padding: 12px;
    gap: 8px;
    font-size: 8px;
  }

  /* TOMBOL AKSI */
  .profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
  }

  .profile-action-button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 8px;
    font-size: 12px;
    border-radius: 11px;
  }

  /* RIWAYAT TES */
  .athlete-history-section {
    margin-top: 30px;
  }

  .history-heading h3 {
    font-size: 19px;
  }

  .public-history-card {
    padding: 14px;
    border-radius: 13px;
  }

  .public-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .public-history-item strong {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
}

/* 4. HP KECIL */
@media (max-width: 390px) {

  .athlete-header {
    padding: 10px 12px;
  }

  .athlete-brand strong {
    font-size: 16px;
  }

  .athlete-search-section,
  .athlete-profile {
    width: calc(100% - 20px);
  }

  .profile-card-content {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
    padding: 10px;
  }

  .profile-left,
  .profile-right {
    padding: 14px 10px;
  }

  .profile-photo-wrapper {
    width: 94px;
    height: 94px;
  }

  .profile-identity h2 {
    font-size: 18px;
  }

  .radar-heading h3 {
    font-size: 18px;
  }

  .public-radar-chart {
    min-height: 245px;
  }

  .profile-card-footer {
    font-size: 7px;
  }
}

/* 5. AKSESIBILITAS */
@media (prefers-reduced-motion: reduce) {
  .athlete-page *,
  .athlete-page *::before,
  .athlete-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
/* ==========================================
   TS FIT — MOBILE PROFILE HORIZONTAL LAYOUT
   Profil kiri + Spider Chart kanan
   ========================================== */

@media (max-width: 768px) {

  /* Kartu profil utama bisa digeser horizontal */
  #profile-card {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Dua kolom tetap berdampingan */
  #profile-card .profile-content,
  #profile-card .profile-body,
  #profile-card .profile-grid {
    display: grid !important;
    grid-template-columns: 280px 440px !important;
    gap: 12px !important;
    width: max-content !important;
    max-width: none !important;
    align-items: stretch !important;
  }

  /* Kartu informasi atlet */
  #profile-card .profile-left,
  #profile-card .profile-info,
  #profile-card .profile-athlete {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
  }

  /* Kartu Spider Chart */
  #profile-card .profile-right,
  #profile-card .profile-chart,
  #profile-card .radar-section {
    width: 440px !important;
    min-width: 440px !important;
    max-width: 440px !important;
  }

  /* Grafik tidak mengecil */
  #public-radar-chart {
    width: 100% !important;
    min-width: 400px !important;
  }

  #public-radar-chart svg {
    width: 100% !important;
    height: auto !important;
  }

}
/* ============================================
   TS FIT — MOBILE SIDE BY SIDE PROFILE
   Profil kiri + Spider Chart besar kanan
   ============================================ */

@media (max-width: 768px) {

  /* Area kartu utama */
  #profile-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Pertahankan layout dua kolom */
  #profile-card .profile-grid,
  #profile-card .profile-content,
  #profile-card .profile-body {
    display: grid !important;
    grid-template-columns: 250px 520px !important;
    gap: 12px !important;
    width: 782px !important;
    min-width: 782px !important;
    max-width: none !important;
    align-items: stretch !important;
  }

  /* Kartu profil kiri */
  #profile-card .profile-left,
  #profile-card .profile-info,
  #profile-card .profile-athlete {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
  }

  /* Kartu Spider Chart kanan */
  #profile-card .profile-right,
  #profile-card .profile-chart,
  #profile-card .radar-section {
    width: 520px !important;
    min-width: 520px !important;
    max-width: 520px !important;
  }

  /* Perbesar grafik */
  #public-radar-chart {
    width: 100% !important;
    min-width: 480px !important;
    min-height: 420px !important;
  }

  #public-radar-chart svg {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
  }

}
/* ==========================================
   TS FIT — MOBILE CARD TANPA GESER
   Profil kiri, Spider Chart kanan
========================================== */

@media (max-width: 768px) {

  /* Tidak ada scroll horizontal */
  html,
  body {
    width: 100%;
    overflow-x: hidden !important;
  }

  .athlete-profile {
    width: calc(100% - 16px) !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Kartu mengikuti lebar layar HP */
  #profile-card.profile-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: 14px;
  }

  /* Profil kiri + Spider Chart kanan */
  #profile-card .profile-card-content {
    display: grid !important;
    grid-template-columns:
      minmax(0, 34fr)
      minmax(0, 66fr) !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    gap: 5px !important;
    padding: 6px !important;
    align-items: stretch !important;
  }

  /* PROFIL KIRI */
  #profile-card .profile-left {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    padding: 12px 5px !important;
    border-radius: 10px;
    overflow: hidden !important;
  }

  .profile-photo-wrapper {
    width: 68px !important;
    height: 68px !important;
    margin: 0 auto;
    border-radius: 10px;
  }

  .profile-identity {
    margin: 10px 0 !important;
  }

  .profile-identity h2 {
    font-size: 12px !important;
    line-height: 1.3;
  }

  .profile-identity p {
    font-size: 8px !important;
    overflow-wrap: anywhere;
  }

  /* Data fisik disusun ke bawah */
  #profile-card .profile-physical-data {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    width: 100%;
  }

  #profile-card .physical-item {
    grid-column: 1 / -1 !important;
    padding: 8px 6px !important;
    min-width: 0;
  }

  #profile-card .physical-item > span {
    font-size: 8px !important;
  }

  #profile-card .physical-item > strong {
    font-size: 14px !important;
  }

  #profile-card .bmi-item > strong {
    font-size: 17px !important;
  }

  #profile-card .bmi-item small {
    font-size: 8px !important;
  }

  /* SPIDER CHART KANAN */
  #profile-card .profile-right {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    padding: 12px 5px !important;
    overflow: hidden !important;
    border-radius: 10px;
  }

  .radar-heading {
    display: block !important;
  }

  .radar-heading .section-eyebrow {
    font-size: 7px !important;
    letter-spacing: 0.5px;
  }

  .radar-heading h3 {
    font-size: 15px !important;
  }

  .radar-heading p,
  .radar-test-date {
    display: none !important;
  }

  /* Legenda */
  .radar-legend {
    display: flex !important;
    gap: 7px !important;
    padding: 7px 5px !important;
    margin-top: 10px !important;
  }

  .legend-item {
    font-size: 7px !important;
  }

  /* Grafik memanfaatkan seluruh lebar kartu kanan */
  #public-radar-chart {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 230px !important;
    height: auto !important;

    padding: 0 !important;
    margin: 10px 0 !important;

    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
  }

  #public-radar-chart svg {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .radar-footer {
    gap: 5px !important;
    font-size: 7px !important;
  }

  /* Header dan footer tetap selebar layar */
  .profile-card-header,
  .profile-card-footer {
    width: 100% !important;
    min-width: 0 !important;
  }

  .profile-card-footer {
    padding: 10px 8px !important;
    font-size: 7px !important;
  }
}
/* ==========================================
   TS FIT — FINAL STICKY HEADER
   DESKTOP, TABLET, MOBILE
========================================== */

.athlete-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  background: #ffffff !important;
}
/* ==========================================
   TS FIT — HEADER STICKY FIX
========================================== */

.athlete-page {
  overflow: visible !important;
}

.athlete-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 99999 !important;
  background: #ffffff !important;
}
/* ==========================================
   TS FIT - STICKY HEADER FINAL FIX
========================================== */

html,
body {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

.athlete-page {
  overflow: visible !important;
}

.athlete-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 99999 !important;
  background: #ffffff !important;
}