:root {
  --bg: #f3f6f5;
  --ink: #17211f;
  --muted: #63736e;
  --surface: #ffffff;
  --line: #d8e2df;
  --green: #117864;
  --green-dark: #0c4b43;
  --blue: #1d5d8f;
  --amber: #b87817;
  --soft: #eaf2ef;
  --shadow: 0 12px 32px rgba(18, 31, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  padding: 28px clamp(18px, 4vw, 54px);
  background: linear-gradient(120deg, var(--green-dark), #183b52);
  color: #ffffff;
  border-bottom: 6px solid var(--amber);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  max-width: 680px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 7px;
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.button.primary {
  background: #ffffff;
  color: var(--green-dark);
  border-color: #ffffff;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 44px;
}

.role-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.tab {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  background: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-dark);
}

.dashboard {
  display: none;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard.active {
  display: block;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.section-title .eyebrow {
  color: var(--green);
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
}

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

.system-card {
  display: grid;
  align-content: start;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.system-card:hover,
.system-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: var(--shadow);
  outline: none;
}

.system-card.strong {
  background: var(--soft);
  border-left: 5px solid var(--green);
}

.tag {
  width: fit-content;
  margin-bottom: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e0ece8;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.system-card h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.system-card p,
.knowledge li,
footer {
  color: var(--muted);
}

.knowledge {
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  background: #fff8ee;
  border: 1px solid #ead7b9;
}

.knowledge h3 {
  margin-bottom: 10px;
}

.knowledge ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #ffffff;
  color: var(--green-dark);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  font-size: 0.88rem;
}

@media (max-width: 920px) {
  .app-header,
  .section-title,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .role-tabs,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard {
    padding: 18px;
  }

  .system-card {
    min-height: 0;
  }
}
