:root {
  --bg: #0f1419;
  --panel: #1a2029;
  --panel-2: #222a35;
  --border: #2c3644;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #4c8dff;
  --accent-2: #3570d4;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.err { color: var(--err); }
.ok { color: var(--ok); }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; }
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 20px;
}
.topbar nav { display: flex; align-items: center; gap: 16px; }
.inline { display: inline; margin: 0; }
button.link {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font: inherit; padding: 0;
}
button.link:hover { text-decoration: underline; }

/* ---- layout ---- */
.wrap { max-width: 860px; margin: 24px auto; padding: 0 20px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.panel h2 { margin: 0 0 14px; font-size: 15px; color: var(--muted); font-weight: 600; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); flex: 1; min-width: 180px; }
label.radio { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }

select, input[type=text], input[type=email] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }

/* ---- buttons ---- */
button, .button {
  font: inherit;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}
button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: var(--accent-2); }
.secondary { background: transparent; }
.actions { display: flex; gap: 12px; margin-top: 16px; }

/* ---- file browser ---- */
.crumbs { font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.crumbs a { cursor: pointer; }
.crumbs .sep { margin: 0 6px; color: var(--border); }

.browser {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  max-height: 320px; overflow-y: auto;
  background: var(--panel-2);
}
.browser li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.browser li:last-child { border-bottom: none; }
.browser li.muted { justify-content: center; padding: 20px; }
.browser .name { flex: 1; cursor: pointer; }
.browser .dir .name { color: var(--accent); font-weight: 500; }
.browser .size { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.browser input[type=checkbox] { width: 16px; height: 16px; }
.icon { width: 18px; text-align: center; }

.selection { margin-top: 12px; font-size: 13px; }
.selection .chip {
  display: inline-block; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px; margin: 3px 4px 0 0; font-size: 12px;
}

/* ---- jobs ---- */
.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
  background: var(--panel-2);
}
.jobs .jid { font-family: ui-monospace, monospace; font-size: 12px; }
.jobs .spacer { flex: 1; }
.jobs time { color: var(--muted); font-size: 12px; }

.status { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 20px; }
.status-queued   { background: #30363d; color: var(--muted); }
.status-running  { background: #1f3a5f; color: var(--accent); }
.status-completed{ background: #12331d; color: var(--ok); }
.status-failed   { background: #3d1618; color: var(--err); }

/* ---- log ---- */
.log {
  background: #0b0e13; border: 1px solid var(--border); border-radius: 6px;
  padding: 14px; overflow-x: auto; font-family: ui-monospace, monospace; font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow-y: auto;
}

/* ---- toast ---- */
#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw;
}
#toast.show { opacity: 1; }
#toast.err { border-color: var(--err); }

/* ---- auth pages ---- */
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 380px;
}
.card h1 { margin: 0 0 8px; font-size: 20px; }
.card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.card button { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.admin-bar { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---- mount step (real connector) ---- */
label.grow { flex: 3; }
.inline-actions { display: flex; align-items: flex-end; }
.inline-actions .primary { height: 38px; }
.hint { font-size: 12px; margin: 6px 0 0; }
#mountstatus { margin: 10px 0 0; font-size: 13px; }
