:root {
  --ink: #061244;
  --muted: #607097;
  --faint: #eef3fb;
  --line: #dbe5f2;
  --surface: #ffffff;
  --canvas: #f7faff;
  --nav: #061743;
  --nav-2: #082b63;
  --blue: #2588ff;
  --violet: #6236ff;
  --pink: #f31383;
  --teal: #00a7a7;
  --green: #0db45a;
  --amber: #f4a000;
  --red: #e64566;
  --shadow: 0 18px 45px rgba(24, 46, 93, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.88), rgba(255, 255, 255, 0.95)),
    radial-gradient(circle at top right, rgba(0, 167, 167, 0.09), transparent 34%),
    var(--canvas);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 26px 16px 18px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(6, 23, 67, 0.98), rgba(8, 43, 99, 0.98) 62%, rgba(5, 19, 57, 0.98)),
    var(--nav);
  box-shadow: 18px 0 40px rgba(10, 31, 72, 0.18);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding: 0 8px 14px;
}

.brand-mark,
.assistant-mark {
  position: relative;
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 12px 22px rgba(29, 118, 255, 0.28));
}

.assistant-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
}

.petal {
  position: absolute;
  width: 41px;
  height: 58px;
  border-radius: 26px 26px 30px 8px;
  transform-origin: 50% 78%;
}

.assistant-mark .petal {
  width: 30px;
  height: 43px;
}

.petal-a {
  left: 5px;
  top: 9px;
  background: linear-gradient(145deg, var(--pink), #ad32ff);
  transform: rotate(-26deg);
}

.petal-b {
  left: 22px;
  top: 0;
  background: linear-gradient(145deg, #1ea5ff, #5246ff);
  transform: rotate(2deg);
}

.petal-c {
  left: 35px;
  top: 10px;
  background: linear-gradient(145deg, #7d2cff, #c125dd);
  transform: rotate(33deg);
}

.brand-name {
  color: #fff;
  font-size: 1.42rem;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
  line-height: 1.25;
}

.category-button {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 6px 0;
  padding: 9px 10px;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: transform 170ms ease, background 170ms ease, border-color 170ms ease;
}

.category-button:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.category-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.category-button:disabled:hover {
  transform: none;
  background: transparent;
  border-color: transparent;
}

.category-button.active {
  color: #fff;
  background: linear-gradient(135deg, #245eff, #6d2dff 64%, #f31687);
  box-shadow: 0 14px 26px rgba(61, 53, 255, 0.24);
}

.category-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
}

.category-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-copy {
  min-width: 0;
}

.category-name {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.74rem;
  font-weight: 700;
}

.category-button.active .category-count {
  color: rgba(255, 255, 255, 0.78);
}

.category-list {
  padding-bottom: 16px;
}

.assistant-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 10px 8px 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

.assistant-card strong {
  display: block;
  margin-bottom: 7px;
  color: #fff;
  line-height: 1.16;
}

.assistant-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  line-height: 1.35;
}

.workspace {
  min-width: 0;
  padding: 30px 34px 42px;
}

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

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--pink);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title-block h1 {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.source-line {
  margin: 11px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-field {
  display: grid;
  grid-template-columns: 24px minmax(180px, 390px);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 42, 89, 0.06);
}

.search-field svg,
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-field input {
  width: 100%;
  min-height: 44px;
  border: 0;
  color: var(--ink);
  outline: 0;
}

.search-field input::placeholder {
  color: #6c799d;
}

.icon-button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--violet);
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 42, 89, 0.06);
}

.period-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

.period-button {
  min-width: 94px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 790;
  transition: background 170ms ease, color 170ms ease, transform 170ms ease;
}

.period-button:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.period-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 12px 24px rgba(37, 136, 255, 0.22);
}

.scope-section {
  margin-bottom: 18px;
}

.scope-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.scope-section h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.scope-meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  text-align: right;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.scope-card {
  min-height: 124px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(24, 46, 93, 0.08);
  text-align: left;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.scope-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 54, 255, 0.35);
}

.scope-card.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet) 58%, var(--pink));
  box-shadow: 0 18px 34px rgba(98, 54, 255, 0.22);
}

.scope-card-top,
.scope-card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.scope-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.15;
}

.scope-score {
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 880;
}

.scope-detail,
.scope-focus {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.32;
}

.scope-card.active .scope-detail,
.scope-card.active .scope-focus {
  color: rgba(255, 255, 255, 0.82);
}

.scope-focus {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.kpi-card,
.panel,
.metric-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 156px;
  padding: 18px;
  overflow: hidden;
  animation: floatIn 560ms ease both;
}

.kpi-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.kpi-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: var(--tone, var(--violet));
  background: color-mix(in srgb, var(--tone, var(--violet)) 13%, white);
}

.kpi-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card h3 {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.2;
}

.kpi-value {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: clamp(1.65rem, 2.35vw, 2.55rem);
  line-height: 1;
  font-weight: 860;
  letter-spacing: 0;
}

.kpi-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(300px, 0.9fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: 22px;
  overflow: hidden;
}

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

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

.panel-header.compact {
  margin-bottom: 18px;
}

.panel h2,
.metric-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-note {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.period-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--violet);
  background: #f0edff;
  font-size: 0.78rem;
  font-weight: 850;
}

.chart-stage {
  width: 100%;
  min-height: 342px;
}

.trend-svg {
  width: 100%;
  height: 342px;
  overflow: visible;
}

.grid-line {
  stroke: #e8eef7;
  stroke-width: 1;
}

.axis-label {
  fill: #6d7897;
  font-size: 12px;
  font-weight: 700;
}

.trend-area {
  fill: url(#trendFill);
  opacity: 0.78;
}

.target-line {
  stroke: rgba(0, 167, 167, 0.55);
  stroke-width: 2;
  stroke-dasharray: 8 7;
}

.trend-path {
  fill: none;
  stroke: url(#trendStroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: drawLine 1100ms ease forwards;
}

.trend-dot {
  fill: #fff;
  stroke: var(--violet);
  stroke-width: 3;
  animation: pulseIn 540ms ease both;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) 120deg, var(--amber) 120deg, var(--amber) 230deg, var(--red) 230deg);
  animation: ringSweep 850ms ease both;
}

.donut::after {
  position: absolute;
  inset: 27px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 1.8rem;
  font-weight: 860;
}

.status-legend,
.mover-list,
.bar-list {
  display: grid;
  gap: 12px;
}

.legend-row,
.mover-row,
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
}

.legend-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot);
}

.bar-copy {
  min-width: 0;
}

.bar-copy strong,
.mover-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  width: 100%;
  height: 9px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transform-origin: left center;
  animation: fillBar 760ms ease both;
}

.mover-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.mover-index {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--violet);
  background: #f0edff;
  font-weight: 860;
}

.mover-copy {
  min-width: 0;
}

.mover-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mover-delta,
.delta-positive {
  color: var(--green);
}

.delta-negative {
  color: var(--red);
}

.metric-section {
  margin-top: 20px;
}

.metric-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 12px;
}

.metric-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.metric-header-row,
.metric-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) 116px 100px minmax(150px, 0.75fr) minmax(240px, 1.2fr);
  gap: 16px;
  align-items: center;
}

.metric-header-row {
  min-height: 38px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-rows {
  display: grid;
  gap: 10px;
}

.metric-row {
  min-height: 104px;
  padding: 16px 18px;
  animation: floatIn 460ms ease both;
}

.metric-main {
  min-width: 0;
}

.metric-main h3 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.2;
}

.metric-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.metric-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--status);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.metric-value {
  color: var(--ink);
  font-size: 1.48rem;
  font-weight: 860;
}

.metric-value small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.metric-delta {
  font-weight: 850;
}

.sparkline {
  width: 100%;
  height: 54px;
}

.sparkline path {
  fill: none;
  stroke: var(--violet);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline polyline {
  fill: rgba(37, 136, 255, 0.12);
  stroke: none;
}

.strategic-value {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 750;
  text-align: center;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fillBar {
  from {
    transform: scaleX(0.02);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ringSweep {
  from {
    transform: rotate(-24deg) scale(0.94);
    opacity: 0.2;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1400px) {
  .app-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

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

  .scope-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

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

  .panel-wide {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .metric-header-row,
  .metric-row {
    grid-template-columns: minmax(240px, 1.6fr) 104px 92px minmax(120px, 0.8fr);
  }

  .metric-header-row span:last-child,
  .strategic-value {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
  }

  .workspace {
    padding: 24px 18px 34px;
  }

  .topbar,
  .scope-section-header,
  .metric-section-header {
    display: grid;
  }

  .scope-meta {
    text-align: left;
  }

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

  .toolbar,
  .search-field {
    width: 100%;
  }

  .search-field {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .kpi-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .metric-header-row {
    display: none;
  }

  .metric-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .strategic-value {
    display: block;
  }
}

@media (max-width: 560px) {
  .brand-lockup {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand-name {
    font-size: 1.18rem;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .period-button {
    min-width: calc(50% - 4px);
  }

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

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

@media print {
  .sidebar,
  .toolbar,
  .period-strip {
    display: none;
  }

  .app-shell,
  .dashboard-grid,
  .kpi-grid {
    display: block;
  }

  .workspace {
    padding: 0;
  }

  .panel,
  .kpi-card,
  .metric-row {
    break-inside: avoid;
    box-shadow: none;
  }
}
