:root {
  color-scheme: light;
  --background: #f4f7f9;
  --surface: #ffffff;
  --text: #202c38;
  --muted: #667788;
  --border: #dbe3ea;
  --blue: #1b4f72;
  --green: #1e8449;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal {
  width: min(100%, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.portal-header {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
}

.brand span,
.module-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand strong {
  color: var(--blue);
  font-size: 1rem;
}

.brand small,
.module-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.header-admin-link,
.management-entry > a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.header-admin-link:hover,
.header-admin-link:focus-visible,
.management-entry > a:hover,
.management-entry > a:focus-visible {
  border-color: #143d59;
  background: #143d59;
  outline: 3px solid rgba(27, 79, 114, 0.18);
  outline-offset: 2px;
}

.portal-intro {
  padding: 46px 0 34px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--blue);
  font-size: 2.25rem;
  line-height: 1.12;
}

.portal-intro > p:last-child,
.section-heading p,
.management-entry p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.module-section {
  padding: 0 0 28px;
}

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

.section-heading h2,
.management-entry h2 {
  margin: 0;
  color: #263946;
  font-size: 1.05rem;
}

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

.module-link {
  --module-accent: var(--blue);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 22px;
  min-height: 84px;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--module-accent);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.module-link[hidden] {
  display: none;
}

.module-link:hover,
.module-link:focus-visible {
  border-color: var(--module-accent);
  box-shadow: 0 8px 22px rgba(32, 44, 56, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.module-link[href="/relatorios/"] {
  --module-accent: #c2414a;
}

.module-link[href="/documental"] {
  --module-accent: #2563a6;
}

.module-link[href="https://ia.solutiongroup.com.br/erosao"] {
  --module-accent: #c77a00;
}

.module-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--module-accent);
  background: #f1f5f7;
  font-size: 0.68rem;
  font-weight: 800;
}

.module-copy strong {
  color: #263946;
  font-size: 0.88rem;
}

.link-icon {
  justify-self: end;
  color: var(--module-accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.management-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(27, 79, 114, 0.2);
  border-left: 4px solid var(--green);
  border-radius: 7px;
  background: #ffffff;
}

@media (max-width: 720px) {
  .portal {
    padding-inline: 16px;
  }

  .portal-header {
    min-height: 72px;
  }

  .header-admin-link span:first-child {
    display: none;
  }

  .module-links {
    grid-template-columns: 1fr;
  }

  .management-entry {
    grid-template-columns: 1fr;
  }

  .management-entry > a {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand small {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .portal-intro {
    padding-block: 34px 28px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .module-link {
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
