:root {
  --field: #1b5e3f;
  --field-dark: #123f2b;
  --field-soft: #e7efe9;
  --ink: #16211c;
  --muted: #5b6b62;
  --faint: #8a988f;
  --bg: #eef2ee;
  --card: #ffffff;
  --line: #dbe4dd;
  --wheat: #b8892b;

  --s-assigned: #6b7a70;
  --s-submitted: #2563a8;
  --s-returned: #b7791f;
  --s-accepted: #1b7a46;

  /* единая шкала скруглений: от мелких меток до крупных панелей */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 18px;
  --r-5: 22px;
  --r-pill: 999px;
  --radius: var(--r-3);

  --shadow: 0 1px 2px rgba(22, 33, 28, .04), 0 8px 24px rgba(22, 33, 28, .05);
  --shadow-lg: 0 12px 28px rgba(22, 33, 28, .12);
  --shadow-brand: 0 8px 22px rgba(27, 94, 63, .24);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Manrope", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

/* ---------- вход ---------- */

.auth {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  background: linear-gradient(160deg, var(--field) 0%, var(--field-dark) 100%);
  overflow: hidden;
}
.auth__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* -- левая половина: заголовок и текст поверх общего зелёного фона -- */
.auth__brandside {
  position: relative; z-index: 1;
  overflow-x: hidden; overflow-y: auto;
  color: #eaf3ec;
  padding: 48px 64px 36px;
  display: grid;
  grid-template-rows: 1fr auto;
}
.auth__in { position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto; align-self: center; }

.auth__logo {
  width: 58px; height: 58px; border-radius: var(--r-4);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center; color: var(--wheat); margin-bottom: 36px;
}
.auth__logo svg { width: 30px; height: 30px; }

.auth__kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--wheat); margin-bottom: 20px;
}
.auth__kicker span { display: block; line-height: 1.5; }
.auth__lead h1 {
  font-size: 60px; line-height: .96; font-weight: 800; letter-spacing: -.025em;
  color: #fff; margin-bottom: 14px; text-shadow: 0 2px 24px rgba(0,0,0,.18);
}
.auth__tagline { color: #cfe2d6; font-size: 16px; line-height: 1.55; max-width: 34ch; margin-bottom: 26px; }
.auth__rule { width: 52px; height: 3px; border-radius: var(--r-1); background: var(--wheat); margin-bottom: 22px; }
.auth__words {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #eaf3ec; margin-bottom: 14px;
}
.auth__desc { color: #a9cdb6; font-size: 14px; line-height: 1.65; max-width: 40ch; margin-bottom: 32px; }

.auth__features { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 8px; }
.auth__feature { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #cfe2d6; }
.auth__feature .ic { width: 28px; height: 28px; color: var(--wheat); }
.auth__feature span { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

.auth__foot {
  position: relative; z-index: 1; padding-top: 28px;
  display: flex; align-items: center; gap: 8px;
  max-width: 480px; margin: 0 auto;
  font-family: var(--mono); font-size: 12px; color: #8fb79c; letter-spacing: .04em;
}
.auth__foot .ic { width: 15px; height: 15px; }

/* -- правая половина: форма (фон прозрачный — виден общий зелёный анимированный фон) -- */
.auth__formside {
  position: relative; z-index: 1;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth__tools { position: absolute; top: 28px; right: 32px; display: flex; gap: 10px; }
.auth__tools .themebtn, .auth__tools .langswitch {
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}

.auth__card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-5); box-shadow: var(--shadow);
  padding: 40px 36px; text-align: center;
}
.auth__shield {
  position: relative; width: 62px; height: 62px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--field-soft); color: var(--field);
  display: grid; place-items: center;
}
.auth__shield svg:first-child { width: 30px; height: 30px; }
.auth__shield-ok {
  position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px;
  color: var(--wheat); background: var(--card); border-radius: 50%;
}
.auth__card h2 { font-size: 23px; margin-bottom: 6px; }
.auth__card .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.auth__card form { text-align: left; }
.auth__card .alert { text-align: left; }

.field--icon .field__wrap { position: relative; display: flex; align-items: center; }
.field--icon .field__ic { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.field--icon input { padding-left: 40px !important; }
.field__eye {
  position: absolute; right: 6px; width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--faint); border-radius: var(--r-2); cursor: pointer;
}
.field__eye:hover { color: var(--field); background: var(--field-soft); }

.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; }
.auth__remember { margin: 0; }
.auth__forgot { font-size: 13px; font-weight: 600; color: var(--field); }
.auth__forgot:hover { text-decoration: underline; }
.auth__divider { height: 1px; background: var(--line); margin: 24px 0 18px; }
.auth__help {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: left;
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.auth__help .ic { flex-shrink: 0; color: var(--wheat); }

.auth__apps { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth__apps-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.auth__apps-row { display: flex; gap: 10px; }
.appbadge {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: #1a1a1a; color: #fff; border: none; border-radius: var(--r-2);
  padding: 8px 12px; cursor: pointer; font-family: inherit; text-align: left;
  transition: background .15s;
}
.appbadge:hover { background: #000; }
.appbadge .ic { width: 22px; height: 22px; flex-shrink: 0; }
.appbadge span { display: flex; flex-direction: column; line-height: 1.25; font-size: 11px; color: #cfcfcf; }
.appbadge span b { font-size: 13px; font-weight: 700; color: #fff; }
.auth__apps-tip {
  display: none; margin-top: 10px; padding: 12px 14px; border-radius: var(--r-2);
  background: var(--field-soft); color: var(--ink); font-size: 13px; line-height: 1.5;
  text-align: left;
}
.auth__apps-tip.show { display: block; }
.auth__apps-tip-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--field); }
.auth__apps-step { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.auth__apps-step:last-of-type { margin-bottom: 8px; }
.auth__apps-stepnum {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--field);
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.auth__apps-step .ic { flex-shrink: 0; color: var(--field); }
.auth__apps-tip-note { font-size: 11px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--field);
  box-shadow: 0 0 0 3px rgba(27, 94, 63, .12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: var(--r-2);
  padding: 12px 18px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn--primary { background: var(--field); color: #fff; width: 100%; }
.btn--primary:hover { background: var(--field-dark); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--field); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--field); }

.alert {
  border-radius: var(--r-2);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert--error { background: #fdeeee; border-color: #f2c7c7; color: #96302f; }
.alert--success { background: #e9f5ee; border-color: #b9dfc7; color: #14663c; }

/* ---------- каркас кабинета ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--field);
  color: #d8e8dd;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 26px; }
.brand__logo {
  width: 34px; height: 34px; border-radius: var(--r-2);
  background: #eaf3ec; color: var(--field);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 15px;
}
.brand__name { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.15; }
.brand__name small { display: block; font-weight: 500; font-size: 11px; color: #9fc4ac; letter-spacing: .03em; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-2);
  font-size: 14px; font-weight: 500; color: #cfe2d6;
  transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }

.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar__foot button {
  width: 100%; text-align: left;
  background: transparent; border: none; color: #b7cebf;
  font-family: var(--sans); font-size: 14px; padding: 8px 12px; cursor: pointer;
  border-radius: var(--r-2);
}
.sidebar__foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

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

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 26px 34px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar .crumb { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.topbar h1 { font-size: 23px; }
.who { text-align: right; }
.who .org { font-weight: 600; font-size: 14px; color: var(--ink); }
.who .role { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .04em; margin-top: 2px; }

.main { padding: 28px 34px 48px; }

/* появление */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .4s ease both; }
  .reveal:nth-child(2) { animation-delay: .04s; }
  .reveal:nth-child(3) { animation-delay: .08s; }
  .reveal:nth-child(4) { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- статистика ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.stat .num { font-family: var(--mono); font-size: 30px; font-weight: 600; line-height: 1; color: var(--ink); }
.stat .lab { font-size: 13px; color: var(--muted); margin-top: 8px; }
.stat--accent .num { color: var(--field); }

/* ---------- список заданий ---------- */

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 16px; }
.section-head .count { font-family: var(--mono); font-size: 12px; color: var(--faint); }

.tasklist { display: flex; flex-direction: column; gap: 10px; }
.task-row {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) auto auto; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .12s, transform .08s;
}
.task-row:hover { border-color: #c4d3c9; transform: translateX(2px); }
.task-row .rail { width: 4px; align-self: stretch; }
.task-row .body { padding: 16px 0; }
.task-row .title { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.task-row .meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.task-row .due { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }
.task-row .due.overdue { color: #b03b36; }
.task-row .go { padding-right: 18px; color: var(--faint); font-size: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .03em; padding: 6px 10px; border-radius: var(--r-pill);
  border: 1px solid; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--assigned { color: var(--s-assigned); border-color: #d3dbd6; background: #f4f7f5; }
.chip--in_progress { color: var(--s-assigned); border-color: #d3dbd6; background: #f4f7f5; }
.chip--submitted { color: var(--s-submitted); border-color: #c3d6ee; background: #eef4fb; }
.chip--returned { color: var(--s-returned); border-color: #ecd7ad; background: #fbf3e3; }
.chip--accepted { color: var(--s-accepted); border-color: #b6ddc4; background: #ecf7f0; }

.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center; color: var(--muted); font-size: 14px;
}

/* ---------- карточка задания ---------- */

.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px;
}
/* карточка-обёртка списка: строки сами держат свои отступы */
.card--tight { padding: 6px 10px; }
/* содержимое в край — таблицы, карты, изображения */
.card--flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 17px; margin-bottom: 14px; }
.card + .card { margin-top: 20px; }

.deflist { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; font-size: 14px; }
.deflist dt { color: var(--muted); }
.deflist dd { margin: 0; font-family: var(--mono); font-size: 13px; }
.desc { font-size: 15px; line-height: 1.65; color: #2c362f; margin: 14px 0 0; white-space: pre-wrap; }

.filepick {
  border: 1px dashed #c3d0c7; border-radius: var(--r-2); padding: 16px; text-align: center;
  font-size: 14px; color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s;
}
.filepick:hover { border-color: var(--field); background: var(--field-soft); }
.filepick input { display: none; }
.filepick .picked { display: block; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--field); }

.report {
  border: 1px solid var(--line); border-radius: var(--r-2); padding: 16px 16px; margin-bottom: 12px;
}
.report__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.report__date { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.report__text { font-size: 14px; line-height: 1.6; color: #2c362f; white-space: pre-wrap; }
.report__files { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.report__files a {
  font-family: var(--mono); font-size: 12px; color: var(--field);
  border: 1px solid var(--line); border-radius: var(--r-1); padding: 4px 10px; background: var(--field-soft);
}
.report__review { margin-top: 10px; padding: 10px 12px; background: #fbf3e3; border-radius: var(--r-2); font-size: 13px; color: #7a5312; }

/* ---------- таблица сотрудников ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 0 12px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 12px; border-bottom: 1px solid #eef2ef; }
.table tr:last-child td { border-bottom: none; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--muted); background: #f1f5f2; border-radius: var(--r-1); padding: 2px 8px; }

.formgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.formgrid .full { grid-column: 1 / -1; }

.back { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.back:hover { color: var(--field); }

.errlist { list-style: none; padding: 0; margin: 0 0 12px; }
.errlist li { color: #96302f; font-size: 13px; }

/* ---------- адаптив ---------- */

@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__brandside {
    padding: 36px 24px 24px; min-height: 0;
  }
  .auth__canvas, .auth__logo, .auth__kicker, .auth__rule,
  .auth__words, .auth__desc, .auth__features, .auth__foot { display: none; }
  .auth__lead h1 { font-size: 36px; margin-bottom: 8px; }
  .auth__tagline { margin-bottom: 0; font-size: 14px; }
  .auth__formside { padding: 24px; min-height: 0; flex-direction: column; }
  .auth__tools { position: static; width: 100%; justify-content: flex-end; margin-bottom: 18px; }
  .auth__card { width: 100%; max-width: none; }
  /* раскладка меню на мобильном полностью описана ниже, в блоке «МОБИЛЬНАЯ ВЕРСИЯ» */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .formgrid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- кабинет Центра ---------- */

.mono { font-family: var(--mono); }
.numchip { font-family: var(--mono); font-size: 13px; padding: 2px 8px; border-radius: var(--r-1); display: inline-block; min-width: 26px; text-align: center; }
.numchip--zero { color: var(--faint); background: transparent; }
.numchip--mut { color: var(--muted); background: #f1f5f2; }
.numchip--warn { color: #b03b36; background: #fbeceb; font-weight: 500; }
.numchip--info { color: var(--s-submitted); background: #eef4fb; font-weight: 500; }
.numchip--ok { color: var(--s-accepted); background: #ecf7f0; }

.progress { height: 6px; background: #e7ede9; border-radius: var(--r-1); overflow: hidden; width: 84px; display: inline-block; vertical-align: middle; }
.progress > span { display: block; height: 100%; background: var(--s-accepted); border-radius: var(--r-1); }
.progress-lab { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 8px; }

.monitor-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.monitor-table th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.monitor-table th.c, .monitor-table td.c { text-align: center; }
.monitor-table td { padding: 14px 12px; border-bottom: 1px solid #eef2ef; }
.monitor-table tr:last-child td { border-bottom: none; }
.monitor-table tbody tr:hover { background: #f7faf8; }
.monitor-table .orgname { font-weight: 600; color: var(--ink); }
.monitor-table .orgname small { display: block; font-weight: 500; font-size: 12px; color: var(--faint); font-family: var(--mono); }

.queue-item { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
.queue-item .rail { width: 4px; align-self: stretch; background: var(--s-submitted); }
.queue-item .body { padding: 14px 0; }
.queue-item .org { font-weight: 600; font-size: 14px; }
.queue-item .task { font-size: 13px; color: var(--muted); margin-top: 2px; }
.queue-item .when { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.queue-item .act { padding-right: 16px; }

.review-actions { display: flex; gap: 12px; margin-top: 18px; }
.btn--accept { background: var(--field); color: #fff; }
.btn--accept:hover { background: var(--field-dark); }
.btn--return { background: #fff; color: #a9691a; border: 1px solid #ecd7ad; }
.btn--return:hover { background: #fbf3e3; }

/* ---------- сотрудники: аватары и телефоны ---------- */

.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--field-soft); flex-shrink: 0; }
.avatar--ph { display: grid; place-items: center; font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--field); }
.emp-cell { display: flex; align-items: center; gap: 12px; }
.emp-cell .nm { font-weight: 600; color: var(--ink); }
.phone { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.dept-card { border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; margin-bottom: 10px; }
.dept-card .dn { font-weight: 600; font-size: 14px; }
.dept-card .dm { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 3px; }
.filepick.compact { padding: 12px; font-size: 13px; }

/* ---------- иконки и современная навигация ---------- */

.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.ic--sm { width: 15px; height: 15px; }
.nav a .ic { opacity: .85; }
.nav a.on .ic { opacity: 1; }
.sidebar__foot button { display: flex; align-items: center; gap: 10px; }
.btn .ic { width: 17px; height: 17px; }
.btn--sm { padding: 8px 14px; font-size: 14px; }

.topbar__right { display: flex; align-items: center; gap: 20px; }
.langswitch { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-2); padding: 6px 10px 6px 12px; background: #fff; color: var(--muted); }
.langswitch select { border: none; background: transparent; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; outline: none; padding-right: 2px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.toolbar h2 { font-size: 17px; }

.filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filterbar .langswitch select { max-width: 150px; text-overflow: ellipsis; }
.filterbar .searchbox { flex: 1 1 200px; min-width: 180px; }

.iconbtn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--field); background: var(--field-soft); border: 1px solid transparent; border-radius: var(--r-2); padding: 6px 12px; cursor: pointer; text-decoration: none; }
.iconbtn:hover { border-color: #b8d3c1; }
.iconbtn .ic { width: 15px; height: 15px; }
.iconbtn--muted { color: var(--muted); background: #f1f5f2; }

.badge-on { font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: var(--r-pill); }
.badge-on.yes { color: var(--s-accepted); background: #ecf7f0; }
.badge-on.no { color: var(--faint); background: #f1f5f2; }
.role-tag { font-family: var(--mono); font-size: 11px; color: var(--s-submitted); background: #eef4fb; padding: 3px 10px; border-radius: var(--r-1); }

.checkline { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0 14px; }
.checkline input { width: 17px; height: 17px; accent-color: var(--field); }

.orggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 4px; max-height: 220px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-2); }
.orggrid label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: var(--r-1); cursor: pointer; }
.orggrid label:hover { background: var(--field-soft); }
.orggrid input { accent-color: var(--field); }

.hint { font-size: 13px; color: var(--faint); margin-top: 6px; }

/* длинные полные названия организаций переносятся аккуратно */
.monitor-table td:first-child { max-width: 340px; }
.monitor-table .orgname { white-space: normal; line-height: 1.35; }
.orggrid label { white-space: normal; line-height: 1.3; }

/* ---------- дашборд показателей (как референс) ---------- */

.indi-section { margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.indi-head { display: flex; align-items: center; gap: 12px; background: var(--field); color: #fff; padding: 12px 20px; font-weight: 700; font-size: 15px; }
.indi-head .ic { width: 20px; height: 20px; }
.indi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.indi-cell { background: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.indi-cell .lbl { font-size: 13px; color: #2c362f; line-height: 1.3; }
.indi-cell .lbl .u { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.indi-cell .val { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--field); white-space: nowrap; }
.indi-cell .val.empty { color: #c7d0ca; font-weight: 400; }

/* форма заполнения */
.indi-form-section { margin-bottom: 20px; }
.indi-form-section h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 12px; color: var(--field-dark); }
.indi-form-section h3 .ic { width: 18px; height: 18px; }
.indi-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.indi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef2ef; }
.indi-row label { font-size: 14px; color: #2c362f; flex: 1; }
.indi-row label .u { color: var(--faint); font-size: 12px; }
.indi-row input { width: 130px; font-family: var(--mono); font-size: 14px; text-align: right; border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px 10px; }
.indi-row input:focus { outline: none; border-color: var(--field); box-shadow: 0 0 0 3px rgba(27,94,63,.12); }
.proof-link { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--field); white-space: nowrap; }
.proof-link:hover { text-decoration: underline; }

.export-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

@media (max-width: 860px) {
  .indi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .indi-rows { grid-template-columns: minmax(0, 1fr); }
}

/* ======================= ТЁМНАЯ ТЕМА ======================= */
[data-theme="dark"] {
  --field: #2e8b5f; --field-dark: #256e4c; --field-soft: #1a2b22;
  --ink: #e7ede9; --muted: #a4b5aa; --faint: #7d9186;
  --bg: #0e1512; --card: #16201b; --line: #26332c; --wheat: #d0a545;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
}
[data-theme="dark"] .sidebar { background: #0b1310; }
[data-theme="dark"] .topbar { background: var(--card); }
[data-theme="dark"] .field input, [data-theme="dark"] .field select, [data-theme="dark"] .field textarea,
[data-theme="dark"] .indi-row input, [data-theme="dark"] .searchbox, [data-theme="dark"] .langswitch { background: #0f1713; color: var(--ink); }
[data-theme="dark"] .stat, [data-theme="dark"] .task-row, [data-theme="dark"] .card, [data-theme="dark"] .queue-item,
[data-theme="dark"] .indi-section, [data-theme="dark"] .indi-cell, [data-theme="dark"] .apptile,
[data-theme="dark"] .kpi-card { background: var(--card); }
[data-theme="dark"] .indi-grid { background: var(--line); }
[data-theme="dark"] .chip--assigned, [data-theme="dark"] .chip--in_progress { background: #1e2a23; }
[data-theme="dark"] .numchip--mut, [data-theme="dark"] .tag, [data-theme="dark"] .role-tag { background: #1e2a23; }

/* переключатель темы: показываем нужную иконку */
.themebtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-2); background: #fff; color: var(--muted); cursor: pointer; }
[data-theme="dark"] .themebtn { background: #0f1713; }
.themebtn:hover { color: var(--field); border-color: var(--field); }
.theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: inline; }

/* строка поиска */
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-2); padding: 6px 12px; background: #fff; color: var(--faint); min-width: 200px; }
.searchbox input { border: none; background: transparent; outline: none; font-family: var(--sans); font-size: 14px; color: var(--ink); width: 100%; }
/* на узком экране в шапке остаётся только лупа; поиск внутри страницы так сворачивать нельзя */
@media (max-width: 980px) {
  .topbar .searchbox { min-width: 0; width: 42px; }
  .topbar .searchbox input { display: none; }
}

/* ======================= ПЛИТКИ-ПРИЛОЖЕНИЯ ======================= */
.applaunch { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-bottom: 8px; }
.apptile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 22px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-5); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s, border-color .12s; }
.apptile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(22,33,28,.12); border-color: #c4d3c9; }
.apptile:active { transform: translateY(0); }
.apptile__icon { width: 60px; height: 60px; border-radius: var(--r-4); display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-brand); }
.apptile__icon svg { width: 30px; height: 30px; }
.apptile__name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.apptile__meta { font-family: var(--mono); font-size: 11px; color: var(--faint); }
/* палитра плиток (iOS-стиль) */
.tile-1 { background: linear-gradient(145deg,#1f7a4d,#14512f); }
.tile-2 { background: linear-gradient(145deg,#2f7db0,#1f5680); }
.tile-3 { background: linear-gradient(145deg,#b7823a,#8a5f22); }
.tile-4 { background: linear-gradient(145deg,#7d5bc0,#573f8f); }
.tile-5 { background: linear-gradient(145deg,#c05b7d,#8f3f5a); }
.tile-6 { background: linear-gradient(145deg,#3a9d8e,#22706a); }
.tile-7 { background: linear-gradient(145deg,#5b8bc0,#3f6690); }
.tile-8 { background: linear-gradient(145deg,#6b7a70,#49564d); }

/* иконка перед показателем */
.indi-cell .lbl-wrap { display: flex; align-items: center; gap: 10px; }
.mini-ic { width: 30px; height: 30px; border-radius: var(--r-2); background: var(--field-soft); color: var(--field); display: grid; place-items: center; flex-shrink: 0; }
.mini-ic svg { width: 16px; height: 16px; }

/* поиск: результаты */
.search-group { margin-bottom: 26px; }
.search-group h2 { font-size: 15px; margin-bottom: 12px; }
.search-empty { color: var(--muted); font-size: 14px; }

/* ======= ДАШБОРД ПОКАЗАТЕЛЕЙ — app-стиль (карточки-виджеты) ======= */
.indi-section { background: transparent; border: none; box-shadow: none; border-radius: 0; overflow: visible; margin-bottom: 28px; }
.indi-head { border-radius: var(--r-3); margin-bottom: 14px; box-shadow: var(--shadow-brand); }
.indi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; background: transparent; }
/* align-items обязательно сбрасываем: раскладка сменилась со строки на колонку,
   а унаследованный center сжимал строку «иконка + подпись» по содержимому —
   из-за этого иконки вставали на разной горизонтали */
.indi-cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); padding: 16px 18px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; box-shadow: var(--shadow); justify-content: space-between; transition: transform .12s, box-shadow .12s, border-color .12s; }
.indi-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c4d3c9; }

.mcard-top { display: flex; align-items: center; gap: 12px; }
.mcard-ic { width: 40px; height: 40px; border-radius: var(--r-3); display: grid; place-items: center; color: #fff; flex-shrink: 0; box-shadow: 0 4px 10px rgba(27,94,63,.22); }
.mcard-ic svg { width: 21px; height: 21px; }
.mcard-lbl { font-size: 13px; color: var(--ink); line-height: 1.3; font-weight: 500; }
.mcard-lbl .u { display: block; font-size: 11px; color: var(--faint); font-weight: 400; margin-top: 1px; }
.mcard-val { font-family: var(--mono); font-size: 27px; font-weight: 600; color: var(--field); line-height: 1; text-align: right; }
.mcard-val.empty { color: #c7d0ca; font-weight: 400; }
[data-theme="dark"] .mcard-val { color: #4fb883; }
[data-theme="dark"] .mcard-val.empty { color: #3a4a41; }
.mcard-proof { font-size: 11px; color: var(--faint); align-self: flex-end; }
a.indi-cell { cursor: pointer; }

/* ======= APP-СТИЛЬ НА ВЕСЬ САЙТ ======= */
:root { --radius: var(--r-4); }
.card, .stat, .task-row, .queue-item, .empty { border-radius: var(--r-4); }
.stat { padding: 20px 22px; transition: transform .12s, box-shadow .12s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .num { font-size: 32px; }
.task-row, .queue-item { transition: transform .12s, box-shadow .12s, border-color .12s; }
.task-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn { border-radius: var(--r-3); }
.iconbtn { border-radius: var(--r-2); padding: 8px 14px; }
.field input, .field select, .field textarea { border-radius: var(--r-3); }
.searchbox, .langswitch, .themebtn { border-radius: var(--r-2); }
.nav a { border-radius: var(--r-2); padding: 12px 14px; }
.sidebar { border-radius: 0 22px 22px 0; }
.avatar { width: 42px; height: 42px; border-radius: var(--r-3); }
.table td { padding: 14px 12px; }
.monitor-table td { padding: 14px 12px; }
.progress { border-radius: var(--r-1); height: 7px; }
.alert { border-radius: var(--r-3); }
.chip { border-radius: var(--r-pill); }
@media (max-width: 860px) { .sidebar { border-radius: 0; } }

/* ======= КАТАЛОГ СОРТОВ ======= */
.vargrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.varcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.varcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.varcard__photo { width: 100%; height: 160px; object-fit: cover; background: var(--field-soft); display: block; }
.varcard__ph { width: 100%; height: 160px; display: grid; place-items: center; background: var(--field-soft); color: var(--field); }
.varcard__ph svg { width: 38px; height: 38px; opacity: .55; }
.varcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.varcard__name { font-weight: 700; font-size: 15px; }
.varcard__meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.varcard__desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.varcard__org { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; }
.varstatus { align-self: flex-start; font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: var(--r-pill); }
.varstatus--testing { color: var(--s-returned); background: #fbf3e3; }
.varstatus--registered { color: var(--s-accepted); background: #ecf7f0; }
.varstatus--promising { color: var(--s-submitted); background: #eef4fb; }
[data-theme="dark"] .varstatus--testing { background: #2c2413; }
[data-theme="dark"] .varstatus--registered { background: #13291c; }
[data-theme="dark"] .varstatus--promising { background: #14212e; }

/* ======= ГЛАВНАЯ ЦЕНТРА: плитки институтов ======= */
.orgtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.orgtile { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-5); padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s, border-color .12s; }
.orgtile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c4d3c9; }
.orgtile__head { display: flex; align-items: flex-start; gap: 14px; }
.orgtile__ic { width: 46px; height: 46px; border-radius: var(--r-3); display: grid; place-items: center; color: #fff; flex-shrink: 0; box-shadow: var(--shadow-brand); }
.orgtile__ic svg { width: 23px; height: 23px; }
.orgtile__name { font-weight: 700; font-size: 14px; line-height: 1.35; }
.orgtile__stats { display: flex; gap: 8px; flex-wrap: wrap; }
.orgtile__stat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--field-soft); border-radius: var(--r-2); padding: 4px 10px; }
.orgtile__stat svg { width: 13px; height: 13px; }
.orgtile__stat.warn { color: #b03b36; background: #fbeceb; }
[data-theme="dark"] .orgtile__stat { background: #1a2b22; }
[data-theme="dark"] .orgtile__stat.warn { background: #2e1615; }
.orgtile__foot { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.orgtile__foot .progress { flex: 1; width: auto; }

/* ======= ПАСПОРТ ИНСТИТУТА ======= */
.orghero { display: flex; align-items: center; gap: 18px; background: var(--field); color: #fff; border-radius: var(--r-5); padding: 22px 26px; margin-bottom: 22px; box-shadow: var(--shadow-brand); }
.orghero__ic { width: 58px; height: 58px; border-radius: var(--r-4); background: rgba(255,255,255,.16); display: grid; place-items: center; flex-shrink: 0; }
.orghero__ic svg { width: 30px; height: 30px; }
.orghero__name { font-size: 19px; font-weight: 800; line-height: 1.3; }
.orghero__sub { font-family: var(--mono); font-size: 12px; color: #a9cdb6; margin-top: 4px; }
.orghero__actions { margin-left: auto; display: flex; gap: 10px; flex-shrink: 0; }
.orghero__actions .iconbtn { background: rgba(255,255,255,.14); color: #fff; border: none; }
.orghero__actions .iconbtn:hover { background: rgba(255,255,255,.24); }
@media (max-width: 860px) { .orghero { flex-wrap: wrap; } .orghero__actions { margin-left: 0; } }

/* ======= подразделы показателей в боковой панели ======= */
.subnav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; padding-left: 10px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-2); font-size: 13px; font-weight: 500; color: #b7cebf; transition: background .12s, color .12s; }
.subnav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.subnav a.on { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.subnav .ic { width: 15px; height: 15px; opacity: .8; }
.subnav .nleft { margin-left: auto; font-family: var(--mono); font-size: 10px; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: var(--r-pill); background: #c0392b; color: #fff; padding: 0 6px; }
.subnav .nleft.done { background: rgba(255,255,255,.16); color: #cfe2d6; }
.sidebar { overflow-y: auto; }

/* бейдж на плитке-приложении (как в PDF) */
.apptile { position: relative; }
.apptile__badge { position: absolute; top: 12px; right: 16px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--r-pill); background: #c0392b; color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; box-shadow: 0 3px 8px rgba(192,57,43,.35); }
.issue-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.issue-card h3 { font-size: 14px; color: var(--field-dark); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .issue-card h3 { color: #7fc9a2; }
.issue-card p { font-size: 14px; line-height: 1.6; color: #2c362f; margin: 0 0 12px; white-space: pre-wrap; }
[data-theme="dark"] .issue-card p { color: #cfe0d5; }
.issue-card .answerbox { background: var(--field-soft); border-radius: var(--r-3); padding: 12px 14px; }
.issue-card .meta { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-bottom: 8px; }

/* ======= лампочки присутствия и KPI ======= */
.lamp { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.lamp--green { background: #22a55b; box-shadow: 0 0 8px rgba(34,165,91,.7); animation: pulse 2s infinite; }
.lamp--amber { background: #e0a72c; box-shadow: 0 0 8px rgba(224,167,44,.6); }
.lamp--red { background: #d64541; }
.lamp--gray { background: #9aa8a0; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.kpibar { display: inline-flex; align-items: center; gap: 8px; }
.kpibar .bar { width: 70px; height: 7px; background: #e7ede9; border-radius: var(--r-1); overflow: hidden; }
[data-theme="dark"] .kpibar .bar { background: #26332c; }
.kpibar .bar span { display: block; height: 100%; border-radius: var(--r-1); background: linear-gradient(90deg,#22a55b,#1b5e3f); }
.kpibar .val { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.late-tag { font-family: var(--mono); font-size: 11px; color: #b7791f; background: #fbf3e3; border-radius: var(--r-1); padding: 2px 6px; }
[data-theme="dark"] .late-tag { background: #2c2413; }

.rank-num { font-family: var(--mono); font-weight: 600; font-size: 15px; width: 30px; display: inline-block; }
.rank-1 { color: #d4af37; } .rank-2 { color: #9aa8a0; } .rank-3 { color: #b7793a; }

.ai-box { background: linear-gradient(135deg, var(--field) 0%, #134a30 100%); color: #eaf3ec; border-radius: var(--r-5); padding: 24px 26px; margin-bottom: 22px; box-shadow: var(--shadow-brand); }
.ai-box h2 { color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ai-box textarea { width: 100%; border: none; border-radius: var(--r-3); padding: 12px 14px; font-family: var(--sans); font-size: 14px; margin-bottom: 12px; background: rgba(255,255,255,.94); }
.ai-answer { white-space: pre-wrap; font-size: 15px; line-height: 1.65; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); padding: 20px 22px; }

/* ======= деталь отчёта: галерея ======= */
.rep-meta { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-bottom: 10px; }
.rep-title { font-size: 22px; font-weight: 800; line-height: 1.3; margin-bottom: 14px; }
.rep-body { font-size: 15px; line-height: 1.7; color: #2c362f; margin-bottom: 8px; }
[data-theme="dark"] .rep-body { color: #cfe0d5; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.gallery img { width: 100%; height: 170px; object-fit: cover; border-radius: var(--r-3); border: 1px solid var(--line); transition: transform .12s; display: block; }
.gallery a:hover img { transform: scale(1.02); }

/* ======= конференции ======= */
.conf-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.conf-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.conf-card__when { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.conf-card__title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.conf-card__desc { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.conf-card__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-badge { font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff; background: #d64541; border-radius: var(--r-pill); padding: 4px 12px; animation: pulse 1.6s infinite; }

/* ======= аккуратный список выбора организаций ======= */
.orggrid { display: flex !important; flex-direction: column; gap: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-3); padding: 4px; background: var(--card); }
.orggrid label { display: flex !important; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); font-size: 14px; line-height: 1.35; cursor: pointer; text-align: left !important; }
.orggrid label:hover { background: var(--field-soft); }
.orggrid input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--field); width: 16px; height: 16px; }

/* ======= сотрудники: группы, ДР, мессенджер ======= */
.dept-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-size: 14px; font-weight: 700; color: var(--field-dark); }
[data-theme="dark"] .dept-head { color: #7fc9a2; }
.dept-head .count { font-family: var(--mono); font-size: 11px; color: var(--faint); background: var(--field-soft); border-radius: var(--r-pill); padding: 2px 10px; }
.bday-banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg,#fdf3e0,#fbe8f0); border: 1px solid #f2ddb8; border-radius: var(--r-4); padding: 14px 18px; margin-bottom: 18px; font-size: 14px; }
[data-theme="dark"] .bday-banner { background: linear-gradient(135deg,#2c2413,#2e1a24); border-color: #4a3b20; }
.bday-badge { font-size: 15px; }
.emp-actions { display: inline-flex; gap: 6px; }
.emp-actions a, .emp-actions button { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.emp-actions a:hover { color: var(--field); border-color: var(--field); }
.emp-actions svg { width: 15px; height: 15px; }

/* ======= чат ======= */
.chat-box { display: flex; flex-direction: column; height: 560px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-5); overflow: hidden; box-shadow: var(--shadow); }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: var(--r-4); font-size: 14px; line-height: 1.5; }
.msg .who { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-bottom: 3px; }
.msg--mine { align-self: flex-end; background: var(--field); color: #fff; border-bottom-right-radius: 5px; }
.msg--mine .who { color: #bcd6c4; }
.msg--their { align-self: flex-start; background: var(--field-soft); border-bottom-left-radius: 5px; }
.msg a { color: inherit; text-decoration: underline; }
.chat-form { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: center; }
.chat-form input[type="text"] { flex: 1; border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 14px; font-family: var(--sans); font-size: 14px; background: var(--card); color: var(--ink); }
.chat-attach { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-2); border: 1px solid var(--line); cursor: pointer; color: var(--muted); position: relative; }
.chat-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chat-attach.has { color: var(--field); border-color: var(--field); }

/* ======= лучшие сотрудники ======= */
.best-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.best-row:last-child { border-bottom: none; }
.best-medal { font-size: 22px; width: 34px; text-align: center; }

/* ======= личный кабинет сотрудника ======= */
.me-hero { display: flex; align-items: center; gap: 18px; background: var(--field); color: #fff; border-radius: var(--r-5); padding: 20px 24px; margin-bottom: 22px; box-shadow: var(--shadow-brand); flex-wrap: wrap; }
.me-hero img, .me-hero .ph { width: 64px; height: 64px; border-radius: var(--r-5); object-fit: cover; flex-shrink: 0; }
.me-hero .ph { background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.me-hero__name { font-size: 19px; font-weight: 800; }
.me-hero__sub { font-family: var(--mono); font-size: 12px; color: #a9cdb6; margin-top: 3px; }
.me-hero__lamp { margin-left: auto; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.14); border-radius: var(--r-pill); padding: 8px 14px; font-size: 13px; }
.ptask { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.ptask:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ptask__rail { width: 4px; height: 34px; border-radius: var(--r-1); background: var(--field); flex-shrink: 0; }
.ptask__body { flex: 1; min-width: 0; }
.ptask__title { font-weight: 600; font-size: 15px; }
.ptask__meta { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 3px; }
.ptask__due.overdue { color: #c0392b; font-weight: 600; }
.prio-urgent { background: #c0392b !important; }
.prio-high { background: #e0a72c !important; }
.prio-low { background: #9aa8a0 !important; }

/* фикс: кнопка отправки в чате не должна растягиваться */
.chat-form .btn { width: auto !important; flex: 0 0 auto; padding: 0 20px; height: 42px; font-size: 17px; }
.chat-form .btn--primary { width: auto !important; }

/* ======= отметка селфи ======= */
.checkin-wrap { max-width: 520px; }
.cam-frame { position: relative; width: 100%; aspect-ratio: 3/4; max-height: 420px; background: #0e1512; border-radius: var(--r-5); overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; }
.cam-frame video, .cam-frame canvas { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-frame .hintbox { position: absolute; color: #8fa79a; font-size: 13px; text-align: center; padding: 0 24px; line-height: 1.6; }
.cam-status { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 14px 0; }
.cam-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa8a0; flex-shrink: 0; }
.cam-status .dot.ok { background: #22a55b; box-shadow: 0 0 8px rgba(34,165,91,.6); }
.cam-status .dot.err { background: #d64541; }
.checkin-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.checkin-btns .btn { flex: 1; min-width: 170px; }
.btn--out { background: #b04a3f; color: #fff; }
.btn--out:hover { background: #983f36; }
.checkin-result { margin-top: 16px; border-radius: var(--r-4); padding: 14px 18px; font-size: 14px; display: none; }
.checkin-result.ok { background: #ecf7f0; color: #1d6b45; display: block; }
.checkin-result.err { background: #fbeceb; color: #b03b36; display: block; }
[data-theme="dark"] .checkin-result.ok { background: #13291c; color: #7fc9a2; }
[data-theme="dark"] .checkin-result.err { background: #2e1615; color: #e79a95; }
.selfie-thumb { width: 40px; height: 40px; border-radius: var(--r-2); object-fit: cover; border: 1px solid var(--line); position: relative; }
.geo-tag { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--field-soft); border-radius: var(--r-1); padding: 2px 8px; }
.face-tag { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  border-radius: 50%; font-size: 10px; font-weight: 700; margin-left: -12px; margin-top: 26px; position: relative; z-index: 1;
  border: 2px solid var(--card); vertical-align: top; }
.face-tag--ok { background: #22a55b; color: #fff; }

/* ======= видеокомната платформы ======= */
.conf-room { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-5); overflow: hidden; box-shadow: var(--shadow); }
.conf-room__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.conf-room__frame { width: 100%; height: 620px; background: #0e1512; }
.conf-room__frame iframe { border: 0; }
.conf-room__err { color: #e79a95; display: grid; place-items: center; height: 100%; font-size: 14px; padding: 24px; text-align: center; }
.conf-kind { font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--field-soft); color: var(--field); }
[data-theme="dark"] .conf-kind { background: #1a2b22; color: #7fc9a2; }
@media (max-width: 860px) { .conf-room__frame { height: 460px; } }

/* ======= размещение культур и карта ======= */
/* position задаём явно: иначе Leaflet при инициализации пропишет
   inline position:relative, и полноэкранный режим карты работать не будет */
.map-box { position: relative; height: 460px; border-radius: var(--r-4); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; }
.map-box.tall { height: 560px; }
.leaflet-container { font-family: var(--sans); background: #dfe6e0; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 8px; }
.map-legend i { width: 12px; height: 12px; border-radius: var(--r-1); display: inline-block; }
.crop-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--field-soft); border-radius: var(--r-pill); padding: 4px 12px; color: var(--field); }
[data-theme="dark"] .crop-chip { background: #1a2b22; color: #7fc9a2; }
.plant-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plant-row:last-child { border-bottom: none; }
.plant-row .nm { font-weight: 600; font-size: 14px; }
.plant-row .sub { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.plant-row .money { margin-left: auto; font-family: var(--mono); font-weight: 600; color: var(--field); white-space: nowrap; }
[data-theme="dark"] .plant-row .money { color: #4fb883; }
.draw-hint { font-size: 13px; color: var(--muted); background: var(--field-soft); border-radius: var(--r-3); padding: 10px 14px; margin-bottom: 12px; }
[data-theme="dark"] .draw-hint { background: #1a2b22; }


/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ — off-canvas меню, бургер, антисдвиг
   Добавлено для приведения телефона в порядок.
   ============================================================ */

/* Кнопка-бургер и оверлей по умолчанию скрыты (видны только на мобильном) */
.burger { display: none; }
.nav-overlay { display: none; }

@media (max-width: 860px) {

  /* --- Глобальный предохранитель от горизонтального сдвига --- */
  html, body { max-width: 100%; overflow-x: hidden; }
  img, svg, video, iframe, canvas { max-width: 100%; }

  /* --- Раскладка становится вертикальной --- */
  .app { flex-direction: column; min-height: 100vh; }

  /* --- Боковое меню превращается в выезжающую панель слева --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 82%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
    border-radius: 0;
    overflow-y: auto;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  /* когда на <body> добавлен класс nav-open — панель выезжает */
  body.nav-open .sidebar { transform: translateX(0); }

  .brand { padding: 0 6px 22px; margin: 0; }
  .nav { flex-direction: column; gap: 3px; }
  .sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }

  /* --- Затемнённый фон позади открытого меню --- */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 999;
  }
  body.nav-open .nav-overlay { opacity: 1; visibility: visible; }

  /* когда меню открыто — фон страницы не скроллится */
  body.nav-open { overflow: hidden; }

  /* --- Контент занимает всю ширину --- */
  .content { width: 100%; min-width: 0; }

  /* --- Топбар: кнопка-бургер слева, всё компактнее --- */
  .topbar {
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .topbar h1 { font-size: 18px; line-height: 1.2; }
  .topbar .crumb { margin-bottom: 2px; }

  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
  }
  .burger svg { width: 22px; height: 22px; }

  /* правая часть топбара переносится под заголовок, если не влезает */
  .topbar__right { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  /* на телефоне блок «кто вошёл» прячем — он есть в меню/профиле */
  .topbar__right .who { display: none; }

  .main { padding: 18px 16px 40px; }

  /* --- Таблицы больше не рвут страницу: горизонтальная прокрутка внутри --- */
  .table, .monitor-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .monitor-table td:first-child { max-width: none; }

  /* сетки плиток приложений — по 2 в ряд, аккуратнее */
  .applaunch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* совсем узкие экраны (маленькие телефоны).
   Сетки задаются ниже, в общем мобильном блоке — здесь только топбар. */
@media (max-width: 420px) {
  .topbar__right { gap: 8px; }
}

/* тёмная тема: бургер в цветах карточки */
[data-theme="dark"] .burger { background: var(--card); color: var(--ink); border-color: var(--line); }

/* ======= голосовой ИИ-помощник (весь экран) ======= */
.voiceai {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, var(--field) 0%, var(--field-dark) 70%);
  color: #fff; padding: 32px 20px; position: relative; overflow: hidden;
}
.voiceai__back {
  position: absolute; top: 22px; left: 22px; display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.75); text-decoration: none; font-size: 14px; font-weight: 500;
}
.voiceai__back:hover { color: #fff; }
.voiceai__back .ic { width: 18px; height: 18px; }

.voiceai__stage { display: flex; flex-direction: column; align-items: center; gap: 26px; max-width: 560px; text-align: center; }

.voiceai__orb { position: relative; width: 180px; height: 180px; display: grid; place-items: center; }
.voiceai__core {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0b563, var(--wheat) 70%);
  display: grid; place-items: center; box-shadow: 0 0 40px rgba(184,137,43,.55);
  animation: voiceai-breathe 3.4s ease-in-out infinite;
  z-index: 2;
}
.voiceai__core .ic { width: 40px; height: 40px; color: #fff; }
.voiceai__ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(184,137,43,.45); }
.voiceai__ring--1 { animation: voiceai-ring 3.4s ease-out infinite; }
.voiceai__ring--2 { animation: voiceai-ring 3.4s ease-out infinite 1.1s; }

.voiceai__orb--listening .voiceai__core { animation: voiceai-breathe 1.1s ease-in-out infinite; box-shadow: 0 0 55px rgba(224,181,99,.8); }
.voiceai__orb--listening .voiceai__ring { border-color: rgba(224,181,99,.75); }
.voiceai__orb--listening .voiceai__ring--1 { animation-duration: 1.4s; }
.voiceai__orb--listening .voiceai__ring--2 { animation-duration: 1.4s; animation-delay: .5s; }

.voiceai__orb--thinking .voiceai__core { animation: voiceai-spin 1.6s linear infinite; }

.voiceai__orb--speaking .voiceai__core { animation: voiceai-breathe .7s ease-in-out infinite; box-shadow: 0 0 60px rgba(224,181,99,.9); }
.voiceai__orb--speaking .voiceai__ring--1 { animation-duration: 1s; }
.voiceai__orb--speaking .voiceai__ring--2 { animation-duration: 1s; animation-delay: .3s; }

@keyframes voiceai-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes voiceai-ring { 0% { transform: scale(.75); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes voiceai-spin { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(180deg) scale(1.05); } 100% { transform: rotate(360deg) scale(1); } }

.voiceai__status { font-size: 17px; font-weight: 500; color: rgba(255,255,255,.9); min-height: 24px; }
.voiceai__transcript { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.72); max-width: 520px; }

.voiceai__controls { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.voiceai__mic {
  width: 68px; height: 68px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: var(--field-dark); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .15s;
}
.voiceai__mic:hover { transform: scale(1.06); }
.voiceai__mic .ic { width: 28px; height: 28px; }
.voiceai__textfallback { display: flex; gap: 8px; width: min(420px, 90vw); }
.voiceai__textfallback input {
  flex: 1; border-radius: var(--r-2); border: none; padding: 10px 14px; font-size: 14px;
  background: rgba(255,255,255,.12); color: #fff;
}
.voiceai__textfallback input::placeholder { color: rgba(255,255,255,.55); }
.voiceai__textfallback input:focus { outline: 2px solid rgba(255,255,255,.4); }

@media (max-width: 480px) {
  .voiceai__orb { width: 140px; height: 140px; }
  .voiceai__core { width: 76px; height: 76px; }
}

/* ======= камеры: клик-на-фуллскрин ======= */
.cam-tile { position: relative; cursor: pointer; }
.cam-tile__expand {
  position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: var(--r-2);
  background: rgba(18,63,43,.65); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .15s;
}
.cam-tile__expand .ic { width: 16px; height: 16px; }
.cam-tile:hover .cam-tile__expand { opacity: 1; }
.cam-tile__live-dot {
  position: absolute; left: 10px; top: 10px; display: flex; align-items: center; gap: 6px;
  background: rgba(18,63,43,.65); color: #fff; font-size: 11px; font-weight: 600;
  border-radius: var(--r-5); padding: 3px 10px 3px 8px; letter-spacing: .03em;
}
.cam-tile__live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; animation: cam-blink 1.6s ease-in-out infinite; }
@keyframes cam-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.camfs {
  position: fixed; inset: 0; background: rgba(8,14,11,.94); z-index: 500;
  display: none; align-items: center; justify-content: center; flex-direction: column; padding: 24px;
}
.camfs.on { display: flex; }
.camfs__close {
  position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; color: #fff; display: grid; place-items: center; cursor: pointer;
}
.camfs__close:hover { background: rgba(255,255,255,.22); }
.camfs__title { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 14px; text-align: center; }
.camfs__stage { width: 100%; height: 100%; max-width: 1400px; display: grid; place-items: center; }
.camfs__img, .camfs__frame { max-width: 100%; max-height: calc(100vh - 100px); width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: var(--r-2); }

.cam-rename { display: flex; align-items: center; gap: 2px; }
.cam-rename__input {
  flex: 1; min-width: 0; border: 1px solid transparent; background: transparent;
  font-weight: 600; font-size: 14px; color: var(--ink); padding: 3px 6px; border-radius: var(--r-1);
  font-family: var(--sans);
}
.cam-rename__input:hover { border-color: var(--line); }
.cam-rename__input:focus { border-color: var(--field); background: var(--field-soft); outline: none; }
.cam-rename__save {
  border: none; background: transparent; color: var(--faint); cursor: pointer;
  padding: 4px; border-radius: var(--r-1); display: flex; flex-shrink: 0;
}
.cam-rename__save:hover { color: var(--field); background: var(--field-soft); }
.cam-rename__save .ic { width: 15px; height: 15px; }

/* ======= KPI-карточки (кликабельные, с иконкой, ведут в детальную аналитику) ======= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 30px; }
.kpi-card {
  display: flex; flex-direction: column; gap: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-4); padding: 20px 20px 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease; position: relative;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(22,33,28,.12); }
.kpi-card__top { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi-card__icon { width: 40px; height: 40px; border-radius: var(--r-3); display: grid; place-items: center; flex-shrink: 0; }
.kpi-card__icon .ic { width: 20px; height: 20px; }
.kpi-card__arrow { color: var(--faint); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; margin-top: 8px; }
.kpi-card:hover .kpi-card__arrow { opacity: 1; transform: translateX(0); }
.kpi-card__arrow .ic { width: 15px; height: 15px; }
.kpi-card__num { font-family: var(--mono); font-size: 27px; font-weight: 700; line-height: 1; color: var(--ink); }
.kpi-card__lab { font-size: 13px; color: var(--muted); margin-top: 6px; }

.kpi-card__icon.tone-1, .stat__ic.tone-1, .ind-tile__ic.tone-1 { background: #eaf3ee; color: #1b5e3f; }
.kpi-card__icon.tone-2, .stat__ic.tone-2, .ind-tile__ic.tone-2 { background: #eaf1fb; color: #2563a8; }
.kpi-card__icon.tone-3, .stat__ic.tone-3, .ind-tile__ic.tone-3 { background: #fbf1e3; color: #b7791f; }
.kpi-card__icon.tone-4, .stat__ic.tone-4, .ind-tile__ic.tone-4 { background: #f4ecfb; color: #7c3aed; }
.kpi-card__icon.tone-5, .stat__ic.tone-5, .ind-tile__ic.tone-5 { background: #fbeaea; color: #c0392b; }
.kpi-card__icon.tone-6, .stat__ic.tone-6, .ind-tile__ic.tone-6 { background: #e6f6f2; color: #0f9d78; }
.kpi-card__icon.tone-7, .stat__ic.tone-7, .ind-tile__ic.tone-7 { background: #eef0fb; color: #4a55c7; }
.kpi-card__icon.tone-8, .stat__ic.tone-8, .ind-tile__ic.tone-8 { background: #fdeef5; color: #c2185b; }
[data-theme="dark"] .kpi-card__icon.tone-1, [data-theme="dark"] .stat__ic.tone-1, [data-theme="dark"] .ind-tile__ic.tone-1 { background: rgba(27,94,63,.28); color: #6fcf9b; }
[data-theme="dark"] .kpi-card__icon.tone-2, [data-theme="dark"] .stat__ic.tone-2, [data-theme="dark"] .ind-tile__ic.tone-2 { background: rgba(37,99,168,.28); color: #7db2ee; }
[data-theme="dark"] .kpi-card__icon.tone-3, [data-theme="dark"] .stat__ic.tone-3, [data-theme="dark"] .ind-tile__ic.tone-3 { background: rgba(183,121,31,.28); color: #f0c37a; }
[data-theme="dark"] .kpi-card__icon.tone-4, [data-theme="dark"] .stat__ic.tone-4, [data-theme="dark"] .ind-tile__ic.tone-4 { background: rgba(124,58,237,.28); color: #c4a4f5; }
[data-theme="dark"] .kpi-card__icon.tone-5, [data-theme="dark"] .stat__ic.tone-5, [data-theme="dark"] .ind-tile__ic.tone-5 { background: rgba(192,57,43,.28); color: #f0a099; }
[data-theme="dark"] .kpi-card__icon.tone-6, [data-theme="dark"] .stat__ic.tone-6, [data-theme="dark"] .ind-tile__ic.tone-6 { background: rgba(15,157,120,.28); color: #7fe0c4; }
[data-theme="dark"] .kpi-card__icon.tone-7, [data-theme="dark"] .stat__ic.tone-7, [data-theme="dark"] .ind-tile__ic.tone-7 { background: rgba(74,85,199,.28); color: #b0b6f0; }
[data-theme="dark"] .kpi-card__icon.tone-8, [data-theme="dark"] .stat__ic.tone-8, [data-theme="dark"] .ind-tile__ic.tone-8 { background: rgba(194,24,91,.28); color: #f5a0c4; }

@media (max-width: 600px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ======= карточки с графиками (Chart.js) ======= */
/* minmax(0,…) обязателен: иначе холст Chart.js растягивает колонку и страница уезжает вбок */
.chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.chart-row--one { grid-template-columns: minmax(0, 1fr); }

/* плашка-ссылка с иконкой */
.stat--link { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.stat--link:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22,33,28,.12); }
.stat__go { display: inline-flex; vertical-align: middle; margin-left: 6px; opacity: .45; }
.stat__go .ic { width: 14px; height: 14px; }
.stat__ic {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--r-2); margin-bottom: 14px;
}
.stat__ic .ic { width: 19px; height: 19px; }
.chart-card h2 { margin-bottom: 16px; }
.chart-box { position: relative; height: 260px; }
.chart-box--sm { height: 200px; }
@media (max-width: 860px) { .chart-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .chart-row--3 { grid-template-columns: minmax(0, 1fr); } }

/* ======= экспорт: печать / Excel / CSV ======= */
.export-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 18px; }
.export-bar__btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600;
  cursor: pointer; }
.export-bar__btn:hover { background: var(--field-soft); border-color: var(--field); color: var(--field-dark); }
[data-theme="dark"] .export-bar__btn:hover { background: rgba(27,94,63,.22); color: #6fcf9b; }

/* ======= страница «из чего сложился показатель» ======= */
.reg-head { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4);
  padding: 18px 22px; box-shadow: var(--shadow); margin: 16px 0 18px; flex-wrap: wrap; }
.reg-head__org { font-size: 17px; font-weight: 700; }
.reg-head__sub { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 4px; }
.reg-head__value { display: flex; align-items: baseline; gap: 6px; }
.reg-head__num { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--field); }
.reg-head__unit { font-size: 13px; color: var(--muted); }

.reg-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.reg-search { flex: 1 1 280px; min-width: 240px; }
.reg-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.reg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.reg-chip:hover { border-color: var(--field); color: var(--field); }
.reg-chip.on { background: var(--field); border-color: var(--field); color: #fff; }
.reg-chip__n { font-family: var(--mono); font-size: 11px; opacity: .75; }

.reg-group { margin-bottom: 22px; }
.reg-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.reg-group__head h3 { font-size: 14px; font-weight: 700; }
.reg-group__ic { width: 28px; height: 28px; border-radius: var(--r-2); display: grid; place-items: center;
  background: var(--field-soft); color: var(--field); flex-shrink: 0; }
.reg-group__ic .ic { width: 15px; height: 15px; }

.reg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.reg-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3);
  text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s, border-color .12s; }
.reg-card:not(.reg-card--plain):hover { transform: translateY(-2px); border-color: #c4d3c9;
  box-shadow: var(--shadow-lg); }
.reg-card__ava { width: 42px; height: 42px; border-radius: var(--r-3); flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; background: var(--field-soft); color: var(--field); }
.reg-card__ava img { width: 100%; height: 100%; object-fit: cover; }
.reg-card__initial { font-weight: 700; font-size: 16px; }
.reg-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.reg-card__name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.reg-card__pos { font-size: 12px; color: var(--muted); }
.reg-card__meta { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.reg-card__go { opacity: .35; flex-shrink: 0; }
.reg-card__go .ic { width: 15px; height: 15px; }
.reg-card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.reg-tag { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--field-soft); color: var(--field-dark); font-weight: 600; }
.reg-tag--head { background: #fbf1e3; color: #8a5f22; }
.reg-tag--sci { background: #eaf1fb; color: #1f5680; }
[data-theme="dark"] .reg-tag--head { background: rgba(183,121,31,.25); color: #f0c37a; }
[data-theme="dark"] .reg-tag--sci { background: rgba(37,99,168,.25); color: #7db2ee; }
@media (max-width: 560px) { .reg-cards { grid-template-columns: minmax(0, 1fr); } }

/* показывает, сколько институтов уже заполнило показатель */
.kpi-card__src { margin-top: 4px; font-size: 11px; color: var(--faint); font-family: var(--mono); }

/* ======= персонализация: избранное в меню + drag-and-drop KPI ======= */
.nav a { position: relative; }
.nav-fav {
  margin-left: auto; opacity: .35; background: none; border: none; color: inherit;
  display: flex; align-items: center; padding: 2px; cursor: pointer; flex-shrink: 0;
}
.nav-fav:hover { opacity: .85; }
.nav-fav.on { opacity: 1; color: #f0c419; }
.nav-fav .ic { width: 15px; height: 15px; }
.nav-fav .ic use { fill: none; }
.nav-fav.on .ic { fill: #f0c419; }
.favs-list.subnav { padding-left: 0; margin: 0 0 10px; }
.nav-fav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: #9fc4ac; padding: 6px 12px 6px; font-weight: 600;
}

.kpi-card { cursor: grab; position: relative; }
.kpi-card.dragging { opacity: .4; cursor: grabbing; }
.kpi-card__grip { position: absolute; top: 8px; right: 8px; opacity: .3; pointer-events: none; }
.kpi-card__grip .ic { width: 14px; height: 14px; }
.kpi-card:hover .kpi-card__grip { opacity: .6; }

@media print {
  .sidebar, .nav-overlay, .topbar__right, .burger, .export-bar,
  .alert, .sidebar__foot, .btn, .iconbtn, button { display: none !important; }
  .app { display: block !important; }
  .content { display: block !important; }
  .main { padding: 0 !important; }
  body, .content { background: #fff !important; }
  .card, .chart-card, .stat, .kpi-card { box-shadow: none !important; border: 1px solid #ccc !important; }
  .chart-row, .kpi-grid, .stats { break-inside: avoid; }
  a[href]::after { content: ""; }
}
.chart-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ======= Командный центр: живой статус, усиленные карточки, кликабельные графики ======= */
.cc-status {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 20px; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.cc-status__live { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  letter-spacing: .03em; color: var(--field-dark); text-transform: uppercase; }
[data-theme="dark"] .cc-status__live { color: #6fcf9b; }
.cc-status__sep { width: 1px; height: 16px; background: var(--line); }
.cc-status__updated { font-family: var(--mono); font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.cc-status__refresh {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 14px;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: border-color .12s, color .12s;
}
.cc-status__refresh:hover { border-color: var(--field); color: var(--field); }
.cc-status__refresh .ic { width: 13px; height: 13px; transition: transform .5s ease; }
.cc-status__refresh.spinning .ic { animation: cc-spin .7s linear infinite; }
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* вспышка при живом обновлении числа */
@keyframes cc-flash { 0% { color: var(--field); } 100% { color: inherit; } }
.cc-flash { animation: cc-flash 1.1s ease; }

/* цветной верхний штрих на карточках-плашках по тону показателя */
.stat, .kpi-card { position: relative; overflow: hidden; }
.stat::before, .kpi-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--field), #22a55b); opacity: .8;
}
.kpi-card.tone-src::before { background: inherit; }
.stat--accent::before { background: linear-gradient(90deg, #1b5e3f, #0f9d78); }

/* графики: явный намёк, что по ним можно кликать */
.chart-card { position: relative; }
.chart-card__hint {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint);
  margin-top: 10px; font-style: italic;
}
.chart-card__hint .ic { width: 12px; height: 12px; opacity: .7; }
.chart-box { cursor: pointer; }

/* карта: полноэкранный режим + легенда */
.cc-map-wrap { position: relative; }
.cc-map-fs {
  position: absolute; top: 12px; right: 12px; z-index: 500;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2);
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; box-shadow: var(--shadow);
}
.cc-map-fs:hover { color: var(--field); border-color: var(--field); }
.cc-map-fs .ic { width: 14px; height: 14px; }
.map-box.cc-fullscreen {
  position: fixed; inset: 16px; z-index: 2000; border-radius: var(--r-3);
  /* высоту задаёт inset, поэтому фиксированную height обязательно снимаем */
  height: auto; width: auto; margin: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
body.cc-map-open::after {
  content: ""; position: fixed; inset: 0; background: rgba(10,16,12,.55); z-index: 1900;
}

/* ======= аналитическая панель показателей ======= */
.an-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: center;
  background: linear-gradient(135deg, var(--field-dark), var(--field));
  color: #fff; border-radius: var(--r-5); padding: 24px 28px; margin-bottom: 22px;
  box-shadow: 0 12px 30px rgba(27,94,63,.25);
}
.an-ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.an-ring svg { transform: rotate(-90deg); }
.an-ring__track { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 11; }
.an-ring__bar { fill: none; stroke: #8fe3b4; stroke-width: 11; stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1); }
.an-ring__val { position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 27px; font-weight: 700; }
.an-hero__t { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.an-hero__sub { font-size: 14px; opacity: .85; line-height: 1.5; max-width: 60ch; }
.an-hero__nums { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 16px; }
.an-hero__num b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 700; }
.an-hero__num span { font-size: 12px; opacity: .8; }

/* Карточки диаграмм выровнены по сетке: у всех одинаковая высота шапки,
   подписи и легенды, поэтому пончики лежат на одной линии, а не вразброс. */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px; margin-bottom: 26px; align-items: stretch; }
.an-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4);
  padding: 18px 20px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
  display: flex; flex-direction: column; min-width: 0; }
.an-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.an-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
  min-height: 32px; }
.an-card__ic { width: 32px; height: 32px; border-radius: var(--r-2); display: grid; place-items: center;
  background: var(--field-soft); color: var(--field); flex-shrink: 0; }
.an-card__ic .ic { width: 16px; height: 16px; }
.an-card__head h3 { font-size: 15px; font-weight: 700; line-height: 1.25; }
/* высота фиксирована: карточка без подписи не должна поднимать свой пончик */
.an-card__hint { font-size: 12px; color: var(--faint); margin-bottom: 10px;
  min-height: 17px; line-height: 17px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.an-donut { position: relative; height: 200px; margin-top: 4px; flex-shrink: 0; }
.an-donut__center { position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; text-align: center; }
.an-donut__center b { display: block; font-family: var(--mono); font-size: 24px;
  font-weight: 700; color: var(--field); line-height: 1.15; }
.an-donut__center span { font-size: 11px; color: var(--faint); display: block;
  max-width: 15ch; margin: 0 auto; line-height: 1.25; }

/* своя легенда — кликом гасим сектор, наведением подсвечиваем.
   Строгие две колонки вместо переноса по месту: иначе пункты ложились
   то по одному, то по два в строку, и легенда выглядела рваной.
   Высота фиксирована — карточки в ряду получаются одинаковыми. */
.an-legend {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px; margin-top: 14px; align-content: start;
  height: 162px; overflow-y: auto; padding-right: 2px;
}
.an-legend__i {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center; gap: 7px; font-size: 12px; text-align: left;
  background: none; border: 0; padding: 2px 0; cursor: pointer; color: var(--ink);
  transition: opacity .15s; min-width: 0;
}
.an-legend__i > span:nth-child(2) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.an-legend__i:hover { opacity: .65; }
.an-legend__i.is-off { opacity: .35; text-decoration: line-through; }
.an-legend__d { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.an-legend__v { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
/* тонкая полоса прокрутки, если пунктов больше, чем помещается */
.an-legend::-webkit-scrollbar { width: 6px; }
.an-legend::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ===== Выбор отчётного периода ===== */
.periodbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 0 16px;
}
.periodbar__lab {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted);
}
.periodbar__lab .ic { color: var(--field); }
.periodbar .langswitch select { font-weight: 600; min-width: 150px; }
/* закрытый период: видно сразу, что вводить нельзя */
.periodbar__closed {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 6px 12px;
  border-radius: var(--r-pill); background: #fbf1e3; color: #b7791f;
}
[data-theme="dark"] .periodbar__closed { background: rgba(183,121,31,.22); color: #f0c37a; }
/* подпись: с каким периодом сравниваются стрелки */
.periodbar__cmp {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--faint); margin-left: auto;
}
.periodbar__cmp .ic { width: 13px; height: 13px; color: var(--field); }
@media (max-width: 700px) { .periodbar__cmp { margin-left: 0; } }

/* ===== Раздел показателей: шапка и плитки ===== */
.sec-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--field) 0%, var(--field-dark) 100%);
  color: #fff; border-radius: var(--r-5); padding: 22px 26px; margin: 16px 0 20px;
  box-shadow: var(--shadow-brand);
}
.sec-hero__ic {
  width: 54px; height: 54px; border-radius: var(--r-4); flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
}
.sec-hero__ic svg { width: 26px; height: 26px; }
.sec-hero__body { flex: 1 1 260px; min-width: 0; }
.sec-hero__t { font-size: 20px; font-weight: 700; line-height: 1.25; }
.sec-hero__nums { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 10px; }
.sec-hero__nums span { font-size: 12px; opacity: .85; }
.sec-hero__nums b {
  display: block; font-family: var(--mono); font-size: 19px;
  font-weight: 700; opacity: 1;
}
/* кольцо заполненности: тонкая дуга поверх бледной дорожки */
.sec-hero__ring { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.sec-hero__ring svg { transform: rotate(-90deg); }
.sec-ring__track { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 8; }
.sec-ring__bar {
  fill: none; stroke: #8fe3b4; stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1);
}
.sec-hero__pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 19px; font-weight: 700;
}
.sec-hero__pct i { font-style: normal; font-size: 11px; opacity: .8; }

.ind-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.ind-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4);
  padding: 16px 18px; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.ind-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ind-tile__ic {
  width: 34px; height: 34px; border-radius: var(--r-2); display: grid;
  place-items: center; color: #fff; margin-bottom: 12px;
}
.ind-tile__ic .ic { width: 17px; height: 17px; }
.ind-tile__val {
  font-family: var(--mono); font-size: 24px; font-weight: 700;
  color: var(--field); line-height: 1.1;
}
.ind-tile__val i { font-style: normal; font-size: 12px; color: var(--faint); margin-left: 4px; }
/* подпись ровно в две строки, иначе плитки в ряду разной высоты */
.ind-tile__lab {
  font-size: 13px; font-weight: 600; margin-top: 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: calc(2 * 1.35em);
}
.ind-tile__bar {
  height: 5px; border-radius: 6px; background: var(--field-soft);
  overflow: hidden; margin-top: 12px;
}
.ind-tile__bar span {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #22a55b, #1b5e3f);
}
.ind-tile__src { font-size: 11px; color: var(--faint); margin-top: 6px; }
.ind-tile--empty .ind-tile__val { color: var(--faint); }
.ind-tile--empty .ind-tile__bar span { background: #d64541; }
[data-theme="dark"] .ind-tile__bar { background: #22302a; }

@media (max-width: 860px) {
  .sec-hero { padding: 18px 20px; gap: 14px; }
  .ind-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .ind-tile { padding: 14px; }
}

/* вкладки языков в форме материала */
.langtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.langtabs__b { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--card); color: var(--muted); transition: background .12s, color .12s; }
.langtabs__b:hover { color: var(--field); border-color: var(--field); }
.langtabs__b.on { background: var(--field); border-color: var(--field); color: #fff; }

/* официальный адрес в строке реестра и в попапе карты */
.row-addr { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px;
  font-size: 12px; color: var(--faint); line-height: 1.4; }
.row-addr .ic { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }
.cc-pop__addr { color: var(--faint); font-size: 11px; line-height: 1.4; margin: 2px 0; }

/* состояние реестров: пустой реестр видно сразу */
.reg-state { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 26px; }
.reg-tile { display: block; text-decoration: none; color: inherit; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4);
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; }
.reg-tile:hover { transform: translateY(-2px); border-color: var(--field);
  box-shadow: var(--shadow-lg); }
.reg-tile__ic { width: 30px; height: 30px; border-radius: var(--r-2); display: grid; place-items: center;
  background: var(--field-soft); color: var(--field); margin-bottom: 8px; }
.reg-tile__ic .ic { width: 15px; height: 15px; }
.reg-tile b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 700;
  line-height: 1.1; color: var(--field); }
.reg-tile__t { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.reg-tile__s { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.reg-tile--empty { border-style: dashed; }
.reg-tile--empty b, .reg-tile--empty .reg-tile__ic { color: var(--faint); }
.reg-tile--empty .reg-tile__ic { background: var(--field-soft); opacity: .6; }
.reg-tile--empty .reg-tile__s { color: #c0392b; }

/* заполненность разделов — цветные полосы */
.an-bars { display: flex; flex-direction: column; gap: 12px; }
.an-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.an-bar__name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.an-bar__name .ic { width: 15px; height: 15px; color: var(--field); flex-shrink: 0; }
.an-bar__pct { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.an-bar__track { grid-column: 1 / -1; height: 8px; border-radius: var(--r-1); background: var(--field-soft); overflow: hidden; }
[data-theme="dark"] .an-bar__track { background: #22302a; }
.an-bar__fill { display: block; height: 100%; border-radius: var(--r-1);
  background: linear-gradient(90deg, #22a55b, #1b5e3f); width: 0;
  transition: width 1.1s cubic-bezier(.22,1,.36,1); }
.an-bar--low .an-bar__fill { background: linear-gradient(90deg, #e0a72c, #b7791f); }
.an-bar--zero .an-bar__fill { background: #d64541; }
a.an-bar { text-decoration: none; color: inherit; }
a.an-bar:hover .an-bar__name { color: var(--field); }

@media (max-width: 860px) {
  .an-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; text-align: center; }
  .an-ring { margin: 0 auto; }
  .an-hero__nums { justify-content: center; gap: 18px; }
  .an-grid { grid-template-columns: minmax(0, 1fr); }
  .an-donut { height: 190px; }
  /* карточки идут одна под другой — фиксировать высоту легенды незачем,
     а прокрутка внутри карточки на телефоне только мешает */
  .an-legend { height: auto; overflow: visible; }
}
@media (max-width: 520px) {
  .an-legend { grid-template-columns: minmax(0, 1fr); }
}

/* метки на карте: институты, станции, участки */
.cc-pin-wrap { background: none; border: none; }
.cc-pin {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg); font-size: 14px; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); cursor: pointer;
  transition: transform .15s;
}
.cc-pin > * { transform: rotate(45deg); }
.cc-pin-wrap:hover .cc-pin { transform: rotate(-45deg) scale(1.15); }
.cc-pop { font-size: 13px; line-height: 1.45; min-width: 170px; }
.cc-pop b { font-size: 14px; }
.cc-pop div { color: var(--muted); }
.cc-pop__owner { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line);
  font-weight: 600; color: var(--field) !important; }
.cc-pop a { display: inline-block; margin-top: 8px; color: var(--field); font-weight: 600; }
.leaflet-tooltip { font-family: var(--sans); font-size: 12px; }

/* =====================================================================
   МОБИЛЬНАЯ ВЁРСТКА — единая сетка, ничего не «разъезжается»
   Блок идёт последним, поэтому перекрывает более ранние правила.
   ===================================================================== */
@media (max-width: 860px) {

  /* --- Все сетки: ровно 2 колонки, одинаковая высота карточек --- */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
  .applaunch { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
  .orgtiles { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .reg-cards { grid-template-columns: minmax(0, 1fr); }

  /* карточки в сетке тянутся на всю высоту ячейки — низ выравнивается */
  .stat, .kpi-card, .apptile { height: 100%; }
  .kpi-card { justify-content: space-between; }

  /* --- Плашки статистики --- */
  .stat { padding: 14px 14px 16px; }
  .stat .num { font-size: 26px; }
  .stat .lab { font-size: 12px; line-height: 1.3; margin-top: 6px; }
  .stat__ic { width: 34px; height: 34px; border-radius: var(--r-2); margin-bottom: 10px; }
  .stat__ic .ic { width: 17px; height: 17px; }
  .stat__go { display: none; }          /* стрелка съедает место, карточка и так кликабельна */

  /* --- KPI-карточки --- */
  .kpi-card { padding: 14px; }
  .kpi-card__num { font-size: 25px; }
  .kpi-card__lab { font-size: 12px; line-height: 1.3; }
  .kpi-card__src { font-size: 10px; }
  .kpi-card__icon { width: 34px; height: 34px; border-radius: var(--r-2); }
  .kpi-card__icon .ic { width: 17px; height: 17px; }
  .kpi-card__arrow, .kpi-card__grip { display: none; }
  .kpi-card { cursor: pointer; }        /* перетаскивание — только на десктопе */

  /* --- Плитки разделов --- */
  .apptile { padding: 16px 10px; gap: 10px; border-radius: var(--r-4); }
  .apptile__icon { width: 46px; height: 46px; border-radius: var(--r-3); }
  .apptile__icon svg { width: 23px; height: 23px; }
  .apptile__name { font-size: 13px; }

  /* --- Заголовки разделов: действие переносится вниз, а не ломает строку --- */
  .section-head { flex-wrap: wrap; align-items: center; gap: 8px; }
  .section-head h2 { font-size: 15px; }
  .section-head .iconbtn { margin-left: 0 !important; width: 100%; justify-content: center; }

  /* --- Панель живого мониторинга --- */
  .cc-status { border-radius: var(--r-4); padding: 12px 14px; gap: 10px; }
  .cc-status__sep { display: none; }
  .cc-status__live, .cc-status__updated { font-size: 12px; }
  .cc-status__refresh { margin-left: 0; width: 100%; justify-content: center; min-height: 40px; }

  /* --- Кнопки экспорта: равной ширины в одну строку --- */
  .export-bar { justify-content: stretch; gap: 8px; }
  .export-bar__btn { flex: 1; justify-content: center; min-height: 40px; padding: 8px 6px; font-size: 12px; }

  /* --- Графики --- */
  .chart-box { height: 240px; }
  .chart-box--sm { height: 190px; }
  .chart-card h2 { font-size: 14px; margin-bottom: 12px; }
  .chart-card__hint { font-size: 11px; }

  /* --- Карта --- */
  .map-box { height: 320px; }
  .map-box.tall { height: 380px; }
  /* идёт после .tall — иначе фиксированная высота победит inset */
  .map-box.cc-fullscreen { inset: 8px; height: auto; }
  .cc-map-fs { top: 8px; right: 8px; padding: 8px 10px; font-size: 11px; min-height: 38px; }

  /* --- Страница «из чего сложился показатель» --- */
  .reg-head { border-radius: var(--r-4); padding: 14px 16px; gap: 10px; }
  .reg-head__org { font-size: 15px; }
  .reg-head__num { font-size: 26px; }
  .reg-tools { gap: 10px; }
  .reg-search { flex: 1 1 100%; }
  /* фильтры — лента с горизонтальной прокруткой вместо «стены» кнопок */
  .reg-chips {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    width: 100%; padding-bottom: 4px; scrollbar-width: none;
  }
  .reg-chips::-webkit-scrollbar { display: none; }
  .reg-chip { flex: 0 0 auto; min-height: 38px; }
  .reg-card { padding: 12px 12px; }
  .reg-card__ava { width: 38px; height: 38px; border-radius: var(--r-2); }

  /* --- Очередь заданий: две строки вместо четырёх колонок --- */
  .queue-item { grid-template-columns: 4px minmax(0, 1fr); gap: 0 12px; padding-bottom: 12px; }
  .queue-item .body { padding: 12px 12px 4px 0; }
  .queue-item .when { grid-column: 2; padding-bottom: 4px; }
  .queue-item .act { grid-column: 2; padding: 6px 12px 0 0; }
  .queue-item .act .btn { width: 100%; justify-content: center; }

  /* --- Панели инструментов и фильтры --- */
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar .btn, .toolbar .iconbtn, .toolbar .export-bar__btn { flex: 1 1 auto; justify-content: center; }
  .filterbar { gap: 8px; }
  .filterbar .langswitch, .filterbar .langswitch select { max-width: none; width: 100%; }
  .filterbar .searchbox { flex: 1 1 100%; }

  /* --- Тач-цели: ничего мельче 40px по высоте --- */
  .btn, .iconbtn, .reg-chip, .export-bar__btn, .cc-status__refresh { min-height: 40px; }
  .nav-fav { padding: 8px; }
}

/* совсем узкие экраны — сетка остаётся 2 колонки, ужимаем только текст */
@media (max-width: 400px) {
  .stats, .applaunch, .kpi-grid { gap: 10px; }
  .stat .num { font-size: 23px; }
  .kpi-card__num { font-size: 22px; }
  .apptile__icon { width: 42px; height: 42px; }
  .apptile__icon svg { width: 21px; height: 21px; }
  .main { padding: 16px 12px 36px; }
}

/* ======= ИЗМЕНЕНИЕ К ПРОШЛОМУ ГОДУ ======= */
/* Сравниваем период с тем же периодом годом раньше: рост — зелёным,
   падение — красным, прочерк — когда сравнивать не с чем. */
.delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  line-height: 1; white-space: nowrap;
  padding: 3px 7px; border-radius: 999px;
  background: var(--field-soft); color: var(--muted);
}
.delta .ic { width: 12px; height: 12px; flex-shrink: 0; }
.delta--up { background: rgba(34,165,91,.14); color: #16794a; }
.delta--down { background: rgba(214,69,65,.13); color: #b23a36; }
.delta--flat { background: var(--field-soft); color: var(--muted); }
.delta--none { background: transparent; color: var(--faint); font-weight: 400; padding: 3px 4px; }
.delta--compact { padding: 2px 4px; gap: 0; margin-left: 3px; vertical-align: middle; }
.delta--compact .ic { width: 11px; height: 11px; }

[data-theme="dark"] .delta { background: #22302a; color: #9fb0a6; }
[data-theme="dark"] .delta--up { background: rgba(34,165,91,.2); color: #63cf94; }
[data-theme="dark"] .delta--down { background: rgba(214,69,65,.2); color: #ef8b87; }
[data-theme="dark"] .delta--none { background: transparent; }

/* карточка показателя на дашборде института */
.mcard-delta { align-self: flex-end; margin-top: 4px; }
/* строка формы заполнения: четвёртый элемент в ряду, поэтому фиксируем ширину,
   чтобы поля ввода у всех строк оставались на одной вертикали */
.indi-row { gap: 10px; }
.indi-delta { flex-shrink: 0; min-width: 62px; text-align: right; }
@media (max-width: 520px) {
  .indi-delta { min-width: 0; }
}
/* плитка показателя в сводной раздела */
.ind-tile__delta { margin-top: 8px; }

@media (max-width: 860px) {
  .delta { font-size: 10px; padding: 2px 6px; }
}

/* ======= ПОКАЗАТЕЛЬ ПО ВСЕМ ИНСТИТУТАМ ======= */
/* Плитка показателя стала входом внутрь: цифра — не тупик, из неё видно,
   какие именно записи её составили и у какого института. */
a.ind-tile--link { display: block; color: inherit; text-decoration: none; }
.ind-tile__delta { display: flex; align-items: center; justify-content: space-between; }
.ind-tile__go { color: var(--faint); opacity: 0; transition: opacity .12s, transform .12s; }
.ind-tile--link:hover .ind-tile__go { opacity: 1; transform: translateX(2px); }

.sec-hero__of { font-weight: 500; opacity: .75; font-size: 15px; }
.sec-hero__nums b i { font-style: normal; font-size: 12px; font-weight: 500; opacity: .8; }
.sec-hero__delta { margin-top: 12px; }
.sec-hero__delta .delta { background: rgba(255,255,255,.16); color: #fff; }
.sec-hero__delta .delta--up { background: rgba(143,227,180,.24); color: #cdf5e0; }
.sec-hero__delta .delta--down { background: rgba(255,255,255,.2); color: #ffd9d7; }
.sec-hero__delta .delta--none { background: transparent; color: rgba(255,255,255,.7); }

/* институт как папка: закрытая — одна строка с цифрой, открытая — сами записи */
.folder {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-3); margin-bottom: 8px; overflow: hidden;
}
.folder__head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; list-style: none; user-select: none;
}
.folder__head::-webkit-details-marker { display: none; }
.folder__head:hover { background: var(--field-soft); }
.folder__chev { color: var(--faint); display: grid; place-items: center; flex-shrink: 0; }
.folder__chev svg { transition: transform .15s; }
.folder[open] .folder__chev svg { transform: rotate(90deg); }
.folder__ic {
  width: 30px; height: 30px; border-radius: var(--r-2); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--field-soft); color: var(--field);
}
.folder__ic svg { width: 16px; height: 16px; }
.folder__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.folder__n {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--field-soft); color: var(--field); flex-shrink: 0;
}
.folder__delta { flex-shrink: 0; }
.folder__val {
  font-family: var(--mono); font-size: 18px; font-weight: 700;
  color: var(--field); flex-shrink: 0; min-width: 92px; text-align: right;
}
.folder__val i { font-style: normal; font-size: 11px; font-weight: 500; color: var(--faint); }
.folder__val--empty { color: #c7d0ca; font-weight: 400; }
.folder--empty .folder__ic { background: #f2f5f3; color: var(--faint); }
.folder__body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.folder__label {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint); margin: 12px 0 10px;
}

[data-theme="dark"] .folder__head:hover { background: #1a241f; }
[data-theme="dark"] .folder__ic { background: #22302a; color: #4fb883; }
[data-theme="dark"] .folder__n { background: #22302a; color: #4fb883; }
[data-theme="dark"] .folder__val { color: #4fb883; }
[data-theme="dark"] .folder--empty .folder__ic { background: #1a241f; }

@media (max-width: 700px) {
  .folder__head { gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
  .folder__name { flex: 1 1 100%; order: 3; }
  .folder__val { min-width: 0; font-size: 16px; margin-left: auto; }
  .folder__body { padding: 4px 12px 12px; }
}
.folder__more { font-size: 12px; color: var(--faint); margin-top: 10px; }
/* заголовок столбца сводной — тоже вход в разрез показателя */
.th-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--faint); }
.th-link:hover { color: var(--field); border-bottom-color: var(--field); }
[data-theme="dark"] .th-link:hover { color: #4fb883; border-bottom-color: #4fb883; }

/* ======= АНАЛИТИКА: ПЛИТКИ, ТЕПЛОВАЯ КАРТА, ВЫВОДЫ ======= */
.kpi-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.kpi-tile {
  display: flex; align-items: flex-start; gap: 14px; min-width: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-4); padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi-tile__ic {
  width: 42px; height: 42px; border-radius: var(--r-3); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--field-soft); color: var(--field);
}
.kpi-tile__ic .ic { width: 20px; height: 20px; }
.kpi-tile__body { min-width: 0; flex: 1; }
.kpi-tile__lab { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-tile__val {
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  color: var(--ink); line-height: 1.15; margin: 2px 0 8px;
}
.kpi-tile__val i { font-style: normal; font-size: 13px; font-weight: 500; color: var(--faint); }
.kpi-tile__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-tile__src { font-size: 11px; color: var(--faint); }
.kpi-tile--accent { background: linear-gradient(135deg, var(--field) 0%, var(--field-dark) 100%);
  border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.kpi-tile--accent .kpi-tile__ic { background: rgba(255,255,255,.16); color: #fff; }
.kpi-tile--accent .kpi-tile__lab,
.kpi-tile--accent .kpi-tile__val { color: #fff; }
.kpi-tile--accent .kpi-tile__val i { color: rgba(255,255,255,.75); }
.kpi-tile--accent .kpi-tile__src { color: rgba(255,255,255,.8); }
[data-theme="dark"] .kpi-tile__ic { background: #22302a; color: #4fb883; }

/* тепловая карта и выводы стоят рядом, на узком экране — друг под другом */
.heat-wrap {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px; margin-bottom: 26px; align-items: start;
}
.section-head--flat { margin: 0 0 12px; }
.heat-scroll { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; }
.heat th {
  font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--faint); padding: 4px 2px; text-align: center; vertical-align: bottom;
}
.heat th span { display: block; max-width: 78px; margin: 0 auto; line-height: 1.2; }
.heat__org { text-align: left !important; max-width: 190px; }
.heat td.heat__org {
  font-size: 12px; font-weight: 600; padding-right: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.heat td.heat__org a { color: inherit; text-decoration: none; }
.heat td.heat__org a:hover { color: var(--field); text-decoration: underline; }
.heat__c { width: 44px; height: 30px; border-radius: var(--r-1); text-align: center; }
.heat__c a {
  display: grid; place-items: center; height: 100%;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: inherit; text-decoration: none;
}
.heat__c:hover { outline: 2px solid var(--field); outline-offset: -2px; }
.heat td.heat__sum {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--field); text-align: right; padding-left: 8px; white-space: nowrap;
}
/* шкала: чем темнее, тем полнее заполнено */
.hot-4 { background: #1b5e3f; color: #fff; }
.hot-3 { background: #7cc79b; color: #123f2b; }
.hot-2 { background: #f3d9a4; color: #6b4c12; }
.hot-1 { background: #f2c3c1; color: #7d2b28; }
.heat-legend {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 12px; font-size: 11px; color: var(--faint);
}
.heat-legend span { width: 14px; height: 12px; border-radius: 3px; display: inline-block; }
.heat-legend span:not(:first-child) { margin-left: 8px; }

.finds { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.find { display: flex; gap: 12px; align-items: flex-start; }
.find__n {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--field-soft); color: var(--field);
}
.find--ok .find__n { background: rgba(34,165,91,.16); color: #16794a; }
.find--warn .find__n { background: #fbf1e3; color: #b7791f; }
.find--bad .find__n { background: rgba(214,69,65,.14); color: #b23a36; }
.find__b { min-width: 0; }
.find__b b { display: block; font-size: 13px; line-height: 1.35; }
.find__b span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

@media (max-width: 1100px) {
  .heat-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .kpi-tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
  .kpi-tile { padding: 14px; gap: 10px; }
  .kpi-tile__val { font-size: 23px; }
  .kpi-tile__ic { width: 36px; height: 36px; }
}
.kpi-tile__val--empty { color: #c7d0ca; font-weight: 400; }
/* нижняя строка плитки одной высоты со значком дельты — иначе плитка
   без дельты оказывается на пару пикселей ниже соседних */
.kpi-tile__foot { min-height: 22px; }
.kpi-tile__val i { margin-left: 4px; }

/* ======= КОНТРОЛЬ ДАННЫХ ======= */
.q-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
/* индикатор свежести: точка + текст, как «данные обновлены N назад» */
.fresh {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; padding: 7px 14px;
  border-radius: var(--r-pill); background: var(--field-soft); color: var(--muted);
}
.fresh i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.fresh--ok { background: rgba(34,165,91,.14); color: #16794a; }
.fresh--old { background: #fbf1e3; color: #b7791f; }
.fresh--none { background: rgba(214,69,65,.12); color: #b23a36; }

.risk-ic--high { background: rgba(214,69,65,.14) !important; color: #b23a36 !important; }
.risk-ic--mid { background: #fbf1e3 !important; color: #b7791f !important; }
.risk-ic--ok { background: rgba(34,165,91,.16) !important; color: #16794a !important; }

.q-wrap {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.q-table td { vertical-align: middle; }
.q-meter { display: flex; align-items: center; gap: 10px; }
.q-track {
  flex: 1; min-width: 90px; height: 7px; border-radius: 6px;
  background: var(--field-soft); overflow: hidden;
}
.q-fill { display: block; height: 100%; border-radius: 6px; background: #22a55b; }
.q-fill--mid { background: linear-gradient(90deg, #e0a72c, #b7791f); }
.q-fill--high { background: #d64541; }
.q-sub { display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.q-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.q-never { color: #b23a36; font-weight: 600; }
.risk {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill);
}
.risk::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.risk--high { background: rgba(214,69,65,.13); color: #b23a36; }
.risk--mid { background: #fbf1e3; color: #b7791f; }
.risk--ok { background: rgba(34,165,91,.14); color: #16794a; }

.issues { display: flex; flex-direction: column; gap: 8px; }
.issue {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-3);
  color: inherit; text-decoration: none; transition: background .12s, border-color .12s;
}
.issue:hover { background: var(--field-soft); border-color: var(--field); }
.issue__ic {
  width: 32px; height: 32px; border-radius: var(--r-2); flex-shrink: 0;
  display: grid; place-items: center;
}
.issue__ic .ic { width: 16px; height: 16px; }
.issue--bad .issue__ic { background: rgba(214,69,65,.13); color: #b23a36; }
.issue--warn .issue__ic { background: #fbf1e3; color: #b7791f; }
.issue__b { flex: 1; min-width: 0; }
.issue__b b { display: block; font-size: 13px; line-height: 1.3; }
.issue__b span { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.issue__n { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--ink); }
.issue__go { color: var(--faint); flex-shrink: 0; }

[data-theme="dark"] .fresh { background: #22302a; }
[data-theme="dark"] .q-track { background: #22302a; }
[data-theme="dark"] .issue:hover { background: #1a241f; }
[data-theme="dark"] .issue__n { color: #e6efe9; }

@media (max-width: 1100px) { .q-wrap { grid-template-columns: minmax(0, 1fr); } }
/* главная кнопка в панели действий — выделена, как в макете справа сверху */
.export-bar__btn--primary {
  background: var(--field); border-color: var(--field); color: #fff;
  margin-left: auto;
}
.export-bar__btn--primary:hover { background: var(--field-dark); border-color: var(--field-dark); color: #fff; }
[data-theme="dark"] .export-bar__btn--primary:hover { background: #16794a; color: #fff; }
@media (max-width: 700px) { .export-bar__btn--primary { margin-left: 0; } }
/* плитки в ряду тянутся до общей высоты, подпись — в одну строку */
.kpi-tiles { align-items: stretch; }
.kpi-tile__src { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
