:root {
  --bg: #0f1216; --panel: #181d24; --border: #2a323d; --fg: #e6e9ee; --muted: #8b95a5;
  --accent: #4f9cff; --danger: #ff6b6b; --ok: #4cd08a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.grow { flex: 1; }
.err { color: var(--danger); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; }

.btn { background: #232a34; color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: .45rem .9rem; font: inherit; cursor: pointer; }
.btn:hover:not(:disabled) { background: #2b3440; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #07121f; font-weight: 600; }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.btn.danger:hover:not(:disabled) { background: #4a2326; border-color: var(--danger); }

.top { display: flex; align-items: center; gap: 1rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--border); }
.top form { margin: 0; }

.login { max-width: 340px; margin: 12vh auto 0; padding: 0 1rem; }
.login form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; }
.login label { display: flex; flex-direction: column; gap: .3rem; color: var(--muted); font-size: .9rem; }
input[name] { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: .55rem .7rem; font: inherit; }
input[name]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.app { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }

.drop { border: 2px dashed var(--border); border-radius: 12px; padding: 3.5rem 1rem; text-align: center; margin-bottom: 1rem; transition: .12s; }
.drop.over { border-color: var(--accent); background: rgba(79, 156, 255, .08); }
.drop-title { font-size: 1.35rem; margin-bottom: .35rem; }
.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: .75rem 0 .5rem; }
#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.bar.indeterminate #bar-fill { width: 30% !important; animation: slide 1s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: 0; } to { margin-left: 70%; } }
#job-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem 1rem; margin: .8rem 0; }
.stats dt { color: var(--muted); font-size: .8rem; }
.stats dd { margin: 0; font-weight: 600; }

details summary { cursor: pointer; color: var(--muted); }
.scan { max-height: 240px; overflow: auto; margin: .5rem 0 0; padding: .5rem .5rem .5rem 2.5rem; background: var(--bg); border-radius: 6px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.num { text-align: right; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: .3rem; }
td:first-child { word-break: break-all; }
