:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --blue: #2563eb;
  --teal: #0f9f8f;
  --amber: #d98a12;
  --red: #c43d3d;
  --green: #178a55;
  --shadow: 0 12px 28px rgba(21, 31, 52, 0.08);
  --shadow-strong: 0 20px 42px rgba(21, 31, 52, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(15, 159, 143, 0.08), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

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

.filter-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(251, 252, 254, 0.94);
  backdrop-filter: blur(12px);
}

.brand-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), #31415e);
  color: white;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand-block h1 {
  font-size: 17px;
  font-weight: 700;
}

.brand-block p,
.visual-title span,
.report-meta,
.kpi-card em,
.eyebrow {
  color: var(--muted);
}

.filter-section {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.filter-section:hover {
  border-color: #b9c6da;
  box-shadow: 0 8px 20px rgba(21, 31, 52, 0.06);
}

.filter-section h2 {
  margin-bottom: 12px;
  font-size: 12px;
  color: #3d4a63;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

label {
  display: block;
  margin-bottom: 12px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

select,
.filter-section button {
  width: 100%;
  min-height: 36px;
  margin-top: 6px;
  border: 1px solid #cfd6e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

select:focus,
.filter-section button:focus,
.kpi-card:focus,
.audit-item:focus {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

select {
  padding: 0 10px;
}

.filter-section button {
  margin-top: 8px;
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.filter-section button:hover,
.filter-section button.active {
  border-color: #9fb7ef;
  background: #edf4ff;
  color: #1746b4;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.filter-actions button {
  text-align: center;
  font-weight: 700;
}

.filter-actions button:first-child {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.filter-state {
  margin-top: 10px;
  padding: 9px;
  border-radius: 6px;
  background: #f1f6ff;
  color: #34517d;
  font-size: 12px;
  font-weight: 600;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid #edf0f5;
  color: #475467;
}

.status-list div:first-of-type {
  border-top: 0;
}

.dashboard {
  min-width: 0;
  padding: 20px 24px 34px;
}

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

.eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.report-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.report-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 12px;
}

.report-meta span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.page-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.page-tabs a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.page-tabs a:hover {
  background: #f0f4fb;
  color: var(--ink);
  transform: translateY(-1px);
}

.page-tabs a.active {
  background: #e8efff;
  color: #1746b4;
  box-shadow: inset 0 -2px 0 #2f6bed;
}

.insight-strip {
  display: grid;
  grid-template-columns: 180px 150px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.insight-strip div {
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid #ccd8eb;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 46%),
    #fff;
  box-shadow: var(--shadow);
}

.insight-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-strip strong {
  font-size: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card,
.visual-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 104px;
  padding: 13px;
  border-left: 4px solid #8a96aa;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 10px 12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.7), rgba(15, 159, 143, 0.7));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.kpi-card:hover,
.kpi-card.selected {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}

.kpi-card:hover::after,
.kpi-card.selected::after {
  transform: scaleX(1);
}

.kpi-card.pulse strong {
  animation: metricPulse 500ms ease;
}

.kpi-card span {
  display: block;
  min-height: 34px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.kpi-card strong {
  display: block;
  margin: 3px 0;
  font-size: 24px;
  line-height: 1.1;
}

.kpi-card em {
  font-size: 12px;
  font-style: normal;
}

.kpi-card.positive {
  border-left-color: var(--green);
}

.kpi-card.warning {
  border-left-color: var(--amber);
}

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

.section-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.two-col {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-card {
  min-height: 280px;
  padding: 16px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.visual-card:hover {
  border-color: #c5d2e5;
  box-shadow: var(--shadow-strong);
}

.visual-card.large {
  min-height: 330px;
}

.visual-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf0f5;
}

.visual-title h3 {
  font-size: 16px;
}

.visual-title span {
  text-align: right;
  font-size: 12px;
}

.line-chart {
  height: 245px;
  padding: 10px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: linear-gradient(#fbfcff, #fff);
  position: relative;
  overflow: hidden;
}

.line-chart::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 68%;
  width: 1px;
  background: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
}

svg {
  width: 100%;
  height: 100%;
}

.gridline {
  fill: none;
  stroke: #e5e9f0;
  stroke-width: 1;
}

.area {
  fill: rgba(37, 99, 235, 0.12);
}

.line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.revenue {
  stroke: var(--blue);
}

.combo-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  height: 192px;
  padding: 12px;
  border-left: 1px solid #edf0f5;
  border-bottom: 1px solid #edf0f5;
}

.combo-chart span {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.combo-chart i {
  display: block;
  width: 60%;
  height: var(--h);
  border-radius: 4px 4px 0 0;
  background: #9db7f5;
  transition: height 200ms ease, background 160ms ease;
}

.combo-chart b {
  position: absolute;
  bottom: calc(var(--h) + 16px);
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--teal);
}

.combo-chart span:hover i {
  background: #6f95ec;
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  color: #475467;
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}

.revenue-dot {
  background: var(--teal);
}

.spend-dot {
  background: #9db7f5;
}

.bar-list,
.comparison-bars,
.score-list {
  display: grid;
  gap: 13px;
}

.bar-list div,
.comparison-bars div {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  align-items: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.bar-list span,
.comparison-bars span {
  color: #475467;
  font-size: 12px;
}

.bar-list b,
.comparison-bars b {
  display: block;
  width: var(--w);
  min-width: 54px;
  padding: 7px 8px;
  border-radius: 4px;
  background: #dbe8ff;
  color: #1746b4;
  font-size: 12px;
  text-align: right;
  transition: filter 180ms ease, transform 180ms ease, width 220ms ease;
}

.bar-list div:hover,
.comparison-bars div:hover {
  transform: translateX(3px);
}

.bar-list div:hover b,
.comparison-bars div:hover b {
  filter: saturate(1.25);
  transform: scaleX(1.02);
  transform-origin: left;
}

.dimmed {
  opacity: 0.35;
}

.selected-row {
  background: #edf4ff !important;
  box-shadow: inset 3px 0 0 var(--blue);
}

.bar-list.small b {
  background: #e5f5ef;
  color: #15724a;
}

.bar-list b.warn-bar {
  background: #fff1d8;
  color: #955f00;
}

.bar-list b.bad-bar,
.comparison-bars b.negative {
  background: #ffe2e2;
  color: #ad2d2d;
}

.funnel {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.funnel div {
  width: var(--w);
  min-width: 156px;
  padding: 10px 12px;
  border-radius: 5px;
  background: #e9f6f4;
  color: #0b675e;
  font-weight: 600;
  transition: transform 180ms ease, filter 180ms ease;
}

.funnel div:hover {
  transform: translateX(5px);
  filter: saturate(1.25);
}

.funnel strong {
  float: right;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 82%, #e9edf3 82% 100%);
  box-shadow: inset 0 0 0 1px rgba(23, 138, 85, 0.18), 0 12px 28px rgba(23, 138, 85, 0.12);
}

.donut span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: white;
  font-size: 30px;
  font-weight: 700;
}

.readiness-list {
  display: grid;
  gap: 9px;
  color: #475467;
}

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

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid #edf0f5;
  text-align: right;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #f6f8fb;
  color: #475467;
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: #fbfcfe;
}

tbody tr {
  transition: background 160ms ease, opacity 160ms ease;
}

tbody tr:hover {
  background: #f0f6ff;
}

.parent-row {
  cursor: pointer;
  font-weight: 700;
}

.parent-row td:first-child::before {
  content: "- ";
  color: var(--blue);
  font-weight: 900;
}

.parent-row.collapsed td:first-child::before {
  content: "+ ";
}

.hidden-row {
  display: none;
}

.good {
  color: var(--green);
  font-weight: 700;
}

.warn {
  color: var(--amber);
  font-weight: 700;
}

.danger-text {
  color: var(--red);
  font-weight: 700;
}

.indent-1 {
  padding-left: 28px;
  color: #475467;
}

.pill {
  display: inline-flex;
  justify-content: center;
  min-width: 68px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf0f5;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
}

.good-pill {
  background: #e5f5ef;
  color: var(--green);
}

.warn-pill {
  background: #fff1d8;
  color: #955f00;
}

.audit-card {
  min-height: unset;
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.audit-item {
  min-height: 134px;
  padding: 12px;
  border: 1px solid #dfe4ed;
  border-left: 4px solid #8a96aa;
  border-radius: 7px;
  background: var(--panel-2);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.audit-item:hover,
.audit-item:focus {
  transform: translateY(-3px);
  background: #fff;
  box-shadow: 0 12px 24px rgba(21, 31, 52, 0.1);
}

.audit-item span {
  display: block;
  min-height: 35px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.audit-item strong {
  display: block;
  margin: 5px 0 7px;
  font-size: 21px;
}

.audit-item p {
  color: var(--muted);
  font-size: 12px;
}

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

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

.score-list div {
  display: grid;
  grid-template-columns: 86px 1fr 34px;
  gap: 10px;
  align-items: center;
  color: #475467;
}

meter {
  width: 100%;
  height: 12px;
}

.matrix {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  overflow: hidden;
}

.matrix div {
  padding: 11px;
  border-right: 1px solid #edf0f5;
  border-bottom: 1px solid #edf0f5;
}

.matrix-head {
  background: #f6f8fb;
  color: #475467;
  font-weight: 700;
}

.checklist {
  display: grid;
  gap: 13px;
  color: #475467;
}

.checklist p {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--green);
}

.tooltip {
  position: fixed;
  z-index: 20;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid #b9c6da;
  border-radius: 6px;
  background: rgba(23, 32, 51, 0.95);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes metricPulse {
  0% {
    color: var(--ink);
    transform: scale(1);
  }
  50% {
    color: var(--blue);
    transform: scale(1.04);
  }
  100% {
    color: var(--ink);
    transform: scale(1);
  }
}

.check.partial {
  background: var(--amber);
}

.check.blocked {
  background: var(--red);
}

.bottom-space {
  margin-bottom: 10px;
}

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

  .filter-panel {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .brand-block {
    grid-column: 1 / -1;
  }

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

  .two-col,
  .three-col,
  .audit-grid,
  .insight-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard {
    padding: 16px;
  }

  .filter-panel,
  .kpi-grid,
  .two-col,
  .three-col,
  .audit-grid,
  .donut-wrap,
  .insight-strip {
    grid-template-columns: 1fr;
  }

  .report-header {
    display: grid;
  }

  .report-meta {
    justify-content: flex-start;
  }

  .visual-title {
    display: grid;
    gap: 6px;
  }

  .visual-title span {
    text-align: left;
  }

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

  table {
    min-width: 640px;
  }

  .audit-item {
    min-height: auto;
  }
}
