:root {
  color: #182024;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5f7f8;
}

* {
  box-sizing: border-box;
}

body {
  background: #f5f5f5;
  margin: 0;
  min-width: 320px;
  overflow: hidden;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
  font: inherit;
}

.portalShell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  min-height: 0;
  padding: 14px;
}

.portalShell.authPending {
  visibility: hidden;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d7dfdd;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 14px 12px 26px;
  position: relative;
  z-index: 1000;
}

.titleBlock {
  min-width: 0;
  position: relative;
}

.districtTitleControl {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  max-width: 100%;
  position: relative;
}

.brandLogo {
  display: block;
  flex: 0 0 auto;
  height: 42px;
  max-width: min(280px, 48vw);
  object-fit: contain;
  width: auto;
}

.brandLogoLink {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.moduleTitleText {
  color: #182024;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moduleTitleText::before {
  color: #6a777b;
  content: "|";
  font-weight: 400;
  margin: 0 14px 0 6px;
}

.topbarActions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: end;
  line-height: 1.45;
}

h1 {
  align-items: center;
  color: #182024;
  display: inline-flex;
  font-size: 1.5rem;
  font-weight: 760;
  gap: 6px;
  line-height: 1.15;
  margin: 0;
  max-width: 100%;
}

.textButton {
  align-items: center;
  background: #ffffff;
  border: 1px solid #b9c7c4;
  border-radius: 4px;
  display: inline-flex;
  min-height: 36px;
  padding: 0 12px;
  text-decoration: none;
}

.textButton:hover,
.textButton:focus-visible {
  background: #f7faf9;
}

.textButton.primary {
  background: #4057A6;
  border-color: #4057A6;
  color: #ffffff;
}

.textButton.primary:hover,
.textButton.primary:focus-visible {
  background: #324587;
}

.authStatus {
  align-items: center;
  color: #405057;
  display: inline-flex;
  justify-content: center;
  margin-right: 14px;
  min-height: 36px;
  text-align: center;
}

.authStatus strong {
  color: #182024;
  display: inline-flex;
  font-weight: 400;
  line-height: 1;
}

.topbar > .portalHeaderRight > .textButton,
.topbar > .portalHeaderRight > .iconButton {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
}

.platformAdminMenu {
  flex: 0 0 auto;
  position: relative;
}

.platformAdminMenuButton {
  font-size: 1.06rem;
}

.platformAdminMenuPanel {
  background: #ffffff;
  border: 1px solid #b9c7c4;
  box-shadow: 0 12px 30px rgba(24, 32, 36, 0.14);
  display: grid;
  min-height: 44px;
  min-width: 230px;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
}

.platformAdminMenuPanel[hidden] {
  display: none;
}

.iconButton {
  align-items: center;
  background: #182024;
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.iconButton.light {
  background: #ffffff;
  border: 1px solid #b9c7c4;
  color: #182024;
}

.platformAdminMenu:hover .platformAdminMenuButton,
.platformAdminMenuButton:hover,
.platformAdminMenuButton:focus {
  background: #f7faf9;
}

.portalContent {
  margin: 0 auto;
  max-width: 1040px;
  padding: 64px 28px 80px;
}

.portalIntro {
  max-width: 720px;
}

.eyebrow {
  color: #4057a5;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.portalIntro h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 650;
  line-height: 1.1;
  margin: 0;
}

.portalIntro p:last-child {
  color: #58646a;
  font-size: 1.05rem;
  margin: 16px 0 0;
}

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

.moduleCard {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d1dbd8;
  border-radius: 6px;
  display: flex;
  gap: 16px;
  min-height: 132px;
  padding: 22px;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.moduleCard:hover,
.moduleCard:focus-visible {
  border-color: #4057a5;
  box-shadow: 0 8px 20px rgba(24, 32, 36, 0.1);
  transform: translateY(-1px);
}

.moduleIcon {
  align-items: center;
  background: #eef3f1;
  border: 1px solid #d1dbd8;
  border-radius: 4px;
  color: #4057a5;
  display: inline-flex;
  flex: 0 0 46px;
  font-size: 0.8rem;
  font-weight: 800;
  height: 46px;
  justify-content: center;
}

.moduleIcon img {
  display: block;
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.moduleCardBody {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.moduleCardBody strong {
  font-size: 1.12rem;
}

.moduleCardBody span {
  color: #58646a;
  line-height: 1.4;
}

.moduleArrow {
  color: #4057a5;
  font-size: 1.4rem;
  margin-left: auto;
}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .portalHeaderRight {
    width: 100%;
  }

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

.portalContent { width:100%; flex:1 1 auto; min-height:0; overflow:auto; }
.moduleSections { display:grid; gap:32px; margin-top:42px; }
.moduleSection h2 { margin:0 0 16px; font-size:1.25rem; font-weight:600; }
.moduleIcon svg { display:block; width:42px; height:42px; }
