:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --surface2:#f2f4fb;
  --text:#111827;
  --muted:#6b7280;
  --accent:#4f46e5;
  --danger:#dc2626;
  --border:rgba(17,24,39,.12);
  --shadow:0 14px 40px rgba(17,24,39,.10);
  --radius:18px;
}

*{box-sizing:border-box}
html, body { height: 100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: transparent;
  color:var(--text);
  min-height: 100vh;
  position: relative;
}

/* ✅ единый фон без разрывов/полос */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(79,70,229,.12), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(22,163,74,.10), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  background-size: cover;
}

header{
  background: rgba(246,247,251,.92);
  border-bottom: 1px solid var(--border);
}

.wrap{max-width:1100px; margin:0 auto; padding:18px 16px;}

.topbar{
  display:flex; gap:14px; flex-wrap:wrap; align-items:flex-start; justify-content:space-between;
}
.left, .right{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.left{flex:1 1 auto}

.btn{
  border:1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding:10px 14px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:800;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  user-select:none;
  box-shadow: 0 6px 18px rgba(17,24,39,.06);
  white-space:nowrap;
}
.btn:hover{background: var(--surface2)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(79,70,229,.96), rgba(79,70,229,.74));
  border-color: rgba(79,70,229,.55);
  color:#fff;
  box-shadow: 0 14px 30px rgba(79,70,229,.18);
}
.btn.danger{
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.35);
  color: #991b1b;
  box-shadow:none;
}
.btn:disabled{
  opacity:.55; cursor:not-allowed;
  transform:none !important;
  box-shadow:none;
}
.btnLink{
  border:1px solid rgba(79,70,229,.30);
  background: rgba(79,70,229,.08);
  color: #1f1a6a;
  font-weight: 1000;
}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight:800;
  white-space:nowrap;
}
.pill b{color:var(--text)}

.desc{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  color:var(--muted);
  line-height:1.35;
}
.desc .task{
  flex: 1 1 640px;
  padding:12px 14px;
  border:1px dashed rgba(17,24,39,.20);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}

main .grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:16px;
  align-items:start;
  margin-top:18px;
}
@media (max-width: 920px){
  main .grid{grid-template-columns:1fr}
}

.card{
  background: rgba(255,255,255,.92);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.card .hd h2{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
}
.card .bd{padding:16px}

label{
  display:block;
  color: var(--muted);
  font-weight:900;
  margin:12px 0 8px;
  font-size:13px;
}

select{
  width:100%;
  padding:12px 12px;
  border-radius: 12px;
  border:1px solid rgba(17,24,39,.14);
  background: #fff;
  color: #111;
  outline:none;
}
select option{ background:#fff; color:#111; }

.hint{
  margin-top:8px;
  color: rgba(17,24,39,.70);
  font-size: 12.5px;
}

.actions{
  display:flex; gap:10px; flex-wrap:wrap; margin-top:14px;
}

.resultBox{
  border-radius: 14px;
  border:1px solid rgba(17,24,39,.12);
  background: rgba(79,70,229,.04);
  padding:14px;
  min-height: 220px;
}
.resultTitle{font-weight:900; margin:0 0 6px}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
.ok{color:#0f7a34}
.muted{color:var(--muted)}

footer{
  margin-top:18px;
  border-top:1px solid var(--border);
  background: rgba(255,255,255,.92);
}
.footerWrap{
  display:flex; gap:12px; flex-wrap:wrap;
  align-items:center; justify-content:space-between;
  color: var(--muted);
}
.footerLinks{display:flex; gap:14px; flex-wrap:wrap; align-items:center;}
footer a{color: var(--accent); text-decoration:none; font-weight:900}
footer a:hover{text-decoration:underline}

/* ---------- MODALS ---------- */
.modalBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 50;
}
.modal{
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(17,24,39,.14);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(17,24,39,.25);
  overflow: hidden;
  display:flex;
  flex-direction:column;
}
.modalHd{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(17,24,39,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  background: rgba(79,70,229,.05);
  flex:0 0 auto;
}
.modalHd h3{
  margin:0;
  font-size:16px;
  font-weight: 900;
}
.modalBd{
  padding: 14px;
  line-height: 1.45;
  color: rgba(17,24,39,.88);
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}
.modalActions{
  padding: 12px 14px;
  border-top: 1px solid rgba(17,24,39,.10);
  display:flex;
  justify-content:flex-end;
  background: rgba(17,24,39,.02);
  flex:0 0 auto;
  gap:10px;
  flex-wrap:wrap;
}

.kpiRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 8px 0 12px;
}
.kpi{
  flex: 1 1 220px;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(17,24,39,.02);
  border-radius: 14px;
  padding: 12px;
}
.kpi .big{
  font-size: 20px;
  font-weight: 1000;
  margin: 0;
}
.kpi .sub{
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 12.5px;
}

.sectionTitle{
  margin: 14px 0 8px;
  font-weight: 1000;
  font-size: 13px;
  color: rgba(17,24,39,.78);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tableScroll{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.spacer12{height:12px;}

.matrix{
  width: 100%;
  border-collapse: collapse;
  border:1px solid rgba(17,24,39,.10);
  border-radius: 14px;
  overflow:hidden;
  background:#fff;
}
.matrix th, .matrix td{
  border-bottom:1px solid rgba(17,24,39,.08);
  border-right:1px solid rgba(17,24,39,.08);
  padding: 10px 8px;
  text-align:center;
  font-weight:800;
  font-size: 12.5px;
  vertical-align: middle;
}
.matrix th{
  background: rgba(79,70,229,.06);
  font-weight: 1000;
  white-space:nowrap;
}
.matrix td:first-child, .matrix th:first-child{
  text-align:left;
  padding-left:10px;
  white-space:nowrap;
}
.matrix tr:last-child td{border-bottom:none}
.matrix td:last-child, .matrix th:last-child{border-right:none}

.cell{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(17,24,39,.10);
  font-weight: 1000;
}
.cell.ok{
  background: rgba(22,163,74,.10);
  border-color: rgba(22,163,74,.25);
  color: #0f7a34;
}
.cell.miss{
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.25);
  color: #991b1b;
}
.cell.na{
  background: rgba(107,114,128,.12);
  border-color: rgba(107,114,128,.20);
  color: rgba(17,24,39,.55);
  font-weight: 900;
}

.missingList{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px){
  .missingList{grid-template-columns:1fr}
}
.missingCard{
  border:1px solid rgba(17,24,39,.10);
  background: rgba(17,24,39,.02);
  border-radius: 14px;
  padding: 12px;
}
.missingCard .t{
  font-weight: 1000;
  margin:0 0 8px;
}
.chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(17,24,39,.10);
  background: #fff;
  font-weight: 900;
  font-size: 12.5px;
  margin: 4px 6px 0 0;
  white-space:nowrap;
}

/* мобилка */
@media (max-width: 480px){
  .btn, .pill{width: 100%; justify-content:center}
  .left, .right{width:100%}
  .right{justify-content:stretch}
}
