header.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 6px 0;
  position: sticky;
  top: 0;
  z-index: 8;
  overflow: hidden;
  border-bottom: 1px solid var(--hero-bottom-border);
  box-shadow: 0 8px 24px -20px rgba(15, 23, 42, 0.45);
}
header.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--hero-top-accent);
  opacity: 0.92;
  pointer-events: none;
}
.hero__content {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  grid-template-areas: "identity nav actions";
  align-items: center;
  gap: clamp(8px, 1.5vw, 16px);
  position: relative;
  z-index: 1;
}
.hero__identity {
  grid-area: identity;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.hero__identity:focus-visible {
  border-radius: 10px;
  outline: 3px solid var(--nav-focus-ring);
  outline-offset: 3px;
}
.hero__logo {
  display: block;
  flex: 0 0 auto;
  width: clamp(32px, 3vw, 40px);
  height: clamp(32px, 3vw, 40px);
  object-fit: contain;
}
.hero__title {
  font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.35rem);
  margin: 0;
  letter-spacing: 0.01em;
}
.hero__nav {
  grid-area: nav;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__actions {
  grid-area: actions;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 44px;
  flex-wrap: wrap;
}
.hero__status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 24px;
  min-width: 140px;
  max-width: 320px;
  order: 1;
}
.hero__buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
  order: 2;
}
.hero__actions .status {
  max-width: none;
  width: 100%;
  min-height: 18px;
  text-align: right;
}
.hero__actions .status.status--loading {
  width: 10px;
  min-width: 10px;
  max-width: 10px;
  min-height: 10px;
  height: 10px;
  text-align: left;
}
:is(button.icon-button, .export-icon-btn, .chart-copy-btn, .chart-download-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
button.icon-button {
  border: none;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.25s ease,
    border-color 0.25s ease;
  box-shadow: 0 12px 26px -22px rgba(15, 23, 42, 0.7);
}
button.icon-button svg {
  width: 18px;
  height: 18px;
}
button.icon-button:focus-visible {
  outline: 3px solid var(--nav-focus-ring);
  outline-offset: 3px;
}
.theme-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}
.global-search-trigger {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}
.global-search-trigger:hover,
.global-search-trigger:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}
body[data-theme="light"] .theme-toggle {
  background: var(--hero-action-bg);
  border: 1px solid var(--hero-action-border);
  color: var(--hero-action-color);
  box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.55);
}
body[data-theme="light"] .global-search-trigger {
  background: var(--hero-action-bg);
  border: 1px solid var(--hero-action-border);
  color: var(--hero-action-color);
  box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.55);
}
body[data-theme="light"] .theme-toggle:hover,
body[data-theme="light"] .theme-toggle:focus-visible {
  background: var(--hero-chip-hover-bg);
  border-color: var(--state-accent-border-42);
  color: var(--hero-chip-active-color);
}
body[data-theme="light"] .global-search-trigger:hover,
body[data-theme="light"] .global-search-trigger:focus-visible {
  background: var(--hero-chip-hover-bg);
  border-color: var(--state-accent-border-42);
  color: var(--hero-chip-active-color);
}
body[data-theme="dark"] .theme-toggle {
  background: var(--hero-action-bg);
  border-color: var(--hero-action-border);
  color: var(--hero-action-color);
}
body[data-theme="dark"] .global-search-trigger {
  background: var(--hero-action-bg);
  border-color: var(--hero-action-border);
  color: var(--hero-action-color);
}
.theme-toggle .theme-icon {
  display: none;
}
.theme-toggle[data-theme="light"] .icon--sun,
.theme-toggle:not([data-theme]) .icon--sun {
  display: block;
}
.theme-toggle[data-theme="dark"] .icon--moon {
  display: block;
}
.theme-toggle[aria-pressed="true"] {
  background: var(--hero-chip-active-bg);
  color: var(--hero-chip-active-color);
}
body[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
  background: var(--hero-chip-active-bg);
  color: var(--hero-action-color);
}
body[data-fullscreen="true"] header.hero {
  display: none;
}
body[data-fullscreen="true"] main.container {
  padding-top: clamp(16px, 3vw, 40px);
}
.mobile-app-nav,
.mobile-more-sheet,
.mobile-shell-status {
  display: none;
}
.mobile-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 22;
}
.mobile-more-sheet[hidden] {
  display: none;
}
.mobile-more-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: #0f172a5c;
  cursor: pointer;
}
.mobile-more-sheet__panel {
  position: absolute;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.mobile-more-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mobile-more-sheet__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}
.mobile-more-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg);
  color: var(--color-text);
  cursor: pointer;
}
.mobile-more-sheet__close svg {
  width: 20px;
  height: 20px;
}
.mobile-more-sheet__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mobile-more-sheet__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 76px;
  gap: 7px;
  padding: 9px 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.mobile-more-sheet__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}
.mobile-more-sheet__icon svg {
  width: 22px;
  height: 22px;
}
.mobile-more-sheet__item:focus-visible,
.mobile-more-sheet__close:focus-visible,
.mobile-more-sheet__backdrop:focus-visible {
  outline: 3px solid var(--nav-focus-ring);
  outline-offset: 2px;
}
.mobile-more-sheet__item.is-active,
.mobile-more-sheet__item[aria-current="page"] {
  border-color: var(--state-accent-border-42);
  background: var(--nav-chip-active);
  color: var(--color-accent);
  box-shadow: var(--state-accent-inset-18);
}
body[data-theme="dark"] .kpi-filter span {
  color: var(--color-text);
}
.status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--hero-text-muted);
}
.status:empty:not(.status--loading) {
  display: none;
}
.status--loading {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  overflow: visible;
  vertical-align: middle;
}
.status--loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(47, 91, 234, 0.35);
  animation: status-loading 1.2s ease-in-out infinite;
}
.status--loading::after {
  content: none;
}
.status--error {
  color: #b91c1c;
  font-weight: 600;
}
.status[data-tone="warning"] {
  color: #b45309;
}
body[data-theme="dark"] .status--error {
  color: #fecaca;
}
body[data-theme="dark"] .status[data-tone="warning"] {
  color: #f9d977;
}
@keyframes status-loading {
  0% {
    transform: scale(0.86);
    opacity: 0.55;
    box-shadow: 0 0 0 0 rgba(47, 91, 234, 0.26);
  }
  55% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(47, 91, 234, 0);
  }
  100% {
    transform: scale(0.86);
    opacity: 0.55;
    box-shadow: 0 0 0 0 rgba(47, 91, 234, 0);
  }
}
@media (min-width: 1320px) and (max-width: 1599px) {
  header.hero .section-nav {
    --section-nav-chip-padding: 5px 7px;
    --section-nav-chip-gap: 4px;
    --section-nav-chip-font-size: 0.76rem;
    --section-nav-icon-size: 14px;
  }
  header.hero .section-nav__inner {
    gap: 5px;
  }
  .hero__content {
    gap: 10px;
  }
  .hero__logo {
    width: 34px;
    height: 34px;
  }
  .hero__title {
    font-size: 1.08rem;
  }
}
@media (max-width: 1319px) {
  header.hero .section-nav {
    --section-nav-chip-min-height: 44px;
  }
  .hero__content {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity actions" "nav nav";
  }
  .hero__actions {
    align-items: center;
    justify-self: end;
  }
  .hero__buttons button.icon-button {
    width: 44px;
    height: 44px;
  }
  .hero__nav .section-nav__bar,
  .hero__nav .section-nav__inner {
    justify-content: flex-start;
  }
  .hero__nav .section-nav__inner {
    overflow-x: visible;
    scrollbar-width: none;
  }
  .hero__nav .section-nav__inner::-webkit-scrollbar {
    display: none;
  }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .hero__nav .section-nav__link[data-nav-priority="secondary"] {
    display: none;
  }
  .hero__nav .section-nav__more-trigger {
    display: inline-flex;
  }
  body[data-mobile-more-open="true"] {
    overflow: hidden;
  }
  .mobile-more-sheet {
    display: block;
  }
  .mobile-more-sheet__panel {
    top: calc(var(--hero-height, 108px) + 8px);
    right: max(16px, env(safe-area-inset-right, 0px));
    width: min(360px, calc(100vw - 32px));
    border-radius: 12px;
    box-shadow: var(--shadow-popover-soft);
  }
}
@media (min-width: 1024px) {
  .hero__nav .section-nav__more-trigger {
    display: inline-flex;
  }
  .mobile-more-sheet {
    display: block;
  }
  .mobile-more-sheet__panel {
    top: calc(var(--hero-height, 58px) + 8px);
    right: max(16px, env(safe-area-inset-right, 0px));
    width: min(390px, calc(100vw - 32px));
    border-radius: 14px;
    box-shadow: var(--shadow-popover-soft);
  }
  .mobile-more-sheet__item--search {
    display: none;
  }
}
@media (max-width: 640px) {
  header.hero {
    padding: 10px 0;
  }
  .hero__content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "identity"
      "actions"
      "nav";
    gap: 14px;
  }
  .hero__actions {
    align-items: flex-start;
    gap: 8px;
    justify-content: flex-start;
  }
  .hero__buttons {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
  }
  .hero__status {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
  .hero__nav .section-nav__bar,
  .hero__nav .section-nav__inner {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  header.hero {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 0 8px;
  }
  .hero__content {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity actions";
    gap: 8px;
  }
  .hero__title {
    font-size: 1rem;
    line-height: 1.15;
  }
  .hero__actions {
    width: auto;
    align-items: center;
    gap: 6px;
    margin-top: 0;
  }
  .hero__buttons {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .hero__status,
  .hero__nav {
    display: none;
  }
  .hero__logo {
    width: 32px;
    height: 32px;
  }
  .section-nav--compact .section-nav__bar {
    padding: 0;
  }
  .section-nav--compact .section-nav__inner {
    gap: 6px;
  }
  .section-nav--compact .section-nav__link {
    min-height: 34px;
    padding: 6px 10px;
  }
  .hero__nav .section-nav__bar,
  .hero__nav .section-nav__inner {
    justify-content: flex-start;
  }
  .hero__buttons button.icon-button {
    width: 44px;
    height: 44px;
  }
  .status {
    text-align: left;
    font-size: 0.78rem;
    width: 100%;
  }
  .chart-filters {
    margin-left: 0;
    flex: 1 1 100%;
  }
  .chart-filter {
    flex: 1 1 140px;
  }
  .chart-filters__summary {
    order: 5;
  }
  body {
    padding-bottom: calc(var(--component-mobile-bottom-nav-height, 72px) + env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: auto;
  }
  body[data-mobile-more-open="true"] {
    overflow: hidden;
  }
  .mobile-app-nav {
    --mobile-nav-bg: color-mix(in srgb, var(--color-surface) 92%, transparent);
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(var(--component-mobile-bottom-nav-height, 72px) + env(safe-area-inset-bottom, 0px));
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-right, 0px));
    border-top: 1px solid var(--color-border);
    background: var(--mobile-nav-bg);
    box-shadow: 0 -18px 34px -28px rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .mobile-app-nav[data-items="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mobile-app-nav__link {
    min-width: 0;
    min-height: 56px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--color-text-muted);
    text-decoration: none;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .mobile-app-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }
  .mobile-app-nav__icon svg {
    width: 21px;
    height: 21px;
  }
  .mobile-app-nav__label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-app-nav__link:focus-visible {
    outline: 3px solid var(--nav-focus-ring);
    outline-offset: 2px;
    color: var(--color-accent);
    background: var(--color-input-bg);
  }
  .mobile-app-nav__link.is-active,
  .mobile-app-nav__link[aria-current="page"],
  .mobile-app-nav__link[aria-expanded="true"] {
    color: var(--color-accent);
    border-color: var(--state-accent-border-38);
    background: var(--nav-chip-active);
    box-shadow: var(--state-accent-inset-16);
  }
  .mobile-more-sheet {
    display: block;
  }
  .mobile-more-sheet__panel {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--component-mobile-bottom-nav-height, 72px) + env(safe-area-inset-bottom, 0px) + 8px);
    border-radius: 18px;
    box-shadow: 0 20px 48px -28px rgba(15, 23, 42, 0.72);
  }
  .mobile-more-sheet__close {
    border-radius: 12px;
  }
  .mobile-shell-status {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--component-mobile-bottom-nav-height, 72px) + env(safe-area-inset-bottom, 0px) + 8px);
    z-index: 21;
    display: block;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--state-accent-border-38);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: var(--shadow-popover-soft);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .mobile-shell-status[data-visible="true"] {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 380px) {
  .mobile-app-nav__label {
    font-size: 0.68rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-more-sheet__panel,
  .mobile-shell-status,
  .mobile-app-nav__link {
    transition: none;
  }
}
