:root {
  --brand: #1F4E79; --brand-ink: #ffffff;
  --bg: #f5f6f8; --surface: #ffffff; --ink: #1d2433; --ink-2: #4a5468; --muted: #6b7486; --line: #dfe3ea;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b; --info: #2a6fdb;
  --radius: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 22px 0 10px; } h3 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono, textarea.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #111827; color: #cbd2de; padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px; color: #fff; font-weight: 600; }
.sidebar .logo img { max-height: 36px; max-width: 150px; background: #fff; border-radius: 4px; padding: 2px; }
.sidebar h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8a93a6; margin: 16px 8px 4px; }
.sidebar a { display: block; color: #d6dbe5; padding: 6px 10px; border-radius: 6px; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar a.active { box-shadow: inset 3px 0 0 var(--brand); }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .org { font-weight: 600; } .topbar form, .topbar select { margin: 0; }
.content { padding: 22px 24px 60px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .g2,.g3,.g4 { grid-template-columns: 1fr; } .content { padding: 16px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
/* stat tiles */
.tile .label { color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tile .value { font-size: 28px; font-weight: 650; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 12px; }
/* meter: one value against 100% */
.meter { height: 8px; border-radius: 4px; background: #e6e9ef; overflow: hidden; margin: 6px 0; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
/* status chips: icon + label, never colour alone */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.pass .dot, .chip.good .dot { background: var(--good); } .chip.partial .dot, .chip.warn .dot { background: var(--warning); }
.chip.fail .dot, .chip.bad .dot { background: var(--critical); } .chip.manual .dot, .chip.neutral .dot { background: #9aa3b2; }
.chip.info .dot { background: var(--info); }
.chip.serious .dot { background: var(--serious); }
/* tables */
table.t { width: 100%; border-collapse: collapse; background: var(--surface); }
table.t th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 600; background: #f0f2f6; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 75vh; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.example td { background: #fffbea; }
/* forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=month],
input[type=datetime-local], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #c9cfd9; border-radius: 6px; font: inherit; background: #fff; }
input[type=color] { width: 60px; height: 36px; padding: 2px; border: 1px solid #c9cfd9; border-radius: 6px; }
textarea { resize: vertical; } .field { margin-bottom: 14px; } .help { color: var(--muted); font-size: 12px; margin-top: 3px; }
.errorlist { color: var(--critical); margin: 4px 0; padding-left: 18px; font-size: 12px; }
ul.checks { list-style: none; padding: 0; margin: 0; columns: 2; } ul.checks li { margin: 2px 0; } ul.checks label { font-weight: 400; display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; } .form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } ul.checks { columns: 1; } }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid #c9cfd9; background: #fff;
  color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #f3f5f8; } .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); } .btn.danger { color: var(--critical); border-color: #efc2c2; } .btn.sm { padding: 4px 9px; font-size: 12px; }
.inline { display: inline; }
/* messages */
.messages { list-style: none; padding: 0; margin: 0 0 14px; } .messages li { padding: 10px 14px; border-radius: 6px; margin-bottom: 6px; border: 1px solid; background: #fff; }
.messages .success { border-color: #bfe5bf; background: #f1faf1; } .messages .error { border-color: #f2c3c3; background: #fdf3f3; }
.messages .warning { border-color: #f6dd9b; background: #fffaeb; } .messages .info { border-color: #c8dafc; background: #f2f6ff; }
.banner { padding: 10px 24px; background: #fffaeb; border-bottom: 1px solid #f6dd9b; }
/* document preview */
.doc-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 36px; }
.doc-preview table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.doc-preview th { background: var(--brand); color: #fff; text-align: left; } .doc-preview th, .doc-preview td { border: 1px solid #cfd5df; padding: 5px 7px; vertical-align: top; }
.doc-preview blockquote { background: #fff8e1; border-left: 4px solid var(--warning); margin: 10px 0; padding: 8px 12px; }
.doc-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; }
.doc-header img { max-height: 54px; max-width: 220px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; } .steps a, .steps span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px; }
.steps .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; } @media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
/* public */
.public-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 32px; background: #fff; border-bottom: 1px solid var(--line); }
.hero { padding: 64px 32px; background: linear-gradient(135deg, #0f2a44, #1F4E79); color: #fff; }
.hero h1 { font-size: 38px; max-width: 820px; } .hero p { font-size: 17px; max-width: 760px; color: #dce6f2; }
.wrap { max-width: 1150px; margin: 0 auto; padding: 0 24px; } .section { padding: 44px 0; }
.price { font-size: 30px; font-weight: 700; } .auth-box { max-width: 460px; margin: 48px auto; }
@media print { .sidebar, .topbar, .no-print, .banner { display: none !important; } .shell { display: block; } .content { padding: 0; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; }
.filters input[type=text], .filters select { width: auto; min-width: 140px; }
.nowrap { white-space: nowrap; }
aside .card { margin-bottom: 12px; }
details.card summary { cursor: pointer; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }
.rating-cell { white-space: nowrap; }
.menu-toggle { display: none; margin-left: auto; order: 2; background: transparent; color: #fff; border: 1px solid #3b4456; border-radius: 6px; padding: 4px 10px; font: inherit; cursor: pointer; }
@media (max-width: 800px) {
  .menu-toggle { display: inline-block; }
  .sidebar { padding: 8px 10px; }
  .sidebar .logo { padding: 4px 8px; }
  .sidebar > a, .sidebar > h4, .sidebar > form, .sidebar > div:not(.logo) { display: none; }
  .sidebar.open > a, .sidebar.open > h4 { display: block; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar .actions { flex-wrap: wrap; }
}
