/* Christo's Bestanden Archief - huiskleuren: rood #d40414, groen #336244, grijs #39393c, blauw #24244b, geel #fcfc34 */
:root {
  --red: #d40414; --green: #336244; --grey: #39393c; --blue: #24244b; --yellow: #fcfc34;
  --green-d: #274d35; --green-l: #e3efe7; --green-m: #c5dccd;
  --bg: #f7f8f7; --panel: #ffffff; --line: #dcdfdc; --text: #1f2421; --muted: #6a706b;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--green); }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.spacer { flex: 1; } .inline { display: inline; margin: 0; }
code { background: #eef0ee; padding: 1px 5px; border-radius: 3px; }
button { font: inherit; }
[hidden] { display: none !important; }

/* ---------- knoppen en formulieren ---------- */
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 4px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f0f2f0; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.danger { color: var(--red); border-color: #e7b3b7; }
.btn.danger:hover { background: #fdecee; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.wide { width: 100%; margin-top: 6px; padding: 10px; }
label { display: block; margin: 0 0 12px; font-weight: 600; font-size: 13px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
label.check input { margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #b9beb9; border-radius: 4px; font: inherit; background: #fff; }
input:focus, textarea:focus, button:focus-visible, .list:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
input.small-input { display: inline-block; width: 150px; margin: 0; padding: 4px 6px; font-size: 12px; }
.hp { position: absolute; left: -5000px; }
.flash { padding: 10px 12px; border-radius: 4px; margin: 0 0 14px; }
.flash-error { background: #fdecee; color: #8a0a14; border: 1px solid #f1c0c4; }
.flash-ok { background: var(--green-l); color: #1d4a2e; border: 1px solid var(--green-m); }
.flash-info { background: #eaf0fb; color: #1d3a6b; border: 1px solid #c5d4ee; }

/* ---------- inlogpagina's ---------- */
body.auth { background: linear-gradient(160deg, var(--green) 0%, var(--blue) 100%); min-height: 100%; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; width: 100%; max-width: 440px; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.auth-head { background: var(--grey); color: #fff; display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 4px solid var(--red); }
.auth-logo { width: 54px; height: 54px; filter: brightness(0) invert(1); }
.auth-site { font-size: 19px; font-weight: 700; } .auth-sub { font-size: 12px; opacity: .8; }
.auth-body { padding: 22px 22px 18px; }
.auth-body .links { text-align: center; margin: 16px 0 0; font-size: 13px; }
table.compact td { padding: 3px 8px 3px 0; font-size: 13px; }
td.ok { color: #1a7f37; font-weight: 600; } td.bad { color: var(--red); font-weight: 600; } td.warn { color: #9a6700; font-weight: 600; }

/* ---------- bovenbalk ---------- */
.topbar { display: flex; align-items: center; gap: 14px; background: var(--green); color: #fff; padding: 5px 14px; height: 50px; border-bottom: 3px solid var(--red); }
.topbar .brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; min-width: 0; }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand img { height: 36px; width: 36px; flex: none; filter: brightness(0) invert(1); }
.toplink { color: #fff; text-decoration: none; padding: 5px 10px; border-radius: 4px; font-size: 13px; }
.toplink:hover { background: rgba(255,255,255,.18); }
.linkbtn { background: none; border: 0; cursor: pointer; }
.who { opacity: .9; font-size: 13px; }

/* ---------- app-opbouw ---------- */
body.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.addressrow { display: flex; gap: 6px; align-items: center; padding: 6px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.navbtn { width: 32px; height: 30px; border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; font-size: 17px; color: var(--grey); }
.navbtn:hover:not(:disabled) { background: #eef0ee; border-color: var(--line); }
.navbtn:disabled { opacity: .35; cursor: default; }
.crumbs { flex: 1; display: flex; align-items: center; flex-wrap: nowrap; overflow: hidden; border: 1px solid #b9beb9; border-radius: 4px; background: #fff; padding: 0 4px; height: 30px; min-width: 0; }
.crumb { border: 0; background: none; padding: 2px 6px; border-radius: 3px; cursor: pointer; white-space: nowrap; color: var(--text); }
.crumb:hover { background: var(--green-l); }
.crumb-sep { color: var(--muted); font-size: 11px; padding: 0 1px; }
.crumbs .crumb:last-child { font-weight: 600; }
.addressrow .filter { width: 240px; flex: none; margin: 0; padding: 5px 9px; }
.toolbar { display: flex; gap: 2px; align-items: center; padding: 4px 10px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tbtn { display: inline-flex; gap: 6px; align-items: center; background: none; border: 1px solid transparent; border-radius: 4px; padding: 5px 9px; cursor: pointer; color: var(--text); white-space: nowrap; }
.tbtn:hover:not(:disabled) { background: var(--green-l); }
.tbtn:disabled { opacity: .4; cursor: default; }
.tbtn small { font-size: 9px; opacity: .7; }
.tbtn.toggle[aria-pressed=true] { background: var(--green-m); border-color: #9cc2aa; }
.tsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.menuwrap { position: relative; }
.menu { position: absolute; z-index: 50; top: 100%; left: 0; min-width: 210px; background: #fff; border: 1px solid #b9beb9; border-radius: 6px; box-shadow: 0 6px 22px rgba(0,0,0,.18); padding: 4px; }
.menu button { display: flex; width: 100%; gap: 8px; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 4px; cursor: pointer; align-items: center; }
.menu button:hover { background: var(--green-l); }
.menu button .tick { width: 14px; color: var(--green); font-weight: 700; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu-opts { padding: 12px 14px; min-width: 290px; }
.menu-opts .range { margin-top: 10px; } .menu-opts input[type=range] { width: 100%; margin: 8px 0 0; accent-color: var(--green); }
.only-small { display: none; }

.main { flex: 1; display: flex; min-height: 0; background: #fff; }
.tree { width: 260px; overflow: auto; padding: 6px 4px 20px; background: #fbfcfb; border-right: 1px solid var(--line); flex: none; }
.splitter { width: 5px; cursor: col-resize; flex: none; background: transparent; margin: 0 -2px; z-index: 5; }
.splitter:hover, .splitter.drag { background: var(--green-m); }
.content { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #fff; }
.bg { position: absolute; inset: 0; background: url("logo-bg.png") no-repeat right 24px bottom 12px / auto 85%; pointer-events: none; opacity: .12; z-index: 0; }
.list { position: absolute; inset: 0; overflow: auto; padding: 8px; z-index: 1; outline: none; }
.side { width: 340px; overflow: auto; flex: none; background: #fbfcfb; border-left: 1px solid var(--line); padding: 12px; }
.statusbar { display: flex; gap: 14px; padding: 3px 12px; background: #fff; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); min-height: 24px; }

/* ---------- mappenboom ---------- */
.tnode { user-select: none; }
.trow { display: flex; align-items: center; gap: 2px; padding: 2px 4px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.trow:hover { background: var(--green-l); }
.trow.cur { background: var(--green-m); font-weight: 600; }
.tarrow { width: 18px; height: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; color: var(--muted); border-radius: 3px; }
.tarrow:hover { background: rgba(0,0,0,.08); }
.tarrow.open { transform: rotate(90deg); } .tarrow.none { visibility: hidden; }
.trow svg { flex: none; } .tname { overflow: hidden; text-overflow: ellipsis; padding-left: 3px; }
.tkids { margin-left: 14px; }

/* ---------- bestandslijst: alle weergaven ---------- */
.item { cursor: default; border: 1px solid transparent; border-radius: 4px; user-select: none; min-width: 0; }
.item:hover { background: rgba(51,98,68,.09); }
.item.sel { background: rgba(51,98,68,.2); border-color: rgba(51,98,68,.55); }
.item .nm { overflow-wrap: anywhere; }
.item .ic { display: flex; align-items: center; justify-content: center; position: relative; }
.item .ic img.th { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); background: #fff; }
.item .sub { color: var(--muted); font-size: 12px; }
.view-large, .view-medium, .view-tiles, .view-small, .view-list { display: block; }
.view-large .grid, .view-medium .grid, .view-tiles .grid { display: grid; gap: 4px; align-content: start; }
.view-large .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.view-medium .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.view-tiles .grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.view-large .item, .view-medium .item { text-align: center; padding: 8px 4px; }
.view-large .ic { height: 100px; } .view-large .ic svg { width: 90px; height: 90px; }
.view-medium .ic { height: 64px; } .view-medium .ic svg { width: 56px; height: 56px; }
.view-large .nm, .view-medium .nm { font-size: 12.5px; max-height: 3.9em; overflow: hidden; margin-top: 4px; }
.view-tiles .item { display: flex; gap: 10px; align-items: center; padding: 6px 8px; }
.view-tiles .ic { width: 52px; height: 52px; flex: none; } .view-tiles .ic svg { width: 46px; height: 46px; }
.view-small .grid, .view-list .grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 12), auto); grid-auto-columns: minmax(200px, 260px); gap: 1px 8px; justify-content: start; }
.view-small .item, .view-list .item { display: flex; gap: 6px; align-items: center; padding: 2px 6px; }
.view-small .ic, .view-list .ic { width: 16px; height: 16px; flex: none; } .view-small .ic svg, .view-list .ic svg { width: 16px; height: 16px; }
.view-small .nm, .view-list .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-list .item { padding: 3px 6px; } .view-list .ic, .view-list .ic svg { width: 18px; height: 18px; }
table.details { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.details th { text-align: left; font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--grey); cursor: pointer; position: sticky; top: -8px; background: rgba(255,255,255,.93); user-select: none; z-index: 2; }
table.details th:hover { background: var(--green-l); }
table.details th .arr { font-size: 9px; margin-left: 4px; color: var(--green); }
table.details td { padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid transparent; }
table.details tr.item { display: table-row; } table.details tr.item.sel td { background: rgba(51,98,68,.2); }
table.details tr.item:hover td { background: rgba(51,98,68,.09); } table.details tr.item.sel:hover td { background: rgba(51,98,68,.26); }
table.details td.c-name { display: table-cell; }
table.details .namecell { display: flex; gap: 8px; align-items: center; min-width: 0; }
table.details .namecell svg { width: 20px; height: 20px; flex: none; } table.details .namecell span { overflow: hidden; text-overflow: ellipsis; }
table.details td.num { text-align: right; } table.details th.num { text-align: right; }
.empty { color: var(--muted); padding: 40px 10px; text-align: center; }
.err { color: #8a0a14; padding: 14px; }

/* ---------- zijpaneel ---------- */
.side h3 { margin: 0 0 8px; font-size: 14px; word-break: break-word; }
.side .pv { margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; text-align: center; min-height: 80px; }
.side .pv img { max-width: 100%; max-height: 380px; display: block; margin: 0 auto; }
.side .pv iframe { width: 100%; height: 440px; border: 0; background: #eee; }
.side .pv video { width: 100%; max-height: 320px; } .side .pv audio { width: 100%; }
.side .pv pre { text-align: left; margin: 0; font: 12px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 380px; overflow: auto; }
.side .pv .bigicon svg { width: 96px; height: 96px; }
.side .pv .hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 10px; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13px; }
.side dt { color: var(--muted); } .side dd { margin: 0; word-break: break-word; }
.side .btn { margin-top: 4px; }

/* ---------- beheer ---------- */
body.admin { background: var(--bg); }
.admin-main { max-width: 1100px; margin: 20px auto; padding: 0 16px 40px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; vertical-align: middle; }
.pending { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pending-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .pending-actions label { margin: 0; }
.note { background: #f4f6f4; border-left: 3px solid var(--green); padding: 6px 10px; margin-top: 6px; font-size: 13px; }
table.grid { width: 100%; border-collapse: collapse; } table.grid th, table.grid td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
table.grid th { background: #f4f6f4; }
td.actions { white-space: nowrap; } td.actions form { margin: 2px 0; }
.table-scroll { overflow-x: auto; }

/* ---------- kleine schermen ---------- */
@media (max-width: 860px) {
  .only-small { display: inline-flex; }
  .tree { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 82vw !important; max-width: 340px; box-shadow: 4px 0 24px rgba(0,0,0,.3); transform: translateX(-105%); transition: transform .18s; padding-top: 56px; }
  .tree.show { transform: none; }
  #splitTree, #splitSide, .side { display: none; }
  .tbtn span { display: none; } .tbtn.only-small span, #btnDownload span { display: inline; }
  .addressrow .filter { width: 130px; }
  .who { display: none; }
}

/* ---------- statusbalk-knoppen en afbeeldingsviewer ---------- */
.sbtn { border: 1px solid transparent; background: none; border-radius: 3px; cursor: pointer; font-size: 14px; color: var(--grey); padding: 0 6px; line-height: 20px; }
.sbtn:hover { background: var(--green-l); border-color: var(--line); }
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(15, 20, 17, .92); display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 92vw; max-height: 88vh; object-fit: contain; box-shadow: 0 6px 40px rgba(0,0,0,.6); background: #fff; }
.lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 26px; line-height: 1; }
.lb button:hover { background: rgba(255,255,255,.28); }
.lb-x { top: 14px; right: 16px; font-size: 20px !important; } .lb-p { left: 16px; top: 50%; } .lb-n { right: 16px; top: 50%; }
.lb-cap { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #e8ece9; font-size: 13px; text-shadow: 0 1px 3px #000; }
