@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --ice: #f0f9ff;
  --navy: #1e3a5f;
  --text: #1e293b;
  --text-light: #475569;
  --muted: #94a3b8;
  --card: #ffffff;
  --border: #e2e8f0;
  --success: #059669;
  --success-light: #d1fae5;
  --success-border: #6ee7b7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-border: #fca5a5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-border: #fcd34d;
}

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

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background: linear-gradient(155deg, #dbeafe 0%, #f8fafc 55%, #e0f2fe 100%);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  flex: 1;
}

.nav-brand span { color: var(--primary); font-style: italic; }

.nav-user {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-user strong { color: var(--text); }

/* ── Layout ── */
.page-wrapper { padding-top: 60px; min-height: 100vh; }

.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Login ── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 8px 48px rgba(30,58,95,0.12);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
}

.login-card-header {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  padding: 2.25rem 2rem 1.75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.login-card-header::after {
  content: '\2744';
  position: absolute;
  bottom: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  line-height: 44px;
  text-align: center;
  font-size: 1.1rem;
}

.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--navy);
}

.login-logo span { color: var(--primary); font-style: italic; }

.login-card-header p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.4rem;
}

.login-card-body { padding: 2.5rem 2rem 2rem; }

.login-card-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.login-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.login-links a:hover { color: var(--primary); }

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--ice);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ── */
.btn {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 20px;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 12px rgba(5,150,105,0.2);
}
.btn-success:hover { background: #047857; }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-light);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-sm {
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border-radius: 16px;
}

.btn-login {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 0.85rem;
  cursor: pointer;
  margin-top: 0.5rem;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
  transition: background 0.2s, transform 0.15s;
}
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ── Messages ── */
.msg {
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: var(--danger-light); border: 1px solid var(--danger-border); color: var(--danger); }
.msg.success { background: var(--success-light); border: 1px solid var(--success-border); color: var(--success); }
.msg.info { background: var(--primary-light); border: 1px solid #93c5fd; color: var(--primary-dark); }

/* ── Page header ── */
.page-header { margin-bottom: 1.75rem; }

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--navy);
}

.page-header p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(30,58,95,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,58,95,0.12);
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--primary-dark); }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(30,58,95,0.06);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--ice); }

.td-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }

/* ── Level rows (card-style list, replaces wide table) ── */
.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.level-row:last-child { border-bottom: none; }
.level-row:hover { background: var(--ice); }

.level-row-main { min-width: 0; flex: 1; }
.level-row-name { font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.level-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-light);
}
.level-row-meta-item { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.level-row-meta-item .lbl { color: var(--muted); }

.level-row-actions { display: flex; gap: 0.4rem; align-items: center; flex-shrink: 0; }

/* ── Compact dropdown menu (kebab) ── */
.menu-wrap { position: relative; display: inline-block; }
.menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(30,58,95,0.14);
  min-width: 160px;
  z-index: 50;
  overflow: hidden;
}
.menu-dropdown.open { display: block; }
.menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}
.menu-dropdown button:hover { background: var(--ice); }
.menu-dropdown button.danger { color: #dc2626; }
.menu-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ── Day-of-week pill toggle (multi-select) ── */
.day-pill {
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.day-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.day-pill.unavail {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
  text-decoration: line-through;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-info    { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted   { background: #f1f5f9; color: var(--muted); }

/* ── Notification dot ── */
.notif-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 0.25rem;
}

/* ── Notification count bubble ── */
.notif-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #f97316;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.3rem;
  line-height: 1;
}

/* ── Attendance roster ── */
.attend-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.attend-row:last-child { border-bottom: none; }

.skater-name { font-weight: 600; font-size: 0.95rem; }

.attend-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.attend-toggle button {
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}

.attend-toggle .present-btn.on { background: var(--success); color: white; }
.attend-toggle .absent-btn.on  { background: var(--danger);  color: white; }

.attend-notes { min-width: 160px; }
.attend-notes input {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  padding: 0.38rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  background: var(--ice);
}
.attend-notes input:focus { border-color: var(--primary); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.empty-icon { font-size: 2.25rem; margin-bottom: 0.6rem; }
.empty-state p { font-size: 0.88rem; }

/* ── Modals ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,58,95,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.show { display: flex; }

.modal {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 16px 64px rgba(30,58,95,0.2);
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  animation: fadeUp 0.22s ease both;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 1.25rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Inline filter bar ── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-select {
  font-family: 'Nunito', sans-serif;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-size: 0.85rem;
  background: var(--ice);
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

/* ── Setup note ── */
.setup-note {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--warning);
  margin-bottom: 1.5rem;
  display: none;
}
.setup-note.show { display: block; }
.setup-note strong { display: block; margin-bottom: 0.3rem; }

/* ── Attendance sheet table ── */
.sheet-header-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(30,58,95,0.05);
}

.sheet-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.sheet-meta-item { display: flex; flex-direction: column; gap: 0.3rem; }

.sheet-meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
}

.sheet-meta-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--ice);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  outline: none;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.2s;
  min-width: 130px;
}
.sheet-meta-value:focus { border-color: var(--primary); }

.sheet-level-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--navy);
  font-weight: 500;
  padding: 0.5rem 0;
}

.sheet-status { display: flex; align-items: flex-end; margin-left: auto; }

.sheet-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(30,58,95,0.05);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--card);
}

.sheet-table thead tr {
  background: var(--navy);
}

.sheet-table th {
  color: white;
  font-weight: 700;
  border-right: 1px solid rgba(255,255,255,0.12);
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}

.skater-th {
  text-align: left;
  padding: 0.75rem 1rem !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--navy);
  min-width: 150px;
  border-right: 2px solid rgba(255,255,255,0.2) !important;
}

.skill-th {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  vertical-align: bottom;
}

.skill-th-inner {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 0.75rem 0.4rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  max-height: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-table tbody tr { border-bottom: 1px solid var(--border); }
.sheet-table tbody tr:last-child { border-bottom: none; }
.sheet-table tbody tr:nth-child(even) { background: #f8fafc; }
.sheet-table tbody tr:nth-child(even) .skater-td { background: #f0f9ff; }

.skater-td {
  padding: 0 !important;
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
  border-right: 2px solid var(--border) !important;
  white-space: nowrap;
}

.skater-td-inner {
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.skill-cell {
  padding: 0 !important;
  border-right: 1px solid var(--border);
  text-align: center;
}

.skill-cell-btn {
  width: 100%;
  height: 48px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  transition: all 0.12s;
  background: transparent;
  display: block;
  line-height: 48px;
  color: #cbd5e1;
}

.skill-cell-btn:hover { transform: scale(1.15); }
.skill-cell-btn.pass    { background: #d1fae5; color: var(--success); }
.skill-cell-btn.needs   { background: #fef3c7; color: var(--warning); }
.skill-cell-btn.present { background: #d1fae5; color: var(--success); }
.skill-cell-btn.absent  { background: #fee2e2; color: var(--danger); }

/* Today column highlight */
.col-today { background: rgba(37,99,235,0.06) !important; }
.col-today-header { background: var(--primary) !important; }

.sheet-legend {
  margin-top: 0.75rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.legend-dot  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── Skater skill cards (kept for possible future use) ── */
.skater-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(30,58,95,0.05);
}

.skater-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: var(--ice);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.skater-card-header:hover { background: var(--primary-light); }

.skater-card-name { font-weight: 700; font-size: 0.97rem; }

.skill-summary {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.skill-progress-bar {
  height: 5px;
  background: var(--border);
}

.skill-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.4s ease;
  min-width: 0;
}

.skills-body { padding: 0.35rem 0.6rem 0.6rem; }

.skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.skill-row:last-child { border-bottom: none; }

.skill-name {
  font-size: 0.87rem;
  flex: 1;
  color: var(--text);
}

.skill-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.skill-toggle button {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}

.skill-pass-btn.on  { background: var(--success); color: white; }
.skill-needs-btn.on { background: var(--warning);  color: white; }

.skater-card.collapsed .skills-body { display: none; }
.skater-card.collapsed .skill-progress-bar { display: none; }

.collapse-icon {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.skater-card.collapsed .collapse-icon { transform: rotate(-90deg); }

/* ── Calendar ────────────────────────────────────────────────────────────── */
.cal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.cal-th {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--navy);
  padding: 0.5rem 0.2rem 0.6rem;
  border-bottom: 2px solid var(--border);
}

.cal-day {
  vertical-align: top;
  border: 1px solid var(--border);
  padding: 0.3rem 0.3rem 0.4rem;
  min-height: 96px;
  background: white;
  transition: background 0.1s;
}

.cal-day.cal-other    { background: #f8fafc; }
.cal-day.cal-weekend  { background: #fafbfc; }
.cal-day.cal-today    { background: #eff6ff; border-color: var(--primary); }

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: right;
  margin-bottom: 0.3rem;
  line-height: 1;
}

.cal-today-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  float: right;
}

.cal-event {
  border-radius: 5px;
  padding: 0.2rem 0.35rem;
  margin-bottom: 0.22rem;
  font-size: 0.67rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  overflow: hidden;
}

.cal-event.cal-regular {
  background: #eff6ff;
  border-left: 2.5px solid var(--primary);
}

.cal-event.cal-sub {
  background: #fef3c7;
  border-left: 2.5px solid #f59e0b;
}

.cal-event.cal-unassigned {
  background: #f1f5f9;
  border-left: 2.5px solid #cbd5e1;
}

.cal-event:hover { filter: brightness(0.92); transform: translateY(-1px); transition: all 0.1s; }

.cal-event-time  { font-size: 0.6rem; color: var(--muted); font-weight: 700; }
.cal-event-level { font-weight: 800; color: var(--navy); white-space: nowrap;
                   overflow: hidden; text-overflow: ellipsis; }
.cal-event-staff { color: var(--text-light); font-size: 0.62rem;
                   white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cal-sub-tag {
  align-self: flex-start;
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  background: #fde68a;
  border-radius: 3px;
  padding: 0.05em 0.3em;
  margin-top: 0.05rem;
}

.cal-other .cal-day-num { color: #c0ccd8; }
.cal-other .cal-event   { opacity: 0.45; }

/* ── Evaluation badges ── */
.eval-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.12em 0.5em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  margin-top: 0.18rem;
  vertical-align: middle;
}
.eval-badge-block { display: block; width: fit-content; }
.eval-pending  { background: #fef3c7; color: #92400e; }
.eval-approved { background: #dbeafe; color: #1e40af; }
.eval-pass     { background: #d1fae5; color: #065f46; }
.eval-fail     { background: #fee2e2; color: #991b1b; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile save bar (hidden on desktop) ── */
#mobile-save-bar { display: none; }

/* ── Responsive ── */
@media (max-width: 640px) {

  /* Nav — hide staff name, tighten spacing */
  nav { padding: 0 0.9rem; height: 54px; gap: 0.5rem; }
  .nav-user > span:first-child { display: none; }
  .nav-user { gap: 0.4rem; }
  .btn-sm { padding: 0.32rem 0.7rem; font-size: 0.76rem; }

  /* Layout */
  .page-wrapper { padding-top: 54px; padding-bottom: 76px; }
  .page-content { padding: 0.9rem 0.75rem 1rem; }
  .page-header { margin-bottom: 1rem; }
  .page-header h1 { font-size: 1.25rem; }
  .page-header p { font-size: 0.8rem; }

  /* Cards */
  .card { padding: 1rem; border-radius: 12px; margin-bottom: 0.9rem; }
  .card-header { margin-bottom: 0.85rem; gap: 0.5rem; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-bottom: 1.1rem; }
  .stat-card  { padding: 0.85rem 0.65rem; }
  .stat-value { font-size: 1.65rem; }

  /* Tabs — bigger tap targets */
  .tab-btn { padding: 0.8rem 1rem; font-size: 0.82rem; }

  /* Attendance grid — taller cells for fat fingers */
  .skill-cell-btn { height: 54px; line-height: 54px; font-size: 1.05rem; }
  .skater-th { min-width: 110px; padding: 0.6rem 0.7rem !important; font-size: 0.65rem; }
  .skater-td-inner { padding: 0.55rem 0.7rem; font-size: 0.83rem; }
  .skill-th { width: 60px; min-width: 60px; max-width: 60px; }

  /* Attendance roster rows */
  .attend-row { grid-template-columns: 1fr; gap: 0.5rem; padding: 0.9rem 0; }
  .attend-toggle button { padding: 0.5rem 1.1rem; font-size: 0.83rem; }
  .attend-notes { min-width: unset; width: 100%; }

  /* Legend */
  .sheet-legend { gap: 0.65rem; font-size: 0.72rem; }

  /* Modals — slide up as a bottom sheet */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    padding: 1.5rem 1.25rem 1.25rem;
    animation: slideUp 0.25s ease both;
  }
  .modal-footer {
    flex-direction: column-reverse;
    padding-bottom: 0.25rem;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.72rem;
    font-size: 0.92rem;
    border-radius: 12px;
  }

  /* Mobile sticky save bar */
  #mobile-save-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    z-index: 50;
    box-shadow: 0 -2px 16px rgba(30,58,95,0.09);
    transition: opacity 0.15s;
  }
  #mobile-save-bar.hidden { display: none; }

}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
