:root {
  --history-navy: #171151;
  --history-blue: #3677ff;
  --history-red: #ed3344;
  --history-orange: #ff7443;
  --history-purple: #5b34c7;
  --history-text: #191637;
  --history-muted: #69718c;
  --history-border: rgba(38, 26, 122, 0.14);
}

body.history-view {
  min-height: 100vh;
  color: var(--history-text);
  background:
    radial-gradient(
      circle at 94% 8%,
      rgba(54, 119, 255, 0.14),
      transparent 30rem
    ),
    radial-gradient(
      circle at 5% 95%,
      rgba(237, 51, 68, 0.08),
      transparent 28rem
    ),
    #f7f8ff;
}

.history-page {
  width: min(calc(100% - 40px), 1240px);
  margin-inline: auto;
  padding: 54px 0 80px;
}

.history-hero {
  max-width: 760px;
  margin-bottom: 32px;
}

.history-kicker {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--history-navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.history-kicker span {
  width: 32px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--history-red),
    var(--history-orange)
  );
}

.history-hero h1,
.history-dashboard-heading h2,
.history-auth-panel h2 {
  margin: 0;
  color: var(--history-navy);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.history-hero h1 {
  font-size: clamp(3rem, 7vw, 5.7rem);
}

.history-hero > p:last-child {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--history-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.history-message,
.history-auth-panel,
.history-dashboard {
  border: 1px solid var(--history-border);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(30, 24, 91, 0.1);
}

.history-message {
  padding: 28px;
  color: var(--history-muted);
  font-weight: 700;
  text-align: center;
}

.history-auth-panel {
  max-width: 700px;
  padding: clamp(28px, 5vw, 54px);
  display: grid;
  justify-items: start;
  gap: 24px;
}

.history-auth-panel[hidden],
.history-dashboard[hidden],
.history-message[hidden],
.history-whatsapp-group[hidden],
.history-empty-state[hidden] {
  display: none;
}

.history-auth-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--history-blue), #5b43d8);
  box-shadow: 0 16px 34px rgba(54, 119, 255, 0.24);
}

.history-auth-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.history-auth-panel p,
.history-dashboard-heading p {
  margin: 0 0 8px;
  color: var(--history-red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history-auth-panel h2,
.history-dashboard-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.history-auth-panel span {
  display: block;
  max-width: 560px;
  margin-top: 14px;
  color: var(--history-muted);
  line-height: 1.7;
}

.history-primary-button,
.history-secondary-button,
.history-logout-button,
.history-refresh-button,
.history-detail-link,
.history-edit-link {
  min-height: 46px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.history-primary-button,
.history-detail-link,
.history-edit-link {
  border: 0;
  color: #ffffff;
  background: linear-gradient(
    105deg,
    var(--history-red),
    var(--history-orange)
  );
}

.history-secondary-button,
.history-logout-button,
.history-refresh-button {
  border: 1px solid var(--history-border);
  color: var(--history-navy);
  background: #ffffff;
}

.history-primary-button:disabled,
.history-logout-button:disabled,
.history-refresh-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.history-inline-message {
  margin: 0;
  color: var(--history-muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.55;
}

.history-inline-message.is-error {
  color: #ad1830;
}

.history-dashboard {
  padding: clamp(22px, 4vw, 44px);
}

.history-account-bar,
.history-dashboard-heading,
.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.history-account-bar {
  margin-bottom: 38px;
  padding: 16px 18px;
  border: 1px solid var(--history-border);
  border-radius: 17px;
  background: #f7f8ff;
}

.history-account-bar span,
.history-total-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--history-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-account-bar strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.history-account-actions {
  display: flex;
  gap: 9px;
}

.history-dashboard-heading {
  align-items: flex-end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--history-border);
}

.history-total-card {
  min-width: 150px;
  padding: 14px 17px;
  border: 1px solid var(--history-border);
  border-radius: 16px;
  background: #f7f8ff;
}

.history-total-card strong {
  color: var(--history-navy);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 2rem;
  font-weight: 900;
}

.history-toolbar {
  min-height: 74px;
  margin-bottom: 18px;
}

.history-whatsapp-group {
  margin-bottom: 22px;
  padding: 22px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  border: 1px solid rgba(18, 140, 75, 0.22);
  border-left: 5px solid #128c4b;
  border-radius: 18px;

  background: linear-gradient(145deg, #f3fff8, #e9fbf1);
}

.history-whatsapp-group span {
  color: #a4262f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-whatsapp-group h3 {
  margin: 7px 0 7px;
  color: #105b32;
  font-size: 1.08rem;
}

.history-whatsapp-group p {
  margin: 0;
  color: #4d6c5a;
  font-size: 0.86rem;
  line-height: 1.6;
}

.history-whatsapp-button {
  min-height: 48px;
  padding: 12px 19px;

  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  border-radius: 13px;

  color: #ffffff;
  background: #128c4b;

  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.history-whatsapp-button:focus-visible {
  outline: 3px solid #25d366;
  outline-offset: 4px;
}

.history-registration-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.history-registration-card {
  min-width: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--history-border);
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #f7f8ff);
  box-shadow: 0 12px 28px rgba(30, 24, 91, 0.06);
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-card-sport {
  color: var(--history-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-card-status {
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(181, 126, 0, 0.2);
  border-radius: 999px;
  color: #7b5600;
  background: #fff7d6;
  font-size: 0.68rem;
  font-weight: 800;
}

.history-card-status[data-status="ACCEPTED"] {
  border-color: rgba(27, 154, 105, 0.18);
  color: #08734d;
  background: #e9fff5;
}

.history-card-status[data-status="REJECTED"] {
  border-color: rgba(216, 45, 62, 0.2);
  color: #a4162a;
  background: #fff0f2;
}

.history-card-status[data-status="CANCELLED"],
.history-card-status[data-status="UNKNOWN"] {
  border-color: rgba(91, 98, 122, 0.2);
  color: #4e556d;
  background: #f1f3f8;
}

.history-registration-card h3 {
  margin: 20px 0;
  color: var(--history-navy);
  font-size: 1.2rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.history-card-meta {
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.history-card-meta div {
  min-width: 0;
  padding: 12px;
  border-radius: 13px;
  background: rgba(54, 119, 255, 0.055);
}

.history-card-meta dt {
  margin-bottom: 5px;
  color: var(--history-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.history-card-meta dd {
  margin: 0;
  color: var(--history-text);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.history-detail-link {
  width: 100%;
}

.history-card-actions {
  width: 100%;
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-card-actions > :only-child {
  grid-column: 1 / -1;
}

.history-edit-link {
  border: 0;
  color: #ffffff;
  background: linear-gradient(
    105deg,
    var(--history-blue),
    var(--history-purple)
  );
}

.history-review-notes {
  margin: 0 0 18px;
  padding: 15px 16px;
  border: 1px solid rgba(181, 126, 0, 0.22);
  border-left: 4px solid #d39a00;
  border-radius: 14px;
  background: #fffaf0;
}

.history-review-notes strong {
  display: block;
  margin-bottom: 7px;
  color: #6b4a00;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-review-notes p {
  margin: 0;
  color: #4f4329;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.history-detail-link[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.history-review-notes .history-notes-hint {
  margin-top: 12px;
  font-weight: 500;
}

.history-material-notes {
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.history-material-notes summary {
  padding: 10px 0;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.5;
}

.history-material-notes summary:focus-visible {
  outline: 3px solid #bd1830;
  outline-offset: 3px;
  border-radius: 4px;
}

.history-material-notes[open] summary {
  margin-bottom: 6px;
}

.history-empty-state {
  padding: 52px 24px;
  border: 1px dashed rgba(38, 26, 122, 0.2);
  border-radius: 20px;
  text-align: center;
}

.history-empty-state > div {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--history-blue);
  background: #edf4ff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 900;
}

.history-empty-state h3 {
  margin: 0;
  color: var(--history-navy);
  font-size: 1.3rem;
}

.history-empty-state p {
  margin: 10px 0 22px;
  color: var(--history-muted);
}

@media (hover: hover) and (pointer: fine) {
  .history-primary-button:hover,
  .history-secondary-button:hover,
  .history-logout-button:hover,
  .history-refresh-button:hover,
  .history-detail-link:hover,
  .history-edit-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(30, 24, 91, 0.12);
  }

  .history-whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(18, 140, 75, 0.2);
  }
}

@media (max-width: 820px) {
  .history-registration-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .history-page {
    width: min(calc(100% - 24px), 1240px);
    padding: 32px 0 54px;
  }

  .history-account-bar,
  .history-dashboard-heading,
  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .history-account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .history-total-card {
    min-width: 0;
  }

  .history-refresh-button {
    width: 100%;
  }

  .history-whatsapp-group {
    align-items: stretch;
    flex-direction: column;
    gap: 17px;
  }

  .history-whatsapp-button {
    width: 100%;
  }

  .history-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-card-meta {
    grid-template-columns: 1fr;
  }

  .history-card-actions {
    grid-template-columns: 1fr;
  }
}
/* PERBAIKAN HEADER HALAMAN RIWAYAT */

body.history-view .registration-header {
  min-height: 86px;
  padding: 14px clamp(20px, 5vw, 74px);
  border-bottom: 1px solid rgba(38, 26, 122, 0.12);
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 12px 38px rgba(23, 16, 77, 0.06);
  backdrop-filter: blur(18px);
}

body.history-view .registration-back {
  min-height: 46px;
  padding: 10px 16px;
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(38, 26, 122, 0.18);
  border-radius: 14px;
  color: #171151;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 16, 77, 0.07);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

body.history-view .registration-back svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

body.history-view .registration-brand {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

body.history-view .registration-logo-frame {
  position: relative;
  width: 118px;
  height: 46px;
  display: block;
  flex: 0 0 118px;
  overflow: hidden;
}

body.history-view .registration-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 196px;
  height: 196px;
  max-width: none;
  display: block;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@media (max-width: 640px) {
  body.history-view .registration-header {
    min-height: 70px;
    padding: 10px 15px;
    gap: 8px;
  }

  body.history-view .registration-back {
    min-height: 42px;
    padding: 9px 11px;
    gap: 7px;
    font-size: 0.73rem;
  }

  body.history-view .registration-back svg {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  body.history-view .registration-logo-frame {
    width: 92px;
    height: 36px;
    flex-basis: 92px;
  }

  body.history-view .registration-logo {
    width: 154px;
    height: 154px;
  }
}
