:root {
  --bg: #0f1720;
  --panel: #ffffff;
  --ink: #1b2733;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1f6feb;
  --brand-d: #1858c4;
  --accent: #0ea5a4;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --soft: #f1f5f9;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef3f9 0%, #e6edf5 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; }
.wrap-wide { max-width: 1240px; }

/* ---------- Шапка ---------- */
.topbar {
  background: linear-gradient(120deg, #14294a, #1f6feb);
  color: #fff;
}
.topbar .inner {
  max-width: 1240px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 18px;
}
.topbar a { color: #dbe9ff; }
.topbar .nav { display: flex; gap: 18px; font-size: 14px; }

/* ---------- Карточки на главной ---------- */
.hero { text-align: center; margin: 36px 0 28px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 16px; margin: 0; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(15,23,42,.12); }
.card .tag {
  align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand); background: #e8f1ff;
  padding: 5px 10px; border-radius: 999px;
}
.card h2 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.card .meta { font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
  text-decoration: none; transition: background .15s ease;
}
.btn:hover { background: var(--brand-d); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: #f2f7ff; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--bad); }
.btn.gray { background: #64748b; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Панель / формы ---------- */
.panel {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 26px; margin-bottom: 22px;
}
.panel h1 { margin: 0 0 6px; font-size: 24px; }
.panel .sub { color: var(--muted); margin: 0 0 4px; font-size: 15px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=date], input[type=password], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #bcd4ff; border-color: var(--brand); }
textarea { resize: vertical; min-height: 78px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px){ .grid2 { grid-template-columns: 1fr; } }

/* ---------- Критерии в опросе ---------- */
.criterion {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
  background: #fcfdff;
}
.criterion .head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.criterion .num {
  min-width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.criterion .ctext { font-weight: 600; font-size: 15px; }

.callout {
  background: #eff6ff; border: 1px solid #cfe0ff; color: #1e40af; border-radius: 10px;
  padding: 12px 14px; font-size: 13px; margin-bottom: 18px;
}

.sticky-actions {
  position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 40%);
  padding: 18px 0 6px; display: flex; gap: 12px; align-items: center;
}

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px;
  background: #111827; color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: var(--shadow); font-size: 14px; z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ---------- Успешная отправка ---------- */
.success-box { text-align: center; padding: 40px 20px; }
.success-box .check {
  width: 72px; height: 72px; border-radius: 50%; background: #dcfce7; color: var(--ok);
  display: grid; place-items: center; font-size: 38px; margin: 0 auto 18px;
}

/* ---------- Админка ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.chip {
  border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.list tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.new { background: #fee2e2; color: #b91c1c; }
.badge.in_progress { background: #fef3c7; color: #92400e; }
.badge.done { background: #dcfce7; color: #15803d; }

.pill { display:inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.pill.strong { background:#dcfce7; color:#15803d; }
.pill.ok { background:#dbeafe; color:#1e40af; }
.pill.weak { background:#fef3c7; color:#92400e; }
.pill.critical { background:#fee2e2; color:#b91c1c; }

/* scoring row */
.score-row { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: #fff; }
.score-row .ctext { font-weight: 600; margin-bottom: 6px; }
.answer {
  background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: 14px;
  white-space: pre-wrap; margin-bottom: 12px; color: #334155; min-height: 20px;
}
.answer.empty { color: #94a3b8; font-style: italic; }
.score-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.score-opt {
  cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px;
  font-weight: 600; font-size: 14px; background: #fff; user-select: none;
}
.score-opt input { display: none; }
.score-opt.s1.checked { background: #dcfce7; border-color: var(--ok); color: var(--ok); }
.score-opt.s05.checked { background: #fef3c7; border-color: var(--warn); color: var(--warn); }
.score-opt.s0.checked { background: #fee2e2; border-color: var(--bad); color: var(--bad); }

/* report */
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
@media (max-width: 820px){ .report-grid { grid-template-columns: repeat(2,1fr); } }
.stat { background: var(--soft); border-radius: 12px; padding: 16px; text-align: center; }
.stat .v { font-size: 26px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: grid; place-items: center; z-index: 60; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; width: 100%; max-width: 420px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 16px; }
.row-between { display:flex; justify-content: space-between; align-items:center; gap: 12px; flex-wrap: wrap; }

@media print {
  .topbar, .no-print, .btn, .sticky-actions { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
}
