:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e2e5eb;
  --text: #1c2230;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --herre: #dbeafe;
  --dame: #fce7f3;
  --mix: #dcfce7;
  --singles: #fef3c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 3rem;
}

header {
  padding: 2rem 1.5rem 1rem;
  text-align: center;
}
header h1 { margin: 0 0 0.25rem; }
header .sub { color: var(--muted); margin: 0; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.card h2 { margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

input, select, button {
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: #6b7280; }
button.danger { background: #dc2626; }

#add-player-form { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

select.attend-select[data-value="afbud"] { color: #dc2626; }
select.attend-select[data-value="kommer"] { color: #16a34a; }

.plan-round { margin-bottom: 1.5rem; }
.plan-round h3 { margin: 0 0 0.5rem; }
.bench-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }

.court-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
}
.court-row .court-label { font-weight: 700; width: 4.5rem; flex-shrink: 0; }
.court-row .vs { color: var(--muted); font-weight: 600; }
.court-row .team { font-weight: 600; }
.court-row .type-tag {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: auto;
  white-space: nowrap;
}

.match-herredouble { background: var(--herre); }
.match-damedouble { background: var(--dame); }
.match-mixeddouble { background: var(--mix); }
.match-singles { background: var(--singles); }

#history-list table { margin-top: 0.5rem; }
