/* SV Kriegsdorf — /svk interner Bereich
   Rot/Weiß, modern & sportlich */

:root {
  --svk-red: #d0021b;
  --svk-red-dark: #a50015;
  --svk-red-light: #fde8ea;
  --svk-ink: #16181d;
  --svk-muted: #6b7280;
  --svk-line: #e5e7eb;
  --svk-bg: #ffffff;
  --svk-card: #ffffff;
  --svk-green: #16a34a;
  --svk-amber: #d97706;
  --svk-radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--svk-bg);
  color: var(--svk-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */

.svk-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--svk-red);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 1.5rem;
  padding-top: calc(0.9rem + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  padding-left: calc(1.5rem + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
  padding-right: calc(1.5rem + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)));
  flex-wrap: wrap;
  box-shadow: 0 2px 12px rgba(208, 2, 27, 0.25);
}

.svk-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.svk-logo {
  height: 40px;
  width: auto;
}

.svk-brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.svk-club {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-style: italic;
}

.svk-sub { color: rgba(255, 255, 255, 0.85); font-size: 0.78rem; }

.svk-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  flex-wrap: wrap;
}

.svk-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.svk-nav a:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.svk-nav a.active { background: #fff; color: var(--svk-red); }

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle:hover { background: rgba(255, 255, 255, 0.25); }

.icon-btn-light {
  background: rgba(255, 255, 255, 0.15);
  border-color: transparent;
}

.icon-btn-light:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: transparent;
}

.svk-auth { display: flex; align-items: center; gap: 0.75rem; }
.svk-user { font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); }

/* --- Layout --- */

.svk-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.svk-footer {
  text-align: center;
  color: var(--svk-muted);
  font-size: 0.8rem;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  border-top: 1px solid var(--svk-line);
}

.page-head { margin-bottom: 1.5rem; }

.page-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-style: italic;
  border-left: 5px solid var(--svk-red);
  padding-left: 0.7rem;
}

.page-head p { margin: 0 0 0.75rem; color: var(--svk-muted); }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

.section-head {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-red);
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

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

.btn-primary {
  background: var(--svk-red);
  color: #fff;
  box-shadow: 0 2px 6px rgba(208, 2, 27, 0.3);
}
.btn-primary:hover { background: var(--svk-red-dark); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid currentColor;
}
.svk-header .btn-ghost { color: #fff; }
.svk-main .btn-ghost { color: var(--svk-red); }
.svk-main .btn-ghost:hover { background: var(--svk-red-light); }

.btn-danger {
  background: transparent;
  color: var(--svk-red-dark);
  border: 1.5px solid var(--svk-red-dark);
}
.btn-danger:hover { background: var(--svk-red-dark); color: #fff; }

.inline-form { display: inline; }

/* --- Flash --- */

.flash-container { margin-bottom: 1rem; }

.flash {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  border-left: 4px solid;
}
.flash-success { background: #e8f7ee; border-color: var(--svk-green); color: #14532d; }
.flash-error { background: var(--svk-red-light); border-color: var(--svk-red); color: var(--svk-red-dark); }
.flash-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }

/* --- Stat cards --- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--svk-card);
  border-radius: var(--svk-radius);
  padding: 1.1rem 1.25rem;
  border-top: 4px solid var(--svk-red);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-style: italic;
  color: var(--svk-red);
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-muted);
}

/* --- Dashboard cards --- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.dash-card {
  background: var(--svk-card);
  border-radius: var(--svk-radius);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--svk-line);
}

.dash-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-red);
}

.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--svk-line);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.dash-list li:last-child { border-bottom: none; }
.dash-list a { color: var(--svk-ink); text-decoration: none; }
.dash-list a:hover { color: var(--svk-red); }

.big-stat { font-size: 2.4rem; font-weight: 800; font-style: italic; color: var(--svk-red); margin: 0.25rem 0; }

.att-stats { display: flex; gap: 2rem; }
.att-stat { display: flex; flex-direction: column; }

/* Strengths & weaknesses */

.assess-list { display: flex; flex-direction: column; gap: 0.9rem; }

.assess-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.assess-rating { letter-spacing: 0.05em; font-size: 0.9rem; white-space: nowrap; }

/* Football rating */

.ball { filter: grayscale(1); opacity: 0.3; }

.ball.on { filter: none; opacity: 1; }

.ball-rating { display: flex; align-items: center; gap: 0.15rem; }

.ball-rating .ball {
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem;
  transition: transform 0.1s;
}

.ball-rating .ball:hover { transform: scale(1.15); }

.ball-rating .ball-value { margin-left: 0.4rem; font-size: 0.8rem; }

.rate-editable { cursor: pointer; }

.rate-editable .ball { transition: transform 0.1s; display: inline-block; }

.rate-editable:hover .ball.on,
.rate-editable .ball:hover { transform: scale(1.15); }

.assess-avg { font-size: 0.75rem; margin-left: 0.35rem; white-space: nowrap; }

/* Live search (player cards) */

.svk-search { margin-bottom: 1rem; }

.svk-search input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.svk-search input:focus {
  outline: none;
  border-color: var(--svk-red);
  box-shadow: 0 0 0 3px var(--svk-red-light);
}

.search-hidden { display: none !important; }

/* Styled modal (jersey-number choice) */

.svk-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  padding: 1rem;
}

.svk-modal[hidden] { display: none; }

.modal-card {
  background: #fff;
  border-radius: var(--svk-radius);
  border-top: 4px solid var(--svk-red);
  padding: 1.4rem 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
}

.modal-card h3 { margin-bottom: 0.5rem; }

.modal-card p { font-size: 0.95rem; color: var(--svk-muted); }

.modal-actions { display: flex; gap: 0.5rem; margin-top: 1.1rem; }

.modal-actions .btn { flex: 1; text-align: center; }

/* "Darf allein nach Hause" badge on photos */

.home-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--svk-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.home-badge svg { width: 20px; height: 20px; }

.assess-line { display: flex; gap: 0.5rem; margin: 0.15rem 0 0; font-size: 0.85rem; }

.assess-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-weight: 800;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.assess-tag-pos { background: #e8f7ee; color: var(--svk-green); }
.assess-tag-neg { background: var(--svk-red-light); color: var(--svk-red); }

.assess-edit {
  border: 1px solid var(--svk-line);
  border-left: 4px solid var(--svk-red);
  border-radius: var(--svk-radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.assess-edit legend {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--svk-red);
  padding: 0 0.4rem;
}

/* --- Player cards --- */

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

.player-card {
  background: var(--svk-card);
  border-radius: var(--svk-radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--svk-line);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s, box-shadow 0.15s;
}

.player-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(208, 2, 27, 0.15); }

.player-photo-wrap { position: relative; }

.jersey-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--svk-red);
  color: #fff;
  font-weight: 800;
  font-style: italic;
  font-size: 1.1rem;
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.player-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--svk-red-light);
  display: block;
}

.player-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  font-style: italic;
  color: var(--svk-red);
}

.player-info { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; }

.player-head { display: flex; align-items: center; gap: 1.25rem; }

.player-photo-lg {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--svk-red);
  background: var(--svk-red-light);
  flex-shrink: 0;
}

.jersey-no { color: var(--svk-red); }

.photo-thumb { height: 60px; border-radius: 8px; vertical-align: middle; }

/* --- Tables --- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--svk-card);
  border-radius: var(--svk-radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.data-table th {
  background: var(--svk-red);
  color: #fff;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 1rem;
}

.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--svk-line);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--svk-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.back-link:hover { color: var(--svk-red); }

.check-cell { text-align: center; }
.check-cell input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--svk-red); cursor: pointer; }
.data-table tr:hover td { background: var(--svk-red-light); }
.data-table a { color: var(--svk-red); }

/* Icon action buttons (overview tables) */

.row-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  padding: 0;
  transition: border-color 0.12s, background 0.12s;
}

.icon-btn:hover {
  border-color: var(--svk-red);
  background: var(--svk-red-light);
}

.view-toggle {
  display: inline-flex;
  gap: 0.3rem;
}

.icon-btn.is-active {
  background: var(--svk-red);
  border-color: var(--svk-red);
  color: #fff;
}

.kit-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
/* --- Filter bar --- */

.filter-bar {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  background: var(--svk-card);
  border: 1px solid var(--svk-line);
  border-left: 4px solid var(--svk-red);
  border-radius: var(--svk-radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-field.sort-mobile { display: none; }

.filter-field label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--svk-muted);
}

.filter-bar select,
.filter-bar input[type="text"] {
  padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fff;
  min-width: 110px;
}

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--svk-red);
  box-shadow: 0 0 0 3px var(--svk-red-light);
}

.filter-bar .filter-nr { min-width: 0; width: 80px; }

.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.filter-actions .btn { padding: 0.45rem 0.9rem; font-size: 0.78rem; }

/* Sortable column headers */
.data-table th .sortlink {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sort-icon {
  font-size: 0.65rem;
  opacity: 0.45;
}

.sortlink:hover .sort-icon { opacity: 0.9; }
.sortlink.sorted .sort-icon { opacity: 1; font-size: 0.75rem; }

.kit-actions .inline-form { display: contents; }

.kit-actions select[name="player_id"] { flex: 1 1 100%; }

.kit-actions input[type="date"] { flex: 1 1 130px; min-width: 0; max-width: 150px; }

.kit-actions select,
.kit-actions input[type="date"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--svk-line);
  border-radius: 6px;
  font-size: 0.85rem;
}

/* --- Attendance --- */

.att-cell { text-align: center; }
.att-cell input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.att-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--svk-line);
  font-weight: 800;
  cursor: pointer;
  color: var(--svk-muted);
  transition: all 0.12s;
}

.att-cell input:checked + .att-present { background: var(--svk-green); border-color: var(--svk-green); color: #fff; }
.att-cell input:checked + .att-absent { background: var(--svk-red); border-color: var(--svk-red); color: #fff; }
.att-cell input:checked + .att-excused { background: var(--svk-amber); border-color: var(--svk-amber); color: #fff; }

/* --- Attendance overlay --- */

.att-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.att-overlay[hidden] { display: none; }

.att-modal {
  background: var(--svk-card);
  border-radius: var(--svk-radius);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.att-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.att-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-style: italic;
}

.att-count {
  background: var(--svk-green);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.9rem;
  margin-left: 0.4rem;
}

.att-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--svk-muted);
}
.att-close:hover { color: var(--svk-red); }

.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.att-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.5rem;
  border: 2px solid var(--svk-line);
  border-radius: var(--svk-radius);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}

.att-toggle:hover { border-color: var(--svk-red); }

.att-toggle.is-present {
  border-color: var(--svk-green);
  background: #e8f7ee;
}

.att-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--svk-red-light);
}

.att-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-style: italic;
  color: var(--svk-red);
  font-size: 1.1rem;
}

.att-name {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.att-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--svk-green);
  color: #fff;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.att-toggle.is-present .att-check { display: flex; }

.att-hint {
  margin: 1rem 0 0;
  color: var(--svk-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Attendance bar (training overview) */

.att-bar {
  position: relative;
  width: 100%;
  min-width: 90px;
  max-width: 160px;
  height: 22px;
  background: var(--svk-line);
  border-radius: 999px;
  overflow: hidden;
}

.att-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--svk-green), #22c55e);
  border-radius: 999px;
  transition: width 0.25s;
}

/* Mini red bars on player cards */

.att-bar-mini { height: 16px; min-width: 0; max-width: none; flex: 1; }
.att-bar-mini .att-bar-text { font-size: 0.65rem; }

.att-bar-red .att-bar-fill {
  background: linear-gradient(90deg, var(--svk-red-dark), var(--svk-red));
}

.player-bars { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.4rem; }

.att-bar-cell { min-width: 110px; }

/* Mobile table condensing: plain-text attendance count, short "issued" state */
.att-count-text, .kit-issued-short { display: none; }

/* Pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination-info {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--svk-muted);
}

.mini-bar-row { display: flex; align-items: center; gap: 0.5rem; }

.mini-bar-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-muted);
  width: 52px;
  flex-shrink: 0;
}

.att-bar-text {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--svk-ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

.att-table input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--svk-line);
  border-radius: 6px;
  font-size: 0.85rem;
}

/* --- Badges --- */

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-present { background: #e8f7ee; color: var(--svk-green); }
.badge-absent { background: var(--svk-red-light); color: var(--svk-red); }
.badge-excused { background: #fef3e2; color: var(--svk-amber); }
.badge-warn { background: #fef3e2; color: var(--svk-amber); }
.badge-cond-neu { background: #e8f7ee; color: var(--svk-green); }
.badge-cond-gut { background: #eff6ff; color: #2563eb; }
.badge-cond-gebraucht { background: #fef3e2; color: var(--svk-amber); }
.badge-cond-defekt { background: var(--svk-red-light); color: var(--svk-red); }
.badge-canceled { background: #3f3f46; color: #fff; }

.canceled-note {
  background: var(--svk-red-light);
  border-left: 4px solid var(--svk-red);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--svk-red-dark);
}

.row-canceled td { color: var(--svk-muted); }
.row-canceled .att-bar { opacity: 0.4; }

/* --- Forms --- */

.form-card {
  background: var(--svk-card);
  border-radius: var(--svk-radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--svk-line);
  max-width: 640px;
}

.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.field.checkbox-field { flex-direction: row; align-items: center; gap: 0.5rem; }
.field.checkbox-field input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--svk-red); cursor: pointer; margin: 0; }
.field.checkbox-field label { margin: 0; }
.invite-teams { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.check-inline { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; color: var(--svk-ink); }
.check-inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--svk-red); cursor: pointer; margin: 0; }
.field label { font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--svk-muted); }
.field-check { flex-direction: row; align-items: center; gap: 0.5rem; }
.field-check label { text-transform: none; color: var(--svk-ink); }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="file"],
.field select,
.field textarea {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--svk-red);
  box-shadow: 0 0 0 3px var(--svk-red-light);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row:has(> :nth-child(3)) { grid-template-columns: 1fr 1fr 1fr; }

.form-section {
  margin: 1.25rem 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-red);
  border-bottom: 2px solid var(--svk-red-light);
  padding-bottom: 0.4rem;
}

.form-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

.muted { color: var(--svk-muted); font-size: 0.85rem; }

/* --- Team hero photo --- */

.team-hero {
  border-radius: var(--svk-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--svk-line);
}

.team-hero img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

/* --- Match badges --- */

.badge-kind-spiel { background: var(--svk-red-light); color: var(--svk-red); }
.badge-kind-turnier { background: #fef3e2; color: var(--svk-amber); }
.badge-kind-training { background: #eef2f7; color: #475569; }
.amount-pos { color: var(--svk-green); font-weight: 700; }
.amount-neg { color: var(--svk-red); font-weight: 700; }

.badge-cat { background: #eef2f7; color: #475569; }

.badge-active { background: #e8f7ee; color: var(--svk-green); }
.badge-inactive { background: #eef2f7; color: #475569; }
.badge-result {
  background: var(--svk-red);
  color: #fff;
  font-size: 0.8rem;
}

/* --- Responsive --- */

@media (max-width: 700px) {
  /* Header: compact, nav behind a dropdown toggle */
  .svk-header { gap: 0.6rem; padding: 0.7rem 1rem; }
  .svk-logo { height: 32px; }
  .svk-club { font-size: 0.95rem; }
  .svk-sub { font-size: 0.68rem; }
  .svk-user { display: none; }
  .svk-auth { margin-left: auto; }
  .nav-toggle { display: inline-block; }
  .svk-nav {
    order: 3;
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }
  .svk-nav.open { display: flex; }
  .svk-nav a { padding: 0.65rem 0.8rem; font-size: 0.85rem; }

  .svk-main { padding: 1rem; }

  /* Headlines & cards smaller */
  .page-head h1 { font-size: 1.25rem; }
  .stat-value { font-size: 1.5rem; }
  .team-hero img { height: 140px; }
  .form-card { padding: 1rem; }
  .dash-card { padding: 0.9rem 1rem; }

  /* Tables stack into per-row cards — no horizontal scrolling */
  .data-table { font-size: 0.85rem; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tr { display: block; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--svk-line); }
  .data-table tr:last-child { border-bottom: none; }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border-bottom: none;
    padding: 0.28rem 0;
    text-align: right;
  }
  .data-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--svk-muted);
    text-align: left;
    flex-shrink: 0;
  }
  .data-table td.td-actions { display: block; text-align: left; }
  .data-table td.td-actions::before { content: none; }
  .data-table td.td-actions .row-actions,
  .data-table td.td-actions .kit-actions { justify-content: flex-start; }
  .data-table td .muted { white-space: normal; }

  /* Condensed cells: hide detail columns, swap bars/names for counts/badges */
  .data-table td.cell-hide { display: none; }
  .data-table td .att-bar-cell { display: none; }
  .data-table .att-count-text { display: inline; font-weight: 700; }
  .data-table .kit-issued-full { display: none; }
  .data-table .kit-issued-short { display: inline-block; }

  /* Forms single column */
  .form-row { grid-template-columns: 1fr; }

  /* Filter bar fields stretch; mobile sort controls appear */
  .filter-field { flex: 1 1 45%; }
  .filter-field.sort-mobile { display: flex; }
  .filter-field select, .filter-field input { width: 100%; min-width: 0; }
  .filter-actions { margin-left: 0; width: 100%; }
  .filter-actions .btn { flex: 1; text-align: center; }

  /* Player header stacks, attendance modal denser */
  .player-head { flex-direction: column; align-items: flex-start; }
  .att-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .att-photo { width: 48px; height: 48px; }
  .att-modal { padding: 1rem; }

  .kit-actions select[name="player_id"] { flex: 1 1 100%; }
  .kit-actions input[type="date"] { flex: 1 1 100px; max-width: none; }
}

/* --- Settings matrix --- */
.matrix-card { max-width: 860px; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.matrix-table { width: 100%; table-layout: fixed; }
.matrix-table td, .matrix-table th { text-align: center; }
.matrix-table td:first-child, .matrix-table th:first-child { text-align: left; width: 38%; }
.matrix-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--svk-red); cursor: pointer; }

@media (max-width: 700px) {
  /* Keep the matrix a real table on mobile — 5 checkbox cols fit without scrolling */
  .matrix-card { padding: 0.9rem; }
  .matrix-table thead { display: table-header-group; }
  .matrix-table tbody { display: table-row-group; }
  .matrix-table tr { display: table-row; padding: 0; }
  .matrix-table td { display: table-cell; padding: 0.5rem 0.15rem; border-bottom: 1px solid var(--svk-line); text-align: center; }
  .matrix-table td::before { content: none; }
  .matrix-table td:first-child, .matrix-table th:first-child { text-align: left; width: 34%; }
  .matrix-table th { font-size: 0.62rem; padding: 0.4rem 0.1rem; }
  .matrix-table td:first-child { font-size: 0.78rem; }
  .matrix-table input[type="checkbox"] { width: 16px; height: 16px; }
}

/* --- Clubs / JFM --- */
.color-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--svk-line); vertical-align: middle; }
.club-logo-thumb { height: 28px; width: 28px; object-fit: contain; border-radius: 6px; vertical-align: middle; margin-right: 6px; }
.club-initial { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.club-initial-bg { background: var(--svk-red); }
.club-initial-sm { width: 28px; height: 28px; font-size: .9rem; }
.jfm-hero { text-align: center; margin: 2rem 0 1.5rem; }
.jfm-hero h1 { margin-bottom: .4rem; }

.jfm-app-download { margin-top: 1.2rem; }
.jfm-app-title {
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--svk-muted);
}
.jfm-store-badges { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
  text-decoration: none;
  line-height: 1.15;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.store-badge svg { width: 24px; height: 24px; fill: #fff; flex-shrink: 0; }
.store-badge span { display: flex; flex-direction: column; align-items: flex-start; }
.store-badge small { font-size: 0.6rem; font-weight: 500; opacity: 0.75; }
a.store-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.store-badge-disabled { opacity: 0.45; cursor: default; }
.jfm-login-card { margin: 0 auto; }
.form-error { color: var(--svk-red); font-size: 0.82rem; }
.role-select { padding: 0.3rem 0.5rem; border: 1.5px solid var(--svk-line); border-radius: 8px; font-size: 0.85rem; }
.user-create { margin-bottom: 0; }

/* Confirmation modal */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: confirmFade 0.15s ease;
}
@keyframes confirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-card {
  background: var(--svk-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 28px 28px 22px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: confirmPop 0.15s ease;
}
@keyframes confirmPop {
  from { transform: scale(0.94) translateY(6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.confirm-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--svk-red);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.confirm-msg {
  margin: 0 0 20px;
  color: #333;
  font-size: 0.98rem;
  line-height: 1.45;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-actions .btn {
  min-width: 120px;
}

/* JFM brand logo */
.jfm-logo {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 14px;
}
.svk-logo-round {
  border-radius: 8px;
  background: #fff;
}

/* Attendance: compact one-row layout on mobile */
.att-notebtn-cell { display: none; }
.att-note-btn {
  border: 1.5px solid var(--svk-line);
  background: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0.45;
}
.att-note-btn.has-note { opacity: 1; }

@media (max-width: 700px) {
  .att-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.6rem;
  }
  .att-table td {
    display: block;
    padding: 0;
    text-align: left;
  }
  .att-table td::before { content: none; }
  .att-table .att-name-cell {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
  }
  .att-table .att-name-cell strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .att-table .att-cell { flex: none; }
  .att-table .att-notebtn-cell { display: block; flex: none; }
  .att-table .att-note-cell { display: none; flex: 1 1 100%; padding-top: 4px; }
  .att-table tr.note-open .att-note-cell { display: block; }
}

/* --- Training plans --- */

.plan-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1.5rem 0 0.75rem;
  border-bottom: 2px solid var(--svk-red-light);
  padding-bottom: 0.4rem;
}
.plan-editor-head h3 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-red);
}

.plan-item {
  border: 1px solid var(--svk-line);
  border-radius: var(--svk-radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.plan-item-top {
  display: grid;
  grid-template-columns: 130px 1fr 80px auto;
  gap: 0.5rem;
  align-items: center;
}
.plan-item-top select,
.plan-item-top input,
.plan-item textarea {
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.plan-item textarea {
  margin-top: 0.5rem;
  resize: vertical;
}
.plan-item-top select:focus,
.plan-item-top input:focus,
.plan-item textarea:focus {
  outline: none;
  border-color: var(--svk-red);
  box-shadow: 0 0 0 3px var(--svk-red-light);
}
.plan-item-moves { display: flex; gap: 0.25rem; }
.plan-item-moves .icon-btn { width: 30px; height: 30px; font-size: 0.85rem; }
.plan-form-actions { margin-top: 1.25rem; display: flex; gap: 0.5rem; }

/* Phase grouping (plan detail + session view) */

.plan-phase { margin-bottom: 1.25rem; }
.plan-phase-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--svk-red-light);
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
}
.phase-badge {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--svk-red);
}
.badge-duration {
  background: #eef2f7;
  color: #475569;
  font-size: 0.75rem;
}

.plan-item-view {
  background: var(--svk-card);
  border: 1px solid var(--svk-line);
  border-radius: var(--svk-radius);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
}
.plan-item-title { display: flex; align-items: center; gap: 0.5rem; }
.plan-item-desc { margin: 0.3rem 0 0; font-size: 0.88rem; }
.item-coaching {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--svk-muted);
  font-style: italic;
}

/* Session plan execution (check / note / rating) */

.sess-plan { margin-top: 2rem; }
.sess-plan .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sess-plan .section-head h2 { margin: 0; font-size: 1.05rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }

.sess-item {
  background: var(--svk-card);
  border: 1px solid var(--svk-line);
  border-radius: var(--svk-radius);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}
.sess-item-main {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.item-check {
  flex: none;
  width: 30px;
  height: 30px;
  border: 2px solid var(--svk-line);
  border-radius: 8px;
  background: #fff;
  color: transparent;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.item-check.checked {
  background: var(--svk-green);
  border-color: var(--svk-green);
  color: #fff;
}
.sess-item-text { flex: 1 1 auto; min-width: 0; font-size: 0.92rem; }
.item-done .sess-item-text strong { text-decoration: line-through; color: var(--svk-muted); }
.item-desc { font-size: 0.85rem; margin-top: 0.15rem; }

.item-stars { flex: none; display: flex; gap: 2px; }
.item-star {
  border: none;
  background: none;
  font-size: 1.25rem;
  color: var(--svk-line);
  cursor: pointer;
  padding: 0 1px;
  line-height: 1;
}
.item-star.on { color: var(--svk-amber); }

.item-note {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}
.item-note:focus {
  outline: none;
  border-color: var(--svk-red);
  box-shadow: 0 0 0 3px var(--svk-red-light);
}

@media (max-width: 700px) {
  .plan-item-top { grid-template-columns: 1fr 70px; }
  .plan-item-top .item-phase { grid-column: 1 / -1; }
  .plan-item-moves { grid-column: 1 / -1; justify-content: flex-end; }
  .sess-item-main { flex-wrap: wrap; }
  .item-stars { margin-left: auto; }
}

/* --- Übungsbibliothek --- */

.practice-search { margin-bottom: 0.5rem; }
.practice-q {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.practice-q:focus {
  outline: none;
  border-color: var(--svk-red);
  box-shadow: 0 0 0 3px var(--svk-red-light);
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.practice-card {
  background: var(--svk-card);
  border: 1px solid var(--svk-line);
  border-radius: var(--svk-radius);
  padding: 0.65rem 0.85rem;
}
.practice-name { display: flex; align-items: center; gap: 0.5rem; }
.practice-desc {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  color: var(--svk-muted);
  line-height: 1.45;
}

.phase-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.phase-progress { font-variant-numeric: tabular-nums; }

/* Phase filter chips + pager (Übungsbibliothek) */

.practice-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.chip {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--svk-line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--svk-ink);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s;
}
.chip:hover { border-color: var(--svk-red); }
.chip-on {
  background: var(--svk-red);
  border-color: var(--svk-red);
  color: #fff;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
}
.icon-btn-disabled {
  opacity: 0.35;
  cursor: default;
}

/* --- JFM landing --- */

.jfm-login-card { margin: 0 auto 1.5rem; }
.jfm-byline { margin: 0.3rem 0 0; font-size: 0.8rem; }
.jfm-byline a { color: inherit; text-decoration: none; opacity: 0.75; }
.jfm-byline a:hover { opacity: 1; text-decoration: underline; }
.jfm-feature-list { margin: 0.3rem 0 1rem; padding-left: 1.2rem; font-size: 0.9rem; }
.jfm-feature-list li { margin-bottom: 0.4rem; }

.jfm-request-card { padding: 0; }
.jfm-request-card summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.jfm-request-card summary::-webkit-details-marker { display: none; }
.jfm-req-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.jfm-req-chevron {
  font-size: 1.3rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.jfm-request-card[open] .jfm-req-chevron { transform: rotate(180deg); }
.jfm-req-body { padding: 0 1.2rem 1.2rem; }
.td-message { max-width: 320px; white-space: pre-wrap; }

/* --- Collapsible attendance --- */

.att-collapse summary {
  cursor: pointer;
  list-style: none;
  padding: 0.6rem 0;
}
.att-collapse summary::-webkit-details-marker { display: none; }
.att-collapse[open] .jfm-req-chevron { transform: rotate(180deg); }
.att-collapse-body { margin-bottom: 1rem; }

/* --- Nav groups: desktop dropdown, flattened on mobile --- */

.nav-group { position: relative; display: flex; }
.nav-group-label {
  background: none;
  border: none;
  font: inherit;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-group-label:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.nav-group-label.active { background: #fff; color: var(--svk-red); }
.nav-caret { font-size: 0.65rem; }
.nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 11rem;
  background: var(--svk-red-dark);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 60;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub { display: flex; }
.nav-sub a { display: block; white-space: nowrap; }

@media (max-width: 700px) {
  /* Flatten groups completely — the hover/focus-within dropdown rules must be
     overridden too, else tapping a link re-opens an absolute-positioned sub
     and swallows the click. */
  .nav-group,
  .nav-sub,
  .nav-group:hover .nav-sub,
  .nav-group:focus-within .nav-sub { display: contents; }
  .nav-group-label { display: none; }
}

/* --- Team switcher in the header sub-line --- */

.team-switch { position: relative; display: inline-block; }
.team-switch-btn {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.team-switch-btn:hover { background: rgba(255, 255, 255, 0.15); }
.team-switch-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 7rem;
  background: var(--svk-red-dark);
  border-radius: 8px;
  padding: 0.25rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 70;
  flex-direction: column;
  text-transform: none;
}
.team-switch:hover .team-switch-menu,
.team-switch:focus-within .team-switch-menu { display: flex; }
.team-switch-menu a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}
.team-switch-menu a:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.team-switch-menu a.active { background: #fff; color: var(--svk-red); }

/* --- Attendance overlay: absent (double-tap) state --- */

.att-toggle.is-absent {
  border-color: var(--svk-red);
  background: #fbe9eb;
}
.att-mark-absent { background: var(--svk-red); }
.att-toggle.is-absent .att-mark-absent { display: flex; }
.att-toggle.is-present .att-mark-absent { display: none; }
.att-toggle.is-absent .att-mark-present { display: none; }

.att-toggle.is-excused {
  border-color: var(--svk-amber);
  background: #fdf3e0;
}
.att-mark-excused { background: var(--svk-amber); }
.att-toggle.is-excused .att-mark-excused { display: flex; }
.att-toggle.is-excused .att-mark-present,
.att-toggle.is-excused .att-mark-absent { display: none; }
.att-toggle.is-present .att-mark-excused,
.att-toggle.is-absent .att-mark-excused { display: none; }
