@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #6b7280;
  --line: #dbe3ef;
  --panel: #ffffff;
  --canvas: #eef3f8;
  --nav: #0d1f3f;
  --nav-soft: #15345f;
  --blue: #1479bd;
  --brand-red: #e21d2b;
  --brand-yellow: #f9c21b;
  --brand-orange: #f27a00;
  --green: #20895e;
  --red: #bd3f3f;
  --amber: #b7791f;
  --radius: 8px;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef3f8 0%, #e5eef6 48%, #fff7df 100%);
}

.auth-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.14);
}

.brand-lockup,
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 7px;
  background: white;
  padding: 4px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.auth-panel h1 {
  margin: 0;
  font-size: 28px;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.6;
  margin: 20px 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.login-form input,
.toolbar select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.login-form button,
.secondary-button,
.toolbar button,
.chips button {
  height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.secondary-button {
  width: 100%;
  background: #e5eaf1;
  color: #64748b;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
}

.login-message.is-error {
  color: var(--red);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  transition: grid-template-columns 180ms ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 76px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: linear-gradient(180deg, #0d1f3f 0%, #0a1730 100%);
  color: white;
  overflow: hidden;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 900;
}

.sidebar-logo strong {
  display: block;
  font-size: 15px;
}

.shell.sidebar-collapsed .sidebar {
  padding: 18px 14px;
  align-items: center;
}

.shell.sidebar-collapsed .sidebar-logo {
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar-logo div:not(.logo-mark),
.shell.sidebar-collapsed .sidebar-logo strong,
.shell.sidebar-collapsed .sidebar-logo span,
.shell.sidebar-collapsed .nav-item span,
.shell.sidebar-collapsed .sidebar-note {
  display: none;
}

.shell.sidebar-collapsed .nav-item {
  justify-content: center;
  width: 44px;
  padding: 10px;
}

.sidebar-logo span,
.sidebar-note span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  font-weight: 750;
}

.nav-item.is-active,
.nav-item:hover {
  background: var(--nav-soft);
  color: white;
  border-color: rgba(249, 194, 27, 0.32);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: #cbd5e1;
}

.sidebar-note p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

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

.topbar p,
.topbar h2 {
  margin: 0;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 780px;
}

.toolbar select {
  max-width: 180px;
  font-size: 13px;
}

.toolbar button {
  padding: 0 14px;
  background: var(--nav);
}

.toolbar button:last-child {
  background: #e5eaf1;
  color: var(--ink);
}

.section-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-head > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 116px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.metric[title] {
  cursor: help;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 25px;
  letter-spacing: 0;
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.metric.up small {
  color: var(--green);
}

.metric.down small,
.metric.warn small {
  color: var(--red);
}

.metric.up {
  border-top: 3px solid var(--brand-yellow);
}

.metric.warn,
.metric.down {
  border-top: 3px solid var(--brand-red);
}

.metric.neutral {
  border-top: 3px solid var(--blue);
}

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

.insight-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: white;
}

.insight-card header {
  margin-bottom: 16px;
}

.insight-card h2 {
  margin: 0;
  font-size: 18px;
}

.insight-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.note {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

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

.funnel-list,
.alert-list,
.bar-list,
.qa-list {
  display: grid;
  gap: 10px;
}

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

.hierarchy-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.hierarchy-row strong {
  color: var(--ink);
}

.hierarchy-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hierarchy-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5eaf1;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.funnel-row,
.alert-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.funnel-row {
  grid-template-columns: 1fr auto auto;
}

.funnel-row small {
  color: var(--muted);
  font-weight: 800;
}

.funnel-row.warn {
  border-color: #f1c7c7;
}

.alert-row {
  grid-template-columns: 28px 1fr auto;
}

.alert-row b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #e5eaf1;
  border-radius: 50%;
}

.alert-row strong,
.alert-row span {
  display: block;
}

.alert-row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.alert-row em {
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.alert-table td:first-child,
.severity-critical,
.severity-warning,
.severity-positive {
  font-weight: 900;
}

.severity-critical {
  color: var(--red);
}

.severity-warning {
  color: var(--amber);
}

.severity-positive {
  color: var(--green);
}

.qa-row {
  display: grid;
  grid-template-columns: 160px 86px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.qa-row em {
  width: max-content;
  min-width: 68px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5eaf1;
  color: #334155;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.qa-row.pass em {
  background: #dff3e9;
  color: var(--green);
}

.qa-row.failed em {
  background: #fde4e4;
  color: var(--red);
}

.qa-row.na em,
.qa-row.guarded em {
  background: #eef2f7;
  color: var(--muted);
}

.qa-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-row div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  font-weight: 800;
}

.bar-row i {
  display: block;
  height: 10px;
  background: #e5eaf1;
  border-radius: 99px;
  overflow: hidden;
}

.bar-row b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--brand-yellow));
  border-radius: inherit;
}

.trend-chart {
  min-height: 210px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 14px;
}

.trend-bar {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.trend-bar span {
  width: 100%;
  max-width: 58px;
  display: block;
  background: linear-gradient(180deg, var(--brand-yellow), var(--brand-orange));
  border-radius: 7px 7px 0 0;
}

.trend-bar strong {
  font-size: 13px;
}

.trend-bar small {
  color: var(--muted);
  font-weight: 800;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chips button {
  padding: 0 14px;
  background: #e5eaf1;
  color: var(--ink);
}

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

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

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    align-items: stretch;
  }

  .sidebar-toggle {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 148px;
    justify-content: center;
  }

  .sidebar-note {
    display: none;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-head {
    display: grid;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar > * {
    flex: 1 1 150px;
    max-width: none;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .auth-panel,
  .section-card {
    padding: 18px;
  }

  .topbar h2,
  .section-head h1 {
    font-size: 24px;
  }

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

  .metric {
    min-height: 96px;
  }

  .alert-row,
  .funnel-row,
  .hierarchy-row,
  .qa-row {
    grid-template-columns: 1fr;
  }

  .alert-row b {
    display: none;
  }
}
