/* ===== THEME TOKENS ===== */
/* Light mode (fallback) */
:root {
  --bg-primary: #fafafa; /* Off-white • reduces eye strain even more */
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #eeeeee;
  --bg-card: #ffffff; /* Pure white for cards/surfaces */
  --bg-hover: #f0f0f0;

  --text-primary: #1e293b; /* Slate-700 • reduced contrast for comfort */
  --text-secondary: #475569; /* Slate-600 */
  --text-muted: #64748b; /* Slate-500 */
  --text-inverse: #ffffff;

  --brand-primary: #05428c; /* Company navy */
  --brand-primary-hover: #04336e;
  --brand-gold: #f59e0b; /* amber-500 • more visible in light mode */
  --brand-gold-hover: #fbbf24;
  --brand-gold-soft: #fef3c7;

  --border-light: #e2e8f0; /* Even softer border */
  --border-medium: #cbd5e1;
  --border-focus: #05428c;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(5, 66, 140, 0.2);

  --brand-primary-rgb: 5, 66, 140;
  --brand-primary-hover-rgb: 4, 51, 110;
  --brand-gold-rgb: 245, 158, 11;
  --brand-gold-hover-rgb: 251, 191, 36;
  --text-primary-rgb: 30, 41, 59;
  --text-muted-rgb: 100, 116, 139;
  --border-light-rgb: 226, 232, 240;
  --zalo-primary-rgb: 0, 104, 255;
  --zalo-primary-hover-rgb: 0, 82, 204;
  --brand-gold-light-rgb: 255, 226, 122;
  --brand-cyan-rgb: 6, 182, 212;
  --brand-cyan-light-rgb: 34, 211, 238;
  --brand-cyan-dark-rgb: 8, 145, 178;
  --brand-purple-rgb: 139, 92, 246;
  --brand-purple-light-rgb: 167, 139, 250;
  --brand-purple-dark-rgb: 124, 58, 237;

  --nav-bg: #ffffff;
  --nav-border: #e2e8f0;
  --footer-bg: #0e1e34;
  --footer-text: #e2e8f0;
}

/* Dark mode (DEFAULT) */
[data-theme="dark"] {
  --bg-primary: #1e293b; /* slate-800 • lighter for reduced contrast */
  --bg-secondary: #334155; /* gray-800 */
  --bg-tertiary: #475569; /* gray-700 */
  --bg-card: #334155; /* gray-800 • slightly lighter than bg for elevation */
  --bg-hover: #475569; /* gray-700 */

  --text-primary: #e2e8f0; /* gray-100 • much softer than pure white */
  --text-secondary: #94a3b8; /* gray-400 */
  --text-muted: #64748b; /* gray-500 */
  --text-inverse: #1e293b;

  --brand-primary: #3b82f6; /* blue-500 • vibrant on dark */
  --brand-primary-hover: #60a5fa;
  --brand-gold: #fbbf24; /* amber-400 • pops on dark */
  --brand-gold-hover: #fbbf24;
  --brand-gold-soft: #3d2b00;

  --border-light: #475569; /* gray-700 • subtle but visible */
  --border-medium: #64748b;
  --border-focus: #60a5fa;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3); /* Colored glow */

  --brand-primary-rgb: 59, 130, 246;
  --brand-primary-hover-rgb: 96, 165, 250;
  --brand-gold-rgb: 251, 191, 36;
  --brand-gold-hover-rgb: 251, 191, 36;
  --text-primary-rgb: 226, 232, 240;
  --text-muted-rgb: 100, 116, 139;
  --border-light-rgb: 71, 85, 105;
  --zalo-primary-rgb: 0, 104, 255;
  --zalo-primary-hover-rgb: 0, 82, 204;
  --brand-gold-light-rgb: 255, 226, 122;
  --brand-cyan-rgb: 6, 182, 212;
  --brand-cyan-light-rgb: 34, 211, 238;
  --brand-cyan-dark-rgb: 8, 145, 178;
  --brand-purple-rgb: 139, 92, 246;
  --brand-purple-light-rgb: 167, 139, 250;
  --brand-purple-dark-rgb: 124, 58, 237;

  --nav-bg: #334155;
  --nav-border: #475569;
  --footer-bg: #061020;
  --footer-text: #94a3b8;
}

/* Dark mode (DEFAULT) */
[data-theme="dark"] {
  --bg-primary: #0b1220;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-gold: #fbbf24;
  --brand-gold-hover: #fcd34d;
  --brand-gold-soft: #3d2b00;

  --border-light: #334155;
  --border-medium: #475569;
  --border-focus: #60a5fa;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.4);

  --brand-primary-rgb: 59, 130, 246;
  --brand-primary-hover-rgb: 96, 165, 250;
  --brand-gold-rgb: 251, 191, 36;
  --brand-gold-hover-rgb: 252, 211, 77;
  --text-primary-rgb: 241, 245, 249;
  --text-muted-rgb: 148, 163, 184;
  --border-light-rgb: 51, 65, 85;
  --zalo-primary-rgb: 0, 104, 255;
  --zalo-primary-hover-rgb: 0, 82, 204;
  --brand-gold-light-rgb: 255, 226, 122;
  --brand-cyan-rgb: 6, 182, 212;
  --brand-cyan-light-rgb: 34, 211, 238;
  --brand-cyan-dark-rgb: 8, 145, 178;
  --brand-purple-rgb: 139, 92, 246;
  --brand-purple-light-rgb: 167, 139, 250;
  --brand-purple-dark-rgb: 124, 58, 237;

  --nav-bg: #111827;
  --nav-border: #334155;
  --footer-bg: #061020;
  --footer-text: #94a3b8;
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #0b1220;
    --bg-secondary: #111827;
    --bg-tertiary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --brand-primary: #3b82f6;
    --brand-primary-hover: #60a5fa;
    --brand-gold: #fbbf24;
    --brand-gold-hover: #fcd34d;
    --brand-gold-soft: #3d2b00;

    --border-light: #334155;
    --border-medium: #475569;
    --border-focus: #60a5fa;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.4);

    --brand-primary-rgb: 59, 130, 246;
    --brand-primary-hover-rgb: 96, 165, 250;
    --brand-gold-rgb: 251, 191, 36;
    --brand-gold-hover-rgb: 252, 211, 77;
    --text-primary-rgb: 241, 245, 249;
    --text-muted-rgb: 148, 163, 184;
    --border-light-rgb: 51, 65, 85;
    --zalo-primary-rgb: 0, 104, 255;
    --zalo-primary-hover-rgb: 0, 82, 204;
    --brand-gold-light-rgb: 255, 226, 122;
    --brand-cyan-rgb: 6, 182, 212;
    --brand-cyan-light-rgb: 34, 211, 238;
    --brand-cyan-dark-rgb: 8, 145, 178;
    --brand-purple-rgb: 139, 92, 246;
    --brand-purple-light-rgb: 167, 139, 250;
    --brand-purple-dark-rgb: 124, 58, 237;

    --nav-bg: #111827;
    --nav-border: #334155;
    --footer-bg: #061020;
    --footer-text: #94a3b8;
  }
}

/* Base body styles using theme tokens */
body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-size: 14px;
  font-family: 'Be Vietnam Pro', 'Roboto Condensed', Arial, Helvetica, Tahoma, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body a {
  color: var(--brand-primary);
  transition: color 0.2s ease;
}

body a:hover {
  color: var(--brand-primary-hover);
}

/* Theme toggle button */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-primary);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--brand-primary);
  background: var(--bg-hover);
  transform: scale(1.05);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.theme-toggle svg {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Smooth transitions for theme-aware elements */
.b2b-header-inner,
.b2b-nav-bar,
.b2b-footer,
.b2b-topbar,
.b2b-search-box-row,
.b2b-search-input-lg,
.b2b-search-input,
.b2b-search-btn-lg,
.b2b-search-btn,
.b2b-search-tag,
.b2b-mobile-bottombar,
.b2b-drawer-nav,
.menu_left_id,
.div-sp-1-4,
.div-sp-1-5,
.vinh-table,
.box-title h2.heading,
.home-news-grid .items .meta h3 a,
.ND,
.breadcrumb,
#breadcrumb,
.fab-btn,
.mobile-bottom-bar,
.b2b-footer-item,
.b2b-footer-links a,
.b2b-social-icon,
.b2b-footer-email-input,
.b2b-footer-submit-btn {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}