:root {
  --ink: #17202a;
  --muted: #5d6d7e;
  --line: #d8dee5;
  --panel: #ffffff;
  --bg: #f4f7f9;
  --accent: #0f6b78;
  --accent-dark: #0a4d56;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.45; }
a { color: var(--accent-dark); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--ink); }
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto; }
.container.narrow { max-width: 760px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h1, h2 { margin: 0 0 12px; line-height: 1.2; }
.panel, .login-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(460px, 100%); }
.form, .grid-form { display: grid; gap: 14px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input, select, textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--ink); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); }
button:disabled { opacity: .65; cursor: wait; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metrics article { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.metrics strong { display: block; font-size: 28px; }
.metrics span { color: var(--muted); }
.muted { color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #edf2f7; color: var(--muted); }
.risk-low { background: #dcfae6; color: var(--ok); }
.risk-medium { background: #fef0c7; color: var(--warn); }
.risk-high, .risk-critical { background: #fee4e2; color: var(--danger); }
.status-match { background: #fee4e2; color: var(--danger); }
.status-clear { background: #dcfae6; color: var(--ok); }
.status-failed, .status-warning { background: #fef0c7; color: var(--warn); }
.severity-info { background: #edf2f7; color: var(--muted); }
.severity-low { background: #dcfae6; color: var(--ok); }
.severity-medium { background: #fef0c7; color: var(--warn); }
.severity-high, .severity-critical { background: #fee4e2; color: var(--danger); }
.matched-row { background: #fff7ed; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button, .tabs a { background: #fff; color: var(--ink); border: 1px solid var(--line); text-decoration: none; border-radius: 6px; padding: 9px 12px; }
.tabs .active, .tabs button.active { border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.details { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; }
.details dt { color: var(--muted); }
.alert, .notice { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; }
.alert { background: #fee4e2; color: var(--danger); }
.notice { background: #dcfae6; color: var(--ok); }
.admin-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 1.2fr .8fr auto auto auto auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.task-form { display: grid; grid-template-columns: 180px minmax(220px, 1fr) auto; gap: 8px; align-items: start; }
.task-form textarea { min-height: 42px; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.nested-table { margin: 10px 0; width: auto; min-width: 420px; }
.nested-table th { text-transform: none; letter-spacing: 0; width: 180px; }
.report-body { background: #fff; }
.report { width: min(1100px, calc(100% - 40px)); margin: 24px auto; }
.cover { padding: 48px 0; border-bottom: 2px solid var(--ink); margin-bottom: 24px; }
@media (max-width: 820px) {
  .topbar, .page-head { align-items: flex-start; flex-direction: column; }
  .metrics, .grid-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .admin-row { grid-template-columns: 1fr; }
  .task-form { grid-template-columns: 1fr; }
  .inline-form { align-items: flex-start; flex-direction: column; }
  .nested-table { min-width: 0; width: 100%; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media print {
  .topbar, .tabs, button, .button { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
