:root {
  --bg: #0b1220;
  --panel: #111827;
  --panel2: #172033;
  --yellow: #ffd500;
  --blue: #1e40af;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --red: #ef4444;
  --line: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(160deg, #050816, #111827);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--yellow);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Header & Hauptnavigation ── */
header.top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #050816;
  border-bottom: 3px solid var(--yellow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-name {
  white-space: nowrap;
}

.brand-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: min(280px, 55vw);
  object-fit: contain;
}

.logoMark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: #07111f;
  border-radius: 12px;
  width: 54px;
  height: 38px;
  font-weight: 900;
  flex-shrink: 0;
}

nav.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

nav.main-nav a {
  display: inline-block;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
}

nav.main-nav a:hover {
  background: var(--blue);
  text-decoration: none;
}

nav.main-nav a.nav-auth {
  color: #FFD500;
}

nav.main-nav a.nav-auth:hover {
  color: #ffe655;
}

/* ── Admin-Navigation (horizontal) ── */
.admin-top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
}

.admin-top-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--yellow);
  margin-right: 4px;
}

.admin-top-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.admin-top-links a {
  display: inline-block;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.admin-top-links a:hover {
  background: var(--blue);
  text-decoration: none;
}

.admin-top-links a.nav-logout {
  color: var(--muted);
}

.admin-top-nav .admin-nav-text.nav-logout {
  margin-left: 8px;
  flex-shrink: 0;
}

.admin-top-nav .admin-nav-help {
  flex-shrink: 0;
  margin-left: 4px;
}

.admin-top-links a.nav-logout:hover {
  color: #fff;
}

.admin-content {
  min-width: 0;
}

/* ── Layout ── */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.hero .home-rich > p {
  color: var(--muted, #9aa4b2);
}

.home-rich p {
  margin: 0 0 10px;
}

.home-rich p:last-child {
  margin-bottom: 0;
}

.home-rich h3 {
  margin: 14px 0 8px;
  font-size: 1.05rem;
  color: var(--yellow);
}

.home-rich ul,
.home-rich ol {
  margin: 0 0 10px;
  padding-left: 1.2em;
}

.home-rich li {
  margin-bottom: 4px;
}

.home-rich a {
  color: var(--yellow);
}

.home-rich table {
  margin-top: 8px;
}

.card,
.panel {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* ── Buttons & Formulare ── */
.btn,
button,
input[type="submit"] {
  background: var(--yellow);
  color: #07111f;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  font-size: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.secondary,
button.btn.secondary {
  background: var(--yellow);
  color: #07111f;
  box-shadow: inset 0 0 0 2px rgba(7, 17, 31, 0.15);
}

.btn.live-on {
  background: #22c55e;
  color: #fff;
}

.btn.live-off {
  background: var(--red);
  color: #fff;
}

.copy-link {
  width: 100%;
  margin-top: 6px;
  font-size: 0.9rem;
}

.copy-link-sm {
  min-width: 180px;
  max-width: 220px;
  font-size: 0.75rem;
  padding: 6px 8px;
}

.tournament-info-box {
  margin-bottom: 16px;
}

.form-hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
}

.input-date-de {
  max-width: 11em;
}

/* Datum-Picker: Icon in Schriftfarbe (--text / #f8fafc) */
input[type="date"] {
  color: var(--text);
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.25em;
  height: 1.25em;
  padding: 0;
  margin: 0;
  filter: none;
  /* Eigenes weisses Kalender-Icon (gleiche Farbe wie --text) */
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f8fafc'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6c0-1.11-.89-2-2-2zm0 16H5V10h14v10zM5 8V6h14v2H5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.2em 1.2em;
  /* Native-Glyph ausblenden, nur unser SVG zeigen */
  color: transparent;
}

.btn.active-badge {
  background: #22c55e;
  color: #fff;
  cursor: default;
}

.btn.active-badge[disabled] {
  background: #eab308;
  color: #1f2937;
  opacity: 1;
}

.btn.danger {
  background: var(--red);
  color: #fff;
}

.btn.danger:disabled {
  background: #ef4444;
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
}

button:disabled:not(.danger),
.btn:disabled:not(.danger) {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: #fff;
  font-size: inherit;
}

label {
  display: block;
  margin: 10px 0 5px;
}

.muted {
  color: var(--muted);
}

/* ── Tabellen ── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #0f172a;
}

.table th,
.table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #172033;
  color: #fff;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.match-table .col-time {
  white-space: nowrap;
  min-width: 4.8em;
}

tr.time-slot-0 {
  background-color: #0f172a;
}

tr.time-slot-1 {
  background-color: #1e2d4a;
}

tr.bye.time-slot-0 {
  background: rgba(255, 213, 0, 0.2) !important;
}

tr.bye.time-slot-1 {
  background: rgba(255, 213, 0, 0.35) !important;
}

.match-table tr.round-slot-0:not(.highlight) {
  background-color: #0f172a;
}

.match-table tr.round-slot-1:not(.highlight) {
  background-color: #1e2d4a;
}

.match-table tr.bye.round-slot-0 {
  background: rgba(255, 213, 0, 0.2) !important;
}

.match-table tr.bye.round-slot-1 {
  background: rgba(255, 213, 0, 0.35) !important;
}

/* ── Turnier / Live ── */
.roundbar .round-status.status-inaktiv { color: #fff; font-weight: 900; }
.roundbar .round-status.status-live { color: #22c55e; font-weight: 900; }
.roundbar .round-status.status-abgeschlossen { color: #ef4444; font-weight: 900; }

.roundbar .round-status.status-freigegeben { color: var(--yellow); font-weight: 900; }

.status-inaktiv { color: #fff; font-weight: 900; }
.status-live { color: #22c55e; font-weight: 900; }
.status-freigegeben { color: var(--yellow); font-weight: 900; }
.status-abgeschlossen { color: #ef4444; font-weight: 900; }
.status-gesperrt { color: var(--red); font-weight: 900; }
.bye { background: rgba(255, 213, 0, 0.25) !important; }
.highlight { background: rgba(255, 213, 0, 0.22) !important; border-left: 5px solid var(--yellow); }
.locked { opacity: 0.7; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.roundbar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.roundbtn {
  font-size: 22px;
  background: #172033;
  color: #fff;
  border: 1px solid var(--line);
  padding: 4px 12px;
}

.round-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 16px;
}

.round-chip {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid var(--line);
  font-size: 1rem;
}

.round-chip-inactive {
  background: #fff;
  color: #07111f;
}

.round-chip-live {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
}

.round-chip-completed {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}

.round-chip-unlocked {
  background: var(--yellow);
  color: #07111f;
  border-color: #c9a800;
}

.round-chip-blink,
.btn-blink {
  animation: round-blink 1s ease-in-out infinite;
}

@keyframes round-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 213, 0, 0.8); }
  50% { opacity: 0.55; box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.35); }
}

.score-save-hint {
  margin-top: 10px;
  font-size: 0.9rem;
}

.admin-score.is-saving {
  opacity: 0.6;
}

.admin-score.is-saved {
  outline: 2px solid #22c55e;
  outline-offset: 1px;
}

.admin-score.is-error {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.round-chip.is-current {
  box-shadow: 0 0 0 4px var(--yellow);
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.team-status-summary {
  line-height: 1.6;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border-left: 3px solid var(--yellow);
}

.team-stand-mini {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.team-stand-mini.is-provisional {
  color: var(--yellow);
  font-weight: 800;
}

.pair-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
}

.member-type-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.member-types-field {
  grid-column: 1 / -1;
}

.type-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.type-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.type-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.type-add-form input[name="new_member_type"] {
  width: 220px;
  max-width: 100%;
}

.category-rename-form input[name="new_name"] {
  width: 180px;
  max-width: 100%;
}

.category-rename-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.teamcheck {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.teamcheck input {
  width: auto;
  transform: scale(1.2);
}

.teamcheck.is-used {
  opacity: 0.45;
  color: var(--muted);
}

.teamcheck.is-used input:disabled {
  cursor: not-allowed;
}

.team-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.5);
}

.toolbar {
  margin: 12px 0 4px;
}

.toolbar .btn-test-scores {
  margin-left: auto;
}

.toolbar-form .toolbar-hint {
  margin: 0 0 16px;
  font-size: 14px;
}

.inline-form {
  display: inline;
}

.inline-form select {
  width: auto;
  display: inline-block;
}

.round-num {
  padding: 8px 14px;
}

.tournament-form {
  margin-top: 12px;
}

.tournament-pause-fields {
  display: contents;
}

.tournament-pause-fields.is-hidden {
  display: none;
}

.test-teams-box {
  margin: 20px 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.4);
}

.test-teams-box h3 {
  margin: 0 0 8px;
}

.live-mobile {
  max-width: 760px;
}

.bigselect {
  font-size: 18px;
  padding: 14px;
}

.standings-table th:nth-child(n+3),
.standings-table td:nth-child(n+3) {
  text-align: center;
  white-space: nowrap;
}

.standings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.standings-head h2 {
  margin: 0;
}

.btn-standings-details {
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--yellow);
  color: #111;
  border-color: var(--yellow);
}

.standings-table tr.standings-rank-1 td {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.28), rgba(255, 215, 0, 0.08));
  color: #ffe566;
  font-weight: 800;
}

.standings-table tr.standings-rank-2 td {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.28), rgba(192, 192, 192, 0.08));
  color: #e8e8e8;
  font-weight: 800;
}

.standings-table tr.standings-rank-3 td {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.32), rgba(205, 127, 50, 0.1));
  color: #f0b27a;
  font-weight: 800;
}

.standings-legend {
  margin: 16px 0 24px;
  padding: 14px 16px;
  background: rgba(23, 32, 51, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}

.standings-legend ul {
  margin: 8px 0;
  padding-left: 20px;
}

.standings-legend li {
  margin: 4px 0;
}

.standings-legend p {
  margin: 6px 0;
}

/* ── Hinweise ── */
.notice {
  border-left: 5px solid var(--yellow);
  padding: 12px;
  background: #172033;
  border-radius: 8px;
  margin: 12px 0;
}

.notice-success { border-left-color: #22c55e; }
.notice-error { border-left-color: var(--red); }

.notice-registration {
  border-left-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(255, 213, 0, 0.08));
  padding: 16px 18px;
}

.notice-registration-lead {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
}

.notice-registration-hint {
  margin: 0;
  color: #dbeafe;
  line-height: 1.45;
}

.notice-readonly {
  border-left-color: #94a3b8;
}

/* ── Sponsoren ── */
.sponsor-grid {
  align-items: center;
  text-align: center;
}

.sponsor-item img {
  max-height: 50px;
  max-width: 140px;
  display: block;
  margin: 0 auto 8px;
}

footer,
.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.site-footer .footer-links {
  margin: 10px 0 0;
}

.site-footer .footer-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-page h2 {
  margin-top: 1.4em;
}

.privacy-page ul {
  padding-left: 1.25em;
}

/* ── Mobile ── */
@media (max-width: 900px) {
  header.top {
    flex-direction: column;
    align-items: stretch;
  }

  nav.main-nav {
    justify-content: flex-start;
  }

  .admin-top-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-top-links a.nav-logout {
    margin-left: 0;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    width: 100%;
  }

  .admin-top-nav .admin-nav-text.nav-logout {
    margin-left: 0;
  }

  .admin-top-nav .admin-nav-help {
    margin-left: auto;
    margin-top: 8px;
  }
}

@media (max-width: 760px) {
  .hero,
  .pair-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 14px;
  }

  .table {
    font-size: 14px;
  }

  .table th,
  .table td {
    padding: 6px;
  }

  .live-mobile h2 {
    font-size: 22px;
  }

  nav.main-nav a {
    padding: 8px 10px;
    font-size: 15px;
  }

  .register-head {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-live-nav {
    align-self: flex-start;
  }
}

/* ── Plauschturnier Kopf ── */
.register-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.register-head-main h1 {
  margin: 0 0 8px;
}

.head-tournament-name {
  font-weight: 700;
  color: var(--yellow);
}

.register-meta {
  margin: 0 0 6px;
  color: var(--muted);
}

.register-meta-when {
  margin: 10px 0 12px;
  font-size: 1.28rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.register-head-main .register-meta-when b {
  font-weight: 800;
  color: #fff;
}

.register-meta-deadline {
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.register-meta-deadline p {
  margin: 0 0 4px;
}

.register-meta-deadline p:last-child {
  margin-bottom: 0;
}

.register-meta-status {
  margin: 0;
}

.register-status-info {
  color: var(--muted);
  line-height: 1.45;
}

.btn-live-nav {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Kiosk Live ── */
body.kiosk-mode {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.kiosk-mode main {
  flex: 1;
  min-height: 0;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

/* Öffentliche Live-Seite: normales Scrollen (nicht wie Kiosk fixiert) */
body.kiosk-mode.live-focus {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body.kiosk-mode.live-focus main {
  flex: none;
  min-height: auto;
  overflow: visible;
  padding-bottom: 20px;
}

.kiosk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 3px solid var(--yellow);
  background: #0f172a;
  flex-shrink: 0;
  z-index: 20;
}

.kiosk-top h1 {
  margin: 0;
  font-size: 1.5rem;
}

.kiosk-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.kiosk-footer {
  text-align: center;
  color: var(--muted);
  padding: 12px 20px;
  font-size: 14px;
  flex-shrink: 0;
}

body.kiosk-mode.kiosk-live-entry {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.kiosk-mode.kiosk-live-entry main {
  flex: 1;
  min-height: 0;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.kiosk-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 8px 10px;
  overflow: hidden;
  border-top: 3px solid var(--yellow);
}

.kiosk-sticky-head {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 52px 8px 12px;
  border-bottom: 1px solid var(--line);
  min-height: 3.2rem;
  overflow: visible;
  z-index: 5;
}

.kiosk-countdown-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.kiosk-head-help {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 6;
  flex-shrink: 0;
}

.kiosk-countdown {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--yellow);
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transform-origin: center center;
  touch-action: none;
  display: inline-block;
}

.kiosk-countdown.is-pause {
  color: #fff;
  text-shadow: 0 0 0.4em rgba(255, 213, 0, 0.45);
}

.kiosk-table-header {
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #172033;
}

.kiosk-games-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.kiosk-games-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.kiosk-table-head,
.kiosk-table-body {
  width: 100%;
  table-layout: fixed;
  margin: 0;
}

.kiosk-table-head,
.kiosk-table-body {
  width: 100%;
  table-layout: fixed;
  margin: 0;
}

.kiosk-table col.k-col-round { width: 10%; }
.kiosk-table col.k-col-time { width: 12%; }
.kiosk-table col.k-col-court { width: 8%; }
.kiosk-table col.k-col-name { width: 21%; }
.kiosk-table col.k-col-score { width: 11%; }
.kiosk-table col.k-col-sep { width: 4%; }

.kiosk-table-head th {
  padding: 6px 4px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kiosk-table .k-col-round,
.kiosk-table-body td.k-col-round {
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.kiosk-table .k-col-time,
.kiosk-table-body td.k-col-time {
  padding-left: 4px;
  padding-right: 4px;
}

.kiosk-table .k-col-court,
.kiosk-table-body td.k-col-court {
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.kiosk-table .k-col-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kiosk-table tr.kiosk-row td {
  padding: 6px 4px;
  vertical-align: middle;
}

.kiosk-table .kiosk-score-cell {
  padding: 4px 2px;
  text-align: center;
  overflow: hidden;
}

.kiosk-table .kiosk-score-sep {
  padding: 4px 1px;
  text-align: center;
  width: auto;
}

.kiosk-table input.kiosk-score {
  width: 100%;
  max-width: 2.75em;
  min-width: 0;
  margin: 0 auto;
  display: block;
  padding: 4px 1px;
  text-align: center;
  font-size: 15px;
  line-height: 1.2;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
}

.kiosk-table input.kiosk-score::-webkit-outer-spin-button,
.kiosk-table input.kiosk-score::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.kiosk-table tr.time-slot-0:not(.highlight) {
  background-color: #0f172a;
}

.kiosk-table tr.time-slot-1:not(.highlight) {
  background-color: #1e2d4a;
}

.kiosk-table tr.bye.time-slot-0 {
  background: rgba(255, 213, 0, 0.2) !important;
}

.kiosk-table tr.bye.time-slot-1 {
  background: rgba(255, 213, 0, 0.35) !important;
}

.kiosk-save-hint-fixed {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 12px 10px;
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

.kiosk-table input.kiosk-score.is-saving {
  opacity: 0.6;
}

.kiosk-table input.kiosk-score.is-saved {
  outline: 2px solid #22c55e;
  outline-offset: 1px;
}

.kiosk-table input.kiosk-score.is-error {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.kiosk-save-hint {
  margin-top: 10px;
  font-size: 0.9rem;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.btn-icon-kiosk {
  background: transparent;
  color: var(--yellow);
  border: 0;
  padding: 4px;
  line-height: 0;
  vertical-align: middle;
}

.btn-icon-kiosk svg {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-icon-kiosk:hover {
  color: #ffe566;
}

.kiosk-unlock-cell {
  text-align: center;
  white-space: nowrap;
}

.kiosk-unlocked-mark {
  color: var(--yellow);
  font-weight: 900;
}

.tournament-status-help ul {
  margin: 8px 0;
  padding-left: 20px;
}

.register-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0 8px;
}

.register-choice-btn {
  flex: 1 1 220px;
  text-align: center;
  justify-content: center;
  font-size: 1.05rem;
  padding: 14px 18px;
}

.password-field {
  margin-bottom: 0;
}

.password-field-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.password-field-row input {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(15, 23, 42, 0.7);
  color: var(--yellow);
  cursor: pointer;
  padding: 0;
}

.password-toggle:hover {
  background: rgba(255, 213, 0, 0.12);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* Formularreihen: feste 4-Spalten-Basis (wie Admin Team bearbeiten) */
.form-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

/* Profil / Benutzer: 2–3 Spalten */
.profile-account-form .form-row-3,
.member-form .form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-account-form .form-row-2,
.member-form .form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row-1 {
  grid-template-columns: 1fr;
}

/* Generischer 2-/3-Spalten-Zeilenblock (z. B. Dokumente, Sponsoren) */
.admin-form-row {
  display: grid;
  gap: 12px;
  align-items: end;
  margin: 10px 0;
}

.admin-form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sponsor-tournament-checks {
  max-height: 130px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.5);
}

.sponsor-tournament-checks .teamcheck {
  margin: 2px 0;
}

@media (max-width: 700px) {
  .admin-form-row-2,
  .admin-form-row-3,
  .admin-form-row-4 {
    grid-template-columns: 1fr;
  }
}

/* Benutzerverwaltung */
.users-table-scroll {
  max-height: 22.5rem; /* ~ Header + 5 Datenzeilen */
  min-height: 9rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  background: #0f172a;
}

.teams-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  background: #0f172a;
  overflow: visible;
}

.users-admin-table {
  margin: 0;
}

.users-admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #152238;
  vertical-align: top;
  padding: 8px 10px;
  box-shadow: 0 1px 0 var(--line);
}

.users-col-title {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
  white-space: nowrap;
}

.users-col-filter {
  width: 100%;
  min-width: 0;
  padding: 6px 8px !important;
  font-size: 13px !important;
  font-weight: 400;
}

.users-filter-dd {
  position: relative;
}

.users-filter-dd-toggle {
  width: 100%;
  padding: 6px 8px !important;
  font-size: 13px !important;
  font-weight: 600;
  text-align: left;
  background: #0f172a !important;
  color: #fff !important;
  border: 1px solid var(--line) !important;
}

.users-filter-dd-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 220px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  background: #152238;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.users-filter-dd-menu.is-fixed {
  position: fixed;
  z-index: 500;
}

.users-filter-select-all {
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  padding-bottom: 8px;
}

.users-filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 2px;
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
}

.users-filter-check input {
  width: auto;
  margin: 0;
}

.users-filter-check-muted {
  color: var(--muted);
}

.users-column-options {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.users-column-options .users-filter-dd-menu {
  right: 0;
  left: auto;
}

.users-cell-na {
  color: var(--muted);
  opacity: .55;
}

.users-admin-table th[hidden],
.users-admin-table td[hidden] {
  display: none;
}

.users-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.users-row-actions .inline-form {
  margin: 0;
}

.users-panel-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
  overflow-x: auto;
}

.users-panel-actions .btn,
.users-panel-actions button,
.users-panel-actions select {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.users-mail-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.users-panel-actions .users-mail-template {
  min-width: 180px;
  max-width: 260px;
}

.phone-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.phone-input-row .phone-cc {
  width: 5.5rem;
  flex: 0 0 auto;
}

.phone-input-row .phone-national {
  flex: 1 1 auto;
  min-width: 0;
}

.team-edit-firstname-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 1.25rem;
}

.team-edit-firstname-label .team-edit-captain-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.team-edit-firstname-label .team-edit-captain-icon.is-hidden {
  visibility: hidden;
}

.team-edit-firstname-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-edit-firstname-row .team-edit-captain-radio {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--accent, #3b82f6);
  cursor: pointer;
}

.team-edit-firstname-row input[type="text"],
.team-edit-firstname-row input:not([type="radio"]) {
  flex: 1 1 auto;
  min-width: 0;
}

.team-captain-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 4px 0 8px;
}

.team-captain-pick-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.team-captain-pick .team-captain-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.phone-with-whatsapp {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.phone-with-whatsapp .phone-input-row {
  flex: 1 1 12rem;
}

.users-select-col {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.users-select-col input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--yellow);
}

.users-admin-table thead .users-select-col {
  vertical-align: middle;
}

.users-panel {
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.users-form-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.users-form-submit .btn,
.users-form-submit button {
  width: auto;
  align-self: center;
  padding: 10px 16px;
}

.member-form .password-field {
  width: 100%;
}

.users-filter-hint {
  margin-top: -4px;
}

.team-edit-grid label,
.profile-account-form label {
  font-size: 12px;
  margin: 0 0 2px;
  display: block;
}

.team-edit-grid input,
.team-edit-grid select,
.profile-account-form input {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.profile-account-form .form-row p {
  margin: 0;
}

@media (max-width: 700px) {
  .form-row,
  .profile-account-form .form-row-2,
  .profile-account-form .form-row-3,
  .member-form .form-row-2,
  .member-form .form-row-3 {
    grid-template-columns: 1fr;
  }
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  min-width: 36px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-icon-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: auto;
  filter: saturate(0.65);
}

.users-row-actions {
  white-space: nowrap;
}

.checkbox-dropdown {
  width: 100%;
}

.roles-matrix-scroll {
  overflow: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.roles-matrix-table {
  margin: 0;
  min-width: 720px;
}

.roles-matrix-table th,
.roles-matrix-table td {
  text-align: center;
  vertical-align: middle;
}

.roles-matrix-table th[scope="row"] {
  text-align: left;
  white-space: nowrap;
}

.roles-matrix-table th.roles-area-admin {
  color: var(--yellow);
  font-weight: 700;
}

.roles-matrix-table th.roles-area-other {
  color: #fff;
  font-weight: 600;
}

.roles-matrix-legend {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.perm-toggle.is-readonly {
  cursor: default;
  pointer-events: none;
}

.roles-matrix-cell {
  padding: 6px !important;
}

.perm-toggle {
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 10px;
  border: 1px solid var(--line) !important;
  background: #0f172a !important;
  font-size: 1.25rem;
  line-height: 1;
}

.perm-toggle.is-allowed {
  color: #22c55e !important;
}

.perm-toggle.is-denied {
  color: #ef4444 !important;
}

.perm-toggle.is-allowed .perm-icon-no,
.perm-toggle.is-denied .perm-icon-ok {
  display: none;
}

.perm-toggle.is-locked {
  cursor: default;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.member-form .users-filter-dd-toggle {
  width: 100%;
}

.profile-team-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 24px 0 8px;
}

.profile-team-title {
  margin: 24px 0 8px;
}

.admin-sortable-table th.th-sortable .users-col-title,
.admin-sortable-table th.th-sortable {
  cursor: pointer;
  user-select: none;
}

.admin-sortable-table th.th-sortable:hover .users-col-title,
.admin-sortable-table th.th-sortable:hover {
  color: var(--yellow);
}

.admin-sortable-table th.is-sorted-asc .users-col-title::after,
.admin-sortable-table th.is-sorted-asc::after {
  content: ' ▲';
  font-size: 0.75em;
  opacity: 0.85;
}

.admin-sortable-table th.is-sorted-desc .users-col-title::after,
.admin-sortable-table th.is-sorted-desc::after {
  content: ' ▼';
  font-size: 0.75em;
  opacity: 0.85;
}

.profile-team-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1 1 280px;
}

.profile-team-tournament-label {
  font-weight: 700;
  white-space: nowrap;
}

.profile-team-select-label .team-tournament-select {
  width: 100%;
  min-width: 220px;
  max-width: 420px;
  padding: 8px 10px;
  font-size: 1rem;
}

.teams-list-table .team-tournament-select {
  max-width: 100%;
  min-width: 180px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.user-row-kontakt td {
  background: rgba(255, 213, 0, 0.06);
}

.team-edit-panel {
  margin: 16px 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
}

.team-edit-panel h2 {
  margin-top: 0;
}

.email-template-picker {
  margin: 16px 0;
}

.email-template-picker select {
  min-width: 280px;
  max-width: 100%;
}

.email-template-form textarea {
  min-height: 280px;
  font-family: inherit;
  line-height: 1.45;
}

.team-edit-actions {
  margin-top: 12px;
}

.email-template-form textarea {
  min-height: 280px;
  font-family: inherit;
  line-height: 1.45;
}

.email-editor-toolbar,
.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 8px;
}

.rich-editor-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.rich-editor-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 2px;
}

.email-editor-btn,
.rich-editor-btn {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  background: #152238;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}

.email-editor-btn:hover,
.rich-editor-btn:hover {
  background: rgba(255, 213, 0, 0.15);
  color: var(--yellow);
}

.rich-editor-btn-yellow {
  color: var(--yellow);
}

.rich-editor-color {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  background: #152238;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.rich-editor-color span {
  font-weight: 700;
  pointer-events: none;
}

.rich-editor-color input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.email-body-editor,
.rich-body-editor {
  min-height: 280px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  line-height: 1.45;
  overflow: auto;
}

.email-body-editor:focus,
.rich-body-editor:focus {
  outline: 2px solid rgba(255, 213, 0, 0.35);
  outline-offset: 2px;
}

.rich-body-editor ul,
.rich-body-editor ol,
.help-panel-body ul,
.help-panel-body ol,
.help-edit-body ul,
.help-edit-body ol {
  margin: 0.5em 0;
  padding-left: 1.75em !important;
  margin-left: 0.25em;
  list-style-position: outside;
}

.rich-body-editor ul,
.help-panel-body ul,
.help-edit-body ul {
  list-style-type: disc !important;
}

.rich-body-editor ol,
.help-panel-body ol,
.help-edit-body ol {
  list-style-type: decimal !important;
}

.rich-body-editor li,
.help-panel-body li,
.help-edit-body li {
  margin-bottom: 0.25em;
  display: list-item !important;
}

.rich-body-editor h3 {
  margin: 0.75em 0 0.35em;
  font-size: 1.05rem;
  color: var(--yellow);
}

.rich-body-editor hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1em 0;
}

.rich-body-editor a {
  color: var(--yellow);
}

.rich-body-editor table,
.rich-table {
  border-collapse: collapse;
  margin: 0.75em 0;
  width: 100%;
}

.rich-body-editor table td,
.rich-body-editor table th,
.rich-table td,
.rich-table th {
  border: 1px solid var(--line);
  padding: 6px 10px;
  min-width: 40px;
}

.team-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.team-row-actions-inner {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.team-row-actions-inner .inline-form {
  display: inline-flex;
  margin: 0;
}

.teams-date-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.teams-date-filters input {
  min-width: 0;
}

.teams-list-table .team-name-cell {
  font-weight: 700;
}

@media (max-width: 900px) {
  .teams-date-filters {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.tournaments-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.tournaments-row-actions .inline-form {
  margin: 0;
}

.tournament-edit-actions {
  align-items: center;
}

.tournament-edit-actions .inline-form {
  margin: 0;
  display: inline-flex;
}

.teams-list-table tr.is-editing td {
  background: rgba(255, 213, 0, 0.08);
}

.teams-display-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.teams-display-options .teamcheck {
  margin: 0;
}

.team-captain-cell {
  min-width: 180px;
  vertical-align: top;
}

.team-captain-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-captain-icon-wrap {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--yellow);
  line-height: 0;
}

.team-captain-icon {
  width: 16px;
  height: 16px;
}

.team-player2-line {
  margin-top: 4px;
  padding-left: 22px;
  color: #dbeafe;
  word-break: break-all;
}

.admin-top-links-icons {
  gap: 6px;
}

.admin-nav-gap {
  width: 12px;
  flex-shrink: 0;
  align-self: stretch;
  margin: 0 4px;
  border-left: 1px solid rgba(248, 250, 252, 0.22);
}

/* WhatsApp */
.btn-whatsapp,
a.btn-whatsapp {
  background: #128c7e;
  color: #fff;
  border-color: #0e6b60;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-whatsapp:hover,
a.btn-whatsapp:hover {
  background: #075e54;
  color: #fff;
  text-decoration: none;
}

.whatsapp-icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.whatsapp-live-panel {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 140, 126, 0.08);
}

.whatsapp-live-panel > summary {
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.whatsapp-live-panel > summary::-webkit-details-marker {
  display: none;
}

.whatsapp-recipient-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.whatsapp-recipient-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

.whatsapp-recipient-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

a.btn-whatsapp.is-opened {
  opacity: 0.55;
}

.phone-with-whatsapp {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.phone-with-whatsapp input {
  flex: 1 1 10em;
  min-width: 0;
}

.admin-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s, color 0.15s;
}

.admin-nav-icon svg {
  width: 22px;
  height: 22px;
}

.admin-nav-icon:hover {
  background: rgba(255, 213, 0, 0.18);
  color: var(--yellow);
}

.admin-nav-text {
  margin-left: 8px;
  padding: 8px 12px;
}

/* ── Page help ── */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.page-heading h1,
.page-heading h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.help-trigger {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.help-trigger svg {
  width: 22px;
  height: 22px;
}

.help-trigger:hover,
.help-trigger[aria-expanded="true"] {
  background: var(--yellow);
  color: #07111f;
}

.help-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 72px 16px 16px;
}

.help-panel[hidden] {
  display: none !important;
}

.help-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.help-panel-inner {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: calc(100vh - 96px);
  overflow: auto;
  background: #101a2e;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 16px 18px 20px;
}

.help-panel-inner.help-panel-wide {
  width: min(720px, 100%);
}

.help-section-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0 16px;
}

.help-panel-body h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--yellow);
}

.help-panel-body h4 {
  margin: 14px 0 8px;
  font-size: 0.95rem;
  color: #fff;
}

.help-panel-body ol {
  margin: 8px 0 12px;
  padding-left: 1.35rem;
}

.help-panel-body ol li {
  margin-bottom: 6px;
}

.help-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.help-panel-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.15rem;
  color: var(--yellow);
}

.help-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.help-edit-btn,
.help-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.help-edit-btn svg,
.help-close svg {
  pointer-events: none;
}

.help-edit-btn:hover,
.help-close:hover {
  background: var(--yellow);
  color: #07111f;
  border-color: var(--yellow);
}

.help-panel-editor[hidden] {
  display: none !important;
}

.help-panel-editor:not([hidden]) {
  display: block;
  margin-top: 8px;
}

.help-panel-body[hidden] {
  display: none !important;
}

.help-panel-editor .help-edit-title {
  width: 100%;
  margin-bottom: 10px;
}

.help-panel-editor .help-edit-body {
  min-height: 180px;
  max-height: 50vh;
  overflow: auto;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1424;
}

.help-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pause-row td {
  background: rgba(255, 213, 0, 0.12) !important;
  border-top: 1px dashed var(--yellow);
  border-bottom: 1px dashed var(--yellow);
}

.pause-label-cell {
  text-align: center;
  font-weight: 800;
  color: var(--yellow);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.match-time-cell {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.match-time-cell.is-readonly,
.pause-row.is-readonly .pause-label-cell {
  cursor: default;
}

.match-time-cell:hover {
  color: var(--yellow);
}

.match-time-cell.is-readonly:hover {
  color: inherit;
}

.live-pause-row td {
  background: rgba(255, 213, 0, 0.12) !important;
  border-top: 1px dashed var(--yellow);
  border-bottom: 1px dashed var(--yellow);
}

.live-pause-row .pause-label-cell {
  text-align: center;
  font-weight: 800;
  color: var(--yellow);
}

.help-panel-body {
  font-size: 0.95rem;
  line-height: 1.45;
}

.help-panel-body h3 {
  margin: 14px 0 6px;
  font-size: 1rem;
  color: var(--yellow);
}

.help-panel-body ul {
  margin: 0 0 10px;
  padding-left: 1.2em;
}

.help-panel-body li {
  margin-bottom: 4px;
}

.help-panel-body p {
  margin: 0 0 10px;
}

.help-panel-body code {
  font-size: 0.9em;
  color: var(--yellow);
}

/* Bildgalerie */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.gallery-item {
  margin: 0;
}

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.gallery-thumb:hover img,
.gallery-thumb:focus-visible img {
  transform: scale(1.04);
}

.gallery-item figcaption {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-item figcaption strong {
  color: var(--yellow);
}

.gallery-item figcaption span {
  color: var(--muted, #aaa);
}

.gallery-lightbox {
  border: none;
  padding: 0;
  max-width: min(96vw, 960px);
  max-height: 96vh;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.gallery-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.gallery-lightbox-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px 0;
  margin: 0;
}

.gallery-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(96vh - 120px);
  margin: 0 auto;
  object-fit: contain;
}

.gallery-lightbox-caption {
  text-align: center;
  padding: 8px 16px 4px;
  margin: 0;
  font-size: 0.95rem;
}

.gallery-lightbox-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px 16px;
}

.gallery-admin-form .gallery-admin-preview {
  max-width: 280px;
  max-height: 200px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gallery-admin-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: block;
}

.gallery-admin-actions {
  white-space: nowrap;
}

.gallery-admin-actions .inline-form {
  display: inline;
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.gallery-event-card {
  color: inherit;
  text-decoration: none;
  display: block;
}

.gallery-event-card .gallery-thumb {
  pointer-events: none;
}

.gallery-events-grid .gallery-item figcaption strong {
  color: var(--yellow);
}

.home-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.home-section-heading h2 {
  margin: 0;
}

.home-edit-btn {
  flex-shrink: 0;
}

.users-mail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.users-mail-actions select {
  min-width: 180px;
}

.users-mail-dialog {
  border: none;
  padding: 16px 20px;
  max-width: min(92vw, 720px);
  width: 100%;
  background: #111827;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.users-mail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.users-mail-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.users-mail-preview {
  max-height: 50vh;
  overflow: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin: 10px 0 16px;
}
