:root {
  --surface-2: #ffffff;
  --surface-1: #f6f5f1;
  --surface-0: #efede7;
  --text-primary: #1f1f1d;
  --text-secondary: #5f5e5a;
  --text-muted: #8b8a83;
  --border: #e3e1d9;
  --border-strong: #cfcdc3;
  --text-accent: #185fa5;
  --bg-accent: #e6f1fb;
  --border-accent: #85b7eb;
  --text-success: #0f6e56;
  --bg-success: #e1f5ee;
  --text-danger: #a32d2d;
  --bg-danger: #fcebeb;
  --border-danger: #f09595;
  --text-warn: #8a5a13;
  --bg-warn: #fdf1de;
  --border-warn: #f0c675;
  --radius: 8px;
  --radius-lg: 12px;
  --btn-h: 36px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 28px;
  background: var(--surface-0);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1200px; margin: 0 auto; }
.card {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--border);
}
.app-header h1 { font-size: 16px; font-weight: 500; margin: 0; }
.sub { padding: 12px 18px 16px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }

input, select, textarea, button { font-family: inherit; font-size: 13px; color: var(--text-primary); }
input[type="text"], input[type="email"], input[type="password"] {
  background: var(--surface-2);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  height: var(--btn-h);
  padding: 0 12px;
  width: 100%;
}
input:focus { border-color: var(--text-accent); box-shadow: 0 0 0 3px var(--bg-accent); }
label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; }

.password-field-wrap { position: relative; }
.password-field-wrap input { padding-right: 40px; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  height: 28px; width: 28px; padding: 0; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 15px; color: var(--text-muted);
}
.password-toggle:hover { color: var(--text-primary); background: var(--surface-1); border-radius: 6px; }
.icon-svg { width: 16px; height: 16px; display: block; flex-shrink: 0; }

button {
  height: var(--btn-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
button:hover { background: var(--surface-1); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--text-accent); border-color: var(--text-accent); color: #fff; font-weight: 600; width: 100%; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
button.small { height: 32px; padding: 0 10px; font-size: 12px; }
.segbtn.on { background: var(--surface-2); border-color: var(--text-accent); color: var(--text-accent); }
button.link {
  height: auto; border: none; background: none; padding: 0;
  color: var(--text-accent); font-weight: 500; text-decoration: underline;
}
button.danger { color: var(--text-danger); border-color: var(--border-danger); }

.error { color: var(--text-danger); font-size: 13px; }
.status-line { font-size: 12px; color: var(--text-muted); display: block; margin-top: 6px; }
.status-line.ok { color: var(--text-success); }
.status-line.error { color: var(--text-danger); }

/* centered auth card (login / reset-password) */
.auth-wrap { max-width: 380px; margin: 12vh auto 0; }
.auth-card { padding: 24px; }
.auth-card h1 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.auth-card .sub { padding: 0 0 18px; }
.field { margin-bottom: 14px; }
.field:last-of-type { margin-bottom: 0; }
.auth-actions { margin-top: 18px; }
.auth-footer { margin-top: 16px; text-align: center; font-size: 12px; }

/* admin table */
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin th, table.admin td { padding: 9px 12px; border-top: 0.5px solid var(--border); text-align: left; }
table.admin thead th { background: var(--surface-1); color: var(--text-secondary); font-weight: 500; border-top: none; position: sticky; top: 0; }
table.admin td.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.admin { color: var(--text-accent); background: var(--bg-accent); }
.badge.owner { color: var(--text-warn); background: var(--bg-warn); }
.badge.pending { color: var(--text-warn); background: var(--bg-warn); }
.badge.active { color: var(--text-success); background: var(--bg-success); }
.badge.locked { color: var(--text-danger); background: var(--bg-danger); }

.chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px;
  font-size: 14px; font-weight: 700; line-height: 1;
  color: var(--text-accent); background: var(--bg-accent);
}

/* dropdown-paneel (taalkeuze e.d.) */
.col-dropdown { position: relative; display: inline-block; }
.col-dropdown-panel {
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 20; min-width: 170px; max-height: 320px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(31,31,29,0.14);
}
.col-dropdown-panel.hidden { display: none; }
.col-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-primary); cursor: pointer;
  padding: 5px 8px; border-radius: 6px; user-select: none;
}
.col-dropdown-item:hover { background: var(--surface-1); }
.add-user-row { display: flex; gap: 10px; align-items: flex-end; padding: 16px 18px; border-top: 0.5px solid var(--border); background: var(--surface-1); flex-wrap: wrap; }
.add-user-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }
.checkbox-field { display: flex; align-items: center; gap: 6px; height: var(--btn-h); }
.checkbox-field label { margin: 0; font-weight: 500; color: var(--text-primary); }

/* gebruikersnaam als klikbare link naar het actiepaneel */
.name-link {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--text-accent); font-weight: 600; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.name-link:hover { filter: brightness(1.15); }

/* actiepaneel (modal) per gebruiker */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,20,18,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-card { background: var(--surface-2); border-radius: var(--radius-lg); max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 0.5px solid var(--border); }
.modal-header h2 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.modal-info { display: flex; flex-direction: column; gap: 8px; }
.modal-info-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 12px; }
.modal-info-row .label { color: var(--text-muted); white-space: nowrap; }
.modal-info-row .value { text-align: right; word-break: break-all; }
.modal-section { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.modal-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.admin-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); margin: 28px 2px 8px;
}
.admin-group-title:first-child { margin-top: 0; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-lang-row { display: flex; gap: 8px; align-items: center; }
select.modal-lang-select {
  flex: 1; height: var(--btn-h); border-radius: var(--radius); border: 0.5px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-primary); padding: 0 10px; font-size: 13px;
}

/* Eigen bevestigingsdialoog i.p.v. het native confirm()/alert() van de browser
   (dat toont "<host> says…" erboven, buiten onze eigen styling om). Zelfde
   opzet als de variant in index.html — die pagina laadt shared.css bewust niet,
   dus de stijl bestaat noodgedwongen op twee plekken. */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(20,20,18,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.confirm-card {
  background: var(--surface-2); border-radius: var(--radius-lg); max-width: 420px; width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25); padding: 20px;
}
.confirm-message { font-size: 13px; color: var(--text-primary); line-height: 1.5; margin: 0 0 18px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
/* button.primary is in shared.css full-width (voor formulieren); in een
   knoppenrij moet hij zich naar zijn tekst voegen. */
.confirm-actions button { width: auto; }
