/* =========================
   Base / Typography
   ========================= */
body {
  font-family: system-ui, Arial, sans-serif;
  margin: 20px;
  color: #222;
  background: #fff;
}
header { display:flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
h1 { margin: 0 0 8px 0; }

/* =========================
   Layout Helpers
   ========================= */
.grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap:12px; align-items: end; }
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px){ .grid-2 { grid-template-columns: 1fr; } }

.row { display:flex; gap:8px; align-items: end; }
.section-sep {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0;
}
body.dark .section-sep { border-top-color: #1f2937; }

.page-wrap { max-width: 1200px; margin: 0 auto; }

/* =========================
   Tables
   ========================= */
table { border-collapse: collapse; width: 100%; background:#fff; }
th, td { border:1px solid #e5e7eb; padding:6px 8px; text-align: center; vertical-align: middle; }
th { background:#eef2f7; }

/* Kompakte Utility-Spalten */
.col-rank { width: 1%; white-space: nowrap; text-align: center; }
.col-bib  { width: 1%; white-space: nowrap; text-align: center; }
.col-land { width: 1%; white-space: nowrap; text-align: center; }

/* =========================
   Inputs & Buttons
   ========================= */
input[type="number"] { width: 64px; }
button { padding:8px 12px; border:1px solid #1e293b; background:#1e293b; color:#fff; border-radius:6px; cursor:pointer; }
button:hover { filter: brightness(1.1); }

.button-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
  gap: 10px;
  align-items: stretch;
  margin: 8px 0 12px 0;
}
.button-bar .btn,
.button-bar a.btn {
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #1e293b;
  background: #1e293b;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  
}
.button-bar .btn:hover,
.button-bar a.btn:hover { filter: brightness(1.08); }
.btn .icon { margin-right: 6px; }
.row > input, .row > button { height: 40px; }

.score-window-btn {
  color: #fff !important;
  background: #2563eb;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
}
.score-window-btn:hover { background: #1e40af; }

/* =========================
   Cards
   ========================= */
.card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
}
.subhead { font-weight: 600; margin: 4px 0 10px 0; opacity: .85; }
.note { color:#bbb; }

/* =========================
   Toolbar & Tool Buttons
   ========================= */
.toolbar{
  display:flex;
  gap:12px;
  align-items:stretch;   /* sorgt für gleiche Höhe der Boxen */
  justify-content:flex-end;
  flex-wrap:wrap;
  margin: 4px 0 12px 0;
}


.toolgroup{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:8px 10px;
  border:1px solid #e5e7eb;
  background:#f8fafc;
  border-radius:10px;
  align-items: stretch;
}

.tooltitle{
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:12px;
  font-weight:700;
  opacity:.7;
  margin-bottom:2px;
  text-align:center;
}

.toolbtn{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  min-width:180px;
  padding:8px 12px;
  border-radius:8px;
  text-decoration:none;
  font-weight:600;
  border:1px solid transparent;
  transition:filter .15s ease, background .15s ease;
}

/* Anzeigen */
.toolbtn.is-view{
  background:#2563eb;
  color:#fff;
}
.toolbtn.is-view:hover{ background:#1d4ed8; }

/* Drucken */
.toolbtn.is-print{
  background:#16a34a;
  color:#fff;
}
.toolbtn.is-print:hover{ background:#15803d; }

/* =========================
   App Header
   ========================= */
.app-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 20px;
  border-bottom:2px solid #e5e7eb;
  background:linear-gradient(90deg, #1e293b 0%, #334155 100%);
  color:#fff;
  border-radius:0 0 12px 12px;
  margin-bottom:16px;
}
.header-left { display:flex; align-items:center; gap:14px; }
.club-logo { height: 180px; width: auto; }
.titles { display:flex; flex-direction:column; }
.clubname { font-size: 14pt; font-weight: 600; color: #e2e8f0; margin-bottom: 4px; }
.app-header h1 { font-size:18pt; margin:0; }
.app-header .subtitle { font-size:12pt; font-weight:400; opacity:.8; margin-left:6px; }

/* =========================
   Params / Forms
   ========================= */
.params-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:16px 20px;
  align-items:start;
}
@media (max-width: 1100px){ .params-grid{ grid-template-columns:1fr; } }

.params-header{
  grid-column:1 / -1;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}

.params-grid fieldset{ border:none; padding:0; margin:0; }
.params-grid legend{ font-weight:600; font-size:15px; margin-bottom:6px; color:var(--fg-muted,#555); }
.params-grid label{ display:block; margin-bottom:12px; font-size:14px; }

.params-grid input[type="text"],
.params-grid input[type="number"]{
  width:100%;
  padding:6px 8px;
  border:0;
  border-bottom:1px solid #ccc;
  background:transparent;
}
body.dark .params-grid input[type="text"],
body.dark .params-grid input[type="number"]{
  border-color:#444;
  color:#fff;
}

.params-grid .checkbox{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:6px;
}

.hint{ font-size:12px; color:#888; margin-top:2px; }

.btn-primary{
  padding:6px 14px;
  border-radius:4px;
  border:1px solid #1e293b;
  background:#1e293b;
  color:#fff;
  font-size:14px;
  cursor:pointer;
}
.btn-primary:hover{ background:#334155; }

/* Param Cards (modern) */
:root{
  --ui-bg: #0f172a;
  --ui-fg: #e5e7eb;
  --ui-muted:#94a3b8;
  --ui-border:#334155;
  --ui-input:#0b1220;
  --ui-accent:#3b82f6;
  --ui-accent-2:#22c55e;
  --ui-danger:#ef4444;
  --ui-radius:10px;
  --ui-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 6px 18px rgba(0,0,0,.25);
}
body:not(.dark){
  --ui-bg:#fff; --ui-fg:#0f172a; --ui-muted:#475569; --ui-border:#cbd5e1; --ui-input:#fff;
}

.param-card{
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  overflow: hidden;
  position: relative;
}

.param-row{
  display:grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap:10px;
  align-items:center;
  margin:6px 0;
}
.param-row > *{ min-width: 0; }
.param-row label{ color: var(--ui-fg); }

.input,
.param-row input[type="text"],
.param-row input[type="number"],
.param-row select{
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-input);
  color: var(--ui-fg);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-sizing: border-box;
  max-width: 100%;
}
.param-row input[type="text"]::placeholder{ color: var(--ui-muted); }
.input:focus, .param-row input:focus, .param-row select:focus{
  outline: none;
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ui-accent) 28%, transparent);
}

/* Number-Spinners */
.param-row input[type="number"]::-webkit-outer-spin-button,
.param-row input[type="number"]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.param-row input[type="number"]{ -moz-appearance: textfield; }

/* Select Pfeil */
.param-row select{
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ui-muted) 50%),
    linear-gradient(135deg, var(--ui-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* Switch */
.switch{
  --w: 44px; --h: 24px;
  position: relative; display:inline-flex; align-items:center; gap:10px; cursor:pointer;
  user-select:none;
}
.switch input{ position:absolute; inset:0; opacity:0; }
.switch .track{
  width: var(--w); height: var(--h); border-radius: 999px;
  background: #1f2937; border:1px solid var(--ui-border);
  transition: background .2s, border-color .2s;
}
.switch .thumb{
  position: absolute; top: 50%; left: 3px;
  width: 18px; height: 18px; border-radius: 999px;
  transform: translateY(-50%); background:#fff; transition: left .2s;
}
.switch input:checked + .track{ background: var(--ui-accent); border-color: var(--ui-accent); }
.switch input:checked + .track + .thumb{ left: calc(var(--w) - 21px); }

/* Secondary buttons */
.btn-secondary{
  height: 40px; padding: 0 14px; border-radius: 10px; border:1px solid var(--ui-border);
  display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-weight:600;
  background: transparent; color: var(--ui-fg);
}
.btn-secondary:hover{ background: rgba(148,163,184,.08); }

/* =========================
   Participants (Admin)
   ========================= */
.participants-card { padding: 18px; }

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

.participants-form{
  display:grid;
  grid-template-columns: minmax(200px, 1fr) minmax(160px, 280px) minmax(140px, 220px) auto;
  gap:10px;
  align-items:center;
  margin:10px 0 14px 0;
}
.participants-form input[type="text"],
.participants-form select{
  height:40px; padding:0 12px; border-radius:10px;
  border:1px solid var(--ui-border, #334155);
  background:#0b1220; color:#e5e7eb;
}
body:not(.dark) .participants-form input[type="text"],
body:not(.dark) .participants-form select{
  background:#fff; color:#0f172a; border-color:#cbd5e1;
}

.participants-form button{
  height:40px; padding:0 14px; border-radius:10px; cursor:pointer;
  border:1px solid transparent; background:var(--ui-accent, #3b82f6); color:#fff;
  font-weight:600;
}

.participants-toolbar{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  margin-top:6px; padding-top:10px; border-top:1px dashed var(--ui-border, #334155);
}
.participants-toolbar .btn,
.participants-toolbar button{
  height:36px; padding:0 12px; border-radius:10px;
  border:1px solid var(--ui-border, #334155);
  background:transparent; color:#e5e7eb; cursor:pointer;
}
.participants-toolbar .btn:hover,
.participants-toolbar button:hover{ background:rgba(148,163,184,.08); }

.participants-table{
  width:100%; border-collapse:collapse; margin-top:12px;
  border:1px solid var(--ui-border, #334155); border-radius:12px; overflow:hidden;
}
.participants-table th, .participants-table td{
  padding:8px 10px; border-bottom:1px solid var(--ui-border, #334155); text-align:left;
}
.participants-table th{
  text-transform:uppercase; font-size:.85rem; letter-spacing:.02em; opacity:.9;
}

/* Actions */
.participants-actions details summary{ cursor:pointer; }
.participants-actions .btn{ height:32px; padding:0 10px; border-radius:8px; }
.participants-actions .btn-danger{ background:#b91c1c; color:#fff; border-color:#7f1d1d; }

/* =========================
   Scores / Status Badges
   ========================= */
.scores-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.scores-header h2{ margin:0; }

.live-status{
  flex:1; text-align:center;
  font-weight:800; letter-spacing:.02em;
  padding:6px 10px; border-radius:999px;
  background:rgba(59,130,246,.12);
  color:#93c5fd;
  border:1px solid rgba(59,130,246,.25);
}
.live-status.done{
  background:rgba(34,197,94,.14);
  color:#86efac;
  border-color:rgba(34,197,94,.25);
}

.card-header-3{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.card-header-3 h2{ margin:0; }
.scores-status{ display:flex; justify-content:center; }

/* Badges */
.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:9999px;
  font-weight:600;
  font-size:0.95rem;
  line-height:1.2;
  white-space:nowrap;
}
.badge-live{
  background:rgba(37, 99, 235, .15);
  color:#93c5fd;
  border:1px solid rgba(37, 99, 235, .45);
}
.badge-done{
  background:rgba(22, 163, 74, .15);
  color:#86efac;
  border:1px solid rgba(22, 163, 74, .45);
}
.badge-info {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.45);
}


/* Serien-Farben (rein typografisch) */
.score.s25 { color: #ff2300; font-weight: 700; } /* 25 */
.score.s24 { color: #ffc900; font-weight: 700; } /* 24 */
.score.s23 { color: #c16800; font-weight: 700; } /* 23 */

/* Kategorien-Titel-Farben */
.catTitleA { color:#00d26a; }
.catTitleB { color:#ffd60a; }
.catTitleC { color:#d00000; }

/* =========================
   Archive Box
   ========================= */
.section-divider {
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, #64748b40, transparent);
  border: 0;
}
.archive-box {
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}
body.dark .archive-box {
  border-color: #1f2937;
  background: rgba(15,23,42,0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.archive-box h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.archive-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
@media (max-width: 900px){ .archive-actions { grid-template-columns: 1fr; } }
.archive-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.archive-box select {
  min-width: 320px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #e5e7eb;
}
body:not(.dark) .archive-box select { background: #fff; color: #111827; border-color:#cbd5e1; }
.btn-ghost {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px dashed #64748b;
  color: #e5e7eb;
  text-decoration: none;
}
.btn-danger {
  background:#b91c1c; border:1px solid #7f1d1d; color:#fff;
  padding:8px 14px; border-radius:8px; cursor:pointer;
}
.hint.small { font-size: .9em; opacity: .8; margin-top: 8px; }

/* =========================
   Dark Theme
   ========================= */
body.dark { background:#101317; color:#fff; }
body.dark table { background:#0f172a; color:#fff; }
body.dark th, body.dark td { border-color:#1f2937; }
body.dark th { background:#1f2937; }

body.dark .card {
  background: #1e293b;
  border-color: #334155;
  color: #f9fafb;
}

body.dark .toolgroup{
  background:#0f172a;
  border-color:#1f2937;
}
body.dark .tooltitle{ color:#cbd5e1; opacity:.7; }

/* =========================
   Details / Disclosure
   ========================= */
details summary { cursor: pointer; user-select: none; list-style: none; outline: none; display: flex; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " ▾"; font-size: 12px; color: #666; }
details[open] summary::before { content: "▼ "; font-size: 0.8em; margin-right: 6px; }
details:not([open]) summary::before { content: "▶ "; font-size: 0.8em; margin-right: 6px; }

/* =========================
   Date label
   ========================= */
.date {
  font-size: 14pt;
  font-weight: 400;
  opacity: .6;
  margin-bottom: 20px;
  z-index:1;
}

/* =========================
   Unified Print Styles
   ========================= */
@media print {
  /* Papierformat & Ränder (A4 Hochformat, 10 mm) */
  @page { size: A4 portrait; margin: 10mm; }

  /* Immer hell drucken */
  :root { color-scheme: only light; }
  html, body { background: #fff !important; color: #000 !important; }

  /* Dark-/Branding-Hintergründe neutralisieren */
  body.dark, .dark,
  .app-header, .card, .param-card,
  .dark .app-header, .dark .card, .dark .param-card {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }

  /* Basis-Skalierung: Ziel One-Pager */
  :root { --print-scale: 0.92; }
  body { zoom: var(--print-scale); }                 /* Chrome/Edge */

  /* Wenn die Seite bewusst kompakt sein soll (z. B. stats.html): <body class="stats-page"> */
  body.stats-page { --print-scale: 0.84; }

  /* Fallback: wrapper skalieren, falls zoom ignoriert wird */
  .page-wrap {
    transform-origin: top left !important;
    transform: scale(var(--print-scale));
    width: calc(100% / var(--print-scale));
  }

  /* Layout straffen / UI ausblenden */
  .toolbar, .toolbtn, .btn, .flash, .hint, .subtitle { display: none !important; }
  .app-header { padding: 0 0 6mm 0 !important; border: 0 !important; background: #fff !important; }

  .grid, .grid-2, .params-sections { gap: 6mm !important; }
  .card, .param-card {
    padding: 6mm !important;
    margin: 0 !important;
    border: 1px solid #ccc !important;
  }

  /* Tabellen kompakt & hell */
  table, .table {
    background: #fff !important;
    color: #000 !important;
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 10pt !important;
  }
  .table th, .table td, th, td {
    border: 1px solid #ccc !important;
    padding: 2mm 3mm !important;
    white-space: nowrap;
  }
  .table th, th {
    background: #f2f2f2 !important;
    color: #000 !important;
  }

  /* Keine Deko im Druck */
  * { box-shadow: none !important; text-shadow: none !important; }

  /* Links neutral (schwarz, unterstrichen) */
  a, a:visited { color: #000 !important; text-decoration: underline !important; }

  /* Formelemente lesbar */
  input, select, textarea {
    background: #fff !important; color: #000 !important; border: 1px solid #444 !important;
  }

  /* Seitenumbrüche vermeiden */
  .card, .param-card, table, .table { break-inside: avoid; page-break-inside: avoid; }
}
/* --- FIX: Parameter-Karten wieder 2x2 nebeneinander (Desktop) --- */
@media screen and (min-width: 1100px) {
  .params-sections {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(360px, 1fr)) !important;
    gap: 20px !important;
    align-items: start;
  }
  /* Sicherheit: Karten dürfen nicht versuchen, die ganze Zeile zu belegen */
  .params-sections > .param-card { grid-column: auto !important; width: auto !important; }
}

/* Unter 1100 px weiterhin 1 Spalte (mobil/tablet) */
@media screen and (max-width: 1099px) {
  .params-sections { grid-template-columns: 1fr !important; }
}
/* ---- Flash -> Toasts (schwebend, ohne Layout-Shift) ---- */
/* Basis: zentriert horizontal */
.flash{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);  /* horizontal zentrieren */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;

  /* sinnvolle Breite */
  width: min(640px, calc(100vw - 24px));
  pointer-events: none;          /* klicks gehen "durch"; optional */
}
.flash > * { pointer-events: auto; }  /* Buttons in Meldungen bleiben klickbar */

/* Variante: oben zentriert */
.flash--top{
  top: 12px;
  bottom: auto;
}

/* Variante: unten zentriert */
.flash--bottom{
  bottom: 12px;
  top: auto;
}

.flash > div{
  pointer-events: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(18,22,30,.92);
  color: #fff;
  border-left: 4px solid #4da3ff;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  line-height: 1.25;
  animation: toast-in .22s ease-out;
}

/* Farbakzente je Kategorie (Flask: success/info/warning/error) */
.flash-success{ border-left-color: #22c55e; }
.flash-info{    border-left-color: #3b82f6; }
.flash-warning{ border-left-color: #f59e0b; }
.flash-error{   border-left-color: #ef4444; }

/* Ausblenden */
.flash > div.toast-hide{
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}

@keyframes toast-in{
  from{ opacity: 0; transform: translateY(-6px); }
  to  { opacity: 1; transform: translateY(0); }
}
.params-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
  align-items: stretch;
}

.param-card {
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: 16px;
  min-height: 220px; /* sorgt für optische Gleichheit */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover { background:#1d4ed8; }

.btn-secondary {
  background: #6b7280;
  color: #fff;
}
.btn-secondary:hover { background:#4b5563; }

.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-success:hover { background:#15803d; }

.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover { background:#b91c1c; }
.btn-green {
  background: #16a34a;
  border: 1px solid #15803d;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-green:hover {
  background: #15803d;
}

/* Globale Box-Sizing-Korrektur */
*, *::before, *::after { box-sizing: border-box; }

/* Inputs/Selects dürfen nie aus dem Container quellen */
input[type="text"],
input[type="number"],
select {
  width: 100%;
  max-width: 100%;
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  box-sizing: border-box; /* <<< wichtig */
}

/* Rundungen sauber clippen (falls ein Browser doch mal übermalt) */
fieldset { overflow: hidden; }

/* =========================
   Autosave Controls (Archiv)
   ========================= */
.archive-row label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 4px;
}

.archive-row label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Inputs/Selects im Archiv */
.archive-row select {
  min-width: 120px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--ui-border, #334155);
  background: var(--ui-input, #0b1220);
  color: var(--ui-fg, #e5e7eb);
}
body:not(.dark) .archive-row select {
  background: #fff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.archive-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
#final-options .param-row{
  display: grid;
  grid-template-columns: 240px 1fr; /* linke Label-Spalte, rechte Control-Spalte */
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

#final-options .field-label{ /* optisch wie deine anderen Labels */
  font-weight: 600;
}

#final-options .control .hint{
  display: block;
  margin-top: 6px;
  opacity: .7;
}

#final-options .param-row--sep{
  border-top: 1px dashed rgba(255,255,255,.12);
  margin-top: 8px;
  padding-top: 12px;
}
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; line-height:18px; }
.badge-warn { background:#d97706; color:#111; }
.badge-ok   { background:#16a34a; color:#fff; }
.badge-info { background:#3b82f6; color:#fff; }

/* === Dashboard-Breitmodus & klare Toolbar === */
.page-wrap { max-width: 1600px; }           /* mehr Platz nutzen */
.card { width: 100%; }

/* Toolbar-Buttons oben rechts gut lesbar */
.toolbar { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.toolbar .btn,
a.btn {                                    /* stellt sicher: auch <a> wird wie Button gerendert */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #165cad;
  background: #1f6feb;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.toolbar .btn:hover,
a.btn:hover { background: #2a7bff; }

/* === Tabelle: keine Zeilenbrüche, Ellipsen bei langen Texten === */
.table-wide { width: 100%; table-layout: fixed; }
.table-wide th, .table-wide td { white-space: nowrap; vertical-align: middle; }
.table-wide td.name, .table-wide td.club {
  overflow: hidden; text-overflow: ellipsis;
}

/* kleine Zellen kompakt */
td.w40 { width: 40px; }
td.w64 { width: 64px; }
td.w100 { width: 100px; }
td.w120 { width: 120px; }

/* Form-Elemente in Zellen */
.table-wide input[type="text"],
.table-wide input[type="number"],
.table-wide select {
  height: 34px;
  padding: 4px 8px;
}
/* rechte Spalte aufräumen */
.toolgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; }
.panel { background:#0f1826; border:1px solid rgba(255,255,255,.06); border-radius:14px; padding:14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.panel h3 { margin:0 0 10px; font-size:12px; letter-spacing:.06em; color:#9db1cc; text-transform:uppercase; }

.btn-block { width:100%; justify-content:center; }
.toolbtn, .btn-like {
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 12px; border-radius:10px; text-decoration:none !important;
  border:1px solid #165cad; background:#1f6feb; color:#fff !important;
  box-shadow:0 1px 0 rgba(0,0,0,.25); margin-bottom:8px;
}
.toolbtn:hover, .btn-like:hover { background:#2a7bff; }

.btn-quiet {
  background:transparent; border-color:#2b3b56; color:#cfe2ff !important;
}
.btn-quiet:hover { background:#1b263b; }

.page-wrap { max-width: 1400px; } /* etwas mehr Breite nutzen */
/* ---- Dezente Sortier-Indikatoren im Tabellenkopf ---- */
.participants-table thead th.sortable {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.participants-table thead th.sortable > span {
  display: inline-block;
  padding-right: 16px; /* Platz für Icon */
}

.participants-table thead th.sortable::after {
  content: "⇅";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.35;              /* dezent */
  transition: opacity 120ms ease;
  pointer-events: none;
}

.participants-table thead th.sortable:hover::after,
.participants-table thead th.sortable:focus::after {
  opacity: 0.7;               /* bei Hover/Focus sichtbarer */
}

/* aktiver Zustand: ▲ / ▼ je nach aria-sort */
.participants-table thead th.sortable[aria-sort="ascending"]::after {
  content: "▲";
  opacity: 0.85;
}

.participants-table thead th.sortable[aria-sort="descending"]::after {
  content: "▼";
  opacity: 0.85;
}

/* kleine optische Hilfe beim Hover */
.participants-table thead th.sortable:hover,
.participants-table thead th.sortable:focus {
  background: rgba(255,255,255,0.03);
  outline: none;
}
.participants-toolbar .input, 
.participants-toolbar select {
  height: 32px;
  padding: 4px 8px;
}
/* Aktionen-Spalte: dezente, einheitliche "Ghost"-Buttons */
.participants-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participants-actions .btn,
.participants-actions button.btn,
.participants-actions a.btn {
  --btn-h: 30px;
  --btn-pad-x: 10px;
  --radius: 10px;

  height: var(--btn-h);
  line-height: calc(var(--btn-h) - 2px);
  padding: 0 var(--btn-pad-x);
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;

  border: 1px solid rgba(255,255,255,.20);
  background: transparent;
  color: rgba(255,255,255,.85);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;

  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .05s ease;
}

/* neutrales Ghost (Bearbeiten) */
.participants-actions .btn-ghost {
  border-color: rgba(120,170,255,.35);
  color: rgba(180,210,255,.95);
}
.participants-actions .btn-ghost:hover {
  background: rgba(120,170,255,.08);
  border-color: rgba(120,170,255,.6);
}
.participants-actions .btn-ghost:active {
  transform: translateY(1px);
}

/* dezentes Danger-Ghost (Löschen) */
.participants-actions .btn-ghost-danger {
  border-color: rgba(255,120,120,.35);
  color: rgba(255,190,190,.95);
}
.participants-actions .btn-ghost-danger:hover {
  background: rgba(255,120,120,.10);
  border-color: rgba(255,120,120,.6);
}
.participants-actions .btn-ghost-danger:active {
  transform: translateY(1px);
}

/* Fokus sichtbar, aber dezent */
.participants-actions .btn:focus-visible {
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}

/* Forms in der Zelle ohne Extra-Margins */
.participants-actions form {
  margin: 0;
}

/* optional: XS-Variante, falls du’s noch kompakter willst */
.participants-actions .btn--xs {
  --btn-h: 26px;
  --btn-pad-x: 8px;
  font-size: 12px;
  border-radius: 8px;
}
.paid-badge{
  font-size:.85em; padding:2px 8px; border-radius:9999px;
  border:1px solid #10b981;
  background:#064e3b;
  color:#7be215;
}
/* ===== Training: Kompaktmodus ===== */
.compact-wrap.compact table { border-collapse: collapse; }
.compact-wrap.compact th,
.compact-wrap.compact td { padding: 6px 8px; vertical-align: middle; }

/* kleinere Controls */
.compact-wrap.compact .input,
.compact-wrap.compact select,
.compact-wrap.compact .btn {
  height: 28px; padding: 2px 8px; font-size: .95rem; line-height: 24px;
}

/* Score-/Getränke-Formulare eng & inline */
.compact-wrap.compact .score-form,
.compact-wrap.compact .bev-form {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
}
.compact-wrap.compact .bev-form select { min-width: 180px; }
.compact-wrap.compact .bev-form input[type="number"] { width: 64px; }

/* Chips & Badges kleiner */
.compact-wrap.compact .round-chip { padding: 2px 6px; font-size: .9rem; }
.compact-wrap.compact .paid-badge { padding: 0 6px; font-size: .8rem; }

/* Zahlen nicht umbrechen */
.compact-wrap.compact .num { white-space: nowrap; }

/* fixe Spalten + ruhige Zeilen */
.table-fixed{ table-layout:fixed; width:100%; border-collapse:collapse; }
.table-fixed th, .table-fixed td{ vertical-align:middle; }

/* ---- Tabellen-Spaltenbreiten (summe ≈ 100%) ---- */
.w-shooter{ width:23% }   /* Name */
.w-num    { width:6%  }   /* Runden, Treffer, Quote -> alle drei nutzen .w-num */
.w-sum    { width:8%  }   /* Summe (€) */
.w-score  { width:11% }   /* Score eintragen */
.w-chips  { width:11% }   /* Runden (einzeln) */
.w-bev    { width:26% }   /* >>> Getränk (breiter) */
.w-paid   { width:3%  }   /* Bezahlt */

/* Chips/Bev-Zellen nicht umbrechen, damit Höhe stabil bleibt */
.table-fixed .nowrap, .table-fixed .round-chip{ white-space:nowrap; }

/* Getränke-Zelle: Formular + Badge sauber nebeneinander */
.bev-cell{
  display:flex; align-items:center; gap:8px;
  position: relative; z-index: 1;       /* neu: verhindert Übergriff in Nachbarzellen */
}

.bev-count{
  display:inline-flex; align-items:center; justify-content:center;
  height:24px; min-width:34px; padding:0 6px; line-height:22px;
  border:1px solid rgba(255,255,255,.2); border-radius:9999px; font-size:.9rem;
  margin-right:6px;                      /* neu: ersetzt die spätere Einzelregel */
}
.bev-count--empty{ opacity:.45; border-color:transparent; }
.compact-wrap.compact .bev-count{ height:22px; min-width:30px; font-size:.85rem; }


/* Kompaktmodus: Badge etwas kleiner */
.compact-wrap.compact .bev-count{ height:22px; min-width:30px; font-size:.85rem; }
/* Runden-Panel */
.rounds-cell{ position:relative; }
.more-rounds{ height:28px; padding:2px 8px; }
.chip-panel{
  position:absolute; top:100%; left:0; margin-top:6px; z-index:20;
  background:#0f1720; border:1px solid rgba(255,255,255,.12);
  box-shadow:0 8px 24px rgba(0,0,0,.35);
  border-radius:12px; padding:8px;
  max-width:420px; max-height:220px; overflow:auto; display:none;
}
.rounds-cell.open .chip-panel{ display:block; }
/* im Kompaktmodus etwas enger */
.compact-wrap.compact .chip-panel{ max-height:180px; }

/* Dark-Widget */
.input[type="date"],
input[type="date"] {
  color-scheme: dark;
}

/* Kalender-Icon – Standardzustand */
.input[type="date"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.25) contrast(1.1) !important;
  opacity: .95 !important;
  border-radius: 6px !important;
  padding: 4px !important;
  background-color: rgba(255,255,255,.06) !important;
  cursor: pointer;
}

/* Hover */
.input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(59,130,246,.25) !important; /* blaues Hover */
  filter: invert(1) brightness(1.35) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,.35) !important;
}
/* eigenes Icon rechts einblenden */
.input[type="date"],
input[type="date"] {
  color-scheme: dark;
  padding-right: 2.4rem; /* Platz für das Icon */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='white'>\
<path d='M7 2a1 1 0 0 0-1 1v1H5a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3h-1V3a1 1 0 1 0-2 0v1H8V3a1 1 0 0 0-1-1zM5 8h14v10a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V8zm3 3h3v3H8v-3z'/></svg>");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 18px 18px;
}

/* natives Picker-Icon unsichtbar lassen, bleibt klickbar */
.input[type="date"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}
/* Kompakte Eingaben oben auf der Trainingstag-Seite */
.training-toolbar .toolbar-input {
  /* gleiche, kleinere Höhe */
  height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 10px;         /* wie bei dir üblich, nur etwas kleiner */
}

/* Date-Picker gleich hoch ausrichten */
.training-toolbar .toolbar-input[type="date"] {
  line-height: 36px;           /* sorgt in Chrome/Edge für gleiche Innenhöhe */
}

/* Kalender-Icon etwas kleiner, damit es zur neuen Höhe passt */
.training-toolbar .toolbar-input[type="date"]::-webkit-calendar-picker-indicator {
  padding: 2px;
}


/* ----- Status-Optik ----- */

/* Zusammenfassung-Chips */
.summary {
  display:flex; gap:.5rem; align-items:center; margin:6px 0 12px;
}
.chip {
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.25rem .6rem; border-radius:9999px; font-weight:500;
  border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04);
}
.chip--warn { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.10); }
.chip--ok   { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.10); }

/* Offene Zeilen: warmer Akzent links + leicht getönt */
tr.unpaid {
  background: rgba(245,158,11,.06);              /* ganz zartes Amber */
  box-shadow: inset 4px 0 0 0 rgba(245,158,11,.8); /* „Akzentleiste“ links */
}

/* Bezahlt-Zeilen: klarer, neutraler Grey-Look (ohne Verlauf) – zwei Stufen dunkler */
tr.paid {
  background: #0a0f14;               /* deutlich grauer als Umgebung */
}
.compact-wrap.compact tr.paid {
  background: #090e12;
}

/* „Bezahlt“-Zwischenzeile */
.section-row td {
  background: rgba(255,255,255,.05);
}
/* zentrierte Badge-Leiste */
.chipbar{
  display:flex;
  justify-content:center;   /* <— zentrieren */
  gap:12px;
  margin:8px 0 12px;
  flex-wrap:wrap;           /* bricht bei schmalen Displays um */
  text-align:center;
}

/* Falls du die Chips noch nicht hast – hier Minimal-Styles */
.chip{
  display:inline-flex; align-items:center;
  padding:6px 10px; border-radius:9999px;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12);
  font-weight:500;
}
.chip-open{ background:rgba(255,196,0,.10); border-color:rgba(255,196,0,.25); }
.chip-paid{ background:rgba(16,185,129,.10); border-color:rgba(16,185,129,.25); }
/* Wrapper in der Mitte */
.badge-bar{
  display:flex;
  justify-content:center;
  gap:12px;
  margin:8px 0 12px;
  width:100%;
}

/* Grund-Style der Badges */
.badge-bar .chip{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.28rem .70rem;
  border-radius:9999px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.05);
  font-weight:500;
}

/* Farbliche Varianten – mehr Spezifität durch .badge-bar davor */
.badge-bar .chip-open{
  background:rgba(248,113,113,.12);   /* rot getönt */
  border-color:rgba(248,113,113,.45);
  color:#fecaca;
}

.badge-bar .chip-paid{
  background:rgba(16,185,129,.12);    /* grün getönt */
  border-color:rgba(16,185,129,.45);
  color:#a7f3d0;
}

/* Zahlen etwas hervorheben */
.badge-bar .chip strong{ color:#fff; font-weight:600; }

@media print {
  body { background:#fff !important; color:#000 !important; }
  .card, .kpi { background:#fff !important; border-color:#999 !important; box-shadow:none !important; }
  .kpi { background:#f3f4f6 !important; }
  .kpi .val, .kpi h3, .kpi .hint { color:#000 !important; }
  .table th, .table td { color:#000 !important; border-color:#bbb !important; background:transparent !important; }
  .report-header { border-bottom:2px solid #000 !important; }
  .warn { color:#8b0000 !important; }
}

/* =====[TRAINING DAY – KANONISCH]======
   Getränke & Bezahlt – Single Source of Truth
   ======================================== */

/* =====[TRAINING DAY – Getränke/Bezahlt fix]==================== */

/* Spaltenbreiten: Bezahlt fix, Getränk bekommt den Rest */
col.w-paid { width: 72px; }       /* 64–80px sind ok */
col.w-bev  { width: auto; }

/* Getränke-Zelle clippt strikt ihren Inhalt */
td.bev-td { overflow: hidden; }

/* Getränke-Inhalt: flex-wrap + sauberes Schrumpfen */
.bev-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;          /* darf umbrechen */
  width:100%;
  box-sizing:border-box;
  overflow:hidden;         /* harte Kante innerhalb der Zelle */
}

/* Alle Kinder dürfen schrumpfen (sonst schieben sie raus) */
.bev-wrap > * { min-width: 0; }

/* Select füllt die Zeile, darf schrumpfen */
.bev-sel{
  flex: 1 1 220px;         /* wächst, darf schrumpfen */
  min-width: 140px;        /* Untergrenze; bei weniger → Umbruch */
  max-width: 100%;
}

/* Menge + Buttons mit fester Breite */
.bev-qty{ flex: 0 0 56px; text-align:right; }
.bev-btn{
  flex: 0 0 28px; width:28px; height:28px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
}

/* Zähler steht immer auf eigener Zeile rechts */
.bev-count{
  flex: 1 0 100%;          /* neue Zeile */
  order: 2;                /* nach den Controls */
  text-align:right;
  display:inline-block;
  height:22px; line-height:22px;
  min-width:34px; padding:0 6px;
  border-radius:9999px;
  border:1px solid rgba(255,255,255,.20);
  white-space:nowrap;
  opacity:.85;
  pointer-events:none;     /* klickt nichts weg */
}
.bev-count.bev-count--empty{ opacity:.45; border-color:transparent; }

/* Kompaktmodus enger */
.compact-wrap.compact .bev-sel{ flex-basis:180px; min-width:120px; }
.compact-wrap.compact .bev-qty{ flex-basis:48px; }
.compact-wrap.compact .bev-btn{ width:24px; height:24px; }
.compact-wrap.compact .bev-count{ font-size:.85rem; }

/* Bezahlt-Zelle: Checkbox bleibt immer ganz oben klickbar */
.paid-cell{
  position:relative; z-index:5;
  display:flex; align-items:center; justify-content:center;
}
.paid-cell .paid-toggle{ position:relative; z-index:6; }

/* Komfort in der Getränkespalte */
.bev-sel { min-width:220px; }   /* vorher evtl. 160px */
.bev-qty { width:56px; }        /* bleibt kompakt */

.inline-del { display:inline; margin-left:6px }
.chip-del   { width:22px; height:22px; border-radius:9999px; border:0; cursor:pointer; }
.chip-del:hover { background:rgba(255,255,255,.12); }

/* --- Add-Shooter Suggest --- */
.add-suggest-wrap{ position:relative; display:block; max-width:100%; }
.add-fields{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.add-fields .input{ min-width:160px; height:32px; }

.suggest-menu{
  position:absolute; top:calc(100% + 6px); left:0; right:0;
  z-index:60; background:#0b1220; border:1px solid #334155;
  border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.35);
  max-height:260px; overflow:auto; padding:6px;
}
.suggest-header{
  font-size:.85rem; opacity:.8; padding:4px 8px 6px; border-bottom:1px solid rgba(255,255,255,.06);
  margin-bottom:6px;
}
.suggest-item{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:8px 10px; border-radius:8px; cursor:pointer;
}
.suggest-item:hover, .suggest-item.active{ background:rgba(59,130,246,.15); }
.suggest-name{ font-weight:600; }
.suggest-meta{ opacity:.8; font-size:.9rem; }
.suggest-empty{ padding:10px; opacity:.8; }

.badge-mini{
  display:inline-block; border:1px solid rgba(255,255,255,.18);
  border-radius:9999px; padding:0 6px; line-height:20px; font-size:.8rem; margin-left:8px;
}
/* Kompakter Getränke-Zähler in der Formularzeile */
.bev-form{ display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.bev-form .btn{ width:26px; height:26px; padding:0; display:inline-flex; align-items:center; justify-content:center; }

/* --- Getränke-Zähler: winziger Chip, keine Ausdehnung --- */
.bev-count{
  display:inline-block !important;
  width:auto !important;
  min-width:auto !important;
  height:18px; line-height:16px;
  font-size:.80rem;
  padding:0 6px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.25);
  background:transparent;
  flex:0 0 auto !important;   /* niemals strecken */
  margin:0 !important;        /* kein Auto-Spacing */
}
.bev-count--compact{ height:18px; line-height:16px; font-size:.80rem; padding:0 6px; }
.bev-count--empty{ opacity:.45; border-color:transparent; }


/* im Kompaktmodus noch etwas kleiner */
.compact-wrap.compact .bev-form .btn{ width:22px; height:22px; }
.compact-wrap.compact .bev-count--compact{ height:18px; min-width:20px; font-size:.75rem; padding:0 5px; }

.row.noprint.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* --- Autocomplete/Suggest sichtbar machen --- */
.typeahead, .autocomplete, .ac-list { color: inherit; }
.typeahead li, .autocomplete li, .ac-list li { color: #eaeaea; }           /* deine helle Schrift */
.typeahead mark, .autocomplete mark, .ac-list mark {
  background: #ffd24a;   /* kontrastreiches Gelb */
  color: #000;           /* schwarze Schrift innerhalb des mark */
  padding: 0 .1em;
  border-radius: 2px;
}
/* Falls irgendwo versehentlich Farbe auf "transparent" gesetzt wurde: */
.typeahead li span, .autocomplete li span, .ac-list li span { color: inherit; }

/* Ghost-X: nur Rahmen, dezentes Hover, Dark-Theme-kompatibel */
.btn-x {
  width: 26px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);   /* Slate-300 */
  color: rgba(203, 213, 225, 0.9);               /* Slate-200 */
  background: transparent;
  font-weight: 700; line-height: 1;
}
.btn-x:hover {
  border-color: rgba(203, 213, 225, 0.8);
  background: rgba(148, 163, 184, 0.10);
}
.btn-x:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.55);
  outline-offset: 2px;
}
.btn-x--danger:hover {                           /* nur leichtes Warngefühl */
  border-color: rgba(248, 113, 113, 0.55);       /* soft red */
  background: rgba(248, 113, 113, 0.10);
  color: rgba(254, 226, 226, 0.95);
}


/* =========================================================
   Globale Select-Optionen für Dark/Light Mode
   Verhindert schlecht lesbare Dropdown-Einträge
   ========================================================= */
select,
.input[type="date"],
input[type="date"] {
  color-scheme: dark;
}

select option,
select optgroup {
  background: #111827;
  color: #f9fafb;
}

select option:checked,
select option:hover,
select option:focus {
  background: #374151;
  color: #ffffff;
}

body.light select,
body.light .input[type="date"],
body.light input[type="date"] {
  color-scheme: light;
}

body.light select option,
body.light select optgroup {
  background: #ffffff;
  color: #111827;
}

body.light select option:checked,
body.light select option:hover,
body.light select option:focus {
  background: #dbeafe;
  color: #111827;
}


/* LOGO FRAME OVERRIDE */
.club-logo,
img.club-logo,
.header-left .club-logo,
.app-header .club-logo,
.module-hero .club-logo,
.page-shell .club-logo,
.page-wrap .club-logo,
img[src*="/static/uploads/logos/"],
img[src*="/static/img/logo"] {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}


/* TENANT LOGO SIZE SYSTEM */
.logo-frameless {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.logo-size-hero {
  width: 72px !important;
  height: 72px !important;
  object-fit: contain !important;
}

@media (min-width: 900px) {
  .logo-size-hero {
    width: 84px !important;
    height: 84px !important;
  }
}

/* =========================
   Tenant Admin Modern UI
   ========================= */
.admin-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% -10%, rgba(37, 99, 235, .18), transparent 32%),
    linear-gradient(180deg, #0b1220 0%, #111827 48%, #0f172a 100%);
  color: #e5e7eb;
}

body.light.admin-body {
  background:
    radial-gradient(circle at 18% -10%, rgba(37, 99, 235, .12), transparent 32%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #0f172a;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(30, 41, 59, .78));
  box-shadow: 0 16px 44px rgba(0, 0, 0, .24);
}

body.light .admin-hero {
  border-color: rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.admin-kicker {
  margin-bottom: 6px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.light .admin-kicker { color: #1d4ed8; }

.admin-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.04;
}

.admin-subtitle {
  margin-top: 8px;
  color: #cbd5e1;
  line-height: 1.45;
}

body.light .admin-subtitle { color: #475569; }

.admin-actions,
.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-actions { justify-content: flex-end; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.admin-card {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(15, 23, 42, .62);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}

body.light .admin-card {
  border-color: rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

.admin-card h2,
.admin-card h3 {
  margin: 0 0 10px;
  letter-spacing: 0;
}

.admin-stat {
  display: grid;
  gap: 6px;
}

.admin-stat-value {
  font-size: 36px;
  line-height: 1;
  font-weight: 850;
}

.admin-muted {
  color: #94a3b8;
}

body.light .admin-muted { color: #64748b; }

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .48);
}

body.light .admin-table-wrap {
  border-color: rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .82);
}

.admin-table {
  min-width: 760px;
  margin: 0;
  background: transparent;
}

.admin-table th {
  background: rgba(15, 23, 42, .72);
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.light .admin-table th {
  background: #e2e8f0;
  color: #334155;
}

.admin-table th,
.admin-table td {
  border-color: rgba(148, 163, 184, .16);
  padding: 10px 12px;
  text-align: left;
}

body.light .admin-table th,
body.light .admin-table td { border-color: rgba(15, 23, 42, .10); }

.admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .16);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
}

body.light .admin-pill {
  background: #dbeafe;
  color: #1e40af;
}

.admin-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
}

body.light .admin-empty { color: #64748b; }

.admin-form-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: center;
}

.admin-form-grid label,
.admin-label {
  font-weight: 700;
}

.admin-section {
  margin-top: 16px;
}

.admin-upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-btn,
a.admin-btn,
button.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: rgba(15, 23, 42, .62);
  color: #e5e7eb;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.admin-btn:hover,
a.admin-btn:hover,
button.admin-btn:hover {
  filter: brightness(1.08);
}

.admin-btn-primary,
a.admin-btn-primary,
button.admin-btn-primary {
  border-color: rgba(37, 99, 235, .55);
  background: #2563eb;
  color: #fff;
}

.admin-btn-danger,
a.admin-btn-danger,
button.admin-btn-danger {
  border-color: rgba(220, 38, 38, .55);
  background: #dc2626;
  color: #fff;
}

.admin-btn-ghost,
a.admin-btn-ghost,
button.admin-btn-ghost {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, .26);
}

.ops-quickbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.ops-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  background: rgba(15, 23, 42, .52);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.15;
}

.ops-status-pill strong {
  color: #e5e7eb;
  margin-left: 4px;
}

.ops-status-success {
  border-color: rgba(22, 163, 74, .38);
  background: rgba(22, 101, 52, .20);
  color: #86efac;
}

.ops-progress-pill.neutral {
  border-color: rgba(148, 163, 184, .24);
}

.ops-progress-pill {
  min-height: 34px;
  box-shadow: none;
}

.ops-progress-pill.green {
  border-color: rgba(22, 163, 74, .42);
  background: rgba(22, 101, 52, .22);
  color: #86efac;
}

.ops-progress-pill.yellow {
  border-color: rgba(245, 158, 11, .42);
  background: rgba(120, 53, 15, .22);
  color: #fcd34d;
}

.ops-progress-pill.red {
  border-color: rgba(220, 38, 38, .42);
  background: rgba(127, 29, 29, .22);
  color: #fca5a5;
}

.ops-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr) !important;
  gap: 14px;
  align-items: start;
  margin: 0 0 18px;
}

.ops-card-operation {
  grid-column: 1;
  grid-row: 1;
}

.ops-card-live {
  grid-column: 2;
  grid-row: 1;
}

.ops-card-admin {
  grid-column: 1 / -1;
}

.ops-main-grid .module-card,
.ops-main-grid .module-side {
  min-height: auto;
}

.ops-main-grid .module-card p,
.ops-main-grid .module-side p {
  min-height: 0;
}

.ops-card-admin .menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.light .admin-btn,
body.light a.admin-btn,
body.light button.admin-btn {
  background: #fff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, .14);
}

body.light .admin-btn-primary,
body.light a.admin-btn-primary,
body.light button.admin-btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

body.light .admin-btn-danger,
body.light a.admin-btn-danger,
body.light button.admin-btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

body.light .admin-btn-ghost,
body.light a.admin-btn-ghost,
body.light button.admin-btn-ghost {
  background: transparent;
  color: #334155;
}

body.light .ops-status-pill {
  background: rgba(255, 255, 255, .82);
  color: #475569;
  border-color: rgba(15, 23, 42, .12);
}

body.light .ops-status-pill strong {
  color: #0f172a;
}

body.light .ops-status-success {
  background: rgba(22, 163, 74, .10);
  color: #166534;
  border-color: rgba(22, 163, 74, .24);
}

body.light .ops-progress-pill.green {
  background: rgba(22, 163, 74, .10);
  color: #166534;
  border-color: rgba(22, 163, 74, .24);
}

body.light .ops-progress-pill.yellow {
  background: rgba(245, 158, 11, .12);
  color: #92400e;
  border-color: rgba(245, 158, 11, .28);
}

body.light .ops-progress-pill.red {
  background: rgba(220, 38, 38, .10);
  color: #991b1b;
  border-color: rgba(220, 38, 38, .24);
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 10px;
  }

  .admin-hero {
    flex-direction: column;
    padding: 15px;
  }

  .admin-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .admin-actions .btn,
  .admin-actions .btn-primary,
  .admin-actions .admin-btn,
  .admin-row-actions .btn,
  .admin-row-actions .btn-primary,
  .admin-row-actions .admin-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .ops-main-grid {
    grid-template-columns: 1fr;
  }

  .ops-card-operation,
  .ops-card-live,
  .ops-card-admin {
    grid-column: 1;
    grid-row: auto;
  }
}
