@layer tokens, base, layout, components, utilities;
:root,
:root[data-theme="light"],
body[data-theme="light"] {
  --color-bg: #eaedf3;
  --color-surface: #f8f9fb;
  --color-surface-alt: #e3e6ee;
  --color-border: rgba(37, 45, 62, 0.16);
  --color-text: #101420;
  --color-text-muted: #4f586c;
  --color-accent: #2f5bea;
  --color-accent-strong: #7fa4ff;
  --color-accent-soft: rgba(47, 91, 234, 0.12);
  --color-input-bg: rgba(47, 91, 234, 0.08);
  --color-input-bg-hover: rgba(47, 91, 234, 0.15);
  --surface-panel: var(--color-surface);
  --border-subtle: var(--color-border);
  --accent: var(--color-accent);
  --filter-height: var(--component-control-height-md);
  --filter-radius: var(--component-control-radius);
  --filter-font-size: 0.9rem;
  --filter-label-size: 0.82rem;
  --filter-padding-x: 12px;
  --filter-bg: var(--color-input-bg);
  --filter-bg-hover: var(--color-input-bg-hover);
  --filter-border: var(--color-border);
  --filter-focus-ring: 0 0 0 3px var(--color-accent-soft);
  --color-input-placeholder: rgba(16, 20, 32, 0.56);
  --color-success: #2ea07a;
  --color-warning: #d48c35;
  --color-danger: #e2444c;
  --color-danger-soft: #e2444c;
  --color-weekend: #c7802c;
  --color-weekend-soft: rgba(199, 128, 44, 0.2);
  --chart-grid: rgba(16, 20, 32, 0.14);
  --skeleton-surface: color-mix(in srgb, var(--color-surface) 88%, var(--color-surface-alt) 12%);
  --skeleton-border: color-mix(in srgb, var(--color-border) 88%, transparent);
  --skeleton-base: color-mix(in srgb, var(--color-text-muted) 16%, transparent);
  --skeleton-highlight: color-mix(in srgb, var(--color-text-muted) 28%, transparent);
  --shadow-elevated: 0 26px 52px -28px rgba(10, 16, 28, 0.55);
  --nav-glass-bg: linear-gradient(145deg, rgba(248, 250, 255, 0.92), rgba(232, 238, 250, 0.84));
  --nav-glass-border: rgba(31, 48, 94, 0.16);
  --nav-chip-bg: rgba(255, 255, 255, 0.58);
  --nav-chip-hover: rgba(47, 91, 234, 0.14);
  --nav-chip-active: rgba(47, 91, 234, 0.2);
  --nav-focus-ring: rgba(47, 91, 234, 0.38);
  --nav-shadow: 0 20px 42px -30px rgba(18, 28, 52, 0.45);
  --hero-bg: linear-gradient(135deg, #eaf1ff 0%, #dce8ff 100%);
  --hero-text: #0f172a;
  --hero-text-muted: rgba(15, 23, 42, 0.72);
  --hero-top-accent: #3f6ef8;
  --hero-bottom-border: rgba(15, 23, 42, 0.12);
  --hero-chip-bg: rgba(255, 255, 255, 0.52);
  --hero-chip-border: rgba(37, 45, 62, 0.18);
  --hero-chip-hover-bg: rgba(47, 91, 234, 0.12);
  --hero-chip-active-bg: rgba(47, 91, 234, 0.18);
  --hero-chip-color: #21304d;
  --hero-chip-active-color: #12387f;
  --hero-action-bg: rgba(255, 255, 255, 0.72);
  --hero-action-border: rgba(47, 91, 234, 0.24);
  --hero-action-color: var(--color-accent);
  --report-diagnosis: #0284c7;
  --report-age: #16a34a;
  --report-referral: #ef4444;
  --report-referral-heatmap-low: #312e81;
  --report-referral-heatmap-mid: #0891b2;
  --report-referral-heatmap-high: #fbbf24;
  --report-disposition-hosp-with-referral: #ef4444;
  --report-disposition-discharged-with-referral: rgba(239, 68, 68, 0.28);
  --report-disposition-hosp-without-referral: #2563eb;
  --report-disposition-discharged-without-referral: rgba(37, 99, 235, 0.24);
  --report-referral-pspc: #2563eb;
  --report-pspc: #f59e0b;
  --report-sex-1: #8b5cf6;
  --report-sex-2: #06b6d4;
  --report-sex-3: #f59e0b;
  --report-sex-4: #10b981;
  --report-heatmap: #16a34a;
  --report-correlation-fill: rgba(37, 99, 235, 0.38);
  --report-correlation-stroke: rgba(37, 99, 235, 0.9);
  --hero-height: 0px;
  --section-nav-height: 0px;
  --summaries-jump-sticky-top: 56px;
  --summaries-jump-nav-height: 52px;
  --state-accent-border-34: rgba(47, 91, 234, 0.34);
  --state-accent-border-35: rgba(37, 99, 235, 0.35);
  --state-accent-border-36: rgba(47, 91, 234, 0.36);
  --state-accent-border-38: rgba(47, 91, 234, 0.38);
  --state-accent-border-42: rgba(47, 91, 234, 0.42);
  --state-accent-border-44: rgba(47, 91, 234, 0.44);
  --state-accent-inset-16: inset 0 0 0 1px rgba(47, 91, 234, 0.16);
  --state-accent-inset-18: inset 0 0 0 1px rgba(47, 91, 234, 0.18);
  --state-accent-inset-20: inset 0 0 0 1px rgba(47, 91, 234, 0.2);
  --state-focus-outline: 3px solid var(--nav-focus-ring);
  --state-focus-offset: 2px;
  --state-focus-shadow-soft: 0 0 0 2px rgba(255, 255, 255, 0.25);
  --state-focus-shadow-hero: 0 0 0 3px rgba(144, 174, 255, 0.38);
  --component-export-size: var(--component-control-height-md);
  --component-export-icon-size: 16px;
  --component-export-radius: 10px;
  --component-export-tooltip-radius: 8px;
  --component-export-tooltip-padding: 6px 10px;
  --component-export-tooltip-font-size: 0.78rem;
  --component-export-tooltip-shadow: var(--shadow-popover-soft);
  --component-export-error-border: rgba(195, 75, 85, 0.35);
  --component-export-error-border-strong: rgba(195, 75, 85, 0.6);
  --component-touch-target-size: 44px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --component-control-height-md: 36px;
  --component-surface-radius: 14px;
  --component-control-radius: 10px;
  --chart-height-compact: 180px;
  --chart-height-standard: 300px;
  --chart-height-analytical: 380px;
  --chart-height-standard-mobile: 260px;
  --chart-height-analytical-mobile: 320px;
  --component-mobile-nav-icon-size: 18px;
  --component-mobile-jump-nav-radius: 14px;
  --component-mobile-jump-nav-link-height: 40px;
  --state-accent-bg-08: rgba(37, 99, 235, 0.08);
  --state-accent-bg-12: rgba(37, 99, 235, 0.12);
  --shadow-soft-panel: 0 6px 18px -12px rgba(15, 23, 42, 0.22);
  --shadow-popover-soft: 0 10px 24px -18px rgba(15, 23, 42, 0.45);
  font-family: "Inter", "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
:root[data-theme="dark"],
body[data-theme="dark"] {
  --color-bg: #0a0d14;
  --color-surface: #141927;
  --color-surface-alt: #1b2130;
  --color-border: rgba(121, 147, 199, 0.2);
  --color-text: #e8ecf6;
  --color-text-muted: #9ca8c0;
  --color-accent: #6d8dff;
  --color-accent-strong: #a8c2ff;
  --color-accent-soft: rgba(109, 141, 255, 0.16);
  --color-input-bg: rgba(109, 141, 255, 0.14);
  --color-input-bg-hover: rgba(109, 141, 255, 0.24);
  --surface-panel: var(--color-surface);
  --border-subtle: var(--color-border);
  --accent: var(--color-accent);
  --filter-height: var(--component-control-height-md);
  --filter-radius: var(--component-control-radius);
  --filter-font-size: 0.9rem;
  --filter-label-size: 0.82rem;
  --filter-padding-x: 12px;
  --filter-bg: var(--color-input-bg);
  --filter-bg-hover: var(--color-input-bg-hover);
  --filter-border: var(--color-border);
  --filter-focus-ring: 0 0 0 3px var(--color-accent-soft);
  --color-input-placeholder: rgba(232, 236, 246, 0.78);
  --color-success: #5ad29a;
  --color-warning: #efb24f;
  --color-danger: #ff4d5d;
  --color-danger-soft: #ff4d5d;
  --color-weekend: #f0a255;
  --color-weekend-soft: rgba(240, 162, 85, 0.24);
  --chart-grid: rgba(156, 168, 192, 0.26);
  --skeleton-surface: color-mix(in srgb, var(--color-surface) 82%, var(--color-surface-alt) 18%);
  --skeleton-border: color-mix(in srgb, var(--color-border) 95%, transparent);
  --skeleton-base: color-mix(in srgb, var(--color-text-muted) 22%, transparent);
  --skeleton-highlight: color-mix(in srgb, var(--color-text-muted) 38%, transparent);
  --shadow-elevated: 0 22px 44px -28px rgba(0, 0, 0, 0.7);
  --nav-glass-bg: linear-gradient(148deg, rgba(16, 24, 45, 0.88), rgba(12, 18, 34, 0.76));
  --nav-glass-border: rgba(123, 149, 207, 0.34);
  --nav-chip-bg: rgba(109, 141, 255, 0.12);
  --nav-chip-hover: rgba(109, 141, 255, 0.24);
  --nav-chip-active: rgba(109, 141, 255, 0.3);
  --nav-focus-ring: rgba(168, 194, 255, 0.46);
  --nav-shadow: 0 22px 44px -30px rgba(2, 6, 20, 0.8);
  --hero-bg: linear-gradient(135deg, #0f1d36 0%, #1a2948 100%);
  --hero-text: #e8ecf6;
  --hero-text-muted: rgba(232, 236, 246, 0.74);
  --hero-top-accent: #8aa7ff;
  --hero-bottom-border: rgba(167, 187, 236, 0.2);
  --hero-chip-bg: rgba(109, 141, 255, 0.12);
  --hero-chip-border: rgba(167, 187, 236, 0.24);
  --hero-chip-hover-bg: rgba(109, 141, 255, 0.22);
  --hero-chip-active-bg: rgba(109, 141, 255, 0.34);
  --hero-chip-color: rgba(232, 236, 246, 0.92);
  --hero-chip-active-color: #f4f8ff;
  --hero-action-bg: rgba(15, 23, 42, 0.7);
  --hero-action-border: rgba(148, 163, 184, 0.5);
  --hero-action-color: #e2e8f0;
  --report-diagnosis: #38bdf8;
  --report-age: #4ade80;
  --report-referral: #f87171;
  --report-referral-heatmap-low: #4338ca;
  --report-referral-heatmap-mid: #14b8a6;
  --report-referral-heatmap-high: #facc15;
  --report-disposition-hosp-with-referral: #f87171;
  --report-disposition-discharged-with-referral: rgba(248, 113, 113, 0.3);
  --report-disposition-hosp-without-referral: #60a5fa;
  --report-disposition-discharged-without-referral: rgba(96, 165, 250, 0.3);
  --report-referral-pspc: #60a5fa;
  --report-pspc: #fbbf24;
  --report-sex-1: #a78bfa;
  --report-sex-2: #22d3ee;
  --report-sex-3: #fbbf24;
  --report-sex-4: #34d399;
  --report-heatmap: #4ade80;
  --report-correlation-fill: rgba(96, 165, 250, 0.38);
  --report-correlation-stroke: rgba(147, 197, 253, 0.94);
  --state-focus-shadow-soft: 0 0 0 2px rgba(232, 236, 246, 0.28);
  --component-export-tooltip-shadow: 0 10px 24px -18px rgba(5, 10, 25, 0.7);
  --shadow-soft-panel: 0 6px 18px -12px rgba(8, 12, 32, 0.4);
  --shadow-popover-soft: 0 10px 24px -18px rgba(5, 10, 25, 0.7);
}
* {
  box-sizing: border-box;
}
input::placeholder,
textarea::placeholder {
  color: var(--color-input-placeholder);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  font-family: "Inter", "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
[hidden] {
  display: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 14%);
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 0;
}
body[data-theme="dark"] select option,
body[data-theme="dark"] select optgroup {
  background: var(--color-surface);
  color: var(--color-text);
}
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-left: clamp(16px, 3vw, 48px);
  padding-right: clamp(16px, 3vw, 48px);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.inline-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.inline-icon-label__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  color: currentColor;
}
.inline-icon-label__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}
.inline-icon-label__text {
  min-width: 0;
}
.inline-icon-label--compact {
  gap: 6px;
}
.inline-icon-label--compact .inline-icon-label__icon {
  width: 0.95em;
  height: 0.95em;
}
.inline-icon-label--label {
  gap: 6px;
}
.inline-icon-label--label .inline-icon-label__icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--color-text-muted);
}
.search-field-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.search-field-wrap .inline-icon-label__icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}
.search-field-wrap input {
  width: 100%;
  padding-left: 42px;
  appearance: none;
  -webkit-appearance: none;
}
.search-field-wrap input[type="search"]::-webkit-search-decoration,
.search-field-wrap input[type="search"]::-webkit-search-cancel-button,
.search-field-wrap input[type="search"]::-webkit-search-results-button,
.search-field-wrap input[type="search"]::-webkit-search-results-decoration {
  appearance: none;
  -webkit-appearance: none;
  display: none;
}
@keyframes skeletonShimmer {
  to {
    transform: translateX(100%);
  }
}
.skeleton {
  position: relative;
  overflow: hidden;
  display: block;
  box-shadow: inset 0 0 0 1px var(--skeleton-border);
  background: var(--skeleton-base);
  border-radius: 12px;
}
.skeleton::after,
.chart-card__skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, var(--skeleton-highlight) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: skeletonShimmer 1.4s linear infinite;
}
.skeleton--title {
  height: 18px;
  max-width: 70%;
}
.skeleton--value {
  height: 34px;
  max-width: 60%;
}
.skeleton--detail {
  height: 16px;
  max-width: 100%;
}
.skeleton--chip {
  height: 12px;
  max-width: 45%;
}
.skeleton--chart-area {
  flex: 1 1 auto;
  height: clamp(200px, 28vh, 320px);
  border-radius: 16px;
}
.skeleton--chart-area--heatmap {
  height: clamp(240px, 34vh, 380px);
}
.skeleton--caption {
  height: 14px;
  max-width: 80%;
}
.skeleton--table-cell {
  width: 100%;
  min-width: 70px;
  max-width: none;
}
.tab-panel {
  margin-bottom: 32px;
  width: 100%;
}
.tab-panel[hidden] {
  display: none;
}
main {
  flex: 1;
  padding: 24px 0 32px;
}
.section {
  margin-bottom: 32px;
}
.section--compact {
  margin-bottom: 24px;
}
.section-band {
  margin-bottom: 32px;
  padding: clamp(18px, 2.6vw, 32px);
  border-radius: clamp(20px, 3vw, 32px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 26px 52px -36px rgba(15, 23, 42, 0.45);
}
.section-band--trends {
  background: linear-gradient(180deg, var(--color-surface-alt) 0%, var(--color-surface) 100%);
}
.section-band--time-scale {
  background: linear-gradient(180deg, rgba(47, 91, 234, 0.08) 0%, var(--color-surface) 60%);
}
body[data-theme="dark"] .section-band {
  box-shadow: 0 30px 60px -40px rgba(4, 6, 14, 0.85);
}
.section-band .section {
  margin-bottom: 24px;
}
.section-band .section:last-child {
  margin-bottom: 0;
}
@media (prefers-reduced-motion: reduce) {
  .section-nav__link,
  .section-nav__trigger,
  .section-nav__bar::before,
  .section-nav__bar::after {
    transition: none;
  }
  .section-nav__link:hover,
  .section-nav__trigger:hover {
    transform: none;
  }
}
.section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.analytical-page-intro {
  margin-bottom: var(--space-4);
}
.analytical-page-intro .section__header {
  margin-bottom: 0;
}
.section__heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.section__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.section__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.section__title {
  font-size: 1.35rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-title__icon {
  display: none;
}
.section-title__icon svg {
  width: 18px;
  height: 18px;
}
body[data-theme="dark"] .section-title__icon {
  background: rgba(96, 165, 250, 0.16);
}
.section-title__text {
  line-height: 1.2;
}
#kpiHeading,
#chartHeading,
#chartsOverviewHeading,
#chartsHourlyHeading,
#chartsHeatmapHeading,
#chartsHospitalTableHeading,
#recentHeading,
#yearlyHeading,
#summariesSegmentHeading,
#summariesGroupClinicalHeading,
#summariesGroupReferralHeading,
#summariesGroupPspcHeading,
#feedbackHeading {
  scroll-margin-top: calc(var(--hero-height, 0px) + 16px);
}
body[data-page="charts"] #chartHeading,
body[data-page="charts"] #chartsOverviewHeading,
body[data-page="charts"] #chartsHourlyHeading,
body[data-page="charts"] #chartsHeatmapHeading,
body[data-page="charts"] #chartsHospitalTableHeading {
  scroll-margin-top: calc(var(--hero-height, 0px) + 20px);
}
body[data-page="summaries"] #yearlyHeading,
body[data-page="summaries"] #summariesGroupClinicalHeading,
body[data-page="summaries"] #summariesGroupReferralHeading,
body[data-page="summaries"] #summariesGroupPspcHeading {
  scroll-margin-top: calc(var(--hero-height, 0px) + var(--summaries-jump-nav-height, 52px) + 20px);
}
body[data-page="gydytojai"] #gydytojaiHeading,
body[data-page="gydytojai"] #gydytojaiTablesHeading,
body[data-page="gydytojai"] #gydytojaiChartsHeading {
  scroll-margin-top: calc(var(--hero-height, 0px) + var(--summaries-jump-nav-height, 52px) + 20px);
}
.section__subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.section__description {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  max-width: 720px;
}
