/* =====================================================================
   1. GLOBAL STYLES
   =====================================================================*/

/* Base Typography & Layout */
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a1a;
  color: #f8fafc;
  position: relative;
}

/* Subtle grid pattern background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3 {
  margin: 0;
  padding: 0;
  font-weight: 600;
}

/* ===============================
   SITE HEADER
   =============================== */
.site-header {
  position: fixed;
  top: 0;
  left: 48px;
  right: 0;
  height: 60px;
  background: #1a1a1a;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  padding-left: 30px;
  z-index: 1001;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.3),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.05);
}

.site-title {
  font-size: 24px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.5px;
  margin: 0;
}

/* ===============================
   LEFT SIDE NAVIGATION BAR
   =============================== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 100vh;
  background: #2a2a2a;
  border-right: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  z-index: 1002;
  box-shadow: 
    2px 0 6px rgba(0, 0, 0, 0.3),
    inset -1px 0 0 0 rgba(255, 255, 255, 0.05);
}

/* Add subtle grid pattern to match body */
.side-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  opacity: 0.5;
}

.side-nav .nav-item {
  width: 36px;
  height: 36px;
  background: #333333;
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  
  /* Angular corner like dashboard sections */
  clip-path: polygon(
    0 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% 100%,
    0 100%
  );
}

/* Decorative corner element */
.side-nav .nav-item::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.side-nav .nav-item i {
  font-size: 18px;
  color: #cbd5e1;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
}

.side-nav .nav-item:hover {
  background: #3b3b3b;
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateX(2px);
}

.side-nav .nav-item:hover::after {
  opacity: 1;
}

.side-nav .nav-item:hover i {
  color: #3b82f6;
}

/* Wrapper for nav item + tooltip */
.side-nav .nav-item-wrapper {
  position: relative;
  margin-bottom: 20px;
}

/* Sidebar tooltips - using real span element */
.side-nav .nav-tooltip {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  background: #2a2a2a;
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, visibility 0.1s ease;
  z-index: 99999 !important;
  border: 1px solid rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.side-nav .nav-item-wrapper:hover .nav-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Active state for current page */
.side-nav .nav-item.active {
  background: #3b3b3b;
  border-color: #3b82f6;
}

.side-nav .nav-item.active::after {
  opacity: 1;
}

.side-nav .nav-item.active i {
  color: #3b82f6;
}


.page-container {
  max-width: 1600px;
  width: calc(100% - 48px - 40px); /* Total width minus sidebar and side spacing */
  margin: 0 auto; /* Center the container */
  margin-left: calc(48px + 20px + ((100% - 48px - 1600px - 40px) / 2)); /* Sidebar + spacing + centering offset */
  padding-top: 80px; /* Add space for header */
  padding-bottom: 60px;
  position: relative;
  z-index: 1;
}

/* When container is smaller than max-width, use simpler centering */
@media (max-width: 1688px) { /* 1600px max-width + 48px sidebar + 40px spacing */
  .page-container {
    width: calc(100% - 48px - 40px);
    margin-left: calc(48px + 20px);
    margin-right: 20px;
  }
}

.dashboard-section {
  margin-top: 32px;
  padding: 24px;
  background: #2a2a2a;
  border-radius: 4px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% 100%,
    0 100%
  );
}

/* Add decorative corner element with angular military style */
.dashboard-section::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  pointer-events: none;
}

/* Tactical accent on sections */
.dashboard-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
  opacity: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.section-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-description {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.section-meta {
  text-align: right;
  background: rgba(30, 30, 30, 0.6);
  padding: 12px 18px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #3b82f6;
  margin-bottom: 4px;
}

.section-date {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.page-header {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: #2a2a2a;
  backdrop-filter: blur(10px);
  border-radius: 4px;
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 30px) 0,
    100% 30px,
    100% 100%,
    30px 100%,
    0 calc(100% - 30px)
  );
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
}

.page-header h1 {
  font-size: 42px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.page-subtitle {
  color: #94a3b8;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
}

.chart-footnote {
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 11px;
  font-style: italic;
  color: #94a3b8;
  text-align: center;
  background: rgba(30, 30, 30, 0.6);
  border-radius: 0;
  border-left: 2px solid rgba(59, 130, 246, 0.5);
}


/* =====================================================================
   2. NAVIGATION (FLOATING NAV, COLLAPSE, EXPAND)
   =====================================================================*/

/* Floating right navigation */
.section-nav {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  background: rgba(42, 42, 42, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 0;
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.5),
    0 4px 6px -2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  overflow: visible !important;
  clip-path: polygon(
    -50px 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% 100%,
    -50px 100%
  );
  /* Ensure child buttons outside the nav are not clipped */
  overflow: visible;
}

.section-nav:hover {
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.6),
    0 10px 10px -5px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(59, 130, 246, 0.5);
}

.section-nav a {
  display: block;
  padding: 10px 16px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: #94a3b8;
  background: rgba(30, 30, 30, 0.6);
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  transition: left 0.5s ease;
}

.section-nav a:hover::before {
  left: 100%;
}

.section-nav a:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #f8fafc;
  transform: translateX(-4px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Hide floating nav on mobile */
@media (max-width: 700px) {
  .section-nav {
    display: none;
  }
}

/* Collapse button: attached to left edge of nav */
.nav-collapse-btn {
  position: absolute;
  left: -35px; /* Move it further out */
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: #3b82f6 !important; /* Make it bright blue so it's visible */
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  border-left: none;
  cursor: pointer;
  width: 35px;
  height: 90px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-shadow: -4px 0 20px rgba(59, 130, 246, 0.9);
  transition: all 0.2s ease;
  border-radius: 4px 0 0 4px; /* Rounded left edge */
}

.nav-collapse-btn:hover {
  background: #2563eb !important;
  transform: translateY(-50%) translateX(-3px);
  box-shadow: -6px 0 25px rgba(59, 130, 246, 1);
}

/* Vertical NAV expand button */
.nav-expand-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: #3b82f6;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-right: none;
  cursor: pointer;
  width: 35px;
  height: 90px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  display: none;
  z-index: 2001;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  transition: all 0.2s ease;
}

.nav-expand-tab:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: -4px 0 12px rgba(59, 130, 246, 0.4);
}

/* Collapsed nav */
.section-nav.collapsed {
  transform: translate(140%, -50%);
  opacity: 0;
  pointer-events: none;
}

.section-nav.collapsed + .nav-collapse-btn {
  display: none;
}


/* =====================================================================
   3. SLIMSELECT BASE STYLING
   =====================================================================*/

.ss-main {
  width: 100%;
  min-width: 180px;
  border-radius: 2px !important;
}

.ss-main .ss-single-selected,
.ss-main .ss-multi-selected {
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 2px !important;
  background: #2a2a2a !important;
  transition: all 0.2s ease !important;
  color: #f8fafc !important;
}

.ss-main .ss-single-selected:hover,
.ss-main .ss-multi-selected:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3) !important;
}

.ss-content {
  max-height: 240px;
  border-radius: 2px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  background: #2a2a2a !important;
}

.ss-main .ss-values .ss-value {
  font-size: 12px !important;
  background: rgba(59, 130, 246, 0.8) !important;
  border: 1px solid rgba(59, 130, 246, 0.6) !important;
  border-radius: 2px !important;
  padding: 4px 8px !important;
  color: #f8fafc !important;
  font-weight: 600 !important;
}

.ss-main .ss-values .ss-value .ss-value-delete {
  background: none !important;
  color: #3b82f6 !important;
  margin-left: 4px !important;
}

.ss-content .ss-list .ss-option {
  font-size: 12px !important;
  padding: 10px 14px !important;
  transition: all 0.15s ease !important;
  color: #f8fafc !important;
}

.ss-content .ss-list .ss-option:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #f8fafc !important;
}

.ss-content .ss-list .ss-option.ss-selected {
  background: rgba(59, 130, 246, 0.3) !important;
  color: #f8fafc !important;
  font-weight: 600 !important;
}

.ss-search input {
  font-size: 12px !important;
  border-radius: 2px !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  padding: 8px 12px !important;
  background: #2a2a2a !important;
  color: #f8fafc !important;
}

.ss-search input:focus {
  border-color: #3b82f6 !important;
  outline: none !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5) !important;
}


/* =====================================================================
   4. SECTION 1 — TOTALS
      - Filters
      - Pie Grid
      - Bar Grid
      - Responsive Rules
   =====================================================================*/

/* Clear Filters Button */
#s1-clear-filters-btn {
  padding: 10px 20px !important;
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: white !important;
  border: 1px solid rgba(59, 130, 246, 0.5) !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
  clip-path: polygon(
    4px 0,
    100% 0,
    calc(100% - 4px) 100%,
    0 100%
  );
}

#s1-clear-filters-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

#s1-clear-filters-btn:hover::before {
  left: 100%;
}

#s1-clear-filters-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(59, 130, 246, 0.8) !important;
}

#s1-clear-filters-btn:active {
  transform: translateY(0);
}

/* FILTER BAR */
#s1-filters-row.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: rgba(30, 30, 30, 0.6);
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

#s1-filters-row .filter-col {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  flex: 1 1 180px;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #3b82f6;
}

#s1-filters-row .ss-main {
  width: 100%;
}

/* PIE CHART GRID */
.s1-pie-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.s1-pie-card {
  background: #333333;
  border-radius: 0;
  padding: 16px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% 100%,
    0 100%
  );
}

.s1-pie-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.s1-pie-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, transparent 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  transition: all 0.3s ease;
}

.s1-pie-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 10px -5px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(59, 130, 246, 0.5);
}

.s1-pie-card:hover::after {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.6) 0%, transparent 100%);
}

.s1-pie-card:hover::before {
  opacity: 1;
}

.pie-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #f8fafc;
  text-align: center;
  position: relative;
  padding-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pie-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: #3b82f6;
  border-radius: 0;
}

.pie-container {
  width: 100%;
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* BAR CHART GRID */
.s1-bar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.s1-bar-card {
  background: #333333;
  border-radius: 0;
  padding: 16px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% 100%,
    0 100%
  );
}

.s1-bar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.s1-bar-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, transparent 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  transition: all 0.3s ease;
}

.s1-bar-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 10px -5px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(59, 130, 246, 0.5);
}

.s1-bar-card:hover::after {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.6) 0%, transparent 100%);
}

.s1-bar-card:hover::before {
  opacity: 1;
}

.bar-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #f8fafc;
  text-align: center;
  position: relative;
  padding-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bar-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: #3b82f6;
  border-radius: 0;
}

.bar-container {
  width: 100%;
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* RESPONSIVE BEHAVIOR */
@media (max-width: 1200px) {
  .s1-pie-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .s1-bar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .s1-pie-grid {
    grid-template-columns: 1fr;
  }
}


/* =====================================================================
   5. SECTION 2 — OVER TIME
      - Chart Block
      - Filter Rows
      - Legends
      - Wrapper
   =====================================================================*/

/* Chart blocks */
.s2-chart-block {
  background: #333333;
  padding: 16px;
  margin-bottom: 28px;
  border-radius: 0;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% 100%,
    0 100%
  );
}

.s2-chart-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
  opacity: 1;
}

.s2-chart-block::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, transparent 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* Filters */
.s2-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: rgba(30, 30, 30, 0.6);
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.s2-filter-col {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  flex: 1 1 160px;
}

.s2-filter-col label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #3b82f6;
}

.s2-filter-col .ss-main {
  width: 100%;
}

/* Chart titles */
.s2-chart-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.s2-chart-title .underline {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: #3b82f6;
  font-size: 120%;
  display: inline-block;
}

/* Region chart sizing */
#bar-overtime-region {
  min-height: 420px;
}
#bar-overtime-region svg {
  width: 100%;
  height: auto;
}

#s2-chart2-block {
  margin-top: 40px;
}

/* Legend */
.s2-c2-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
}

.s2-c2-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

.s2-c2-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =====================================================================
   RESPONSIVE ADJUSTMENTS FOR SIDEBAR
   ===================================================================== */

/* Medium screens - reduce margins slightly */
@media (max-width: 1400px) {
  .page-container {
    width: calc(100% - 48px - 30px);
    margin-left: calc(48px + 15px);
    margin-right: 15px;
  }
}

/* Smaller screens - minimal side margins */
@media (max-width: 1200px) {
  .page-container {
    width: calc(100% - 48px - 20px);
    margin-left: calc(48px + 10px);
    margin-right: 10px;
  }
}

/* Tablet and below - even tighter margins */
@media (max-width: 900px) {
  .page-container {
    width: calc(100% - 48px - 16px);
    margin-left: calc(48px + 8px);
    margin-right: 8px;
  }
  
  .dashboard-section {
    padding: 16px;
  }
}

/* Additional responsive */
@media (max-width: 768px) {
  .page-container {
    width: calc(100% - 48px - 10px);
    margin-left: calc(48px + 5px);
    margin-right: 5px;
  }
  
  .s2-filter-row {
    gap: 12px;
  }

  .s2-filter-col {
    min-width: 120px;
    flex: 1 1 120px;
  }
}


/* =====================================================================
   6. SECTION 3 — COMPARISON
      - Panels
      - Chart styles
      - Filters
   =====================================================================*/

#comparison-grid {
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  gap: 24px;
  align-items: start;
}

.comparison-panel {
  background: #333333;
  padding: 20px;
  border-radius: 0;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% 100%,
    0 100%
  );
}

.comparison-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6 0%, transparent 100%);
  opacity: 1;
}

.comparison-panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, transparent 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.comparison-panel h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.comparison-clear-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  clip-path: polygon(
    3px 0,
    100% 0,
    calc(100% - 3px) 100%,
    0 100%
  );
}

.comparison-clear-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  border-color: rgba(59, 130, 246, 0.8);
}

.comparison-filters-grid-A {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(30, 30, 30, 0.6);
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.comparison-divider {
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.5), transparent);
}

.comparison-chart {
  margin-top: 20px;
  min-height: 300px;
}

/* Comparison granularity selects */
.comparison-panel select {
  background: #2a2a2a;
  color: #f8fafc;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comparison-panel select:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.comparison-panel select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Comparison chart text labels */
#comparison-chart-A svg text,
#comparison-chart-B svg text {
  fill: #e2e8f0 !important;
}

@media (max-width: 1024px) {
  #comparison-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .comparison-divider {
    display: none;
  }
}


/* =====================================================================
   7. SECTION 4 — DETAIL TABLE
      - Controls
      - Table
      - Filters
   =====================================================================*/

#detail-table-row {
  margin-top: 20px;
}

/* Controls container for search and download */
.detail-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(30, 30, 30, 0.6);
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* Search and download row - but we'll override to stack */
.detail-search-download-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: flex-start;
}

/* Search wrapper for positioning clear button */
.detail-search-wrapper {
  position: relative;
  width: 33.333%;
  min-width: 300px;
  max-width: 500px;
}

.detail-global-search {
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 40px 10px 16px !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: #2a2a2a;
  color: #f8fafc;
  transition: all 0.2s ease;
  box-sizing: border-box;
}


.detail-global-search:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.detail-global-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.detail-global-search::placeholder {
  color: #64748b;
}

/* Clear button (X) inside search */
.detail-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: rgba(239, 68, 68, 0.8);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.detail-search-clear:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.detail-download-btn {
  align-self: flex-start;
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.detail-download-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  border-color: rgba(59, 130, 246, 0.8);
}

/* Container */
.table-container {
  width: 100%;
  max-width: 100%;
  height: 700px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0;
  background: #333333;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.detail-table-wrapper {
  flex: 1;
  min-height: 0;
}

/* Table Head/Body */
.detail-table th {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 4px;
  min-width: 100px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  background: #2a2a2a;
  color: #f8fafc;
}

.detail-table td {
  font-size: 10px;
  padding: 3px 4px;
  min-width: 100px;
  border: 1px solid rgba(59, 130, 246, 0.1);
  background: #333333;
  color: #e2e8f0;
}


/* Specific column widths */
.detail-table th.col-location,
.detail-table td.col-location {
  min-width: 120px !important;
  max-width: 120px !important;
  width: 120px !important;
  position: sticky;
  left: 0;
  background: #2a2a2a;
  z-index: 3;  
  border-right: 2px solid rgba(59, 130, 246, 0.3) !important;
}

.detail-table th.col-region,
.detail-table td.col-region {
  min-width: 140px !important;
  max-width: 140px !important;
  width: 140px !important;
  position: sticky;
  left: 130px;
  background: #2a2a2a;
  z-index: 3;
  border-right: 2px solid rgba(59, 130, 246, 0.3) !important;
}

.detail-table th.col-date,
.detail-table td.col-date {
  min-width: 100px !important;
  max-width: 100px !important;
  width: 100px !important;
  position: sticky;
  left: 280px;
  background: #2a2a2a;
  z-index: 3;
  border-right: 2px solid rgba(59, 130, 246, 0.3) !important;
}

.detail-table th.col-state,
.detail-table td.col-state {
  min-width: 120px !important;
  max-width: 120px !important;
  width: 120px !important;
  position: sticky;
  left: 390px;
  background: #2a2a2a;
  z-index: 3;
  border-right: 2px solid rgba(59, 130, 246, 0.3) !important;
}

.detail-table th.col-country,
.detail-table td.col-country {
  min-width: 130px !important;
  max-width: 130px !important;
  width: 130px !important;
  position: sticky;
  left: 520px;
  background: #2a2a2a;
  z-index: 3;
  border-right: 2px solid rgba(59, 130, 246, 0.3) !important;
}


/* Higher z-index for header cells */
.detail-table thead th.col-location,
.detail-table thead th.col-region,
.detail-table thead th.col-date,
.detail-table thead th.col-state,
.detail-table thead th.col-country {
  z-index: 10;
  background: #2a2a2a;
}


/* Make filter dropdowns match column width */
.detail-table th.col-location .detail-filter-select {
  max-width: 120px !important;
  width: 120px !important;
}

.detail-table th.col-region .detail-filter-select {
  max-width: 140px !important;
  width: 140px !important;
}

.detail-table th.col-date .detail-filter-select {
  max-width: 100px !important;
  width: 100px !important;
}

.detail-table th.col-state .detail-filter-select {
  max-width: 120px !important;
  width: 120px !important;
}

.detail-table th.col-country .detail-filter-select {
  max-width: 130px !important;
  width: 130px !important;
}

/* Target SlimSelect wrapper elements in LOCATION column */
.detail-table th.col-location .ss-main {
  max-width: 120px !important;
  width: 120px !important;
  min-width: 120px !important;
}

.detail-table th.col-location .ss-single-selected,
.detail-table th.col-location .ss-multi-selected {
  max-width: 120px !important;
  width: 120px !important;
}

/* Target SlimSelect wrapper elements in REGION column */
.detail-table th.col-region .ss-main {
  max-width: 140px !important;
  width: 140px !important;
  min-width: 140px !important;
}

.detail-table th.col-region .ss-single-selected,
.detail-table th.col-region .ss-multi-selected {
  max-width: 140px !important;
  width: 140px !important;
}

/* Target SlimSelect wrapper elements in DATE column */
.detail-table th.col-date .ss-main {
  max-width: 100px !important;
  width: 100px !important;
  min-width: 100px !important;
}

.detail-table th.col-date .ss-single-selected,
.detail-table th.col-date .ss-multi-selected {
  max-width: 100px !important;
  width: 100px !important;
}

/* Target SlimSelect wrapper elements in STATE column */
.detail-table th.col-state .ss-main {
  max-width: 120px !important;
  width: 120px !important;
  min-width: 120px !important;
}

.detail-table th.col-state .ss-single-selected,
.detail-table th.col-state .ss-multi-selected {
  max-width: 120px !important;
  width: 120px !important;
}

/* Target SlimSelect wrapper elements in COUNTRY column */
.detail-table th.col-country .ss-main {
  max-width: 130px !important;
  width: 130px !important;
  min-width: 130px !important;
}

.detail-table th.col-country .ss-single-selected,
.detail-table th.col-country .ss-multi-selected {
  max-width: 130px !important;
  width: 130px !important;
}

/* Smaller font size for LOCATION column filter - selected values */
.detail-table th.col-location .ss-main .ss-values .ss-value .ss-value-text {
  font-size: 8px !important;
}

.detail-table th.col-location .ss-main .ss-values .ss-placeholder {
  font-size: 8px !important;
}

.detail-table th.col-location .ss-content .ss-list .ss-option {
  font-size: 10px !important;
}


/* Smaller font size for REGION column filter - selected values */
.detail-table th.col-region .ss-main .ss-values .ss-value .ss-value-text {
  font-size: 8px !important;
}

.detail-table th.col-region .ss-main .ss-values .ss-placeholder {
  font-size: 8px !important;
}

.detail-table th.col-region .ss-content .ss-list .ss-option {
  font-size: 10px !important;
}



/* Smaller font size for DATE column filter - selected values */
.detail-table th.col-date .ss-main .ss-values .ss-value .ss-value-text {
  font-size: 7px !important;
}

.detail-table th.col-date .ss-main .ss-values .ss-placeholder {
  font-size: 7px !important;
}

.detail-table th.col-date .ss-content .ss-list .ss-option {
  font-size: 8px !important;
}

/* Smaller font size for STATE column filter - selected values */
.detail-table th.col-state .ss-main .ss-values .ss-value .ss-value-text {
  font-size: 7px !important;
}

.detail-table th.col-state .ss-main .ss-values .ss-placeholder {
  font-size: 7px !important;
}

.detail-table th.col-state .ss-content .ss-list .ss-option {
  font-size: 8px !important;
}

/* Smaller font size for COUNTRY column filter - selected values */
.detail-table th.col-country .ss-main .ss-values .ss-value .ss-value-text {
  font-size: 7px !important;
}

.detail-table th.col-country .ss-main .ss-values .ss-placeholder {
  font-size: 7px !important;
}

.detail-table th.col-country .ss-content .ss-list .ss-option {
  font-size: 8px !important;
}







.detail-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #2a2a2a;
  box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}

.detail-table thead::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #2a2a2a;
  z-index: -1;
}

/* Filters inside header */
.detail-table thead .filter-row input {
  font-size: 9px;
  padding: 2px 4px;
  background: #1e1e1e;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #f8fafc;
}

.detail-filter-select {
  width: 100%;
  max-width: 150px;
  padding: 1px 3px;
  font-size: 9px;
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: #1e1e1e;
  color: #f8fafc;
}

.detail-filter-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Sorting Buttons */
.detail-sort-btn {
  padding: 0 4px;
  font-size: 9px;
  border-radius: 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: #1e1e1e;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.detail-sort-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

.detail-sort-btn.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

/* Scroll container */
.detail-table-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;
}






/* Hidden by default */
#mobile-warning {
  display: none;
}

/* Enable on screens under 768px (mobile/tablet) */
@media (max-width: 768px) {
  #mobile-warning {
    display: flex;
    position: fixed;
    z-index: 99999;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    padding: 20px;
  }

  .mobile-warning-box {
    background: white;
    color: black;
    padding: 25px 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 16px;
    line-height: 1.4;
  }

  /* Prevent user from interacting with anything underneath */
  body {
    overflow: hidden;
  }
}



/* Overflow Responsiveness */
.pie-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* =====================================================================
   PIE CHART STYLING - Border colors
   ===================================================================== */

/* Pie chart slice borders - medium-dark gray for balance */
.pie-container svg path {
  stroke: #4b5563 !important;
  stroke-width: 2px !important;
}

/* =====================================================================
   CHART TEXT STYLING - Make all labels visible on dark background
   ===================================================================== */

/* D3 SVG text elements - make them light gray/white */
svg text {
  fill: #e2e8f0 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Pie chart labels */
.pie-container svg text {
  fill: #e2e8f0 !important;
}

/* Bar chart labels and axes */
.bar-container svg text {
  fill: #e2e8f0 !important;
}

/* Chart axes */
.axis text {
  fill: #cbd5e1 !important;
}

/* Axis lines */
.axis line,
.axis path {
  stroke: #475569 !important;
}

/* Grid lines */
.grid line {
  stroke: #334155 !important;
  stroke-opacity: 0.5 !important;
}

/* Tick marks */
.tick text {
  fill: #cbd5e1 !important;
}

.tick line {
  stroke: #475569 !important;
}

/* Section 2 chart text */
#bar-overtime-total svg text,
#bar-overtime-region svg text,
#bar-overtime-branch svg text,
#bar-overtime-country svg text,
#bar-overtime-state svg text {
  fill: #e2e8f0 !important;
}

/* Comparison charts text */
#comparison-chart-A svg text,
#comparison-chart-B svg text {
  fill: #e2e8f0 !important;
}



/* =====================================================================
   END OF FILE
   ===================================================================== */