: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; }
.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; }
