* {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== KOLORY ========== */
:root {
  --color-gus-blue: #001d77;
  --color-gus-blue-dark: #00175f;
  --color-gus-magenta: #ff00ff;
  --color-gus-magenta-dark: #cc00cc;
  --color-gus-dark: #111827;
  --color-gus-card-dark: #1f2937;
  --color-gus-border: #dadbdf;
  --color-gus-border-dark: #374151;
  --color-gus-logo: #f0ab00;
  --color-gus-logo-dark: #070706;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-highlight: #f5a800;
  --color-highlight-dark: #ff00ff;

  --color-chart-2023: #f5a800;
  --color-chart-2022: #ffc975;
  --color-chart-2020: #ffdba2;
  --color-chart-2015: #b3b3b3;
  --color-chart-dom: #f5a800;
  --color-chart-ruch: #fcb843;
  --color-chart-praca: #ffdba2;
  --color-chart-szkola: #fee5be;
  --color-chart-inne: #cccccc;
}

.dark {
  --color-chart-2023: #00ffff;
  --color-chart-2022: #ff00ff;
  --color-chart-2020: #00ff00;
  --color-chart-2015: #00ff00;
  --color-chart-dom: #ff00ff;
  --color-chart-ruch: #0000ff;
  --color-chart-praca: #00ffff;
  --color-chart-szkola: #00ff00;
  --color-chart-inne: #ffaaaa;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-spin,
  .animate-bounce,
  .animate-pulse,
  .shake,
  .cookie-consent-popup.shake {
    animation: none !important;
  }
}

/* ========== KOLORY DLA MARKERÓW ========== */
.marker-2023 {
  background-color: var(--color-chart-2023);
}

.marker-2022 {
  background-color: var(--color-chart-2022);
}

.marker-2020 {
  background-color: var(--color-chart-2020);
}

.marker-2015 {
  background-color: var(--color-chart-2015);
}

.marker-dom {
  background-color: var(--color-chart-dom);
}

.marker-ruch {
  background-color: var(--color-chart-ruch);
}

.marker-praca {
  background-color: var(--color-chart-praca);
}

.marker-szkola {
  background-color: var(--color-chart-szkola);
}

.marker-inne {
  background-color: var(--color-chart-inne);
}

/* ========== HIGHLIGHTS ========== */
.text-highlight {
  color: var(--color-gus-blue);
}

.dark .text-highlight {
  color: var(--color-gus-magenta);
}

.bg-highlight {
  background-color: var(--color-gus-blue);
}

.dark .bg-highlight {
  background-color: var(--color-gus-magenta);
}

.highlight-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.highlight-card:hover {
  transform: translateY(-5px);
  background-color: var(--color-white);
  box-shadow: 0 12px 20px -10px rgba(0, 29, 119, 0.15);
}

.dark .highlight-card:hover {
  background-color: #262f3f;
}

/* ========== STATYSTYKI ========== */
.stat-trend-up {
  color: #10b981;
}

.stat-trend-down {
  color: #ef4444;
}

/* ========== NOTYFIKACJE ========== */
.notification-slide {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========== SPINNER ========== */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* ========== DROPDOWN ARCHIWUM ========== */
#archive-dropdown {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#archive-dropdown a {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

#archive-dropdown a:hover {
  background-color: #f3f4f6 !important;
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark #archive-dropdown a:hover {
  background-color: #374151 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#archive-dropdown a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--color-gus-blue);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.dark #archive-dropdown a::before {
  background-color: var(--color-gus-magenta);
}

#archive-dropdown a:hover::before {
  transform: translateX(0);
}

/* ========== NAVIGACJA ========== */
.nav-btn {
  border-left: 4px solid transparent !important;
  transition: all 0.2s ease-in-out !important;
}

.nav-btn .h-8.w-8 {
  background-color: transparent !important;
  border: none !important;
}

.nav-btn span {
  color: #374151 !important;
}

.dark .nav-btn span {
  color: #d1d5db !important;
}

.nav-btn:hover:not(.active) .h-8.w-8 i,
.nav-btn:hover:not(.active) span {
  color: var(--color-gus-blue) !important;
}

.dark .nav-btn:hover:not(.active) .h-8.w-8 i,
.dark .nav-btn:hover:not(.active) span {
  color: var(--color-gus-magenta) !important;
}

.nav-btn.active .h-8.w-8 i,
.nav-btn.active span {
  color: var(--color-gus-blue) !important;
}

.nav-btn.active span {
  font-weight: 600;
}

.nav-btn.active .h-2.w-2 {
  background-color: var(--color-gus-blue) !important;
  opacity: 1 !important;
}

.dark .nav-btn.active .h-8.w-8 i,
.dark .nav-btn.active span {
  color: var(--color-gus-magenta) !important;
}

.dark .nav-btn.active .h-2.w-2 {
  background-color: var(--color-gus-magenta) !important;
}

.nav-btn .h-2.w-2 {
  opacity: 0 !important;
  transition: opacity 0.2s ease;
}

/* ========== UKŁAD ========== */
.app-container {
  min-height: 100vh;
}

.main-scrollable {
  overflow-y: auto;
  max-height: calc(100vh - 76px);
}

/* ========== PRZEWIJANIE ========== */
.sidebar-scrollable {
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gus-blue) transparent;
}

.sidebar-scrollable::-webkit-scrollbar {
  width: 8px;
}

.sidebar-scrollable::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
  background-color: var(--color-gus-blue) !important;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar-scrollable::-webkit-scrollbar-thumb:hover {
  background-color: rgba(43, 64, 214, 0.8) !important;
}

.dark .sidebar-scrollable {
  scrollbar-color: var(--color-gus-magenta) rgba(55, 65, 81, 0.3);
}

.dark .sidebar-scrollable::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    rgba(255, 0, 255, 0.8),
    var(--color-gus-magenta)
  );
  border: 1px solid rgba(31, 41, 55, 0.9);
}

.dark .sidebar-scrollable::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, rgba(255, 0, 255, 0.9), #cc00cc);
}

.main-scrollable::-webkit-scrollbar {
  width: 12px;
}

.main-scrollable::-webkit-scrollbar-track {
  background: rgba(229, 231, 235, 0.5);
  border-radius: 6px;
  margin: 20px 0;
}

.main-scrollable::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    rgba(43, 64, 214, 0.8),
    var(--color-gus-blue)
  );
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  min-height: 40px;
}

.main-scrollable::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    to bottom,
    rgba(43, 64, 214, 0.9),
    var(--color-gus-blue)
  );
}

.dark .main-scrollable {
  scrollbar-color: rgba(255, 0, 255, 0.8) rgba(55, 65, 81, 0.5);
}

.dark .main-scrollable::-webkit-scrollbar-track {
  background: rgba(55, 65, 81, 0.5);
}

.dark .main-scrollable::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    rgba(255, 0, 255, 0.8),
    var(--color-gus-magenta)
  );
  border: 2px solid rgba(31, 41, 55, 0.9);
}

.dark .main-scrollable::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, rgba(255, 0, 255, 0.9), #cc00cc);
}

.overflow-x-auto {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.overflow-x-auto::-webkit-scrollbar {
  display: none;
}

/* ========== PRZYCISK POWROTU NA GÓRĘ ========== */
.scroll-to-top {
  position: fixed;
  bottom: 64px;
  right: 36px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-gus-blue);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.scroll-to-top:hover {
  background-color: var(--color-gus-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:active {
  transform: translateY(0);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top.dark {
  background-color: var(--color-gus-magenta);
}

.scroll-to-top.dark:hover {
  background-color: #cc00cc;
}

/* ========== SIDEBAR ========== */
#sidebar {
  width: 20rem;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#sidebar.collapsed {
  width: 5.5rem;
}

#sidebar.collapsed .nav-btn .flex.items-start {
  justify-content: center !important;
}

#sidebar.collapsed .nav-btn span:not(.sr-only) {
  display: none;
}

#sidebar.collapsed .nav-btn .h-8.w-8 {
  margin-right: 0;
}

#sidebar.collapsed .nav-btn {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

#sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 0.75rem 0.5rem;
}

#sidebar.collapsed .sidebar-footer .footer-text {
  display: none;
}

#sidebar.collapsed .sidebar-collapse-btn {
  margin: 0 auto;
}

@media (max-width: 1023px) {
  #sidebar {
    z-index: 100 !important;
    position: fixed !important;
    top: 88px;
    height: calc(100vh - 88px);
  }

  #sidebar:not(.-translate-x-full) {
    z-index: 100 !important;
  }

  #mobile-overlay {
    z-index: 90 !important;
  }

  .legend-on-map {
    z-index: 5 !important;
    position: absolute !important;
    bottom: 10px !important;
    left: 10px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .dark .legend-on-map {
    background: rgba(31, 41, 55, 0.95) !important;
  }

  .map-info-panel {
    z-index: 5 !important;
    position: relative !important;
    margin-top: 0 !important;
  }

  .bg-white.dark\:bg-gray-800.rounded-xl {
    position: relative !important;
    z-index: 1 !important;
  }

  #sidebar.collapsed {
    width: 5rem !important;
  }

  #sidebar.collapsed .nav-btn span {
    display: inline;
  }

  #sidebar.collapsed .nav-btn {
    justify-content: center;
    padding-right: 0.5rem;
  }

  #sidebar.collapsed .nav-btn .h-8.w-8 {
    margin-right: 0 !important;
  }

  #sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 0.75rem 0.5rem;
  }

  #sidebar.collapsed .sidebar-footer .footer-text {
    display: none;
  }

  #sidebar.collapsed .sidebar-collapse-btn {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .legend-on-map {
    bottom: 5px !important;
    left: 5px !important;
    padding: 6px 10px !important;
    min-width: 120px !important;
  }

  .legend-on-map .legend-item {
    gap: 4px !important;
  }

  .legend-on-map .legend-text {
    font-size: 10px !important;
  }

  .legend-on-map .legend-line,
  .legend-on-map .legend-color.area-square {
    width: 20px !important;
  }
}

@media (max-width: 1023px) {
  #sidebar.collapsed {
    width: 5rem !important;
  }

  #sidebar.collapsed:not(.-translate-x-full) {
    z-index: 100 !important;
  }
}

@media (max-width: 640px) {
  #sidebar {
    max-width: 280px;
  }
}

@media (max-width: 768px) and (min-width: 641px) {
  #sidebar {
    max-width: 320px;
  }
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #ced0d4;
  background-color: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dark .sidebar-footer {
  border-top-color: #606773;
  background-color: #1f2937;
}

.sidebar-footer .footer-text {
  font-size: 0.8rem;
  color: var(--color-gray-500);
  white-space: nowrap;
  overflow: hidden;
}

.dark .sidebar-footer .footer-text {
  color: var(--color-gray-400);
}

.sidebar-collapse-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gus-blue);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background-color: var(--color-gray-200);
  color: var(--color-gus-blue);
}

.dark .sidebar-collapse-btn {
  color: var(--color-gray-400);
}

.dark .sidebar-collapse-btn:hover {
  background-color: #374151;
  color: var(--color-gus-magenta);
}

.sidebar-collapse-btn i {
  font-size: 1.2rem;
}

#mobile-overlay {
  transition: opacity 0.3s ease-in-out;
}

body.overflow-hidden {
  overflow: hidden;
  height: 100vh;
}

/* ========== TABELE ========== */
.table-container th,
.table-container th[rowspan],
.table-container th[colspan] {
  text-align: center !important;
  vertical-align: middle !important;
}

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

th {
  background: var(--color-gray-50);
  color: var(--color-gray-600);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: lovercase;
  letter-spacing: 0.5px;
  padding: 0.75rem;
  border-top: 1px solid var(--color-gray-300);
  border-bottom: 1px solid var(--color-gray-300);
  border-right: 1px solid var(--color-gray-300);
  text-align: center;
}

.dark th {
  background: #111827;
  color: var(--color-gray-400);
  border-top-color: var(--color-gray-600);
  border-bottom-color: var(--color-gray-600);
  border-right-color: var(--color-gray-600);
}

th:last-child {
  border-right: none;
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-gray-300);
  border-right: 1px solid var(--color-gray-300);
  color: var(--color-gray-800);
  text-align: right;
}

.dark td {
  border-bottom-color: var(--color-gray-600);
  border-right-color: var(--color-gray-600);
  color: var(--color-gray-200);
}

td:last-child {
  border-right: none;
  font-weight: 600;
  color: var(--color-gus-blue);
  text-align: right;
}

.dark td:last-child {
  color: var(--color-gus-magenta);
}

td:first-child {
  font-weight: 500;
  padding-left: 1.5rem;
  text-align: left;
}

td.indent {
  padding-left: 3rem;
  font-weight: 400;
}

tr:hover td {
  background: var(--color-gray-100);
}

.dark tr:hover td {
  background: #2d3748;
}

tfoot td,
tfoot td:last-child {
  color: var(--color-gray-500) !important;
  font-weight: normal !important;
}

.dark tfoot td,
.dark tfoot td:last-child {
  color: var(--color-gray-400) !important;
}

.no-stretch {
  align-self: flex-start;
  height: auto !important;
  min-height: 0;
}

.indent {
  padding-left: 3rem !important;
}

.indent-2 {
  padding-left: 4.5rem !important;
}

.indent-3 {
  padding-left: 6rem !important;
}

.table-wrapper {
  background: var(--color-white);
  border-radius: 1rem;
  border: 1px solid var(--color-gray-300);
  overflow-x: hidden !important;
  max-width: 100%;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: fit-content;
  transition: all 0.2s ease-in-out;
}

.table-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.dark .table-wrapper {
  background: var(--color-gus-card-dark);
  border-color: var(--color-gray-700);
}

.table-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  min-height: 85px;
  display: flex;
  align-items: flex-start !important;
}

.dark .table-header {
  background: #111827;
  border-bottom-color: var(--color-gray-700);
}

.table-title {
  font-weight: 600;
  color: #111827;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dark .table-title {
  color: var(--color-white);
}

.table-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--color-gus-blue);
  color: var(--color-white);
}

.dark .table-badge {
  background: var(--color-gus-magenta);
}

.table-container * {
  box-sizing: border-box;
}

.table-container {
  overflow-x: hidden !important;
  max-width: 100%;
  padding: 1rem 0.5rem;
}

.span-2 table th {
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  font-weight: 600;
  padding: 0.75rem;
  text-align: center;
  vertical-align: bottom;
  border-bottom: 1px solid var(--color-gray-300);
  border-right: 1px solid var(--color-gray-300);
}

.dark .span-2 table th {
  background-color: #111827;
  color: var(--color-gray-400);
  border-bottom-color: var(--color-gray-600);
  border-right-color: var(--color-gray-600);
}

.span-2 table th:last-child {
  border-right: none;
}

.span-2 table td {
  all: unset;
  display: table-cell;
  padding: 0.75rem;
  border-bottom: 0;
  border-right: 0;
  text-align: right;
  font-weight: 400;
  color: inherit;
}

.dark .span-2 table td {
  color: var(--color-gray-400);
}

.span-2 table td:last-child {
  font-weight: 400 !important;
  color: inherit !important;
}

.dark .span-2 table td:last-child {
  color: inherit !important;
}

.span-2 .row-2024 td {
  font-weight: 600 !important;
}

.span-2 .row-2024 td:first-child {
  font-weight: 600 !important;
}

.table-wrapper .table-container table thead th img {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 8px auto;
  cursor: pointer;
  opacity: 0.95;
  overflow-x: hidden !important;
}

.table-wrapper .table-container table thead th img:hover {
  transform: scale(1.1);
  opacity: 1;
}

.table-wrapper .table-container table thead th {
  vertical-align: bottom;
  text-align: center;
}

.table-wrapper .table-container table thead th div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

@media (max-width: 640px) {
  .table-wrapper .table-container table thead th img {
    height: 60px !important;
  }
}

@media (max-width: 480px) {
  .table-wrapper .table-container table thead th img {
    height: 50px !important;
  }
}

/* ========== WYKRESY ========== */
.chart-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--color-white);
  border-radius: 1rem;
  border: 1px solid var(--color-gray-300);
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: fit-content;
  display: flex;
  flex-direction: column;
}

.dark .chart-card {
  background: var(--color-gus-card-dark);
  border-color: var(--color-gray-700);
}

.chart-card:hover {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.chart-header {
  padding: 1rem 1.5rem 1rem 2rem;
  border-bottom: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  display: flex;
  justify-content: space-between;
  align-items: flex-start !important;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 85px;
}

.dark .chart-header {
  background: #111827;
  border-bottom-color: var(--color-gray-700);
}

.chart-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.chart-title {
  font-weight: 600;
  color: #111827;
  font-size: 1.1rem;
  align-items: flex-start;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.dark .chart-title {
  color: var(--color-white);
}

.open-modal-btn {
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 0;
}

@media (max-width: 480px) {
  .open-modal-btn .hidden.sm\:inline {
    display: none;
  }

  .open-modal-btn .sm\:hidden {
    display: inline;
  }
}

.chart-subtitle {
  font-weight: 400;
  color: var(--color-gray-500);
  font-size: 0.95rem;
  margin-top: 2px;
}

.dark .chart-subtitle {
  color: var(--color-gray-400);
}

.chart-card .legend-item[data-series] {
  cursor: pointer;
}

.chart-card .legend-marker-line {
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

.chart-card .legend-item.inactive {
  opacity: 0.5;
}

/* ========== OSIE I SIATKA ========== */
.axis path,
.axis line,
.axis .domain {
  stroke: #b3b3b3;
  stroke-width: 2.5px !important;
}

.dark .axis path,
.dark .axis line,
.dark .axis .domain {
  stroke: #b3b3b3;
}

.grid .tick line {
  stroke: #b3b3b3 !important;
  stroke-width: 1px !important;
  stroke-dasharray: none !important;
  opacity: 1 !important;
}

.dark .grid .tick line {
  opacity: 0.8 !important;
  stroke: var(--color-gray-300) !important;
}

.grid .domain,
.axis-x-labels .domain,
.axis-x-labels .tick line {
  display: none !important;
}

.tracking-group line {
  stroke: #808080 !important;
  stroke-width: 1px !important;
  stroke-dasharray: 0 !important;
  opacity: 0.8 !important;
}

.dark .tracking-group line {
  stroke: #b3b3b3 !important;
}

.axis text {
  font-family: "Inter", sans-serif;
  font-size: 16px !important;
  font-weight: 500;
  fill: var(--color-gray-600);
}

.dark .axis text {
  fill: var(--color-gray-400);
}

.axis .tick text {
  font-size: 16px;
  font-weight: 400;
}

.axis .tick line {
  stroke: var(--color-gray-200);
}

.dark .axis .tick line {
  stroke: var(--color-gray-700);
}

/* ========== LEGENDY ========== */
.legend-container {
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1.5rem;
  row-gap: 0.5rem;
  margin: 0;
  width: 100%;
  border-top: 0 !important;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-gray-700);
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
  line-height: 1.2;
  margin: 0;
}

.dark .legend-item {
  color: var(--color-gray-200);
}

.legend-item:hover {
  color: var(--color-gus-blue);
  font-weight: 600;
}

.dark .legend-item:hover {
  color: var(--color-gus-magenta);
}

.legend-item.inactive {
  opacity: 0.5;
}

.legend-marker {
  width: 12px;
  height: 12px;
  transition:
    background-color 0.3s ease,
    opacity 0.3s ease;
}

.legend-marker-line {
  display: inline-block;
  width: 20px;
  height: 3px;
  vertical-align: middle;
  margin-right: 5px;
  transition: opacity 0.3s ease;
}

.legend-header {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-gray-600);
  text-align: center;
  padding: 0.5rem 1rem 0.25rem 1rem;
  margin-top: 0.25rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-top: 1px solid var(--color-gray-200);
  width: 100%;
}

.dark .legend-header {
  color: var(--color-gray-400);
  border-top-color: var(--color-gray-600);
}

.legend-container {
  padding-top: 0.25rem;
}

/* ========== TOOLTIPY ========== */
.tooltip-d3 {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.15),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(229, 231, 235, 0.8);
  padding: 12px 16px;
  pointer-events: none;
  font-size: 16px;
  font-family: "Inter", sans-serif;
  z-index: 1000;
  backdrop-filter: blur(4px);
  width: max-content;
  animation: tooltipFadeIn 0.15s ease-out;
}

.dark .tooltip-d3 {
  background: rgba(31, 41, 55, 0.75);
  border-color: rgba(75, 85, 99, 0.5);
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.5),
    0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

.tooltip-d3 table {
  border-collapse: collapse;
  width: 100%;
}

.tooltip-d3 th {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 400;
  padding: 8px 12px 8px 8px;
  background-color: #e6e6e6;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  border-radius: 8px 8px 0 0;
  letter-spacing: 0.3px;
  text-transform: none !important;
}

.dark .tooltip-d3 th {
  background-color: #2d3a4e;
  color: #f1f5f9;
  border-bottom-color: var(--color-gray-700);
}

.tooltip-d3 td {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  padding: 8px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.dark .tooltip-d3 td {
  color: #e2e8f0;
  border-bottom-color: var(--color-gray-700);
}

.tooltip-d3 tr:last-child td {
  border-bottom: none;
}

.tooltip-d3 .color-marker {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  vertical-align: middle;
}

.tooltip-d3 td:last-child {
  font-weight: 400;
  text-align: right;
  color: #0f172a;
  font-family: "Inter", monospace;
  letter-spacing: 0.2px;
}

.dark .tooltip-d3 td:last-child {
  color: #f8fafc;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== PRZYPISY ========== */
.footnote {
  font-size: 0.8rem;
  color: var(--color-gray-600);
  padding: 1rem 1.5rem;
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
}

.dark .footnote {
  background: #111827;
  color: var(--color-gray-400);
  border-top-color: var(--color-gray-700);
}

/* ========== SIATKA STRONY ========== */
.grid-container {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}

@media (min-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-container .span-2 {
    grid-column: span 2;
  }
}

.grid-container > * {
  width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 768px) {
  .grid-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .grid-container > * {
    grid-column: 1 !important;
  }
}

/* ========== ELEMENTY WYKRESÓW ========== */
.bar {
  transition: opacity 0.3s ease;
}

.line {
  fill: none;
  stroke-width: 2.5px;
  transition:
    opacity 0.3s ease,
    stroke 0.3s ease;
}

.dot {
  r: 5;
  transition: opacity 0.3s ease;
  stroke: white;
  stroke-width: 1;
}

.grid line,
.grid .domain {
  stroke: #b3b3b3;
  stroke-width: 1px;
  shape-rendering: crispEdges;
}

.dark .grid line,
.dark .grid .domain {
  stroke: #b3b3b3;
}

.bar-label {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 600;
  fill: white;
  pointer-events: none;
}

/* ========== STYLE DLA LUDNOŚĆ ========== */
.split-header {
  display: flex !important;
  position: relative;
  width: 100%;
  padding: 1rem 1.5rem;
  gap: 20px;
  box-sizing: border-box;
  align-items: flex-start !important;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  min-height: 95px;
}

.dark .split-header {
  background: #111827;
  border-bottom-color: var(--color-gray-700);
}

.header-half {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}

.left-half {
  justify-content: flex-start;
  text-align: left;
}

.right-half {
  justify-content: flex-start;
  text-align: left;
  margin-left: 10px;
}

.header-half .chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 100%;
}

.dark .header-half .chart-title {
  color: var(--color-white);
}

.split-header::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background-color: #b3b3b3;
  transform: translateX(-50%);
  opacity: 0.75;
}

.dark .split-header::after {
  background-color: #cccccc;
}

.dual-chart-row-horizontal {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
  height: 100%;
  min-height: 250px;
}

.dual-chart-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.dual-chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--color-gray-600);
  text-align: center;
}

.dark .dual-chart-title {
  color: var(--color-gray-400);
}

.dual-chart-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 250px;
  background: transparent;
  isolation: isolate;
}

.axis-y-left {
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%) rotate(-180deg);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 16px;
  color: var(--color-gray-500);
  font-weight: 500;
  z-index: 5;
  pointer-events: none;
}

.dark .axis-y-left {
  color: var(--color-gray-400);
}

#chart-age-groups,
#chart-fertility-combined {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  position: relative;
}

#chart-age-groups svg,
#chart-fertility-combined svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-svg-container {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.chart-svg-container svg {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.chart-svg-container svg * {
  pointer-events: visible;
}

.chart-card .p-4 {
  height: calc(100% - 180px);
  display: flex;
  flex-direction: column;
}

#fertility-icon,
#mother-age-icon {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  opacity: 1;
  transition: top 0.3s ease;
}

/* ========== STYLE DLA MAPY ========== */
#polska-map {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  padding: 0;
  overflow: visible;
  position: relative;
  transform: translateY(50px);
}

.woj {
  fill: #feeed5;
  stroke: #f5a800;
  stroke-width: 1.5px;
  transition: fill 0.2s ease;
  cursor: pointer;
}

.dark .woj {
  fill: #5f6774;
  stroke: #ffaaaa;
}

.woj:hover {
  fill: #f5a800 !important;
}

.dark .woj:hover {
  fill: var(--color-gus-magenta) !important;
}

.woj-label,
.country-label-map,
.sea-label,
.sea-waves-group {
  pointer-events: none;
  user-select: none;
}

.woj-label {
  font:
    600 14px "Inter",
    "Segoe UI",
    Arial,
    sans-serif;
  fill: #475569;
  letter-spacing: 0.3px;
}

.dark .woj-label {
  fill: #f3f4f6;
}

.external-border-top {
  fill: none !important;
  stroke: #151d29 !important;
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  z-index: 9999;
}

.dark .external-border-top {
  stroke: var(--color-gus-magenta) !important;
}

.neighbor-country {
  fill: #f4f5f6;
  stroke: #828890;
  stroke-width: 1px;
}

.dark .neighbor-country {
  fill: #151d29;
  stroke: #596678;
}

.non-schengen {
  fill: #dcdddd !important;
}

.dark .non-schengen {
  fill: #000000 !important;
}

.country-label-map {
  fill: #768293;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  pointer-events: none;
}

.dark .country-label-map {
  fill: #8593a6;
}

.sea-label {
  fill: var(--color-gus-blue);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.8;
  pointer-events: none;
}

.dark .sea-label {
  opacity: 1;
  fill: aqua;
}

.wave-path {
  fill: var(--color-gus-blue);
  pointer-events: none;
}

.dark .wave-path {
  fill: aqua;
}

.map-info-panel {
  width: 100%;
  margin: 10px 0 0;
  background: #fff;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  border-top: 1px solid #cbd1d8;
  gap: 10px;
  z-index: 5 !important;
  position: relative !important;
  height: 90px;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.dark .map-info-panel {
  background: #1f2937;
  border-top-color: #596678;
  color: #e5e7eb;
}

#sidebar.collapsed ~ main .map-info-panel,
.sidebar.collapsed .map-info-panel {
  z-index: 5 !important;
  position: relative !important;
}

.woj-badge {
  background: var(--color-gus-blue);
  color: white;
  padding: 4px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
  flex-shrink: 1;
}

.dark .woj-badge {
  background: var(--color-gus-magenta);
}

.map-stats {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

/* RESPONSYWNOŚĆMAP INFO PANEL */
@media (max-width: 768px) {
  .map-info-panel {
    height: auto;
    padding: 0;
    gap: 0;
    align-items: stretch;
    overflow: visible;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 8px;
  }

  .dark .map-info-panel {
    border-color: #4b5563;
  }

  .woj-badge {
    display: flex;
    align-items: center;
    border-radius: 11px 11px 0 0;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 700;
    max-width: 100%;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dark .woj-badge {
    border-bottom-color: #4b5563;
  }

  .map-stats {
    display: flex;
    flex-direction: column;
    overflow: visible;
    width: 100%;
    gap: 0;
  }

  .map-stats-right {
    display: contents;
  }

  .map-stat-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.88rem;
  }

  .dark .map-stat-item {
    border-bottom-color: #374151;
  }

  .map-stat-item:last-child {
    border-bottom: none;
  }

  .map-stat-icon {
    width: 16px;
    height: 16px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .map-stat-item > div:not(.map-stat-icon) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .map-stat-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    white-space: nowrap;
  }

  .map-stat-value {
    font-weight: 700;
    font-size: 0.88rem;
    text-align: right;
    max-width: none;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.map-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.map-stats-right {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.map-stat-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gus-blue);
  flex-shrink: 0;
}

.dark .map-stat-icon {
  color: var(--color-gus-magenta);
}

.map-stat-label {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark .map-stat-label {
  color: var(--color-gray-400);
}

.map-stat-value {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
  line-height: 1.3;
}

.dark .map-stat-value {
  color: #f3f4f6;
}

.legend-on-map {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 5 !important;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #cbd1d8;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  min-width: 160px;
  cursor: default;
}

.legend-on-map * {
  cursor: default;
}

.dark .legend-on-map {
  background: rgba(31, 41, 55, 0.9);
  border-color: #596678;
  color: #e5e7eb;
}

.legend-line {
  width: 36px;
  height: 2px;
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.legend-line.woj-line {
  border-bottom: 2px solid #f5a800;
}

.dark .legend-line.woj-line {
  border-bottom-color: #ffaaaa;
}

.legend-line.country-line {
  border-bottom: 2px solid #596678;
}

.dark .legend-line.country-line {
  border-bottom-color: #828890;
}

.legend-line.schengen-line {
  border-bottom: 6px solid #151d29;
}

.dark .legend-line.schengen-line {
  border-bottom-color: var(--color-gus-magenta);
}

.legend-color.area-square {
  width: 36px;
  height: 18px;
  border-radius: 4px;
  background: #feeed5;
  border: 2px solid #f5a800;
  flex-shrink: 0;
}

.dark .legend-color.area-square {
  background: #5f6774;
  border-color: #ffaaaa;
}

.legend-text {
  font-weight: 500;
  white-space: nowrap;
  color: inherit;
  font-size: 0.8rem;
}

/* ========== STYLE DLA EDUKACJI ========== */
.charts-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  min-height: 350px;
}

.chart-wrapper {
  flex: 1;
  position: relative;
  min-width: 200px;
}

.chart-labels-row {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-bottom: 10px;
}

.chart-container1,
.chart-container2 {
  flex: 1;
  text-align: center;
  font-size: 1rem;
}

.dark .chart-container1,
.dark .chart-container2 {
  color: var(--color-gray-200);
}

.schools-labels {
  position: relative;
  width: 120px;
  height: 350px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  flex-shrink: 0;
}

.school-label {
  position: absolute;
  width: 100%;
  left: 0;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.school-label .label-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  font-size: 16px;
}

.school-label .line1,
.school-label .line2 {
  display: block;
  white-space: nowrap;
}

.school-label:not([data-school="higher education institutions"]) .label-text {
  display: inline-block;
  white-space: nowrap;
}

.school-label[data-school="higher education institutions"] .label-text {
  transform: translateY(0);
}

.school-label.header .label-text {
  font-weight: 700;
  color: var(--color-gray-700);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark .school-label.header .label-text {
  color: var(--color-gray-400);
}

.dark .school-label .label-text {
  color: var(--color-gray-400);
}

.schools-labels {
  display: block;
}

.flex-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.container2 {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 5px;
  padding-left: 10px;
}

.container2 .left {
  width: 30px;
  font-weight: 500;
  color: var(--color-gray-600);
}

.dark .container2 .left {
  color: var(--color-gray-400);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========== STYLE DLA RYNKU PRACY ========== */
.percent-symbol {
  background: transparent;
  letter-spacing: 1px;
}

/* ========== STYLE DLA ZDROWIE ========== */
.charts-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 1rem;
}

.charts-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.chart-wrapper-small {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 220px;
  height: 220px;
}

.chart-labels-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}

.chart-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-gray-600);
}

.dark .chart-label {
  color: var(--color-gray-400);
}

.grid-containerZdrowie {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

/* ========== STYLE DLA KULTURY I TURYSTYKI ========== */
.grid-container-kultura {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}

@media (min-width: 1024px) {
  .grid-container-kultura {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-container-kultura .span-2 {
    grid-column: span 2;
  }
}

.kultura-chart-container {
  width: 100%;
  height: 350px;
  position: relative;
}

#chart32-d3 {
  width: 100%;
  position: relative;
}

.chart-container-horizontal .axis-left text {
  font-size: 12px !important;
}

.dark .kultura-chart-container svg text,
.dark #chart30-d3 svg text,
.dark #chart31-d3 svg text,
.dark #chart32-d3 svg text {
  fill: var(--color-gray-400) !important;
}

.dark .kultura-chart-container svg .axis text,
.dark #chart30-d3 svg .axis text,
.dark #chart31-d3 svg .axis text,
.dark #chart32-d3 svg .axis text {
  fill: var(--color-gray-400) !important;
}

.dark #chart31-d3 svg .axis-left text,
.dark #chart32-d3 svg .axis-left text {
  fill: var(--color-gray-400) !important;
  font-weight: 500;
}

.dark #chart30-d3 svg .axis-x text {
  fill: var(--color-gray-400) !important;
  font-weight: 500;
}

.dark .kultura-chart-container svg .axis-label {
  fill: var(--color-gray-400) !important;
}

@media (max-width: 768px) {
  .kultura-chart-container {
    height: 300px;
  }

  #chart32-d3 {
    height: 450px;
  }
}

@media (max-width: 480px) {
  .kultura-chart-container {
    height: 280px;
  }

  #chart32-d3 {
    height: 400px;
  }

  .dark #chart30-d3 svg .axis-x text,
  .dark #chart31-d3 svg .axis-left text,
  .dark #chart32-d3 svg .axis-left text {
    font-size: 11px !important;
  }
}

/* ========== BUDOWNICTWO ========== */
.bg-gray-400 {
  background-color: #b3b3b3;
}

.bg-gold {
  background-color: #f5a800;
}

.dark .bg-gray-400 {
  background-color: #ff00ff;
}

.dark .bg-gold {
  background-color: #00ff00;
}

.year-separator {
  stroke-width: 1.5px !important;
  stroke-dasharray: 10, 5 !important;
}

.stacked-bar-segment {
  transition:
    opacity 0.3s ease,
    stroke 0.2s ease;
  cursor: pointer;
}

.stacked-bar-segment:hover {
  stroke: #000;
  stroke-width: 2px;
  filter: brightness(1.1);
}

.dark .stacked-bar-segment:hover {
  stroke: #fff;
}

.pie-segment {
  transition:
    opacity 0.3s ease,
    stroke 0.2s ease;
  cursor: pointer;
}

.pie-segment:hover {
  stroke: #000;
  stroke-width: 2px;
  filter: brightness(1.1);
}

.dark .pie-segment:hover {
  stroke: #fff;
}

.tooltip-d3.budownictwo-tooltip table {
  border-collapse: collapse;
  width: 100%;
}

.tooltip-d3.budownictwo-tooltip th {
  font-size: 11px;
  padding: 8px 10px;
}

.tooltip-d3.budownictwo-tooltip td {
  font-size: 11px;
  padding: 6px 8px;
}

.legend-item[data-chart="budownictwo48"],
.legend-item[data-chart="budownictwo49-52"] {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.legend-item[data-chart="budownictwo48"].inactive,
.legend-item[data-chart="budownictwo49-52"].inactive {
  opacity: 0.5;
}

#chart48-d3,
#chart49-d3,
#chart50-d3,
#chart51-d3,
#chart52-d3 {
  width: 100%;
  height: 100%;
  min-height: 200px;
}

@media (max-width: 768px) {
  .flex-row.items-stretch.justify-center.gap-2.sm\:gap-4 {
    flex-wrap: wrap;
  }

  #chart49-d3,
  #chart50-d3,
  #chart51-d3,
  #chart52-d3 {
    min-height: 180px;
  }
}

@media (max-width: 480px) {
  #chart48-d3 {
    min-height: 300px;
  }

  #chart49-d3,
  #chart50-d3,
  #chart51-d3,
  #chart52-d3 {
    min-height: 160px;
  }
}

/* ========== MEDIA QUERIES ========== */
@media (max-width: 1024px) {
  .map-info-panel,
  .map-stats {
    justify-content: center !important;
  }
}

@media (max-width: 768px) {
  .split-header {
    flex-direction: column;
    gap: 8px;
  }

  .header-half {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .right-half {
    justify-content: flex-start;
  }

  .split-header::after {
    display: none;
  }

  .dual-chart-row-horizontal {
    flex-direction: column;
  }

  .dual-chart-wrapper {
    display: flex;
    flex-direction: column;
    height: 280px;
  }

  .grid-container .chart-card,
  .grid-container .table-wrapper {
    grid-column: 1 !important;
  }

  .schools-labels {
    width: 80px;
    height: 300px;
  }

  .school-label .label-text {
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
  }

  .school-label.header .label-text {
    font-size: 14px;
  }

  .flex-row {
    gap: 10px;
  }

  #chart-age-groups {
    min-height: 250px;
  }
}

@media (max-width: 768px) and (min-width: 641px) {
  .scroll-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .table-container table {
    min-width: 450px;
  }

  .schools-labels {
    width: 70px;
  }

  .school-label .label-text {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .prose-sm {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .prose-sm table {
    font-size: 0.75rem;
  }

  .prose-sm td,
  .prose-sm th {
    padding: 0.5rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .prose-sm td,
  .prose-sm th {
    padding: 0.75rem 0.5rem;
  }
}

#page-content .font-inter,
#page-content [class*="explanations"],
#page-content .prose {
  font-family: "Inter", sans-serif;
}

#page-content table {
  font-family: "Inter", sans-serif;
}

#page-content table td,
#page-content table th {
  font-family: "Inter", sans-serif;
}

#page-content .font-mono {
  font-family:
    "SF Mono", "Menlo", "Monaco", "Cascadia Code", "Consolas", monospace;
}

svg:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

svg:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-gus-blue);
  outline-offset: 2px;
}

.dark svg:focus-visible,
.dark [tabindex]:focus-visible {
  outline-color: var(--color-gus-magenta);
}

/* ========== SIDEBAR CUSTOM ========== */
#sidebar.collapsed .nav-btn:hover::after,
#sidebar.collapsed .nav-btn:hover::before {
  display: none !important;
  content: none !important;
}

#sidebar.collapsed .nav-btn:hover {
  background: transparent !important;
}

.custom-sidebar-tooltip {
  position: fixed;
  background: linear-gradient(135deg, #001d77 0%, #1a3485 100%);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-family: "Inter", sans-serif;
  z-index: 10000;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  white-space: nowrap;
  display: none;
  max-width: 420px;
  white-space: normal;
  line-height: 1.4;
}
.custom-sidebar-tooltip .tooltip-english {
  font-weight: 600;
}

.dark .custom-sidebar-tooltip {
  background: linear-gradient(135deg, #ff00ff 0%, #ff4dff 100%);
}
