/* ═══════════════════ Klantenportaal (aanvulling op style.css) ═══════════════════ */
.container.wide { max-width: 1400px; }
.header-inner { gap: 18px; }
.header-inner .nav { flex-wrap: nowrap; white-space: nowrap; }
.header-inner .search { flex: 1; max-width: 380px; margin-left: auto; }
.header-inner .search input {
  width: 100%; font: inherit; font-size: 0.9rem; color: var(--text);
  background: rgba(5,11,24,0.6); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.45em 1em;
}
.header-inner .search input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(47,182,246,0.18); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-chip { color: var(--text-soft); font-size: 0.82rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-admin .header-inner { height: auto; min-height: 62px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.is-admin .nav { gap: 18px; margin-left: auto; flex-wrap: wrap; white-space: normal; }

/* Portaal: zijbalk + inhoud */
.portal-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .portal-layout { grid-template-columns: 1fr; gap: 20px; } .header-inner .search { display: none; } }

.sidebar {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 8px; position: sticky; top: 82px; max-height: calc(100vh - 110px); overflow-y: auto;
}
@media (max-width: 900px) { .sidebar { position: static; max-height: none; } }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 14px; margin-left: 12px; border-left: 1px solid var(--line); }
.tree details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.tree details > summary::-webkit-details-marker { display: none; }
.tree-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; color: var(--text-soft); font-size: 0.92rem; border-left: 3px solid transparent;
}
.tree-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-link:hover { background: rgba(47,182,246,0.08); color: var(--text); text-decoration: none; }
.tree-link.current { color: var(--text); background: rgba(47,182,246,0.12); border-left-color: var(--amber); font-weight: 600; }
.tree-icon { width: 20px; height: 20px; flex: none; color: var(--cyan); }
.chev { width: 28px; align-self: stretch; display: grid; place-items: center; flex: none; }
.chev::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--text-mute); border-bottom: 2px solid var(--text-mute); transform: rotate(45deg); transition: transform 0.15s; margin-top: -3px; }
.tree details[open] > summary .chev::before { transform: rotate(-135deg); margin-top: 3px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--text-mute); margin-bottom: 14px; }
.crumbs a { color: var(--text-soft); }
.crumbs > * + *::before { content: '›'; margin-right: 6px; color: var(--text-mute); }
.crumbs span { color: var(--text); }

.group-head { display: flex; align-items: center; gap: 28px; margin-bottom: 28px; }
.group-icon { width: 110px; height: 110px; flex: none; color: var(--cyan); filter: drop-shadow(0 0 18px var(--cyan-glow)); }
.group-icon svg { width: 100%; height: 100%; }
.group-head h1 { font-size: 2.1rem; margin: 2px 0 4px; }
.back { font-size: 0.85rem; color: var(--text-soft); }
@media (max-width: 560px) { .group-icon { width: 70px; height: 70px; } .group-head { gap: 16px; } .group-head h1 { font-size: 1.6rem; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 18px 0 8px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 170px; padding: 22px 14px; text-align: center; color: var(--text);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tile:hover { border-color: var(--cyan); box-shadow: 0 0 26px var(--cyan-glow); transform: translateY(-2px); text-decoration: none; }
.tile-icon { width: 64px; height: 64px; color: var(--cyan); }
.tile-icon svg { width: 100%; height: 100%; }
.tile-name { font-weight: 600; font-size: 0.98rem; line-height: 1.3; overflow-wrap: anywhere; }

.section-title { margin: 34px 0 12px; display: flex; align-items: center; gap: 10px; }
.count { font-size: 0.75rem; font-weight: 700; color: var(--text-soft); background: rgba(140,180,255,0.1); border-radius: 999px; padding: 0.1em 0.7em; }

.docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: rgba(10,24,48,0.7); border: 1px solid var(--line); border-radius: var(--radius);
}
.doc:hover { border-color: var(--line-strong); }
.doc-ext {
  flex: none; min-width: 48px; text-align: center; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em;
  color: var(--cyan); background: rgba(47,182,246,0.1); border: 1px solid rgba(47,182,246,0.3); border-radius: 6px; padding: 0.55em 0.4em;
}
.doc-ext.sm { display: inline-block; min-width: 0; padding: 0.15em 0.5em; }
.doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-title { font-weight: 600; overflow-wrap: anywhere; }
.doc-desc { color: var(--text-soft); font-size: 0.88rem; }
.doc-meta { color: var(--text-mute); font-size: 0.78rem; overflow-wrap: anywhere; }
.doc-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 640px) { .doc { flex-wrap: wrap; } .doc-actions { width: 100%; } .doc-actions .btn { flex: 1; } }

/* ═══════════════════ Beheer ═══════════════════ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 18px 0 22px; }
.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; color: var(--text);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2)); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stat-card:hover { border-color: var(--cyan); text-decoration: none; }
.stat-card .stat-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--cyan); }
.stat-card .stat-label { color: var(--text-soft); text-transform: none; letter-spacing: 0; font-size: 0.88rem; font-weight: 500; }

.form-block { display: flex; flex-direction: column; gap: 6px; }
.label-text { font-size: 0.88rem; font-weight: 600; color: var(--text-soft); }
.form-actions { margin-top: 18px; }
.inline { display: inline; margin: 0; }
.hint { color: var(--text-mute); }

.gtree, .gtree ul { list-style: none; margin: 0; padding: 0; }
.gtree ul { margin-left: 26px; border-left: 1px solid var(--line); padding-left: 10px; }
.grow { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.grow-icon { width: 26px; height: 26px; color: var(--cyan); flex: none; }
.grow-icon svg { width: 100%; height: 100%; }
.grow-name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow-actions { display: flex; gap: 6px; }

.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.icon-opt { position: relative; cursor: pointer; }
.icon-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.icon-opt span { display: grid; place-items: center; height: 46px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft); background: rgba(5,11,24,0.5); }
.icon-opt span svg { width: 26px; height: 26px; }
.icon-opt:hover span { border-color: var(--line-strong); color: var(--text); }
.icon-opt input:checked + span { border-color: var(--cyan); color: var(--cyan); background: rgba(47,182,246,0.12); box-shadow: 0 0 0 2px rgba(47,182,246,0.25); }
.icon-opt input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.grouptree ul { list-style: none; margin: 0; padding: 0; }
.grouptree ul ul { margin-left: 22px; padding-left: 10px; border-left: 1px solid var(--line); }
.form label.check, .check { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer; font-weight: 500; color: var(--text); }
.form label.check > input[type=checkbox], .check input[type=checkbox] {
  flex: 0 0 17px; width: 17px; height: 17px; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--cyan); margin: 0;
}
.form label.check > span:not(.check-icon) { flex: 1 1 auto; min-width: 0; }
.check input:disabled ~ span { opacity: 0.55; }
.check-icon { display: inline-flex; }
.inline-check { margin-top: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters select, .filters input { font: inherit; color: var(--text); background: rgba(5,11,24,0.6); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.55em 0.8em; min-width: 0; }
.filters input { flex: 1; min-width: 180px; }
select option { background: var(--bg-panel); color: var(--text); }

.tabs { display: flex; gap: 6px; margin: 14px 0 16px; flex-wrap: wrap; }
.tab { padding: 0.45em 1em; border-radius: 999px; border: 1px solid var(--line); color: var(--text-soft); font-size: 0.88rem; }
.tab:hover { text-decoration: none; border-color: var(--line-strong); color: var(--text); }
.tab.active { background: rgba(47,182,246,0.14); border-color: var(--cyan); color: var(--text); }

.file-list .ftitle { flex: 1; min-width: 0; font: inherit; font-size: 0.9rem; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; }
.file-list .ftitle:hover, .file-list .ftitle:focus { border-color: var(--line-strong); outline: none; }
.upload-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.kv.big { font-size: 1rem; align-items: center; }
.pw { font-size: 1.15rem; letter-spacing: 0.05em; color: var(--amber); }
.form textarea[readonly] { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.table .t-title, .table .t-sub { max-width: 360px; }
