/* Loaded after page-specific styles so every CRM screen keeps one visual identity. */
:root {
  --brand-navy: #17375f;
  --brand-white: #ffffff;
  --brand-sand: #c7a66b;
}

body[data-page-mode="standalone"],
body.premium-page {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
  color: var(--text, #172b45);
}

body[data-page-mode="standalone"] :is(button,input,select,textarea),
body.premium-page :is(button,input,select,textarea) {
  font-family: inherit !important;
}

body[data-page-mode="standalone"] {
  background: var(--bg) !important;
}

body[data-page-mode="standalone"] :is(.topbar,.panel,.stat-card,.category-card,.hero-card,.profile-backup-box,.service-setting-row,.account-security-card,.subscription-card,.appearance-settings-panel,.table-wrap,.client-table-wrap,.target-table-wrap,.analytics-insight-card,.analytics-command-value,.target-plan-panel,.target-coach-panel,.target-log-panel,.target-history-panel,.sales-performance-kpi,.sales-performance-insight-grid > div,.personal-plan-analytics-row,.personal-plan-analytics-summary article,.empty-state) {
  color: var(--text) !important;
  border-color: var(--line) !important;
  background: var(--surface) !important;
}

body[data-page-mode="standalone"] :is(.topbar h2,.panel h3,.hero-card h3,.section-title,.page-title,.analytics-command-value strong,.sales-performance-kpi strong) {
  color: var(--primary) !important;
}

body[data-page-mode="standalone"] :is(.eyebrow,.subtle,.muted,.profile-account-email,.analytics-insight-card p,.sales-performance-insight-grid p) {
  color: var(--muted) !important;
}

body[data-page-mode="standalone"] :is(.primary-btn,.button-primary,.button.primary,.btn-primary) {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
}

body[data-page-mode="standalone"] :is(.ghost-btn,.button.secondary,.btn-secondary,.profile-theme-button,.color-palette-option) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--primary) !important;
}

body[data-page-mode="standalone"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea) {
  border-color: var(--line) !important;
  background: var(--field-surface) !important;
  color: var(--text) !important;
}

body[data-page-mode="standalone"] :is(.data-table th,table thead th) {
  border-color: var(--line) !important;
  background: var(--surface-alt) !important;
  color: var(--primary) !important;
}

body[data-page-mode="standalone"] a:not(.primary-btn):not(.button-primary):not(.button.primary) {
  color: var(--primary);
}

html[data-theme="dark"] body[data-page-mode="standalone"] :is(.topbar h2,.panel h3,.hero-card h3,.section-title,.page-title) {
  color: var(--text) !important;
}

html[data-theme="dark"] body[data-page-mode="standalone"] :is(.ghost-btn,.button.secondary,.btn-secondary,.profile-theme-button,.color-palette-option) {
  background: var(--surface-alt) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body[data-page-mode="standalone"] :is(.data-table th,table thead th) {
  color: var(--beige) !important;
}

body.premium-page :is(.primary-btn,.button-primary,.button.primary,.btn-primary,.header-cta) {
  background-color: var(--brand-navy) !important;
  border-color: var(--brand-navy) !important;
}

body.premium-page :is(.eyebrow,.kicker) { color: var(--brand-sand); }

/* The platform console has its own markup but follows the same CRM identity. */
body:has(.console),
body:has(.admin-gate) {
  --navy: var(--brand-navy);
  --blue: var(--brand-navy);
  --line: #e7dfd1;
  --muted: #64758b;
  --surface: #fff;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}

body:has(.console) :is(button,input,select,textarea) { font-family: inherit !important; }
body:has(.console) .sidebar { background: var(--brand-navy) !important; }
body:has(.console) :is(.brand-mark,.gate-mark) { background: linear-gradient(145deg,#31577f,var(--brand-navy)) !important; }
body:has(.console) .admin-nav button.active { box-shadow: inset -3px 0 var(--brand-sand) !important; }
body:has(.console) .kpi-card::after { background: var(--brand-sand) !important; }
body:has(.console) :is(.button.primary,.text-button,.site-pages-table td strong) { color: var(--brand-navy) !important; }
body:has(.console) .button.primary { background: var(--brand-navy) !important; color: #fff !important; }
body:has(.admin-gate) { background: #f7f5f0 !important; }

/* Premium, consistent actions inside the central floating control. */
#worshipWidget .worship-orbit-trigger,
#worshipWidget .worship-submenu .worship-menu-action,
#worshipWidget .worship-submenu .worship-menu-action:nth-child(n) {
  border: 1px solid var(--beige, #c7a66b) !important;
  color: var(--primary, #17375f) !important;
  background: linear-gradient(145deg, var(--surface, #fff), var(--surface-alt, #f4efe5)) !important;
  box-shadow: 0 8px 20px rgba(23,55,95,.12), inset 0 1px 0 rgba(255,255,255,.9) !important;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

#worshipWidget .worship-orbit-trigger:hover,
#worshipWidget .worship-orbit-trigger[aria-expanded="true"],
#worshipWidget .worship-submenu .worship-menu-action:hover,
#worshipWidget .worship-submenu .worship-menu-action:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary, #17375f) !important;
  color: var(--primary, #17375f) !important;
  background: linear-gradient(145deg, #fff, var(--beige-soft, #eee1c9)) !important;
  box-shadow: 0 12px 24px rgba(23,55,95,.18), inset 0 1px 0 #fff !important;
}

#worshipWidget .worship-submenu .worship-menu-action .worship-menu-icon,
#worshipWidget .worship-orbit-trigger .worship-orbit-icon { color: inherit !important; }
#worshipWidget .worship-submenu .worship-menu-label { color: var(--primary, #17375f) !important; }

html[data-theme="dark"] #worshipWidget .worship-orbit-trigger,
html[data-theme="dark"] #worshipWidget .worship-submenu .worship-menu-action,
html[data-theme="dark"] #worshipWidget .worship-submenu .worship-menu-action:nth-child(n) {
  border-color: var(--beige, #d5b06e) !important;
  color: var(--text, #f0ece3) !important;
  background: linear-gradient(145deg, var(--surface-alt, #223347), var(--surface, #172230)) !important;
}

html[data-theme="dark"] #worshipWidget .worship-orbit-trigger:hover,
html[data-theme="dark"] #worshipWidget .worship-submenu .worship-menu-action:hover,
html[data-theme="dark"] #worshipWidget .worship-submenu .worship-menu-action:focus-visible {
  color: #172b45 !important;
  background: var(--beige, #d5b06e) !important;
}
