/* SwimRep visual system — neutral, mobile-oriented, light-first */
:root {
  --green-900:#15181d;
  --green-800:#20242b;
  --green-600:#5d6673;
  --green-100:#f1f4f7;
  --ink:#15181d;
  --muted:#69717d;
  --line:#e1e6eb;
  --paper:#ffffff;
  --bg:#f4f6f8;
  --nexus-dark:#15181d;
  --nexus-dark-2:#20242b;
  --nexus-mid:#69717d;
  --nexus-soft:#eef1f4;
  --nexus-glow:rgba(255,255,255,.95);
  --nexus-shadow:0 18px 46px rgba(21,24,29,.08);
  --nexus-shadow-soft:0 10px 28px rgba(21,24,29,.06);
}

html,body {
  background:
    radial-gradient(circle at 12% 5%, rgba(255,255,255,.98) 0 9%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 88% 12%, rgba(226,232,240,.65) 0 8%, rgba(226,232,240,0) 27%),
    linear-gradient(180deg,#f8fafb 0%,#f3f5f7 48%,#eef1f4 100%);
  color:var(--ink);
}

body::before {
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.92), transparent 24%),
    radial-gradient(circle at 75% 64%, rgba(203,213,225,.22), transparent 25%);
}

::selection { background:#20242b; color:#fff; }

/* Brand */
.brand-lockup { gap:12px; }
.brand-mark {
  background:#fff;
  border:1px solid rgba(226,232,240,.95);
  box-shadow:0 9px 25px rgba(15,23,42,.08), 0 0 28px rgba(255,255,255,.95);
}
.brand-mark img { width:100%; height:100%; display:block; }
.brand-lockup h1 { color:var(--nexus-dark); letter-spacing:-.035em; font-weight:760; }
.brand-lockup p { color:var(--muted); font-size:12px; letter-spacing:.08em; text-transform:uppercase; font-weight:750; }

/* Authentication */
.auth-screen {
  position:relative;
  isolation:isolate;
  background:
    radial-gradient(circle at 50% 10%, rgba(255,255,255,1) 0 10%, transparent 34%),
    radial-gradient(circle at 15% 80%, rgba(203,213,225,.4), transparent 28%),
    linear-gradient(145deg,#f8fafc,#edf0f3);
}
.auth-screen::before,.auth-screen::after {
  content:"";
  position:absolute;
  border-radius:999px;
  filter:blur(28px);
  opacity:.52;
  z-index:-1;
}
.auth-screen::before { width:220px; height:220px; background:#fff; top:8%; left:8%; }
.auth-screen::after { width:280px; height:280px; background:#dce3e9; bottom:3%; right:5%; }
.auth-card {
  border:1px solid rgba(226,232,240,.92);
  background:rgba(255,255,255,.87);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  box-shadow:0 30px 80px rgba(15,23,42,.12),0 0 60px rgba(255,255,255,.85);
  border-radius:26px;
}
.auth-card .brand-lockup.centered {
  background:linear-gradient(145deg,#fff,#f6f8fa);
  border:1px solid var(--line);
  border-radius:20px;
}
.auth-tab,.nav-btn { color:var(--nexus-dark); border-color:var(--line); }
.auth-tab.active { background:var(--nexus-dark); color:#fff; border-color:var(--nexus-dark); box-shadow:0 8px 22px rgba(21,24,29,.18); }
input,select,textarea {
  border-color:#dce2e7;
  background:rgba(255,255,255,.94);
  color:var(--ink);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
input:focus,select:focus,textarea:focus {
  outline:none;
  border-color:#8f99a5;
  box-shadow:0 0 0 4px rgba(148,163,184,.16);
}
.btn.primary { background:linear-gradient(180deg,#252a31,#15181d); color:#fff; box-shadow:0 8px 20px rgba(21,24,29,.18); }
.btn.secondary,.btn.soft { background:#f7f8fa; color:#2e343d; border-color:#dfe4e8; }
.btn.secondary:hover,.btn.soft:hover { background:#eef1f4; }
.link-btn { color:#303640; border-color:#dfe4e8; background:#fff; }
.link-btn:hover { background:#f3f5f7; border-color:#cdd4db; }

/* Main shell */
.app-shell { min-height:100dvh; }
.app-header {
  position:sticky;
  top:0;
  z-index:25;
  background:rgba(249,250,251,.88);
  color:var(--ink);
  border-bottom:1px solid rgba(218,224,230,.9);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  box-shadow:0 8px 30px rgba(15,23,42,.045);
}
.app-header .brand-mark { background:#fff; }
.app-header .brand-lockup h1 { color:var(--ink); }
.app-header .brand-lockup p { color:#737b86; }
.user-chip {
  background:#fff;
  border:1px solid var(--line);
  color:var(--ink);
  box-shadow:0 8px 24px rgba(15,23,42,.055);
}
.user-chip strong { background:#eef1f4; color:#3d4650; }
#logoutBtn { background:#fff; color:#4b5563; border:1px solid #dfe4e8; }
#logoutBtn:hover { background:#f5f6f8; }

.layout { grid-template-columns:252px minmax(0,1fr); gap:20px; padding:20px; }
.sidebar {
  top:92px;
  padding:12px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,.075), transparent 22%),
    linear-gradient(180deg,#20242a 0%,#15181d 100%);
  border:1px solid rgba(255,255,255,.06);
  border-radius:24px;
  box-shadow:0 24px 50px rgba(21,24,29,.16);
}
.sidebar .nav-btn {
  position:relative;
  min-height:48px;
  display:flex;
  align-items:center;
  gap:11px;
  text-align:left;
  color:#c9d0d8;
  background:transparent;
  border:1px solid transparent;
  border-radius:15px;
  transition:.18s ease;
}
.sidebar .nav-btn svg { width:19px; height:19px; opacity:.85; }
.sidebar .nav-btn:hover { color:#fff; background:rgba(255,255,255,.07); }
.sidebar .nav-btn.active {
  color:#11151a;
  background:linear-gradient(180deg,#fff,#edf1f4);
  border-color:rgba(255,255,255,.72);
  box-shadow:0 7px 24px rgba(255,255,255,.14);
}

.content { width:min(1420px,100%); margin:0 auto; }
.page-title,.view-head {
  position:relative;
  overflow:hidden;
  background:rgba(255,255,255,.84);
  border:1px solid rgba(222,227,232,.94);
  box-shadow:var(--nexus-shadow-soft),0 0 36px rgba(255,255,255,.8);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-radius:24px;
  padding:22px 24px;
}
.page-title::after,.view-head::after {
  content:"";
  position:absolute;
  width:180px;
  height:180px;
  right:-62px;
  top:-92px;
  border-radius:50%;
  background:radial-gradient(circle,#fff 0%,rgba(226,232,240,.5) 42%,rgba(226,232,240,0) 70%);
  pointer-events:none;
}
.page-title span,.eyebrow { color:#7b8490; letter-spacing:.11em; }
.page-title h2,.view-head h2 { color:#171a1f; letter-spacing:-.04em; }
.view-head p { color:var(--muted); margin:.45rem 0 0; max-width:760px; }

/* Cards */
.stat-card,.module-card,.report-card,.data-card {
  position:relative;
  overflow:hidden;
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(249,250,251,.94));
  border:1px solid rgba(221,226,231,.92);
  border-radius:22px;
  box-shadow:var(--nexus-shadow-soft),0 0 30px rgba(255,255,255,.7);
}
.stat-card::before,.data-card::before {
  content:"";
  position:absolute;
  width:110px;
  height:110px;
  border-radius:50%;
  right:-54px;
  top:-54px;
  background:radial-gradient(circle,rgba(255,255,255,.98),rgba(226,232,240,.24) 55%,transparent 72%);
  pointer-events:none;
}
.dashboard-links-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.dashboard-link-card { cursor:pointer; transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.dashboard-link-card:hover { transform:translateY(-3px); border-color:#cfd6dc; box-shadow:0 18px 38px rgba(21,24,29,.09),0 0 30px rgba(255,255,255,.9); }
.stat-card span { color:#7b8490; }
.stat-card strong { color:#1c2026; letter-spacing:-.045em; }
.stat-card small { color:#818995; }
.data-card h3 { color:#1c2026; }
.pill { background:#eef1f4; color:#46505b; border:1px solid #e0e5e9; }

/* Competitions / users */
.competition-card-vertical,.user-card,.results-competition-card,.results-preview-card,.results-import-card {
  background:rgba(255,255,255,.94);
  border:1px solid #e0e5e9;
  box-shadow:var(--nexus-shadow-soft);
  border-radius:22px;
}
.competition-card-vertical:hover,.user-card:hover { border-color:#cfd6dc; box-shadow:0 16px 34px rgba(21,24,29,.08); }
.user-card h3,.competition-card-vertical h3 { color:#1d2228; }

/* Attendance: keep calendar, make it a first-class product view */
.attendance-calendar-card,.attendance-summary-card {
  border:1px solid #dde3e8;
  background:rgba(255,255,255,.94);
  border-radius:24px;
  box-shadow:var(--nexus-shadow-soft);
}
.attendance-calendar-cell {
  background:#fbfcfd;
  border-color:#e4e8ec;
  border-radius:14px;
  transition:.16s ease;
}
.attendance-calendar-cell:hover { transform:translateY(-1px); background:#fff; border-color:#cfd6dc; box-shadow:0 8px 18px rgba(15,23,42,.06); }
.attendance-calendar-cell.is-today { box-shadow:inset 0 0 0 2px #343a42,0 7px 18px rgba(21,24,29,.08); }
.attendance-calendar-cell.has-session { background:linear-gradient(145deg,#fff,#f3f5f7); }
.attendance-session-dot { background:#20242b; color:#fff; }
.attendance-summary-pills > * { background:#f3f5f7; border:1px solid #e1e6ea; }
.picker-athlete-row { background:#fff; border-color:#e1e6ea; }
.picker-status-options label { background:#f7f8fa; border-color:#e1e6ea; }

/* Progression: simplify the existing information hierarchy */
.staff-progression-view { display:grid; gap:14px; }
.staff-progression-controls { padding:20px; }
.staff-progression-filters { gap:10px; }
.staff-progression-summary {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.staff-progression-summary article {
  position:relative;
  overflow:hidden;
  background:linear-gradient(145deg,#fff,#f6f8fa);
  border:1px solid #dfe4e8;
  border-radius:20px;
  padding:18px;
  box-shadow:0 10px 26px rgba(21,24,29,.055);
}
.staff-progression-summary article::after {
  content:"";
  position:absolute;
  width:90px;
  height:90px;
  right:-42px;
  top:-42px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,1),rgba(203,213,225,.25),transparent 70%);
}
.staff-progression-summary strong { display:block; font-size:30px; color:#171a1f; letter-spacing:-.04em; }
.staff-progression-summary span { color:#7a838e; font-size:12px; font-weight:750; text-transform:uppercase; letter-spacing:.07em; }
.staff-export-card { background:#f8f9fa; border:1px solid #e1e6ea; border-radius:16px; }

/* Results */
.result-summary-grid > *, .result-stat-pills > * { background:#f5f7f8; border:1px solid #e1e6ea; border-radius:16px; }
.results-table thead th { background:#f1f3f5; color:#4b5560; }
.results-table tbody tr:hover { background:#f8fafb; }

/* Modals */
.modal-root { background:rgba(17,20,24,.48); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.modal-card { border:1px solid rgba(226,232,240,.9); border-radius:24px; box-shadow:0 35px 90px rgba(15,23,42,.24),0 0 45px rgba(255,255,255,.2); }
.modal-head { background:rgba(255,255,255,.94); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); }
.modal-head h3 { color:#1c2026; }
.close-btn { background:#eef1f4; color:#303740; }
.modal-section { background:#f8fafb; border-color:#e0e5e9; }
.section-title strong,.race-category-title-checklist { color:#30363e; }
.races-checklist { background:#f4f6f8; border-color:#dfe4e8; }
.race-checklist-item { border-color:#e0e5e9; }
.race-checklist-item:hover { background:#f6f7f9; border-color:#cfd6dc; }
.race-checklist-item input[type="checkbox"] { accent-color:#20242b; }
.selected-races-container { background:#f0f2f4; border-color:#d7dde2; }
.selected-races-title { color:#343b44; }

/* Responsive */
@media(max-width:1080px){
  .layout { grid-template-columns:218px minmax(0,1fr); }
  .dashboard-links-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media(max-width:820px){
  body { padding-bottom:86px; }
  .app-header {
    position:sticky;
    top:0;
    padding:calc(env(safe-area-inset-top) + 10px) 14px 12px;
    border-radius:0;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
  }
  .app-header .brand-lockup { min-width:0; }
  .app-header .brand-mark { width:44px; height:44px; border-radius:14px; }
  .app-header .brand-lockup h1 { font-size:19px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .app-header .brand-lockup p { font-size:9px; }
  .user-chip { display:none; }
  #logoutBtn { width:auto; min-width:44px; padding:9px 12px; }
  .layout { display:block; padding:12px; }
  .content { width:100%; }
  .sidebar {
    position:fixed;
    left:10px;
    right:10px;
    bottom:max(10px,env(safe-area-inset-bottom));
    top:auto;
    z-index:35;
    display:flex;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    scrollbar-width:none;
    gap:6px;
    padding:8px;
    border-radius:20px;
    background:rgba(23,26,31,.94);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    box-shadow:0 20px 55px rgba(15,23,42,.28);
  }
  .sidebar::-webkit-scrollbar { display:none; }
  .sidebar .nav-btn {
    flex:0 0 auto;
    min-width:74px;
    min-height:56px;
    padding:7px 9px;
    display:grid;
    place-items:center;
    align-content:center;
    gap:4px;
    text-align:center;
    font-size:10px;
    line-height:1.05;
    color:#cbd2d9;
    white-space:nowrap;
  }
  .sidebar .nav-btn svg { width:19px; height:19px; }
  .sidebar .nav-btn.active { color:#15181d; background:#fff; }
  .page-title,.view-head { border-radius:20px; padding:18px; }
  .page-title h2,.view-head h2 { font-size:27px; }
  .dashboard-links-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .stat-card { min-height:126px; padding:15px; }
  .stat-card strong { font-size:31px; }
  .staff-progression-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .staff-progression-summary article { padding:14px; border-radius:17px; }
  .staff-progression-summary strong { font-size:25px; }
  .attendance-calendar-card { border-radius:20px; }
  .modal-root { align-items:end; }
  .modal-card { border-radius:24px 24px 18px 18px; }
}

@media(max-width:420px){
  .auth-card { padding:16px; border-radius:22px; }
  .dashboard-links-grid { grid-template-columns:1fr 1fr; }
  .stat-card { min-height:116px; padding:13px; }
  .stat-card span { font-size:10px; }
  .stat-card strong { font-size:27px; }
  .stat-card small { font-size:11px; }
  .sidebar { left:7px; right:7px; bottom:max(7px,env(safe-area-inset-bottom)); }
  .sidebar .nav-btn { min-width:69px; }
}
