:root {
  --wm-azul: #535a75;
  --wm-azul-oscuro: #2d334e;
  --wm-rojo: #cc2d3b;
  --wm-rojo-700: #a6232e;
  --wm-gris: #e2e9ef;
  --wm-negro: #0a0e1a;
  --bg: #fafbfd;
  --bg-soft: #e2e9ef;
  --fg: #2d334e;
  --fg-muted: #535a75;
  --fg-soft: #7a8197;
  --line: #d5dce5;
  --line-soft: #eaeef3;
  --ok: #1f8a5b;
  --warn: #b57810;
  --font-sans: "Poppins", system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(45, 51, 78, 0.05), 0 0 0 1px rgba(45, 51, 78, 0.04);
  --shadow-md: 0 4px 16px rgba(45, 51, 78, 0.08), 0 0 0 1px rgba(45, 51, 78, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 28px 20px;
  background: var(--wm-azul-oscuro);
  color: #fff;
}

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

.brand__mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--wm-azul-oscuro);
  font-weight: 700;
}

.brand__mark::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--wm-azul-oscuro);
  border-radius: 999px;
  background: var(--wm-rojo);
}

.brand__word {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.brand__sub {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.side-nav__item {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-nav__item:hover,
.side-nav__item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.side-meta {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.side-meta span {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.side-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.site-label {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.site-label strong {
  color: #fff;
  line-height: 1.25;
}

.side-meta small {
  display: block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 500;
}

.side-logout {
  width: 100%;
  min-height: 34px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.14);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(45, 51, 78, 0.96), rgba(83, 90, 117, 0.86)),
    var(--bg);
}

.login-panel {
  display: grid;
  width: min(100%, 430px);
  gap: 22px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(10, 14, 26, 0.28);
}

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

.login-brand .brand__mark {
  background: var(--wm-azul-oscuro);
  color: #fff;
}

.login-brand .brand__mark::after {
  border-color: #fff;
}

.login-brand .brand__sub {
  color: var(--fg-soft);
}

.login-panel h1 {
  font-size: 34px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--fg);
}

.login-form input:focus {
  outline: none;
  border-color: var(--wm-azul-oscuro);
  box-shadow: 0 0 0 4px rgba(45, 51, 78, 0.08);
}

.login-form .btn {
  min-height: 44px;
  border-radius: 8px;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(204, 45, 59, 0.22);
  border-radius: 8px;
  background: rgba(204, 45, 59, 0.08);
  color: var(--wm-rojo);
  font-size: 13px;
  font-weight: 600;
}

.login-hint {
  margin: 0;
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 500;
}

.main {
  width: min(1480px, 100%);
  padding: 30px 36px 60px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.96)),
    #fff;
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  color: var(--wm-rojo);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-title {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.framed-label {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(45, 51, 78, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(45, 51, 78, 0.04);
}

.framed-label::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.framed-label--red {
  border-color: rgba(204, 45, 59, 0.22);
  background: rgba(204, 45, 59, 0.045);
  color: var(--wm-rojo);
}

.dashboard-title-frame {
  display: inline-block;
  max-width: 100%;
  padding: 9px 18px 12px;
  border: 1px solid rgba(45, 51, 78, 0.13);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.section-heading-frame {
  display: grid;
  width: fit-content;
  min-width: 220px;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.section-heading-frame h2 {
  margin-top: 0;
}

h1,
h2 {
  margin: 0;
  color: var(--fg);
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
}

h2 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.15;
}

.filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.filters label {
  display: grid;
  gap: 3px;
}

.filters label.is-hidden {
  display: none;
}

.filters span {
  padding-left: 10px;
  color: var(--fg-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.filters select,
.filters input {
  width: 104px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--fg);
  padding: 0 12px;
}

.filters .filter-mode {
  width: 132px;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--wm-azul-oscuro);
  box-shadow: 0 0 0 4px rgba(45, 51, 78, 0.07);
}

.btn {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn-dark {
  background: var(--wm-azul-oscuro);
  color: #fff;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.64;
}

.tab-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 10px;
}

.status-bar {
  min-height: 32px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.status-bar:empty {
  display: none;
}

.status-bar:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-bar:not(:empty)::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.status-bar[data-source="loading"] {
  color: var(--wm-azul-oscuro);
}

.status-bar[data-source="fallback"] {
  color: var(--wm-rojo);
}

.loading-signature {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid rgba(45, 51, 78, 0.18);
  border-left: 4px solid var(--wm-rojo);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.loading-signature[hidden] {
  display: none;
}

.loading-signature__mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--wm-azul-oscuro);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.loading-signature__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.loading-signature__text strong {
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
}

.loading-signature__text small {
  color: var(--fg-soft);
  font-size: 11px;
}

.loading-signature__dots {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.loading-signature__dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--wm-rojo);
  animation: loading-dot 0.9s ease-in-out infinite;
}

.loading-signature__dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-signature__dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loading-dot {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.skeleton-line,
.skeleton-block {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2f6 0%, #f8fafc 45%, #eef2f6 90%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.15s linear infinite;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line--sm {
  width: 42%;
}

.skeleton-line--md {
  width: 68%;
}

.skeleton-line--lg {
  width: 86%;
}

.skeleton-block {
  height: 176px;
  border-radius: 12px;
}

.skeleton-value {
  width: 68%;
  height: 36px;
  border-radius: 8px;
}

.kpi-card.is-loading,
.panel.is-loading {
  position: relative;
}

.loading-table-row td {
  padding: 10px 12px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 220% 0;
  }
  100% {
    background-position: -220% 0;
  }
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.summary-layout {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.kpi-rail {
  display: grid;
  gap: 14px;
}

.kpi-card,
.panel {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.kpi-card {
  display: grid;
  gap: 12px;
  min-height: 136px;
  padding: 20px;
}

.kpi-card__label {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
}

.kpi-card__value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--fg);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.kpi-card__unit {
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 500;
}

.kpi-card__help {
  max-width: 210px;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.outlier-box,
.range-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: rgba(204, 45, 59, 0.1);
  color: var(--wm-rojo);
  font-size: 12px;
  font-weight: 600;
}

.outlier-box {
  padding: 7px 10px;
}

.range-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
}

.context-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.outlier-box::before,
.range-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

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

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

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

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

.chart {
  position: relative;
  min-height: 250px;
}

.chart--donut {
  display: grid;
  justify-content: center;
  align-items: center;
}

.chart svg {
  display: block;
  width: 100%;
  min-height: 230px;
}

.axis-label {
  fill: var(--fg-soft);
  font-size: 11px;
  font-weight: 500;
}

.bar-label {
  fill: var(--fg);
  font-size: 11px;
  font-weight: 600;
}

.bar-label--compact {
  font-size: 10px;
}

.bar-hover-target {
  cursor: pointer;
  outline: none;
}

.bar-hover-target rect {
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.bar-hover-target:hover rect,
.bar-hover-target:focus rect {
  filter: drop-shadow(0 4px 8px rgba(45, 51, 78, 0.22));
  opacity: 0.88;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 3px;
  min-width: 132px;
  max-width: 220px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--wm-azul-oscuro);
  color: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

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

.chart-tooltip strong,
.chart-tooltip span,
.chart-tooltip small {
  display: block;
}

.chart-tooltip strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.chart-tooltip__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.chart-tooltip span {
  font-size: 13px;
  font-weight: 600;
}

.chart-tooltip small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 500;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
  justify-content: center;
  width: min(100%, 430px);
}

.donut-total {
  display: grid;
  width: fit-content;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f7f9fb;
}

.donut-total span {
  color: var(--fg-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.donut-total strong {
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.donut {
  position: relative;
  display: grid;
  width: 160px;
  height: 160px;
  place-items: center;
  border-radius: 50%;
}

.donut::after {
  content: "";
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.donut__center {
  position: absolute;
  z-index: 1;
  inset: 35px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 50%;
  color: var(--fg);
  text-align: center;
}

.donut__center-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.donut__center span {
  display: block;
  max-width: 76px;
  overflow: hidden;
  color: var(--fg-muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard {
  display: grid;
  gap: 12px;
}

.donut-wrap .legend-item {
  align-items: flex-start;
}

.donut-wrap .legend-item > span {
  display: grid;
  gap: 2px;
}

.legend-delta {
  display: block;
  color: var(--fg-soft);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.leader-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
}

.leader-rank {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(213, 42, 54, 0.1);
  color: var(--wm-rojo);
  font-size: 11px;
  font-weight: 700;
}

.leader-label {
  overflow: hidden;
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-track {
  position: relative;
  height: 9px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-soft);
}

.leader-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--wm-rojo);
}

.leader-value {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.leader-subvalue {
  margin-top: 4px;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 500;
}

.actions-panel {
  min-height: 420px;
}

.action-list {
  display: grid;
  gap: 12px;
}

.action-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--wm-azul);
  border-radius: 12px;
  background: #fff;
}

.action-card--high {
  border-left-color: var(--wm-rojo);
}

.action-card--medium {
  border-left-color: #d8951f;
}

.action-card--info {
  border-left-color: var(--wm-azul);
}

.action-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.priority-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: rgba(45, 51, 78, 0.08);
  color: var(--fg);
  padding: 5px 8px;
}

.action-card--high .priority-pill {
  background: rgba(204, 45, 59, 0.1);
  color: var(--wm-rojo);
}

.action-card h3 {
  margin: 0;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.35;
}

.action-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.action-card__footer {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--fg-soft);
  font-size: 12px;
}

.action-card__footer strong {
  color: var(--fg);
}

.goals-panel {
  min-height: 420px;
}

.traffic-light-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.traffic-light-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 252px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--wm-azul);
  border-radius: 12px;
  background: #fff;
}

.traffic-light-card--green {
  border-top-color: var(--ok);
}

.traffic-light-card--yellow {
  border-top-color: var(--warn);
}

.traffic-light-card--red {
  border-top-color: var(--wm-rojo);
}

.traffic-light-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.traffic-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--wm-azul);
  box-shadow: 0 0 0 4px rgba(83, 90, 117, 0.12);
}

.traffic-light-card--green .traffic-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(31, 138, 91, 0.12);
}

.traffic-light-card--yellow .traffic-dot {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(181, 120, 16, 0.13);
}

.traffic-light-card--red .traffic-dot {
  background: var(--wm-rojo);
  box-shadow: 0 0 0 4px rgba(204, 45, 59, 0.12);
}

.traffic-light-card h3 {
  margin: 0;
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.traffic-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.traffic-value strong {
  color: var(--fg);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.traffic-value span {
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 600;
}

.traffic-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.traffic-meta div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.traffic-meta dt,
.traffic-meta dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.traffic-meta dt {
  color: var(--fg-soft);
  font-weight: 600;
}

.traffic-meta dd {
  color: var(--fg-muted);
  font-weight: 500;
}

.traffic-light-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.capacity-panel {
  min-height: 560px;
}

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

.capacity-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f9fbfd;
}

.capacity-block--wide {
  grid-column: span 2;
}

.capacity-block--risk {
  display: grid;
  gap: 12px;
  background: #fff;
}

.capacity-block--high {
  border-color: rgba(204, 45, 59, 0.32);
}

.capacity-block--medium {
  border-color: rgba(181, 120, 16, 0.32);
}

.capacity-block--low {
  border-color: rgba(31, 138, 91, 0.26);
}

.capacity-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.capacity-block__head span,
.capacity-block h3,
.capacity-metrics dt,
.capacity-table__row--head {
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.capacity-block__head strong {
  color: var(--fg);
  font-size: 26px;
  font-weight: 700;
}

.capacity-block p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.capacity-metrics {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
}

.capacity-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.capacity-metrics dd {
  margin: 0;
  text-align: right;
}

.capacity-metrics strong {
  display: block;
  color: var(--fg);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.capacity-metrics span {
  display: block;
  margin-top: 4px;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 600;
}

.capacity-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.capacity-list--companies {
  padding-left: 0;
  list-style: none;
}

.capacity-list--companies li {
  display: grid;
  gap: 3px;
}

.capacity-list--companies strong {
  color: var(--fg);
  font-size: 12px;
}

.capacity-list--companies span {
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 600;
}

.capacity-table {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.capacity-table__row {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(48px, auto));
  gap: 10px;
  align-items: center;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.capacity-table__row strong {
  color: var(--wm-rojo);
  text-align: right;
}

.capacity-table__row span:not(:first-child) {
  text-align: right;
}

.capacity-recommendations {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.capacity-recommendations article {
  padding-left: 12px;
  border-left: 3px solid var(--wm-rojo);
}

.capacity-recommendations strong {
  display: block;
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
}

.capacity-recommendations p {
  margin-top: 4px;
}

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

.detail-card {
  min-height: 340px;
}

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

.table-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.table-note strong {
  color: var(--fg);
  font-weight: 700;
}

.table-note__list {
  margin: 0;
  padding-left: 16px;
}

.table-note__list li + li {
  margin-top: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

td strong {
  color: var(--fg);
  font-weight: 600;
}

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

.metric-item {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(45, 51, 78, 0.02);
}

.metric-item span {
  display: block;
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 500;
}

.metric-item strong {
  display: block;
  margin-top: 8px;
  color: var(--fg);
  font-size: 24px;
  font-weight: 700;
}

.empty-state {
  display: grid;
  min-height: 210px;
  place-items: center;
  color: var(--fg-soft);
  font-size: 13px;
}

.empty-state--compact {
  min-height: auto;
  padding: 18px;
  text-align: center;
}

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

  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
  }

  .side-nav {
    grid-auto-flow: column;
    margin-left: auto;
  }

  .side-meta {
    display: none;
  }

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

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

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

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

@media (max-width: 980px) {
  .main {
    padding: 24px 18px 44px;
  }

  .topbar,
  .filters,
  .tab-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    border-radius: 18px;
  }

  .filters label,
  .filters select,
  .filters input,
  .filters button {
    width: 100%;
  }

  .chart-grid,
  .detail-grid,
  .capacity-grid,
  .traffic-light-list,
  .kpi-rail {
    grid-template-columns: 1fr;
  }

  .panel--wide,
  .capacity-block--wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .side {
    flex-wrap: wrap;
  }

  .side-nav {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    margin-left: 0;
  }

  .panel__head {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-list,
  .donut-wrap {
    grid-template-columns: 1fr;
  }
}
