:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #eef7ef;
  --text: #181a17;
  --muted: #687064;
  --line: #dfe5dc;
  --accent: #1f7a4d;
  --accent-dark: #155f39;
  --accent-soft: #dff2e5;
  --ok: #2563eb;
  --ok-soft: #dbeafe;
  --pending: #dc2626;
  --pending-soft: #fee2e2;
  --wall: #dff5f1;
  --rock: #eceafd;
  --optional: #fff6d9;
  --danger: #a32020;
  --danger-soft: #fde8e8;
  --shadow: 0 10px 28px rgba(24, 26, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.training-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.training-body a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 245, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-main,
.training-shell,
.progress-card,
.reset-panel,
.training-tabs {
  width: min(1120px, calc(100% - 28px));
  margin-inline: auto;
}

.header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 12px;
}

.header-main h1,
.section-heading h2,
.login-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.header-main h1 {
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1.06;
}

.header-main p,
.section-heading p,
.login-copy {
  margin: 6px 0 0;
  color: var(--muted);
}

.eyebrow,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ghost-button,
.login-form button,
.status-form button,
.reset-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.progress-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-card strong {
  display: block;
  font-size: 1.3rem;
}

.progress-card span,
.progress-card small {
  color: var(--muted);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: #e8ede5;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.reset-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reset-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reset-form {
  margin: 0;
}

.reset-form button {
  min-height: 38px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--pending);
  border: 1px solid #fecaca;
}

.reset-form button:hover,
.reset-form button:focus-visible {
  background: var(--pending-soft);
}

.reset-form.reset-danger button {
  background: var(--pending);
  color: #ffffff;
  border-color: var(--pending);
}

.training-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}

.training-tabs::-webkit-scrollbar {
  display: none;
}

.training-tabs a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.training-shell {
  padding: 18px 0 44px;
}

.content-section {
  scroll-margin-top: 190px;
  margin: 0 0 28px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin: 0 0 14px;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.section-note,
.session-footer {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid #cfe5d5;
  border-radius: 8px;
}

.section-heading .section-note {
  grid-column: 1 / -1;
  margin: 0;
}

.session-footer {
  margin: 12px 0 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.week-grid,
.exercise-list,
.guide-list {
  display: grid;
  gap: 12px;
}

.week-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.exercise-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.week-card,
.exercise-card,
.guide-card,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.week-card,
.exercise-card,
.guide-card {
  padding: 14px;
}

[data-status-value="ok"] {
  border-color: #93c5fd;
}

[data-status-value="pendente"] {
  border-color: #fecaca;
}

.card-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-topline h3,
.guide-card h3 {
  margin: 2px 0 0;
  font-size: 1.02rem;
  line-height: 1.2;
}

.card-topline > div {
  min-width: 0;
}

.week-card .card-topline {
  grid-template-columns: 1fr;
}

.week-card .status-form {
  max-width: none;
  justify-self: stretch;
}

.days-list {
  display: grid;
  gap: 8px;
}

.day-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.day-row span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.day-row a,
.day-row strong {
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.day-academia,
.legend-academia {
  background: var(--accent-soft);
}

.day-parede,
.legend-parede {
  background: var(--wall);
}

.day-rocha,
.legend-rocha {
  background: var(--rock);
}

.day-opcional,
.legend-opcional {
  background: var(--optional);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.detail-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f6f8f4;
}

.detail-grid dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.status-form {
  width: 100%;
  max-width: 260px;
  justify-self: end;
  display: grid;
  gap: 6px;
}

.status-label,
.login-form label,
.search-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.status-control select,
.login-form input,
.search-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.status-control select,
.login-form input,
.search-box input {
  padding: 0 12px;
}

.status-control button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #263238;
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

[data-status-value="ok"] .status-control select {
  border-color: #93c5fd;
  background: var(--ok-soft);
  color: var(--ok);
}

[data-status-value="pendente"] .status-control select {
  border-color: #fecaca;
  background: var(--pending-soft);
  color: var(--pending);
}

.status-control select:disabled,
.status-control button:disabled {
  cursor: wait;
  opacity: 0.74;
}

.search-box {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
}

.guide-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.rules-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.rules-list li {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.legend-item {
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.alert {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
}

.alert-error {
  border-color: #f2b8b8;
  background: var(--danger-soft);
  color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  width: min(360px, calc(100% - 28px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: var(--danger);
}

.training-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-shell {
  width: min(440px, 100%);
}

.login-panel {
  padding: 24px;
}

.login-panel h1 {
  margin-top: 4px;
  font-size: 2rem;
  line-height: 1.06;
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .header-main {
    align-items: stretch;
    flex-direction: column;
  }

  .card-topline {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading .reset-form {
    justify-self: start;
  }

  .status-form {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .ghost-button {
    width: 100%;
  }

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

  .week-grid,
  .exercise-list,
  .guide-list {
    grid-template-columns: 1fr;
  }

  .content-section {
    scroll-margin-top: 250px;
  }
}

@media (max-width: 560px) {
  .header-main,
  .training-shell,
  .progress-card,
  .reset-panel,
  .training-tabs {
    width: min(100% - 20px, 1120px);
  }

  .reset-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .reset-form button {
    width: 100%;
  }

  .app-header {
    position: static;
  }

  .content-section {
    scroll-margin-top: 18px;
  }

  .detail-grid,
  .day-row {
    grid-template-columns: 1fr;
  }

  .status-control {
    grid-template-columns: 1fr;
  }

  .status-control select,
  .status-control button {
    min-height: 46px;
  }
}
