:root {
  --navy: #183b56;
  --blue: #2e74b5;
  --blue-soft: #e8f1f8;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d8e0e8;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --danger: #b42318;
  --success: #16794b;
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: white; background: var(--navy); }
.brand { color: white; font-weight: 800; letter-spacing: .08em; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 20px; margin-right: auto; margin-left: 34px; }
.nav a { color: #dceaf5; font-size: 14px; font-weight: 700; text-decoration: none; }
.nav a:hover { color: white; }
.topbar form { margin: 0; }
.shell { max-width: 1180px; margin: 0 auto; padding: 34px 24px 60px; }
.shell.wide { max-width: 1500px; }
.shell.narrow { max-width: 720px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: 30px; color: var(--navy); }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid.two { grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 8px 26px rgba(24,59,86,.06); }
.card h2 { margin: 0 0 8px; color: var(--navy); font-size: 18px; }
.metric { font-size: 32px; font-weight: 800; color: var(--navy); }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; }
.pill.good { background: #dcfae6; color: var(--success); }
.btn { appearance: none; border: 0; border-radius: 9px; padding: 10px 14px; background: var(--blue); color: white; font-weight: 700; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.secondary { background: transparent; border: 1px solid rgba(255,255,255,.55); }
.card .btn.secondary, .form-actions .btn.secondary, .table-card .btn.secondary { color: var(--navy); border-color: var(--line); background: white; }
.btn.small { padding: 7px 9px; font-size: 12px; white-space: nowrap; }
.btn.danger { background: #fff1f0; color: var(--danger); border: 1px solid #f5b7b1; }
.text-link { font-weight: 700; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.status-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0; }
.status-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: white; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); }
.status-card strong { color: var(--navy); font-size: 24px; }
.token-panel { padding: 18px; background: #fff8e6; border: 1px solid #f0cf75; border-radius: 12px; }
.token-panel h2 { margin: 0; color: var(--navy); font-size: 18px; }
.secret-token { display: block; margin-top: 12px; padding: 12px; overflow-wrap: anywhere; background: #17212b; color: #e8f5ee; border-radius: 8px; user-select: all; }
.table-card { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #e8edf2; vertical-align: middle; }
th { color: var(--navy); background: #edf4fa; white-space: nowrap; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-weight: 800; font-size: 11px; }
.status.active { color: #087443; background: #dcfae6; }
.status.stale { color: #8a5700; background: #fff1c2; }
.status.offline { color: var(--danger); background: #fee4e2; }
.status.disabled { color: #475467; background: #eaecf0; }
.status.pending { color: #8a5700; background: #fff1c2; }
.status.processing { color: #175cd3; background: #eaf2ff; }
.status.completed { color: #087443; background: #dcfae6; }
.status.failed { color: var(--danger); background: #fee4e2; }
.actions { display: flex; gap: 6px; }
.actions form { margin: 0; }
.empty-state { padding: 50px 20px; text-align: center; }
.form-card label { margin-top: 18px; }
select { width: 100%; padding: 12px; border: 1px solid #b9c6d3; border-radius: 9px; background: white; font: inherit; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.check-list { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 8px; min-width: 190px; }
.check-list label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 600; }
.check-list input { width: auto; }
.assignment-picker { position: relative; margin-bottom: 8px; }
.assignment-picker summary { width: 190px; padding: 8px 10px; cursor: pointer; color: var(--navy); background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; }
.assignment-picker[open] .check-list { position: absolute; z-index: 10; top: 38px; right: 0; width: 230px; max-height: 220px; overflow-y: auto; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 28px rgba(24,59,86,.18); }
.check-list.tall { max-height: 260px; overflow-y: auto; margin: 16px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.group-card { margin-bottom: 12px; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #dceaf5, transparent 38%), var(--canvas); }
.auth-card { width: min(430px, 100%); padding: 32px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(24,59,86,.14); }
.auth-card h1 { margin-bottom: 8px; }
label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 700; }
input { width: 100%; padding: 12px; border: 1px solid #b9c6d3; border-radius: 9px; font: inherit; }
input:focus { outline: 3px solid rgba(46,116,181,.18); border-color: var(--blue); }
.auth-card .btn { width: 100%; margin-top: 20px; }
.alert { margin: 12px 0; padding: 11px 13px; border-radius: 9px; }
.alert.error { background: #fee4e2; color: var(--danger); }
.alert.success { background: #dcfae6; color: var(--success); }
.placeholder { border-style: dashed; }
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .hero { align-items: start; flex-direction: column; }
  .topbar { padding: 0 18px; }
  .nav { gap: 10px; margin-left: 16px; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .page-heading { align-items: start; flex-direction: column; }
}
