:root {
  --bg: #0b1020;
  --bg-2: #121a33;
  --panel: #161f3b;
  --line: #2a365c;
  --text: #e8edff;
  --muted: #9aa8d1;
  --accent: #e11d8a;
  --accent-2: #7c5cff;
  --ok: #2ecc8a;
  --warn: #f5c542;
  --err: #ff5d73;
  --radius: 14px;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: #0e1530;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.user { color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: center; }

.layout { display: grid; grid-template-columns: 280px 1fr 360px; min-height: 0; }
.sidebar, .main, .side {
  min-height: 0; overflow: auto;
}
.sidebar { border-right: 1px solid var(--line); padding: 16px; background: var(--bg-2); }
.main { padding: 16px 20px; }
.side { border-left: 1px solid var(--line); padding: 16px; background: var(--bg-2); }

h2, h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.crumb {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 6px 10px; border-radius: 999px; font-size: 13px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 10px;
}
.btn:hover { border-color: #4a5c96; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #9b1fe8); border: 0; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.list { display: grid; gap: 6px; }
.row {
  display: grid; grid-template-columns: 28px 36px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #10182f;
}
.row.folder { cursor: pointer; }
.row:hover { border-color: #45568f; }
.row .title { font-weight: 600; }
.row .meta { color: var(--muted); font-size: 12px; }
.thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: #0a1022; }
.ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #1b2550; }

.login {
  max-width: 460px; margin: 10vh auto; background: var(--panel); padding: 28px;
  border: 1px solid var(--line); border-radius: 18px;
}
.login h1 { margin: 0 0 8px; }
.login p { color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; background: #0d1430; color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.field { margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.preview { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #0a1024; padding: 10px; border-radius: 10px; max-height: 220px; overflow: auto; }
.log { font-size: 13px; display: grid; gap: 6px; }
.log .ok { color: var(--ok); }
.log .err { color: var(--err); }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #24305a; color: var(--muted); }
.empty { color: var(--muted); padding: 30px 8px; text-align: center; }
.bm { display: block; width: 100%; text-align: left; margin-bottom: 6px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar, .side { border: 0; border-top: 1px solid var(--line); }
}
