@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg: #F5F7F4;
  --surface: #FFFFFF;
  --ink: #0B2430;
  --teal: #0E7C86;
  --teal-dark: #0C6871;
  --coral: #E85A4F;
  --yellow: #F4B942;
  --muted: #7C93A8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.display { font-family: 'Big Shoulders Display', sans-serif; font-weight: 800; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }

.lane-stripe {
  display: flex; height: 6px; width: 100%; overflow: hidden; border-radius: 999px;
}
.lane-stripe span { flex: 1; }
.lane-stripe span:nth-child(1), .lane-stripe span:nth-child(5) { background: var(--teal); }
.lane-stripe span:nth-child(2), .lane-stripe span:nth-child(4) { background: var(--yellow); }
.lane-stripe span:nth-child(3) { background: var(--coral); }

header.topbar {
  background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 16px 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar-inner h1 { font-size: 26px; margin: 0; line-height: 1; }
.topbar-inner h1 span { color: var(--yellow); }
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-logo { height: 40px; width: 40px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.topbar-sub { font-size: 11px; color: rgba(255,255,255,0.5); margin: 4px 0 0; }
.topbar-user { font-size: 12px; color: rgba(255,255,255,0.7); display:flex; align-items:center; gap:10px; }
.topbar-user a.logout { color: var(--coral); font-weight: 600; }

nav.tabs {
  max-width: 1000px; margin: 0 auto; padding: 0 8px;
  display: flex; gap: 4px; overflow-x: auto;
}
nav.tabs a {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.55); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav.tabs a.active { color: #fff; border-color: var(--yellow); }

main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }

.card {
  background: var(--surface); border: 1px solid rgba(11,36,48,0.08);
  border-radius: 14px; padding: 16px;
}
.card + .card { margin-top: 12px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.field { display: block; margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted); margin-bottom: 4px;
}
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid rgba(11,36,48,0.12); border-radius: 8px;
  padding: 9px 11px; font-size: 13px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,134,0.12);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px;
  font-weight: 700; cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-danger-outline { background: transparent; border: 1px solid rgba(232,90,79,0.3); color: var(--coral); }
.btn-danger-outline:hover { background: rgba(232,90,79,0.06); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-teal { background: rgba(14,124,134,0.1); color: var(--teal); }
.badge-coral { background: rgba(232,90,79,0.1); color: var(--coral); }
.badge-yellow { background: rgba(244,185,66,0.2); color: #8a6516; }
.badge-muted { background: rgba(124,147,168,0.12); color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--bg); }
th { text-align: left; padding: 9px 12px; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
td { padding: 9px 12px; border-top: 1px solid rgba(11,36,48,0.06); }

.empty {
  text-align: center; padding: 50px 16px; border: 1px dashed rgba(11,36,48,0.15);
  border-radius: 14px; color: var(--muted); font-size: 13px;
}

.avatar {
  width: 52px; height: 52px; border-radius: 10px; background: var(--bg);
  overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.athlete-card { display: flex; gap: 12px; }
.athlete-card .meta { min-width: 0; flex: 1; }
.athlete-card .name { font-weight: 700; font-size: 13px; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.athlete-card .sub { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.athlete-card .actions { display: flex; flex-direction: column; gap: 4px; }
.athlete-card .actions a, .athlete-card .actions button { font-size: 11px; font-weight: 700; background: none; border: none; cursor: pointer; padding: 0; }
.athlete-card .actions .edit { color: var(--teal); }
.athlete-card .actions .del { color: var(--coral); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search-box { position: relative; max-width: 320px; flex: 1; }
.search-box input { padding-left: 32px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink); padding: 20px;
}
.login-box {
  background: #fff; border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 360px;
}
.login-box h1 { font-size: 28px; margin: 0 0 4px; }
.login-box p.sub { color: var(--muted); font-size: 12px; margin: 0 0 20px; }
.alert-error {
  background: rgba(232,90,79,0.1); color: var(--coral); border-radius: 8px;
  padding: 9px 12px; font-size: 12px; margin-bottom: 14px; font-weight: 600;
}
.alert-success {
  background: rgba(14,124,134,0.1); color: var(--teal); border-radius: 8px;
  padding: 9px 12px; font-size: 12px; margin-bottom: 14px; font-weight: 600;
}

.stat-row { display: flex; gap: 8px; flex-wrap: wrap; }

.eval-item { display: flex; align-items: center; gap: 12px; }
.eval-date {
  width: 42px; height: 42px; border-radius: 10px; background: rgba(244,185,66,0.15);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.eval-date .mo { font-size: 9px; font-weight: 700; text-transform: uppercase; color: #8a6516; line-height: 1; }
.eval-date .day { font-size: 16px; font-weight: 800; color: #8a6516; font-family: 'Big Shoulders Display', sans-serif; line-height: 1.1; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,36,48,0.5);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; padding: 20px;
}
.modal-head { display: flex; align-items: center; justify-content: between; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head a { color: var(--muted); }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}