/* ============================================================
   SIT Teamtraining - beheer / admin styles
   Consistent met Wedstrijdanalyse: --wa-primary, --wa-secondary via
   organisatie-branding op :root (base.html).
   ============================================================ */
:root {
  --wa-primary:   #FF6B1A;
  --wa-secondary: #00355F;
  --on-primary:   #FFFFFF;
  --on-secondary: #FFFFFF;
  --tt-bg:      #F1F5F9;
  --tt-panel:   #FFFFFF;
  --tt-text:    #0F172A;
  --tt-muted:   #64748B;
  --tt-border:  #E2E8F0;
  --tt-danger:  #DC2626;
  --tt-good:    #16A34A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tt-text);
  background: var(--tt-bg);
}

a { color: var(--wa-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1rem;
  background: #FFFFFF;
  color: var(--tt-text);
  border-bottom: 3px solid var(--wa-primary);
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}
.topbar-brand { display: flex; align-items: center; gap: 0.5rem; color: var(--tt-text); text-decoration: none; }
.topbar-brand img { max-height: 64px; }
.topbar-brand-name { font-weight: 700; font-size: 1.15rem; line-height: 4rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.topbar-user { color: var(--tt-muted); }
.topbar-logout { color: var(--tt-muted); opacity: 0.9; }

/* ---- Pages ---- */
.app-main { padding: 1rem; }
.page { max-width: 1200px; margin: 0 auto; }
.page h1 { margin: 0.25rem 0 0.75rem; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 0.75rem; }
.page-subtitle { color: var(--tt-muted); margin: 0 0 0.75rem; }

.panel {
  background: var(--tt-panel);
  border: 1px solid var(--tt-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.panel h2, .panel h3 { margin-top: 0; }

.muted { color: var(--tt-muted); }
.warn  { color: #b45309; }
.danger, .num.danger { color: var(--tt-danger); }
.badge {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 9999px;
  background: #eef2f7; color: #475569; font-size: 0.8rem;
}
.badge.tag { background: rgba(255,107,26,0.10); color: var(--wa-primary); }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem 1rem; }
.form-grid label { display: flex; flex-direction: column; gap: 0.25rem; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid label > span { font-size: 0.85rem; color: var(--tt-muted); }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
input, select, textarea {
  font: inherit;
  padding: 0.45rem 0.6rem; border: 1px solid var(--tt-border); border-radius: 6px;
  background: #fff; color: var(--tt-text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wa-primary); }
textarea { min-height: 4rem; resize: vertical; }

.row-actions { display: flex; gap: 0.4rem; align-items: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--tt-border); border-radius: 6px;
  background: #fff; color: var(--tt-text);
  cursor: pointer; font-weight: 500; text-decoration: none;
  transition: transform 0.05s, background 0.1s, border-color 0.1s;
}
.btn:hover { background: #F1F5F9; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--wa-primary); color: var(--on-primary); border-color: transparent; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.danger  { background: var(--tt-danger); color: #fff; border-color: transparent; }
.btn.ghost   { background: transparent; }
.btn.tiny    { padding: 0.25rem 0.55rem; font-size: 0.85rem; }
.btn.google  { background: #fff; color: var(--tt-text); border-color: var(--tt-border); }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.table th, .table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--tt-border);
  text-align: left; vertical-align: middle;
}
.table th { background: #F8FAFC; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--tt-muted); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover td { background: rgba(15,23,42,0.03); }
.table td.actions { white-space: nowrap; width: 1%; }

/* ---- Chips (tag-selector) ---- */
.chip-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.65rem; border-radius: 9999px;
  background: rgba(255,107,26,0.10); color: var(--wa-primary); font-size: 0.85rem;
  border: 1px solid rgba(255,107,26,0.20);
}
.chip .chip-x {
  cursor: pointer; opacity: 0.65; margin-left: 0.15rem;
  background: transparent; border: 0; color: inherit; font-size: 1rem; line-height: 1;
}
.chip .chip-x:hover { opacity: 1; }

.chip-input-wrap {
  border: 1px solid var(--tt-border); border-radius: 6px; padding: 0.4rem;
  background: #fff; display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 2.4rem;
}
.chip-input-wrap input {
  border: none; outline: none; flex: 1 1 8rem; min-width: 6rem; padding: 0.2rem;
}
.chip-suggest {
  border: 1px solid var(--tt-border); border-top: 0; border-radius: 0 0 6px 6px;
  background: #fff; max-height: 12rem; overflow-y: auto; margin-top: -1px;
}
.chip-suggest button {
  display: block; width: 100%; text-align: left; padding: 0.4rem 0.6rem;
  background: #fff; border: 0; cursor: pointer; font: inherit; color: var(--tt-text);
}
.chip-suggest button:hover { background: #F1F5F9; }
.chip-suggest .create-hint { color: var(--wa-primary); font-weight: 500; }

/* ---- Foto-grid (oefening-detail) ---- */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.foto-card { border: 1px solid var(--tt-border); border-radius: 8px; overflow: hidden; background: #fff; }
.foto-card img { width: 100%; height: 140px; object-fit: cover; display: block; background: #F8FAFC; }
.foto-card-body { padding: 0.5rem; }
.foto-card-body input { width: 100%; }
.foto-card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; gap: 0.35rem; }
.foto-card-drag { color: var(--tt-muted); cursor: grab; font-size: 1.1rem; }

/* ---- Landing / login ---- */
.landing {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--wa-secondary), #0B1F3A);
  color: #fff; margin: 0;
}
.landing-card {
  background: #fff; color: var(--tt-text);
  padding: 2rem 2.5rem; border-radius: 12px; max-width: 480px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.landing-card h1 { margin-top: 0; color: var(--wa-secondary); }
.landing-card .btn { display: inline-block; margin: 0.5rem 0; }
.error { color: var(--tt-danger); }

/* ---- Org switcher ---- */
.org-switch { position: relative; }
.org-switch-btn {
  background: transparent; color: var(--tt-text);
  border: 1px solid var(--tt-border); border-radius: 8px;
  padding: 0.35rem 0.75rem; font-size: 0.9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.org-switch-btn:hover { background: #F1F5F9; }
.org-switch-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--tt-border);
  border-radius: 8px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.10);
  display: none; z-index: 1000; padding: 4px 0;
}
.org-switch-menu.open { display: block; }
.org-switch-menu form { margin: 0; }
.org-switch-item {
  width: 100%; text-align: left; background: transparent;
  border: none; padding: 0.55rem 0.9rem; font-size: 0.92rem;
  color: var(--tt-text); cursor: pointer;
}
.org-switch-item:hover { background: #F8FAFC; }
.org-switch-item.is-current { color: var(--wa-primary); font-weight: 600; }

/* ---- App-launcher sidebar ---- */
.sit-shell { display: flex; min-height: calc(100vh - 60px); }
.sit-sidebar {
  width: 220px; flex-shrink: 0;
  background: #FFFFFF; border-right: 1px solid #E2E8F0;
  padding: 12px 0; overflow-y: auto;
  position: sticky; top: 0; align-self: flex-start;
  max-height: calc(100vh - 60px);
}
.sit-sidebar-list { display: flex; flex-direction: column; gap: 2px; }
.sit-sidebar-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  color: #0F172A; text-decoration: none; font-size: 0.95rem;
  border-left: 3px solid transparent; transition: background 0.1s;
}
.sit-sidebar-item:hover { background: #F8FAFC; text-decoration: none; }
.sit-sidebar-item .bi { font-size: 1.15rem; opacity: 0.85; }
.sit-sidebar-item.is-current { background: rgba(255,107,26,0.08); color: #FF6B1A;
  font-weight: 600; border-left-color: #FF6B1A; }
.sit-sidebar-item.is-current .bi { opacity: 1; }
.sit-sidebar-subnav { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 10px 46px; }
.sit-sidebar-subnav a { color: #64748B; text-decoration: none; font-size: 0.88rem;
  padding: 5px 10px; border-radius: 5px; }
.sit-sidebar-subnav a:hover { background: #F1F5F9; color: #0F172A; }
.sit-sidebar-subnav a.active { color: #FF6B1A; font-weight: 600; background: #FFF5EE; }
.sit-main { flex: 1; min-width: 0; }
@media (max-width: 768px) {
  .sit-sidebar { position: fixed; top: 60px; left: 0; bottom: 0; z-index: 900;
    transform: translateX(-100%); transition: transform 0.2s; box-shadow: 4px 0 20px rgba(0,0,0,0.10); }
  .sit-sidebar.open { transform: translateX(0); }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---- Two-column list + form (masterdata detail) ---- */
.md-split { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .md-split { grid-template-columns: 1fr; } }

/* ---- Empty state ---- */
.empty {
  padding: 1rem; color: var(--tt-muted); text-align: center;
  border: 1px dashed var(--tt-border); border-radius: 8px; margin: 0.5rem 0;
}

.hidden { display: none !important; }
