@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --bg: #090d16;
  --bg-soft: #0e1322;
  --surface: #151b2c;
  --surface-soft: #1d253b;
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.15);
  --sidebar: #0e1322;
  --sidebar-soft: #151b2c;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --sidebar-width: 292px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #090d16 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  padding: 22px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, var(--sidebar), #171c20);
  background-color: #171c20;
  color: #eef3ef;
  z-index: 20;
}

.sidebar-brand {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
  padding: 0 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.sidebar-brand span {
  color: #aab6ad;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #dfe7e1;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--sidebar-soft);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-link.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-label {
  font-size: 14px;
  font-weight: 700;
}

.nav-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.shell-main {
  min-width: 0;
  margin-left: var(--sidebar-width);
  max-width: calc(100vw - var(--sidebar-width));
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.shell-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(9, 13, 22, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.shell-headline {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shell-headline h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

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

.shell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.view-root {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 22px 24px 32px;
}

.page {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.page > * {
  min-width: 0;
  max-width: 100%;
}

.page-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 4px;
}

.page-intro h2 {
  margin: 0 0 5px;
  font-size: 22px;
  line-height: 1.2;
}

.page-intro p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

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

h1,
h2,
h3 {
  margin: 0;
}

#meta,
.meta-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.toolbar,
.filters,
.page-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.dashboard-filter-panel {
  margin-bottom: 2px;
  background: var(--surface);
}

.dashboard-filters {
  width: 100%;
}

label {
  display: flex;
  flex: 1 1 150px;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

select,
button,
input {
  max-width: 100%;
  height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
}

select:focus,
button:focus,
input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  outline-offset: 1px;
}

button {
  cursor: pointer;
  border-color: #1f5cc0;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

button:hover {
  background: #1d4ed8;
}

.ghost-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.cards,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr));
  gap: 12px;
}

.summary-kpi-stack {
  display: grid;
  gap: 16px;
}

.summary-primary-kpis-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.summary-primary-kpi-panel {
  min-width: 0;
}

.summary-primary-kpi-panel .kpi-hero {
  height: 100%;
}

.summary-team-kpis {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.summary-team-kpis-header {
  margin-bottom: 12px;
}

.summary-team-kpis-header span {
  display: inline-block;
  color: #8e96a8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-page .page-intro {
  padding-bottom: 0;
}

.summary-page .page-intro h2 {
  font-size: 20px;
}

.summary-page .page-intro p {
  font-size: 13px;
  max-width: 760px;
}

.summary-page .kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.summary-page .kpi-card {
  padding: 12px;
}

.summary-page .kpi-card .value {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.05;
}

.summary-page .kpi-card .label {
  font-size: 10px;
}

.summary-page .kpi-label-main {
  font-size: 12px;
}

.summary-page .kpi-label-sub {
  font-size: 9px;
}

.summary-page .chart-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-page .chart-card,
.summary-page .table-card {
  padding: 14px;
}

.summary-page .chart-card {
  min-height: 230px;
}

.summary-page .chart-card.is-pie {
  min-height: 248px;
}

.summary-page .chart-card h3,
.summary-page .table-card h3 {
  font-size: 15px;
}

.summary-page .chart-card p,
.summary-page .table-card p {
  font-size: 11px;
}

.summary-page .pie-layout {
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 14px;
}

.summary-page .pie-chart {
  width: min(148px, 100%);
}

.summary-page .pie-chart span {
  width: 72px;
  font-size: 12px;
}

.summary-page .table-card table {
  min-width: 980px;
}

.summary-page .table-card thead th {
  font-size: 10px;
  padding: 9px 8px;
}

.summary-page .table-card tbody td {
  padding: 9px 8px;
  font-size: 11px;
  line-height: 1.35;
}

.summary-page .table-card .muted-line {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.3;
}

.summary-page #summary-table-wrap .table-card table {
  min-width: 2580px;
  table-layout: fixed;
}

.summary-page #summary-table-wrap .table-card thead th,
.summary-page #summary-table-wrap .table-card tbody td {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  vertical-align: middle;
}

.summary-page #summary-table-wrap .table-card thead th {
  line-height: 1.18;
}

.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(1) { width: 86px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(2) { width: 126px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(3) { width: 190px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(4) { width: 300px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(5) { width: 116px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(6) { width: 180px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(7) { width: 154px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(8) { width: 154px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(9) { width: 132px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(10) { width: 136px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(11) { width: 146px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(12) { width: 154px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(13) { width: 136px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(14) { width: 150px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(15) { width: 154px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(16) { width: 180px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(17) { width: 164px; }
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(18) { width: 176px; }

.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(1),
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(2),
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(5),
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(7),
.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(8) {
  white-space: nowrap;
}

.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(n+10) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.summary-page #summary-table-wrap .table-card :is(th, td):nth-child(9) {
  text-align: center;
}

.summary-detail-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.summary-detail-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}

.summary-detail-filters select {
  height: 34px;
  font-size: 12px;
  padding: 0 10px;
}

@media (max-width: 1180px) {
  .summary-primary-kpis-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .summary-page .chart-grid,
  .summary-page .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.card,
.kpi-card,
.chart-card,
.table-card,
.panel {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card,
.kpi-card {
  position: relative;
  padding: 15px;
  overflow: hidden;
}

.card::before,
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.kpi-card:nth-child(2n)::before { background: var(--ok); }
.kpi-card:nth-child(3n)::before { background: #f59e0b; }
.kpi-card:nth-child(4n)::before { background: #ef4444; }

.card .label,
.kpi-card .label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
  line-height: 1.15;
}

.kpi-label-main,
.kpi-label-sub {
  display: block;
}

.kpi-label-main {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.kpi-label-sub {
  margin-top: 2px;
  color: #8e96a8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 0.9;
}

.card .value,
.kpi-card .value {
  margin-top: 8px;
  font-size: 25px;
  line-height: 1.12;
  font-weight: 800;
  color: var(--ink);
}

.kpi-card .helper {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.panel,
.chart-card,
.table-card {
  padding: 16px;
}

.panel-grid,
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: 14px;
}

.chart-card {
  min-height: 260px;
}

.chart-card.is-pie {
  min-height: 290px;
}

.chart-card header,
.table-card header,
.panel header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.chart-card h3,
.table-card h3,
.panel h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.chart-card p,
.table-card p,
.panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-bars {
  display: grid;
  gap: 13px;
}

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

.chart-bar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.chart-label,
.legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.chart-bar-top strong {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.chart-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.chart-fill {
  width: var(--bar-width);
  min-width: 3px;
  height: 100%;
  border-radius: 999px;
  background: var(--bar-color);
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(118px, 148px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pie-chart {
  width: min(148px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--segments));
  box-shadow: inset 0 0 0 1px rgba(29, 35, 39, 0.08);
}

.pie-chart span {
  display: grid;
  place-items: center;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

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

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

.pie-legend-row strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pie-legend-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pie-legend-metrics {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

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

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.action {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.action strong {
  display: block;
  font-size: 23px;
  margin-top: 6px;
}

.action.warn strong { color: var(--warn); }
.action.bad strong { color: var(--bad); }
.action.ok strong { color: var(--ok); }

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

tbody td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

td {
  overflow-wrap: anywhere;
}

.summary-copy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.tier-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tier-card,
.calendar-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.tier-card strong,
.calendar-day strong {
  color: var(--ink);
  font-size: 14px;
}

.bars,
.mini-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 10px;
  align-items: center;
}

.bar-label,
.bar-value {
  font-size: 12px;
  color: var(--muted);
}

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

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #eef1ea;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-fill.warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.bar-fill.bad { background: linear-gradient(90deg, #dc2626, #fb7185); }
.bar-fill.ok { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.bar-fill.neutral { background: linear-gradient(90deg, #2563eb, #60a5fa); }

.stat-list {
  display: grid;
  gap: 10px;
}

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

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.muted-line {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge.ok { background: #dff7ee; color: #047857; }
.badge.warn { background: #fff4cf; color: #92400e; }
.badge.bad { background: #ffe4e6; color: #be123c; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
}

.stack {
  display: grid;
  gap: 14px;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: var(--bg-soft);
}

.sidebar-toggle {
  display: none;
}

.top-nav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  overflow-x: visible;
  padding: 2px 0 4px;
}

.top-nav-link {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.top-nav-link:hover,
.top-nav-link.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

body .sidebar,
body.sidebar-open .sidebar {
  display: none;
}

body .shell-main {
  width: 100%;
  margin-left: 0;
  max-width: 100vw;
}

body .shell-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

body .sidebar-toggle {
  display: none !important;
}

@media (max-width: 1100px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    width: min(var(--sidebar-width), calc(100vw - 28px));
    flex-basis: min(var(--sidebar-width), calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }

  .shell-main {
    margin-left: 0;
    max-width: 100vw;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .shell-topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .view-root {
    padding: 18px;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 20px;
  }
}

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

  .shell-topbar,
  .topbar,
  .page-intro {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    align-items: stretch;
  }

  .page-filters {
    align-items: stretch;
  }

  label {
    min-width: 0;
    flex-basis: 100%;
  }

  .shell-actions {
    width: 100%;
  }

  .bar-row,
  .stat-row,
  .pie-layout {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    margin: 0 auto;
  }

  .pie-legend-row {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }

  .pie-legend-row em {
    display: none;
  }

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

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

@media (max-width: 520px) {
  .shell-topbar {
    padding: 14px;
  }

  .view-root {
    padding: 14px;
  }

  .shell-headline h1 {
    font-size: 22px;
  }

  .meta-copy {
    display: none;
  }

  .panel,
  .chart-card,
  .table-card,
  .card,
  .kpi-card {
    padding: 14px;
  }

  .card .value,
  .kpi-card .value,
  .action strong {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .chart-card header,
  .table-card header,
  .panel header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .table-card .table-wrap {
    overflow-x: visible;
  }

  .table-card table {
    display: block;
    min-width: 0;
  }

  .table-card thead {
    display: none;
  }

  .table-card tbody {
    display: grid;
    gap: 10px;
  }

  .table-card tbody tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
  }

  .table-card tbody tr:hover {
    background: var(--surface-soft);
  }

  .table-card tbody td {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    padding: 0;
    border-bottom: 0;
  }

  .table-card tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
}

@media (max-width: 420px) {
  .table-card tbody td {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* Visual refresh inspired by contemporary ERP dashboard patterns: soft canvas,
   command-center header, pill navigation and elevated analytics cards. */
:root {
  /* Brand iAgenda */
  --brand-blue: #3b82f6;
  --brand-navy: #06090f;
  --brand-sky: #93c5fd;
  --brand-ice: #bfdbfe;
  --brand-green: #22c55e;

  /* Paleta principal */
  --bg: #eef2f7;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.18);
  --ok: #22c55e;
  --warn: #c47816;
  --bad: #f43f5e;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.15);
  --accent-2: #0ea5e9;
  --accent-3: #f59e0b;
  --shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-blue: 0 16px 40px rgba(37, 99, 235, 0.16);
  --radius: 22px;
  --radius-sm: 14px;
}

html {
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: 'Inter', "Aptos Display", "Bahnschrift", system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 38%),
    radial-gradient(ellipse at 88% 8%, rgba(15, 23, 42, 0.055) 0%, transparent 34%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 48%, #e5eaf1 100%);
}

button,
select,
input {
  border-radius: 13px;
}

body .shell-main {
  min-height: 100vh;
  min-height: 100dvh;
}

body .shell-topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  margin: 14px clamp(12px, 2vw, 28px) 0;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 98% 0%, rgba(37, 99, 235, 0.10), transparent 18rem);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.06);
  backdrop-filter: blur(18px);
}

body .shell-topbar::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 8px;
  width: 6px;
  border-radius: 99px;
  background: linear-gradient(180deg, #2563eb, #0ea5e9, #22c55e);
}

.shell-headline {
  padding-left: 12px;
}

.shell-headline h1 {
  font-size: clamp(24px, 3vw, 42px);
  letter-spacing: -0.055em;
  color: #0f172a;
}

.shell-headline p,
.meta-copy,
.page-intro p,
.chart-card p,
.table-card p,
.panel p {
  color: var(--muted);
  line-height: 1.55;
}

.shell-topbar .shell-headline p,
.shell-topbar .meta-copy {
  color: #64748b;
}

.shell-actions {
  justify-content: flex-end;
}

body .shell-topbar > .shell-actions:first-child {
  justify-content: flex-start;
}

body .shell-topbar > .shell-actions:nth-child(2) {
  justify-content: flex-end;
}

button,
.ghost-button {
  min-height: 42px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

button {
  background: linear-gradient(135deg, #2563eb, #1a4fc4);
}

button:hover,
.ghost-button:hover,
.top-nav-link:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
}

.top-nav {
  gap: 10px;
  padding: 14px 0 2px;
}

.top-nav-link {
  padding: 10px 14px;
  border-color: rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  color: #475569;
  letter-spacing: -0.02em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.top-nav-link.is-active {
  border-color: #2563eb;
  background: linear-gradient(135deg, #1d4ed8, #1a45b8);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

.view-root {
  padding: 24px clamp(14px, 2vw, 30px) 42px;
}

.page {
  gap: 20px;
}

.page > * {
  animation: dashboard-rise .34s ease both;
}

.page > *:nth-child(2) { animation-delay: .03s; }
.page > *:nth-child(3) { animation-delay: .06s; }
.page > *:nth-child(4) { animation-delay: .09s; }

.page-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 92% 15%, rgba(37, 99, 235, 0.10), transparent 18rem);
  box-shadow: var(--shadow-soft);
}

.page-intro::after {
  content: "";
  position: absolute;
  right: -52px;
  top: -72px;
  width: 230px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 34px solid rgba(37, 99, 235, 0.1);
}

.page-intro h2 {
  max-width: 820px;
  font-size: clamp(26px, 4vw, 46px);
  letter-spacing: -0.06em;
  color: #0f172a;
}

.dashboard-filter-panel {
  border-color: rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.08), transparent 18rem);
}

label {
  color: #475569;
  letter-spacing: -0.01em;
}

select,
input {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.04);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

select:focus,
input:focus {
  border-color: rgba(37, 99, 235, 0.6);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  outline: 0;
}

.cards,
.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr));
  gap: 16px;
}

.card,
.kpi-card,
.chart-card,
.table-card,
.panel {
  border-color: rgba(15, 23, 42, 0.10);
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96));
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(37, 99, 235, 0.06);
}

.card,
.kpi-card {
  min-height: 128px;
  padding: 18px;
}

.card::before,
.kpi-card::before {
  left: 18px;
  right: 18px;
  top: 14px;
  bottom: auto;
  width: auto;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.card::after,
.kpi-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.05);
}

.kpi-card:nth-child(2n)::before { background: linear-gradient(90deg, var(--ok), #86efac); }
.kpi-card:nth-child(3n)::before { background: linear-gradient(90deg, var(--accent-3), #fcd34d); }
.kpi-card:nth-child(4n)::before { background: linear-gradient(90deg, var(--bad), #fb7185); }

.card .label,
.kpi-card .label {
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.card .value,
.kpi-card .value {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: clamp(25px, 2.4vw, 36px);
  letter-spacing: -0.06em;
  color: #0f172a;
}

.panel,
.chart-card,
.table-card {
  padding: clamp(16px, 2vw, 22px);
}

.panel-grid,
.chart-grid {
  gap: 18px;
}

.chart-card {
  min-height: 290px;
}

.chart-card header,
.table-card header,
.panel header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.chart-card h3,
.table-card h3,
.panel h3 {
  font-size: 18px;
  letter-spacing: -0.04em;
}

.chart-bars {
  gap: 15px;
}

.chart-label,
.legend-label {
  color: #334155;
  font-size: 13px;
}

.chart-track,
.bar-track {
  height: 12px;
  background: rgba(37, 99, 235, 0.10);
}

.chart-fill {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.pie-layout {
  grid-template-columns: minmax(132px, 170px) minmax(0, 1fr);
}

.pie-chart {
  width: min(170px, 100%);
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.08),
    0 18px 38px rgba(37, 99, 235, 0.12);
}

.pie-chart span {
  width: 84px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
}

.pie-legend-row {
  min-height: 28px;
  padding: 4px 0;
}

.chart-card.is-pie .pie-layout {
  grid-template-columns: minmax(150px, 190px) minmax(180px, 1fr);
  align-items: center;
}

.chart-card.is-pie .pie-legend {
  min-width: 180px;
}

.chart-card.is-pie .pie-legend-row {
  grid-template-columns: 12px minmax(96px, 1fr) auto;
  align-items: center;
  column-gap: 10px;
}

.chart-card.is-pie .legend-label {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.chart-card.is-pie .pie-legend-row strong,
.chart-card.is-pie .pie-legend-row em,
.chart-card.is-pie .pie-legend-metrics {
  line-height: 1.25;
  text-align: right;
}

.legend-dot {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.actions {
  gap: 14px;
}

.insight-list {
  display: grid;
  gap: 10px;
}

.insight-item {
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  line-height: 1.5;
}

.action,
.tier-card,
.calendar-day {
  border-color: rgba(15, 23, 42, 0.10);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
}

.table-wrap {
  border-radius: 18px;
}

table {
  overflow: hidden;
}

thead th {
  background: #f1f5f9;
  color: #475569;
}

tbody td {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.badge {
  border-radius: 999px;
}

.badge.ok { background: #dcfce7; color: #166534; border: 1px solid rgba(22, 101, 52, 0.16); }
.badge.warn { background: #fef3c7; color: #92400e; border: 1px solid rgba(146, 64, 14, 0.16); }
.badge.bad { background: #ffe4e6; color: #be123c; border: 1px solid rgba(190, 18, 60, 0.16); }

.empty-state {
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--muted);
  border-color: rgba(15, 23, 42, 0.10);
}

@keyframes dashboard-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  body .shell-topbar {
    top: 0;
    margin: 0;
    border-radius: 0 0 24px 24px;
  }

  .shell-headline {
    padding-left: 8px;
  }

  .top-nav {
    gap: 8px;
  }

  .top-nav-link {
    padding: 9px 12px;
    font-size: 12px;
  }

  .page-intro::after {
    opacity: 0.45;
  }

  .chart-card.is-pie .pie-layout {
    grid-template-columns: 1fr;
  }

  .chart-card.is-pie .pie-legend {
    width: 100%;
    min-width: 0;
  }

  .chart-card.is-pie .pie-legend-row {
    grid-template-columns: 12px minmax(0, 1fr) auto 42px;
  }
}

@media (max-width: 520px) {
  .view-root {
    padding: 16px 12px 32px;
  }

  .page {
    gap: 16px;
  }

  .page-intro {
    padding: 18px;
  }

  .card,
  .kpi-card {
    min-height: 112px;
  }

  .meta-copy {
    display: none;
  }
}

/* --- Nuevos estilos de paginación y buscadores --- */
.table-pagination {
  background: var(--surface-soft);
}

.table-pagination button {
  height: 32px;
  border-radius: 6px;
  font-size: 13px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
  background: #2563eb;
  border: 1px solid #1f5cc0;
  color: #fff;
}

.table-pagination button:hover:not(:disabled) {
  background: #1d4ed8;
}

.table-pagination button:disabled {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.table-search-input {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  padding: 0 10px;
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-search-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tooltip nativo interactivo / Efecto hover en gráficos */
.chart-bar-row {
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.chart-bar-row:hover {
  background: var(--surface-soft);
}

.pie-legend-row {
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.pie-legend-row:hover {
  background: var(--surface-soft);
}

/* ============================
   MEJORAS MARCA iAGENDA
   ============================ */

/* Logo iAgenda en topbar */
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.topbar-brand-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(31, 111, 235, 0.28));
  transition: transform 0.2s ease;
}

.topbar-brand-icon:hover {
  transform: scale(1.08);
}

/* Badge En Vivo */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.22);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-green);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* ============================
   KPI HERO — Métrica principal
   ============================ */
.kpi-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
  background:
    linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(14, 165, 233, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(31, 111, 235, 0.2);
  border-radius: 26px;
  box-shadow: var(--shadow-blue);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.kpi-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(31, 111, 235, 0.22);
}

.kpi-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #1F6FEB, #0EA5E9);
  border-radius: 26px 0 0 26px;
}

.kpi-hero::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -56px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 235, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.kpi-hero-left {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
}

.kpi-hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.kpi-hero-label .kpi-hero-icon {
  font-size: 16px;
}

.kpi-hero-value {
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--brand-blue);
  line-height: 1;
  margin-bottom: 8px;
}

.kpi-hero.is-iagenda-net .kpi-hero-label,
.kpi-hero.is-iagenda-net .kpi-hero-value {
  color: #16a34a;
}

.kpi-hero-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.kpi-hero-sub strong {
  color: var(--brand-green);
  font-weight: 700;
}

.kpi-hero-chart {
  flex-shrink: 0;
  width: clamp(120px, 18vw, 240px);
  height: 56px;
  opacity: 0.9;
}

/* ============================
   GRUPOS DE KPIs
   ============================ */
.kpi-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
}

.kpi-section-label {
  display: inline-block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.kpi-section-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  border-radius: 999px;
}

/* Grid de KPIs financieros (row de 4) */
.kpi-financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 14px;
}

/* Grid de KPIs operativos (row de 5 compactas) */
.kpi-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr));
  gap: 12px;
}

.kpi-ops-grid .kpi-card {
  min-height: 100px;
  padding: 14px 16px;
}

.kpi-ops-grid .kpi-card .value {
  font-size: clamp(20px, 2.2vw, 28px);
}

/* Hover en todas las cards */
.kpi-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(31, 111, 235, 0.13);
}

/* ============================
   NAVEGACIÓN CON EMOJIS
   ============================ */
.top-nav-link[href*="resumen"]::before { content: "📊 "; }
.top-nav-link[href*="detalle"]::before { content: "📋 "; }
.top-nav-link[href*="general"]::before { content: "🏠 "; }
.top-nav-link[href*="finanzas"]::before { content: "💰 "; }
.top-nav-link[href*="reservas"]::before { content: "📅 "; }
.top-nav-link[href*="profesionales"]::before { content: "👤 "; }
.top-nav-link[href*="clientes"]::before { content: "👥 "; }
.top-nav-link[href*="reclamos"]::before { content: "🔔 "; }
.top-nav-link[href*="reputacion"]::before { content: "⭐ "; }

/* ============================
   ÁREA DUAL CHART
   ============================ */
.dual-area-chart-container {
  position: relative;
  width: 100%;
}

/* ============================
   TABLA — mejorar header color
   ============================ */
thead th {
  color: #475569 !important;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.05) !important;
}

/* Botones con color iAgenda */
button:not(.ghost-button):not(.sidebar-toggle) {
  background: linear-gradient(135deg, #1F6FEB, #1558c7);
  border-color: #1558c7;
}

button:not(.ghost-button):not(.sidebar-toggle):hover {
  background: linear-gradient(135deg, #1a62d8, #1047a8);
}

/* Badges con verde iAgenda para OK */
.badge.ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.16);
}

/* Barra de progreso con azul iAgenda */
.bar-fill.neutral {
  background: linear-gradient(90deg, #1F6FEB, #60a5fa);
}

/* Chart fill con azul iAgenda */
.kpi-card:nth-child(1)::before {
  background: linear-gradient(90deg, #1F6FEB, #0EA5E9);
}

/* Selects y inputs con azul iAgenda en focus */
select:focus,
input:focus {
  border-color: rgba(31, 111, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.1);
  outline: 0;
}

/* ============================
   ANIMACIÓN countUp
   ============================ */
.kpi-value-animating {
  transition: opacity 0.15s ease;
  opacity: 0.5;
}

@media (max-width: 820px) {
  .kpi-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
  }

  .kpi-hero-chart {
    width: 100%;
    height: 44px;
  }

  .kpi-hero-value {
    font-size: clamp(28px, 6vw, 40px);
  }
}

@media (max-width: 520px) {
  .kpi-financial-grid,
  .kpi-ops-grid {
    grid-template-columns: 1fr 1fr;
  }
}
