/* Light theme only — html[data-salesman-theme="light"] set by /salesman/js/salesman-theme.js */
html[data-salesman-theme="light"] {
  color-scheme: light;
}

/* ——— Light: global body & type ——— */
html[data-salesman-theme="light"] body {
  color: #0f172a !important;
  background: #f1f5f9 !important;
  background-image: none !important;
}

html[data-salesman-theme="light"] .text-white-50 {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .text-secondary {
  color: #64748b !important;
}

html[data-salesman-theme="light"] .text-muted {
  color: #64748b !important;
}

/* ——— Sidebar ——— */
html[data-salesman-theme="light"] .sh-sidebar {
  background: #e2e8f0;
  border-right-color: #cbd5e1;
}

html[data-salesman-theme="light"] .sh-sidebar-brand {
  color: #64748b;
  border-bottom-color: #cbd5e1;
}

html[data-salesman-theme="light"] .sh-sidebar nav a {
  color: #1e293b;
}

html[data-salesman-theme="light"] .sh-sidebar nav a:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #0f172a;
}

html[data-salesman-theme="light"] .sh-sidebar nav a.is-active {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
}

html[data-salesman-theme="light"] .sh-sidebar-section {
  color: #64748b;
}

/* ——— Top bars ——— */
html[data-salesman-theme="light"] .sh-top,
html[data-salesman-theme="light"] .sp-topbar {
  background: #fff !important;
  border-bottom-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .sh-brand,
html[data-salesman-theme="light"] .sp-brand {
  color: #047857 !important;
}

/* ——— Module pages ——— */
html[data-salesman-theme="light"] .sm-module h1 {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sm-module .sm-lead {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sm-step {
  color: #047857;
}

html[data-salesman-theme="light"] .sm-panel,
html[data-salesman-theme="light"] .sm-stat-card {
  background: #fff !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .sm-stat-card .sm-stat-label {
  color: #64748b;
}

html[data-salesman-theme="light"] .sm-stat-card .sm-stat-value {
  color: #047857;
}

html[data-salesman-theme="light"] .sm-panel h2 {
  color: #64748b;
}

html[data-salesman-theme="light"] .sm-table-wrap {
  border-color: #e2e8f0;
  background: #fff;
}

html[data-salesman-theme="light"] .sm-table-wrap th {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sm-table-wrap td {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .table {
  --bs-table-bg: #fff;
  --bs-table-color: #0f172a;
}

html[data-salesman-theme="light"] .sm-empty {
  color: #64748b;
}

/* ——— Workflow module pages (hero, rail, toolbar) ——— */
html[data-salesman-theme="light"] body.sm-workflow-page {
  color: #0f172a !important;
  background: linear-gradient(165deg, #f0fdf4 0%, #f1f5f9 40%, #e2e8f0 100%) !important;
  background-image: none !important;
}

html[data-salesman-theme="light"] .sm-workflow-page .sh-top {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .sm-workflow-rail {
  border-color: #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html[data-salesman-theme="light"] .sm-wf-steps a {
  color: #64748b;
  border-color: #e2e8f0;
  background: #f8fafc;
}

html[data-salesman-theme="light"] .sm-wf-steps a:hover {
  color: #0f172a;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

html[data-salesman-theme="light"] .sm-wf-steps li.is-current a {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.18), #fff);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}

html[data-salesman-theme="light"] .sm-wf-steps .sm-wf-num {
  color: #94a3b8;
}

html[data-salesman-theme="light"] .sm-wf-steps li.is-current .sm-wf-num {
  color: #059669;
}

html[data-salesman-theme="light"] .sm-hero {
  border-bottom-color: #e2e8f0;
}

html[data-salesman-theme="light"] .sm-hero h1 > i {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.2), #fff);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857 !important;
}

html[data-salesman-theme="light"] .sm-info-banner {
  border-color: #bae6fd;
  background: linear-gradient(135deg, #e0f2fe, #f8fafc);
  color: #334155;
}

html[data-salesman-theme="light"] .sm-info-banner strong {
  color: #0f172a;
}

html[data-salesman-theme="light"] .sm-info-banner i {
  color: #0284c7;
}

html[data-salesman-theme="light"] .sm-toolbar {
  border-color: #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

html[data-salesman-theme="light"] .sm-page-actions {
  border-top-color: #e2e8f0;
}

/* Day mode: markup uses .table-dark — show light tables with dark text for contrast */
html[data-salesman-theme="light"] .sm-workflow-page .sm-table-wrap .table.table-dark {
  --bs-table-bg: #ffffff;
  --bs-table-striped-bg: #f8fafc;
  --bs-table-hover-bg: #f1f5f9;
  --bs-table-active-bg: #e2e8f0;
  --bs-table-color: #0f172a;
  --bs-table-border-color: #e2e8f0;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .sm-workflow-page .sm-table-wrap .table.table-dark > :not(caption) > * > * {
  color: #0f172a !important;
  border-color: #e2e8f0;
}

html[data-salesman-theme="light"] .sm-workflow-page .sm-table-wrap .table.table-dark thead th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 700;
}

html[data-salesman-theme="light"] .sm-workflow-page .sm-table-wrap .table.table-dark tbody tr:hover > * {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sm-wf-steps .sm-wf-name {
  color: inherit;
}

html[data-salesman-theme="light"] #smOpenFullContacts {
  border-color: #10b981 !important;
  color: #047857 !important;
  background: #fff !important;
}

html[data-salesman-theme="light"] #smOpenFullContacts:hover {
  background: rgba(16, 185, 129, 0.1) !important;
}

html[data-salesman-theme="light"] .sm-table-wrap .sm-btn-crm {
  border-color: #10b981 !important;
  color: #047857 !important;
  background: #fff !important;
}

html[data-salesman-theme="light"] .sm-table-wrap .sm-btn-crm:hover {
  background: rgba(16, 185, 129, 0.1) !important;
}

html[data-salesman-theme="light"] .sm-badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}

html[data-salesman-theme="light"] .sm-badge-warn {
  color: #b45309;
}

html[data-salesman-theme="light"] .sm-badge-muted {
  color: #475569;
}

/* ——— Forms ——— */
html[data-salesman-theme="light"] .form-control,
html[data-salesman-theme="light"] .form-select {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-salesman-theme="light"] .form-control.bg-dark,
html[data-salesman-theme="light"] .form-select.bg-dark,
html[data-salesman-theme="light"] textarea.form-control.bg-dark {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-salesman-theme="light"] .alert.bg-dark.text-light {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] a.text-success {
  color: #047857 !important;
}

html[data-salesman-theme="light"] .form-control:focus,
html[data-salesman-theme="light"] .form-select:focus {
  color: #0f172a !important;
  border-color: #10b981 !important;
}

html[data-salesman-theme="light"] .form-control::placeholder {
  color: #94a3b8;
}

html[data-salesman-theme="light"] .form-text,
html[data-salesman-theme="light"] .form-label {
  color: #475569 !important;
}

/* Keyboard hint pill (e.g. Ctrl+S) */
html[data-salesman-theme="light"] .sm-workflow-page kbd {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: none !important;
}

/* ——— Dashboard (sp-*) ——— */
html[data-salesman-theme="light"] .sp-hero h1 {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sp-hero p {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sp-card {
  background: #fff !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .sp-card a {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sp-card .sp-sub {
  color: #64748b !important;
}

html[data-salesman-theme="light"] .sp-section-title {
  color: #64748b !important;
}

html[data-salesman-theme="light"] .btn-sp-outline {
  border-color: #10b981;
  color: #047857;
  background: #fff;
}

html[data-salesman-theme="light"] .btn-sp-outline:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
}

html[data-salesman-theme="light"] .btn-sp-logout {
  border-color: #cbd5e1;
  color: #64748b;
}

html[data-salesman-theme="light"] .btn-sp-logout:hover {
  border-color: #f87171;
  color: #b91c1c;
  background: #fef2f2;
}

/* ——— Landing index (sh-*) ——— */
html[data-salesman-theme="light"] .sh-main .sh-hero h1 {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sh-main .sh-hero p,
html[data-salesman-theme="light"] .sh-main .sh-hero p a {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sh-sync {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #065f46 !important;
}

html[data-salesman-theme="light"] .sh-sync strong {
  color: #047857;
}

html[data-salesman-theme="light"] .sh-card {
  background: #fff !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .sh-card h3 {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sh-card p {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sh-card a.cta {
  color: #047857 !important;
}

html[data-salesman-theme="light"] .sh-process {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.08) 0%, #f8fafc 100%);
}

html[data-salesman-theme="light"] .sh-process-title {
  color: #047857;
}

html[data-salesman-theme="light"] .sh-process-num {
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

html[data-salesman-theme="light"] .sh-process-card {
  border-color: rgba(16, 185, 129, 0.35);
  background: #fff;
}

html[data-salesman-theme="light"] .sh-process-card h4 {
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sh-process-card p {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sh-process-card .cta {
  color: #047857 !important;
}

html[data-salesman-theme="light"] .sh-process-branch {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
  color: #334155 !important;
}

html[data-salesman-theme="light"] .sh-process-branch a {
  color: #b45309 !important;
}

html[data-salesman-theme="light"] .sh-sync-hub {
  border-color: rgba(16, 185, 129, 0.3);
  background: #fff;
}

html[data-salesman-theme="light"] .sh-sync-hub-cloud {
  color: #047857;
}

html[data-salesman-theme="light"] .sh-sync-hub p {
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sh-sync-hub-flows {
  color: #334155 !important;
}

html[data-salesman-theme="light"] .sh-value-bar {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sh-section {
  color: #64748b !important;
}

html[data-salesman-theme="light"] .btn-sh-outline {
  border-color: #10b981;
  color: #047857;
}

html[data-salesman-theme="light"] .btn-outline-light {
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  background: #fff !important;
}

html[data-salesman-theme="light"] .btn-outline-secondary {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  background: #f8fafc !important;
}

html[data-salesman-theme="light"] .btn-warning {
  color: #78350f !important;
  background-color: #fbbf24 !important;
  border-color: #d97706 !important;
}

html[data-salesman-theme="light"] .btn-warning:hover {
  color: #451a03 !important;
  background-color: #f59e0b !important;
  border-color: #b45309 !important;
}

html[data-salesman-theme="light"] .btn-outline-warning {
  color: #b45309 !important;
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}

html[data-salesman-theme="light"] .btn-outline-warning:hover {
  color: #78350f !important;
  background: #fef3c7 !important;
  border-color: #d97706 !important;
}

/* ——— Alerts ——— */
html[data-salesman-theme="light"] .alert {
  color: #0f172a;
}

/* ——— Bootstrap “dark” surfaces in a light-only UI (modals, typeahead, pagination) ——— */
html[data-salesman-theme="light"] .modal-content.bg-dark.text-light,
html[data-salesman-theme="light"] .modal-content.bg-dark {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .modal-content.bg-dark .modal-header,
html[data-salesman-theme="light"] .modal-content.bg-dark .modal-footer {
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .modal-content.bg-dark .btn-close {
  filter: none;
  opacity: 0.55;
}

html[data-salesman-theme="light"] .list-group.bg-dark,
html[data-salesman-theme="light"] .list-group-flush.bg-dark {
  background: #fff !important;
}

html[data-salesman-theme="light"] .list-group-item.bg-dark,
html[data-salesman-theme="light"] .list-group-item-action.bg-dark {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html[data-salesman-theme="light"] .list-group-item-action.bg-dark:hover,
html[data-salesman-theme="light"] .list-group-item-action.bg-dark:focus {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .input-group-text.bg-dark.text-light {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

html[data-salesman-theme="light"] .page-link.bg-dark.text-light {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-salesman-theme="light"] .page-link.bg-dark.text-light:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-salesman-theme="light"] .sm-cust-suggest-empty.bg-dark,
html[data-salesman-theme="light"] .sm-customer-suggest-empty.bg-dark {
  background: #f8fafc !important;
  color: #475569 !important;
}

html[data-salesman-theme="light"] .sm-cust-suggest-empty.bg-dark a,
html[data-salesman-theme="light"] .sm-customer-suggest-empty.bg-dark a {
  color: #047857 !important;
}

/* ——— Login page outer ——— (backgrounds live in /salesman/login.html) */
