/* Shared styles for the application - Theme variables (light default) */
:root {
  --bg-page: #f5f7fb;
  --bg-card: #fff;
  --bg-card-hover: #f8f9fa;
  --text-primary: #222d3b;
  --text-secondary: #5a6575;
  --text-muted: #666;
  --text-muted-2: #888;
  --text-muted-3: #999;
  --border: #e0e4e8;
  --border-2: #d0d5dc;
  --border-3: #e5e7eb;
  --sidebar-bg: #222d3b;
  --sidebar-hover: #1a2230;
  --sidebar-border: #33405a;
  --accent: #2b7cff;
  --accent-hover: #1e6ae8;
  --accent-shadow: rgba(43, 124, 255, 0.3);
  --accent-focus: rgba(43, 124, 255, 0.1);
  --success-bg: #d4edda;
  --success-text: #155724;
  --success-border: #c3e6cb;
  --error-bg: #f8d7da;
  --error-text: #721c24;
  --error-border: #f5c6cb;
  --info-bg: #e3f2fd;
  --info-text: #0d47a1;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --surface-muted: #f9fafb;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-2: rgba(0, 0, 0, 0.12);
  --progress-track: #e0e4e8;
}

/* Dark theme */
html.theme-dark {
  --bg-page: #0f1419;
  --bg-card: #1a2230;
  --bg-card-hover: #232d3d;
  --text-primary: #e6edf3;
  --text-secondary: #8b9cad;
  --text-muted: #9ca3af;
  --text-muted-2: #6b7280;
  --text-muted-3: #6b7280;
  --border: #374151;
  --border-2: #4b5563;
  --border-3: #374151;
  --sidebar-bg: #0d1117;
  --sidebar-hover: #161b22;
  --sidebar-border: #21262d;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-shadow: rgba(88, 166, 255, 0.25);
  --accent-focus: rgba(88, 166, 255, 0.15);
  --success-bg: #1a3d2a;
  --success-text: #6ee7b7;
  --success-border: #065f46;
  --error-bg: #3d1f1f;
  --error-text: #fca5a5;
  --error-border: #991b1b;
  --info-bg: #1e3a5f;
  --info-text: #93c5fd;
  --warning-bg: #422c0f;
  --warning-text: #fcd34d;
  --surface-muted: #161b22;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-2: rgba(0, 0, 0, 0.4);
  --progress-track: #374151;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-page);
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 2px 0 8px var(--shadow);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
}

.sidebar h2 {
  font-size: 24px;
  font-weight: 600;
  padding: 28px 0 24px 32px;
  margin: 0;
  color: #fff;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.sidebar ul li {
  padding: 14px 32px;
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar ul li:hover,
.sidebar ul li.active {
  background: var(--sidebar-hover);
  border-left: 4px solid var(--accent);
}

.sidebar .logout {
  margin-top: auto;
  padding: 20px 32px;
  border-top: 1px solid var(--sidebar-border);
}

.main-content {
  flex: 1;
  padding: 40px 48px;
  background: var(--bg-page);
  margin-left: 240px;
  min-height: 100vh;
}

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

.dashboard-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-shadow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

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

.btn-danger {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #c82333;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px var(--shadow-2);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s ease;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Theme-aware alerts (use these instead of inline success/error styles) */
.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--success-border);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--error-border);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-text);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

html.theme-dark .alert-info {
  border-color: #1e40af;
}

.bg-muted {
  background: var(--surface-muted);
}

.text-accent {
  color: var(--accent);
}

.payment-received-box {
  margin-top: 12px;
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
  background: #e8f5e9;
  color: #2e7d32;
}

html.theme-dark .payment-received-box {
  background: var(--success-bg);
  color: var(--success-text);
}

/* Goals filter bar - one single horizontal line (like example) */
.goals-filter-card {
  margin-bottom: 20px;
  padding: 14px 20px;
  box-shadow: 0 2px 8px var(--shadow);
  background: var(--bg-card);
}

.goals-filter-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
}

.goals-filter-bar .filter-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.goals-filter-bar .filter-item-name {
  flex: 1;
  min-width: 120px;
}

.goals-filter-bar .filter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.goals-filter-bar .filter-input {
  width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
}

.goals-filter-bar .filter-item-name .filter-input {
  width: 100%;
  min-width: 140px;
}

.goals-filter-bar .filter-actions {
  display: inline-flex;
  gap: 8px;
  margin-left: 4px;
}

.goals-filter-bar .btn-filter {
  padding: 8px 18px;
  font-size: 14px;
}

.goals-filter-bar .btn-clear {
  padding: 8px 18px;
  font-size: 14px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}

.goals-filter-bar .btn-clear:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-2);
}

/* Goals Open/Completed tabs - clean segmented control */
.goals-tabs-wrap {
  margin-bottom: 24px;
}

.goals-tabs {
  display: inline-flex;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 1px 2px var(--shadow);
}

.goals-tabs .tab-link {
  padding: 10px 26px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
  border-right: 1px solid var(--border-3);
  background: var(--bg-card);
}

.goals-tabs .tab-link:last-child {
  border-right: none;
}

.goals-tabs .tab-link:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}

.goals-tabs .tab-link.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.goals-tabs .tab-link.active:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Tasks page: four tabs (Open / Completed / Invoiced / Paid) - slightly tighter */
.goals-tabs.tasks-tabs-four .tab-link {
  padding: 10px 18px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px var(--shadow-2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted-2);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.goal-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.2s ease;
  border-left: 4px solid var(--accent);
}

.goal-card:hover {
  box-shadow: 0 4px 16px var(--shadow-2);
  transform: translateY(-2px);
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.goal-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.goal-card-actions {
  display: flex;
  gap: 8px;
}

.goal-card-description {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.goal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.goal-card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.goal-card-progress {
  margin-top: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.progress-bar {
  background: var(--progress-track);
  border-radius: 8px;
  overflow: hidden;
  height: 10px;
}

.progress-fill {
  background: linear-gradient(90deg, #2b7cff 0%, #1e6ae8 100%);
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 8px;
}

.progress-fill.high {
  background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.progress-fill.medium {
  background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.progress-fill.low {
  background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted-2);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted-3);
}

/* Home: Reserve funds & Goal Gap (base) */
.reserve-funds-heading { margin: 0 0 12px 0; font-size: 16px; color: #64748b; }
.reserve-funds-desc { margin: 0 0 12px 0; font-size: 14px; color: var(--text-muted); }
.reserve-account-chip { padding: 6px 12px; background: #f1f5f9; border-radius: 6px; font-size: 14px; color: var(--text-primary); }
.goal-gap-title-main { margin: 0 0 20px 0; font-size: 20px; font-weight: 600; color: var(--text-primary); }
.goal-gap-desc { margin: 0 0 20px 0; font-size: 14px; color: var(--text-muted); }
.goal-gap-empty { padding: 24px; text-align: center; border-radius: 8px; }
.goal-gap-empty--safe { background: #f0fdf4; color: #166534; }
.goal-gap-list { display: flex; flex-direction: column; gap: 12px; }
.goal-gap-row { padding: 16px; border-radius: 8px; border-left: 4px solid; }
.goal-gap-row--safe { background: #f0fdf4; border-left-color: #22c55e; }
.goal-gap-row--risk { background: #fef2f2; border-left-color: #dc2626; }
.goal-gap-row-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.goal-gap-row-main { flex: 1; min-width: 200px; }
.goal-gap-row-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.goal-gap-goal-title { font-weight: 600; color: var(--text-primary); }
.goal-gap-badge { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.goal-gap-badge--safe { background: #dcfce7; color: #166534; }
.goal-gap-badge--risk { background: #fee2e2; color: #991b1b; }
.goal-gap-meta { font-size: 14px; color: var(--text-muted); }
.goal-gap-shortfall { margin-top: 8px; font-size: 14px; color: #991b1b; font-weight: 600; }
.goal-gap-available { text-align: right; font-size: 13px; color: var(--text-muted); }
.goal-gap-no-due-wrap { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-3); }
.goal-gap-no-due-heading { margin: 0 0 12px 0; font-size: 14px; color: var(--text-secondary); }
.goal-gap-no-due-list { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-gap-no-due-chip { padding: 6px 12px; background: #f3f4f6; border-radius: 6px; font-size: 13px; color: var(--text-primary); }

/* Goal gap: compact 4-metric summary (replaces per-task inflow list) */
.goal-gap-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.goal-gap-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

@media (max-width: 720px) {
  .goal-gap-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.goal-gap-stat {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.goal-gap-row--risk .goal-gap-stat {
  background: rgba(255, 255, 255, 0.75);
}

.goal-gap-stat--emphasis {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 1px 0 rgba(34, 197, 94, 0.12);
}

.goal-gap-row--risk .goal-gap-stat--emphasis {
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 1px 0 rgba(220, 38, 38, 0.08);
}

.goal-gap-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.2;
}

.goal-gap-stat-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-word;
}

.goal-gap-stat-value--negative {
  color: #b91c1c;
}

.goal-gap-inflows {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-3);
  font-size: 12px;
  color: var(--text-muted);
}

.goal-gap-inflows-title {
  margin-bottom: 4px;
  font-weight: 500;
  color: var(--text-secondary);
}

.goal-gap-inflows-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.goal-gap-inflow-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  padding: 2px 0;
}

.goal-gap-inflow-name {
  font-weight: 500;
  color: var(--text-primary);
}

.goal-gap-inflow-amount {
  font-weight: 500;
}

.goal-gap-inflow-date,
.goal-gap-inflow-status {
  opacity: 0.9;
}

.goal-gap-inflows-empty {
  font-style: italic;
}

.summary-totals { background: var(--surface-muted); }

/* Theme toggle button in sidebar */
.theme-toggle-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-hover);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Dark theme overrides for page-specific / inline-style elements */
html.theme-dark .task-due-card,
html.theme-dark .marketing-tabs .tab-link,
html.theme-dark .manage-subtabs a,
html.theme-dark .section-list li,
html.theme-dark .platform-list li,
html.theme-dark .task-list li {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .task-due-card .task-meta,
html.theme-dark .task-due-card .progress,
html.theme-dark .frequency-badge {
  color: var(--text-muted) !important;
}

html.theme-dark .task-due-card.done {
  background: var(--success-bg) !important;
  border-left-color: var(--success-border) !important;
}

html.theme-dark .marketing-tabs,
html.theme-dark .goals-filter-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

html.theme-dark .date-row input[type="date"],
html.theme-dark .filter-bar-manage select {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .manage-subtabs a.active,
html.theme-dark .marketing-tabs .tab-link.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

html.theme-dark .manage-subtabs a:hover:not(.active),
html.theme-dark .marketing-tabs .tab-link:hover:not(.active) {
  background: var(--bg-card-hover) !important;
  color: var(--accent) !important;
}

/* Task cards (tasks.php) and status badges */
html.theme-dark .task-card {
  background: var(--bg-card) !important;
  border-left-color: var(--accent) !important;
}

html.theme-dark .subtask-row,
html.theme-dark .goal-card-meta-item {
  color: var(--text-muted) !important;
}

/* Status badges stay readable in dark */
html.theme-dark .status-open { background: #1e3a5f; color: #93c5fd; }
html.theme-dark .status-completed { background: #422c0f; color: #fcd34d; }
html.theme-dark .status-invoiced { background: #3d1f3d; color: #e9d5ff; }
html.theme-dark .status-paid { background: #1a3d2a; color: #6ee7b7; }

/* Home: Reserve funds & Goal Gap (dark) */
html.theme-dark .reserve-funds-heading { color: var(--text-secondary); }
html.theme-dark .reserve-funds-desc { color: var(--text-muted); }
html.theme-dark .reserve-account-chip { background: var(--surface-muted); color: var(--text-primary); border: 1px solid var(--border); }
html.theme-dark .goal-gap-desc { color: var(--text-muted); }
html.theme-dark .goal-gap-empty--safe { background: var(--success-bg); color: var(--success-text); }
html.theme-dark .goal-gap-row--safe { background: var(--success-bg); border-left-color: var(--success-border); }
html.theme-dark .goal-gap-row--risk { background: var(--error-bg); border-left-color: var(--error-border); }
html.theme-dark .goal-gap-goal-title { color: var(--text-primary); }
html.theme-dark .goal-gap-badge--safe { background: #1a3d2a; color: #6ee7b7; }
html.theme-dark .goal-gap-badge--risk { background: #3d1f1f; color: #fca5a5; }
html.theme-dark .goal-gap-meta { color: var(--text-muted); }
html.theme-dark .goal-gap-shortfall { color: #fca5a5; }
html.theme-dark .goal-gap-available { color: var(--text-muted); }
html.theme-dark .goal-gap-no-due-heading { color: var(--text-secondary); }
html.theme-dark .goal-gap-no-due-chip { background: var(--surface-muted); color: var(--text-primary); }
html.theme-dark .goal-gap-summary {
  border-top-color: var(--border-3);
}
html.theme-dark .goal-gap-stat {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--border-3);
}
html.theme-dark .goal-gap-row--risk .goal-gap-stat {
  background: rgba(0, 0, 0, 0.25);
}
html.theme-dark .goal-gap-stat-value--negative {
  color: #fca5a5;
}

/* Tasks: card title and Sub-tasks (dark) */
html.theme-dark .task-card-title { color: var(--text-primary) !important; }
html.theme-dark .subtasks-toggle { color: var(--text-primary) !important; }
html.theme-dark .subtasks-toggle .subtasks-chevron { color: var(--text-primary); }
html.theme-dark .subtasks-section { border-top-color: var(--border) !important; }
html.theme-dark .subtask-row { background: var(--surface-muted) !important; }
html.theme-dark .subtask-row span { color: var(--text-primary) !important; }

/* Allocations / Route payment: Source Summary & Totals (dark) */
html.theme-dark .allocation-summary,
html.theme-dark .payment-summary { background: var(--surface-muted); border-radius: 8px; }
html.theme-dark .allocation-summary h3,
html.theme-dark .payment-summary h3 { color: var(--text-primary); }
html.theme-dark .summary-row { border-bottom-color: var(--border); color: var(--text-primary); }
html.theme-dark .summary-row span { color: var(--text-primary); }
html.theme-dark .summary-row strong { color: var(--text-primary); }
html.theme-dark .summary-row:last-child { border-top-color: var(--accent); }
html.theme-dark .summary-totals { background: var(--surface-muted) !important; color: var(--text-primary); }
html.theme-dark .summary-totals .summary-row { color: var(--text-primary); }
html.theme-dark .summary-totals .summary-row span { color: var(--text-primary); }
html.theme-dark .allocation-item { background: var(--bg-card) !important; border-color: var(--border) !important; }
html.theme-dark .allocation-item-title { color: var(--text-primary) !important; }
html.theme-dark .allocation-item-meta { color: var(--text-muted) !important; }
html.theme-dark .currency-symbol { color: var(--text-muted); }
html.theme-dark .allocation-input-group input,
html.theme-dark .allocation-input-group select { border-color: var(--border); background: var(--bg-card); color: var(--text-primary); }
html.theme-dark .card h3 { color: var(--text-primary); }

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    min-height: auto;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }

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

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