:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-strong: #f0f3f7;
  --text: #17212b;
  --muted: #617083;
  --line: #dde4ec;
  --orange: #ee4d2d;
  --green: #0f8a63;
  --cyan: #2d9cdb;
  --blue: #2d62d8;
  --amber: #b66b00;
  --violet: #7c4cc2;
  --red: #c43d3d;
  --shadow: 0 18px 45px rgba(22, 34, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(238, 77, 45, 0.1), transparent 32%),
    linear-gradient(45deg, rgba(45, 156, 219, 0.09), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.app-shell {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  align-items: stretch;
}

.login-panel {
  min-height: 100vh;
  padding: 56px clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}

.brand-row,
.side-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.login-copy {
  max-width: 440px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.login-form {
  max-width: 420px;
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #314052;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
}

.login-form button,
.ghost-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.login-form button {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 12px 30px rgba(238, 77, 45, 0.22);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.review-note {
  max-width: 420px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  display: grid;
  gap: 6px;
}

.review-note span,
.review-note strong {
  overflow-wrap: anywhere;
}

.review-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-aside {
  display: grid;
  place-items: center;
  padding: 48px;
}

.flow-card {
  width: min(520px, 100%);
  border-radius: 8px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(221, 228, 236, 0.9);
  box-shadow: var(--shadow);
}

.flow-card p {
  color: var(--orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flow-card ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 18px;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.15;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #101820;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.side-brand .brand-mark {
  width: 40px;
  height: 40px;
}

.side-brand span {
  display: block;
  margin-top: 4px;
  color: #aab5c1;
  font-size: 13px;
}

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

.side-nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #dce5ee;
  text-decoration: none;
  font-weight: 700;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: 0;
}

.ghost-button {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.content {
  min-width: 0;
  padding: 28px;
  display: grid;
  gap: 22px;
}

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

.topbar h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: 0;
}

.status-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.green {
  color: #086044;
  background: #dff6ed;
}

.status-pill.amber {
  color: #7a4700;
  background: #fff1d7;
}

.status-pill.blue {
  color: #244ea8;
  background: #e4ecff;
}

.hero-band,
.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(22, 34, 51, 0.06);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  gap: 24px;
  padding: clamp(22px, 4vw, 38px);
  overflow: hidden;
}

.hero-copy h3 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(26px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero-visual {
  display: grid;
  align-content: center;
  gap: 14px;
}

.funnel-row {
  min-height: 74px;
  padding: 16px;
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  background: #f7fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.funnel-row:nth-child(2) {
  border-left-color: var(--cyan);
}

.funnel-row:nth-child(3) {
  border-left-color: var(--green);
}

.funnel-row span {
  color: var(--muted);
  font-weight: 700;
}

.funnel-row strong {
  font-size: 28px;
}

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

.metric-card {
  min-height: 150px;
  padding: 20px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: 0;
}

.metric-card em {
  color: var(--green);
  font-style: normal;
  font-weight: 700;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  padding: 20px;
}

.panel.wide {
  grid-column: span 2;
}

.panel.full {
  grid-column: 1 / -1;
}

.panel-heading h3 {
  margin: 0;
  font-size: 20px;
}

.period-label,
.muted {
  color: var(--muted);
}

.bar-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px minmax(80px, 1fr) 48px;
  align-items: center;
  gap: 14px;
  font-weight: 800;
}

.bar-row span {
  color: #35465a;
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  background: #edf1f5;
  overflow: hidden;
}

.bar-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.bar-track.cyan div {
  background: var(--cyan);
}

.bar-track.red div {
  background: var(--red);
}

.bar-track.violet div {
  background: var(--violet);
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
}

.donut {
  width: 112px;
  aspect-ratio: 1;
  flex: 0 0 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 48%, transparent 49%),
    conic-gradient(var(--green) 0 85%, #e8edf2 85% 100%);
}

.donut-wrap strong {
  display: block;
  font-size: 36px;
}

.donut-wrap span {
  color: var(--muted);
  font-weight: 700;
}

.compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.compact-list span {
  color: var(--muted);
  font-weight: 700;
}

.compact-list.large strong {
  font-size: 24px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
}

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

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

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

td {
  font-weight: 700;
}

.spark-chart {
  height: 260px;
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #eef3f8);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 12px;
}

.spark-chart span {
  display: block;
  min-height: 24px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--orange), var(--amber));
}

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

.info-grid h4 {
  margin-bottom: 10px;
  font-size: 17px;
}

.info-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.pipeline {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pipeline div {
  min-height: 72px;
  padding: 14px;
  border-radius: 8px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 800;
}

.callback-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed #a8b5c2;
  border-radius: 8px;
  background: #f7fafc;
  color: #314052;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef3f8;
}

@media (max-width: 980px) {
  .login-screen,
  .dashboard,
  .hero-band,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
  }

  .login-aside {
    padding: 28px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

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

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

  .panel.wide {
    grid-column: auto;
  }

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

@media (max-width: 640px) {
  .content {
    padding: 18px;
  }

  .topbar,
  .panel-heading {
    display: grid;
  }

  .status-group {
    justify-content: flex-start;
  }

  .metric-grid,
  .pipeline {
    grid-template-columns: 1fr;
  }

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

  .funnel-row {
    display: grid;
  }
}
