/* Finecharts dashboard — Bootstrap 5 + dark mode (loads after finecharts.css) */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --fc-accent: #0d9488;
  --fc-accent-2: #6366f1;
  --fc-accent-soft: rgba(13, 148, 136, 0.15);
  --fc-page-gradient-start: #f8fafc;
  --fc-page-gradient-end: #eef2f7;
  --fc-glass: rgba(255, 255, 255, 0.72);
  --fc-navbar-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] {
  --fc-page-gradient-start: #0f1419;
  --fc-page-gradient-end: #1a222d;
  --fc-glass: rgba(30, 41, 59, 0.85);
  --fc-navbar-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* Base fill so overscroll / gaps never flash light; theme sheet loads last to beat legacy demo.css */
html {
  background-color: var(--bs-body-bg);
}

body {
  font-family: "Plus Jakarta Sans", "Open Sans", "Segoe UI", system-ui, sans-serif;
  background-color: var(--bs-body-bg);
  background-image: linear-gradient(
    165deg,
    var(--fc-page-gradient-start) 0%,
    var(--fc-page-gradient-end) 45%,
    var(--bs-body-bg) 100%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  min-height: 100vh;
  color: var(--bs-body-color);
}

/* No backdrop-filter here — it creates a containing block and breaks dropdown Popper
   positioning (menus appear offset or under content). Solid/mixed bg only. */
.navbar-main {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--fc-accent) 3%) !important;
  box-shadow: var(--fc-navbar-shadow);
  position: relative;
  z-index: 1040;
}

[data-bs-theme="dark"] .navbar-main {
  background: color-mix(in srgb, var(--bs-body-bg) 96%, var(--fc-accent) 4%) !important;
}

.navbar-main.fc-navbar-modern {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.navbar-main.fc-navbar-modern::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--fc-accent) 35%, var(--bs-border-color)),
    transparent
  );
  pointer-events: none;
  opacity: 0.85;
}

/* Let dropdowns escape the collapse box on desktop */
.navbar-main .navbar-collapse {
  overflow: visible !important;
}

@media (max-width: 991.98px) {
  .navbar-main .navbar-collapse:not(.show) {
    overflow: hidden !important;
  }

  .navbar-main .navbar-collapse.show {
    overflow-y: auto !important;
    overflow-x: visible !important;
    max-height: min(85vh, 100%);
    -webkit-overflow-scrolling: touch;
    margin-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid var(--bs-border-color);
  }
}

.navbar-main .nav-item.dropdown {
  position: relative;
}

/* Menus above page content; must beat cards, chart canvases, and legacy z-index rules */
.navbar-main .dropdown-menu {
  z-index: 1065 !important;
}

.navbar-main .nav-item .dropdown-menu {
  top: 100% !important;
  margin-top: 0.35rem !important;
}

.navbar-main .navbar-brand {
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.fc-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, var(--fc-accent) 0%, var(--fc-accent-2) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.navbar-main .nav-link {
  font-weight: 500;
  border-radius: 0.5rem;
  padding: 0.5rem 0.85rem !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link:focus {
  background: var(--bs-tertiary-bg);
}

.navbar-main .nav-link.dropdown-toggle::after {
  margin-left: 0.35em;
  vertical-align: 0.12em;
}

/* Charts mega menu */
.fc-charts-mega.dropdown-menu {
  min-width: min(100vw - 2rem, 26rem);
  padding: 0;
  border-radius: 1rem !important;
  overflow: hidden;
  border: 1px solid var(--bs-border-color) !important;
}

.fc-charts-mega.dropdown-menu.fc-charts-mega--lg {
  min-width: min(100vw - 2rem, 44rem);
}

@media (min-width: 992px) {
  .fc-charts-mega.dropdown-menu {
    min-width: 22rem;
  }

  .fc-charts-mega.dropdown-menu.fc-charts-mega--lg {
    min-width: 42rem;
  }
}

.fc-charts-mega--lg .fc-mega-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 575.98px) {
  .fc-charts-mega--lg .fc-mega-grid {
    grid-template-columns: 1fr;
  }
}

.fc-mega-head {
  padding: 1rem 1.25rem;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--fc-accent) 12%, transparent),
    color-mix(in srgb, var(--fc-accent-2) 10%, transparent)
  );
  border-bottom: 1px solid var(--bs-border-color);
}

.fc-mega-head h6 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.fc-mega-head p {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

.fc-mega-grid {
  padding: 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.fc-mega-link {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 0.85rem;
  border-radius: 0.65rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s ease, transform 0.18s ease;
}

.fc-mega-link:hover {
  background: var(--bs-tertiary-bg);
  color: inherit;
  transform: translateX(2px);
}

.fc-mega-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.fc-mega-icon.teal {
  background: color-mix(in srgb, var(--fc-accent) 18%, transparent);
  color: var(--fc-accent);
}

.fc-mega-icon.indigo {
  background: color-mix(in srgb, var(--fc-accent-2) 18%, transparent);
  color: var(--fc-accent-2);
}

.fc-mega-icon.amber {
  background: color-mix(in srgb, #f59e0b 22%, transparent);
  color: #d97706;
}

.fc-mega-icon.rose {
  background: color-mix(in srgb, #f43f5e 18%, transparent);
  color: #e11d48;
}

.fc-mega-icon.slate {
  background: color-mix(in srgb, var(--bs-secondary-color) 22%, transparent);
  color: var(--bs-body-color);
}

.fc-mega-icon.sky {
  background: color-mix(in srgb, #38bdf8 20%, transparent);
  color: #0284c7;
}

.fc-mega-icon.violet {
  background: color-mix(in srgb, #a78bfa 20%, transparent);
  color: #7c3aed;
}

/* Chart demo containers: predictable height on small screens */
.fc-chart-host {
  width: 100%;
  min-height: 240px;
  position: relative;
}

.fc-mega-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
}

.fc-mega-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.fc-mega-foot {
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid var(--bs-border-color);
  text-align: center;
}

.fc-mega-foot a {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Nav icon triggers */
.fc-nav-pill {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem !important;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color) !important;
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.fc-nav-pill:hover,
.fc-nav-pill:focus {
  background: color-mix(in srgb, var(--fc-accent) 15%, var(--bs-tertiary-bg));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--fc-accent) 25%, transparent);
}

.fc-nav-pill::after {
  display: none !important;
}

.fc-nav-pill .badge {
  font-size: 0.6rem !important;
  padding: 0.2em 0.45em;
}

/* Inbox / alerts dropdown panels */
.fc-dropdown-panel.dropdown-menu {
  min-width: 19rem;
  max-width: 22rem;
  padding: 0;
  border: 1px solid var(--bs-border-color) !important;
  border-radius: 1rem !important;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] .fc-dropdown-panel.dropdown-menu {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.fc-dropdown-panel .fc-dd-header {
  padding: 1rem 1.15rem;
  background: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fc-dropdown-panel .fc-dd-header strong {
  font-size: 0.95rem;
}

.fc-dropdown-panel .fc-dd-header .badge {
  font-weight: 600;
}

.fc-dd-row {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--bs-border-color);
  transition: background 0.15s ease;
}

.fc-dd-row:last-of-type {
  border-bottom: none;
}

a.fc-dd-row {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.fc-dd-row:hover {
  background: var(--bs-tertiary-bg);
}

.fc-dd-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bs-border-color);
}

.fc-dd-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.fc-dd-footer {
  padding: 0.65rem 1rem;
  background: var(--bs-tertiary-bg);
  border-top: 1px solid var(--bs-border-color);
  text-align: center;
}

.fc-dd-footer a {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Page hero */
.fc-page-hero {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--bs-body-bg) 100%, transparent) 0%,
    color-mix(in srgb, var(--bs-tertiary-bg) 55%, var(--bs-body-bg)) 100%
  );
  border-bottom: 1px solid var(--bs-border-color);
  position: relative;
  overflow: visible;
}

.fc-page-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--fc-accent), var(--fc-accent-2));
  border-radius: 0 4px 4px 0;
  z-index: 1;
}

.fc-page-hero-inner {
  padding: 1.35rem 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  position: relative;
  z-index: 2;
}

@media (min-width: 992px) {
  .fc-page-hero-inner {
    padding: 1.5rem 2rem 1.65rem 2rem;
  }
}

.fc-page-hero-copy {
  flex: 1 1 12rem;
  min-width: 0;
}

.fc-page-hero-nav {
  flex: 0 0 auto;
}

.fc-page-hero h1,
.fc-page-hero .fc-hero-title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.fc-page-hero .fc-hero-lead {
  margin: 0;
  max-width: 42rem;
  line-height: 1.5;
}

/* Pill breadcrumb */
.fc-breadcrumb.breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.35rem;
  column-gap: 0.2rem;
  padding: 0.55rem 1.1rem 0.55rem 0.95rem;
  margin: 0 !important;
  list-style: none;
  border-radius: 2rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  font-size: 0.75rem;
  font-weight: 600;
  --bs-breadcrumb-divider: "";
}

[data-bs-theme="dark"] .fc-breadcrumb.breadcrumb {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.fc-breadcrumb .breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.fc-breadcrumb .breadcrumb-item + .breadcrumb-item {
  padding-left: 0;
}

.fc-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  float: none;
  padding-right: 0.55rem;
  padding-left: 0.35rem;
  font-size: 1rem;
  line-height: 1;
  font-weight: 400;
  color: var(--bs-secondary-color);
  opacity: 0.65;
}

.fc-breadcrumb .breadcrumb-item a {
  color: var(--bs-secondary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 1rem;
  padding: 0.2rem 0.5rem;
  margin: -0.15rem -0.25rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.fc-breadcrumb .breadcrumb-item a:hover {
  color: var(--fc-accent);
  background: color-mix(in srgb, var(--fc-accent) 10%, transparent);
}

.fc-breadcrumb .breadcrumb-item.active {
  color: var(--bs-body-color);
  padding: 0.25rem 0.65rem;
  margin-left: 0.1rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--fc-accent) 12%, transparent);
}

/* Middle segments (plain text, not links) */
.fc-breadcrumb .breadcrumb-item:not(.active):not(:has(a)) {
  padding: 0.2rem 0.35rem;
  color: var(--bs-secondary-color);
}

.fc-breadcrumb .breadcrumb-item a .bi {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Dashboard intro + stat strip */
.fc-dash-intro {
  margin-bottom: 0.5rem;
}

.fc-stat-card {
  height: 100%;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fc-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

[data-bs-theme="dark"] .fc-stat-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.fc-stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5rem;
  height: 5rem;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--fc-accent) 12%, transparent), transparent 70%);
  pointer-events: none;
}

.fc-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 0.35rem;
}

.fc-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.fc-stat-delta {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.fc-stat-delta.up {
  color: var(--fc-accent);
}

.fc-stat-delta.down {
  color: #e11d48;
}

/* Good-news metric even when the arrow points down (e.g. lower latency) */
.fc-stat-delta.fc-stat-delta--good {
  color: #14b8a6;
}

[data-bs-theme="dark"] .fc-stat-delta.fc-stat-delta--good {
  color: #5eead4;
}

/* KPI row: metrics + live sparkline */
.fc-stat-card.fc-stat-card--kpi {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: 6.75rem;
}

.fc-stat-card.fc-stat-card--kpi::after {
  display: none;
}

.fc-stat-card.fc-stat-card--kpi .fc-stat-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fc-stat-card.fc-stat-card--kpi .fc-stat-chart {
  flex: 0 0 auto;
  align-self: center;
  width: 6.5rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.fc-stat-card.fc-stat-card--kpi .fc-stat-chart canvas {
  display: block;
  max-width: 100%;
}

.fc-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.fc-section-head h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin: 0;
}

.fc-section-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.page-heading {
  background: var(--bs-body-bg) !important;
  border-color: var(--bs-border-color) !important;
}

.gray-bg,
.bg-muted {
  background-color: var(--bs-secondary-bg) !important;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.white-bg {
  background-color: var(--bs-body-bg) !important;
}

.wrapper-content {
  padding: 1.5rem 1rem 2.5rem;
}

@media (min-width: 992px) {
  .wrapper-content {
    padding: 1.75rem 1.5rem 3rem;
  }
}

/* Card-style chart panels */
.fc-feature-band {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--fc-accent) 6%, var(--bs-secondary-bg)),
    var(--bs-secondary-bg) 55%,
    color-mix(in srgb, var(--fc-accent-2) 5%, var(--bs-secondary-bg))
  );
  border: 1px solid var(--bs-border-color);
}

.finecharts.finecharts-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.06);
  /* visible so header tool dropdowns are not clipped (Popper positions menu below toggle) */
  overflow: visible;
  margin-bottom: 1.5rem;
  background: var(--bs-body-bg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.finecharts.finecharts-card:hover {
  border-color: color-mix(in srgb, var(--fc-accent) 28%, var(--bs-border-color));
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.08);
}

[data-bs-theme="dark"] .finecharts.finecharts-card:hover {
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .finecharts.finecharts-card {
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.35);
}

.finecharts.finecharts-card .finecharts-title {
  background: var(--bs-tertiary-bg);
  border: none;
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.875rem 1.125rem;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 1rem 1rem 0 0;
  overflow: visible;
  position: relative;
  z-index: 20;
}

.finecharts.finecharts-card .finecharts-title h5 {
  float: none;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.finecharts.finecharts-card .finecharts-title h5 small {
  font-weight: 400;
  color: var(--bs-secondary-color);
}

.finecharts.finecharts-card .finecharts-content {
  background: var(--bs-body-bg);
  border: none;
  padding: 1.125rem 1.25rem 1.25rem;
  position: relative;
  z-index: 0;
  border-radius: 0 0 1rem 1rem;
}

.finecharts.finecharts-card .finecharts-tools {
  float: none;
  text-align: right;
  margin: 0;
  position: relative;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.125rem;
}

.finecharts.finecharts-card .finecharts-tools a {
  color: var(--bs-secondary-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.finecharts.finecharts-card .finecharts-tools a:hover {
  background: var(--fc-accent-soft);
  color: var(--fc-accent);
}

.finecharts-tools.dropdown,
.finecharts-tools .dropdown {
  position: relative;
  z-index: 2;
}

/*
 * Card tool menus: style-demo.css sets .dropdown-menu { left:0; padding:0; float:left } and
 * .dropdown-menu > li > a { margin:4px } which misaligns BS5 + Popper and pulls labels off the panel.
 */
.finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu {
  z-index: 1085 !important;
  float: none !important;
  /* Beat style-demo left:0 so Popper + dropdown-menu-end can align; do not set top (Popper handles Y) */
  left: auto;
  right: auto;
  text-align: start !important;
  min-width: 13rem;
  padding: 0.35rem 0.4rem !important;
  margin: 0 !important;
  margin-top: 0.35rem !important;
  list-style: none !important;
  border-radius: 0.75rem !important;
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 88%, transparent) !important;
  background: var(--bs-body-bg) !important;
  background-clip: padding-box !important;
  box-shadow:
    0 0.25rem 0.5rem color-mix(in srgb, var(--bs-body-color) 6%, transparent),
    0 1rem 2.25rem rgba(15, 23, 42, 0.14) !important;
  box-sizing: border-box;
}

.finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu > li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  width: 100%;
}

/* Kill legacy .dropdown-menu > li > a { margin:4px } + finecharts.css padding — items must span full menu width */
.finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu > li > a.dropdown-item,
.finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu .dropdown-item {
  border-radius: 0.5rem !important;
  padding: 0.55rem 0.85rem !important;
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  font-size: 0.875rem !important;
  font-weight: 500;
  line-height: 1.4 !important;
  color: var(--bs-body-color) !important;
  white-space: nowrap;
  text-align: start !important;
  text-indent: 0 !important;
}

.finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu .dropdown-item:hover,
.finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu .dropdown-item:focus {
  background: var(--fc-accent-soft) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .finecharts.finecharts-card .finecharts-tools .dropdown > ul.dropdown-menu.fc-finecharts-dropdown-menu {
  box-shadow:
    0 0.35rem 0.75rem rgba(0, 0, 0, 0.45),
    0 1.25rem 2.5rem rgba(0, 0, 0, 0.55) !important;
  border-color: color-mix(in srgb, var(--bs-border-color) 70%, transparent) !important;
}

.finecharts .collapse-link .bi {
  transition: transform 0.2s ease;
  display: inline-block;
}

.footer {
  border-top: 1px solid var(--bs-border-color) !important;
  padding: 1.25rem 1rem;
  margin-top: 2rem;
  color: var(--bs-secondary-color);
  background: var(--bs-body-bg) !important;
}

.dropdown-messages-box .d-flex {
  font-size: 0.8125rem;
}

.h-200 {
  min-height: 200px;
}

.h-80 {
  min-height: 80px;
}

.theme-toggle-btn .bi {
  font-size: 1.1rem;
  vertical-align: -0.125em;
}

/* Peity gallery — overrides legacy finecharts.css pre { color: darkred !important } */
.fc-peity-page .fc-peity-table {
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bs-body-bg);
}

.fc-peity-page .fc-peity-table thead th {
  background: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: var(--bs-border-color) !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
}

.fc-peity-page .fc-peity-table tbody td {
  border-color: var(--bs-border-color);
  padding: 0.85rem 0.85rem;
  vertical-align: middle;
}

.fc-peity-page .fc-peity-table tbody td:first-child {
  background: color-mix(in srgb, var(--bs-secondary-bg) 55%, var(--bs-body-bg));
  text-align: center;
  width: 38%;
}

.fc-peity-page .fc-peity-table pre,
.fc-peity-page .fc-peity-table code {
  display: block;
  margin: 0;
  padding: 0.55rem 0.65rem !important;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--bs-body-color) !important;
  background: color-mix(in srgb, var(--bs-tertiary-bg) 88%, transparent) !important;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
}

.fc-peity-page .fc-peity-table code {
  display: inline-block;
  white-space: pre-wrap;
}

.fc-peity-page svg.peity {
  vertical-align: middle;
  overflow: visible;
}

.fc-peity-page svg.peity polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fc-peity-page .fc-peity-table tbody td:first-child svg.peity {
  filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--bs-body-color) 8%, transparent));
}

[data-bs-theme="dark"] .fc-peity-page .fc-peity-table tbody td:first-child svg.peity {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

@media (max-width: 767.98px) {
  .fc-peity-page .finecharts-card > div:has(table.fc-peity-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* -------------------------------------------------------------------------- */
/* Bootstrap 5+ layout: mobile-first shell (navbar excluded — already solid) */
/* -------------------------------------------------------------------------- */

#wrapper {
  max-width: 100%;
  overflow-x: clip;
}

.fc-page-hero-inner {
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.fc-section-head > div:first-child {
  flex: 1 1 14rem;
  min-width: 0;
}

.fc-stat-value {
  font-size: clamp(1.2rem, 4.2vw, 1.5rem);
}

@media (max-width: 575.98px) {
  .fc-stat-card.fc-stat-card--kpi {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 1rem 1rem;
  }

  .fc-stat-card.fc-stat-card--kpi .fc-stat-chart {
    width: 100%;
    justify-content: center;
  }

  .fc-stat-card.fc-stat-card--kpi .fc-stat-chart canvas {
    margin: 0 auto;
  }
}

.finecharts.finecharts-card .finecharts-title {
  row-gap: 0.5rem;
}

.finecharts.finecharts-card .finecharts-title h5 {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0.5rem;
}

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

.finecharts.finecharts-content .sparkline,
.finecharts.finecharts-content [id^='sparkline'],
.finecharts.finecharts-content [id^='line'] {
  display: block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.wrapper-content .row {
  --bs-gutter-x: 1rem;
}

@media (min-width: 576px) {
  .wrapper-content .row {
    --bs-gutter-x: 1.5rem;
  }
}
