/* ════════════════════════════════════════════════
   GYMNASTICS PRO — MAIN STYLESHEET
   Navy Blue (#272B6B) + Crimson Red (#E8001E)
════════════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --red:         #E8001E;
  --red-dark:    #B30017;
  --red-glow:    rgba(232, 0, 30, 0.20);
  --red-soft:    rgba(232, 0, 30, 0.09);
  --navy:        #272B6B;
  --navy-dark:   #1A1E50;
  --navy-soft:   rgba(39, 43, 107, 0.15);
  --bg:          #0D0D12;
  --bg2:         #13131B;
  --bg3:         #1B1B26;
  --bg4:         #222230;
  --border:      rgba(255, 255, 255, 0.07);
  --border-red:  rgba(232, 0, 30, 0.25);
  --border-navy: rgba(39, 43, 107, 0.45);
  --text:        #F0EFF6;
  --text2:       #B0AFBA;
  --muted:       #7A7A8A;
  --gold:        #FFB800;
  --silver:      #C8C8D4;
  --bronze:      #CD8B4A;
  --green:       #00C853;
  --sidebar-w:   248px;
  --radius:      12px;
  --radius-sm:   8px;
  --font-d:      'Bebas Neue', sans-serif;
  --font-b:      'DM Sans', sans-serif;
  --font-m:      'JetBrains Mono', monospace;
  --transition:  all 0.2s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font-b); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-b); }
input, select, textarea { font-family: var(--font-b); }
img { display: block; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border-red); border-radius: 2px; }

/* ════════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

/* Background */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}
.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: pulse 8s ease-in-out infinite;
}
.c1 {
  width: 500px; height: 500px;
  background: rgba(39, 43, 107, 0.4);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.c2 {
  width: 400px; height: 400px;
  background: rgba(232, 0, 30, 0.15);
  bottom: -100px; right: -80px;
  animation-delay: 3s;
}
.c3 {
  width: 250px; height: 250px;
  background: rgba(39, 43, 107, 0.25);
  top: 50%; right: 20%;
  animation-delay: 6s;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%       { transform: scale(1.1); opacity: 1; }
}

/* Login container */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(39, 43, 107, 0.6), 0 0 0 1px rgba(255,255,255,0.08);
}
.brand-name {
  font-family: var(--font-d);
  font-size: 1.9rem;
  letter-spacing: 3px;
  color: var(--text);
}
.brand-sub {
  font-family: var(--font-m);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 3px;
  text-transform: uppercase;
}

/* Auth Card */
.auth-card {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255,255,255,0.04);
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 15px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: var(--transition);
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  color: var(--red);
  box-shadow: inset 0 -2px 0 var(--red);
  background: var(--bg2);
}

/* Panels */
.auth-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  animation: fadeIn 0.25s ease;
}
.auth-panel.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2px;
}

/* Stats strip */
.stats-strip {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px 16px;
}
.strip-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 18px;
}
.strip-num {
  font-family: var(--font-d);
  font-size: 1.35rem;
  color: var(--red);
  line-height: 1;
}
.strip-lbl {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
}
.strip-dot {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ── FIELDS ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.4px;
}
.field input,
.field select,
.field textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.field select { cursor: pointer; }
.field textarea { resize: vertical; }
.disabled-field { opacity: 0.5; cursor: not-allowed !important; }
.field-note { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.hint-text { font-size: 0.72rem; color: var(--muted); font-weight: 400; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.eye-btn:hover { opacity: 1; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.forgot-row { display: flex; justify-content: flex-end; }
.forgot-link {
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}
.forgot-link:hover { color: var(--red); }
.red-link { color: var(--red); font-weight: 600; }

/* OTP */
.otp-timer {
  font-family: var(--font-m);
  font-size: 0.75rem;
  color: var(--red);
  margin-left: 4px;
}
.otp-input {
  font-family: var(--font-m) !important;
  font-size: 1.3rem !important;
  letter-spacing: 8px;
  text-align: center;
}

.hidden { display: none !important; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.switch-note { font-size: 0.78rem; color: var(--muted); text-align: center; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--red-glow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--red-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn-outline:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.btn-ghost {
  background: none;
  color: var(--muted);
  border: none;
  padding: 11px 16px;
  font-size: 0.875rem;
  transition: color 0.2s;
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { color: var(--text); background: var(--bg3); }

.btn-danger {
  background: none;
  color: var(--red);
  border: 1px solid var(--border-red);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.w-full { width: 100%; }
.btn-arrow { font-size: 1rem; }

/* ════════════════════════════════════════════════
   APP LAYOUT (SIDEBAR + CONTENT)
════════════════════════════════════════════════ */
.app-page { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  transition: transform 0.3s ease;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--border);
  min-height: 68px;
}
.sb-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.sb-name {
  font-family: var(--font-d);
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: var(--text);
  display: block;
}
.admin-tag {
  font-family: var(--font-m);
  font-size: 0.55rem;
  background: var(--red);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1.5px;
  display: block;
  margin-top: 2px;
}
.sb-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: var(--transition);
  border: 1px solid transparent;
}
.sb-item::before { content: attr(data-icon); font-size: 0.95rem; }
.sb-item:hover { color: var(--text); background: var(--bg3); }
.sb-item.active {
  color: var(--text);
  background: var(--red-soft);
  border-color: var(--border-red);
}
.admin-sb .sb-brand { background: rgba(232,0,30,0.06); }
.admin-sb .sb-item.active { background: var(--red-soft); border-color: var(--border-red); }

.sb-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
}
.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red-soft);
  border: 2px solid var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: 1rem;
  color: var(--red);
  overflow: hidden;
  flex-shrink: 0;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user-disc {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-m);
}
.sb-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.8rem;
  transition: var(--transition);
}
.sb-logout:hover { border-color: var(--red); color: var(--red); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 55;
  backdrop-filter: blur(2px);
}

/* ── PAGE WRAP ── */
.page-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  height: 66px;
  background: rgba(13,13,18,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.top-bar-title h1 {
  font-family: var(--font-d);
  font-size: 1.65rem;
  letter-spacing: 1px;
  line-height: 1;
}
.top-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.disc-chip {
  font-family: var(--font-m);
  font-size: 0.68rem;
  padding: 4px 11px;
  border-radius: 20px;
  background: var(--navy-soft);
  border: 1px solid var(--border-navy);
  color: var(--silver);
  letter-spacing: 1.5px;
}
.admin-chip {
  font-family: var(--font-m);
  font-size: 0.62rem;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  letter-spacing: 2px;
  font-weight: 700;
}
.hdr-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red-soft);
  border: 2px solid var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: 0.95rem;
  color: var(--red);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}
.hdr-avatar:hover { border-color: var(--red); }
.hdr-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── MAIN AREA ── */
.main-area {
  flex: 1;
  padding: 28px;
  max-width: 1200px;
  width: 100%;
}

/* ── KPI CARDS ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.kpi-card:hover { border-color: var(--border-red); }
.kpi-label {
  font-family: var(--font-m);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
.kpi-value {
  font-family: var(--font-d);
  font-size: 2.1rem;
  color: var(--red);
  line-height: 1.1;
  margin-top: 6px;
}
.kpi-sub { font-size: 0.73rem; color: var(--muted); margin-top: 4px; }

/* Loading shimmer */
.loading-shimmer {
  min-height: 90px;
  background: linear-gradient(90deg, var(--bg2) 0%, var(--bg3) 50%, var(--bg2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── CONTENT GRID ── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.wide-panel { grid-column: 1 / 2; }
.right-col { display: flex; flex-direction: column; gap: 20px; }

/* ── PANEL ── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-title {
  font-family: var(--font-m);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
}
.panel-link {
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}
.panel-link:hover { color: var(--red); }

/* ── EMPTY STATES ── */
.empty-state-sm {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 0;
}
.full-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 24px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-icon-lg { font-size: 3rem; margin-bottom: 12px; }
.empty-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.empty-sub { color: var(--muted); font-size: 0.875rem; max-width: 380px; margin: 0 auto; }

/* ── RECENT COMPETITION ITEMS ── */
.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}
.recent-item:last-child { border-bottom: none; padding-bottom: 0; }
.ri-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ri-info { flex: 1; min-width: 0; }
.ri-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.ri-score {
  font-family: var(--font-m);
  font-size: 1.05rem;
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── PERSONAL BESTS ── */
.pb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pb-item:last-child { border-bottom: none; }
.pb-app { font-size: 0.82rem; color: var(--text2); }
.pb-score { font-family: var(--font-m); color: var(--red); font-weight: 700; font-size: 0.9rem; }

/* ── MEDALS ── */
.medal-row { display: flex; gap: 10px; }
.medal-box {
  flex: 1;
  background: var(--bg3);
  border-radius: 10px;
  padding: 16px 8px;
  text-align: center;
  border: 1px solid var(--border);
}
.medal-icon { font-size: 1.5rem; }
.medal-count { font-family: var(--font-d); font-size: 2rem; line-height: 1; margin: 4px 0; }
.gold-box .medal-count   { color: var(--gold); }
.silver-box .medal-count { color: var(--silver); }
.bronze-box .medal-count { color: var(--bronze); }
.medal-lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-family: var(--font-m); }

/* ── APPARATUS TABS ── */
.apparatus-scroll { overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; }
.apparatus-tabs { display: flex; gap: 8px; white-space: nowrap; }
.app-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-m);
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.app-tab:hover { border-color: var(--border-red); color: var(--text); }
.app-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px var(--red-glow);
}

/* ── DATA TABLE ── */
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 600px;
}
.data-table th {
  font-family: var(--font-m);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: var(--bg3);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px !important;
}
.td-score { font-family: var(--font-m); color: var(--red); font-weight: 700; font-size: 1rem; }
.td-name { font-weight: 600; }
.td-sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.place-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-family: var(--font-m);
  font-size: 0.75rem;
  font-weight: 700;
}
.place-1 { background: rgba(255,184,0,0.15); color: var(--gold); }
.place-2 { background: rgba(200,200,212,0.12); color: var(--silver); }
.place-3 { background: rgba(205,139,74,0.13); color: var(--bronze); }
.place-n { background: var(--bg3); color: var(--muted); }

.app-pill {
  font-family: var(--font-m);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--red-soft);
  border: 1px solid var(--border-red);
  color: var(--red);
  display: inline-block;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  padding: 10px 14px 10px 34px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--red); }
.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  padding: 10px 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: var(--font-b);
}
.filter-select:focus { border-color: var(--red); }
.mini-search {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font-b);
  width: 180px;
}
.mini-search:focus { border-color: var(--red); }
.result-count { font-size: 0.8rem; color: var(--muted); margin-bottom: 14px; }

/* ── COMPETITION CARDS ── */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.comp-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.comp-card:hover {
  border-color: var(--border-red);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}
.comp-card-top {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.cc-name { font-weight: 700; font-size: 0.92rem; }
.cc-date { font-size: 0.73rem; color: var(--muted); margin-top: 3px; }
.cc-medal { font-size: 1.3rem; }
.comp-card-scores {
  padding: 14px 18px;
  display: flex;
  gap: 18px;
}
.cs-item { display: flex; flex-direction: column; }
.cs-label { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--font-m); }
.cs-val { font-family: var(--font-d); font-size: 1.35rem; color: var(--red); }
.comp-card-foot {
  padding: 10px 18px;
  background: var(--bg3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  color: var(--muted);
}

/* ── PROFILE PAGE ── */
.profile-layout { max-width: 680px; }
.profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-cover {
  height: 110px;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--red-dark) 100%);
  position: relative;
  overflow: hidden;
}
.cover-pattern {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 12px
  );
}
.profile-identity {
  padding: 0 24px 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: -36px;
  border-bottom: 1px solid var(--border);
}
.avatar-upload-zone { position: relative; cursor: pointer; }
.profile-av {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--bg2);
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: 1.6rem;
  color: var(--red);
  overflow: hidden;
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; }
.av-edit-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.avatar-upload-zone:hover .av-edit-overlay { opacity: 1; }
.profile-name-area { padding-bottom: 4px; }
.profile-fullname { font-family: var(--font-d); font-size: 1.4rem; letter-spacing: 1px; margin-top: 8px; }
.profile-discline { font-size: 0.78rem; color: var(--muted); font-family: var(--font-m); margin-top: 2px; }
.profile-form {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-group-title {
  font-family: var(--font-m);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

/* ── SCORES SUMMARY BAR ── */
.scores-summary {
  display: flex;
  gap: 24px;
  padding: 14px 24px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ss-item { display: flex; flex-direction: column; }
.ss-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); font-family: var(--font-m); }
.ss-val { font-family: var(--font-d); font-size: 1.45rem; color: var(--red); }

/* ── ADMIN ── */
.admin-tab { display: none; animation: fadeIn 0.25s ease; }
.admin-tab.active { display: block; }

.upload-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.upload-step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex: 1;
  min-width: 180px;
}
.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.step-text { display: flex; flex-direction: column; }
.step-text strong { font-size: 0.85rem; }
.step-text span { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.step-arrow { color: var(--muted); font-size: 1.2rem; }

.drop-zone {
  border: 2px dashed var(--border-red);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--red-soft);
  transition: var(--transition);
  margin-bottom: 20px;
}
.drop-zone:hover { background: rgba(232,0,30,0.13); border-color: var(--red); }
.drop-zone.drag-over { background: rgba(232,0,30,0.18); border-color: var(--red); }
.drop-icon { font-size: 2.2rem; margin-bottom: 8px; color: var(--red); }
.drop-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.drop-sub { font-size: 0.8rem; color: var(--muted); }

.upload-preview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.upload-errors {
  background: rgba(232,0,30,0.08);
  border: 1px solid var(--border-red);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 14px;
}
.err-row { font-family: var(--font-m); font-size: 0.76rem; color: var(--red); margin: 3px 0; }
.upload-result {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.result-ok { color: var(--green); font-weight: 700; margin-bottom: 10px; font-size: 1rem; }
.result-item { font-size: 0.84rem; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--border); }
.result-item:last-child { border-bottom: none; }

/* Template columns */
.tmpl-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.tmpl-col-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tmpl-col-item.required { border-color: var(--border-red); }
.col-code { font-family: var(--font-m); font-size: 0.78rem; color: var(--red); font-weight: 700; }
.col-req { font-size: 0.62rem; color: var(--red); background: var(--red-soft); border-radius: 3px; padding: 1px 5px; display: inline-block; width: fit-content; }
.col-desc { font-size: 0.76rem; color: var(--muted); }

/* Apparatus guide */
.apparatus-guide {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.ag-title {
  font-family: var(--font-m);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 12px;
}
.ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.ag-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.ag-disc { font-weight: 700; font-size: 0.82rem; margin-bottom: 6px; }
.ag-codes { display: flex; flex-wrap: wrap; gap: 4px; }
.ag-code {
  font-family: var(--font-m);
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--red-soft);
  border: 1px solid var(--border-red);
  color: var(--red);
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--bg3);
  border: 1px solid var(--border-red);
  color: var(--text);
  padding: 11px 22px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .wide-panel { grid-column: 1; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-248px); width: 248px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .page-wrap { margin-left: 0; }
  .hamburger { display: flex; }
  .main-area { padding: 18px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .tmpl-cols { grid-template-columns: 1fr; }
  .upload-steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
}

@media (max-width: 480px) {
  .login-container { max-width: 100%; }
  .auth-panel { padding: 18px; }
  .stats-strip { padding: 2px 10px; }
  .strip-stat { padding: 6px 10px; }
}
