:root {
  --teal: #005c63;
  --teal-dark: #073f43;
  --gold: #c6aa65;
  --ink: #253033;
  --muted: #667075;
  --line: #d8dee4;
  --soft: #f5f7f6;
  --white: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: var(--teal-dark);
  color: var(--white);
  padding: 24px 18px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.brand img {
  width: 136px;
  height: 52px;
  object-fit: contain;
  background: transparent;
  border-radius: 6px;
  padding: 0;
}
.brand strong { display: none; }
.brand span { display: none; }
nav { display: grid; gap: 8px; margin-top: 22px; }
nav a {
  color: white;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,.07);
}
nav a:hover { background: rgba(198,170,101,.22); }

.content { padding: 28px; max-width: 1280px; width: 100%; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.page-head p, .panel-head p {
  margin: 0 0 4px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}
h1 { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: 0; }

.band, .form-card, .login-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.grid { display: grid; gap: 18px; margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.card span { color: var(--teal); font-weight: 700; font-size: 13px; }
.card p { color: var(--muted); line-height: 1.45; }

.selector, .form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
}
textarea { resize: vertical; min-height: 120px; }
button, .button {
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: white;
  padding: 11px 16px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}
button:hover, .button:hover { background: #004d53; }
.button.secondary { background: white; color: var(--teal); border: 1px solid var(--line); }
.button.danger, button.danger { background: #982121; color: white; }
.button.danger:hover, button.danger:hover { background: #7d1b1b; }
.actions { display: flex; gap: 10px; }
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-line h2 { margin: 0; }
.danger-zone {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  align-items: end;
}
.suggestion {
  margin-top: 18px;
  border-left: 4px solid var(--gold);
  padding: 14px 16px;
  background: #fcfaf4;
  border-radius: 4px;
}
.suggestion p { margin: 6px 0 12px; color: var(--muted); }

.section-title {
  margin: 24px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}
.question {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 16px 16px;
  margin: 0 0 16px;
  min-width: 0;
}
.question::after {
  content: "";
  display: block;
  clear: both;
}
.question.is-skipped {
  display: none;
}
.question legend {
  display: block;
  float: left;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
}
.question legend + .scale,
.question legend + label {
  clear: both;
}
.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 8px;
  margin-top: 0;
  clear: both;
}
.scale label, .yesno label {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1.25;
  min-height: 56px;
  text-align: center;
}
.yesno { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.yesno legend { width: 100%; }
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(245,247,246,.94);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}
.survey-progress {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(247,250,249,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}
.form-warning {
  margin-bottom: 14px;
}
.survey-progress span {
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 13px;
}
.survey-progress div {
  height: 9px;
  background: #e4ecea;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.survey-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
  transition: width .2s ease;
}
.stack { display: grid; gap: 10px; }
.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 14px;
  display: grid;
  gap: 4px;
}
.mini-card span { color: var(--teal); font-weight: 700; }
.mini-card small { color: var(--muted); }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 10px; text-align: left; vertical-align: top; }
th { background: var(--teal); color: white; font-size: 13px; }
td { font-size: 14px; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  font-weight: 700;
  font-size: 12px;
}
.level-none, .level-low { background: #e7f4ed; color: #14613c; }
.level-medium { background: #fff4d6; color: #7a5800; }
.level-high { background: #ffe5d6; color: #9a3a00; }
.level-very-high { background: #ffe0e0; color: #982121; }

.result-hero {
  display: grid;
  grid-template-columns: 180px 180px 1fr;
  gap: 18px;
  align-items: center;
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 20px;
}
.result-hero div { background: rgba(255,255,255,.72); border-radius: 8px; padding: 14px; }
.result-hero span { display: block; color: var(--muted); font-size: 13px; }
.result-hero strong { font-size: 30px; }
.result-hero p { margin: 0; line-height: 1.45; }
.detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; }
.detail-grid span { color: var(--muted); }
.metric { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px 0; }
.flash-wrap { margin-bottom: 18px; }
.flash { padding: 12px 14px; border-radius: 6px; margin-bottom: 8px; background: white; border: 1px solid var(--line); }
.flash.error { border-color: #d97777; color: #982121; }
.flash.success { border-color: #77b28b; color: #14613c; }
.login-panel { max-width: 430px; margin: 8vh auto 0; }
.login-panel .form-card { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.highlight { border-color: var(--gold); background: #fffdf7; }
.inline-form { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.page-head.compact { margin-top: 14px; }
.public-body {
  display: block;
  background: linear-gradient(180deg, #f7faf9 0%, #eef4f2 100%);
}
.public-content {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--teal-dark);
}
.public-brand img {
  width: 180px;
  height: 58px;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0;
}
.public-brand strong { display: none; }
.public-brand span { display: none; }

@media (max-width: 920px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; position: static; }
  nav { grid-template-columns: repeat(3, 1fr); }
  .grid.two, .grid.three, .selector, .form-grid, .scale, .result-hero { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .section-line { align-items: flex-start; flex-direction: column; }
}
