:root {
  --ink: #19211f;
  --muted: #68726e;
  --paper: #f4f2ec;
  --surface: #fffdf8;
  --line: #dedbd2;
  --forest: #143d35;
  --forest-2: #1f574b;
  --lime: #c8ef78;
  --coral: #ec745f;
  --gold: #d5a83f;
  --blue: #5c83a9;
  --platinum: #244d45;
  --shadow: 0 18px 50px rgba(25, 33, 31, 0.08);
  --radius: 20px;
  --kpi-main-value-font-size: clamp(15px, 1.26vw, 19.2px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Arial", sans-serif;
}

button,
select,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px 22px;
  color: #f9f7f0;
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 239, 120, 0.18), transparent 32%),
    var(--forest);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--forest);
  border-radius: 13px;
  background: var(--lime);
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 8px;
  margin-top: 52px;
}

.nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  font-size: 13px;
  text-decoration: none;
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 var(--lime);
}

.nav-item.is-disabled {
  opacity: 0.45;
}

.nav-icon {
  color: var(--lime);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-note {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-note strong {
  display: block;
  margin: 6px 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17px;
}

.sidebar-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.55;
}

.dashboard {
  width: 100%;
  max-width: 1660px;
  padding: 34px 38px 24px;
  margin: 0 auto;
}

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

.topbar h1 {
  margin: 4px 0 6px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.subtitle {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
}

.data-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  color: var(--forest);
  border: 1px solid #c9d7d2;
  border-radius: 999px;
  background: #edf5f1;
  font-size: 11px;
  font-weight: 700;
}

.data-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f9d75;
  box-shadow: 0 0 0 4px rgba(79, 157, 117, 0.14);
}

.icon-button,
.text-button {
  color: var(--forest);
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 18px;
}

.text-button {
  padding: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.filter-panel {
  margin-top: 28px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.74);
  box-shadow: 0 8px 30px rgba(25, 33, 31, 0.04);
}

.filter-heading {
  align-items: center;
}

.filter-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0 0;
  padding: 7px 10px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 11px;
  transition:
    color 260ms ease,
    border-color 260ms ease,
    background-color 260ms ease,
    box-shadow 260ms ease,
    transform 260ms ease;
}

.filter-summary strong {
  color: inherit;
  font-weight: 750;
}

.filter-summary.scope-tone-green {
  color: #185c35;
  border-color: #78b98b;
  background: #e4f5e7;
  box-shadow: 0 3px 10px rgba(49, 125, 76, 0.12);
}

.filter-summary.scope-tone-purple {
  color: #5e368a;
  border-color: #b396d1;
  background: #f1e9fa;
  box-shadow: 0 3px 10px rgba(105, 67, 145, 0.14);
}

.filter-summary.scope-tone-blue {
  color: #245f91;
  border-color: #86b8df;
  background: #e5f2fc;
  box-shadow: 0 3px 10px rgba(46, 120, 177, 0.14);
}

.filter-summary.scope-flash {
  animation: scope-update-flash 620ms ease;
}

@keyframes scope-update-flash {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.025);
    box-shadow: 0 0 0 5px rgba(31, 87, 75, 0.1);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .filter-summary {
    transition: none;
  }

  .filter-summary.scope-flash {
    animation: none;
  }
}

.filters {
  display: grid;
  grid-template-columns: 0.9fr 1.05fr 1.25fr 1fr 0.72fr;
  gap: 12px;
  align-items: start;
  margin-top: 14px;
}

.filters label > span,
.filter-action > span {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-action {
  min-width: 154px;
}

.reload-button {
  width: 100%;
  height: 43px;
  padding: 0 14px;
  color: #fff;
  border: 1px solid var(--forest-2);
  border-radius: 11px;
  background: var(--forest-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: 150ms ease;
}

.reload-button.has-changes {
  box-shadow: 0 0 0 4px rgba(31, 87, 75, 0.12);
}

.reload-button:hover:not(:disabled) {
  background: var(--forest);
  transform: translateY(-1px);
}

.reload-button:focus-visible {
  outline: 3px solid rgba(200, 239, 120, 0.7);
  outline-offset: 2px;
}

.reload-button:disabled {
  color: #7b8581;
  border-color: #d9ddd9;
  background: #ecefeb;
  cursor: default;
}

.filter-action small {
  display: block;
  min-height: 14px;
  margin: 5px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

select {
  width: 100%;
  height: 43px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface);
  cursor: pointer;
}

select:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(31, 87, 75, 0.1);
}

.query-section-heading {
  margin-top: 48px;
}

.query-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 0.36fr) minmax(0, 1fr);
  gap: 22px;
  padding: 0;
  overflow: hidden;
}

.query-controls {
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #f8f6f0;
}

.query-template-field,
.query-parameters label {
  display: grid;
  gap: 6px;
}

.query-template-field {
  margin-top: 20px;
}

.query-template-field > span,
.query-parameters label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.query-parameters {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.query-parameters input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface);
}

.query-parameters input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(31, 87, 75, 0.1);
}

.query-run-button {
  margin-top: 16px;
}

.query-export-button {
  width: 100%;
  height: 43px;
  margin-top: 8px;
  padding: 0 14px;
  color: var(--forest-2);
  border: 1px solid var(--forest-2);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: 150ms ease;
}

.query-export-button:hover:not(:disabled) {
  color: #fff;
  background: var(--forest-2);
  transform: translateY(-1px);
}

.query-export-button:focus-visible {
  outline: 3px solid rgba(200, 239, 120, 0.7);
  outline-offset: 2px;
}

.query-export-button:disabled {
  color: #7b8581;
  border-color: #d9ddd9;
  background: #ecefeb;
  cursor: default;
}

.query-safety-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.query-status.is-connected {
  color: #185c35;
  background: #e4f5e7;
}

.query-result {
  min-width: 0;
  padding: 20px 20px 20px 0;
}

.query-result-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.query-result-heading > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.query-result-heading strong {
  font-size: 13px;
}

.query-result-heading span {
  color: var(--muted);
  font-size: 10px;
}

.query-table-wrap {
  min-height: 260px;
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.query-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  white-space: nowrap;
}

.query-table-wrap th,
.query-table-wrap td {
  padding: 10px 12px;
  border-right: 1px solid #eeeae1;
  border-bottom: 1px solid #eeeae1;
  text-align: left;
}

.query-table-wrap th {
  position: sticky;
  top: 0;
  color: var(--forest);
  background: #eef3ef;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.query-empty-state {
  display: grid;
  min-height: 258px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.query-error-state {
  color: var(--coral);
}

.scope-note {
  margin-top: 12px;
  padding: 11px 13px;
  color: #5e5849;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #fbf5e7;
  font-size: 11px;
  line-height: 1.5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 18px;
}

.kpi-group-label {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.kpi-group-label:first-child {
  margin-top: 0;
}

.kpi-card,
.loading-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 9px 25px rgba(25, 33, 31, 0.045);
}

.loading-card {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  position: absolute;
  right: -18px;
  bottom: -30px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(200, 239, 120, 0.16);
  content: "";
}

.kpi-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-info,
.info-button {
  display: inline-grid;
  flex: none;
  place-items: center;
  color: var(--forest-2);
  border: 1px solid #c9d7d2;
  border-radius: 50%;
  background: #f4f8f6;
  cursor: help;
  font-family: Arial, sans-serif;
  font-weight: 800;
  text-transform: none;
}

.card-info {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.info-button {
  width: 25px;
  height: 25px;
  font-size: 11px;
}

.card-info:focus-visible,
.info-button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.kpi-value {
  margin: 8px 0 6px;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 650;
  font-size: var(--kpi-main-value-font-size);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.kpi-comparisons {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  font-size: 10px;
}

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

.kpi-comparison {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding-right: 12px;
}

.kpi-comparison + .kpi-comparison {
  padding-right: 0;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.kpi-comparison > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.kpi-comparison strong,
.delta-ratio,
.delta-icon {
  font-weight: 700;
}

.kpi-comparison.positive {
  color: #16834f;
}

.kpi-comparison.negative {
  color: var(--coral);
}

.kpi-comparison.neutral {
  color: #75807c;
}

.delta-icon {
  min-width: 10px;
  font-size: 14px;
  line-height: 1;
}

.attention-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.attention-items {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.attention-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 7px;
  align-items: baseline;
  font-size: 10px;
  line-height: 1.3;
}

.attention-item > span {
  color: var(--muted);
  font-weight: 700;
}

.attention-item p {
  margin: 0;
}

.attention-item p {
  color: var(--ink);
}

.attention-item.positive .attention-delta {
  color: #16834f;
}

.attention-item.negative .attention-delta {
  color: var(--coral);
}

.attention-item.neutral .attention-delta,
.attention-neutral {
  color: #75807c;
}

.attention-delta {
  white-space: nowrap;
}

.comparison-label {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.25;
}

.section-heading {
  align-items: end;
  margin: 42px 0 15px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.section-heading > p {
  max-width: 410px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.chart-grid {
  display: grid;
  gap: 14px;
}

.chart-grid--wide {
  grid-template-columns: 1.1fr 0.9fr;
}

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

.panel {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.panel-heading {
  align-items: flex-start;
}

.panel-heading h3 {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.status-tag {
  flex: none;
  padding: 5px 7px;
  color: #755b1f;
  border-radius: 6px;
  background: #fbf0ce;
  font-size: 9px;
  font-weight: 800;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 7px;
  border-radius: 2px;
}

.legend-swatch--bar {
  background: #d8e6df;
}

.legend-swatch--profit {
  background: var(--forest-2);
}

.legend-swatch--line {
  height: 0;
  border-top: 2px solid var(--coral);
  border-radius: 0;
}

.chart {
  height: 250px;
  margin-top: 6px;
}

#revenue-chart,
#profit-chart {
  height: 286px;
}

.chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 9px;
}

.chart .gridline {
  stroke: #ebe7de;
  stroke-width: 1;
}

.chart .area {
  fill: url("#area-fill");
}

.chart .line {
  fill: none;
  stroke: var(--forest-2);
  stroke-width: 2.5;
}

.chart .line-secondary {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2;
}

.chart .bar {
  fill: #d8e6df;
}

.chart .bar-profit {
  fill: var(--forest-2);
}

.chart .bar-negative {
  fill: var(--coral);
}

.chart .line-point {
  fill: var(--surface);
  stroke: var(--coral);
  stroke-width: 2;
}

.chart .chart-target {
  cursor: help;
  transition: opacity 120ms ease;
}

.chart .chart-target:hover,
.chart .chart-target:focus {
  opacity: 0.72;
  outline: none;
}

.chart .data-label {
  fill: var(--ink);
  font-size: 8px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
}

.chart .data-label--growth {
  fill: #b44e3e;
}

.chart .axis-unit {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.chart .axis-month {
  fill: var(--ink);
  font-size: 8px;
  font-weight: 600;
}

.chart .axis-year {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.chart .axis-year-bracket {
  fill: none;
  stroke: #cfc9bd;
  stroke-width: 1;
}

.chart .axis-year-divider {
  stroke: #a9c3c0;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  opacity: 0.85;
}

.chart .axis-title {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 700;
}

.inline-scope {
  margin: 5px 0 0;
  color: #8b6f2f;
  font-size: 9px;
}

.contributor-table {
  margin-top: 16px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) 2.5fr 0.8fr 0.8fr;
  gap: 14px;
  align-items: center;
}

.table-head {
  padding: 0 10px 9px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-row {
  padding: 12px 10px;
  border-bottom: 1px solid #eeeae1;
  font-size: 11px;
}

.table-row:last-child {
  border-bottom: 0;
}

.category-name strong,
.category-name small {
  display: block;
}

.category-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.revenue-bar {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 6px;
  background: #efede6;
}

.revenue-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-2);
}

.revenue-bar span {
  position: absolute;
  top: 4px;
  left: 8px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.positive {
  color: #277157;
  font-weight: 750;
}

.warning {
  color: #a7682a;
  font-weight: 750;
}

.negative {
  color: #bd5242;
  font-weight: 750;
}

.donut-layout {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 250px;
}

.donut {
  position: relative;
  width: 145px;
  height: 145px;
  border-radius: 50%;
}

.donut::after {
  position: absolute;
  inset: 27px;
  display: grid;
  place-items: center;
  color: var(--forest);
  border-radius: 50%;
  background: var(--surface);
  content: "Cơ cấu\A doanh thu";
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  white-space: pre;
}

.legend {
  display: grid;
  gap: 11px;
}

.legend-item {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 10px;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-item span {
  color: var(--muted);
}

.rank-bars {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.rank-row {
  display: grid;
  grid-template-columns: 88px 1fr 39px;
  gap: 10px;
  align-items: center;
  font-size: 10px;
}

.rank-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8df;
}

.track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-2);
}

.rank-row.risk .track i {
  background: var(--coral);
}

.rank-row strong {
  text-align: right;
}

.insight-panel {
  color: #fff;
  border-color: var(--forest);
  background:
    radial-gradient(circle at 100% 0%, rgba(200, 239, 120, 0.13), transparent 35%),
    var(--forest);
}

.insight-panel .panel-heading p {
  color: rgba(255, 255, 255, 0.6);
}

.insight-content {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.insight-item {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.insight-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.insight-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--lime);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.insight-item p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  line-height: 1.55;
}

footer {
  margin-top: 32px;
  padding: 20px 22px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

footer p {
  margin: 0;
}

.portfolio-details {
  display: grid;
  gap: 5px;
}

.portfolio-details strong {
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
}

.portfolio-label {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portfolio-author {
  color: var(--ink);
  font-weight: 600;
}

.portfolio-author a {
  color: var(--green);
  text-decoration: none;
}

.portfolio-author a:hover,
.portfolio-author a:focus-visible {
  text-decoration: underline;
}

.portfolio-period {
  flex: 0 0 auto;
  padding-top: 3px;
  font-weight: 700;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 11px 15px;
  color: #fff;
  border-radius: 10px;
  background: var(--forest);
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip,
.info-tooltip {
  position: fixed;
  z-index: 20;
  display: grid;
  min-width: 180px;
  gap: 3px;
  padding: 10px 12px;
  color: #fff;
  border-radius: 9px;
  background: rgba(20, 61, 53, 0.96);
  box-shadow: var(--shadow);
  font-size: 10px;
  pointer-events: none;
}

.info-tooltip {
  z-index: 30;
  max-width: min(310px, calc(100vw - 24px));
  padding: 11px 13px;
  color: #fff;
  line-height: 1.45;
}

.chart-tooltip[hidden],
.info-tooltip[hidden] {
  display: none;
}

.chart-tooltip strong {
  color: var(--lime);
  font-size: 9px;
}

.chart-tooltip span {
  color: rgba(255, 255, 255, 0.72);
}

.chart-tooltip b {
  margin-top: 2px;
  font-size: 12px;
}

.error-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--coral);
  font-size: 12px;
  text-align: center;
}

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

  .dashboard {
    padding-inline: 25px;
  }

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

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

  .filter-action {
    grid-column: 4;
  }

  .query-workspace {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .donut-layout {
    grid-template-columns: 115px 1fr;
  }

  .donut {
    width: 115px;
    height: 115px;
  }

  .donut::after {
    inset: 23px;
  }
}

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

  .sidebar {
    padding: 22px 10px;
  }

  .brand {
    justify-content: center;
  }

  .brand > span:not(.brand-mark),
  .sidebar-note {
    display: none;
  }

  .main-nav {
    margin-top: 32px;
  }

  .nav-item {
    justify-content: center;
    padding-inline: 8px;
    font-size: 0;
  }

  .nav-icon {
    font-size: 10px;
  }

  .dashboard {
    padding: 24px 18px;
  }

  .topbar h1 {
    font-size: clamp(30px, 5.5vw, 42px);
  }

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

  .filter-action {
    grid-column: auto;
  }

  .chart-grid,
  .chart-grid--wide,
  .chart-grid--three,
  .query-workspace {
    grid-template-columns: 1fr;
  }

  .query-result {
    padding: 0 18px 18px;
  }

  .section-heading {
    display: grid;
  }

  .section-heading > p {
    max-width: none;
  }
}

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

  .sidebar {
    display: none;
  }

  .topbar,
  .filter-heading,
  footer {
    display: grid;
  }

  .portfolio-period {
    padding-top: 8px;
    white-space: normal;
  }

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