@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #fff7ed;
  --panel: #ffffff;
  --panel-2: #ffedd5;
  --text: #1c1917;
  --muted: #57534e;
  --accent: #ea580c;
  --cta: #ea580c;
  --accent-2: #16a34a;
  --danger: #dc2626;
  --border: #fed7aa;
  --radius: 16px;
  --shadow: 0 4px 6px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.topbar { background: rgba(255,255,255,.8); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 1.1rem; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .9rem; }
.brand-name { font-size: 1.1rem; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .85rem; }
.nav a.active, .nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
main { padding: 24px 0 48px; min-height: calc(100vh - 120px); }
.footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: .85rem; background: var(--panel); }
h1 { font-size: 2rem; margin: 0 0 12px; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 1.1rem; margin: 0 0 8px; font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.card:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.btn { min-height: 44px; }
input, select, textarea { min-height: 44px; }
.card:hover { transform: scale(1.02); box-shadow: 0 8px 16px rgba(0,0,0,.08); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--panel); padding: 10px; border-bottom: 1px solid var(--border); flex-direction: column; }
  .nav.open { display: flex; }
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); font-size: .75rem; font-weight: 500; color: var(--text); }
.badge.ok { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.badge.warn { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.btn { background: var(--cta); color: #fff; border: none; padding: 8px 16px; border-radius: 980px; cursor: pointer; font-weight: 500; font-size: .9rem; transition: opacity .15s ease; }
.btn:hover { opacity: .88; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
input, select, textarea {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: 10px; font: inherit; width: 100%; font-size: .9rem;
}
label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.form-group { margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: .9rem; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; }
tr:hover td { background: #f5f5f7; }
.hero { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.hero h1 { margin-bottom: 8px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 980px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; color: var(--muted); font-weight: 500; font-size: .9rem; transition: all .15s ease; }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }
.list { display: grid; gap: 12px; }
.list-item { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); transition: transform .2s ease; }
.list-item:hover { transform: scale(1.01); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px; }
.kv dt { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery div { aspect-ratio: 4/3; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); font-weight: 500; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; }
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
  .brand { order: 1; }
  #globalSearch { order: 2; width: 100%; max-width: none; min-height: 44px; }
  .menu-btn { order: 3; }
  .nav { order: 4; width: 100%; display: none; }
  .nav.open { display: flex; flex-direction: column; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .tab { white-space: nowrap; }
  .filters { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .stat-value { font-size: 1.8rem; }
  .avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }
  #backToTop { bottom: 16px; left: 16px; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}
@media (max-width: 480px) {
  .kv { grid-template-columns: 1fr; }
  .calendar-cell { min-height: 56px; padding: 4px; }
  .calendar-day { font-size: .8rem; }
  .calendar-count { font-size: .65rem; }
}
.athlete-hero { background: linear-gradient(135deg, #ea580c18, #2563eb14); }
.avatar-lg { width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; flex-shrink: 0; }
.stat-card { display: flex; flex-direction: column; gap: 2px; }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.stat-note { color: var(--muted); font-size: .8rem; }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: flex; gap: 12px; align-items: flex-start; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.page-title { margin-bottom: 4px; }
.page-subtitle { color: var(--muted); margin-bottom: 20px; }
body.dark {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --cta: #60a5fa;
  --accent-2: #4ade80;
  --danger: #f87171;
  --border: #334155;
}
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-head { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; padding: 4px 0; }
.calendar-cell { min-height: 72px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--panel); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.calendar-cell.empty { background: transparent; border: none; cursor: default; }
.calendar-cell.today { border-color: var(--accent); }
.calendar-cell.selected { background: var(--panel-2); border-color: var(--accent); }
.calendar-day { font-weight: 600; font-size: .9rem; }
.calendar-count { display: inline-block; margin-top: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 600; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 8px; }