:root {
  --color-primary: #1a5f9e;
  --color-primary-dark: #134a7a;
  --color-accent: #4a9fd4;
  --color-accent-light: #d0e8f7;
  --color-success: #198754;
  --color-danger: #dc3545;
  --color-warning: #ffc107;
  --color-bg: #f4f8fc;
  --color-card-bg: #ffffff;
  --color-text: #1e293b;
  --color-muted: #6c757d;
  --radius: 0.5rem;
  --shadow: 0 2px 8px rgba(26,95,158,0.10);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
  background: var(--color-primary) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.navbar-brand img { height: 42px; }
.navbar-brand span {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: .03em;
}
.navbar .nav-link { color: rgba(255,255,255,.85) !important; }
.navbar .nav-link:hover,
.navbar .nav-link.active { color: #fff !important; }

/* ── Cards ── */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header-primary {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: .75rem 1rem;
  font-weight: 600;
}

/* ── Tables ── */
.table-hobbyliga thead th {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary-dark);
  font-weight: 600;
}
.table-hobbyliga tbody tr:hover {
  background: var(--color-accent-light);
}
.table-hobbyliga tbody tr.rank-1 td:first-child { font-weight: 700; color: var(--color-primary); }

/* ── Badges for promotion/relegation ── */
.badge-aufsteiger {
  background: var(--color-success);
  color: #fff;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 99px;
}
.badge-absteiger {
  background: var(--color-danger);
  color: #fff;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 99px;
}

/* ── Match result form ── */
.match-row { transition: background .15s; }
.match-row:hover { background: var(--color-accent-light); }
.match-row input[type=number] {
  width: 56px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #bcd;
  padding: 2px 4px;
}

/* ── Progress bar ── */
.progress { height: 8px; border-radius: 99px; }
.progress-bar { background: var(--color-accent); }

/* ── Export box ── */
.export-box {
  background: #fff;
  border: 1px solid #c8dff0;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  font-family: monospace;
  font-size: .92rem;
  white-space: pre-wrap;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}
.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-primary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ── Status pill ── */
.status-done { color: var(--color-success); font-weight: 600; }
.status-open { color: var(--color-muted); }

/* ── Admin bar ── */
.admin-bar {
  background: #fff3cd;
  border-bottom: 2px solid var(--color-warning);
  padding: .4rem 0;
  font-size: .85rem;
}

/* ── Button sizes ── */
.btn-xs {
  font-size: .72rem;
  padding: .15rem .45rem;
  border-radius: .25rem;
}

/* ── Avatar images ── */
.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent-light);
}
.avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ── Avatar upload zone ── */
.avatar-upload-zone {
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: background .2s;
}
.avatar-upload-zone.drag-over {
  background: var(--color-accent-light);
}

/* ── Category badges ── */
.cat-btn { font-weight: 700; min-width: 2rem; }
.cat-A { background: #198754 !important; color: #fff !important; border-color: #198754 !important; }
.cat-B { background: var(--color-primary) !important; color: #fff !important; border-color: var(--color-primary) !important; }
.cat-C { background: var(--color-muted) !important; color: #fff !important; border-color: var(--color-muted) !important; }
.cat-D { background: #7c3aed !important; color: #fff !important; border-color: #7c3aed !important; }
.cat-null, .cat-None { background: #fff !important; color: var(--color-muted) !important; border-color: #ccc !important; }

.playtype-btn { font-weight: 700; min-width: 3rem; }
.playtype-einzel { background: var(--color-primary) !important; color: #fff !important; border-color: var(--color-primary) !important; }
.playtype-doppel { background: #f59e0b !important; color: #1e293b !important; border-color: #f59e0b !important; }
.playtype-beides { background: #198754 !important; color: #fff !important; border-color: #198754 !important; }

/* ── Responsive tweaks ── */

/* Tablet (iPad mini ~768px) */
@media (max-width: 991px) {
  .table { font-size: .85rem; }
  .btn-xs { font-size: .7rem; padding: .2rem .45rem; }
  .admin-bar { font-size: .82rem; }
  /* Hide less critical table columns on tablet */
  .col-hide-tablet { display: none !important; }
}

/* Phone (≤576px) */
@media (max-width: 576px) {
  h2 { font-size: 1.2rem; }
  .match-row input[type=number] { width: 44px; }
  .col-hide-phone { display: none !important; }
}

/* Score entry form — wrap gracefully on narrow screens */
.score-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.score-form .score-group { display: flex; flex-direction: column; }
.score-form .score-inputs { display: flex; gap: 4px; }
.score-form input[type=number] { width: 50px; text-align: center; padding: .25rem .3rem; }
.score-form input[type=date] { width: 140px; }
