@import url('/vendor/xterm/css/xterm.css');

:root {
  --bg: #0b0b0e;
  --panel: #15161b;
  --line: #2a2b33;
  --text: #e4e4e7;
  --muted: #9a9aa6;
  --accent: #f0abfc;
  --accent-ink: #1a0b1d;
  --danger: #fca5a5;
  --term-bg: #101114;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: .92em; }
button {
  font: inherit; cursor: pointer; border: 0; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: .55em 1em;
}
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spacer { flex: 1; }
.brand { font-weight: 700; letter-spacing: .04em; }

/* ---- Login / setup cards */
.center { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px 24px;
}
.card h1 { margin: 0 0 4px; font-size: 1rem; color: var(--accent); }
.card h2 { margin: 0 0 20px; font-size: 1.4rem; }
.card form { display: grid; gap: 14px; }
.card label { display: grid; gap: 4px; font-weight: 500; }
.card small { color: var(--muted); font-weight: 400; }
.card input {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: .55em .7em; width: 100%;
}
.card button { margin-top: 6px; }
.error { background: #3b1518; color: var(--danger); border-radius: 6px; padding: .6em .8em; margin: 0 0 16px; }
.totp { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; text-align: center; }
.totp p { margin: 0 0 10px; color: var(--muted); font-size: .92em; }
.totp img { background: #fff; border-radius: 6px; padding: 6px; width: 200px; height: 200px; image-rendering: pixelated; }
.secret { display: inline-block; margin-top: 4px; color: var(--text); letter-spacing: .08em; word-break: break-all; }

/* ---- App shell */
body.app { display: flex; flex-direction: column; overflow: hidden; }
.bar {
  display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 48px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto;
}
.bar .brand { color: var(--accent); white-space: nowrap; }
.tabs { display: flex; gap: 4px; }
.tabs a {
  color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 6px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); background: #1f2027; }
.tabs a[aria-selected="true"] { color: var(--text); background: #26272f; box-shadow: inset 0 -2px 0 var(--accent); }
.who { color: var(--muted); white-space: nowrap; }
.bar form { margin: 0; }
button.link { background: none; color: var(--muted); padding: 6px 4px; font-weight: 500; }
button.link:hover { color: var(--text); }

.panels { flex: 1; min-height: 0; position: relative; }
.panel { position: absolute; inset: 0; display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.panel.scroll { overflow: auto; }

.termbar {
  display: flex; align-items: center; gap: 12px; padding: 6px 16px; flex: none;
  font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--term-bg);
}
.termbar button { padding: 3px 10px; font-size: 13px; }
#term { flex: 1; min-height: 0; padding: 8px 0 0 12px; background: var(--term-bg); }
@media (max-width: 640px) { .termbar .hint { display: none; } }

.files { padding: 16px; max-width: 1100px; }
.files-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
#crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 1.05rem; }
#crumbs .sep { color: var(--muted); }
button.crumb { background: none; color: var(--accent); padding: 2px 4px; font-weight: 500; }
button.ghost { background: #26272f; color: var(--text); font-weight: 500; }
a.button {
  display: inline-block; text-decoration: none; border-radius: 6px; padding: .55em 1em;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.files-note { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
#files-msg { color: var(--muted); margin: 6px 0; min-height: 1.2em; }
.files-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.files-table th, .files-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.files-table th { color: var(--muted); font-weight: 500; }
.files-table .num { text-align: right; white-space: nowrap; }
.files-table td:nth-child(3) { color: var(--muted); white-space: nowrap; }
.entry { color: var(--text); text-decoration: none; word-break: break-all; }
a.entry:hover { color: var(--accent); text-decoration: underline; }
button.entry { background: none; padding: 0; font-weight: 600; color: var(--accent); text-align: left; }
a.small { font-size: 13px; }
@media (max-width: 640px) { .files-table td:nth-child(3), .files-table th:nth-child(3) { display: none; } }

.activity { padding: 16px; }
.activity h2 { margin: 0 0 12px; font-size: 1.1rem; }
.activity table { border-collapse: collapse; width: 100%; font-size: 13px; }
.activity th, .activity td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.activity th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--bg); }
.activity tr[class*="fail"] td, .activity tr[class*="locked"] td, .activity tr[class*="limited"] td { color: var(--danger); }
