/* rcai-qa витрина — современный минимализм, фирменный шрифт SZRCAI */
@font-face {
  font-family: 'SZRCAI';
  src: url('assets/fonts/SZRCAI.ttf') format('truetype');
  font-weight: 400 900; font-display: swap;
}
@font-face {
  font-family: 'SZRCAI Mono';
  src: url('assets/fonts/SZRCAI_mono.ttf') format('truetype');
  font-weight: 400 700; font-display: swap;
}

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e9eaee;
  --border-strong: #d9dbe1;
  --text: #1a1c20;
  --muted: #8b909a;
  --muted-2: #b4b8c0;
  --accent: #4263eb;
  --accent-soft: #eaeeff;
  --pass: #2f9e44;
  --pass-soft: #e9f6ed;
  --fail: #e03131;
  --fail-soft: #fceced;
  --skip: #f08c00;
  --skip-soft: #fdf3e3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,22,28,.04), 0 4px 16px rgba(20,22,28,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f12; --surface: #16181d; --surface-2: #1b1d23;
    --border: #23262d; --border-strong: #2d3138; --text: #e7e8ea; --muted: #888d97;
    --muted-2: #5b606a; --accent: #5c7cfa; --accent-soft: #1c2336;
    --pass: #51cf66; --pass-soft: #14241a; --fail: #ff6b6b; --fail-soft: #2a1719;
    --skip: #ffa94d; --skip-soft: #2a2113;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'SZRCAI', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.mono { font-family: 'SZRCAI Mono', ui-monospace, SFMono-Regular, monospace; }
a { color: var(--accent); text-decoration: none; }

/* ── header ─────────────────────────────────────────────── */
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .logo { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand .logo b { color: var(--accent); }
.brand .sub { color: var(--muted); font-size: 13px; }
.run-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); font-size: 12px; color: var(--muted);
}
.chip b { color: var(--text); font-weight: 600; }
.chip.ok b { color: var(--pass); } .chip.bad b { color: var(--fail); }

/* ── layout ─────────────────────────────────────────────── */
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 28px 64px; }

/* summary */
.summary { display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-bottom: 22px; }
.ring-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
}
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { transform: rotate(-90deg); }
.ring .pct { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.ring .pct .n { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ring .pct .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ring-card .caption { color: var(--muted); font-size: 12.5px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 16px;
}
.card .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.card .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.card.pass .v { color: var(--pass); } .card.fail .v { color: var(--fail); }
.card.skip .v { color: var(--skip); }
.card .bar { height: 4px; border-radius: 4px; margin-top: 12px; background: var(--border); overflow: hidden; }
.card .bar > i { display: block; height: 100%; border-radius: 4px; }

/* trend */
.trend { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 22px; }
.trend h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; }
.trend .bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; }
.trend .bars .b { flex: 1; min-width: 6px; max-width: 26px; border-radius: 4px 4px 2px 2px;
  background: var(--pass-soft); position: relative; }
.trend .bars .b > span { position: absolute; inset: 0; border-radius: inherit; }
.trend .empty { color: var(--muted-2); font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* content grid */
.grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.side { position: sticky; top: 86px; }
.side .block { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px; }
.side .block h4 { margin: 4px 6px 10px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .cnt { color: var(--muted); font-size: 12px; flex-shrink: 0; white-space: nowrap; }
.nav-item.active .cnt { color: var(--accent); }
.nav-item .cnt.has-fail { color: var(--fail); font-weight: 700; }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; }
.search input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { background: var(--surface); border: none; padding: 8px 12px; font: inherit;
  color: var(--muted); cursor: pointer; border-left: 1px solid var(--border); }
.seg button:first-child { border-left: none; }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* table */
.tbl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: 26px 1fr 120px 70px; align-items: center;
  gap: 12px; padding: 11px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.row:first-child { border-top: none; }
.row:hover { background: var(--surface-2); }
.row .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sui { color: var(--muted); font-size: 12px; }
.row .dur { color: var(--muted); font-size: 12px; text-align: right; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.passed { background: var(--pass); } .dot.failed { background: var(--fail); }
.dot.skipped { background: var(--skip); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.empty-tbl { padding: 40px; text-align: center; color: var(--muted); }
.count-line { color: var(--muted); font-size: 12.5px; margin: 0 2px 10px; }

/* model (traceability) */
.req { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.req .rh { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.req .rid { font-weight: 700; }
.req .risk { font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--fail-soft); color: var(--fail); text-transform: uppercase; letter-spacing: .04em; }
.req .desc { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.case-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-top: 1px solid var(--border); font-size: 13px; }
.case-row .cid { font-size: 12.5px; }
.case-row .tags { color: var(--muted); font-size: 11.5px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.badge.auto { background: var(--pass-soft); color: var(--pass); }
.badge.manual { background: var(--skip-soft); color: var(--skip); }

/* detail drawer */
.scrim { position: fixed; inset: 0; background: rgba(15,17,21,.32); opacity: 0; pointer-events: none;
  transition: opacity .18s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(540px, 92vw);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 40px rgba(0,0,0,.12);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.7,.2,1); z-index: 41;
  display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .dh { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex;
  align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer .dh .x { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.drawer .db { padding: 20px 22px; overflow: auto; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin-bottom: 18px; }
.kv .k { color: var(--muted); font-size: 12.5px; }
.kv .v { font-size: 13px; }
.why-box { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.5; }
.why-box .k { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 4px; font-weight: 600; }
.msg { background: var(--fail-soft); border: 1px solid var(--fail); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 12.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
footer { color: var(--muted-2); font-size: 12px; text-align: center; padding: 30px 0 10px; }
