/* Verpleegkundige Tools - applicatiebrede visuele fundering */
:root {
  --app-bg: #f3f7f7;
  --surface: #ffffff;
  --surface-soft: #f8fbfb;
  --text: #17323a;
  --muted: #657b82;
  --border: #d9e4e5;
  --border-strong: #c7d7d9;
  --primary: #176b72;
  --primary-hover: #125b61;
  --primary-soft: #eaf5f5;
  --accent: #2f8790;
  --danger: #a53a3a;
  --danger-soft: #fff1f1;
  --warning-soft: #fff8e8;
  --warning-border: #e8c66d;
  --info-soft: #edf7ff;
  --info-border: #a7cde8;
  --shadow-sm: 0 1px 2px rgba(23, 50, 58, .05);
  --shadow: 0 10px 28px rgba(23, 50, 58, .07);
  --radius: 14px;
  --radius-sm: 9px;
  --focus: 0 0 0 3px rgba(23, 107, 114, .16);
}

html { color-scheme: light; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.container { width: min(1120px, calc(100% - 40px)); max-width: none; margin: 0 auto; padding: 38px 0 56px; }
.auth-container { max-width: 520px; padding-top: 8vh; }

h1, h2, h3 { color: #123039; line-height: 1.2; letter-spacing: -.018em; }
h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 3vw, 2.35rem); }
h2 { margin: 0 0 14px; font-size: 1.28rem; }
h3 { margin: 20px 0 8px; font-size: 1rem; }
p { margin-top: 0; }
small, .muted { color: var(--muted); }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }

.page-header, .admin-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.page-header p, .admin-header p { color: var(--muted); margin-bottom: 0; }
.breadcrumb { margin: 0 0 8px !important; font-size: .9rem; color: var(--muted); }
.top-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.top-links a, .admin-header > a, .admin-header-actions a, .admin-link {
  display: inline-flex; align-items: center; min-height: 38px; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-sm);
}
.top-links a:hover, .admin-header > a:hover, .admin-header-actions a:hover, .admin-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.card > :last-child { margin-bottom: 0; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.module-card { position: relative; display: block; min-height: 150px; text-decoration: none; color: inherit; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #b9d4d6; color: inherit; }
.module-card h2 { margin-bottom: 8px; }
.module-card p { color: var(--muted); }
.module-card span { display: inline-block; margin-top: 10px; color: var(--primary); font-weight: 700; }

label { display: block; margin-bottom: 15px; color: #29444c; font-weight: 650; }
input, select, textarea {
  width: 100%; box-sizing: border-box; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  color: var(--text); font: inherit; line-height: 1.45; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
label small { display: block; margin-top: 5px; font-weight: 400; }
.checkline { display: flex !important; align-items: center; gap: 9px; }
.checkline input { width: auto !important; margin: 0 !important; accent-color: var(--primary); }

button, .button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; box-sizing: border-box; padding: 9px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 650; transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
button:hover, .button-link:hover { border-color: #a9c1c4; background: var(--surface-soft); color: var(--text); }
button:active, .button-link:active { transform: translateY(1px); }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); }
.status.error { color: #842b2b; background: var(--danger-soft); border: 1px solid #efc1c1; border-radius: var(--radius-sm); padding: 10px 12px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.admin-table th { padding: 10px 12px; text-align: left; white-space: nowrap; color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--border-strong); }
.admin-table td { padding: 13px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #e8eeee; }
.admin-table tbody tr:hover { background: #f8fbfb; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

.log-filter-form { background: #fbfdfd; }
.log-filter-form h2 { margin-top: 0; }
.log-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 4px 16px; }
.log-result-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; color: var(--muted); }
.log-result-header strong { color: var(--text); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.log-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.log-meta-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface-soft); border: 1px solid #e6eeee; border-radius: var(--radius-sm); }
.log-meta-grid span { overflow-wrap: anywhere; }
.log-block { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; min-height: 1.2em; }
.prompt-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.5; background: #f7fafa; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; max-height: 70vh; overflow: auto; }
details { border-radius: var(--radius-sm); }
summary { cursor: pointer; color: var(--primary); }

@media (max-width: 700px) {
  .container { width: min(100% - 28px, 1120px); padding: 22px 0 38px; }
  .page-header, .admin-header { flex-direction: column; gap: 14px; }
  .card { padding: 18px; }
  .top-links { width: 100%; }
  .module-grid { grid-template-columns: 1fr; }
  .admin-table { min-width: 680px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


/* Accountbeheer en verplichte eerste wachtwoordwijziging */
.password-reset-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.password-reset-form input { min-width: 220px; margin: 0; }
.password-reset-form button { white-space: nowrap; }
.badge-warning { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #fff4d6; border: 1px solid #ead18b; color: #6d5311; font-size: .82rem; font-weight: 700; }
.auth-secondary { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 700px) {
  .password-reset-form { flex-direction: column; align-items: stretch; min-width: 260px; }
  .password-reset-form input { min-width: 0; }
}
.status.success { color:#225d45; background:#eaf7f0; border:1px solid #b9dfca; border-radius:var(--radius-sm); padding:10px 12px; }


/* V1.2 afronding: beheeracties en compacte gebruikersinterface */
.admin-header-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.admin-header-actions a {
  display:inline-flex; align-items:center; justify-content:center; height:42px; box-sizing:border-box;
  padding:0 13px; border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--text); text-decoration:none; font-weight:600; font-size:.92rem;
  box-shadow:var(--shadow-sm);
}
.users-table { min-width:760px; }
.user-actions { display:flex; align-items:center; gap:7px; white-space:nowrap; }
.inline-action-form { display:inline-flex; margin:0; }
.icon-button { width:38px; height:38px; min-height:38px; padding:0; font-size:1rem; }
.icon-button.danger-action:hover { border-color:#d7a7a7; background:var(--danger-soft); }
.status-badge { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; font-size:.82rem; font-weight:700; }
.status-active { background:#eaf7f0; border:1px solid #b9dfca; color:#225d45; }
.status-blocked { background:var(--danger-soft); border:1px solid #efc1c1; color:#842b2b; }
.app-dialog { width:min(480px, calc(100% - 32px)); box-sizing:border-box; padding:0; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--text); box-shadow:0 24px 70px rgba(23,50,58,.22); }
.app-dialog::backdrop { background:rgba(16,38,44,.42); backdrop-filter:blur(2px); }
.app-dialog form { padding:22px; }
.dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:18px; }
.dialog-header h2 { margin-bottom:5px; }
.dialog-header p { margin:0; }
.dialog-close { flex:0 0 auto; width:36px; height:36px; min-height:36px; padding:0; font-size:1.45rem; line-height:1; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.module-access-fieldset { border:1px solid var(--border); border-radius:10px; padding:14px 16px; margin:14px 0 18px; }
.module-access-fieldset legend { padding:0 6px; font-weight:700; }
.module-access-fieldset .checkline + .checkline { margin-top:10px; }
