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

:root {
  --bg: #111010;
  --surface: #1c1b1b;
  --surface2: #252424;
  --surface3: #2e2d2d;
  --accent: #e8401c;
  --accent-dim: #b33015;
  --accent2: #f0a500;
  --accent2-dim: #c07f00;
  --text: #f2ede8;
  --text-dim: #9a9490;
  --text-muted: #6a6560;
  --border: #2a2929;
  --border-light: #3a3938;
  --green: #4caf50;
  --blue: #4a9eff;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── SPLASH ── */
.splash {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--text-dim);
  font-size: 16px;
}

/* ── LOGIN ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 360px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.login-logo span { color: var(--accent); }

.login-logo p {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 4px;
}

.login-error {
  background: rgba(232,64,28,0.15);
  border: 1px solid rgba(232,64,28,0.3);
  color: var(--accent);
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}

/* ── LAYOUT ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-brand h2 span { color: var(--accent); }

.sidebar-user {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.sidebar-user strong { color: var(--accent2); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(232,64,28,0.15); color: var(--accent); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover { border-color: var(--accent); color: var(--accent); }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.page {
  padding: 28px 32px;
  max-width: 960px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.page-header p {
  color: var(--text-dim);
  margin-top: 4px;
  font-size: 13px;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-value.accent { color: var(--accent); }
.stat-value.accent2 { color: var(--accent2); }

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

tbody tr {
  border-top: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:hover { background: var(--surface2); }

td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text);
}

td.dim { color: var(--text-dim); }

/* ── FORMS ── */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

select {
  cursor: pointer;
}

select option {
  background: var(--surface2);
  color: var(--text);
}

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

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--surface3); border-color: var(--text-dim); }

.btn-danger {
  background: rgba(232,64,28,0.15);
  color: var(--accent);
  border: 1px solid rgba(232,64,28,0.3);
}
.btn-danger:hover { background: rgba(232,64,28,0.25); }

.btn-ghost {
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-icon {
  padding: 6px 8px;
}

/* ── TAGS / BADGES ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-a { background: rgba(74,158,255,0.15); color: var(--blue); }
.badge-b { background: rgba(240,165,0,0.15); color: var(--accent2); }
.badge-c { background: rgba(179,113,255,0.15); color: #b371ff; }
.badge-ind { background: rgba(76,175,80,0.15); color: var(--green); }
.badge-type { background: var(--surface3); color: var(--text-dim); }
.badge-rpe {
  background: rgba(232,64,28,0.15);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
}

/* ── TRAINING CARD ── */
.training-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.training-card-header {
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.training-card-header-left h3 {
  font-size: 15px;
  font-weight: 600;
}

.training-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.training-meta span {
  font-size: 12px;
  color: var(--text-dim);
}

.training-card-body {
  padding: 16px 20px;
}

/* ── TASK ITEM ── */
.task-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
}

.task-item:last-child { margin-bottom: 0; }

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.task-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.task-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.5;
}

.task-timer-config {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.task-config-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface3);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.task-config-chip strong { color: var(--text); }

/* ── TIMER WIDGET ── */
.timer-widget {
  background: var(--surface3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timer-display { flex: 1; }

.timer-phase {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.timer-time {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-set-info {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.timer-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-start { background: var(--accent); color: #fff; }
.btn-start:hover { background: var(--accent-dim); }
.btn-pause { background: var(--accent2); color: #111; }
.btn-pause:hover { background: var(--accent2-dim); }
.btn-reset { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border-light); }
.btn-reset:hover { color: var(--text); }

/* ── FEEDBACK FORM ── */
.feedback-section {
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.feedback-btn-row {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feedback-form-wrap {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.feedback-form-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

.scale-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.scale-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scale-btn:hover { border-color: var(--accent); color: var(--text); }
.scale-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-btn.selected-mood { background: var(--accent2); border-color: var(--accent2); color: #111; }

.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.pain-btn {
  padding: 7px 10px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.pain-btn:hover { border-color: var(--accent); color: var(--text); }
.pain-btn.selected { background: rgba(232,64,28,0.2); border-color: var(--accent); color: var(--accent); }
.pain-btn.selected-ok { background: rgba(76,175,80,0.15); border-color: var(--green); color: var(--green); }

/* ── FEEDBACK SUMMARY ── */
.feedback-summary {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(76,175,80,0.05);
}

.summary-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  margin-bottom: 10px;
}

.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-item label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.summary-item p {
  font-size: 13px;
  color: var(--text);
}

/* ── FEEDBACK CARD (coach view) ── */
.feedback-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.feedback-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.feedback-card-athlete {
  font-size: 14px;
  font-weight: 600;
}

.feedback-card-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.feedback-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.feedback-field label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.feedback-field p {
  font-size: 13px;
  color: var(--text);
  max-width: 300px;
}

/* ── NEW TRAINING FORM ── */
.task-form-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.task-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.task-form-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.toggle-input {
  width: auto;
  cursor: pointer;
  accent-color: var(--accent);
}

.timer-fields {
  background: var(--surface3);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
}

/* ── ASSIGN SECTION ── */
.assign-groups {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.group-btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.group-btn:hover { border-color: var(--text-dim); color: var(--text); }
.group-btn.active-a { background: rgba(74,158,255,0.15); border-color: var(--blue); color: var(--blue); }
.group-btn.active-b { background: rgba(240,165,0,0.15); border-color: var(--accent2); color: var(--accent2); }

.athletes-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.athlete-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}

.athlete-check-item:hover { background: var(--surface3); }

.athlete-check-item input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.athlete-check-item label {
  margin: 0;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.athlete-check-item .group-tag {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── FILTER ROW ── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-row select {
  width: auto;
  min-width: 180px;
}

/* ── HISTORY VIEW ── */
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-training-name {
  font-size: 14px;
  font-weight: 600;
}

.history-date {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── INLINE ALERT ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-error {
  background: rgba(232,64,28,0.12);
  border: 1px solid rgba(232,64,28,0.25);
  color: var(--accent);
}

.alert-success {
  background: rgba(76,175,80,0.12);
  border: 1px solid rgba(76,175,80,0.25);
  color: var(--green);
}

/* ── CALENDAR ── */
.cal-wrap { }

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.cal-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}

.cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  min-height: 80px;
  vertical-align: top;
  transition: border-color 0.15s;
}

.cal-day.empty {
  background: transparent;
  border: none;
  min-height: 0;
}

.cal-day.today {
  border-color: var(--accent);
}

.cal-day.today .cal-day-num { color: var(--accent); }

.cal-day.has-events { cursor: pointer; }
.cal-day.has-events:hover { border-color: var(--border-light); background: var(--surface2); }

.cal-day.athlete-day {
  background: rgba(232,64,28,0.07);
  border-color: rgba(232,64,28,0.35);
  cursor: pointer;
}

.cal-day.athlete-day:hover { background: rgba(232,64,28,0.13); }

.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1;
}

.cal-event {
  background: var(--accent);
  border-radius: 3px;
  padding: 2px 5px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: opacity 0.1s;
}

.cal-event:hover { opacity: 0.85; }
.cal-event-name { display: block; font-size: 10px; font-weight: 700; color: #fff; line-height: 1.2; }
.cal-event-athlete { display: block; font-size: 10px; color: rgba(255,255,255,0.8); }

.cal-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  margin-top: 4px;
}

.cal-detail-panel {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
  animation: slideDown 0.15s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cal-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-detail-title { font-size: 16px; font-weight: 700; }
.cal-detail-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ── TIMER TYPE SELECTOR ── */
.timer-type-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: var(--surface3);
  border-radius: var(--radius);
  padding: 3px;
  width: fit-content;
}

.tt-btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tt-btn:hover { color: var(--text); }
.tt-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.tt-btn.active-time { background: var(--accent); color: #fff; }
.tt-btn.active-reps { background: var(--accent2); color: #111; }

/* ── ASSIGNMENT WITH DATES ── */
.assign-athlete-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background 0.1s;
}

.assign-athlete-row:hover { background: var(--surface3); }

.assign-athlete-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.assign-athlete-row label {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  flex: 1;
}

.assign-athlete-row .group-tag {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.assign-date-input {
  width: auto !important;
  padding: 5px 8px !important;
  font-size: 12px !important;
  color-scheme: dark;
  flex-shrink: 0;
}

.assign-date-input:disabled { opacity: 0.35; cursor: not-allowed; }

.assign-list {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}

/* ── ENHANCED TIMER ── */
.timer-widget {
  background: var(--surface3);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 10px;
}

.timer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timer-display { flex: 1; min-width: 0; }

.timer-phase {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 3px;
}

.timer-main-value {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 2px;
}

.timer-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.timer-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.timer-progress-area {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.9s linear;
}

.progress-fill.work { background: var(--accent); }
.progress-fill.rest { background: var(--accent2); }
.progress-fill.between { background: var(--blue); }
.progress-fill.sets { background: var(--green); }

.btn-next-rep {
  background: var(--accent2);
  color: #111;
  font-weight: 700;
}

.btn-next-rep:hover { background: var(--accent2-dim); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-nav {
    padding: 8px;
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }

  .nav-section { display: flex; gap: 4px; margin: 0; }
  .nav-label { display: none; }
  .nav-item { flex-shrink: 0; padding: 7px 12px; font-size: 12px; }

  .sidebar-footer { display: none; }

  .page { padding: 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-2 { grid-template-columns: 1fr; }

  .timer-widget { flex-direction: column; align-items: flex-start; }

  .training-card-header { flex-direction: column; }

  .feedback-fields { flex-direction: column; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 12px; }
  .card { padding: 14px; }
}

/* ============================================================
   MODAL OVERLAY (popup z rozmyciem tła)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: modalFade 0.15s ease;
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.18s ease;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.modal-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--surface2);
  margin-bottom: 6px;
}

.modal-status.status-green { color: var(--green); background: rgba(76,175,80,0.12); }
.modal-status.status-blue  { color: var(--blue);  background: rgba(74,158,255,0.12); }
.modal-status.status-red   { color: #e5484d;      background: rgba(229,72,77,0.12); }

.modal-survey { margin-top: 12px; }

.modal-survey-row {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.modal-field { margin-bottom: 10px; }
.modal-survey label, .modal-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.modal-survey p, .modal-field p { font-size: 13px; color: var(--text); }

/* ============================================================
   WEEK VIEW (widok tygodniowy)
   ============================================================ */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.week-title-wrap { text-align: center; }
.week-title { font-size: 17px; font-weight: 700; color: var(--text); }
.week-range { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.week-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--text-dim);
}
.week-legend span { display: inline-flex; align-items: center; gap: 6px; }

.week-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.week-dot.week-green { background: var(--green); }
.week-dot.week-blue  { background: var(--blue); }
.week-dot.week-red   { background: #e5484d; }
.week-dot.week-grey  { background: var(--border-light); }

.week-table-wrap { overflow-x: auto; }
.week-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 4px;
}

.week-table th, .week-table td {
  padding: 0;
  vertical-align: top;
}

.week-athlete-head {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 6px 10px !important;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 2;
  min-width: 140px;
}

.week-daycol {
  text-align: center;
  background: var(--surface2);
  border-radius: 6px;
  padding: 6px 4px !important;
  min-width: 84px;
}
.week-daycol.week-today { background: rgba(232,64,28,0.15); }
.week-dayname { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; }
.week-daycol.week-today .week-dayname { color: var(--accent); }
.week-daynum { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.week-athlete {
  padding: 8px 10px !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--surface);
  border-radius: 6px;
  z-index: 1;
}

.week-athlete-link {
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.week-athlete-link:hover { color: var(--accent); text-decoration: underline; }

.week-cell {
  background: var(--surface);
  border-radius: 6px;
  padding: 4px !important;
  min-width: 84px;
  min-height: 52px;
  height: 52px;
}
.week-cell-empty { background: var(--surface2); opacity: 0.4; }

.week-chip {
  border-radius: 5px;
  padding: 5px 7px;
  margin-bottom: 3px;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  border-left: 3px solid transparent;
}
.week-chip:last-child { margin-bottom: 0; }
.week-chip:hover { filter: brightness(1.15); transform: translateY(-1px); }
.week-chip.week-green { background: rgba(76,175,80,0.16); border-left-color: var(--green); }
.week-chip.week-blue  { background: rgba(74,158,255,0.16); border-left-color: var(--blue); }
.week-chip.week-red   { background: rgba(229,72,77,0.16); border-left-color: #e5484d; }
.week-chip-name { display: block; font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.25; }
.week-chip-rpe { display: block; font-size: 10px; color: var(--text-dim); margin-top: 1px; }

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

.week-sum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.week-sum-card:hover { background: var(--surface2); }
.week-sum-card.sum-ok { border-left-color: var(--green); }
.week-sum-card.sum-warn { border-left-color: var(--accent2); }
.week-sum-card.sum-none { border-left-color: var(--border-light); opacity: 0.7; }

.week-sum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.week-sum-name { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; }
.week-sum-icon { font-size: 16px; }

.week-sum-stats { display: flex; gap: 16px; }
.week-sum-stats > div { display: flex; flex-direction: column; }
.week-sum-num { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.week-sum-num.accent { color: var(--accent); }
.week-sum-stats label { font-size: 10px; color: var(--text-muted); margin: 3px 0 0; text-transform: uppercase; letter-spacing: 0.4px; }

/* ============================================================
   ATHLETE PROFILE (historia zawodnika)
   ============================================================ */
.athlete-name-link {
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.athlete-name-link:hover { color: var(--accent); text-decoration: underline; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-header h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.profile-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; }

.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.profile-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.profile-history { display: flex; flex-direction: column; gap: 8px; }

.hist-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.hist-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.hist-row-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hist-name { font-size: 13px; font-weight: 600; color: var(--text); }
.hist-date { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.hist-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hist-status { font-size: 11px; font-weight: 600; }
.hist-status.hist-green { color: var(--green); }
.hist-status.hist-blue  { color: var(--blue); }
.hist-status.hist-red   { color: #e5484d; }
.hist-caret { font-size: 9px; color: var(--text-muted); }

.hist-detail {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.pain-freq-list { display: flex; flex-direction: column; gap: 4px; }
.pain-freq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
}
.pain-freq-count { font-weight: 700; color: var(--accent); }

/* ============================================================
   CALENDAR EVENTS (starty / wyjazdy)
   ============================================================ */
.cal-day-flag { font-size: 11px; margin-left: 4px; }

.cal-happening {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 3px;
  padding: 2px 5px;
  margin-bottom: 2px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: filter 0.1s;
}
.cal-happening:hover { filter: brightness(1.2); }
.cal-hap-icon { font-size: 10px; }
.cal-hap-name { font-size: 10px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-happening.evt-competition { background: rgba(240,165,0,0.18); border-left-color: var(--accent2); }
.cal-happening.evt-trip { background: rgba(74,158,255,0.18); border-left-color: var(--blue); }
.cal-happening.evt-other { background: var(--surface3); border-left-color: var(--text-muted); }

/* ── RESPONSIVE (nowe komponenty) ── */
@media (max-width: 768px) {
  .modal-survey-row { gap: 16px; }
  .week-summary-grid { grid-template-columns: 1fr; }
  .profile-header { gap: 12px; }
  .profile-avatar { width: 46px; height: 46px; font-size: 20px; }
}

/* ============================================================
   ITERACJA 1 — grupy, cykle, podsumowanie
   ============================================================ */

/* Kropka koloru grupy */
.grp-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-right: 6px;
  vertical-align: middle;
}

/* Zarządzanie grupami */
.group-manage-list { display: flex; flex-direction: column; gap: 6px; }
.group-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius);
}

/* Przełącznik segmentowy (Ankiety / Podsumowanie) */
.seg-toggle {
  display: inline-flex;
  gap: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 18px;
}
.seg-btn {
  padding: 7px 18px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent); color: #fff; }

/* Selektor zakresu kalendarza */
.cal-scope-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cal-scope-row select { width: auto; min-width: 200px; }

/* Wybór koloru (cykle) */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text-dim); }

/* Legenda cykli */
.cycle-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cycle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.cycle-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cycle-chip .dim { font-weight: 400; font-size: 11px; }
.cycle-chip-del {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 11px; padding: 0 0 0 2px;
}
.cycle-chip-del:hover { color: var(--accent); }

/* Chipy szybkiego wyboru (podsumowanie) */
.pick-chip {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pick-chip:hover { border-color: var(--accent); color: var(--text); }

/* Lista zawodników z checkboxami (podsumowanie) */
.sum-ath-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sum-ath-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin: 0;
  font-size: 13px;
  color: var(--text);
}
.sum-ath-item:hover { background: var(--surface3); }
.sum-ath-item input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }

@media (max-width: 768px) {
  .sum-ath-grid { grid-template-columns: 1fr 1fr; }
  .cal-scope-row select { min-width: 0; flex: 1; }
}

/* Baner aktualnego cyklu (zawodnik) */
.cycle-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}
.cycle-banner-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cycle-banner-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cycle-banner-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
