/* CSS Variables */
:root {
  /* Main content - Light */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Sidebar - Dark Navy */
  --sidebar-bg: #1e2a3b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: rgba(59, 130, 246, 0.15);
  --sidebar-border: rgba(255, 255, 255, 0.08);

  /* Accents */
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --radius: 8px;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove outlines on all interactive elements */
button,
input,
select,
textarea,
a,
[role="button"],
.btn,
.filter-select,
.filter-date,
.multi-select-trigger {
  outline: none !important;
}

button:focus,
button:active,
button:focus-visible,
input:focus,
input:active,
input:focus-visible,
select:focus,
select:active,
select:focus-visible,
textarea:focus,
textarea:active,
textarea:focus-visible,
a:focus,
a:active,
a:focus-visible,
[role="button"]:focus,
[role="button"]:active,
[role="button"]:focus-visible {
  outline: none !important;
  box-shadow: none;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: fadeIn ease 3s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

/* Scroll lock when menu is open */
html.menu-open,
html.menu-open body {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* App Layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 225px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  padding: 24px 12px;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.logo {
  padding: 0 12px;
  margin-bottom: 0;
  color: var(--sidebar-text-active);
}

.logo-subtitle {
  padding: 0 12px;
  font-size: 0.635rem;
  font-weight: 500;
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  margin-top: -4px;
  margin-bottom: 24px;
}

.logo-icon {
  display: none;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

.nav-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0;
}

/* Hide scrollbar but keep functionality */
.nav-section::-webkit-scrollbar {
  width: 4px;
}

.nav-section::-webkit-scrollbar-track {
  background: transparent;
}

.nav-section::-webkit-scrollbar-thumb {
  background-color: var(--sidebar-border);
  border-radius: 2px;
}

.nav-section::-webkit-scrollbar-thumb:hover {
  background-color: var(--sidebar-text);
}

.nav-section-title {
  padding: 0 12px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  margin-bottom: 8px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-item:hover {
  color: var(--sidebar-text-active);
  background-color: var(--sidebar-hover);
}

.nav-item.active {
  color: var(--sidebar-text-active);
  background-color: var(--sidebar-active);
}

/* Nav Item with Submenu */
.nav-item-group,
.nav-item-with-submenu {
  display: flex;
  flex-direction: column;
}

.nav-item.has-submenu {
  justify-content: flex-start;
}

.nav-item .submenu-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.nav-item-group.open .nav-item .submenu-arrow,
.nav-item-with-submenu.open .nav-item .submenu-arrow {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  padding-left: 28px;
  margin-top: 2px;
}

.nav-item-group.open .nav-submenu,
.nav-item-with-submenu.open .nav-submenu {
  display: flex;
}

.nav-submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-submenu-item:hover {
  color: var(--sidebar-text-active);
  background-color: var(--sidebar-hover);
}

.nav-submenu-item.active {
  color: var(--sidebar-text-active);
  background-color: var(--sidebar-active);
}

.nav-submenu-item::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.5;
}

.nav-footer {
  border-top: 1px solid var(--sidebar-border);
  padding-top: 16px;
  margin-top: auto;
  flex-shrink: 0;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  position: relative;
}

.user-profile:hover {
  background-color: var(--sidebar-hover);
}

/* User Dropdown Menu */
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 200px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.15s ease;
  z-index: 999999 !important;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: background-color 0.1s ease;
}

.user-dropdown-item:hover {
  background-color: #f1f5f9;
}

.user-dropdown-item svg {
  color: #64748b;
  flex-shrink: 0;
}

.user-dropdown-item.has-submenu {
  justify-content: flex-start;
}

.user-dropdown-item .submenu-arrow {
  margin-left: auto;
  color: #94a3b8;
}

.user-dropdown-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 6px 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-initials {
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sidebar-text-active);
}

.user-role {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sidebar-text);
}

/* Page Fade-in Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Main Content */
.main {
  flex: 1;
  margin-left: 225px;
  padding: 32px 40px;
  background-color: var(--bg-primary);
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Date Filter - Button Group Style */
.date-filter-group {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.date-btn {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border-right: 1px solid var(--border-color);
}

.date-btn:last-child {
  border-right: none;
}

.date-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.date-btn.active {
  background-color: #233857;
  color: #ffffff;
}

/* Stats Grid */
.stats-grid,
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: grid;
  grid-template-columns: 35% 65%;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.stat-content {
  min-width: 0;
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sidebar-bg);
  margin-bottom: 6px;
  line-height: 1.3;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.stat-change.positive {
  color: var(--accent-green);
}

.stat-change.negative {
  color: var(--accent-red);
}

.stat-sparkline-container {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-sparkline {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.charts-grid>.chart-card {
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

.charts-grid>.chart-card .chart-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.chart-card:first-child {
  margin-top: 0;
}

.chart-card-full {
  width: 100%;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.chart-action {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.chart-action:hover {
  color: var(--text-primary);
}

.chart-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.blue {
  background-color: var(--accent-blue);
}

.dot.green {
  background-color: var(--accent-green);
}

.dot.cyan {
  background-color: var(--accent-cyan);
}

.dot.yellow {
  background-color: var(--accent-yellow);
}

.chart-body {
  height: 220px;
  position: relative;
  width: 100%;
  min-width: 0;
}

.chart-body canvas {
  max-width: 100%;
}

/* Chart.js Tooltip Fix */
.chart-card {
  position: relative;
  overflow: visible !important;
}

.chart-body,
.chart-donut {
  overflow: visible !important;
}

/* Pie Charts Row - Equal Height Layout */
.pie-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.pie-charts-row .chart-card {
  height: 380px !important;
  overflow: hidden !important;
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

.pie-charts-row .chart-body {
  height: 320px !important;
  overflow: hidden !important;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.chart-body canvas,
.chart-donut canvas {
  overflow: visible !important;
}

/* Force Chart.js tooltip to appear above everything */
#chartjs-tooltip,
.chartjs-tooltip,
div[class*="chartjs"] {
  z-index: 99999 !important;
  pointer-events: none;
}

/* Donut chart with side legend */
.chart-with-legend {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 220px;
}

.chart-donut {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  position: relative;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.donut-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sidebar-bg);
}

.donut-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex: 1;
}

.legend-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Bottom Grid - Tables and Activity */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bottom-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.bottom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.bottom-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bottom-action {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.bottom-action:hover {
  color: var(--text-primary);
}

/* Top Pages Table */
.pages-table {
  width: 100%;
}

.pages-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 0.8fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pages-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 0.8fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  font-size: 0.8125rem;
}

.pages-row:last-child {
  border-bottom: none;
}

.page-name {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.page-views {
  color: var(--text-secondary);
}

.share-bar {
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.share-fill {
  height: 100%;
  background-color: var(--accent-blue);
  border-radius: 2px;
}

.page-status {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-status.top {
  color: var(--accent-blue);
}

.page-status.high {
  color: var(--accent-blue);
}

.page-status.mid {
  color: var(--accent-blue);
}

.page-status.low {
  color: var(--accent-blue);
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 6px;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================ */
/* Overview Page Styles */
/* ============================================ */

/* Hero KPI Cards Grid */
.overview-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.overview-hero-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overview-hero-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overview-hero-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.overview-hero-badge.positive {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.overview-hero-badge.negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.overview-hero-value {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.overview-hero-chart {
  height: 48px;
  margin: 4px 0;
}

.overview-hero-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.overview-hero-footer {
  margin-top: auto;
}

.overview-hero-compare {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Overview Chart Section */
.overview-chart-section {
  margin-bottom: 24px;
}

/* Overview Stats Grid */
.overview-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.overview-stats-grid.overview-stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.overview-stats-grid.overview-stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.overview-hero-grid.overview-hero-grid-single {
  grid-template-columns: 1fr;
  margin-bottom: 24px;
}

.overview-hero-grid.overview-hero-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 24px;
}

.overview-stats-grid.overview-stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.overview-stats-grid.overview-stats-grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

.overview-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 26px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: center;
  justify-content: center;
}

.overview-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.overview-stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.overview-stat-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overview-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.overview-stat-change {
  font-size: 0.6875rem;
  font-weight: 500;
}

.overview-stat-change.positive {
  color: #10b981;
}

.overview-stat-change.negative {
  color: #ef4444;
}

/* Overview Rates Section */
.overview-rates-section {
  margin-bottom: 24px;
}

.overview-rates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  padding: 8px 0;
}

.overview-rate-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-rate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overview-rate-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overview-rate-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.overview-rate-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.overview-rate-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.overview-rate-footer {
  display: flex;
}

.overview-rate-change {
  font-size: 0.6875rem;
  font-weight: 500;
}

.overview-rate-change.positive {
  color: #10b981;
}

.overview-rate-change.negative {
  color: #ef4444;
}

/* Overview Charts Row */
.overview-charts-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.overview-charts-row.single-chart {
  grid-template-columns: 1fr;
}

.chart-card.full-width {
  width: 100%;
}

/* Mobile Responsive Styles for Overview */
@media (max-width: 1200px) {
  .overview-hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .overview-stats-grid.overview-stats-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .overview-stats-grid.overview-stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-rates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .overview-hero-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .overview-hero-value {
    font-size: 1.5rem;
  }

  .overview-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .overview-stats-grid.overview-stats-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-stats-grid.overview-stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-rates-grid {
    grid-template-columns: 1fr;
  }

  .overview-stat-card {
    padding: 12px;
  }

  .overview-stat-icon {
    width: 36px;
    height: 36px;
  }

  .overview-stat-value {
    font-size: 1.125rem;
  }

  .overview-rates-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .overview-charts-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .overview-stats-grid {
    grid-template-columns: 1fr;
  }

  .overview-stats-grid.overview-stats-grid-5 {
    grid-template-columns: 1fr;
  }
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.menu-btn,
.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background-color 0.15s ease;
}

.menu-btn:hover,
.close-btn:hover {
  background-color: var(--bg-tertiary);
}

.mobile-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.close-btn {
  display: none;
  color: var(--sidebar-text);
}

.close-btn:hover {
  color: var(--sidebar-text-active);
  background-color: var(--sidebar-hover);
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive - Tablets */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive - Tablet (collapsed sidebar with icons only) */
@media (max-width: 980px) and (min-width: 769px) {
  .sidebar {
    width: 68px;
    padding: 24px 8px;
  }

  .sidebar-header {
    justify-content: center;
  }

  .logo {
    display: none;
  }

  .logo-subtitle {
    display: none;
  }

  .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
  }

  .logo-icon svg {
    width: 22px;
    height: 22px;
  }

  .nav-section-title {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
  }

  .nav-item .nav-label {
    display: none;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .nav-footer {
    padding: 12px 0;
  }

  .nav-footer .nav-item {
    justify-content: center;
  }

  .user-profile {
    justify-content: center;
  }

  .user-info {
    display: none;
  }

  .main {
    margin-left: 68px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100vh;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: none;
  }

  .sidebar.active {
    left: 0;
    box-shadow: none;
  }

  .close-btn {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding: 16px;
    padding-top: 72px;
    min-width: 0;
    overflow-x: hidden;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .page-subtitle {
    font-size: 0.75rem;
  }

  .date-filter-group {
    width: 100%;
  }

  .date-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-label {
    font-size: 0.625rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-sparkline-container {
    display: none;
  }

  .charts-grid {
    gap: 12px;
  }

  .chart-card {
    padding: 16px;
    overflow: hidden;
  }

  .chart-body {
    height: 200px;
  }

  .chart-with-legend {
    flex-direction: column;
    height: auto;
  }

  .chart-donut {
    width: 160px;
    height: 160px;
  }

  .bottom-grid {
    gap: 12px;
  }

  .bottom-card {
    padding: 16px;
  }

  .pages-header {
    display: none;
  }

  .pages-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .share-bar {
    display: none;
  }

  .activity-item {
    padding-bottom: 12px;
  }

  .activity-text {
    font-size: 0.75rem;
  }

  /* Revenue pages filter mobile styles */
  .filters-row {
    flex-direction: column;
    gap: 12px;
  }

  .filter-group-compact {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  .floating-label-wrapper {
    width: 100% !important;
  }

  .floating-label-wrapper .filter-select {
    width: 100% !important;
    box-sizing: border-box;
  }

  #categorySelect {
    width: 100% !important;
  }

  .floating-date-range {
    width: 100% !important;
  }

  .floating-date-range .date-range-container {
    width: 100% !important;
    box-sizing: border-box;
  }

  .floating-date-range .filter-date {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }

  .floating-multi-select {
    width: 100% !important;
  }

  .floating-multi-select .multi-select-trigger {
    width: 100% !important;
  }

  .filter-buttons {
    width: 100%;
    justify-content: stretch;
  }

  .filter-buttons .btn {
    flex: 1;
  }

  .filters-actions {
    flex-direction: column;
    gap: 8px;
  }

  .filters-actions .filter-btn {
    width: 100%;
  }

  /* Stats grid mobile */
  .stats-grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Table mobile improvements */

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.75rem;
  }

  /* Page header mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title {
    font-size: 1.25rem;
  }

  /* Section headers mobile */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid-4 {
    grid-template-columns: 1fr;
  }

  .chart-body {
    height: 180px;
  }

  .chart-donut {
    width: 140px;
    height: 140px;
  }

  .donut-value {
    font-size: 1.25rem;
  }

  /* Revenue pages small mobile */
  .floating-date-range .date-range-container {
    flex-direction: row;
    flex-wrap: nowrap;
    height: 66px;
    padding: 32px 12px 12px 12px;
    box-sizing: border-box;
  }

  .floating-date-range .filter-label {
    position: absolute;
    top: 18px;
    left: 18px;
  }

  .floating-date-range .filter-date {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    font-size: 0.75rem;
    padding: 0 4px;
  }

  .date-separator {
    width: auto;
    flex-shrink: 0;
    padding: 0 4px;
  }
}

/* ========================================
   DETAILED REPORTS STYLES
   ======================================== */

/* Export Button */
.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.export-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* Filters Section */
.filters-section {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1;
}

/* Floating label input wrapper */
.floating-label-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.floating-label-wrapper .filter-label {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-blue);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1;
}

.floating-label-wrapper .filter-select,
.floating-label-wrapper .filter-date {
  padding: 32px 45px 12px 18px;
  height: 66px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-label-wrapper .filter-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px 20px;
}

.floating-label-wrapper .filter-select:hover,
.floating-label-wrapper .filter-date:hover {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-label-wrapper .filter-select:focus,
.floating-label-wrapper .filter-date:focus {
  outline: none;
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Floating label for date range */
.floating-date-range {
  position: relative;
  display: flex;
  flex-direction: column;
}

.floating-date-range .filter-label {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-blue);
  pointer-events: none;
  z-index: 1;
}

.floating-date-range .date-range-container {
  display: flex;
  align-items: center;
  padding: 32px 16px 12px 16px;
  height: 66px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-date-range .date-range-container:hover {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-date-range .date-range-container:focus-within {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-date-range .filter-date {
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-text-align: left;
  width: auto;
}

.floating-date-range .filter-date:focus {
  outline: none;
  box-shadow: none;
}

/* Move calendar icon closer to the date text */
.filter-date::-webkit-calendar-picker-indicator {
  margin-left: -8px;
  cursor: pointer;
}

/* Floating label for multi-select dropdowns */
.floating-multi-select {
  position: relative;
  display: flex;
  flex-direction: column;
}

.floating-multi-select .filter-label {
  position: absolute;
  top: 16px;
  left: 18px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-blue);
  pointer-events: none;
  z-index: 2;
}

.floating-multi-select .multi-select-dropdown {
  position: relative;
}

.floating-multi-select .multi-select-trigger {
  padding: 32px 45px 12px 18px;
  height: 66px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-width: 180px;
  box-sizing: border-box;
}

.floating-multi-select .multi-select-trigger:hover {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-multi-select .multi-select-trigger:focus {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.floating-multi-select .multi-select-text {
  font-size: 0.875rem;
}

.filter-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.filter-select {
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

/* Equal width filter groups for DRG subpages (3 items = 33% each) */
.filters-row .filter-group-compact.floating-label-wrapper,
.filters-row .floating-multi-select,
.filters-row .filter-group-compact.floating-date-range {
  flex: 1 1 0;
  min-width: 0;
}

.filters-row .filter-group-compact.floating-label-wrapper .filter-select,
.filters-row .floating-multi-select .multi-select-dropdown,
.filters-row .filter-group-compact.floating-date-range .date-range-container {
  width: 100%;
  box-sizing: border-box;
}

.filters-row .floating-multi-select .multi-select-trigger {
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.filters-row .floating-multi-select .multi-select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.filters-row .floating-multi-select .multi-select-dropdown.open .multi-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.filter-select:hover {
  border-color: var(--border-color);
}

.filter-select:focus {
  outline: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-date {
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.filter-date:hover {
  border-color: var(--border-color);
}

.filter-date:focus {
  outline: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.date-separator {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.filters-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.filter-btn {
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn.primary {
  color: #ffffff;
  background-color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

.filter-btn.primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

.filter-btn.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.filter-btn.secondary {
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.filter-btn.secondary:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* Stats Grid 5 columns */
.stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* Stats Grid 6 columns */
.stats-grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Stats Grid 7 columns */
.stats-grid-7 {
  grid-template-columns: repeat(7, 1fr);
}

/* Stats Grid 8 columns */
.stats-grid-8 {
  grid-template-columns: repeat(8, 1fr);
}

.stat-card-compact {
  display: flex;
  flex-direction: column;
  padding: 26px 20px;
  text-align: center;
  align-items: center;
  row-gap: 8px;
}

.stat-card-compact .stat-label {
  margin-bottom: 0;
}

.stat-card-compact .stat-value {
  font-size: 1.5rem;
  margin-bottom: 0;
}

/* Chart Tabs */
.chart-tabs {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.chart-tab {
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border: none;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-tab:last-child {
  border-right: none;
}

.chart-tab:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.chart-tab.active {
  background-color: var(--sidebar-bg);
  color: #ffffff;
}

.chart-body-large {
  height: 300px;
}

/* Data Table Card */
.data-table-card,
.table-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table-card:first-child,
.table-card:first-child {
  margin-top: 0;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.table-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.table-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.table-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.table-search input {
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  width: 150px;
}

.table-search input::placeholder {
  color: var(--text-muted);
}

.table-page-size {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
}

/* Data Table */
.table-wrapper {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

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

.data-table th,
.data-table td {
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.data-table th.sortable:hover {
  background-color: var(--border-color);
}

.sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 1em;
  margin-left: 0;
  opacity: 0.5;
  font-family: "Apple Symbols", "Segoe UI Symbol", sans-serif;
  font-style: normal;
  font-size: 13px;
  line-height: 1;
  vertical-align: text-top;
  text-align: center;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
  top: -2px;
}

.data-table th.sortable:hover .sort-icon {
  opacity: 1;
}

.data-table th.sortable[data-sort-dir="asc"] .sort-icon,
.data-table th.sortable[data-sort-dir="desc"] .sort-icon,
.data-table th.sortable[data-order="asc"] .sort-icon,
.data-table th.sortable[data-order="desc"] .sort-icon,
th.sortable[data-order="asc"] .sort-icon,
th.sortable[data-order="desc"] .sort-icon,
th[data-sort][data-sort-dir="asc"] .sort-icon,
th[data-sort][data-sort-dir="desc"] .sort-icon {
  opacity: 1 !important;
}

.data-table td {
  color: var(--text-primary);
  background-color: #fcfcfc;
  white-space: nowrap;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 12px;
}

.data-table tbody tr:hover td {
  background-color: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
  border-bottom-color: transparent;
  padding-bottom: 15px;
}

.data-table .text-right {
  text-align: right;
}

.drg-change {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  padding: 4px 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--accent-blue);
}

.revenue-cell {
  color: var(--accent-green);
}

/* Table Footer */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.table-info {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.page-btn.active {
  background-color: var(--sidebar-bg);
  color: #ffffff;
  border-color: var(--sidebar-bg);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 8px;
  color: var(--text-muted);
}

/* Responsive for Detailed Reports */
@media (max-width: 1400px) {
  .stats-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid-7 {
    grid-template-columns: repeat(4, 1fr);
  }

  .stats-grid-8 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1400px) {
  .filters-row {
    flex-wrap: wrap !important;
  }

  .filters-row .filter-group-compact {
    flex: 0 0 calc(50% - 8px) !important;
    min-width: calc(50% - 8px) !important;
    max-width: calc(50% - 8px) !important;
  }

  .filters-row .filter-group-compact.floating-date-range {
    flex: 0 0 calc(50% - 8px) !important;
    min-width: calc(50% - 8px) !important;
    max-width: calc(50% - 8px) !important;
  }

  .filters-row .floating-label-wrapper {
    flex: 0 0 calc(50% - 8px) !important;
    min-width: calc(50% - 8px) !important;
    max-width: calc(50% - 8px) !important;
  }
}

@media (max-width: 1200px) {
  .stats-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid-7 {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid-8 {
    grid-template-columns: repeat(4, 1fr);
  }

  .filters-row {
    flex-wrap: wrap;
  }

  .filter-group {
    min-width: 150px;
  }
}

@media (max-width: 768px) {
  .stats-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid-7 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid-8 {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters-section {
    padding: 16px;
    overflow: visible;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filters-row {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    overflow: visible;
  }

  .filter-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filter-group-compact.floating-label-wrapper {
    width: 100%;
  }

  .single-select-dropdown {
    width: 100%;
  }

  .single-select-trigger {
    width: 100%;
  }

  .single-select-menu {
    width: 100%;
    max-width: 100%;
  }

  .table-wrapper {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .date-range-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .date-separator {
    text-align: center;
    padding: 4px 0;
  }

  .filters-actions {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .table-controls {
    width: 100%;
    flex-direction: column;
  }

  .table-search {
    width: 100%;
  }

  .table-search input {
    width: 100%;
  }

  .table-page-size {
    width: 100%;
  }

  .table-footer {
    flex-direction: column;
    gap: 12px;
  }

  .chart-body-large {
    height: 250px;
  }

  .header-right {
    width: 100%;
  }

  .export-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stats-grid-5 {
    grid-template-columns: 1fr;
  }

  .stats-grid-6 {
    grid-template-columns: 1fr;
  }

  .stats-grid-7 {
    grid-template-columns: 1fr;
  }

  .stats-grid-8 {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   MULTI-SELECT DROPDOWN STYLES
   ======================================== */

.multi-select-dropdown {
  position: relative;
  width: 100%;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease;
  text-align: left;
}

.multi-select-trigger:hover {
  border-color: var(--border-color);
}

.multi-select-trigger:focus {
  outline: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.multi-select-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-arrow {
  flex-shrink: 0;
  margin-left: 15px;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  position: relative;
  top: -7px;
}

.multi-select-dropdown.open .multi-select-arrow {
  transform: rotate(180deg);
}

.multi-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: 350px;
  overflow-y: auto;
  padding: 4px 0;
}

.multi-select-dropdown.open .multi-select-menu {
  display: block;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.1s ease;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.multi-select-option:hover {
  background-color: var(--bg-secondary);
}

.multi-select-option.select-all {
  font-weight: 600;
  color: var(--accent-blue);
}

.multi-select-option input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-primary);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.multi-select-option input[type="checkbox"]:checked+.checkbox-custom {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.multi-select-option input[type="checkbox"]:checked+.checkbox-custom::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.multi-select-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 2px 0;
}

/* Badge for selected count */
.multi-select-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: white;
  background-color: var(--accent-blue);
  border-radius: 10px;
  margin-left: 8px;
}

/* ========================================
   SINGLE-SELECT DROPDOWN STYLES
   ======================================== */

.single-select-dropdown {
  position: relative;
  width: 100%;
}

.single-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 32px 45px 12px 18px;
  height: 66px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: left;
}

.single-select-trigger:hover {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.single-select-dropdown.open .single-select-trigger {
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.single-select-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.single-select-dropdown.open .single-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.single-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.single-select-dropdown.open .single-select-menu {
  display: block;
}

.single-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background-color 0.15s ease;
}

.single-select-option:hover {
  background-color: var(--bg-secondary);
}

.single-select-option.selected {
  background-color: rgba(59, 130, 246, 0.08);
  color: var(--accent-blue);
  font-weight: 500;
}

.single-select-option .radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.single-select-option.selected .radio-custom {
  border-color: var(--accent-blue);
  background-color: var(--accent-blue);
}

.single-select-option.selected .radio-custom::after {
  content: "";
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
}

/* ========================================
   FILTER CARD STYLES (CC/MCC Pages)
   ======================================== */

.filter-cards-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.filter-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .filter-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .filter-cards-row {
    grid-template-columns: 1fr;
  }
}

.filter-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-card:hover {
  border-color: #d1d5db;
}

.filter-card:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-card-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.filter-card-select {
  width: 100%;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 24px;
}

.filter-card-select:focus {
  outline: none;
}

.filter-card-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-card-date {
  flex: 1;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.filter-card-date:focus {
  outline: none;
}

.filter-card-date-separator {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.filter-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  background-color: var(--accent-blue);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.filter-apply-btn:hover {
  background-color: #2563eb;
}

.filter-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.filter-reset-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* ========================================
   TOP LIST COMPONENT STYLES
   ======================================== */

.top-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 1200px) {
  .top-list-grid {
    grid-template-columns: 1fr;
  }
}

.top-list-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.top-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.top-list-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin: 0;
}

.top-list-view-all {
  font-size: 0.8125rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.top-list-view-all:hover {
  text-decoration: underline;
}

.top-list-table {
  width: 100%;
  border-collapse: collapse;
}

.top-list-table thead th {
  padding: 12px 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.top-list-table thead th.text-right {
  text-align: right;
}

.top-list-table tbody td {
  padding: 14px 20px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  background-color: #fcfcfc;
}

.top-list-table tbody tr:last-child td {
  border-bottom: none;
}

.top-list-table tbody td.text-right {
  text-align: right;
}

.top-list-name {
  color: var(--accent-blue);
  font-weight: 500;
}

.top-list-share {
  width: 140px;
}

.share-bar-container {
  display: flex;
  align-items: center;
  gap: 0;
}

.share-bar {
  height: 8px;
  background-color: var(--accent-blue);
  border-radius: 4px 0 0 4px;
  min-width: 4px;
}

.share-bar-bg {
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 0 4px 4px 0;
  flex: 1;
}

/* Charts Row Layout */
.charts-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.charts-row>.chart-card {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

@media (max-width: 1024px) {
  .charts-row {
    flex-direction: column;
  }
}

/* Top Tables Row Layout */
.top-tables-row {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  align-items: flex-start;
}

.top-tables-row>.chart-card {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

@media (max-width: 1024px) {
  .top-tables-row {
    flex-direction: column;
  }
}

/* View All Link */
.view-all-link {
  font-size: 0.8125rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Top Table Styles */
.top-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.top-table-container::-webkit-scrollbar {
  height: 8px;
}

.top-table-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.top-table-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.top-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

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

.top-table thead th {
  padding: 12px 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.top-table tbody td {
  padding: 14px 16px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.top-table tbody tr:last-child td {
  border-bottom: none;
}

.top-table-name {
  color: var(--accent-blue);
  font-weight: 500;
}

.top-table-impact {
  font-weight: 600;
  text-align: right;
}

.top-table-impact.positive {
  color: var(--accent-green);
}

.top-table-impact.negative {
  color: var(--accent-red);
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  max-width: 120px;
  height: 8px;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--accent-blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Maximize Button */
.maximize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.maximize-btn svg {
  width: 14px;
  height: 14px;
}

.maximize-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.chart-header,
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Fullscreen Modal */
.fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 9999;
  overflow: auto;
}

.fullscreen-modal.open {
  display: flex;
  flex-direction: column;
}

.fullscreen-modal-content {
  background: var(--bg-primary);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fullscreen-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.fullscreen-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fullscreen-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.fullscreen-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.fullscreen-modal-body {
  flex: 1;
  padding: 24px;
  overflow: auto;
  min-height: 0;
}

.fullscreen-modal-body.chart-modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 0;
}

.fullscreen-modal-body.chart-modal-body .chart-modal-wrapper {
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 2 / 1;
  position: relative;
}

.fullscreen-modal-body canvas {
  width: 100% !important;
  height: 100% !important;
}

.fullscreen-modal-body .table-wrapper {
  max-height: calc(100vh - 100px);
  overflow: auto;
}

@media (max-width: 768px) {
  .fullscreen-modal-header {
    padding: 12px 16px;
  }

  .fullscreen-modal-body {
    padding: 16px;
  }

  .fullscreen-modal-body.chart-modal-body {
    height: auto;
  }

  .fullscreen-modal-body.chart-modal-body .chart-modal-wrapper {
    aspect-ratio: 2 / 1;
  }
}
