:root {
  --navy: #0B2F59;
  --navy-deep: #05182B;
  --navy-black: #031220;
  --blue: #0878F9;
  --blue-deep: #1455B8;
  --cyan: #19A9E5;
  --gold: #F4A100;
  --soft: #F4F8FB;
  --charcoal: #24384D;
  --muted: #6B7E90;
  --line: #DCE7ED;
  --white: #FFFFFF;
  --success: #2E8B6D;
  --danger: #B44747;
  --shadow: 0 18px 50px rgba(11,47,89,.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--charcoal);
  background: #edf3f7;
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.auth-body { background: #fff; }

.welcome-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(430px, .92fr);
  background: #fff;
}

.welcome-hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 38px 62px 32px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 85% 38%, rgba(18,99,199,.22), transparent 31%),
    radial-gradient(circle at 18% 6%, rgba(16,111,215,.08), transparent 30%),
    linear-gradient(145deg, var(--navy-black) 0%, #061b30 48%, #092b4d 100%);
}

.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .3;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255,255,255,.75) 0 1px, transparent 1.7px),
    radial-gradient(circle at 24% 32%, rgba(255,255,255,.45) 0 1px, transparent 1.8px),
    radial-gradient(circle at 59% 17%, rgba(255,255,255,.55) 0 1px, transparent 1.8px),
    radial-gradient(circle at 72% 6%, rgba(255,255,255,.4) 0 1px, transparent 1.8px),
    radial-gradient(circle at 94% 29%, rgba(255,255,255,.6) 0 1px, transparent 1.8px);
}

.hero-top,
.hero-content,
.hero-bottom { position: relative; z-index: 3; }

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.cybergov-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.cybergov-logo { width: 54px; height: 54px; flex: 0 0 auto; }
.cybergov-wordmark strong { display: block; font-size: 28px; letter-spacing: .02em; line-height: 1; }
.cybergov-wordmark small { display: block; margin-top: 7px; font-size: 11px; opacity: .82; }
.cybergov-wordmark-light { color: #fff; }

.hero-pillars {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.83);
  font-size: 10px;
  letter-spacing: .18em;
  margin-top: 12px;
  white-space: nowrap;
}
.hero-pillars i { width: 1px; height: 12px; background: rgba(255,255,255,.35); }

.hero-content {
  width: min(720px, 95%);
  margin-top: clamp(62px, 9vh, 118px);
}

.hero-content h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 4.25vw, 68px);
  line-height: 1.05;
  letter-spacing: -.035em;
}
.hero-content h1 em { color: #1797ff; font-style: normal; }

.hero-intro {
  max-width: 690px;
  margin: 24px 0 0;
  color: #d8e5f0;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.58;
}

.hero-capabilities {
  display: flex;
  gap: clamp(28px, 5vw, 68px);
  margin-top: 38px;
}

.capability {
  display: grid;
  grid-template-columns: 38px auto;
  gap: 10px;
  align-items: center;
  color: #e7f1f8;
  font-size: 13px;
  line-height: 1.35;
}
.capability-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(142,205,255,.8);
  border-radius: 11px;
  color: #50b9ff;
  font-size: 19px;
}

.earth-stage {
  position: absolute;
  z-index: 1;
  left: 5%;
  right: -2%;
  bottom: 122px;
  height: 40%;
  opacity: .96;
}
.earth-stage::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -5% -2% -8%;
  background: linear-gradient(to bottom, rgba(4,20,36,.92) 0%, rgba(4,20,36,.12) 28%, rgba(4,20,36,.02) 65%, rgba(4,20,36,.70) 100%);
  pointer-events: none;
}
.earth-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.1) contrast(1.06);
}

.hero-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.global-message { max-width: 430px; }
.accent-line { display: block; width: 56px; height: 3px; border-radius: 99px; background: #12a7ff; margin-bottom: 16px; }
.global-message strong { display: block; font-size: 25px; }
.global-message p { margin: 8px 0 0; color: #d0deea; font-size: 14px; line-height: 1.5; }

.framework-strip {
  display: flex;
  align-items: baseline;
  gap: 20px;
  color: rgba(255,255,255,.72);
  font-size: 16px;
  white-space: nowrap;
}
.framework-strip strong { color: #fff; font-size: 22px; letter-spacing: .04em; }

.welcome-auth {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 76px 52px 42px;
  background:
    radial-gradient(circle at 15% 8%, rgba(8,120,249,.045), transparent 25%),
    #fff;
}

.auth-language {
  position: absolute;
  right: 54px;
  top: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #314e78;
}
.auth-language select {
  appearance: auto;
  border: 0;
  outline: none;
  background: transparent;
  color: #314e78;
  cursor: pointer;
}

.auth-card {
  width: min(540px, 100%);
  margin: 0 auto;
  padding: 28px 32px 26px;
  border: 1px solid #edf2f8;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 50px rgba(11,47,89,.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #09265b;
}
.auth-logo { width: 52px; height: 52px; }
.auth-brand strong { display: block; font-size: 29px; letter-spacing: .01em; }
.auth-brand small { display: block; color: #34538b; margin-top: 3px; font-size: 10px; }

.auth-heading { text-align: center; margin: 38px 0 32px; }
.auth-heading h2 { margin: 0; color: #061b50; font-size: 35px; letter-spacing: -.025em; }
.auth-heading p { margin: 8px 0 0; color: #60769c; font-size: 15px; }

.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 9px; }
.auth-field > span { color: #112b5d; font-size: 13px; font-weight: 700; }
.password-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.password-label a { color: #0878F9; font-size: 12px; font-weight: 600; }

.input-shell {
  height: 52px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  border: 1px solid #cddcf0;
  border-radius: 8px;
  background: #fff;
  transition: .18s ease;
}
.input-shell:focus-within { border-color: #0878F9; box-shadow: 0 0 0 3px rgba(8,120,249,.08); }
.input-icon { text-align: center; color: #0878F9; }
.input-shell input { min-width: 0; height: 100%; border: 0; outline: 0; color: #142b52; background: transparent; padding: 0 4px; }
.input-shell input::placeholder { color: #8797b1; }
.visibility-button { width: 42px; height: 100%; border: 0; background: transparent; color: #536f9a; cursor: pointer; }

.sign-in-button {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: #fff;
  background: linear-gradient(90deg, #0878F9, #096DF1);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(8,120,249,.15);
  transition: transform .16s ease, box-shadow .16s ease;
}
.sign-in-button:hover { transform: translateY(-1px); box-shadow: 0 13px 26px rgba(8,120,249,.20); }
.sign-in-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 26px 0 20px;
  color: #7183a2;
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #dce5f1; }

.sso-grid, .demo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sso-button, .demo-button {
  min-height: 50px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
}
.sso-button { border: 1px solid #d5e0ef; background: #fff; color: #173462; }
.sso-button:hover { border-color: #a9c5e8; background: #fbfdff; }

.microsoft-mark { display: grid; grid-template-columns: 8px 8px; grid-template-rows: 8px 8px; gap: 1px; }
.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }
.google-mark { font-weight: 800; font-size: 18px; color: #4285F4; }

.demo-actions {
  border-top: 1px solid #e3eaf3;
  margin-top: 20px;
  padding-top: 20px;
}
.demo-button { min-height: 54px; }
.demo-primary { border: 1px solid #0878F9; background: #0878F9; color: #fff; }
.demo-secondary { border: 1px solid #0878F9; background: #fff; color: #0878F9; }
.demo-primary:hover { background: #056de4; }
.demo-secondary:hover { background: #f6faff; }

.error, .action-message {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}
.error { color: var(--danger); background: #fff1f1; border: 1px solid #f1caca; }
.action-message { margin-top: 14px; color: #31506e; background: #f3f8fc; border: 1px solid #d8e8f4; text-align: center; }

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 28px;
  color: #61769b;
  font-size: 12px;
}
.auth-footer a:hover { color: #0878F9; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background:
    radial-gradient(circle at 50% 0%, rgba(25,169,229,.12), transparent 22%),
    var(--navy);
  color: white;
  min-height: 100vh;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  margin-top: 38px;
  display: grid;
  gap: 8px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: #dbeaf4;
  font-size: 14px;
  transition: .16s ease;
}

.nav a.active,
.nav a:hover {
  background: rgba(255,255,255,.10);
  color: white;
}

.logout-button {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.16);
  background: transparent;
  color: #dbeaf4;
  border-radius: 10px;
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
}

.logout-button:hover {
  background: rgba(255,255,255,.08);
  color: white;
}

.content {
  padding: 30px 36px 45px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

h1 {
  color: var(--navy);
  font-size: 32px;
  margin: 7px 0 5px;
  letter-spacing: -.02em;
}

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

.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  min-height: 30px;
}

.metric-value {
  color: var(--navy);
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
}

.trend {
  font-size: 11px;
  margin-top: 7px;
  color: var(--success);
}

.trend.negative { color: var(--danger); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(11,47,89,.035);
}

.panel h2 {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 17px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #edf2f5;
}

.alert-row:last-child { border-bottom: 0; }

.alert-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.institutions-panel { margin-top: 18px; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

.table td {
  border-bottom: 1px solid #eef3f6;
  padding: 13px 8px;
}

.table tbody tr:hover { background: #fafcfd; }

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 32px 0 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--navy);
  color: white;
  padding: 13px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12px;
  max-width: 320px;
}

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    min-height: auto;
    height: auto;
    position: static;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .logout-button { margin-top: 24px; }
  .content { padding: 22px 16px 36px; }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .login-area { padding: 26px 20px; }
  .nav { grid-template-columns: 1fr; }
}


@media (max-width: 1180px) {
  .welcome-page { grid-template-columns: 1fr 520px; }
  .welcome-hero { padding-left: 42px; padding-right: 42px; }
  .hero-pillars { display: none; }
  .framework-strip { gap: 13px; font-size: 13px; }
}

@media (max-width: 900px) {
  .welcome-page { grid-template-columns: 1fr; }
  .welcome-hero { min-height: 480px; padding: 30px 30px 24px; }
  .hero-content { margin-top: 48px; width: 100%; }
  .hero-content h1 { font-size: 44px; }
  .hero-intro { max-width: 620px; }
  .earth-stage { height: 47%; bottom: 58px; opacity: .78; }
  .hero-capabilities { display: none; }
  .hero-bottom { margin-top: 130px; }
  .global-message p { display: none; }
  .framework-strip { display: none; }
  .welcome-auth { min-height: auto; padding: 86px 24px 44px; }
  .auth-language { right: 28px; top: 28px; }
}

@media (max-width: 560px) {
  .welcome-hero { min-height: 390px; padding: 24px 22px; }
  .cybergov-wordmark strong { font-size: 23px; }
  .cybergov-logo { width: 45px; height: 45px; }
  .hero-content { margin-top: 44px; }
  .hero-content h1 { font-size: 36px; }
  .hero-intro { font-size: 15px; }
  .earth-stage { bottom: 30px; height: 45%; }
  .hero-bottom { display: none; }
  .welcome-auth { padding: 76px 16px 34px; }
  .auth-card { padding: 24px 18px; border-radius: 16px; }
  .auth-brand strong { font-size: 24px; }
  .auth-heading { margin: 30px 0 26px; }
  .auth-heading h2 { font-size: 30px; }
  .sso-grid, .demo-actions { grid-template-columns: 1fr; }
}
