:root {
  --sgm-green: #00a551;
  --sgm-green-dark: #00863f;
  --sgm-blue: #0066b2;
  --sgm-red: #e1071a;
  --sgm-yellow: #fcdd17;
  --sgm-orange: #f2940a;
  --sgm-purple: #921c7f;
  --bg: #f4f6f5;
  --card-bg: #ffffff;
  --border: #dfe3e1;
  --text: #1a1f1c;
  --text-muted: #667066;
}

* { box-sizing: border-box; }

body {
  font-family: "Poppins", -apple-system, Segoe UI, Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

h1 { font-size: 21px; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 17px; font-weight: 600; margin: 0; }
h3 { font-size: 13px; font-weight: 600; }

a { color: var(--sgm-blue); }

/* Topbar */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--sgm-orange), var(--sgm-yellow), var(--sgm-green), var(--sgm-blue), var(--sgm-purple), var(--sgm-red)) 1;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar .brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-badge {
  background: var(--sgm-green);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
}

.topbar nav a { text-decoration: none; color: var(--sgm-blue); font-weight: 600; }
.topbar nav .user { color: var(--text-muted); }

/* Flash messages */
.flashes { margin: 16px 0; }
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 14px;
}
.flash-error { background: #fde8e8; color: #a3121f; }
.flash-success { background: #e2f6ea; color: var(--sgm-green-dark); }

/* Login */
.login-box {
  max-width: 360px;
  margin: 64px auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 20px;
}
.login-brand-name { font-weight: 700; font-size: 16px; }

.login-box label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
}

.login-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Buttons */
button, .btn {
  background: var(--sgm-green);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--sgm-green-dark); }
button:disabled { background: #a9b2ae; cursor: not-allowed; }

.btn-secondary { background: #6b7568; }
.btn-secondary:hover { background: #52594e; }
.btn-danger { background: var(--sgm-red); }
.btn-danger:hover { background: #a3121f; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  margin-bottom: 12px;
  min-width: 420px;
}
table th, table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eef0ee;
  font-size: 14px;
}
table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; }

/* Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.card label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
}

.card input[type="text"],
.card input[type="password"],
.card input[type="file"],
.card input[type="date"],
.card select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.card .checkbox-label {
  font-weight: normal;
  display: block;
  margin-bottom: 8px;
}

.card .checkbox-label input { width: auto; margin-right: 6px; }

.hint { color: var(--text-muted); font-size: 13px; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 14px 0;
}
legend { font-size: 13px; color: var(--text-muted); padding: 0 6px; }

/* Dashboard tool tiles */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--sgm-green);
  border-radius: 8px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow 0.15s ease;
}
.tool-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.tool-card h3 { margin: 0 0 6px 0; font-size: 15px; color: var(--text); }
.tool-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Ledenoverzicht groepen */
.speltak-group {
  margin-bottom: 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--sgm-green);
  border-radius: 8px;
  padding: 14px 18px 6px;
  overflow-x: auto;
}
.speltak-group h3 { color: var(--text-muted); margin: 14px 0 4px 0; text-transform: uppercase; letter-spacing: 0.03em; }

/* Import-diff */
.diff-card { border-left: 5px solid var(--border); }
.diff-added { border-left-color: var(--sgm-green); }
.diff-removed { border-left-color: var(--sgm-red); }
.diff-changed { border-left-color: var(--sgm-orange); }

/* Contactgegevens (uitklapbaar per naam) */
table details summary {
  cursor: pointer;
  color: var(--text);
  list-style: none;
}
table details summary::-webkit-details-marker { display: none; }
table details summary::marker { display: none; content: ""; }
table details[open] summary { margin-bottom: 4px; }
.contact-info {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0 2px 4px;
  border-left: 2px solid var(--border);
  margin-left: 2px;
}
.contact-info div { margin-bottom: 2px; }

/* VOG-status */
.vog-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.vog-badge-geldig { background: var(--sgm-green); }
.vog-badge-verlopen { background: var(--sgm-orange); }
.vog-badge-ontbrekend { background: var(--sgm-red); }

/* Toestemming foto's: inline status-knoppen */
.tf-form {
  display: flex;
  gap: 4px;
  margin: 0;
}
.tf-btn {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}
.tf-btn:hover { background: var(--bg); }
.tf-ja.tf-active { background: var(--sgm-green); color: #fff; border-color: var(--sgm-green); }
.tf-nee.tf-active { background: var(--sgm-red); color: #fff; border-color: var(--sgm-red); }
.tf-onbekend.tf-active { background: #94a3b8; color: #fff; border-color: #94a3b8; }

/* Aanwezigheid */
.aanw-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}
.aanw-btn:hover { background: var(--bg); }
.aanw-aanwezig { background: var(--sgm-green); color: #fff; border-color: var(--sgm-green); }
.aanw-aanwezig:hover { background: var(--sgm-green-dark); }
.aanw-afwezig { background: var(--sgm-red); color: #fff; border-color: var(--sgm-red); }
.aanw-afwezig:hover { background: #a3121f; }
.aanw-afgemeld { background: var(--sgm-orange); color: #fff; border-color: var(--sgm-orange); }
.aanw-afgemeld:hover { background: #c47d00; }

.geen-fotos-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
  color: var(--sgm-red);
}
.geen-fotos-icon svg { display: block; }

/* Responsive */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .brand-name { font-size: 13px; }
  main { margin: 14px auto; padding: 0 10px 30px; }
  .card, .speltak-group { padding: 14px 14px 6px; }
  .login-box { margin: 32px auto; padding: 20px; }
}
