/* Admin styles (stage 3) — vanilla, no CDN. */
* { box-sizing: border-box; }
body {
  margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f6f7f9; color: #1c2733;
}
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px; background: #14212e; color: #fff;
}
.brand { font-weight: 600; letter-spacing: .2px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav button {
  background: #24384d; color: #e7eef5; border: 0; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}
.nav button.active, .nav button:hover { background: #3b5a78; }
.nav button.ghost { background: transparent; border: 1px solid #3b5a78; }
.view { max-width: 1100px; margin: 20px auto; padding: 0 16px 60px; }
.card {
  background: #fff; border: 1px solid #dfe5ec; border-radius: 10px;
  padding: 16px 18px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: #5b6b7b; }
input, select, textarea {
  font: inherit; padding: 7px 9px; border: 1px solid #c9d2dc;
  border-radius: 6px; background: #fff; min-width: 0;
}
button.primary {
  background: #2464b0; color: #fff; border: 0; border-radius: 6px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
}
button.primary:hover { background: #1d5493; }
button.small { padding: 4px 9px; font-size: 12px; cursor: pointer; }
button.danger { background: #b02a24; color: #fff; border: 0; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #e7ecf2; }
th { font-size: 12px; color: #5b6b7b; font-weight: 600; }
tr:hover td { background: #f2f6fb; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 12px; background: #e3eaf1; color: #33475b;
}
.badge.ok { background: #ddf3e4; color: #176b38; }
.badge.err { background: #f8dfdd; color: #99271f; }
.badge.warn { background: #f6ecd9; color: #8a6416; }
.toast {
  position: fixed; bottom: 18px; right: 18px; background: #14212e; color: #fff;
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  max-width: 420px;
}
.muted { color: #5b6b7b; font-size: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.kv .num { font-size: 22px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
pre.data {
  background: #f2f4f7; border: 1px solid #e0e6ec; padding: 10px;
  border-radius: 6px; font-size: 12px; overflow: auto; max-height: 340px;
}

/* --- weights (/admin/weights) ------------------------------------------- */
.weight-block {
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  color: #5b6b7b; margin: 16px 0 6px;
}
.weight-list { display: flex; flex-direction: column; gap: 8px; }
.weight-param {
  display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 14px;
  align-items: start; padding: 9px 10px; border: 1px solid #e7ecf2;
  border-radius: 8px; background: #fbfcfe;
}
.wp-title { font-weight: 600; }
.wp-key { font-weight: 400; margin-left: 6px; }
.wp-desc { color: #5b6b7b; font-size: 12px; margin-top: 3px; }
.wp-value input { width: 100%; }
.weight-param input:disabled { background: #f1f3f6; color: #5b6b7b; }
.weight-sum {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
}
.weight-sum.ok { background: #ddf3e4; color: #176b38; }
.weight-sum.err { background: #f8dfdd; color: #99271f; }
.weight-job {
  margin-top: 14px; padding: 12px; border: 1px solid #dfe5ec;
  border-radius: 8px; background: #fbfcfe;
}
.weight-summary { margin-top: 8px; font-size: 13px; }
.progress-track {
  height: 9px; border-radius: 6px; background: #e3eaf1;
  overflow: hidden; margin: 10px 0 6px;
}
.progress-bar {
  height: 100%; background: #2464b0; border-radius: 6px;
  transition: width .25s ease;
}
@media (max-width: 720px) {
  .weight-param { grid-template-columns: 1fr; }
  .wp-value { max-width: 220px; }
}

/* --- score editor (карточка/модерация) ---------------------------------- */
.score-editor {
  margin: 14px 0 6px; padding: 12px 14px; border: 1px solid #dfe5ec;
  border-radius: 10px; background: #fbfcfe;
}
.score-editor h3 { margin: 0; font-size: 15px; }
.score-head { align-items: center; margin-bottom: 2px; }
.score-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-top: 10px;
}
.score-field { display: flex; flex-direction: column; gap: 4px; }
.score-field span { font-size: 12px; color: #5b6b7b; }
.score-field input, .score-field select { width: 100%; }
.score-field input:disabled, .score-field select:disabled {
  background: #f1f3f6; color: #5b6b7b;
}
.score-sum {
  margin-top: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px;
}
.score-sum.ok { background: #ddf3e4; color: #176b38; }
.score-sum.err { background: #f8dfdd; color: #99271f; }
.score-error { color: #99271f; font-size: 13px; min-height: 1.2em; margin-top: 6px; }
.ce-section-title { margin: 18px 0 8px; font-size: 14px; }
/* «Ждут одобрения»: карточка-ссылка в таблице */
.approvals-table a { color: #1d5493; text-decoration: none; }
.approvals-table a:hover { text-decoration: underline; }

/* --- очередь модерации --------------------------------------------------- */
.queue-counters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.queue-counter {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 118px; padding: 8px 12px; border: 1px solid #dfe5ec;
  border-radius: 9px; background: #fbfcfe; cursor: pointer; text-align: left;
  color: #1c2733;
}
.queue-counter:hover { border-color: #9fb6cd; }
.queue-counter.active { border-color: #2464b0; box-shadow: 0 0 0 2px #dbe8f7; }
.queue-counter b { font-size: 20px; line-height: 1.1; }
.queue-counter span { font-size: 12px; color: #5b6b7b; }
.queue-reason {
  max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge.kind-new { background: #ddf3e4; color: #176b38; }
.badge.kind-identity { background: #f6ecd9; color: #8a6416; }
.badge.kind-negative { background: #f8dfdd; color: #99271f; }
.badge.kind-update { background: #e0e9fb; color: #1d4f9a; }
.banner {
  margin: 10px 0 14px; padding: 12px 14px; border-radius: 9px;
  border: 1px solid #dfe5ec; font-size: 13px;
}
.banner-draft { background: #fff7e0; border-color: #ecd9a4; color: #6b4d0a; }
.banner-update { background: #eef4fd; border-color: #b9cfee; color: #173f75; }
.banner .diff-table { margin-top: 8px; background: #fff; border-radius: 6px; }
.moderation-detail h3 { margin: 16px 0 6px; font-size: 14px; }

