:root {
  color-scheme: light;
  --bg: #f8f8f6;
  --ink: #0c262d;
  --muted: #607276;
  --line: #dfe5e7;
  --panel: #ffffff;
  --sidebar: #ffffff;
  --sidebar-muted: #607276;
  --accent: #d7ff00;
  --accent-strong: #bff000;
  --danger: #d64d40;
  --warn: #a06b00;
  --ok: #0c262d;
  --soft: #eef2f3;
  font-family: "Arial Narrow", "Helvetica Neue Condensed", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

input[type="file"] {
  display: none;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover {
  background: #071a1f;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 0 16px;
  text-transform: uppercase;
}

.file-picker:hover {
  background: #071a1f;
}

input,
select {
  width: min(460px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 34px 22px;
  color: var(--ink);
}

.brand-mark {
  margin: 0;
  color: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.84;
  text-transform: uppercase;
}

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

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-subpages {
  display: grid;
  gap: 2px;
  padding-left: 20px;
}

.nav-subpage {
  display: flex;
  align-items: center;
  min-height: 30px;
  border-left: 4px solid var(--line);
  padding: 5px 10px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.nav-subpage:hover {
  background: var(--soft);
  color: var(--ink);
}

.nav-subpage.active {
  border-left-color: var(--accent);
  background: var(--soft);
  color: var(--ink);
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  border-left: 8px solid transparent;
  border-radius: 0;
  padding: 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.client-subpage-view {
  min-height: 560px;
  padding: 0;
}

.client-page-dashboard {
  display: grid;
  gap: 16px;
}

.client-page-dashboard.loading,
.client-page-dashboard.empty {
  color: var(--muted);
  font-size: 14px;
}

.client-project-status-band {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink);
}

.client-project-status-item {
  display: grid;
  align-content: center;
  min-height: 138px;
  background: var(--panel);
  padding: 20px 22px;
}

.client-project-status-item.primary {
  background: var(--accent);
}

.client-project-status-item span,
.client-margin-item span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-project-status-item strong,
.client-margin-item strong {
  margin-top: 8px;
  color: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
}

.client-margin-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink);
}

.client-margin-item {
  display: grid;
  align-content: center;
  min-height: 150px;
  background: #f1ffd6;
  padding: 22px 26px;
}

.client-margin-item.material {
  background: var(--soft);
}

.client-margin-item small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.client-financial-chart {
  min-height: 390px;
}

.client-financial-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.client-financial-bar.previous {
  fill: var(--ink);
}

.client-financial-bar.current {
  fill: var(--accent);
}

.client-financial-value {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.client-period-label {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.nav-link:hover,
.nav-link.active {
  border-left-color: var(--accent);
  background: var(--soft);
  color: var(--ink);
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.topbar,
.query-header,
.data-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  margin-bottom: 28px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 22px;
}

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

.sidebar .eyebrow {
  color: var(--sidebar-muted);
  margin-top: 18px;
}

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

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
}

.filters {
  margin-bottom: 16px;
}

.date-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  border: 0;
  border-left: 12px solid var(--accent);
  background: var(--panel);
  padding: 18px;
}

.date-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.date-form input {
  width: 170px;
}

.key-figures-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.key-figures-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 8px solid var(--accent);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 14px 18px;
}

.key-figures-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.key-figures-meta p:first-child {
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
}

.key-figures-main {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 0.85fr);
  gap: 1px;
  background: var(--line);
}

.key-figures-financial {
  min-width: 0;
  background: #fff;
  color: var(--ink);
}

.key-figure-financial-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 24px;
  min-height: 178px;
  border-bottom: 1px solid var(--line);
  padding: 24px 28px;
}

.key-figure-label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.key-figure-financial-row > div:first-child > strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
}

.key-figure-financial-row small {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.key-figure-evolution {
  display: grid;
  place-content: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  text-align: center;
}

.key-figure-evolution.negative {
  background: #f6d8d4;
  color: #8c2f27;
}

.key-figure-evolution.neutral {
  background: var(--soft);
  color: var(--muted);
}

.key-figure-evolution span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.key-figure-evolution strong {
  margin-top: 4px;
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: 0;
}

.key-figures-financial-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.key-figures-financial-footer > div {
  min-width: 0;
  min-height: 104px;
  padding: 20px 22px;
}

.key-figures-financial-footer > div:last-child {
  border-right: 0;
}

.key-figures-financial-footer span {
  display: block;
  min-height: 30px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.key-figures-financial-footer strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.key-figures-financial-footer small {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.key-figures-people {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  background: var(--accent);
  color: var(--ink);
}

.key-figure-people-item {
  display: grid;
  align-content: center;
  min-height: 230px;
  border-bottom: 1px solid rgba(12, 38, 45, 0.25);
  padding: 28px;
}

.key-figure-people-item:last-child {
  border-bottom: 0;
}

.key-figure-people-item span {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.key-figure-people-item strong {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
}

.key-figure-people-item.tenure strong {
  font-size: 50px;
}

.key-figure-people-item p {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 800;
}

.key-figure-gender {
  margin-top: 20px;
}

.key-figure-gender-bar {
  display: flex;
  width: 100%;
  height: 12px;
  background: var(--ink);
}

.key-figure-gender-bar span {
  display: block;
  height: 100%;
}

.key-figure-gender-bar .women {
  width: 56.5%;
  background: #fff;
}

.key-figure-gender-bar .men {
  width: 43.5%;
  background: var(--ink);
}

.key-figure-gender-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.key-figure-gender-labels span {
  font-size: 11px;
  line-height: 1.25;
}

.key-figure-gender-labels b {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.key-figures-strip {
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(440px, 1.65fr) minmax(260px, 0.9fr);
  gap: 1px;
  background: var(--ink);
}

.key-figures-objective-panel {
  margin-bottom: 0;
  border-top-color: var(--accent);
}

.key-figure-strip-item {
  min-width: 0;
  min-height: 204px;
  background: var(--panel);
  padding: 24px 26px;
}

.key-figure-strip-item > span {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.key-figure-strip-item.client-count {
  border-top: 8px solid var(--accent);
}

.key-figure-strip-item.client-count strong {
  display: block;
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 70px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
}

.key-figure-strip-item small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.key-figure-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin: 0;
  padding-left: 24px;
}

.key-figure-list li {
  min-width: 0;
  padding-left: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#key-figures-top-suppliers {
  grid-template-columns: 1fr;
  gap: 9px;
}

.client-podium-item {
  min-height: 306px;
  padding-bottom: 18px;
}

.client-podium {
  display: grid;
  gap: 12px;
}

.client-podium-top {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 5px;
  min-height: 218px;
}

.client-podium-place {
  display: grid;
  grid-row: 1;
  grid-template-rows: minmax(68px, auto) 20px var(--podium-height);
  align-items: end;
  min-width: 0;
  text-align: center;
}

.client-podium-place.rank-1 {
  grid-column: 3;
  --podium-height: 84px;
}

.client-podium-place.rank-2 {
  grid-column: 2;
  --podium-height: 66px;
}

.client-podium-place.rank-3 {
  grid-column: 4;
  --podium-height: 52px;
}

.client-podium-place.rank-4 {
  grid-column: 1;
  --podium-height: 38px;
}

.client-podium-place.rank-5 {
  grid-column: 5;
  --podium-height: 30px;
}

.client-podium-place strong {
  align-self: end;
  padding: 0 3px 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.client-podium-place small {
  align-self: start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.client-podium-step {
  display: grid;
  place-items: center;
  height: 100%;
  background: #cbd5d7;
  color: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0;
}

.rank-1 .client-podium-step {
  background: var(--accent);
  font-size: 36px;
}

.rank-3 .client-podium-step {
  background: var(--soft);
}

.rank-4 .client-podium-step,
.rank-5 .client-podium-step {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.client-podium-empty {
  margin: 30px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi-grid,
.chart-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

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

#margin-evolution-view .kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.compact-kpis .kpi strong {
  font-size: 22px;
}

.project-chart-grid {
  align-items: start;
}

.panel {
  margin-bottom: 16px;
  border: 0;
  border-top: 8px solid var(--ink);
  border-radius: 0;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 22px;
}

.kpi {
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  min-height: 138px;
  padding: 18px;
}

.kpi:first-child {
  background: var(--accent);
}

#project-margin-view .kpi:first-child {
  background: var(--panel);
}

.kpi-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: clamp(36px, 4vw, 66px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
}

#kpis .kpi strong {
  font-size: clamp(30px, 3.2vw, 52px);
  white-space: nowrap;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-chart.loading,
.bar-chart.empty {
  color: var(--muted);
  font-size: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 1fr) minmax(82px, auto);
  gap: 10px;
  align-items: center;
}

.bar-axis {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 1fr) minmax(82px, auto);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bar-axis span {
  grid-column: 2;
}

.bar-axis span:nth-child(2) {
  justify-self: center;
}

.bar-axis span:nth-child(3) {
  justify-self: end;
}

.bar-label,
.bar-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.bar-label {
  color: var(--ink);
}

.bar-value {
  color: var(--muted);
  text-align: right;
}

.bar-track {
  height: 20px;
  overflow: hidden;
  border-radius: 0;
  background: var(--line);
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--ink);
}

.bar-fill.negative {
  background: var(--danger);
}

.amount-bar-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.amount-bar-chart.empty {
  color: var(--muted);
  font-size: 14px;
}

.project-client-margin-chart {
  max-height: 720px;
  overflow: auto;
}

.project-client-margin-chart.loading,
.project-client-margin-chart.empty {
  min-height: 220px;
  color: var(--muted);
  font-size: 14px;
}

.project-client-margin-chart svg {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}

.project-client-bar.total {
  fill: var(--accent);
}

.project-client-bar.work {
  fill: var(--ink);
}

.project-client-bar.material {
  fill: #91a1a5;
}

.project-client-bar.previous {
  fill: var(--danger);
}

.project-client-label,
.project-client-total {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.project-client-total,
.project-client-share,
.project-client-evolution {
  font-variant-numeric: tabular-nums;
}

.project-client-share {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.project-client-evolution {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-client-evolution.positive {
  fill: var(--ok);
}

.project-client-evolution.negative {
  fill: var(--danger);
}

.project-client-column-title {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-client-row-line {
  stroke: #edf0f1;
  stroke-width: 1;
}

.project-margin-average-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  background: var(--ink);
}

.project-margin-average-item {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 174px;
  background: var(--accent);
  padding: 24px 28px;
}

.project-margin-average-item span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.project-margin-average-item strong {
  color: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
}

.project-margin-average-item small {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.project-owner-margin-chart {
  min-height: 420px;
  overflow-x: auto;
}

.project-owner-margin-chart.loading,
.project-owner-margin-chart.empty {
  color: var(--muted);
  font-size: 14px;
}

.project-owner-margin-chart svg {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}

.owner-margin-bar.total {
  fill: var(--accent);
}

.owner-margin-bar.work {
  fill: var(--ink);
}

.owner-margin-bar.material {
  fill: #91a1a5;
}

.owner-margin-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.owner-margin-project-count {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bar-svg-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.bar-svg-value {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-warning {
  margin: 0 0 16px;
  border: 0;
  border-left: 12px solid var(--accent);
  border-radius: 0;
  background: #fbffe8;
  padding: 12px 14px;
  color: #745018;
  font-size: 14px;
}

.summary-table-panel {
  border-top-color: var(--accent);
}

.supplier-ranking-panel {
  border-top-color: var(--accent);
}

.summary-table.empty {
  color: var(--muted);
  font-size: 14px;
}

.summary-table table,
.supplier-ranking table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.summary-table th,
.summary-table td,
.supplier-ranking th,
.supplier-ranking td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: right;
}

.summary-table thead th,
.supplier-ranking thead th {
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.supplier-ranking.empty {
  color: var(--muted);
  font-size: 14px;
}

.supplier-ranking thead th:nth-child(1),
.supplier-ranking tbody td:nth-child(1) {
  width: 78px;
  text-align: left;
}

.supplier-ranking thead th:nth-child(2),
.supplier-ranking tbody th {
  text-align: left;
}

.supplier-ranking tbody th {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.supplier-ranking tbody td {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.supplier-ranking tfoot th,
.supplier-ranking tfoot td {
  border-top: 2px solid var(--ink);
  border-bottom: 0;
  background: #f3f6f6;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.supplier-ranking tfoot th {
  text-align: left;
  text-transform: uppercase;
}

.summary-table thead th:not(:first-child)::before {
  content: none;
}

.summary-table tbody th {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.summary-table tbody .indent-row th {
  padding-left: 28px;
  color: var(--muted);
  font-weight: 700;
  text-transform: none;
}

.summary-table tbody td {
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
}

.summary-table td.positive {
  color: var(--ok);
}

.summary-table td.negative {
  color: var(--ink);
}

.supplier-ranking td.positive {
  color: var(--ok);
}

.supplier-ranking td.negative {
  color: var(--ink);
}

.objective-panel {
  border-top-color: var(--accent);
}

.objective-chart.empty {
  color: var(--muted);
  font-size: 14px;
}

.objective-bars {
  display: grid;
  gap: 20px;
}

.objective-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 22px;
  align-items: center;
}

.objective-stack {
  position: relative;
  display: flex;
  height: 64px;
  overflow: hidden;
  background: transparent;
}

.objective-fill {
  display: block;
  height: 100%;
}

.objective-fill.accent {
  background: var(--accent);
}

.objective-fill.muted {
  background: var(--line);
}

.objective-target-gap {
  display: block;
  height: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--accent) 0 4px,
      transparent 4px 10px
    );
}

.objective-ghost-gap {
  display: block;
  height: 100%;
  background: transparent;
}

.objective-realized-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--ink);
  transform: translateX(-50%);
}

.objective-meta {
  display: grid;
  gap: 3px;
  color: var(--ink);
}

.objective-meta strong {
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 32px;
  line-height: 0.95;
}

.objective-meta span {
  font-size: 13px;
  font-weight: 800;
}

.objective-submeta {
  color: var(--muted);
}

.objective-axis-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 22px;
  margin-top: 12px;
}

.objective-axis {
  position: relative;
  border-top: 1px solid var(--ink);
  padding-top: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.objective-axis span {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.objective-axis span:first-child {
  transform: translateX(0);
}

.objective-axis span:last-child {
  transform: translateX(-100%);
}

.objective-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-top: 18px;
  color: var(--ink);
}

.objective-footer span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  line-height: 1;
  text-transform: uppercase;
}

.objective-footer strong {
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.9;
}

.donut-chart {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 250px;
}

#sales-chart-geo,
#sales-chart-work {
  align-items: start;
}

.donut-chart.loading,
.donut-chart.empty,
.column-chart.loading,
.column-chart.empty {
  display: block;
  min-height: 250px;
  color: var(--muted);
  font-size: 14px;
}

.donut-wrap {
  display: grid;
  place-items: center;
}

.donut-wrap svg,
.column-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.donut-total {
  fill: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.donut-caption {
  fill: var(--muted);
  font-size: 11px;
}

.legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 42px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 0;
}

.legend-label {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row strong {
  color: var(--ink);
  font-size: 12px;
}

.column-chart {
  min-height: 250px;
}

.purchase-ledger-comparison {
  min-height: 460px;
  overflow-x: auto;
}

.purchase-ledger-comparison.loading,
.purchase-ledger-comparison.empty {
  display: block;
  min-height: 250px;
  color: var(--muted);
  font-size: 14px;
}

.purchase-ledger-comparison svg {
  display: block;
  width: 100%;
  min-width: 820px;
  height: auto;
}

.purchase-comparison-evolution {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.purchase-ledger-axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.billing-chart {
  min-height: 620px;
  overflow-x: auto;
}

.billing-chart.loading,
.billing-chart.empty {
  display: block;
  min-height: 250px;
  color: var(--muted);
  font-size: 14px;
}

.billing-chart svg {
  display: block;
  width: 100%;
  min-width: var(--billing-chart-width, 980px);
  height: auto;
}

.billing-chart.fit-width {
  min-height: 0;
  overflow-x: hidden;
}

.billing-chart.fit-width svg {
  min-width: 0;
}

.billing-subtitle {
  fill: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 32px;
  font-weight: 900;
}

.billing-bar.previous,
.billing-legend-previous {
  fill: var(--ink);
}

.billing-bar.current,
.billing-legend-current {
  fill: var(--accent);
}

.billing-axis-label {
  fill: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.billing-badge circle {
  fill: #f1ffd6;
}

.billing-badge.negative circle {
  fill: #ffe7e3;
}

.billing-badge-arrow {
  fill: var(--ink);
  font-size: 46px;
  font-weight: 900;
}

.billing-badge-value {
  fill: var(--ink);
  font-family: Impact, "Arial Black", "Helvetica Neue Condensed", sans-serif;
  font-size: 34px;
  font-weight: 900;
}

.line-chart {
  min-height: 320px;
}

.line-chart.loading,
.line-chart.empty {
  display: block;
  min-height: 320px;
  color: var(--muted);
  font-size: 14px;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.line-path {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: square;
  stroke-linejoin: round;
  stroke-width: 5;
}

.line-point {
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 3;
}

.line-point.negative {
  fill: var(--danger);
}

.compare-bar.current {
  fill: var(--accent);
}

.compare-bar.previous {
  fill: var(--ink);
}

.compare-bar.margin {
  fill: var(--accent);
}

.compare-bar.margin.previous {
  stroke: none;
}

.metric-bar.revenue {
  fill: var(--ink);
}

.metric-bar.purchases {
  fill: var(--line);
}

.metric-bar.margin {
  fill: var(--accent);
}

.metric-bar.previous-year {
  stroke: none;
}

.chart-legend text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.wide-chart-panel {
  border-top-color: var(--accent);
}

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

.zero-line {
  stroke: #a9b2ad;
  stroke-width: 1.5;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 0;
  padding: 0 12px;
  font-weight: 700;
}

.waiting {
  background: #eef0ee;
  color: var(--muted);
}

.success {
  background: #e7f4ed;
  color: var(--ok);
}

.error {
  background: #f9e8e6;
  color: var(--danger);
}

.warning {
  background: #fbf0d8;
  color: var(--warn);
}

.config {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 18px 0 0;
}

.config dt {
  color: var(--muted);
  font-size: 13px;
}

.config dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.chips,
.quick-endpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips.empty {
  color: var(--muted);
}

.chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 10px;
  background: #f8faf8;
  color: var(--ink);
  font-size: 13px;
}

.chip:hover {
  border-color: var(--accent);
  background: #edf5f1;
}

#query-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 1 580px;
}

#source {
  margin-top: 4px;
  min-width: min(320px, 100%);
}

.quick-endpoints {
  margin-top: 14px;
}

.import-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.file-status {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.table-preview {
  max-height: 360px;
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
}

.table-preview table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.table-preview th,
.table-preview td {
  max-width: 260px;
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-preview th {
  position: sticky;
  top: 0;
  background: var(--accent);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
}

.target {
  max-width: 58%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

pre {
  min-height: 560px;
  max-height: calc(100vh - 260px);
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17201d;
  padding: 16px;
  color: #eef8f3;
  font-size: 13px;
  line-height: 1.5;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

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

  .workspace {
    width: min(100% - 24px, 1180px);
    padding: 20px 0;
  }

  .topbar,
  .query-header,
  .data-header,
  .date-form,
  #query-form {
    align-items: stretch;
    flex-direction: column;
  }

  .date-form input {
    width: 100%;
  }

  .key-figures-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .key-figures-main,
  .key-figures-strip {
    grid-template-columns: 1fr;
  }

  .key-figures-people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .key-figure-people-item {
    min-height: 190px;
    border-right: 1px solid rgba(12, 38, 45, 0.25);
    border-bottom: 0;
  }

  .key-figure-people-item:last-child {
    border-right: 0;
  }

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

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

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

  .client-project-status-band,
  .client-margin-band {
    grid-template-columns: 1fr;
  }

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

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

  .bar-value {
    text-align: left;
  }

  .donut-chart {
    grid-template-columns: 1fr;
  }

  .donut-wrap svg {
    max-width: 260px;
  }

  .target {
    max-width: 100%;
    white-space: normal;
  }

  pre {
    min-height: 420px;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .key-figure-financial-row {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 14px;
    min-height: 150px;
    padding: 20px;
  }

  .key-figure-financial-row > div:first-child > strong {
    font-size: 38px;
  }

  .key-figure-evolution {
    width: 82px;
    height: 82px;
  }

  .key-figure-evolution strong {
    font-size: 22px;
  }

  .key-figures-financial-footer,
  .key-figures-people {
    grid-template-columns: 1fr;
  }

  .key-figures-financial-footer > div,
  .key-figure-people-item {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .key-figure-people-item {
    border-bottom-color: rgba(12, 38, 45, 0.25);
  }

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

  .client-podium-top {
    min-height: 244px;
  }

  .client-podium-place strong {
    font-size: 10px;
  }
}
