:root {
  /* Brand Colors */
  --color-navy: #102A4C;
  --color-navy-dark: #0B2748;
  --color-navy-deep: #071B33;
  --color-navy-card: #0F2848;
  
  --color-orange: #FF6B0B;
  --color-orange-hover: #E95E00;
  --color-orange-light: #FFF4ED;
  --color-orange-subtle: #FFE8D6;

  /* Neutrals */
  --color-text: #16243A;
  --color-text-secondary: #5A6B82;
  --color-text-muted: #8492A6;
  --color-text-light: #A0ABC0;
  --color-text-white: #FFFFFF;

  --color-bg: #F7F9FC;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #F8FAFC;
  --color-border: #E7ECF2;
  --color-border-subtle: #F1F4F9;
  --color-divider: #E2E8F0;

  /* Accent & Functional */
  --color-success: #16A34A;
  --color-success-bg: #DCFCE7;
  --color-success-text: #15803D;

  --color-warning: #D97706;
  --color-warning-bg: #FEF3C7;

  --color-info: #2563EB;
  --color-info-bg: #EFF6FF;

  --color-danger: #DC2626;
  --color-danger-bg: #FEE2E2;

  /* Typography */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.8125rem;  /* 13px */
  --font-size-base: 0.875rem; /* 14px */
  --font-size-md: 0.9375rem;  /* 15px */
  --font-size-lg: 1rem;       /* 16px */
  --font-size-xl: 1.125rem;   /* 18px */
  --font-size-2xl: 1.25rem;   /* 20px */
  --font-size-3xl: 1.75rem;   /* 28px */
  --font-size-4xl: 2.125rem;  /* 34px */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Borders & Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-card: 0 2px 6px rgba(16, 42, 76, 0.04), 0 1px 2px rgba(16, 42, 76, 0.02);
  --shadow-md: 0 4px 12px rgba(16, 42, 76, 0.07);
  --shadow-lg: 0 10px 25px rgba(16, 42, 76, 0.1);

  /* Container */
  --container-max-width: 1280px;
  --header-height: 72px;
  --nav-height: 48px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Dark Theme Support */
body.dark-theme {
  --color-bg: #0C1524;
  --color-surface: #121F33;
  --color-surface-subtle: #172740;
  --color-border: #1E314D;
  --color-border-subtle: #1A2B44;
  --color-divider: #233857;

  --color-text: #F1F5F9;
  --color-text-secondary: #94A3B8;
  --color-text-muted: #64748B;
  --color-text-light: #475569;

  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);

  color-scheme: dark;
}

/* Components that still carry legacy fixed light colors. */
body.dark-theme .site-header,
body.dark-theme .header-top,
body.dark-theme .header-popover-menu,
body.dark-theme .header-popover-footer,
body.dark-theme .header-user-dropdown-menu,
body.dark-theme .hero-features-box,
body.dark-theme .forum-header-card,
body.dark-theme .forum-group-card,
body.dark-theme .forum-toolbar,
body.dark-theme .topic-table-card,
body.dark-theme .forum-sidebar-card,
body.dark-theme .topic-post-card,
body.dark-theme .reply-composer-card,
body.dark-theme .post-edit-modal-card,
body.dark-theme .profile-hero,
body.dark-theme .profile-card,
body.dark-theme .security-card,
body.dark-theme .search-suggest-dropdown,
body.dark-theme .wt-chat-sidebar,
body.dark-theme .wt-chat-sidebar-header,
body.dark-theme .wt-chat-main,
body.dark-theme .wt-chat-header,
body.dark-theme .wt-chat-input-area,
body.dark-theme .wt-chat-bubble.is-other {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

body.dark-theme .header-popover-header,
body.dark-theme .header-popover-item:hover,
body.dark-theme .header-user-dropdown-menu .dropdown-item:hover,
body.dark-theme .forum-row:hover,
body.dark-theme .topic-row:hover,
body.dark-theme .post-author-col,
body.dark-theme .post-quote-box,
body.dark-theme .email-status-row,
body.dark-theme .session-item,
body.dark-theme .device-item,
body.dark-theme .wt-chat-sidebar-tabs,
body.dark-theme .wt-chat-stream,
body.dark-theme .wt-chat-item:hover,
body.dark-theme .wt-chat-back-mobile {
  background-color: var(--color-surface-subtle);
  border-color: var(--color-border);
}

body.dark-theme .header-popover-item.unread,
body.dark-theme .wt-chat-item.active {
  background-color: rgba(255, 107, 11, 0.12);
}

body.dark-theme .wt-chat-item.unread {
  background-color: rgba(22, 163, 74, 0.12);
}

body.dark-theme :is(
  .header-popover-header,
  .header-user-dropdown-menu .dropdown-item,
  .brand-logo,
  .brand-logo .logo-web,
  .card-header-title,
  .stat-number,
  .topic-title-link,
  .topic-author-name,
  .btn-more-topics,
  .forum-title-link,
  .forum-header-title,
  .forum-group-title,
  .forum-title,
  .topic-title,
  .forum-sidebar-title,
  .author-profile-link,
  .post-body-text,
  .reply-composer-title,
  .profile-name,
  .profile-card__title,
  .security-card__title,
  .email-display,
  .activity-item__title,
  .suggest-item-title,
  .wt-chat-sidebar-title,
  .wt-chat-item-name,
  .wt-chat-partner-title,
  .wt-chat-bubble.is-other,
  .wt-chat-back-mobile
) {
  color: var(--color-text);
}

body.dark-theme .text-navy {
  color: var(--color-text) !important;
}

body.dark-theme .topics-data-table tr.topic-row:hover td,
body.dark-theme .forum-item-row:hover {
  background-color: var(--color-surface-subtle);
}

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
  background-color: var(--color-surface-subtle);
  border-color: var(--color-border) !important;
  color: var(--color-text);
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
  color: var(--color-text-muted);
}
