:root {
  --primary: #087bc6;
  --primary-dark: #06649f;
  --gray-50: #f7f8f9;
  --gray-100: #eceff1;
  --gray-300: #cbd3d8;
  --gray-600: #5a6672;
  --gray-900: #1d2429;
  --success: #2e9e46;
  --danger: #d1393c;
  --warning: #d9962a;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.4;
}

a {
  color: var(--primary);
}

header.app-header {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

header.app-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}

header.app-header .logo-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

nav.main-nav {
  display: flex;
  overflow-x: auto;
  background: var(--primary-dark);
}

nav.main-nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1rem;
  white-space: nowrap;
  font-size: 0.9rem;
}

nav.main-nav a.active {
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(29, 36, 41, 0.06);
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--gray-900);
}

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

.kennzahl {
  text-align: center;
}

.kennzahl .wert {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.kennzahl .label {
  color: var(--gray-600);
  font-size: 0.85rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

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

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(29, 36, 41, 0.06);
}

.table-scroll table {
  box-shadow: none;
  border-radius: 0;
}

.spiele-tabelle td,
.spiele-tabelle th {
  padding: 0.5rem 0.6rem;
}

.spiele-tabelle td a {
  color: var(--gray-900);
  text-decoration: none;
  font-weight: 600;
}

.spiele-tabelle td a:hover {
  color: var(--primary);
}

@media (max-width: 480px) {
  .hide-sm {
    display: none;
  }
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(29, 36, 41, 0.12);
  transition: background-color 0.15s ease;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-300);
  color: var(--gray-900);
}

form p {
  margin: 0.5rem 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  color: var(--gray-900);
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--gray-600) 50%),
    linear-gradient(135deg, var(--gray-600) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) center,
    calc(100% - 13px) center;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 123, 198, 0.15);
}

input[type="date"],
input[type="time"] {
  min-height: 2.6rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.badge-dabei,
.badge-aktiv,
.badge-gute_aktion {
  background: var(--success);
}

.badge-gefehlt_unentschuldigt,
.badge-abgemeldet {
  background: var(--danger);
}

.badge-verletzt,
.badge-pausiert,
.badge-verbesserung {
  background: var(--warning);
}

.badge-gefehlt_entschuldigt,
.badge-allgemein {
  background: var(--gray-600);
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.messages li {
  background: var(--success);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
}

.spieler-zeile {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.spieler-zeile h3 {
  margin: 0 0 0.5rem;
}

.spieler-zeile .felder {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.notizen-liste {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.notizen-liste li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.85rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-bar select {
  width: auto;
}

.login-card {
  max-width: 360px;
  margin: 3rem auto;
}

@media (min-width: 640px) {
  main {
    padding: 1.5rem;
  }
}
