*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f2f2f2;
  color: #1a0507;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────────────────── */

.page-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */

.site-nav {
  background: #230a0d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.site-nav-header {
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  margin-bottom: 1.75rem;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.nav-toggle-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.nav-toggle-close { display: none; }

.site-nav.nav-open .nav-toggle-open  { display: none; }
.site-nav.nav-open .nav-toggle-close { display: block; }

.brand-logo {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.5rem 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.4rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.12s, color 0.12s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-link.active {
  background: rgba(193, 39, 45, 0.75);
  color: #fff;
  font-weight: 600;
}

.nav-group {
  display: grid;
  gap: 0.18rem;
}

.nav-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
}

.nav-group-row .nav-link {
  min-width: 0;
}

.nav-subtoggle {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}

.nav-subtoggle:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-subtoggle-icon {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.12s ease;
}

.nav-group.open .nav-subtoggle-icon {
  transform: rotate(225deg) translate(-1px, -1px);
}

.nav-submenu {
  display: none;
  padding: 0.15rem 0 0.25rem 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 0.8rem;
}

.nav-group.open .nav-submenu {
  display: grid;
  gap: 0.5rem;
}

.nav-submenu-section {
  display: grid;
  gap: 0.15rem;
}

.nav-submenu-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.1rem 0.45rem;
}

.nav-sublink {
  display: block;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.4;
}

.nav-sublink:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-sublink.active {
  background: rgba(193, 39, 45, 0.26);
  color: #fff;
  font-weight: 600;
}

.nav-submenu-status {
  padding: 0.35rem 0.45rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
}

/* ─── Welcome hero ───────────────────────────────────────────── */

.welcome-hero {
  /* break out of content-shell padding to fill full width */
  margin: -2.5rem -3rem 2.5rem;
  height: 300px;
  background-color: #1a0507;
  background-image: url('bikebackground.jpg');
  background-size: cover;
  background-position: center 40%;
  position: relative;
  overflow: hidden;
}

.welcome-hero-overlay {

}

.welcome-hero-title {
  position: absolute;
  top: 1.75rem;
  left: 2rem;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.welcome-hero-title strong {
  font-weight: 700;
}

/* ─── Content ────────────────────────────────────────────────── */

.content-shell {
  padding: 2.5rem 3rem;
  /* transparent so body gradient shows through */
  background: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-link {
  color: rgba(0, 0, 0, 0.56);
  text-decoration: none;
  font-size: 0.88rem;
}

.footer-link:hover {
  color: #b82028;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-icon-link {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #230a0d;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}

.footer-icon-link:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 32, 40, 0.3);
  background: #fff;
}

.footer-icon-link svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-icon-link svg path {
  fill: currentColor;
  stroke: none;
}

.footer-icon-fill {
  fill: currentColor;
  stroke: none;
}

.footer-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.page-panel {
  width: 100%;
  max-width: none;
  flex: 1 0 auto;
}

.page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a0507;
  line-height: 1.25;
}

.page-copy {
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.95rem;
  line-height: 1.8;
}

.page-copy p { margin-bottom: 0.9rem; }
.page-copy p:last-child { margin-bottom: 0; }

.page-copy a {
  color: #b82028;
  text-decoration: none;
}
.page-copy a:hover { text-decoration: underline; }

/* ─── Section label ──────────────────────────────────────────── */

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.35);
  margin: 1.75rem 0 0.75rem;
}

/* ─── News cards ─────────────────────────────────────────────── */

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
  margin-top: 1.5rem;
}

.news-item {
  min-width: 0;
}

.news-separator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.news-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.news-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.news-card-thumb {
  flex: 0 0 140px;
  width: 140px;
  align-self: stretch;
  overflow: hidden;
  border-radius: 0;
}

.news-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card-body {
  flex: 1 1 0;
  min-width: 0;
  padding: 1.1rem 1.25rem;
}

.news-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.news-date {
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.4);
  font-variant-numeric: tabular-nums;
}

.news-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #b82028;
  background: rgba(184, 32, 40, 0.1);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a0507;
  margin-bottom: 0.55rem;
}

.news-card p {
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.65;
}

@media (max-width: 1100px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Athlete overview cards ─────────────────────────────────── */

.athlete-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.athlete-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  padding: 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  display: block;
}

.athlete-card:hover {
  background: #fff;
  border-color: rgba(184, 32, 40, 0.35);
  box-shadow: 0 2px 12px rgba(184, 32, 40, 0.08);
}

.athlete-initial {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(184, 32, 40, 0.12);
  color: #b82028;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.athlete-card-name {
  font-weight: 600;
  color: #1a0507;
  font-size: 0.9rem;
}

.athlete-card-role {
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 0.2rem;
}

/* ─── Athlete bio page ───────────────────────────────────────── */

.athlete-bio {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 3rem;
  align-items: start;
}

.athlete-bio-info {
  min-width: 0;
}

.athlete-bio-photo {
  width: 220px;
  flex-shrink: 0;
}

.athlete-bio-photo img {
  width: 100%;
  border-radius: 0.5rem;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.athlete-bio-photo-placeholder {
  width: 220px;
  aspect-ratio: 3 / 4;
  background: rgba(0, 0, 0, 0.05);
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.3);
  font-size: 0.8rem;
}

/* ─── Info table ─────────────────────────────────────────────── */

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.info-table th,
.info-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.info-table tr:first-child th,
.info-table tr:first-child td {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a0507;
  padding-top: 0;
}

.info-table th {
  color: rgba(0, 0, 0, 0.5);
  font-weight: 500;
  width: 38%;
}

.info-table td {
  color: #1a0507;
}

/* ─── Buttons ────────────────────────────────────────────────── */

.btn,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  min-height: 2.75rem;
  border-radius: 0.4rem;
  border: none;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s, color 0.12s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary,
.primary-button {
  background: #b82028;
  color: #fff;
}

.btn-primary:hover,
.primary-button:hover {
  background: #9e1a21;
}

.btn-ghost,
.secondary-button {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.btn-ghost:hover,
.secondary-button:hover {
  background: rgba(0, 0, 0, 0.1);
}

.delete-user-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(184, 32, 40, 0.25);
  background: rgba(184, 32, 40, 0.07);
  color: #b82028;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}

.delete-user-button:hover:not(:disabled) {
  background: rgba(184, 32, 40, 0.15);
}

.delete-user-button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ─── Forms ──────────────────────────────────────────────────── */

label {
  display: block;
  font-size: 0.82rem;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 0.3rem;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.4rem;
  color: #1a0507;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 0.9rem;
  outline: none;
  transition: border-color 0.12s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(184, 32, 40, 0.5);
}

input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

textarea {
  resize: vertical;
  min-height: 130px;
}

select option {
  background: #fff;
  color: #1a0507;
}

/* ─── Login page ─────────────────────────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  padding: 2rem;
}

.login-box h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a0507;
  margin-bottom: 1.5rem;
}

.login-box small {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.4);
}

/* ─── Modal ──────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: start center;
  padding: 1.5rem 1rem;
  z-index: 100;
  overflow-y: auto;
}

.modal-content {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.75rem;
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  margin: auto;
}

.modal-content h2 {
  color: #1a0507;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

/* ─── User management ────────────────────────────────────────── */

.user-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.user-status-bar span {
  color: rgba(0, 0, 0, 0.6);
}

.user-status-bar strong {
  color: #1a0507;
}

.user-management-box {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.user-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin: 0 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.875rem;
}

.user-name { color: #1a0507; }
.user-role { color: rgba(0, 0, 0, 0.5); }

.info-text {
  padding: 1rem;
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
}

/* ─── Inline page editor ─────────────────────────────────────── */

/* ─── Utility ────────────────────────────────────────────────── */

.hidden { display: none !important; }
.admin-only.hidden { display: none !important; }

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 860px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .site-nav {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 1rem;
    display: block;
    overflow: visible;
  }

  .site-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .brand {
    margin-bottom: 0;
    margin-right: 0;
    padding-left: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  nav {
    display: none;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.9rem;
  }

  .site-nav.nav-open nav {
    display: flex;
  }

  .site-nav.nav-open .nav-toggle {
    background: rgba(193, 39, 45, 0.75);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .nav-divider { display: none; }

  .nav-link {
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
  }

  .nav-subtoggle {
    width: 2.2rem;
    height: 2.2rem;
  }

  .nav-submenu {
    margin-left: 0;
    padding: 0.1rem 0.4rem 0.15rem 0.85rem;
  }

  .nav-sublink {
    padding: 0.5rem 0.6rem;
    font-size: 0.86rem;
  }

  .athlete-bio {
    grid-template-columns: 1fr;
  }

  .athlete-bio-photo,
  .athlete-bio-photo-placeholder {
    width: 100%;
    max-width: 260px;
  }
}

@media (max-width: 600px) {
  .content-shell {
    padding: 1.5rem 1.25rem;
  }

  .welcome-hero {
    margin: -1.5rem -1.25rem 1.75rem;
    height: 220px;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  .athlete-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

}
