/* WebAsk Insights — оформление интерфейса.
   Без внешних шрифтов и CDN: всё рисуется локально. */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e7eaf1;
  --line-2: #eef1f7;
  --brand: #4f46e5;
  --brand-ink: #3730a3;
  --brand-soft: #eef0ff;
  --violet: #7c3aed;
  --sky: #0ba5ec;
  --teal: #0e9384;
  --ok: #12b76a;
  --ok-soft: #e8f9f0;
  --warn: #f79009;
  --warn-soft: #fff6e8;
  --bad: #f04438;
  --bad-soft: #fef0ef;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 8px 24px -12px rgba(16, 24, 40, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; color: var(--brand-ink); }

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
button { font-family: inherit; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ------------------------------------------------------------- страница входа */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #e9ecff 0%, rgba(233, 236, 255, 0) 62%),
    radial-gradient(900px 480px at 96% 4%, #e6f6ff 0%, rgba(230, 246, 255, 0) 58%),
    var(--bg);
}

.auth-shell {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  padding: 44px 42px;
  color: #eef0ff;
  background:
    radial-gradient(620px 420px at 8% 6%, rgba(124, 58, 237, 0.55), transparent 60%),
    radial-gradient(520px 380px at 92% 96%, rgba(11, 165, 236, 0.35), transparent 62%),
    linear-gradient(150deg, #1b1b46 0%, #2a2170 52%, #3a1d63 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.auth-brand h1 { color: #fff; font-size: 26px; }
.auth-brand p { color: rgba(238, 240, 255, 0.78); font-size: 14px; max-width: 34ch; }

.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(140deg, #7c3aed, #4f46e5 60%, #0ba5ec);
  color: #fff;
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -0.03em;
  box-shadow: 0 10px 24px -10px rgba(124, 58, 237, 0.9);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }

.auth-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-points li {
  position: relative;
  padding-left: 26px;
  color: rgba(238, 240, 255, 0.86);
  font-size: 13.5px;
}
.auth-points li::before {
  content: "";
  position: absolute; left: 6px; top: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.16);
}

.auth-mode {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12.5px;
  color: rgba(238, 240, 255, 0.7);
  display: flex; align-items: center; gap: 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.dot.demo { background: #fdb022; }
.dot.live { background: #32d583; }

.auth-form { padding: 44px 42px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.auth-form h2 { font-size: 21px; }
.auth-form > p { margin-bottom: 18px; }

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.field .hint { font-size: 12px; color: var(--muted); }

.checkbox { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); margin: 2px 0 20px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #d5dae6; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(160deg, #5b52ea, #4f46e5 55%, #4338ca);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.9);
}
.btn-primary:hover { color: #fff; background: linear-gradient(160deg, #645ceb, #4f46e5 55%, #3730a3); }
.btn-danger { color: var(--bad); border-color: #f7cdc9; background: #fff; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.form-error {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  border: 1px solid #f7cdc9;
  color: #b42318;
  font-size: 13px;
}

.auth-hint {
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed #d9dfeb;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
.auth-hint b { color: var(--ink-2); }
.auth-hint code {
  font-family: var(--mono);
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--brand-ink);
}

/* ---------------------------------------------------------------- каркас */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-row .name { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.brand-row .sub { font-size: 11.5px; color: var(--muted-2); }

.nav { display: grid; gap: 3px; }
.nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 6px 10px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink-2);
  font-weight: 550;
  font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav a .ico { width: 17px; height: 17px; flex: 0 0 auto; opacity: 0.85; }
.nav a .count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 7px;
}

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.mode-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.mode-card .row { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink-2); }
.mode-card .sub { margin-top: 3px; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .crumbs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.topbar .crumbs b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }

.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #eef0ff, #e0f2fe);
  color: var(--brand-ink);
  font-weight: 700; font-size: 13px;
  border: 1px solid #dfe3f5;
}
.user-chip .who { line-height: 1.25; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 620; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }

/* minmax(0, 1fr) обязателен: иначе колонка растягивается под min-content
   шапок таблиц, и на узких экранах страница уезжает вправо. */
.content {
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 1560px;
  width: 100%;
}

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .titles { display: grid; gap: 5px; min-width: 0; }
.page-head .titles p { color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 30px;
  font-size: 11.5px;
  font-weight: 650;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: #067647; border-color: #c6f1da; }
.badge.warn { background: var(--warn-soft); color: #b54708; border-color: #fce4c2; }
.badge.bad { background: var(--bad-soft); color: #b42318; border-color: #f7cdc9; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: #dfe1ff; }
.badge.muted { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* ------------------------------------------------------------------ карточки */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; }
.card-head .meta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px 16px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; }

.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--brand), var(--sky));
  opacity: 0.9;
}
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.kpi .sub { font-size: 12px; color: var(--muted-2); }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi.ok::after { background: linear-gradient(180deg, #12b76a, #0e9384); }
.kpi.warn::after { background: linear-gradient(180deg, #f79009, #fdb022); }
.kpi.sky::after { background: linear-gradient(180deg, #0ba5ec, #6172f3); }

.grid-3 { display: grid; grid-template-columns: 1.15fr 1fr 1.25fr; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }

/* ------------------------------------------------------------- обзор: карточки */
.survey-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.survey-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  color: inherit;
}
.survey-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #d8dded; text-decoration: none; }
.survey-card .head { display: flex; gap: 10px; align-items: flex-start; }
.survey-card .head h3 { font-size: 15px; line-height: 1.35; }
.survey-card .head .badge { margin-left: auto; }
.survey-card .nums { display: flex; gap: 18px; }
.survey-card .nums div { display: grid; gap: 2px; }
.survey-card .nums b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.survey-card .nums span { font-size: 11.5px; color: var(--muted); }
.survey-card .spark { height: 42px; }
.survey-card .foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--brand); font-weight: 600; }
.survey-card .foot .arrow { transition: transform .15s; }
.survey-card:hover .foot .arrow { transform: translateX(3px); }

/* ------------------------------------------------------------------- графики */
.chart-bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bar-label { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 20px; background: var(--line-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, #6366f1, #818cf8); transition: width .5s cubic-bezier(.2,.7,.3,1); }
.bar-fill.correct { background: linear-gradient(90deg, #12b76a, #32d583); }
.bar-value { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); font-weight: 600; min-width: 72px; text-align: right; }
.bar-value small { color: var(--muted-2); font-weight: 500; }

.insight {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.insight b { color: var(--ink-2); font-weight: 650; }

.histogram { width: 100%; height: auto; display: block; }
.histogram text { font-family: var(--font); font-size: 9px; fill: var(--muted-2); }
.histogram .avg-line { stroke: #f79009; stroke-width: 1; stroke-dasharray: 3 3; }
.histogram .avg-text { fill: #b54708; font-size: 9px; font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 118px; height: 118px; flex: 0 0 auto; }
.donut text { font-family: var(--font); }
.legend { display: grid; gap: 7px; flex: 1 1 120px; }
.legend .item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend .swatch { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.legend .pct { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.text-answers { display: grid; gap: 8px; max-height: 216px; overflow: auto; padding-right: 4px; }
.text-answer {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.8px;
  color: var(--ink-2);
  line-height: 1.45;
}
.text-answer .count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 6px;
}

.area-chart { width: 100%; height: auto; display: block; }
.area-chart .axis { font-family: var(--font); font-size: 10.5px; fill: var(--muted-2); }
.area-chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.area-chart .dot { fill: #fff; stroke: var(--brand); stroke-width: 2; }

.sparkline { display: block; width: 100%; height: 42px; }

/* -------------------------------------------------------------------- таблица */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  font-weight: 700;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:hover { background: #fbfcff; cursor: pointer; }
.table tbody tr:last-child td { border-bottom: none; }
.table .preview { color: var(--muted); font-size: 12.5px; max-width: 520px; }
.table .preview b { color: var(--ink-2); font-weight: 600; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.complete i { background: var(--ok); }
.status-dot.partial i { background: var(--warn); }
.status-dot.complete { color: #067647; }
.status-dot.partial { color: #b54708; }

.pager { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line-2); }
.pager .info { color: var(--muted); font-size: 12.5px; }
.pager .spacer { flex: 1; }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: none; padding: 5px 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------------- прочее */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); display: grid; gap: 6px; place-items: center; }
.empty .big { font-size: 26px; }
.empty b { color: var(--ink-2); }

.skeleton { background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 37%, #eef1f7 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.skeleton.line { height: 12px; margin-bottom: 8px; }
.skeleton.block { height: 74px; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.toast {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  max-width: 420px;
  background: #101828;
  color: #fff;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .22s ease-out;
}
.toast.error { background: #7a271a; }
.toast.ok { background: #054f31; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade-in .16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: min(640px, 100%);
  max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
/* широкая модалка для графиков */
.modal.modal-wide { width: min(1000px, 95vw); }
/* контейнер графика в модалке */
.modal-chart-host {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.modal-chart-host svg {
  display: block;
  width: 100%;
  height: auto;
}

.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 15.5px; }
.modal-head .close { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 18px 20px; overflow: auto; display: grid; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

.qa { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.qa:last-child { border-bottom: 0; padding-bottom: 0; }
.qa .q { font-size: 12px; color: var(--muted); font-weight: 600; }
.qa .a { font-size: 13.5px; color: var(--ink); }

/* Результат по методике: сырой балл → стэн → интерпретация */
.scoring {
  border: 1px solid #dfe1ff;
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}
.scoring-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); }
.scoring-row { display: grid; grid-template-columns: minmax(90px, 1fr) 48px 66px 120px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.scoring-name { font-weight: 600; }
.scoring-raw { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.scoring-sten { font-variant-numeric: tabular-nums; color: var(--brand-ink); font-weight: 650; }
.scoring-bar { height: 7px; border-radius: 20px; background: #dfe1ff; overflow: hidden; }
.scoring-bar i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, #6366f1, #818cf8); }
.scoring-text { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: #344054; }

.notice {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}
.notice.warn { background: var(--warn-soft); border: 1px solid #fce4c2; color: #93370d; }
.notice.info { background: #eef4ff; border: 1px solid #d5e3ff; color: #1d3a8a; }
.notice.ok { background: var(--ok-soft); border: 1px solid #c6f1da; color: #054f31; }
.notice.bad { background: var(--bad-soft); border: 1px solid #f7cdc9; color: #912018; }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; color: var(--ink-2); font-weight: 550; word-break: break-word; }

.audit { display: grid; gap: 9px; font-size: 12.5px; }
.audit .line { display: flex; gap: 10px; align-items: baseline; }
.audit .when { color: var(--muted-2); font-variant-numeric: tabular-nums; min-width: 92px; }
.audit .what { color: var(--ink-2); }
.audit .what b { font-weight: 650; }

/* ------------------------------------------------------------------ адаптив */
@media (max-width: 1240px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > *:last-child { grid-column: span 2; }
  .survey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 30px; }
  .auth-form { padding: 30px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; align-items: center;
    padding: 10px 14px; gap: 12px;
    overflow-x: auto;
  }
  .sidebar .brand-row { flex: 0 0 auto; }
  .sidebar .brand-row .sub { display: none; }
  .sidebar .nav {
    display: flex; gap: 4px;
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; scrollbar-width: none;
  }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .sidebar .nav a { white-space: nowrap; }
  .sidebar .nav-title, .sidebar-foot { display: none; }
  .grid-2, .split { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .card-head { flex-wrap: wrap; }
  .card-head .meta { flex-wrap: wrap; }
  .topbar { padding: 10px 16px; height: auto; min-height: 58px; flex-wrap: wrap; gap: 10px; }
  .topbar .crumbs { flex: 1 1 auto; min-width: 0; }
}

@media (max-width: 700px) {
  .survey-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-3 > *:last-child { grid-column: auto; }
  .kpi-strip { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: minmax(70px, 40%) minmax(0, 1fr) auto; }
  .table .preview { max-width: 220px; }
  .user-chip .who { display: none; }
  .content { padding: 14px; gap: 14px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .modal { max-height: 92vh; }
}
