:root {
  --bg: #f4f6f8; --panel: #ffffff; --ink: #1f2933; --muted: #647382;
  --line: #e3e8ee; --brand: #1f6f8b; --brand-dark: #17576e;
  --ok: #2e8b57; --warn: #d98e04; --bad: #c0392b; --chip: #eef3f6;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
header {
  background: var(--brand); color: #fff; padding: 10px 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
header h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: .2px; }
header .leit { font-size: 11px; opacity: .8; }
header .ctx { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; }
header .ctx input { width: 290px; }
header .ctx .who { color: #eaf4f8; font-weight: 600; }
header .ctx .demo-ctx { display: flex; gap: 8px; align-items: center; }
header .ctx a { color: #9fd4e6; text-decoration: none; border: 1px solid #3a6b7d; border-radius: 6px; padding: 3px 8px; }
header .ctx a:hover { background: #14323d; }
nav { display: flex; gap: 4px; padding: 0 14px; background: var(--brand-dark); }
nav button {
  background: none; border: none; color: #d8e6ec; padding: 11px 16px; cursor: pointer;
  font-size: 14px; border-bottom: 3px solid transparent;
}
nav button.active { color: #fff; border-bottom-color: #fff; font-weight: 600; }
main { padding: 20px; max-width: 1100px; margin: 0 auto; }
.view { display: none; } .view.active { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
h2 { font-size: 15px; margin: 0 0 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1; min-width: 160px; }

/* Dropzone (Drag & Drop Upload) */
.dropzone {
  border: 2px dashed var(--line); border-radius: 8px; background: #fbfdfe;
  padding: 26px 16px; text-align: center; cursor: pointer; transition: all .15s ease;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); background: #f3f8fa; }
.dropzone.drag { border-color: var(--brand); background: #e9f3f6; border-style: solid; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: #f1f9f4; }
.dz-inner { pointer-events: none; }
.dz-icon { font-size: 26px; line-height: 1; color: var(--brand); margin-bottom: 6px; }
.dz-text { color: var(--muted); font-size: 13px; }
.dz-link { color: var(--brand); font-weight: 600; text-decoration: underline; }
.dz-file { margin-top: 8px; font-size: 13px; color: var(--ink); font-weight: 600; }
button.primary {
  background: var(--brand); color: #fff; border: none; padding: 9px 18px; border-radius: 6px;
  cursor: pointer; font-size: 14px; margin-top: 12px;
}
button.primary:hover { background: var(--brand-dark); }
button.ghost { background: var(--chip); border: 1px solid var(--line); color: var(--ink);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
table { width: 100%; border-collapse: collapse; margin-top: 6px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
tbody tr:hover { background: #f8fafb; cursor: pointer; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; background: var(--chip);
  font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.scan-clean { color: var(--ok); } .scan-infected { color: var(--bad); } .scan-pending { color: var(--warn); }
.muted { color: var(--muted); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.badge { background: var(--chip); border-radius: 6px; padding: 6px 11px; font-size: 12px; }
.badge b { color: var(--brand); }
/* Drawer */
.drawer-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10; }
.drawer-bg.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; width: 640px; max-width: 94vw; height: 100%;
  background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.18); z-index: 11; overflow-y: auto;
  transform: translateX(100%); transition: transform .2s; }
.drawer.open { transform: translateX(0); }
.drawer .head { padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: #fff; }
.drawer .head h3 { margin: 0; font-size: 16px; flex: 1; }
.drawer .body { padding: 20px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.kv .k { color: var(--muted); }
iframe.viewer { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; }

/* Große Vorschau links (Desktop): füllt alles links vom 640px-Drawer */
.bigpreview { position: fixed; top: 0; left: 0; right: 640px; bottom: 0; background: #eef1f4;
  z-index: 11; display: none; flex-direction: column; box-shadow: inset -1px 0 0 var(--line); }
.bigpreview.open { display: flex; }
.bp-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: #fff; }
.bp-head span { flex: 1; font-weight: 600; font-size: 14px; }
.bp-body { flex: 1; padding: 12px; min-height: 0; }
.bp-body iframe, .bp-body img { width: 100%; height: 100%; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; }
.bp-body img { object-fit: contain; }
@media (max-width: 900px) { .bigpreview.open { display: none; } }
.linkchip { display:inline-block; background:#eef3f6; border:1px solid var(--line); border-radius:6px;
  padding:3px 9px; margin:3px 4px 0 0; font-size:12px; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink);
  color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 20; opacity: 0; transition: opacity .2s; font-size: 13px; }
.toast.show { opacity: 1; }
.statusgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.statuscard { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.statuscard .t { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.statuscard .v { font-size: 16px; margin-top: 6px; font-weight: 600; }
/* Explorer */
.objitem { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; }
.objitem:hover { background: #f8fafb; }
.objitem.sel { background: #e7f0f4; font-weight: 600; }
.treecat { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px;
  cursor: pointer; border-radius: 5px; font-size: 13px; }
.treecat:hover { background: #f8fafb; }
.treedocs { display: none; }
.treedocs.open { display: block; }
.treedoc { padding: 5px 8px; font-size: 13px; cursor: pointer; border-radius: 5px; }
.treedoc:hover { background: #eef3f6; }

/* --- Dateiformat: Farbe + Badge + Such-Filter (rot=PDF, grün=Excel, gelb=Bild …) --- */
.ft-pdf     { --ftc: #c0392b; }
.ft-excel   { --ftc: #1a7f37; }
.ft-word    { --ftc: #2b5797; }
.ft-ppt     { --ftc: #d35400; }
.ft-image   { --ftc: #d4a008; }
.ft-mail    { --ftc: #7d4fc0; }
.ft-archive { --ftc: #6b7280; }
.ft-text    { --ftc: #475569; }
.ft-other   { --ftc: #9aa5b1; }
/* farbiger Balken links je Dokument, nach Dateityp */
tr.ftrow td:first-child { border-left: 4px solid var(--ftc, transparent); }
/* Baum-Dokument: farbiger Balken + Symbol je Dateityp */
.treedoc { border-left: 3px solid var(--ftc, transparent); }
.treedoc .fticon { margin-right: 3px; }
/* Objektname hinter der Objektnummer im Explorer */
.objname { color: #64748b; font-weight: 400; margin-left: 5px; }
/* Format-Badge in der Liste */
.ftbadge { display: inline-block; min-width: 40px; text-align: center; padding: 2px 7px;
  border-radius: 4px; background: var(--ftc, #9aa5b1); color: #fff; font-size: 11px;
  font-weight: 700; letter-spacing: .4px; }
/* Format-Filter über den Suchergebnissen */
#searchFilters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
#searchFilters:empty { display: none; }
.ff-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.fmtfilter { background: #fff; border: 1px solid var(--line); color: var(--ink); padding: 4px 11px;
  border-radius: 14px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.fmtfilter::before { content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ftc, #9aa5b1); display: inline-block; }
.fmtfilter b { color: var(--muted); font-weight: 700; }
.fmtfilter:hover { border-color: var(--ftc, var(--brand)); }
.fmtfilter.on { background: var(--ftc, #888); border-color: var(--ftc, #888); color: #fff; }
.fmtfilter.on b { color: #fff; }
.fmtfilter.on::before { background: #fff; }
.fmtfilter.clear { color: var(--muted); }
.fmtfilter.clear::before { display: none; }

/* Ziehharmonika-Suchfilter (object_status) */
.search-acc { border:1px solid var(--border,#e2e6ea); border-radius:8px; padding:6px 10px; }
.search-acc > summary { cursor:pointer; font-size:13px; font-weight:600; list-style:none; user-select:none; }
.search-acc > summary::-webkit-details-marker { display:none; }
.search-acc > summary::before { content:"▸ "; color:#888; }
.search-acc[open] > summary::before { content:"▾ "; }

/* Dokument-Attribute (Detail-Drawer) */
.metatbl{width:100%;border-collapse:collapse;font-size:12.5px;}
.metatbl td{padding:3px 4px;vertical-align:middle;border-bottom:1px solid #f0f2f4;}
.metatbl .mk{color:#667;white-space:nowrap;font-weight:600;max-width:160px;overflow:hidden;text-overflow:ellipsis;}
.metatbl .mv{width:100%;box-sizing:border-box;border:1px solid #dce1e6;border-radius:6px;padding:5px 7px;font-size:12.5px;}
.metatbl .mact{white-space:nowrap;text-align:right;}
.metatbl .mact button{padding:3px 7px;font-size:13px;}
.metaadd{display:flex;gap:6px;margin-top:8px;}
.metaadd input{flex:1;border:1px solid #dce1e6;border-radius:6px;padding:6px 8px;font-size:12.5px;}

/* Ziehharmonika-Filter (Suche) */
.search-acc .acc-body{padding:10px 2px 2px;}
.search-acc .filtrow{display:flex;align-items:center;gap:10px;margin:6px 0;}
.search-acc .filtrow .fl{flex:0 0 150px;font-size:13px;font-weight:600;color:#555;}
.search-acc .filtrow select{flex:1;max-width:280px;border:1px solid #cdd4da;border-radius:8px;padding:8px 10px;font-size:13px;background:#fff;}
