@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
  --green-950: #0f3f22;
  --green-900: #1b5b2a;
  --green-800: #206e31;
  --green-700: #2e7d32;
  --green-100: #e8f5e9;
  --green-050: #f5fbf6;
  --cream: #f6f8f4;
  --ink: #183226;
  --muted: #627768;
  --line: rgba(32, 110, 49, 0.14);
  --shadow: 0 18px 40px rgba(17, 48, 29, 0.12);
  --shadow-soft: 0 10px 24px rgba(17, 48, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(232, 245, 233, 0.92), transparent 34%),
    linear-gradient(180deg, #fbfdfb 0%, #eef6f0 100%);
}

body {
  min-height: 100vh;
}

a {
  color: var(--green-800);
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  background:
    linear-gradient(90deg, rgba(15, 63, 34, 0.98), rgba(32, 110, 49, 0.96)),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  color: #fff;
  padding: 20px 24px;
  box-shadow: 0 6px 22px rgba(11, 43, 22, 0.18);
}

.topbar-row {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
}

.brand-logo img {
  width: 38px;
  height: auto;
  filter: none;
}

.brand-title {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.9;
  max-width: 720px;
}

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

.top-link,
.btn {
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.top-link {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.top-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn {
  background: var(--green-700);
  color: #fff;
  box-shadow: 0 10px 20px rgba(46, 125, 50, 0.18);
}

.btn.secondary {
  background: #fff;
  color: var(--green-900);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.danger {
  background: #a53b31;
  box-shadow: none;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 22px;
}

.hero-banner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(15, 63, 34, 0.98), rgba(34, 113, 53, 0.95)),
    radial-gradient(circle at top right, rgba(255,255,255,0.16), transparent 40%);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 68%);
}

.hero-logo-wrap {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-wrap img {
  width: 108px;
  height: auto;
  filter: none;
}

.hero-banner-copy,
.hero-banner-stats {
  position: relative;
  z-index: 1;
}

.hero-banner-copy h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.16;
}

.hero-banner-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  opacity: 0.94;
  max-width: 780px;
}

.hero-banner-copy-large {
  font-size: 20px !important;
  line-height: 1.7 !important;
  font-weight: 500;
  max-width: 880px !important;
}

.hero-banner-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.hero-card,
.info-card,
.section-card,
.login-card {
  padding: 26px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green-700);
  font-weight: 900;
}

.hero-title {
  margin: 8px 0 10px;
  font-size: 32px;
  line-height: 1.16;
}

.hero-copy,
.muted {
  color: var(--muted);
  line-height: 1.75;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stat-box {
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.82), rgba(255, 255, 255, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.stat-box strong {
  display: block;
  font-size: 26px;
  color: var(--green-900);
  margin-bottom: 4px;
}

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

.section-title {
  margin: 0;
  font-size: 28px;
}

.section-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.summary-list {
  display: grid;
  gap: 14px;
}

.summary-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(245, 251, 246, 0.96), rgba(255, 255, 255, 0.98));
  border: 1px solid var(--line);
}

.summary-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green-900);
}

.news-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #d94f2b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.category-list {
  display: grid;
  gap: 22px;
}

.category-section {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 245, 0.98));
}

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.category-code {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 125, 50, 0.1);
  color: var(--green-900);
  font-weight: 900;
  letter-spacing: 0.04em;
  flex: 0 0 48px;
}

.category-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--green-950);
}

.category-count {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.doc-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 247, 0.96));
  box-shadow: 0 10px 24px rgba(20, 52, 30, 0.06);
}

.doc-card-top {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.doc-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 125, 50, 0.1);
  color: var(--green-900);
  font-size: 14px;
  font-weight: 900;
}

.doc-title {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.38;
  color: var(--green-950);
}

.doc-meta-line {
  margin: 0 0 8px;
  font-size: 14px;
  color: #516758;
  line-height: 1.55;
}

.doc-meta-line strong {
  color: var(--green-950);
}

.doc-summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.doc-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 700;
  background: var(--green-100);
  color: var(--green-900);
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 11px 15px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--line);
  font-size: 14px;
}

.doc-link.primary {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
  box-shadow: 0 10px 20px rgba(46, 125, 50, 0.18);
}

.doc-link.secondary {
  background: #fff;
  color: var(--green-900);
}

.empty-state {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.7), rgba(255, 255, 255, 0.98));
  border: 1px dashed rgba(46, 125, 50, 0.25);
}

.flash {
  margin-bottom: 18px;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
}

.flash.success {
  background: #edf9ee;
  color: #215d2c;
  border: 1px solid rgba(46, 125, 50, 0.25);
}

.flash.error {
  background: #fff0ed;
  color: #8a2e1f;
  border: 1px solid rgba(168, 61, 48, 0.25);
}

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

.form-grid.single {
  grid-template-columns: 1fr;
}

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

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-900);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(46, 125, 50, 0.12);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.login-layout {
  min-height: calc(100vh - 136px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 34px;
}

.login-card {
  width: min(540px, 100%);
}

.portal-footer {
  background:
    linear-gradient(90deg, rgba(15, 63, 34, 0.98), rgba(32, 110, 49, 0.96)),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  color: #e8f5e9;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  padding: 0 14px;
}

.login-hero {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(15, 63, 34, 0.96), rgba(34, 113, 53, 0.92)),
    radial-gradient(circle at top right, rgba(255,255,255,0.14), transparent 40%);
  color: #fff;
}

.login-hero h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.25;
}

.login-hero p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.94;
}

.small-note {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .hero-grid,
  .doc-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar-row,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-banner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 16px 14px;
  }

  .container {
    padding: 20px 12px 32px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-logo img {
    width: 30px;
  }

  .brand-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .brand-subtitle {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 4px;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
  }

  .top-link {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
  }

  .hero-card,
  .info-card,
  .section-card,
  .login-card {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-banner {
    gap: 14px;
    padding: 18px;
    margin-bottom: 18px;
  }

  .hero-logo-wrap {
    width: 92px;
    height: 92px;
  }

  .hero-logo-wrap img {
    width: 84px;
  }

  .hero-banner-copy h2,
  .hero-title {
    font-size: 24px;
  }

  .hero-banner-copy p {
    font-size: 13px;
    line-height: 1.65;
  }

  .hero-banner-copy-large {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .stats-grid {
    gap: 10px;
    margin-top: 16px;
  }

  .stat-box {
    padding: 14px 16px;
  }

  .stat-box strong {
    font-size: 22px;
  }

  .summary-list {
    gap: 10px;
  }

  .summary-item {
    padding: 12px 14px;
  }

  .section-title {
    font-size: 20px;
    line-height: 1.3;
  }

  .section-subtitle,
  .doc-summary,
  .muted {
    font-size: 13px;
    line-height: 1.65;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .category-code {
    min-width: 0;
  }

  .doc-card {
    padding: 16px;
    border-radius: 18px;
  }

  .doc-card-top {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .doc-title {
    font-size: 20px;
  }

  .doc-footer {
    gap: 8px;
  }

  .doc-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .doc-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .doc-link {
    width: 100%;
    padding: 11px 14px;
  }

  .form-actions {
    gap: 10px;
  }

  .form-actions .btn,
  .form-actions .btn.secondary,
  .form-actions .btn.danger {
    width: 100%;
  }

  .portal-footer {
    font-size: 11px;
    padding: 8px 12px;
  }
}
