:root {
  --primary: #2c3e50;
  --accent: #3498db;
  --danger: #e74c3c;
  --success: #27ae60;
  --warning: #f39c12;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --border: #dde1e7;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --nav-height: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Navigation */
.navbar {
  background: var(--primary);
  color: white;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .brand { font-weight: 700; font-size: 18px; color: white; text-decoration: none; flex-shrink: 0; }
.nav-menu { display: flex; flex: 1; align-items: center; gap: 20px; }
.navbar nav { display: flex; gap: 4px; flex: 1; }
.navbar nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.15s;
}
.navbar nav a:hover, .navbar nav a.active { background: rgba(255,255,255,0.15); color: white; }
.navbar .user-info { font-size: 13px; color: rgba(255,255,255,0.7); white-space: nowrap; }
.navbar .btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.navbar .btn-logout:hover { background: rgba(255,255,255,0.2); }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Layout */
.page { padding: 24px; max-width: 1400px; margin: 0 auto; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 600; }

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9fa; }

/* Formulare */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: var(--text-muted); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Checkboxen Gruppe */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.checkbox-item input { margin: 0; }
.color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-admin { background: #fadbd8; color: #c0392b; }
.badge-superuser { background: #d2b4de; color: #6c3483; }
.badge-trainer { background: #d5e8d4; color: #27ae60; }
.badge-active { background: #d5e8d4; color: #27ae60; }
.badge-inactive { background: #f2f3f4; color: var(--text-muted); }
.badge-heim { background: #dbeafe; color: #1d4ed8; }
.badge-auswaerts { background: #fef3c7; color: #d97706; }
.badge-training { background: #ede9fe; color: #7c3aed; }
.badge-spiel { background: #fee2e2; color: #dc2626; }
.badge-turnier { background: #fef9c3; color: #ca8a04; }
.badge-archived { background: #e8e8e8; color: #666; }
.badge-cancelled { background: #f2f3f4; color: var(--text-muted); text-decoration: line-through; }
.badge-recurring { background: #dbeafe; color: #1d4ed8; }
.badge-single { background: #d5e8d4; color: #27ae60; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Login-Seite */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}
.login-card {
  background: white;
  border-radius: 14px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 22px; color: var(--primary); }
.login-logo p { color: var(--text-muted); font-size: 13px; }

/* Responsive */
@media (max-width: 768px) {
  .page { padding: 12px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .nav-hamburger { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    z-index: 99;
  }
  .nav-menu.open { display: flex; }
  .navbar nav { flex: none; flex-direction: column; width: 100%; }
  .navbar nav a { display: block; padding: 10px 12px; }
  .nav-menu .user-info {
    padding: 8px 12px 4px;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 4px;
  }
  .nav-menu .btn-logout,
  .nav-menu .btn[id="btn-profile"] {
    width: 100%;
    justify-content: center;
    margin: 2px 0 !important;
  }
}
