:root {
  --bg: #f4f8ff;
  --card: rgba(255, 255, 255, 0.82);
  --line: #d8e2f2;
  --line-strong: #c8d8f1;
  --text: #122038;
  --muted: #5f7493;
  --brand: #2f6df6;
  --brand-deep: #2049c8;
  --brand-soft: #e8efff;
  --brand-glow: rgba(47, 109, 246, 0.2);
  --good: #149c66;
  --bad: #e24b63;
  --shadow: 0 12px 40px rgba(18, 32, 56, 0.08);
  --shadow-soft: 0 6px 20px rgba(18, 32, 56, 0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 560px at 92% -10%, rgba(47, 109, 246, 0.16), transparent 65%),
    radial-gradient(900px 480px at -8% 18%, rgba(85, 170, 255, 0.16), transparent 62%),
    linear-gradient(155deg, #fbfdff 0%, #f1f6ff 42%, #eef4ff 100%);
  min-height: 100vh;
}

.page {
  width: min(1320px, 94%);
  margin: 26px auto 44px;
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 250, 255, 0.82) 100%);
  border: 1px solid rgba(206, 220, 243, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
}
.hero::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 109, 246, 0.24) 0%, rgba(47, 109, 246, 0) 70%);
}
.hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  left: -55px;
  bottom: -95px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 205, 255, 0.22) 0%, rgba(95, 205, 255, 0) 70%);
}

h1 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
}
h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.sub, .hint { color: var(--muted); margin: 0; }
.tag {
  margin: 0;
  width: fit-content;
  font-weight: 700;
  color: #1744b3;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(120deg, #edf2ff, #dbe8ff);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #cbdcff;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  position: relative;
  z-index: 2;
}
.stat-card {
  background: linear-gradient(160deg, #f7fbff 0%, #edf4ff 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 15px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.stat-card span {
  font-size: 30px;
  font-weight: 800;
  color: #173777;
}
.stat-card small { color: var(--muted); margin-top: 4px; text-align: center; }

.grid {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(207, 221, 242, 0.95);
  backdrop-filter: blur(7px);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card:nth-child(1),
.card:nth-child(2),
.card:nth-child(4) {
  grid-column: span 2;
}

.form-grid, .calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #355072;
}
input, textarea {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(18, 32, 56, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
input:focus, textarea:focus, button:focus {
  outline: 2px solid rgba(47, 109, 246, 0.2);
  border-color: var(--brand);
  box-shadow: 0 0 0 5px rgba(47, 109, 246, 0.13);
}
.full { margin-top: 10px; display: block; }

.audit-table {
  margin-top: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
}
.audit-row {
  display: grid;
  grid-template-columns: 2fr 90px 90px 2fr;
  border-bottom: 1px solid #e5ecf8;
}
.audit-row:last-child { border-bottom: none; }
.audit-row span { padding: 10px; display: flex; align-items: center; }
.audit-row.header {
  background: linear-gradient(180deg, #eff5ff, #e9f1ff);
  font-weight: 600;
  color: #244067;
}
.audit-row.data:nth-child(even) { background: rgba(248, 251, 255, 0.8); }
.audit-row input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: var(--brand-deep);
  cursor: pointer;
}
.name-input, .note-input { width: 100%; }

.calc-results {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.calc-results > div {
  background: linear-gradient(165deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  box-shadow: inset 0 1px 0 #fff;
}
.calc-results strong {
  display: block;
  font-size: 22px;
  color: #153f95;
  letter-spacing: -0.02em;
}
.calc-results span { color: var(--muted); font-size: 13px; }

.matrix {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 10px;
}
.matrix-col {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f3f8ff);
  padding: 10px;
  box-shadow: inset 0 1px 0 #fff;
}
.matrix-col h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #1f3d70;
}
.state-btn {
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  border: 1px solid #d5e2f8;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease, box-shadow 0.2s ease;
}
.state-btn:hover {
  transform: translateY(-1px);
  border-color: #b8cff8;
  box-shadow: 0 6px 18px rgba(33, 78, 168, 0.1);
}
.state-btn.active {
  border-color: var(--brand);
  background: linear-gradient(140deg, #edf3ff 0%, #dbe8ff 100%);
  color: #123c9a;
  font-weight: 600;
  box-shadow: 0 8px 18px var(--brand-glow);
}

.plan-items { display: grid; gap: 10px; margin-bottom: 10px; }
.plan-row {
  display: grid;
  grid-template-columns: 32px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.btn {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(28, 62, 131, 0.12);
}
.btn.primary {
  background: linear-gradient(135deg, #3f7bff 0%, #2c63e8 48%, #2557d4 100%);
  border-color: #2b61df;
  color: #fff;
  box-shadow: 0 10px 20px rgba(39, 86, 196, 0.3);
}
.btn.primary:hover { box-shadow: 0 14px 24px rgba(39, 86, 196, 0.35); }
.btn.ghost { background: linear-gradient(180deg, #f8fbff, #edf3ff); }
.btn.tiny { padding: 6px 10px; }
.btn.danger { color: #fff; background: var(--bad); border-color: var(--bad); }
.actions { display: flex; gap: 10px; }

.recent-list { display: grid; gap: 8px; }
.recent-list article {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.recent-actions { display: inline-flex; gap: 6px; }
.error { color: var(--bad); }

@media (max-width: 1080px) {
  .grid { grid-template-columns: 1fr; }
  .card:nth-child(1), .card:nth-child(2), .card:nth-child(4) { grid-column: span 1; }
  .hero { flex-direction: column; }
  .hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .form-grid, .calc-grid { grid-template-columns: 1fr 1fr; }
  .calc-results { grid-template-columns: repeat(3, 1fr); }
  .matrix { grid-template-columns: repeat(2, 1fr); }
}

/* Report */
.report-page {
  width: min(980px, 94%);
  margin: 24px auto 40px;
}
.report-sheet {
  background: #fff;
  border: 1px solid #d8e2f2;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.report-header {
  padding: 28px;
  background: linear-gradient(135deg, #eff4ff 0%, #e4eeff 100%);
  border-bottom: 1px solid #d3e0f5;
}
.report-title {
  margin: 8px 0 0;
  font-size: 34px;
  letter-spacing: -0.02em;
}
.report-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.report-meta .meta-card {
  background: #fff;
  border: 1px solid #d3e0f5;
  border-radius: 12px;
  padding: 10px;
}
.report-meta small { color: #62799b; display: block; }
.report-meta strong { font-size: 20px; color: #183a80; }
.report-body { padding: 20px 26px 28px; }
.report-section { margin-top: 18px; }
.report-section h3 {
  margin: 0 0 10px;
  font-size: 20px;
}
.report-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.report-block {
  border: 1px solid #d9e4f5;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}
.report-checklist {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.report-checklist th, .report-checklist td {
  border: 1px solid #d9e4f5;
  padding: 8px;
  vertical-align: top;
}
.status-good { color: #0f935f; font-weight: 700; }
.status-bad { color: #d43655; font-weight: 700; }
.status-neutral { color: #5d7598; font-weight: 600; }
.report-list {
  margin: 0;
  padding-left: 18px;
}
.report-actions {
  width: min(980px, 94%);
  margin: 0 auto 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media print {
  body { background: #fff; }
  .report-actions { display: none; }
  .report-page { width: 100%; margin: 0; }
  .report-sheet {
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
  .form-grid, .calc-grid, .calc-results, .matrix {
    grid-template-columns: 1fr;
  }
  .audit-row {
    grid-template-columns: 1.5fr 70px 70px 1.5fr;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
}
