:root {
  --bg: #d9e9f5;
  --shell: #eef4f9;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --border: #dce6f1;
  --ink: #1e2430;
  --muted: #5e6d7e;
  --blue: #2f73d8;
  --blue-deep: #1957b8;
  --green: #44b96c;
  --yellow: #f5b641;
  --orange: #f08423;
  --red: #ef5547;
  --mint: #68d2a8;
  --shadow: 0 22px 50px rgba(90, 127, 164, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(180deg, #dbe9f3 0%, #d4e6f3 100%);
}

.app-stage {
  padding: 18px;
}

.browser-shell {
  max-width: 1380px;
  margin: 0 auto;
  background: rgba(239, 246, 251, 0.96);
  border: 1px solid rgba(188, 205, 221, 0.85);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.browser-topbar,
.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(233, 241, 248, 0.96);
  border-bottom: 1px solid rgba(194, 208, 221, 0.82);
}

.browser-toolbar {
  background: rgba(245, 249, 252, 0.96);
}

.browser-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff6b63;
}

.dot.yellow {
  background: #f5c44d;
}

.dot.green {
  background: #69d26d;
}

.browser-tabs {
  display: flex;
  gap: 10px;
  flex: 1;
}

.browser-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 12px 12px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.browser-tab.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
}

.browser-tab.muted {
  font-size: 1.25rem;
}

.browser-nav,
.browser-actions {
  display: flex;
  gap: 12px;
  color: #7b8b9d;
  font-size: 1.1rem;
}

.browser-address {
  flex: 1;
  min-height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5f8fa, #edf3f8);
  border: 1px solid rgba(205, 217, 229, 0.95);
}

.browser-action {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid #91a3b7;
  opacity: 0.9;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 120px);
}

.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
}

.brand-lockup h1,
.dashboard-header h2,
.panel h3,
.downloads-strip h3 {
  margin: 0;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
}

.brand-eyebrow,
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: #6f8396;
  font-weight: 700;
}

.brand-lockup h1 {
  font-size: 1.05rem;
  line-height: 1.04;
  max-width: 11ch;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin: 30px 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px 0 44px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #c1d2e3;
}

.nav-item.active {
  background: rgba(47, 115, 216, 0.12);
  color: var(--blue-deep);
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-item.active::before {
  background: var(--blue);
}

.sidebar-note {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f3f8fd;
}

.sidebar-note .label {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--blue-deep);
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}

.dashboard-main {
  padding: 28px 24px 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.dashboard-header h2 {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 0.96;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-button,
.primary-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(195, 209, 223, 0.9);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-family: inherit;
}

.primary-button {
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 28px rgba(47, 115, 216, 0.22);
}

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

.metric-card,
.panel,
.downloads-strip {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(137, 160, 186, 0.08);
}

.metric-card {
  padding: 18px;
}

.metric-card-primary {
  background:
    radial-gradient(circle at bottom right, rgba(68, 185, 108, 0.16), transparent 42%),
    #ffffff;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.metric-label {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2b333d;
}

.metric-value {
  display: block;
  font-family: "Archivo", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
}

.metric-value.success {
  color: var(--green);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-green {
  margin-top: 10px;
  color: #fff;
  background: var(--green);
}

.pill-red {
  color: #fff;
  background: var(--red);
}

.pill-yellow {
  color: #714300;
  background: #ffd786;
}

.pill-blue {
  color: #fff;
  background: var(--blue);
}

.pill-green-soft {
  color: #276d45;
  background: #d7f3e2;
}

.pill-blue-soft {
  color: #22509b;
  background: #d9e8ff;
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 84px;
  min-width: 120px;
}

.mini-bars span {
  display: block;
  width: 12px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #b8efc5, #54bb71);
}

.mini-bars span:nth-child(1) { height: 40px; }
.mini-bars span:nth-child(2) { height: 56px; }
.mini-bars span:nth-child(3) { height: 68px; }
.mini-bars span:nth-child(4) { height: 46px; }
.mini-bars span:nth-child(5) { height: 74px; }
.mini-bars span:nth-child(6) { height: 62px; }
.mini-bars span:nth-child(7) { height: 84px; }

.sparkline,
.micro-columns {
  width: 100%;
  height: 66px;
  margin-top: 10px;
}

.sparkline path {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline.blue path {
  stroke: #5d8ed8;
}

.sparkline.green path {
  stroke: #55be78;
}

.sparkline.mint path {
  stroke: #59caa0;
}

.micro-columns {
  display: flex;
  align-items: end;
  gap: 7px;
}

.micro-columns span {
  display: block;
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ffe5b3, #f59a2f);
}

.micro-columns span:nth-child(1) { height: 18px; }
.micro-columns span:nth-child(2) { height: 26px; }
.micro-columns span:nth-child(3) { height: 16px; }
.micro-columns span:nth-child(4) { height: 22px; }
.micro-columns span:nth-child(5) { height: 30px; }
.micro-columns span:nth-child(6) { height: 36px; }
.micro-columns span:nth-child(7) { height: 48px; }

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr 0.92fr;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h3 {
  font-size: 1.45rem;
  line-height: 1.02;
}

.eyebrow.small {
  margin-bottom: 6px;
  font-size: 0.72rem;
}

.map-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  background: linear-gradient(180deg, #fbfdff, #f6fbff);
  border: 1px solid #edf3f8;
  border-radius: 18px;
}

.risk-map {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.legend {
  margin-top: 16px;
}

.legend-bar {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #37bf67 0%, #f6df4b 35%, #f08a1f 68%, #d92323 100%);
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  position: relative;
  padding: 16px 16px 16px 18px;
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: 16px;
  background: var(--panel-soft);
}

.task-card.danger {
  border-left-color: var(--red);
}

.task-card.warning {
  border-left-color: var(--yellow);
}

.task-card.success {
  border-left-color: var(--green);
}

.task-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.task-card h4 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-family: "Archivo", sans-serif;
}

.task-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.52;
}

.task-menu {
  color: #8ea0b2;
  font-size: 1.2rem;
}

.month-track {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.track-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.track-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid currentColor;
  background: #fff;
  margin-top: 4px;
}

.track-dot::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 54px;
  background: currentColor;
  opacity: 0.32;
}

.track-item:last-child .track-dot::after {
  display: none;
}

.track-dot.red { color: var(--red); }
.track-dot.blue { color: var(--blue); }
.track-dot.green { color: var(--green); }

.track-item strong {
  display: block;
  margin-bottom: 4px;
  font-family: "Archivo", sans-serif;
}

.track-item p {
  margin: 0;
  color: var(--ink);
}

.school-table {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.school-table-head,
.school-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: center;
}

.school-table-head {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.school-row {
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid #eef3f8;
  font-size: 0.95rem;
}

.school-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.mini-button {
  min-height: 38px;
  padding: 0 14px;
  background: #f3f8fd;
  color: var(--blue-deep);
}

.downloads-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 18px;
}

.downloads-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.downloads-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #f2f7fd;
  border: 1px solid var(--border);
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 700;
}

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

  .metric-card-primary {
    grid-column: span 2;
  }

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

@media (max-width: 880px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-header,
  .downloads-strip {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .app-stage {
    padding: 8px;
  }

  .browser-topbar,
  .browser-toolbar,
  .dashboard-main,
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .metrics-grid,
  .sidebar-nav,
  .school-table-head,
  .school-row {
    grid-template-columns: 1fr;
  }

  .metric-card-primary {
    grid-column: auto;
  }

  .metric-top {
    flex-direction: column;
    align-items: start;
  }
}
