:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #68738a;
    --line: #e4e8f0;
    --accent: #2457d6;
    --accent-soft: #eaf0ff;
    --danger: #c73535;
    --warning: #a66a00;
    --success: #167c42;
    --shadow: 0 16px 40px rgba(23, 32, 51, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #101827; color: #fff; padding: 24px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); font-weight: 800; }
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; font-size: 12px; color: #aab4c5; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { color: #dce4f3; padding: 10px 12px; border-radius: 10px; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.content { padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 12px; }
.user-chip { background: var(--card); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.metric { display: grid; gap: 8px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 30px; line-height: 1; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #fafbfe; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.clean { color: var(--success); background: #e8f6ee; }
.badge.low, .badge.medium { color: var(--warning); background: #fff4dc; }
.badge.high, .badge.critical, .badge.listed { color: var(--danger); background: #fdeaea; }
.badge.paused { color: var(--muted); background: #edf0f6; }
form { margin: 0; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; color: var(--text); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; padding: 10px 14px; cursor: pointer; font-weight: 700; }
button.secondary, .button.secondary { background: #edf2ff; color: var(--accent); }
button.danger, .button.danger { background: var(--danger); color: #fff; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.alert.success { border-color: #bce3cd; background: #edfbf3; color: var(--success); }
.alert.error { border-color: #f1b8b8; background: #fff0f0; color: var(--danger); }
.alert.info { border-color: #cdd8ff; background: var(--accent-soft); color: var(--accent); }
.notice { color: var(--muted); font-size: 13px; }
.pagination { display: flex; gap: 8px; margin-top: 14px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(460px, 100%); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f1f4fa; padding: 2px 6px; border-radius: 6px; }
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid.cols-4, .grid.cols-2, .form-grid.two { grid-template-columns: 1fr; }
    .content { padding: 18px; }
}
.badge.running { color: var(--accent); background: var(--accent-soft); }
.badge.finished { color: var(--success); background: #e8f6ee; }
.badge.failed, .badge.error { color: var(--danger); background: #fdeaea; }
.progress { width: 160px; max-width: 100%; height: 9px; background: #e9edf5; border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.checkline { display: flex; align-items: center; gap: 8px; }
.checkline input { width: auto; }
.table-wrap td .actions { gap: 6px; }
