:root {
  --green: #1f9d55;
  --green-bg: #e9f8ef;
  --yellow: #b7791f;
  --yellow-bg: #fff8e1;
  --red: #c53030;
  --red-bg: #fdecec;
  --blue: #2563eb;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #eef3ff 0%, var(--bg) 100%);
  color: var(--text);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  background: linear-gradient(135deg, #153e75, #2563eb);
  color: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  letter-spacing: 0.3px;
}

.hero p {
  margin: 0;
  line-height: 1.5;
  opacity: 0.95;
  max-width: 920px;
}

.layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(229, 231, 235, 0.8);
}

.form-card {
  padding: 24px;
}

.section-title {
  margin: 0 0 18px;
  font-size: 1.25rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fbfcfe;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.field small {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.35;
}

input, select {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
  background: #fff;
}

input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
}

.risk-green { background: var(--green-bg); color: var(--green); }
.risk-yellow { background: var(--yellow-bg); color: var(--yellow); }
.risk-red { background: var(--red-bg); color: var(--red); }
.risk-neutral { background: #eef2f7; color: #4b5563; }

.actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover { transform: translateY(-1px); }
button.primary { background: var(--blue); color: #fff; }
button.secondary { background: #eef2ff; color: #1e40af; }
button.danger { background: #fff1f2; color: #be123c; }

.side-card {
  padding: 22px;
  position: sticky;
  top: 20px;
}

.score-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.mini-box {
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
  background: #fafafa;
}

.mini-box strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.result-panel {
  border-radius: 18px;
  padding: 18px;
  margin-top: 14px;
  border: 1px solid transparent;
}

.result-title {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.result-text {
  margin: 0;
  line-height: 1.5;
}

.legend {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fafafa;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 3px;
  flex: 0 0 14px;
}

.history {
  margin-top: 24px;
}

.history table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.94rem;
}

.history th, .history td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.history small { color: var(--muted); }

.history .row-action {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.disclaimer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.footer-note {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .grid { grid-template-columns: 1fr; }
}
