/* ========================================= */
/* SECTION: Global Theme Token System */
/* ========================================= */
/* CHANGE: Two global themes — taoHome and companyMode */
/* BEFORE: Colors split across site.css, lighthouse-theme.css, and page-level hex overrides */
/* AFTER: Unified --theme-* tokens on :root[data-theme="tao-home|company"] */
/* WHY: Shell must reflect home (no company) vs company payroll workspace automatically */

/* ========================================= */
/* SECTION: taoHome — default when no company is selected */
/* ========================================= */
/* CHANGE: Purple-forward Lighthouse / TAO home palette */
/* BEFORE: --lh-primary purple lived only in lighthouse-theme.css :root */
/* AFTER: Full semantic token set for background, surface, text, accent, border */
/* WHY: taoHome is the pre-company and companies-list experience */

:root[data-theme="tao-home"] {
  --theme-background: #f9fafb;
  --theme-surface: #ffffff;
  --theme-surface-muted: #f3f4f6;
  --theme-surface-hover: #fafafa;
  --theme-surface-elevated: #ffffff;
  --theme-text: #111827;
  --theme-text-secondary: #374151;
  --theme-text-muted: #6b7280;
  --theme-text-subtle: #9ca3af;
  --theme-text-inverse: #ffffff;
  --theme-accent: #8b5cf6;
  --theme-accent-hover: #7c3aed;
  --theme-accent-soft: #f3e8ff;
  --theme-accent-border: #e9d5ff;
  --theme-border: #e5e7eb;
  --theme-border-muted: #f3f4f6;
  --theme-border-strong: #d1d5db;
  --theme-success: #16a34a;
  --theme-success-soft: #dcfce7;
  --theme-success-text: #166534;
  --theme-warning: #f59e0b;
  --theme-warning-soft: #fef3c7;
  --theme-warning-text: #92400e;
  --theme-danger: #dc2626;
  --theme-danger-soft: #fee2e2;
  --theme-danger-text: #b91c1c;
  --theme-info: #8b5cf6;
  --theme-info-soft: #dbeafe;
  --theme-info-text: #1e40af;
  --theme-focus-ring: rgba(139, 92, 246, 0.45);
  --theme-accent-shadow: rgba(139, 92, 246, 0.35);
  --bs-primary: var(--theme-accent);
  --bs-primary-rgb: 139, 92, 246;
  --bs-link-color: var(--theme-accent-hover);
  --bs-link-hover-color: #6d28d9;
}

:root[data-theme="tao-home"][data-bs-theme="dark"] {
  --theme-background: #0f1419;
  --theme-surface: #111827;
  --theme-surface-muted: #1f2937;
  --theme-surface-hover: #1f2937;
  --theme-surface-elevated: #1f2937;
  --theme-text: #e5e7eb;
  --theme-text-secondary: #d1d5db;
  --theme-text-muted: #9ca3af;
  --theme-text-subtle: #6b7280;
  --theme-text-inverse: #111827;
  --theme-accent-soft: rgba(139, 92, 246, 0.15);
  --theme-accent-border: rgba(139, 92, 246, 0.35);
  --theme-border: #1f2937;
  --theme-border-muted: #1f2937;
  --theme-border-strong: #374151;
  --theme-success-soft: rgba(22, 163, 74, 0.18);
  --theme-warning-soft: rgba(245, 158, 11, 0.18);
  --theme-danger-soft: rgba(220, 38, 38, 0.18);
  --theme-info-soft: rgba(59, 130, 246, 0.18);
  --theme-focus-ring: rgba(139, 92, 246, 0.5);
  --theme-accent-shadow: rgba(139, 92, 246, 0.4);
}

/* ========================================= */
/* SECTION: companyMode — when a company workspace is active */
/* ========================================= */
/* CHANGE: Teal-forward payroll company palette */
/* BEFORE: --payroll-primary teal only in site.css :root regardless of context */
/* AFTER: Accent switches to payroll teal when data-theme="company" */
/* WHY: Company-selected pages should use payroll brand colors */

:root[data-theme="company"] {
  --theme-background: #f9fafb;
  --theme-surface: #ffffff;
  --theme-surface-muted: #f3f4f6;
  --theme-surface-hover: #fafafa;
  --theme-surface-elevated: #ffffff;
  --theme-text: #111827;
  --theme-text-secondary: #374151;
  --theme-text-muted: #6b7280;
  --theme-text-subtle: #9ca3af;
  --theme-text-inverse: #ffffff;
  --theme-accent: #0d9488;
  --theme-accent-hover: #0f766e;
  --theme-accent-soft: #ccfbf1;
  --theme-accent-border: #99f6e4;
  --theme-border: #e5e7eb;
  --theme-border-muted: #f3f4f6;
  --theme-border-strong: #d1d5db;
  --theme-success: #16a34a;
  --theme-success-soft: #dcfce7;
  --theme-success-text: #166534;
  --theme-warning: #f59e0b;
  --theme-warning-soft: #fef3c7;
  --theme-warning-text: #92400e;
  --theme-danger: #dc2626;
  --theme-danger-soft: #fee2e2;
  --theme-danger-text: #b91c1c;
  --theme-info: #0d9488;
  --theme-info-soft: #ccfbf1;
  --theme-info-text: #115e59;
  --theme-focus-ring: rgba(13, 148, 136, 0.45);
  --theme-accent-shadow: rgba(13, 148, 136, 0.35);
  --bs-primary: var(--theme-accent);
  --bs-primary-rgb: 13, 148, 136;
  --bs-link-color: var(--theme-accent-hover);
  --bs-link-hover-color: #0d9488;
}

:root[data-theme="company"][data-bs-theme="dark"] {
  --theme-background: #0f1419;
  --theme-surface: #111827;
  --theme-surface-muted: #1f2937;
  --theme-surface-hover: #1f2937;
  --theme-surface-elevated: #1f2937;
  --theme-text: #e5e7eb;
  --theme-text-secondary: #d1d5db;
  --theme-text-muted: #9ca3af;
  --theme-text-subtle: #6b7280;
  --theme-text-inverse: #111827;
  --theme-accent-soft: rgba(13, 148, 136, 0.15);
  --theme-accent-border: rgba(13, 148, 136, 0.35);
  --theme-border: #1f2937;
  --theme-border-muted: #1f2937;
  --theme-border-strong: #374151;
  --theme-success-soft: rgba(22, 163, 74, 0.18);
  --theme-warning-soft: rgba(245, 158, 11, 0.18);
  --theme-danger-soft: rgba(220, 38, 38, 0.18);
  --theme-info-soft: rgba(13, 148, 136, 0.18);
  --theme-focus-ring: rgba(13, 148, 136, 0.5);
  --theme-accent-shadow: rgba(13, 148, 136, 0.4);
}

/* ========================================= */
/* SECTION: Legacy Token Aliases */
/* ========================================= */
/* CHANGE: Map existing --lh-* and --payroll-* names to theme tokens */
/* BEFORE: Components referenced disconnected token files */
/* AFTER: Single source of truth via --theme-* with backward-compatible aliases */
/* WHY: Existing CSS can migrate incrementally without breaking selectors */

:root[data-theme="tao-home"],
:root[data-theme="company"] {
  --lh-primary: var(--theme-accent);
  --lh-primary-hover: var(--theme-accent-hover);
  --lh-primary-soft: var(--theme-accent-soft);
  --lh-primary-border: var(--theme-accent-border);
  --lh-bg-page: var(--theme-background);
  --payroll-primary: var(--theme-accent);
  --payroll-warning: var(--theme-warning);
  --payroll-danger: var(--theme-danger);
  --payroll-success: var(--theme-success);
}
