/*
 * revenue.css - Shared visual styles
 * Consumers: index.html (root), revenue/revenue.html, finance/finance.html,
 *            pickup/pickup.html, rate-plan/rate-plan.html,
 *            market-segmentation/market-segmentation.html
 */

:root {
  /* ── 8px Grid Spacing Scale ── */
  --space-1: 4px;    /* 0.5× */
  --space-2: 8px;    /* 1× base unit */
  --space-3: 12px;   /* 1.5× */
  --space-4: 16px;   /* 2× */
  --space-5: 20px;   /* 2.5× */
  --space-6: 24px;   /* 3× */
  --space-8: 32px;   /* 4× */
  --space-10: 40px;  /* 5× */
  --space-12: 48px;  /* 6× */
  --space-16: 64px;  /* 8× */

  /* ── Type Scale (Major Third 1.25) ── */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.8125rem; /* 13px */
  --text-base: 1rem;      /* 16px */
  --text-md:   1.0625rem; /* 17px */
  --text-lg:   1.25rem;   /* 20px */
  --text-xl:   1.5rem;    /* 24px */
  --text-2xl:  1.75rem;   /* 28px */
  --text-3xl:  2rem;      /* 32px */

  /* ── Font Weights ── */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ── Line Heights ── */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ── Colors — WCAG AA compliant palette ── */
  --background: hsl(210 17% 98%);
  --foreground: hsl(222 47% 11%);          /* #1e293b — 13.5:1 on white */
  --muted-foreground: hsl(215 16% 47%);    /* #64748b — 4.6:1 on white */
  --border: hsl(214 32% 91%);
  --card: hsl(0 0% 100%);
  --muted: hsl(210 40% 96%);

  --accent-blue: hsl(217 91% 50%);         /* #2563eb — 4.6:1 on white */
  --accent-blue-soft: hsl(214 95% 93%);
  --accent-orange: hsl(25 95% 53%);        /* #f97316 — 3.1:1 (decorative only) */
  --accent-green: hsl(142 71% 29%);        /* #166534 — 7.1:1 on white */
  --accent-red: hsl(0 84% 44%);            /* #be123c — 5.7:1 on white */

  --gray-50:  hsl(210 40% 98%);
  --gray-100: hsl(210 40% 96%);
  --gray-200: hsl(214 32% 91%);
  --gray-300: hsl(213 27% 84%);
  --gray-400: hsl(215 20% 65%);
  --gray-500: hsl(215 16% 47%);
  --gray-600: hsl(215 19% 35%);
  --gray-700: hsl(215 25% 27%);
  --gray-800: hsl(217 33% 17%);
  --gray-900: hsl(222 47% 11%);

  /* ── Radii ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px hsla(220 20% 20% / 0.05);
  --shadow-sm: 0 2px 4px hsla(220 20% 20% / 0.06);
  --shadow-md: 0 4px 12px hsla(220 20% 20% / 0.08);
  --shadow-lg: 0 8px 24px hsla(220 20% 20% / 0.1);
  --shadow-xl: 0 16px 40px hsla(220 20% 20% / 0.12);
  --shadow-soft: 0 8px 30px hsla(220 20% 20% / 0.08);

  /* ── Transitions ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;

  /* ── Focus Ring ── */
  --focus-ring: 0 0 0 2px var(--card), 0 0 0 4px var(--accent-blue);
  --focus-ring-offset: 2px;

  /* ── Min Touch Target ── */
  --tap-min: 44px;
}

/* Main Navigation Bar */
.main-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-tabs {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted-foreground);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--duration-fast) var(--ease-in-out),
              background var(--duration-fast) var(--ease-in-out),
              border-color var(--duration-fast) var(--ease-in-out);
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
}

.nav-tab:hover {
  color: var(--foreground);
  background: var(--gray-50);
}

.nav-tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.nav-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  font-weight: var(--weight-semibold);
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  transform: translateX(20px);
  opacity: 0;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left-color: #16a34a;
}

.toast-success .toast-icon {
  color: #16a34a;
}

.toast-error {
  border-left-color: var(--accent-red);
}

.toast-error .toast-icon {
  color: var(--accent-red);
}

.toast-info {
  border-left-color: var(--accent-blue);
}

.toast-info .toast-icon {
  color: var(--accent-blue);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast-message {
  flex: 1;
}

/* Nav brand - hidden on desktop, shown on mobile */
.nav-brand {
  display: none;
}

/* Flatpickr custom styling */
.flatpickr-calendar {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 10px 40px hsla(220 20% 20% / 0.15) !important;
  border: 1px solid var(--border) !important;
  font-family: inherit !important;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  display: none;
}

.flatpickr-months {
  padding: 0.5rem 0;
}

.flatpickr-month {
  height: 36px !important;
}

.flatpickr-current-month {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
}

.flatpickr-weekdays {
  background: transparent !important;
}

.flatpickr-weekday {
  color: var(--muted-foreground) !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
}

.flatpickr-day {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}

.flatpickr-day:hover {
  background: var(--accent-blue-soft) !important;
  border-color: transparent !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent-blue) !important;
  border-color: var(--accent-blue) !important;
}

.flatpickr-day.today {
  border-color: var(--accent-blue) !important;
}

.flatpickr-day.today:hover {
  background: var(--accent-blue) !important;
  color: white !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  visibility: hidden;
}

.flatpickr-innerContainer {
  padding: 0.5rem;
}

.flatpickr-prev-month,
.flatpickr-next-month {
  padding: 8px !important;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: var(--accent-blue) !important;
  stroke: var(--accent-blue) !important;
}

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: radial-gradient(circle at top left, #e0f2fe 0, #f9fafb 40%, #e5e7eb 100%);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: pageLoad var(--duration-slow) var(--ease-out);
}

@keyframes pageLoad {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Global focus-visible ring */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Utility: screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--space-6) var(--space-2) var(--space-6);
}

.page-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.page-header-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.page-header-subtitle {
  font-size: var(--text-base);
  color: var(--muted-foreground);
  font-weight: var(--weight-normal);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.page-main {
  padding: 0 var(--space-6) var(--space-8) var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
}

/* Browser-style Tabs */
.browser-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: -1px;
  padding-left: var(--space-4);
  position: relative;
  z-index: 2;
}

.browser-tab {
  position: relative;
  padding: var(--space-2) var(--space-5);
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  min-width: 100px;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.browser-tab::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--duration-fast) var(--ease-in-out);
}

.browser-tab:hover:not(.browser-tab-active) {
  background: var(--gray-50);
  color: var(--foreground);
}

.browser-tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.browser-tab:active:not(.browser-tab-active) {
  transform: scale(0.97);
}

.browser-tab-active {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
  z-index: 3;
}

.browser-tab-active::before {
  background: var(--card);
}

/* Modern Controls Bar */
.controls-bar {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.controls-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-6);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.control-group-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  line-height: var(--leading-normal);
}

.control-group-action {
  margin-left: auto;
}

/* Date Range Picker */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.date-icon {
  position: absolute;
  left: var(--space-3);
  color: var(--muted-foreground);
  pointer-events: none;
}

.date-input {
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  background: white;
  color: var(--foreground);
  min-height: var(--tap-min);
  transition: border-color var(--duration-fast) var(--ease-in-out),
              box-shadow var(--duration-fast) var(--ease-in-out);
  cursor: pointer;
}

.date-input:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
  opacity: 0.7;
}

.date-input.is-disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
  opacity: 0.7;
}

.date-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.date-separator {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

/* Preset Buttons */
.preset-buttons {
  display: flex;
  gap: var(--space-1);
}

.preset-btn {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--muted-foreground);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  min-height: var(--tap-min);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.preset-btn:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  border-color: var(--border);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.controls-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.controls-disabled .preset-btn,
.controls-disabled .date-input,
.preset-buttons.controls-disabled .preset-btn,
.date-range-picker.controls-disabled .date-input {
  cursor: not-allowed;
}

.preset-btn:hover:not(:disabled) {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.preset-btn:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: none;
}

.preset-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Modern Select (Choices.js overrides) */
.modern-select {
  min-width: 320px;
  width: 100%;
  display: block;
}

.control-group-filters {
  min-width: 180px;
}

.filter-controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-controls-row .choices,
.filter-controls-row .choices__inner {
  min-width: 180px !important;
}

.filter-controls-row .modern-select {
  min-width: 180px;
  flex: 1 1 auto;
}

.filter-controls-row .choices {
  flex: 1 1 auto;
}

.filter-controls-row .choices__list--dropdown .choices__item {
  white-space: nowrap;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  min-height: var(--tap-min);
  min-width: 60px;
}

.theme-toggle-btn:hover {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
}

.theme-toggle-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle-btn:active {
  transform: scale(0.97);
}

.theme-toggle-icon {
  font-size: var(--text-base);
}

.theme-toggle-label {
  font-weight: var(--weight-bold);
}

/* Dark mode toggle button styling */
body.dark-theme .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

body.dark-theme .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #4ade80;
}

.control-group-filters .choices,
.control-group-filters .choices__inner {
  width: 100% !important;
}

.choices {
  margin-bottom: 0 !important;
}

.choices__inner {
  background: var(--gray-50) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-2) var(--space-3) !important;
  min-height: var(--tap-min) !important;
  font-size: var(--text-base) !important;
}

.choices__list--single .choices__item {
  font-size: var(--text-base) !important;
  font-weight: var(--weight-medium) !important;
}

.choices__list--dropdown .choices__item {
  font-size: var(--text-sm) !important;
  padding: var(--space-2) var(--space-3) !important;
  min-height: var(--tap-min) !important;
  display: flex !important;
  align-items: center !important;
}

.choices__inner:focus-within {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px var(--accent-blue-soft) !important;
}

.choices__list--dropdown {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 40px hsla(220 20% 20% / 0.12) !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: var(--accent-blue-soft) !important;
  color: var(--accent-blue) !important;
}

.choices__list--single {
  padding: 0 !important;
}

.choices[data-type*="select-one"]::after {
  border-color: var(--muted-foreground) transparent transparent transparent !important;
}

/* Budget Input */
.budget-input-wrapper {
  position: relative;
}

.budget-input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  background: var(--gray-50);
  color: var(--foreground);
  width: 100px;
  min-height: var(--tap-min);
  transition: border-color var(--duration-fast) var(--ease-in-out),
              box-shadow var(--duration-fast) var(--ease-in-out);
}

.budget-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.budget-input::-webkit-inner-spin-button,
.budget-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Load Button */
.load-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  min-height: var(--tap-min);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  box-shadow: 0 2px 8px hsla(217 91% 50% / 0.3);
}

.load-btn:hover {
  background: hsl(217 91% 44%);
  box-shadow: 0 4px 12px hsla(217 91% 50% / 0.4);
  transform: translateY(-1px);
}

.load-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.load-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.load-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.load-btn svg {
  flex-shrink: 0;
}

/* Cards & controls */

.card {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-5);
}

.control-card {
  margin-bottom: var(--space-4);
}

.section-title {
  margin: 0 0 var(--space-3) 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

.control-label {
  display: flex;
  flex-direction: column;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  line-height: var(--leading-normal);
}

.control-input {
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  min-width: 170px;
  min-height: var(--tap-min);
  background: var(--card);
  transition: border-color var(--duration-fast) var(--ease-in-out),
              box-shadow var(--duration-fast) var(--ease-in-out);
}

.control-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.btn-primary {
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-blue);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  padding: var(--space-2) var(--space-4);
  min-height: var(--tap-min);
  cursor: pointer;
  box-shadow: 0 2px 8px hsla(217 91% 50% / 0.3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--duration-fast) var(--ease-in-out);
}

.btn-primary:hover {
  background: hsl(217 91% 44%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px hsla(217 91% 50% / 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-ghost {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  min-height: var(--tap-min);
  cursor: pointer;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--duration-fast) var(--ease-in-out);
}

.btn-ghost:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--foreground);
}

.btn-ghost:active {
  transform: scale(0.97);
}

.btn-ghost:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.control-hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  line-height: var(--leading-normal);
}

/* Status */

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.status-url code {
  background: var(--gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
}

/* JSON viewer */

.json-viewer {
  max-height: 260px;
  overflow: auto;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid #111827;
  padding: 0.75rem;
}

/* Tables */

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.table-card {
  padding-bottom: var(--space-3);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--gray-50);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background var(--duration-fast) var(--ease-in-out);
}

tbody tr:nth-child(even) {
  background: var(--gray-50);
}

tbody tr:hover {
  background: var(--accent-blue-soft);
}

tbody tr.highlight-row {
  background: hsl(210 100% 95%) !important;
}

/* Pills / legend */

.pill {
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: default;
  line-height: var(--leading-normal);
  min-height: var(--space-8);
  display: inline-flex;
  align-items: center;
}

.pill-muted {
  color: var(--muted-foreground);
}

.pill-active {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: var(--weight-semibold);
}

.chart-metric-toggle .pill {
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.chart-metric-toggle .pill:not(.pill-active):hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.chart-metric-toggle .pill:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Chart */

.chart-shell {
  margin-top: var(--space-6);
}

.chart-card {
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(219, 234, 254, 0.55) 0,
    rgba(255, 255, 255, 0.9) 36%,
    rgba(249, 250, 251, 0.95) 100%
  );
  opacity: 0.4;
  pointer-events: none;
}

.chart-card > * {
  position: relative;
  z-index: 1;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.chart-card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.chart-card-subtitle {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.chart-svg-wrapper {
  margin-top: var(--space-2);
}

.chart-svg-wrapper svg {
  width: 100%;
  height: 260px;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-top: var(--space-3);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.legend-swatch {
  width: 12px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.legend-blue {
  background-color: var(--accent-blue);
}

.legend-green {
  background-color: var(--accent-green);
}

.legend-red {
  background-color: var(--accent-red);
}

.legend-orange {
  background-color: var(--accent-orange);
}

/* Chart element classes */

.chart-grid-line {
  stroke: hsla(215 16% 70% / 0.22);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--gray-200);
  stroke-width: 1;
}

.chart-tick-label {
  font-size: 10px;
  fill: var(--muted-foreground);
}

.chart-y-label {
  font-size: 10px;
  fill: var(--muted-foreground);
}

.chart-bar {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.bar-this-year {
  fill: var(--accent-blue);
}

.bar-diff-pos {
  fill: var(--accent-green);
}

.bar-diff-neg {
  fill: var(--accent-red);
}

.chart-bar:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.chart-weekend {
  fill: #f3f4ff;
}

.chart-line {
  fill: none;
  stroke: var(--accent-orange);
  stroke-width: 2;
}

.chart-line-dot {
  fill: var(--accent-orange);
  stroke: var(--card);
  stroke-width: 1;
}

/* Tooltip */

.hover-panel {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px hsla(220 20% 20% / 0.3);
  padding: 0;
  font-size: 0.75rem;
  min-width: 480px;
  max-width: 550px;
  color: var(--foreground);
  animation: tooltip-pop 120ms ease-out;
  overflow: visible;
}

.hover-panel strong {
  font-size: 0.78rem;
}

/* Tooltip header */
.tooltip-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--foreground);
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* ADR header section */
.tooltip-adr-header {
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 2rem;
}

.tooltip-adr-col {
  text-align: center;
}

.tooltip-adr-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
}

.tooltip-adr-label {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

/* Tooltip table */
.tooltip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.tooltip-table thead th {
  padding: 0.5rem 0.5rem 0.25rem;
  font-weight: 600;
  color: var(--foreground);
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.tooltip-table thead th:first-child {
  text-align: left;
}

.tooltip-table tbody td {
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
}

.tooltip-row-label {
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.tooltip-sub-label {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.tooltip-row-separator td {
  border-top: 1px solid var(--border);
}

.tooltip-diff-row td {
  padding-top: 0.6rem;
}

.tooltip-muted {
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Bar cells */
.tooltip-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.tooltip-bar-wrapper {
  width: 50px;
  height: 8px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.tooltip-bar-cell span {
  font-weight: 600;
  min-width: 45px;
  text-align: right;
  flex-shrink: 0;
}

.tooltip-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 2px;
}

.tooltip-bar-blue {
  background: var(--accent-blue);
}

.tooltip-bar-blue.tooltip-bar-light {
  opacity: 0.6;
}

.tooltip-bar-gray {
  background: var(--muted-foreground);
  opacity: 0.5;
}

.tooltip-bar-striped {
  background: repeating-linear-gradient(
    -45deg,
    var(--accent-red),
    var(--accent-red) 2px,
    transparent 2px,
    transparent 4px
  );
}

.tooltip-bar-green {
  background: var(--accent-green);
}

.tooltip-bar-red {
  background: var(--accent-red);
}

/* Diff row */
.tooltip-diff-cell {
  position: relative;
}

.tooltip-diff-bar {
  height: 6px;
  border-radius: 3px;
  min-width: 2px;
}

.tooltip-positive {
  color: var(--accent-green);
  font-weight: 600;
}

.tooltip-negative {
  color: var(--accent-red);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@keyframes tooltip-pop {
  from {
    opacity: 0;
    transform: translateY(2px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* KPI section */

.kpi-section {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.kpi-header-card {
  padding-block: var(--space-3);
}

.kpi-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.kpi-header-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.kpi-header-subtitle {
  font-size: var(--text-base);
  color: var(--muted-foreground);
  font-weight: var(--weight-normal);
}

.kpi-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.kpi-synced {
  font-size: var(--text-sm);
}

.kpi-preferences {
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--gray-100);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--space-8);
  transition: all var(--duration-fast) var(--ease-in-out);
}

.kpi-preferences:hover {
  background: var(--gray-200);
}

.kpi-preferences:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.kpi-pref-icon {
  font-size: var(--text-sm);
}

.kpi-panels-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.kpi-panel {
  padding-block: var(--space-3);
}

.kpi-panel-header {
  margin-bottom: var(--space-2);
}

.kpi-panel-title-tabs {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.kpi-panel-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.kpi-panel-tabs {
  display: inline-flex;
  border-radius: var(--radius-full);
  background: #e5edff;
  padding: 2px;
  gap: 2px;
}

.kpi-tab {
  border: none;
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
  min-height: var(--space-6);
}

.kpi-tab:hover:not(.kpi-tab-active) {
  background: rgba(255, 255, 255, 0.5);
}

.kpi-tab-active {
  background: #ffffff;
  color: var(--foreground);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-xs);
}

.kpi-panel-body {
  background: #f3f6ff;
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
}

.kpi-row {
  display: grid;
  grid-template-columns: minmax(70px, 90px) minmax(0, 1fr) max-content;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
}

.kpi-row-main {
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-1);
}

.kpi-row-label {
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}

.kpi-row-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-row-bars-muted .kpi-bar-track {
  opacity: 0.5;
}

.kpi-bar-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.kpi-bar-track-ly {
  background: #e5e7eb;
}

.kpi-bar-current {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #2563eb;
  border-radius: inherit;
  transition: width 0.18s ease-out;
}

.kpi-bar-ly {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #a855f7;
  border-radius: inherit;
  transition: width 0.18s ease-out;
}

.kpi-bar-ly-positive {
  background: var(--accent-green);
}

.kpi-bar-ly-negative {
  background: var(--accent-red);
}

.kpi-bar-ly-neutral {
  background: #a855f7;
}

.kpi-row-numbers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.kpi-row-value {
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.kpi-row-secondary {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.kpi-row-delta {
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.kpi-section.goal-filter .kpi-bar-current {
  height: 100%;
  border-radius: 10px;
  background: var(--goal-fill, #22c55e);
  transition: width 0.4s ease, background 0.4s ease;
}

/* Tall black goal marker line */
.kpi-section.goal-filter .kpi-bar-track::after {
  content: '';
  position: absolute;
  left: var(--goal-pct, 75%);
  top: -8px;
  bottom: -8px;
  width: 3px;
  background: #0f172a;
  border-radius: 2px;
  z-index: 10;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* Goal value label below the marker */
.kpi-section.goal-filter .kpi-bar-track::before {
  content: attr(data-goal-label);
  position: absolute;
  left: var(--goal-pct, 75%);
  top: calc(100% + 10px);
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  z-index: 10;
}

/* Style the LY label as "Goal" */
.kpi-section.goal-filter .kpi-row-secondary {
  color: #64748b;
  font-weight: 500;
  font-size: 0.75rem;
}

/* ========== MODERN FILTER: Glassmorphism style ========== */
.kpi-section.modern-filter .kpi-bar-track-ly {
  display: none !important;
}

.kpi-section.modern-filter .kpi-row-bars {
  position: relative;
  padding-bottom: 18px;
}

.kpi-section.modern-filter .kpi-bar-track {
  height: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: visible;
}

.kpi-section.modern-filter .kpi-bar-current {
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* Glowing goal marker for modern */
.kpi-section.modern-filter .kpi-bar-track::after {
  content: '';
  position: absolute;
  left: var(--goal-pct, 75%);
  top: -6px;
  bottom: -6px;
  width: 4px;
  background: linear-gradient(180deg, #f59e0b, #ef4444);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

/* Goal label for modern filter */
.kpi-section.modern-filter .kpi-bar-track::before {
  content: attr(data-goal-label);
  position: absolute;
  left: var(--goal-pct, 75%);
  top: calc(100% + 8px);
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: #f59e0b;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== MODERN FILTER: Full Dark Dashboard Theme ========== */
body.modern-theme {
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #151b28 100%);
  min-height: 100vh;
}

body.modern-theme .main-nav {
  background: rgba(26, 31, 46, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

body.modern-theme .nav-tab {
  color: rgba(255, 255, 255, 0.6);
}

body.modern-theme .nav-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

body.modern-theme .nav-tab.active {
  color: #4ade80;
  border-bottom-color: #4ade80;
}

body.modern-theme .nav-user-info {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

body.modern-theme .nav-select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

body.modern-theme .page-header {
  padding: 24px 20px 16px;
}

body.modern-theme .page-header-title {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 600;
}

body.modern-theme .page-header-subtitle {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .browser-tabs {
  display: none;
}

body.modern-theme .controls-bar {
  background: rgba(26, 31, 46, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

body.modern-theme .control-group-label {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .date-input,
body.modern-theme .preset-btn,
body.modern-theme .budget-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.modern-theme .date-input:focus,
body.modern-theme .preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #4ade80;
}

body.modern-theme .date-icon {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .date-separator {
  color: rgba(255, 255, 255, 0.4);
}

body.modern-theme .load-btn {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #0f1419;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
}

body.modern-theme .load-btn:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 6px 25px rgba(74, 222, 128, 0.4);
}

body.modern-theme .year-picker-wrapper,
body.modern-theme .month-picker-wrapper {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body.modern-theme .year-display {
  color: #ffffff;
}

body.modern-theme .year-nav-btn {
  color: rgba(255, 255, 255, 0.6);
}

body.modern-theme .year-nav-btn:hover {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

/* Modern Theme Cards */
body.modern-theme .card {
  background: rgba(26, 31, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.modern-theme .kpi-section {
  gap: 1rem;
}

body.modern-theme .kpi-header-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

body.modern-theme .kpi-header-title {
  color: #ffffff;
  font-size: 1.25rem;
}

body.modern-theme .kpi-header-subtitle {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .kpi-synced {
  color: rgba(255, 255, 255, 0.4);
}

body.modern-theme .kpi-preferences {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

body.modern-theme .kpi-preferences:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Modern Theme KPI Panels */
body.modern-theme .kpi-panels-row {
  gap: 1rem;
}

body.modern-theme .kpi-panel {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

body.modern-theme .kpi-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  opacity: 0.8;
}

body.modern-theme .kpi-panel-title {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.modern-theme .kpi-panel-tabs {
  background: rgba(255, 255, 255, 0.08);
}

body.modern-theme .kpi-tab {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .kpi-tab-active {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

body.modern-theme .kpi-chip {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

body.modern-theme .kpi-chip-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

body.modern-theme .kpi-panel-body {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

body.modern-theme .kpi-main-legend {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .kpi-main-legend .legend-swatch.legend-blue {
  background: #4ade80;
}

body.modern-theme .kpi-main-legend .legend-swatch.legend-gray {
  background: rgba(255, 255, 255, 0.3);
}

body.modern-theme .kpi-row-label {
  color: rgba(255, 255, 255, 0.7);
}

body.modern-theme .kpi-bar-track {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
}

body.modern-theme .kpi-bar-current {
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 4px;
}

body.modern-theme .kpi-bar-ly {
  background: rgba(255, 255, 255, 0.25);
}

body.modern-theme .kpi-row-value {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

body.modern-theme .kpi-row-secondary {
  color: rgba(255, 255, 255, 0.4);
}

body.modern-theme .kpi-row-delta.kpi-positive {
  color: #4ade80;
}

body.modern-theme .kpi-row-delta.kpi-negative {
  color: #f87171;
}

body.modern-theme .kpi-row-delta.kpi-neutral {
  color: rgba(255, 255, 255, 0.5);
}

/* Modern Theme - Large Value Display */
body.modern-theme .kpi-panel .kpi-large-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

body.modern-theme .kpi-panel .kpi-large-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .kpi-panel .kpi-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

body.modern-theme .kpi-panel .kpi-change-badge.positive {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

body.modern-theme .kpi-panel .kpi-change-badge.negative {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

/* Modern Theme Chart Card */
body.modern-theme .chart-card {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

body.modern-theme .chart-card::before {
  display: none;
}

body.modern-theme .section-title {
  color: #ffffff;
}

body.modern-theme .section-subtitle {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

body.modern-theme .pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

body.modern-theme .pill-active {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

body.modern-theme .pill:not(.pill-active):hover {
  background: rgba(255, 255, 255, 0.12);
}

body.modern-theme .chart-legend {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .legend-blue {
  background: #4ade80;
}

body.modern-theme .legend-green {
  background: #22c55e;
}

body.modern-theme .legend-red {
  background: #f87171;
}

body.modern-theme .legend-orange {
  background: #fbbf24;
}

/* Modern Theme Chart SVG */
body.modern-theme .chart-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
}

body.modern-theme .chart-axis-line {
  stroke: rgba(255, 255, 255, 0.1);
}

body.modern-theme .chart-tick-label,
body.modern-theme .chart-y-label {
  fill: rgba(255, 255, 255, 0.5);
}

body.modern-theme .bar-this-year {
  fill: #4ade80;
}

body.modern-theme .bar-diff-pos {
  fill: #22c55e;
}

body.modern-theme .bar-diff-neg {
  fill: #f87171;
}

body.modern-theme .chart-line {
  stroke: #fbbf24;
}

body.modern-theme .chart-line-dot {
  fill: #fbbf24;
  stroke: rgba(26, 31, 46, 0.9);
}

/* Modern Theme Circular Progress */
body.modern-theme .circular-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body.modern-theme .circular-progress {
  position: relative;
  width: 140px;
  height: 140px;
}

body.modern-theme .circular-progress svg {
  transform: rotate(-90deg);
}

body.modern-theme .circular-progress .progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 10;
}

body.modern-theme .circular-progress .progress-bar {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

body.modern-theme .circular-progress-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

body.modern-theme .circular-progress-percent {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
}

body.modern-theme .circular-progress-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Modern Theme Status Row */
body.modern-theme .status-row {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .status-url code {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

/* Modern Theme Rate Plan Manager */
body.modern-theme .rate-plan-manager-container {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

body.modern-theme .rate-plan-manager-summary {
  color: #ffffff;
}

body.modern-theme .rate-plan-manager-summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.modern-theme .rate-plan-manager-summary .summary-hint {
  color: rgba(255, 255, 255, 0.4);
}

body.modern-theme .rate-plan-manager {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* Modern Theme Tooltip */
body.modern-theme .hover-panel {
  background: rgba(26, 31, 46, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.modern-theme .tooltip-header {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.modern-theme .tooltip-adr-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.modern-theme .tooltip-adr-value {
  color: #ffffff;
}

body.modern-theme .tooltip-adr-label {
  color: rgba(255, 255, 255, 0.5);
}

body.modern-theme .tooltip-table thead th {
  color: rgba(255, 255, 255, 0.7);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.modern-theme .tooltip-row-label,
body.modern-theme .tooltip-sub-label {
  color: rgba(255, 255, 255, 0.6);
}

body.modern-theme .tooltip-row-separator td {
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.modern-theme .tooltip-bar-wrapper {
  background: rgba(255, 255, 255, 0.1);
}

body.modern-theme .tooltip-bar-blue {
  background: #4ade80;
}

body.modern-theme .tooltip-bar-gray {
  background: rgba(255, 255, 255, 0.3);
}

body.modern-theme .tooltip-positive {
  color: #4ade80;
}

body.modern-theme .tooltip-negative {
  color: #f87171;
}

/* Modern Theme Choices.js Override */
body.modern-theme .choices__inner {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.modern-theme .choices__list--single .choices__item {
  color: #ffffff !important;
}

body.modern-theme .choices__list--dropdown {
  background: rgba(26, 31, 46, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.modern-theme .choices__list--dropdown .choices__item {
  color: rgba(255, 255, 255, 0.8) !important;
}

body.modern-theme .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: rgba(74, 222, 128, 0.2) !important;
  color: #4ade80 !important;
}

body.modern-theme .choices[data-type*="select-one"]::after {
  border-color: rgba(255, 255, 255, 0.5) transparent transparent transparent !important;
}

/* Modern Theme Mobile Nav */
body.modern-theme .mobile-nav-menu {
  background: rgba(26, 31, 46, 0.98);
}

body.modern-theme .mobile-nav-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.modern-theme .mobile-nav-title {
  color: #ffffff;
}

body.modern-theme .mobile-nav-close {
  color: rgba(255, 255, 255, 0.6);
}

body.modern-theme .mobile-nav-links a {
  color: rgba(255, 255, 255, 0.8);
}

body.modern-theme .mobile-nav-links a:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.modern-theme .mobile-nav-links a.active {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-left-color: #4ade80;
}

body.modern-theme .hamburger-btn span {
  background: #ffffff;
}

/* Modern Theme - Area Chart Gradient */
body.modern-theme .chart-area {
  fill: url(#areaGradient);
}

body.modern-theme .chart-svg-wrapper svg {
  background: transparent;
}

/* Modern Theme - Enhanced KPI Panel with Large Numbers like reference */
body.modern-theme .kpi-panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.modern-theme .kpi-panel .kpi-hero-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

body.modern-theme .kpi-panel .kpi-hero-value {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

body.modern-theme .kpi-panel .kpi-hero-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

body.modern-theme .kpi-panel .kpi-hero-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

body.modern-theme .kpi-panel .kpi-hero-change.negative {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Modern Theme - Mileage Goal Style (Circular Progress) */
body.modern-theme .kpi-panel.kpi-panel-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 1rem 0;
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-progress {
  fill: none;
  stroke: url(#goalGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-percent {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

body.modern-theme .kpi-panel.kpi-panel-goal .kpi-goal-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Modern Theme - Activity/Stats List */
body.modern-theme .kpi-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

body.modern-theme .kpi-stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.modern-theme .kpi-stats-item:last-child {
  border-bottom: none;
}

body.modern-theme .kpi-stats-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

body.modern-theme .kpi-stats-value {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
}

body.modern-theme .kpi-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

body.modern-theme .kpi-stats-badge.positive {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

body.modern-theme .kpi-stats-badge.negative {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Modern Theme - Heart Health Style Progress Bar */
body.modern-theme .kpi-health-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

body.modern-theme .kpi-health-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, 
    #ef4444 0%, 
    #f97316 25%, 
    #eab308 50%, 
    #22c55e 75%, 
    #4ade80 100%
  );
  position: relative;
}

body.modern-theme .kpi-health-marker {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}

body.modern-theme .kpi-health-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Modern Theme - Smooth Transitions */
body.modern-theme * {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-duration: 0.15s;
  transition-timing-function: ease;
}

body.modern-theme .kpi-bar-current,
body.modern-theme .kpi-bar-ly {
  transition: width 0.4s ease;
}

.kpi-positive {
  color: var(--accent-green);
}

.kpi-negative {
  color: var(--accent-red);
}

.kpi-neutral {
  color: var(--muted-foreground);
}

/* Monthly Breakdown Table */
.monthly-breakdown-section {
  margin-top: var(--space-6);
}

.monthly-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.monthly-breakdown-year {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.monthly-breakdown-table-wrapper {
  overflow-x: auto;
}

.monthly-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.monthly-breakdown-table th,
.monthly-breakdown-table td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

.monthly-breakdown-table th {
  background: var(--gray-50);
  font-weight: var(--weight-semibold);
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.monthly-breakdown-table tbody tr:hover {
  background: var(--gray-50);
}

.monthly-breakdown-table .text-right {
  text-align: right;
}

.monthly-breakdown-table .monthly-total-row {
  background: var(--accent-blue-soft);
  border-top: 2px solid var(--accent-blue);
}

.monthly-breakdown-table .monthly-total-row td {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  font-weight: var(--weight-semibold);
}

.legend-gray {
  background-color: var(--gray-300);
}

.kpi-chip {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  background: var(--gray-100);
  color: var(--muted-foreground);
  margin-right: var(--space-1);
}

.kpi-chip-green {
  background: hsl(142 72% 90%);
  color: var(--accent-green);
}

.kpi-chip-outline {
  background: transparent;
  border: 1px solid var(--border);
}

.kpi-panel-badge-row {
  margin-top: 0.35rem;
}

.kpi-main-legend {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* Hamburger Menu */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  z-index: 101;
}

.hamburger-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--foreground);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
}

.mobile-nav-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--card);
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-nav-menu.active {
  right: 0;
}

.mobile-nav-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-nav-title {
  font-weight: 600;
  font-size: 1rem;
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.25rem;
}

.mobile-nav-links {
  padding: 0.5rem 0;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  color: var(--foreground);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  border-left: 3px solid transparent;
  min-height: var(--tap-min);
  transition: all var(--duration-fast) var(--ease-in-out);
}

.mobile-nav-links a:hover {
  background: var(--gray-50);
}

.mobile-nav-links a.active {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-left-color: var(--accent-blue);
}

.mobile-nav-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.mobile-nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-nav-user-icon {
  font-size: 1.25rem;
}

.mobile-nav-user-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.mobile-nav-signout {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-nav-signout:hover {
  background: var(--gray-200);
}

.mobile-nav-signin {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-nav-signin:hover {
  background: hsl(210 98% 40%);
}

.mobile-nav-property {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.mobile-nav-property-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.mobile-nav-property select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--gray-50);
}

/* ========== RESPONSIVE ========== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .nav-tab {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }
  
  .nav-property-select {
    display: none;
  }

  .controls-bar-inner {
    gap: var(--space-4);
  }
}

/* Mobile and Tablet (max 768px) */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-tabs {
    display: none;
  }
  
  .nav-right {
    display: none;
  }
  
  .mobile-nav-overlay,
  .mobile-nav-menu {
    display: block;
  }
  
  /* Main nav becomes minimal header */
  .main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
  }
  
  .nav-brand {
    display: block;
    font-weight: var(--weight-semibold);
    font-size: var(--text-base);
    color: var(--foreground);
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-2);
  }

  .page-header-title {
    font-size: var(--text-lg);
  }

  .page-main {
    padding: 0 var(--space-4) var(--space-6) var(--space-4);
  }

  .controls-bar {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
  }

  .controls-bar-inner {
    gap: var(--space-3);
  }

  .controls-row {
    align-items: stretch;
  }

  .kpi-panels-row {
    grid-template-columns: 1fr;
  }

  .chart-svg-wrapper svg {
    height: 200px;
  }

  /* Stack date range picker on mobile */
  .date-range-picker {
    flex-wrap: wrap;
  }

  .preset-buttons {
    flex-wrap: wrap;
  }

  /* Tables scroll horizontally */
  .monthly-breakdown-table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  .hover-panel {
    min-width: auto;
    max-width: calc(100vw - var(--space-8));
  }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
  .page-header {
    padding: var(--space-3) var(--space-3) var(--space-2);
  }

  .page-header-title {
    font-size: var(--text-base);
  }

  .page-main {
    padding: 0 var(--space-3) var(--space-4) var(--space-3);
  }

  .controls-bar {
    padding: var(--space-3);
  }

  .card {
    padding: var(--space-3) var(--space-4);
  }

  .kpi-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* Budget Modal Styles */
.budget-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.budget-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.budget-modal-content {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: min(720px, 100%);
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.budget-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.budget-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.budget-modal-property {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.budget-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.budget-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.budget-form-header {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.budget-form-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
}

.budget-form-row label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
}

.budget-month-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.budget-month-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.budget-month-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.budget-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--muted);
}

.budget-modal-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.budget-modal-btn-cancel {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.budget-modal-btn-cancel:hover {
  background: var(--muted);
}

.budget-modal-btn-save {
  background: #6366f1;
  color: white;
}

.budget-modal-btn-save:hover {
  background: #4f46e5;
}

.budget-modal-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Variance colors for monthly breakdown */
.text-green {
  color: #22c55e;
}

.text-red {
  color: #ef4444;
}

/* Monthly Breakdown Table Column Color Coding */
.monthly-breakdown-table th.col-data,
.monthly-breakdown-table td.col-data {
  background: hsl(210 100% 97%);
}

.monthly-breakdown-table th.col-budget,
.monthly-breakdown-table td.col-budget {
  background: hsl(270 50% 97%);
}

.monthly-breakdown-table th.col-variance,
.monthly-breakdown-table td.col-variance {
  background: hsl(45 100% 97%);
}

.monthly-breakdown-table th.col-data {
  background: hsl(210 100% 94%);
  color: hsl(210 80% 40%);
}

.monthly-breakdown-table th.col-budget {
  background: hsl(270 50% 94%);
  color: hsl(270 60% 40%);
}

.monthly-breakdown-table th.col-variance {
  background: hsl(45 100% 92%);
  color: hsl(35 80% 35%);
}

.monthly-breakdown-table tbody tr:hover td.col-data {
  background: hsl(210 100% 94%);
}

.monthly-breakdown-table tbody tr:hover td.col-budget {
  background: hsl(270 50% 94%);
}

.monthly-breakdown-table tbody tr:hover td.col-variance {
  background: hsl(45 100% 90%);
}

.monthly-breakdown-table .monthly-total-row td.col-data {
  background: hsl(210 100% 92%);
}

.monthly-breakdown-table .monthly-total-row td.col-budget {
  background: hsl(270 50% 92%);
}

.monthly-breakdown-table .monthly-total-row td.col-variance {
  background: hsl(45 100% 88%);
}

/* ========== DARK THEME: Budget Modal ========== */
body.dark-theme .budget-modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

body.dark-theme .budget-modal-content {
  background: rgba(26, 31, 46, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

body.dark-theme .budget-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .budget-modal-header h2 {
  color: #ffffff;
}

body.dark-theme .budget-modal-property {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .budget-form-header {
  color: rgba(255, 255, 255, 0.5);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .budget-form-row label {
  color: rgba(255, 255, 255, 0.8);
}

body.dark-theme .budget-month-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.dark-theme .budget-month-input:focus {
  border-color: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

body.dark-theme .budget-month-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

body.dark-theme .budget-modal-footer {
  background: rgba(0, 0, 0, 0.2);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .budget-modal-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

body.dark-theme .budget-modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .budget-modal-btn-save {
  background: #4ade80;
  color: #0f1419;
}

body.dark-theme .budget-modal-btn-save:hover {
  background: #22c55e;
}

/* ========== DARK THEME: Monthly Breakdown Table ========== */
body.dark-theme .monthly-breakdown-table {
  color: rgba(255, 255, 255, 0.8);
}

body.dark-theme .monthly-breakdown-table th {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .monthly-breakdown-table td {
  color: rgba(255, 255, 255, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark-theme .monthly-breakdown-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-theme .monthly-breakdown-table th.col-data {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

body.dark-theme .monthly-breakdown-table td.col-data {
  background: rgba(37, 99, 235, 0.06);
}

body.dark-theme .monthly-breakdown-table th.col-budget {
  background: rgba(168, 85, 247, 0.15);
  color: #a78bfa;
}

body.dark-theme .monthly-breakdown-table td.col-budget {
  background: rgba(168, 85, 247, 0.06);
}

body.dark-theme .monthly-breakdown-table th.col-variance {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
}

body.dark-theme .monthly-breakdown-table td.col-variance {
  background: rgba(234, 179, 8, 0.06);
}

body.dark-theme .monthly-breakdown-table tbody tr:hover td.col-data {
  background: rgba(37, 99, 235, 0.12);
}

body.dark-theme .monthly-breakdown-table tbody tr:hover td.col-budget {
  background: rgba(168, 85, 247, 0.12);
}

body.dark-theme .monthly-breakdown-table tbody tr:hover td.col-variance {
  background: rgba(234, 179, 8, 0.12);
}

body.dark-theme .monthly-breakdown-table .monthly-total-row {
  background: rgba(255, 255, 255, 0.05);
  border-top-color: rgba(255, 255, 255, 0.15);
}

body.dark-theme .monthly-breakdown-table .monthly-total-row td.col-data {
  background: rgba(37, 99, 235, 0.15);
}

body.dark-theme .monthly-breakdown-table .monthly-total-row td.col-budget {
  background: rgba(168, 85, 247, 0.15);
}

body.dark-theme .monthly-breakdown-table .monthly-total-row td.col-variance {
  background: rgba(234, 179, 8, 0.15);
}

body.dark-theme .text-green {
  color: #4ade80;
}

body.dark-theme .text-red {
  color: #f87171;
}

body.dark-theme .monthly-breakdown-header {
  color: rgba(255, 255, 255, 0.5);
}

/* ========== DARK THEME: Year & Month Pickers ========== */
body.dark-theme .year-picker-wrapper,
body.dark-theme .month-picker-wrapper {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .year-display {
  color: #ffffff;
}

body.dark-theme .year-nav-btn {
  color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .year-nav-btn:hover {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

/* ========== DARK THEME: Flatpickr ========== */
body.dark-theme .flatpickr-calendar {
  background: rgba(26, 31, 46, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .flatpickr-months .flatpickr-month {
  background: transparent !important;
  color: #ffffff !important;
}

body.dark-theme .flatpickr-current-month {
  color: #ffffff !important;
}

body.dark-theme .flatpickr-weekday {
  color: rgba(255, 255, 255, 0.4) !important;
}

body.dark-theme .flatpickr-day {
  color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .flatpickr-day:hover {
  background: rgba(74, 222, 128, 0.2) !important;
  border-color: transparent !important;
}

body.dark-theme .flatpickr-day.selected,
body.dark-theme .flatpickr-day.startRange,
body.dark-theme .flatpickr-day.endRange {
  background: #4ade80 !important;
  border-color: #4ade80 !important;
  color: #0f1419 !important;
}

body.dark-theme .flatpickr-day.today {
  border-color: #4ade80 !important;
}

body.dark-theme .flatpickr-day.today:hover {
  background: #4ade80 !important;
  color: #0f1419 !important;
}

body.dark-theme .flatpickr-prev-month,
body.dark-theme .flatpickr-next-month {
  color: rgba(255, 255, 255, 0.6) !important;
  fill: rgba(255, 255, 255, 0.6) !important;
}

body.dark-theme .flatpickr-prev-month:hover svg,
body.dark-theme .flatpickr-next-month:hover svg {
  fill: #4ade80 !important;
  stroke: #4ade80 !important;
}

/* ========== DARK THEME: Nav User Info ========== */
body.dark-theme .nav-user-info {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

body.dark-theme .nav-select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

body.dark-theme .nav-signout-btn {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .nav-signout-btn:hover {
  color: #f87171;
}

body.dark-theme .nav-signin-btn {
  background: #4ade80;
  color: #0f1419;
}

body.dark-theme .nav-signin-btn:hover {
  background: #22c55e;
}

/* Navbar Right Section with User Info and Property Dropdown */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: 1rem;
}

.nav-property-select {
  min-width: 160px;
}

.nav-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: var(--gray-50);
  color: var(--foreground);
  cursor: pointer;
  min-width: 140px;
}

.nav-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--gray-100);
}

.nav-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--foreground);
}

.nav-user-icon {
  font-size: 1rem;
}

.nav-user-name {
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-signout-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.nav-signout-btn:hover {
  color: var(--accent-red);
}

.nav-signin-btn {
  padding: 0.5rem 1rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-signin-btn:hover {
  background: hsl(210 98% 40%);
}

.hidden {
  display: none !important;
}

/* Year & Month Pickers */
.year-picker-wrapper,
.month-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.5rem;
  height: 42px;
}

.year-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.year-nav-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.year-nav-btn:active {
  transform: scale(0.95);
}

.year-display {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--foreground);
  min-width: 50px;
  text-align: center;
}

.month-picker-wrapper .year-display {
  min-width: 90px;
}

/* ========== CIRCLE FILTER: Circular Progress Indicators ========== */
.kpi-section.circle-filter .kpi-panels-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.kpi-section.circle-filter .kpi-panel {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
  position: relative;
  overflow: visible;
}

.kpi-section.circle-filter .kpi-panel::before {
  display: none;
}

.kpi-section.circle-filter .kpi-panel-header {
  margin-bottom: 0.5rem;
  text-align: center;
}

.kpi-section.circle-filter .kpi-panel-title {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-section.circle-filter .kpi-panel-badge-row {
  display: none;
}

.kpi-section.circle-filter .kpi-panel-body {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kpi-section.circle-filter .kpi-main-legend {
  display: none;
}

.kpi-section.circle-filter .kpi-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hide Transient and Group rows in circle filter */
.kpi-section.circle-filter .kpi-row-transient,
.kpi-section.circle-filter .kpi-row-group {
  display: none !important;
}
.kpi-section.circle-filter .kpi-row-transient .kpi-bar-track::after,
.kpi-row-group .kpi-bar-track::after {
  display: none !important;
}
.kpi-row-transient .kpi-bar-track::before,
.kpi-row-group .kpi-bar-track::before {
  display: none !important;
}

/* Globally hide target markers on transient rows (all filters) */
.kpi-row-transient .kpi-bar-track::after,
.kpi-row-transient .kpi-bar-track::before {
  display: none !important;
}

/* Total row becomes the circle container */
.kpi-section.circle-filter .kpi-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  width: 160px;
  height: 160px;
  position: relative;
}

.kpi-section.circle-filter .kpi-row-label {
  display: none;
}

/* Hide the bar tracks - we use the row itself as the circle */
.kpi-section.circle-filter .kpi-row-bars {
  display: none;
}

/* Create the circular progress ring using conic-gradient */
.kpi-section.circle-filter .kpi-row::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    #4ade80 0%,
    #4ade80 var(--circle-progress, 0%),
    rgba(255, 255, 255, 0.1) var(--circle-progress, 0%),
    rgba(255, 255, 255, 0.1) 100%
  );
  z-index: 1;
}

/* Inner circle to create the ring effect */
.kpi-section.circle-filter .kpi-row::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border-radius: 50%;
  background: rgba(26, 31, 46, 0.98);
  z-index: 2;
}

/* Circle progress container - holds the values inside the ring */
.kpi-section.circle-filter .kpi-row-numbers {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  position: relative;
  z-index: 10;
}

.kpi-section.circle-filter .kpi-row-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.kpi-section.circle-filter .kpi-row-secondary {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.kpi-section.circle-filter .kpi-row-delta {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.25rem;
}

.kpi-section.circle-filter .kpi-row-delta.kpi-positive {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.kpi-section.circle-filter .kpi-row-delta.kpi-negative {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.kpi-section.circle-filter .kpi-row-delta.kpi-neutral {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments for circle filter */
@media (max-width: 900px) {
  .kpi-section.circle-filter .kpi-panels-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* ========== DARK THEME: Global dark mode for all filters ========== */
body.dark-theme {
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #151b28 100%);
}

body.dark-theme .main-nav {
  background: rgba(26, 31, 46, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

body.dark-theme .nav-tab {
  color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .nav-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .nav-tab.active {
  color: #4ade80;
  border-bottom-color: #4ade80;
}

body.dark-theme .page-header-title {
  color: #ffffff;
}

body.dark-theme .page-header-subtitle {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .browser-tabs {
  display: flex;
}

body.dark-theme .browser-tab {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .browser-tab:hover:not(.browser-tab-active) {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

body.dark-theme .browser-tab-active {
  background: rgba(26, 31, 46, 0.95);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .controls-bar {
  background: rgba(26, 31, 46, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

body.dark-theme .control-group-label {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .date-input,
body.dark-theme .preset-btn,
body.dark-theme .budget-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.dark-theme .date-input:focus,
body.dark-theme .preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #4ade80;
}

body.dark-theme .date-icon {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .date-separator {
  color: rgba(255, 255, 255, 0.4);
}

body.dark-theme .load-btn {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #0f1419;
}

body.dark-theme .load-btn:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

body.dark-theme .card {
  background: rgba(26, 31, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

body.dark-theme .kpi-header-card {
  background: transparent;
  border: none;
}

body.dark-theme .kpi-header-title {
  color: #ffffff;
}

body.dark-theme .kpi-header-subtitle {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .kpi-synced {
  color: rgba(255, 255, 255, 0.4);
}

body.dark-theme .kpi-preferences {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .kpi-panel {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .kpi-panel-title {
  color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .kpi-panel-tabs {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .kpi-tab {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .kpi-tab-active {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

body.dark-theme .kpi-chip {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

body.dark-theme .kpi-chip-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .kpi-panel-body {
  background: rgba(0, 0, 0, 0.2);
}

body.dark-theme .kpi-main-legend {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .kpi-main-legend .legend-swatch.legend-blue {
  background: #4ade80;
}

body.dark-theme .kpi-main-legend .legend-swatch.legend-gray {
  background: rgba(255, 255, 255, 0.3);
}

body.dark-theme .kpi-row-label {
  color: rgba(255, 255, 255, 0.7);
}

body.dark-theme .kpi-bar-track {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .kpi-bar-current {
  background: linear-gradient(90deg, #4ade80, #22c55e);
}

body.dark-theme .kpi-bar-ly {
  background: rgba(255, 255, 255, 0.25);
}

body.dark-theme .kpi-row-value {
  color: #ffffff;
}

body.dark-theme .kpi-row-secondary {
  color: rgba(255, 255, 255, 0.4);
}

body.dark-theme .kpi-row-delta.kpi-positive {
  color: #4ade80;
}

body.dark-theme .kpi-row-delta.kpi-negative {
  color: #f87171;
}

body.dark-theme .kpi-row-delta.kpi-neutral {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .chart-card {
  background: rgba(26, 31, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .chart-card::before {
  display: none;
}

body.dark-theme .section-title {
  color: #ffffff;
}

body.dark-theme .section-subtitle {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .chart-legend {
  color: rgba(255, 255, 255, 0.5);
}

body.dark-theme .status-row {
  color: rgba(255, 255, 255, 0.5);
}

/* Dark theme chart area */
body.dark-theme .chart-metric-toggle {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .chart-metric-toggle .pill {
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
}

body.dark-theme .chart-metric-toggle .pill.active {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

body.dark-theme .chart-metric-toggle .pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-theme #dailyGraph {
  background: transparent;
}

body.dark-theme .daily-chart-container {
  background: transparent;
}

body.dark-theme .chart-y-axis text,
body.dark-theme .chart-x-axis text {
  fill: rgba(255, 255, 255, 0.5);
}

body.dark-theme .chart-grid line {
  stroke: rgba(255, 255, 255, 0.1);
}

/* Dark theme Choices.js overrides */
body.dark-theme .choices__inner {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.dark-theme .choices__list--single .choices__item {
  color: #ffffff !important;
}

body.dark-theme .choices__list--dropdown {
  background: rgba(26, 31, 46, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .choices__list--dropdown .choices__item {
  color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-theme .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: rgba(74, 222, 128, 0.2) !important;
  color: #4ade80 !important;
}

body.dark-theme .choices[data-type*="select-one"]::after {
  border-color: rgba(255, 255, 255, 0.5) transparent transparent transparent !important;
}

/* ========== CIRCLE FILTER: Color-changing progress (red to green) ========== */
.kpi-section.circle-filter .kpi-row::before {
  background: conic-gradient(
    from -90deg,
    var(--circle-color, #4ade80) 0%,
    var(--circle-color, #4ade80) var(--circle-progress, 0%),
    rgba(255, 255, 255, 0.1) var(--circle-progress, 0%),
    rgba(255, 255, 255, 0.1) 100%
  );
}

/* Light mode circle filter */
body:not(.dark-theme) .kpi-section.circle-filter .kpi-panel {
  background: #ffffff;
  border: 1px solid var(--border);
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row::after {
  background: #ffffff;
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row-value {
  color: var(--foreground);
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row-secondary {
  color: var(--muted-foreground);
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row::before {
  background: conic-gradient(
    from -90deg,
    var(--circle-color, #22c55e) 0%,
    var(--circle-color, #22c55e) var(--circle-progress, 0%),
    #e5e7eb var(--circle-progress, 0%),
    #e5e7eb 100%
  );
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row-delta.kpi-positive {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row-delta.kpi-negative {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-row-delta.kpi-neutral {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted-foreground);
}

/* ========== CIRCLE FILTER: Metric header above circle ========== */
.kpi-section.circle-filter .kpi-panel-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi-section.circle-filter .kpi-panel-title-tabs {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.kpi-section.circle-filter .kpi-panel-tabs {
  display: flex !important;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px;
}

body:not(.dark-theme) .kpi-section.circle-filter .kpi-panel-tabs {
  background: #e5edff;
}

/* Metric header showing current / goal */
.circle-metric-header {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.circle-metric-current {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
}

.circle-metric-separator {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.4);
}

.circle-metric-goal {
  font-size: 1.25rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

body:not(.dark-theme) .circle-metric-current {
  color: var(--foreground);
}

body:not(.dark-theme) .circle-metric-separator {
  color: var(--muted-foreground);
}

body:not(.dark-theme) .circle-metric-goal {
  color: var(--muted-foreground);
}

/* ========== CIRCLE FILTER: Comparison lines below circles ========== */
.circle-comparison-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.dark-theme) .circle-comparison-lines {
  border-top-color: var(--border);
}

.circle-comparison-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.circle-comparison-label {
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
}

body:not(.dark-theme) .circle-comparison-label {
  color: var(--muted-foreground);
}

.circle-comparison-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.circle-comparison-dot.current {
  background: #4ade80;
}

.circle-comparison-dot.ly {
  background: rgba(255, 255, 255, 0.3);
}

body:not(.dark-theme) .circle-comparison-dot.ly {
  background: #a855f7;
}

.circle-comparison-value {
  font-weight: 600;
  text-align: right;
  min-width: 70px;
  color: #ffffff;
}

.circle-comparison-delta-placeholder,
.circle-comparison-delta {
  min-width: 70px;
  text-align: right;
}

body:not(.dark-theme) .circle-comparison-value {
  color: var(--foreground);
}

.circle-comparison-delta {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.circle-comparison-delta.positive {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.circle-comparison-delta.negative {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

body:not(.dark-theme) .circle-comparison-delta.positive {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

body:not(.dark-theme) .circle-comparison-delta.negative {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
