/**
 * Filename: public/stylesheets/sidebar.css
 * Revision: 2025-12-09-01 (darker blue theme)
 * Description: Centralized sidebar styles - adjusted badge for longer plan names
 */

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
  background: #0d1520;
}

/* Sidebar Container - STICKY */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1e3a5f 0%, #0f1927 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

/* Plan Badge */
.sidebar-plan {
  padding: 10px 16px 0;
  text-align: center;
}

.plan-wrapper {
  position: relative;
  display: inline-block;
}

.plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.plan-badge:hover {
  background: rgba(255,255,255,0.25);
}

/* Plan Tooltip */
.plan-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: white;
  color: #162231;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  padding: 12px 16px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 200;
  text-align: left;
}

.plan-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid white;
}

.plan-wrapper:hover .plan-tooltip {
  opacity: 1;
  visibility: visible;
}

.plan-tooltip-header {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
}

.plan-tooltip-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.plan-tooltip-row .label {
  color: #6b7280;
}

.plan-tooltip-row .value {
  font-weight: 600;
  color: #162231;
}

.plan-tooltip-row.trial .value {
  color: #f59e0b;
}

.plan-change-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: #3b82f6;
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.2s;
}

.plan-change-btn:hover {
  background: #2563eb;
  color: white;
  text-decoration: none;
}

/* Sidebar Header */
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.logo-img {
  max-width: 180px;
  height: auto;
  object-fit: contain;
  margin-left: 10px;
  margin-top: 10px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-top: 4px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,1);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: #3b82f6;
}

.nav-icon {
  font-size: 24px;
}

/* Nav Section Header (ClearMyBooks) */
.nav-section {
  margin-top: 16px;
  padding: 12px 24px 4px 36px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-section-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

/* Nav hierarchy levels */
.nav-item.nav-level-1 {
  padding-left: 36px !important;
}

.nav-item.nav-level-2 {
  padding-left: 60px !important;
}

.nav-level-1 .nav-icon,
.nav-level-2 .nav-icon {
  font-size: 18px;
}

.nav-item.active-parent {
  color: rgba(255,255,255,0.9);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 32px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content Area - offset for fixed sidebar */
.main-content {
  flex: 1;
  background: #f8fafc;
  padding: 24px 32px;
  overflow-y: auto;
  margin-left: 240px;
  height: 100vh;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
  margin-right: 12px;
}

.theme-toggle:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.theme-icon-dark {
  display: none;
}

/* Dark Mode Styles */
[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: inline;
}

[data-theme="dark"] .theme-toggle {
  background: #1e3a5f;
  border-color: #2d4a6f;
}

[data-theme="dark"] .theme-toggle:hover {
  background: #2d4a6f;
}

[data-theme="dark"] .dashboard {
  background: #0f1927;
}

[data-theme="dark"] .account-bar {
  background: #0f1927;
}

[data-theme="dark"] .top-bar {
  background: #0f1927;
  color: #f9fafb;
  border-color: #1e293b;
}

[data-theme="dark"] .top-bar h1 {
  color: #f9fafb;
}

[data-theme="dark"] .account-avatar {
  background: #2d4a6f;
}

[data-theme="dark"] .stat-box,
[data-theme="dark"] .match-card,
[data-theme="dark"] .filter-card,
[data-theme="dark"] .card,
[data-theme="dark"] .results-card,
[data-theme="dark"] .table-container {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .stat-number,
[data-theme="dark"] .match-number,
[data-theme="dark"] .filter-card-count {
  color: #f9fafb;
}

[data-theme="dark"] .stat-label,
[data-theme="dark"] .match-label,
[data-theme="dark"] .filter-card-label {
  color: #9ca3af;
}

[data-theme="dark"] .data-table th {
  background: #1e3a5f;
  color: #f9fafb;
  border-color: #2d4a6f;
}

[data-theme="dark"] .data-table td {
  background: #162231;
  color: #e5e7eb;
  border-color: #1e3a5f;
}

[data-theme="dark"] .data-table tr:hover td {
  background: #1e3a5f;
}

[data-theme="dark"] .search-input,
[data-theme="dark"] select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="date"] {
  background: #1e3a5f;
  border-color: #2d4a6f;
  color: #f9fafb;
}

[data-theme="dark"] .btn-outline {
  background: #1e3a5f;
  border-color: #2d4a6f;
  color: #f9fafb;
}

[data-theme="dark"] .btn-outline:hover {
  background: #2d4a6f;
}

[data-theme="dark"] .comparison-bar-container,
[data-theme="dark"] .analysis-header {
  color: #f9fafb;
}

[data-theme="dark"] .comparison-bar {
  background: #1e3a5f;
}

[data-theme="dark"] .progress-card {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .progress-status {
  color: #f9fafb;
}

[data-theme="dark"] .modal-content {
  background: #162231;
  color: #f9fafb;
}

[data-theme="dark"] .account-modal-content {
  background: #162231;
  color: #f9fafb;
}

/* Financial Health Dark Mode */
[data-theme="dark"] .score-circle-wrapper {
  background: #162231;
}

[data-theme="dark"] .score-circle {
  background: #162231;
}

[data-theme="dark"] .score-label,
[data-theme="dark"] .score-grade,
[data-theme="dark"] .score-description,
[data-theme="dark"] .last-analyzed {
  color: #e5e7eb;
}

[data-theme="dark"] .category-card {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .category-card h4,
[data-theme="dark"] .category-name {
  color: #f9fafb;
}

[data-theme="dark"] .category-status,
[data-theme="dark"] .category-items {
  color: #9ca3af;
}

[data-theme="dark"] .issues-section {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .issues-section h3 {
  color: #f9fafb;
}

[data-theme="dark"] .issue-item,
[data-theme="dark"] .accordion-item {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .issue-header,
[data-theme="dark"] .accordion-header {
  background: #162231;
  color: #f9fafb;
}

[data-theme="dark"] .issue-header:hover,
[data-theme="dark"] .accordion-header:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .issue-content,
[data-theme="dark"] .accordion-content {
  background: #111827;
  border-color: #1e3a5f;
  color: #e5e7eb;
}

[data-theme="dark"] .issue-title,
[data-theme="dark"] .issue-description {
  color: #e5e7eb;
}

[data-theme="dark"] .summary-stats,
[data-theme="dark"] .stats-grid,
[data-theme="dark"] .stats-row {
  background: #162231;
}

[data-theme="dark"] .summary-stat,
[data-theme="dark"] .stat-item {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .summary-stat .value,
[data-theme="dark"] .stat-value {
  color: #f9fafb;
}

[data-theme="dark"] .summary-stat .label,
[data-theme="dark"] .stat-name {
  color: #9ca3af;
}

[data-theme="dark"] .score-history,
[data-theme="dark"] .history-section {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .score-history h3,
[data-theme="dark"] .history-title {
  color: #f9fafb;
}

/* Dashboard Cards Dark Mode */
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .action-card,
[data-theme="dark"] .metric-card {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .card-title,
[data-theme="dark"] .card-header {
  color: #f9fafb;
}

[data-theme="dark"] .card-body,
[data-theme="dark"] .card-content {
  color: #e5e7eb;
}

/* Progress bars */
[data-theme="dark"] .progress-bar-bg,
[data-theme="dark"] .progress-track {
  background: #1e3a5f;
}

/* Forms */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #1e3a5f;
  border-color: #2d4a6f;
  color: #f9fafb;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #9ca3af;
}

[data-theme="dark"] label {
  color: #e5e7eb;
}

/* Links in dark mode */
[data-theme="dark"] a.action-link,
[data-theme="dark"] .issue-action {
  color: #60a5fa;
}

/* Borders and dividers */
[data-theme="dark"] hr,
[data-theme="dark"] .divider {
  border-color: #1e3a5f;
}

/* General text colors */
[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4 {
  color: #f9fafb;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] .text-muted {
  color: #e5e7eb;
}

/* Badge colors */
[data-theme="dark"] .badge {
  background: #1e3a5f;
  color: #f9fafb;
}

/* Table styles */
[data-theme="dark"] table {
  background: #162231;
}

[data-theme="dark"] th,
[data-theme="dark"] td {
  border-color: #1e3a5f;
}

[data-theme="dark"] tbody tr:hover {
  background: #1e3a5f;
}

/* Scrollbar dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
  background: #162231;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #2d4a6f;
  border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Settings page */
[data-theme="dark"] .settings-section,
[data-theme="dark"] .setting-card,
[data-theme="dark"] .settings-card {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .settings-section h2,
[data-theme="dark"] .settings-section h3 {
  color: #f9fafb;
}

/* Orders page */
[data-theme="dark"] .order-card,
[data-theme="dark"] .order-detail {
  background: #162231;
  border-color: #1e3a5f;
}

/* Inventory page */
[data-theme="dark"] .inventory-card,
[data-theme="dark"] .product-card {
  background: #162231;
  border-color: #1e3a5f;
}

/* Category cards grid */
[data-theme="dark"] .categories-grid,
[data-theme="dark"] .cards-grid {
  background: transparent;
}

/* Account bar border */
[data-theme="dark"] .account-bar {
  border-color: #1e3a5f;
}

[data-theme="dark"] .top-bar {
  border-color: #1e3a5f;
}
/* Financial Health page specific dark mode */
[data-theme="dark"] .score-card-main {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%) !important;
}

[data-theme="dark"] .issue-group {
  border-color: #1e3a5f;
}

[data-theme="dark"] .issue-group-header {
  background: #162231;
}

[data-theme="dark"] .issue-group-header:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .issue-group-title {
  color: #f9fafb;
}

[data-theme="dark"] .issue-group-chevron {
  color: #9ca3af;
}

[data-theme="dark"] .issue-group-content {
  background: #111827;
}

[data-theme="dark"] .issue-card {
  border-color: #1e3a5f;
}

[data-theme="dark"] .issue-card.high {
  background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .issue-card.medium {
  background: rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .issue-card.low {
  background: rgba(34, 197, 94, 0.1);
}

[data-theme="dark"] .issue-title {
  color: #f9fafb;
}

[data-theme="dark"] .issue-description {
  color: #9ca3af;
}

[data-theme="dark"] .orders-toggle {
  background: #1e3a5f;
  color: #a5b4fc;
}

[data-theme="dark"] .orders-toggle:hover {
  background: #2d4a6f;
}

[data-theme="dark"] .orders-table th {
  background: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .orders-table td {
  border-color: #1e3a5f;
  color: #e5e7eb;
}

[data-theme="dark"] .orders-table tr:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .stat-card {
  background: #162231;
}

[data-theme="dark"] .stat-value {
  color: #f9fafb;
}

[data-theme="dark"] .history-section {
  background: #162231;
}

[data-theme="dark"] .history-section h3 {
  color: #f9fafb;
}

[data-theme="dark"] .history-bar-label {
  color: #9ca3af;
}

[data-theme="dark"] .history-bar-score {
  color: #f9fafb;
}

[data-theme="dark"] .no-results {
  color: #9ca3af;
}

[data-theme="dark"] .category-label {
  color: #9ca3af;
}

[data-theme="dark"] .category-bar {
  background: #1e3a5f;
}

[data-theme="dark"] .category-freshness {
  color: #6b7280;
}

/* Dashboard connection cards dark mode */
[data-theme="dark"] .connection-card {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .connection-card:hover {
  border-color: #2d4a6f;
  background: #1e3a5f;
}

[data-theme="dark"] .connection-label,
[data-theme="dark"] .connection-name,
[data-theme="dark"] .connection-url {
  color: #f9fafb;
}

[data-theme="dark"] .connection-details span {
  color: #9ca3af;
}

/* Dashboard action cards dark mode */
[data-theme="dark"] .action-card {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .action-card:hover {
  background: #1e3a5f;
  border-color: #2d4a6f;
}

[data-theme="dark"] .action-card h3 {
  color: #f9fafb;
}

[data-theme="dark"] .action-card p {
  color: #9ca3af;
}

[data-theme="dark"] .action-card.primary-action {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

/* Dashboard section headers */
[data-theme="dark"] .connections h2,
[data-theme="dark"] .quick-actions h2,
[data-theme="dark"] section h2 {
  color: #f9fafb;
}

/* Content header */
[data-theme="dark"] .content-header h1 {
  color: #f9fafb;
}

/* Migration page dark mode */
[data-theme="dark"] .migrate-tabs {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .tab-btn {
  background: #1e3a5f;
  color: #9ca3af;
  border-color: #2d4a6f;
}

[data-theme="dark"] .tab-btn:hover {
  background: #2d4a6f;
  color: #f9fafb;
}

[data-theme="dark"] .tab-btn.active {
  background: #162231;
  color: #f9fafb;
  border-color: #3b82f6;
}

[data-theme="dark"] .migrate-section {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .migrate-section h3,
[data-theme="dark"] .migrate-section h4,
[data-theme="dark"] .step-header,
[data-theme="dark"] .section-title {
  color: #f9fafb;
}

[data-theme="dark"] .platform-card,
[data-theme="dark"] .action-card.platform-card {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .platform-card:hover,
[data-theme="dark"] .action-card.platform-card:hover {
  background: #1e3a5f;
  border-color: #2d4a6f;
}

[data-theme="dark"] .platform-card.selected,
[data-theme="dark"] .action-card.platform-card.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .platform-card span,
[data-theme="dark"] .platform-name {
  color: #f9fafb;
}

[data-theme="dark"] .category-title,
[data-theme="dark"] .platform-category {
  color: #9ca3af;
}

/* CSV Tool dark mode */
[data-theme="dark"] .csv-header-section,
[data-theme="dark"] .csv-table-section {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .file-upload-zone {
  background: #162231;
  border-color: #2d4a6f;
}

[data-theme="dark"] .file-upload-zone:hover {
  background: #1e3a5f;
  border-color: #6b7280;
}

[data-theme="dark"] .file-upload-zone p,
[data-theme="dark"] .file-upload-text {
  color: #9ca3af;
}

[data-theme="dark"] .mapping-row,
[data-theme="dark"] .field-mapping {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .mapping-label {
  color: #f9fafb;
}

/* Sidebar dark mode - more contrast */
[data-theme="dark"] .sidebar {
  background: #0b1620;
  border-right: none;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .main-content {
  background: #0f1927;
}

[data-theme="dark"] .sidebar-header {
  border-color: #334155;
}

[data-theme="dark"] .sidebar-footer {
  border-color: #334155;
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-left-color: #3b82f6;
}

[data-theme="dark"] .plan-badge {
  background: rgba(255,255,255,0.1);
}

[data-theme="dark"] .plan-badge:hover {
  background: rgba(255,255,255,0.15);
}

/* Progress section dark mode */
[data-theme="dark"] .progress-section,
[data-theme="dark"] #progressSection {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .progress-bar-container {
  background: #1e3a5f;
}

[data-theme="dark"] .progress-text {
  color: #f9fafb;
}

/* Migrate items dark mode */
[data-theme="dark"] .migrate-items,
[data-theme="dark"] .migrate-item {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .migrate-item:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .migrate-item-name,
[data-theme="dark"] .item-label {
  color: #f9fafb;
}

[data-theme="dark"] .migrate-item-count,
[data-theme="dark"] .item-count {
  color: #9ca3af;
}

/* Step numbers/indicators dark mode */
[data-theme="dark"] .step-number {
  background: #059669;
  color: white;
}

[data-theme="dark"] .step-title,
[data-theme="dark"] .step-description {
  color: #f9fafb;
}

/* Wizard content area dark mode */
[data-theme="dark"] .wizard-content,
[data-theme="dark"] #wizard-content {
  background: #162231;
  border-color: #1e3a5f;
}

/* Category headers */
[data-theme="dark"] .platform-category-title,
[data-theme="dark"] h4 {
  color: #9ca3af;
}

/* Orders page dark mode */
[data-theme="dark"] .date-container,
[data-theme="dark"] #date-picker-container {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .date-container .box,
[data-theme="dark"] #date-picker-container .box {
  background: #162231;
}

[data-theme="dark"] .date-container h2,
[data-theme="dark"] #date-picker-container h2 {
  color: #f9fafb;
}

[data-theme="dark"] .form-item label {
  color: #e5e7eb;
}

[data-theme="dark"] .actions-bar,
[data-theme="dark"] #actions-bar {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .order-count,
[data-theme="dark"] .order-count-wrapper {
  color: #f9fafb;
}

[data-theme="dark"] .orders-table-container,
[data-theme="dark"] #orders-table-container {
  background: #162231;
}

[data-theme="dark"] .order-row {
  background: #162231;
  border-color: #1e3a5f;
}

[data-theme="dark"] .order-row:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .order-detail,
[data-theme="dark"] .order-preview {
  background: #111827;
  border-color: #1e3a5f;
}

[data-theme="dark"] .order-legend-tooltip {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .legend-title {
  color: #f9fafb;
}

[data-theme="dark"] .legend-item {
  color: #e5e7eb;
}

/* Header left section */
[data-theme="dark"] .header-left h1 {
  color: #f9fafb;
}

/* Order Analysis page specific dark mode fixes */
[data-theme="dark"] .analysis-header {
  color: #f9fafb;
}

[data-theme="dark"] .analysis-header h2 {
  color: #f9fafb;
}

[data-theme="dark"] .analysis-header .analysis-subtitle,
[data-theme="dark"] #analysis-subtitle {
  color: #9ca3af;
}

[data-theme="dark"] #missing-orders-action {
  background: #162231 !important;
  border-color: #1e3a5f !important;
}

[data-theme="dark"] .action-button-container {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(185, 28, 28, 0.1) 100%) !important;
  border-color: rgba(252, 165, 165, 0.3) !important;
}

[data-theme="dark"] .schedule-toggle {
  color: #9ca3af;
}

[data-theme="dark"] .schedule-toggle .toggle-text {
  color: #9ca3af;
}

[data-theme="dark"] .comparison-bar-container {
  background: #162231 !important;
  border-color: #1e3a5f !important;
}

[data-theme="dark"] .comparison-bar-container h3 {
  color: #f9fafb;
}

[data-theme="dark"] .comparison-bar {
  background: #1e3a5f;
}

[data-theme="dark"] .bar-legend,
[data-theme="dark"] .comparison-legend {
  color: #e5e7eb;
}

[data-theme="dark"] .bar-legend span,
[data-theme="dark"] .legend-item span {
  color: #e5e7eb;
}

[data-theme="dark"] .data-table thead th {
  background: #0b1620;
  color: #f9fafb;
  border-color: #1e3a5f;
}

[data-theme="dark"] .data-table tbody td {
  background: #162231;
  color: #e5e7eb;
  border-color: #1e3a5f;
}

[data-theme="dark"] .data-table tbody tr:hover td {
  background: #1e3a5f;
}

[data-theme="dark"] .status-badge {
  color: #f9fafb;
}

[data-theme="dark"] .status-badge.missing,
[data-theme="dark"] .status-badge.not_in_qbo {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

[data-theme="dark"] .status-badge.matched {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

[data-theme="dark"] .status-badge.mismatch {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

/* Toggle slider dark mode */
[data-theme="dark"] .toggle-slider {
  background: #1e3a5f;
}

[data-theme="dark"] input:checked + .toggle-slider {
  background: #3b82f6;
}

/* Account bar dark mode for Order Analysis */
[data-theme="dark"] .account-bar {
  background: #0f1927;
  border-color: #1e3a5f;
}

/* Scan duplicates button */
[data-theme="dark"] .btn-scan-duplicates,
[data-theme="dark"] .btn-outline {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .btn-outline:hover {
  background: #1e3a5f;
}

/* Order Analysis table summary rows dark mode */
[data-theme="dark"] .table-summary-row {
  background: #162231 !important;
  border-color: #1e3a5f !important;
  color: #f9fafb !important;
}

[data-theme="dark"] .table-summary-row.summary-missing {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border-left: 4px solid #ef4444 !important;
}

[data-theme="dark"] .table-summary-row.summary-mismatch {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fcd34d !important;
  border-left: 4px solid #f59e0b !important;
}

[data-theme="dark"] .table-summary-row.summary-orphan {
  background: rgba(124, 58, 237, 0.15) !important;
  color: #c4b5fd !important;
  border-left: 4px solid #7c3aed !important;
}

/* Pagination dark mode */
[data-theme="dark"] .pagination button {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .pagination button:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .pagination button.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

[data-theme="dark"] .pagination button:disabled {
  background: #0f1927;
  color: #6b7280;
  border-color: #1e3a5f;
}

/* Checkbox dark mode */
[data-theme="dark"] input[type="checkbox"] {
  accent-color: #3b82f6;
}

[data-theme="dark"] .row-checkbox,
[data-theme="dark"] .col-checkbox input[type="checkbox"],
[data-theme="dark"] #select-all {
  background: #162231;
  border-color: #1e3a5f;
}

/* Override any inline background styles for orphan JE */
[data-theme="dark"] .table-summary-row[style*="background:#f3e8ff"] {
  background: rgba(124, 58, 237, 0.15) !important;
  color: #c4b5fd !important;
}

/* Inventory Analysis dark mode */
[data-theme="dark"] .summary-card {
  background: #162231 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .summary-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="dark"] .summary-card.selected {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  outline-color: #3b82f6;
}

[data-theme="dark"] .summary-value {
  color: #f9fafb;
}

[data-theme="dark"] .summary-label {
  color: #9ca3af;
}

[data-theme="dark"] .inventory-table th,
[data-theme="dark"] table th {
  background: #0b1620 !important;
  color: #f9fafb !important;
  border-color: #1e3a5f !important;
}

[data-theme="dark"] .inventory-table td,
[data-theme="dark"] table td {
  background: #162231 !important;
  color: #e5e7eb !important;
  border-color: #1e3a5f !important;
}

[data-theme="dark"] .inventory-table tr:hover td,
[data-theme="dark"] table tbody tr:hover td {
  background: #1e3a5f !important;
}

[data-theme="dark"] .page-info {
  color: #9ca3af;
}

[data-theme="dark"] .pagination button,
[data-theme="dark"] .pagination .page-btn {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .pagination button:hover,
[data-theme="dark"] .pagination .page-btn:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .pagination button.active,
[data-theme="dark"] .pagination .page-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
}

[data-theme="dark"] .pagination button:disabled,
[data-theme="dark"] .pagination .page-btn:disabled {
  background: #0b1620;
  color: #6b7280;
}

/* Search input dark mode */
[data-theme="dark"] .search-input,
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="text"] {
  background: #162231 !important;
  border-color: #1e3a5f !important;
  color: #f9fafb !important;
}

[data-theme="dark"] .search-input::placeholder,
[data-theme="dark"] input::placeholder {
  color: #6b7280 !important;
}

/* Export button dark mode */
[data-theme="dark"] .btn-export,
[data-theme="dark"] .export-btn {
  background: #162231;
  border-color: #1e3a5f;
  color: #f9fafb;
}

[data-theme="dark"] .btn-export:hover,
[data-theme="dark"] .export-btn:hover {
  background: #1e3a5f;
}

/* Status badges in inventory */
[data-theme="dark"] .status-matched {
  background: rgba(5, 150, 105, 0.2);
  color: #6ee7b7;
}

[data-theme="dark"] .status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

[data-theme="dark"] .status-danger {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

/* Secondary button dark mode */
[data-theme="dark"] .btn-secondary {
  background: #162231 !important;
  color: #f9fafb !important;
  border-color: #1e3a5f !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #1e3a5f !important;
}

/* Summary card danger (Not in QuickBooks) dark mode fix */
[data-theme="dark"] .summary-card.card-danger {
  background: #162231 !important;
  border-left-color: #dc2626 !important;
}

[data-theme="dark"] .summary-card.card-danger .summary-value {
  color: #fca5a5 !important;
}

/* Summary card info (Not in Shopify) dark mode fix */
[data-theme="dark"] .summary-card.card-info {
  background: #162231 !important;
  border-left-color: #3b82f6 !important;
}

[data-theme="dark"] .summary-card.card-info .summary-value {
  color: #93c5fd !important;
}

/* Summary card success dark mode */
[data-theme="dark"] .summary-card.card-success {
  background: #162231 !important;
}

[data-theme="dark"] .summary-card.card-success .summary-value {
  color: #6ee7b7 !important;
}

/* Summary card warning dark mode */
[data-theme="dark"] .summary-card.card-warning {
  background: #162231 !important;
}

[data-theme="dark"] .summary-card.card-warning .summary-value {
  color: #fcd34d !important;
}

/* Summary card total dark mode */
[data-theme="dark"] .summary-card.card-total {
  background: #162231 !important;
}

/* Inventory status badges dark mode */
[data-theme="dark"] .status-badge {
  border: 1px solid transparent;
}

[data-theme="dark"] .status-matched {
  background: rgba(5, 150, 105, 0.2) !important;
  color: #6ee7b7 !important;
  border-color: rgba(5, 150, 105, 0.4);
}

[data-theme="dark"] .status-not_in_qbo {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #fca5a5 !important;
  border-color: rgba(220, 38, 38, 0.4);
}

[data-theme="dark"] .status-not_in_platform {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.4);
}

/* Financial Health Score dark mode */
[data-theme="dark"] .analysis-controls {
  background: #162231 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .control-group label {
  color: #e5e7eb !important;
}

[data-theme="dark"] .control-group select {
  background: #1e3a5f !important;
  border-color: #2d4a6f !important;
  color: #f9fafb !important;
}

[data-theme="dark"] .progress-section {
  background: #162231 !important;
}

[data-theme="dark"] .progress-text {
  color: #e5e7eb !important;
}

/* Header actions in account-bar dark mode */
[data-theme="dark"] .account-bar .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Fix header-left h1 dark mode text visibility */
[data-theme="dark"] .header-left h1,
[data-theme="dark"] .account-bar h1 {
  color: #f9fafb !important;
}

/* Custom checkbox styling for dark mode */
[data-theme="dark"] input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #1e293b;
  border: 2px solid #64748b;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

[data-theme="dark"] input[type="checkbox"]:hover {
  border-color: #94a3b8;
}

[data-theme="dark"] input[type="checkbox"]:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

[data-theme="dark"] input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

[data-theme="dark"] input[type="checkbox"]:disabled {
  background: #374151;
  border-color: #4b5563;
  cursor: not-allowed;
}

/* Orders page status badges dark mode */
[data-theme="dark"] .status-paid {
  background: rgba(5, 150, 105, 0.2) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .status-pending {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
}

[data-theme="dark"] .status-authorized {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .status-refunded {
  background: rgba(157, 23, 77, 0.2) !important;
  color: #f9a8d4 !important;
}

[data-theme="dark"] .status-partially-refunded {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f9a8d4 !important;
}

[data-theme="dark"] .status-voided {
  background: rgba(107, 114, 128, 0.2) !important;
  color: #9ca3af !important;
}

[data-theme="dark"] .status-expired {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #fca5a5 !important;
}

/* Fulfillment status badges dark mode */
[data-theme="dark"] .fulfillment-fulfilled {
  background: rgba(5, 150, 105, 0.2) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .fulfillment-unfulfilled {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
}

[data-theme="dark"] .fulfillment-partially-fulfilled {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .fulfillment-scheduled {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
}

[data-theme="dark"] .fulfillment-on-hold {
  background: rgba(107, 114, 128, 0.2) !important;
  color: #9ca3af !important;
}

/* Optgroup styling for order filters dropdown */
[data-theme="dark"] select optgroup {
  background: #0f1927;
  color: #9ca3af;
  font-weight: 600;
  font-style: normal;
}

[data-theme="dark"] select option {
  background: #162231;
  color: #f9fafb;
  padding: 8px;
}

[data-theme="dark"] select option:hover,
[data-theme="dark"] select option:focus {
  background: #1e3a5f;
}

/* Active filter chips dark mode */
[data-theme="dark"] .active-filters {
  color: #9ca3af;
}

[data-theme="dark"] .filter-chip {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .filter-chip.financial {
  background: rgba(5, 150, 105, 0.2) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .filter-chip.fulfillment {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .filter-chip.state {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #c4b5fd !important;
}

[data-theme="dark"] .filter-separator {
  color: #6b7280;
}

[data-theme="dark"] .filter-clear-all {
  color: #9ca3af;
}

[data-theme="dark"] .filter-clear-all:hover {
  color: #f87171;
}

/* Filter summary dark mode */
[data-theme="dark"] .filter-summary {
  background: rgba(5, 150, 105, 0.15) !important;
  border-color: rgba(5, 150, 105, 0.3) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .filter-summary .filter-separator {
  color: #34d399 !important;
}

[data-theme="dark"] .filter-summary .filter-clear {
  color: #9ca3af;
}

[data-theme="dark"] .filter-summary .filter-clear:hover {
  color: #f87171;
}