:root {
  --green: #06713a;
  --green-dark: #04562d;
  --green-soft: #eaf7ef;
  --blue: #0b65c2;
  --amber: #b86b00;
  --red: #c33434;
  --text: #16233a;
  --muted: #6d7a8a;
  --line: #dfe6ee;
  --bg: #f4f7fa;
  --card: #ffffff;
  --shadow: 0 10px 28px rgba(16, 35, 58, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.topbar {
  height: 74px;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  color: white;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 270px;
}

.logo {
  width: 58px;
  height: 38px;
  background: white;
  color: var(--green);
  border-radius: 8px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.brand strong { display: block; font-size: 18px; }
.brand span { display: block; font-size: 12px; letter-spacing: 3px; font-weight: 700; opacity: .9; }

.mainnav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 10px;
  flex: 1;
}

.mainnav a {
  color: rgba(255,255,255,.86);
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-weight: 800;
  border-bottom: 4px solid transparent;
}

.mainnav a:hover,
.mainnav a.active {
  color: white;
  background: rgba(0,0,0,.12);
  border-bottom-color: white;
}

.userbar {
  display: flex;
  gap: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.userbar a { color: white; }

.app {
  width: min(1720px, calc(100% - 40px));
  margin: 22px auto;
}

.page {
  display: none;
  animation: fade .18s ease-in;
}

.page:target { display: block; }
.page:first-of-type { display: block; }
body:has(.page:target) .page:first-of-type { display: none; }

@keyframes fade { from { opacity: .6; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 0 0 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
}

.page-head p,
.card-title p {
  color: var(--muted);
  margin: 6px 0 0;
}

.card, .stat, .check-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.card h3 {
  margin: 20px 0 12px;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
}

.toolbar.compact { max-width: 720px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.wide { flex: 1; }

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd7e3;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: white;
  font-size: 15px;
}

textarea {
  padding: 14px;
  min-height: 160px;
  resize: vertical;
}

.btn {
  border: none;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:hover { background: var(--green-dark); }

.btn.secondary {
  background: white;
  border: 1px solid #cbd7e3;
  color: var(--text);
}

.btn.dark { background: #2f3b4c; }

.btn.danger-outline {
  background: white;
  border: 1px solid var(--red);
  color: var(--red);
}

.btn.block {
  width: 100%;
  margin-top: 10px;
}

.stats-grid,
.check-cards {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.stats-grid.four { grid-template-columns: repeat(4, 1fr); }
.check-cards { grid-template-columns: repeat(6, 1fr); }

.stat {
  padding: 20px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 12px;
  align-items: center;
}

.stat .icon { grid-row: span 2; font-size: 26px; }
.stat b { font-size: 20px; }
.stat small { color: var(--muted); }

.stat.danger b { color: var(--red); }

.split-layout {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 20px;
  align-items: start;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  align-items: start;
}

.grid-three {
  display: grid;
  grid-template-columns: 1fr 1fr 320px;
  gap: 18px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.actions { display: flex; gap: 10px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
}

tr.selected {
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green);
}

.warning-row { background: #fff8ee; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.pill.success { color: #08743c; background: #dff6e8; }
.pill.warning { color: var(--amber); background: #fff0d8; }
.pill.danger { color: var(--red); background: #ffe5e5; }
.pill.blue { color: var(--blue); background: #e4f0ff; }

.pagination {
  padding-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.pagination span { margin-right: auto; }

.pagination button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  min-width: 38px;
  height: 36px;
}

.profile-panel { position: sticky; top: 94px; }

.close {
  float: right;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 24px;
}

.profile-top {
  display: flex;
  gap: 18px;
  align-items: center;
}

.avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dff6e8, #0a7a42);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  flex: 0 0 auto;
}

.avatar.large { width: 96px; height: 96px; }

.profile-top h2 { margin: 0 0 6px; }
.profile-top p { margin: 5px 0; color: var(--muted); }

.action-row {
  display: flex;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 800;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 14px;
}

.info-grid span { color: var(--muted); }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mini-stats div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.mini-stats b { display: block; font-size: 18px; }
.mini-stats small { color: var(--muted); }

.member-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.check-list {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.check-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.dot.green { background: var(--green); }
.dot.amber { background: orange; }
.dot.grey { background: #9aa4b1; }

.check-card {
  padding: 20px;
  min-height: 150px;
}

.check-card h3 { margin: 0 0 16px; font-size: 15px; }
.check-card b { display: block; font-size: 24px; margin-bottom: 10px; }
.check-card p { color: var(--muted); margin: 0 0 16px; }
.check-card a { color: var(--green); font-weight: 900; text-decoration: none; }

.check-card.good { background: linear-gradient(180deg, #ffffff, #f0fbf4); }
.check-card.blue { background: linear-gradient(180deg, #ffffff, #eef6ff); }
.check-card.amber { background: linear-gradient(180deg, #ffffff, #fff6e9); }
.check-card.good b { color: var(--green); }
.check-card.blue b { color: var(--blue); }
.check-card.amber b { color: var(--amber); }

.timeline {
  display: grid;
  gap: 14px;
}

.timeline div {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.timeline b { color: var(--muted); }
.timeline em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.result-card dl,
.subcard dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; }

.back {
  color: var(--green);
  text-decoration: none;
  font-weight: 900;
}

.check-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin: 18px -24px 22px;
  padding: 0 24px;
}

.tabs a {
  padding: 14px 18px;
  font-weight: 900;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}

.tabs a.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.subcard {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: white;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 40px;
}

@media (max-width: 1200px) {
  .split-layout, .grid-two, .grid-three { grid-template-columns: 1fr; }
  .check-cards { grid-template-columns: repeat(2, 1fr); }
  .stats-grid.four, .form-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-panel { position: static; }
}

@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 14px; }
  .brand { min-width: auto; }
  .mainnav { overflow-x: auto; width: 100%; }
  .userbar { display: none; }
  .app { width: calc(100% - 20px); }
  .toolbar, .member-header, .page-head { flex-direction: column; align-items: stretch; }
  .check-cards, .stats-grid.four, .form-grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
}
