/* client-check — дизайн-система дашборда.
   Светлая тема, фиолетовый акцент (вид FINNOVA), токены/компоненты в духе
   uniq-check: .card / .badge / .btn / .stat / focus-ring / reduced-motion. */

:root {
  --bg: #f1eefb;
  --card: #ffffff;
  --elevated: #faf9ff;
  --ink: #1c1830;
  --muted: #6b6785;
  --subtle: #9a97ad;
  --line: #ece8f6;
  --line-strong: #ddd7ee;

  --accent: #6d5efc;
  --accent-600: #5a4be0;
  --accent-soft: #efeaff;

  --risk: #e5484d;
  --risk-soft: #fdecec;
  --clear: #17915a;
  --clear-soft: #e7f6ee;
  --warn: #c98a04;
  --warn-soft: #fbf1da;
  --na: #7b7791;
  --na-soft: #eeecf3;

  --panel: #211d40;
  --panel-2: #2b264f;
  --panel-line: #39335f;
  --panel-ink: #f5f3ff;
  --panel-muted: #a49fce;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(28, 24, 48, .05);
  --shadow: 0 8px 26px rgba(44, 38, 90, .09);
  --shadow-lg: 0 18px 50px rgba(44, 38, 90, .14);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── layout ───────────────────────────────────────────────── */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px 48px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(241, 238, 251, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-strong);
}
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #9b8bff); color: #fff; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.nav { display: flex; gap: 4px; background: #e7e2f7; padding: 4px; border-radius: 12px; }
.nav a { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.nav a.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.nav a:not(.active):hover { color: var(--ink); }
.topbar .spacer { flex: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft);
  display: grid; place-items: center; font-weight: 700; color: var(--accent-600); }

/* ── page head ────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 28px 0 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ── buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; font-weight: 600; font-size: 14px;
  padding: 10px 16px; cursor: pointer; transition: background .16s, box-shadow .16s, transform .06s;
  white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-600); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--elevated); }
.btn-light { background: #fff; color: var(--panel); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* ── cards & stats ────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted);
  font-size: 13px; font-weight: 600; }
.stat .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; }
.stat .sub { font-size: 12.5px; color: var(--subtle); margin-top: 4px; }
.stat.risk .ico { background: var(--risk-soft); }
.stat.clear .ico { background: var(--clear-soft); }
.stat.warn .ico { background: var(--warn-soft); }
.stat.total .ico { background: var(--accent-soft); }

/* ── chart ────────────────────────────────────────────────── */
.chart-card { padding: 20px 22px; margin-top: 16px; }
.chart-card h3 { margin: 0 0 2px; font-size: 15px; }
.chart-card .hint { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.chart-box { height: 190px; }

/* ── split: list + detail ─────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 16px; margin-top: 16px; align-items: start; }
.list-card { padding: 8px; }
.list-card .list-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 10px; }
.list-card .list-head h3 { margin: 0; font-size: 15px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  cursor: pointer; transition: background .14s; }
.check-row:hover { background: var(--elevated); }
.check-row.active { background: var(--accent-soft); }
.check-row .ava { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid;
  place-items: center; font-weight: 700; color: var(--accent-600); background: #efeaff; }
.check-row .who { flex: 1; min-width: 0; }
.check-row .who .name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-row .who .meta { font-size: 12px; color: var(--subtle); }
.check-row .when { font-size: 12px; color: var(--subtle); white-space: nowrap; }

/* ── detail panel (dark, FINNOVA-style) ───────────────────── */
.detail { background: var(--panel); color: var(--panel-ink); border-radius: var(--radius-lg);
  padding: 22px 24px; box-shadow: var(--shadow-lg); }
.detail .d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail .d-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.detail .d-sub { color: var(--panel-muted); font-size: 13px; margin-top: 2px; }
.verdict-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  font-weight: 700; font-size: 13px; margin: 16px 0 18px; }
.verdict-pill.risk { background: rgba(229,72,77,.16); color: #ff9a9d; }
.verdict-pill.clear { background: rgba(23,145,90,.18); color: #66e0a3; }
.verdict-pill.warning { background: rgba(201,138,4,.18); color: #f3c35a; }
.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sec { background: var(--panel-2); border: 1px solid var(--panel-line); border-radius: 12px; padding: 12px; }
.sec .st { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.sec .nm { font-size: 12.5px; color: var(--panel-ink); font-weight: 600; line-height: 1.3; }
.sec .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.risk { background: #ff6b6f; } .dot.clear { background: #4fd699; }
.dot.warning { background: #f3c35a; } .dot.unavailable, .dot.error { background: #8f8ab8; }
.detail .d-foot { display: flex; gap: 10px; margin-top: 18px; }

/* ── badges ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; }
.badge.risk { background: var(--risk-soft); color: var(--risk); }
.badge.clear { background: var(--clear-soft); color: var(--clear); }
.badge.warning { background: var(--warn-soft); color: var(--warn); }
.badge.unavailable, .badge.error { background: var(--na-soft); color: var(--na); }

/* ── empty state ──────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }
.empty h3 { margin: 12px 0 4px; color: var(--ink); }

/* ── modal (new check) ────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(28,24,48,.45); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; padding: 24px; }
.modal h2 { margin: 0 0 2px; font-size: 20px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.seg { display: flex; gap: 6px; background: #efecf8; padding: 4px; border-radius: 11px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--accent); color: #fff; }
label { display: block; font-size: 12.5px; font-weight: 600; margin: 10px 0 5px; color: var(--ink); }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14px; background: var(--elevated); color: var(--ink); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,94,252,.16); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hidden { display: none; }

@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .sec-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
}
