/**
 * Nanban Settings Ivory — premium readable UI (loads last)
 * Fixes contrast after settings.js + enterprise CSS
 */

/* ═══ GLOBAL READABLE TEXT (all pages) ═══ */
html.nb-ivory-theme body {
  color: #18181b !important;
  font-family: "Inter", "Noto Sans Tamil", system-ui, sans-serif;
}

html.nb-ivory-theme p,
html.nb-ivory-theme li,
html.nb-ivory-theme td,
html.nb-ivory-theme th,
html.nb-ivory-theme span:not(.btn):not(.tag-expiry):not(.tag-30day):not(.tag-tomorrow-30):not(.tag-today-30),
html.nb-ivory-theme div:not(.btn):not(.modal-overlay) {
  color: inherit;
}

html.nb-ivory-theme #nbAppMain,
html.nb-ivory-theme #loginScreen,
html.nb-ivory-theme #publicPortal {
  color: #18181b;
}

html.nb-ivory-theme #nbAppMain p,
html.nb-ivory-theme #nbAppMain label,
html.nb-ivory-theme #nbAppMain small,
html.nb-ivory-theme #loginScreen p,
html.nb-ivory-theme #loginScreen label {
  color: #475569;
}

html.nb-ivory-theme #nbAppMain input,
html.nb-ivory-theme #nbAppMain select,
html.nb-ivory-theme #nbAppMain textarea {
  color: #0c0a09 !important;
  font-weight: 500 !important;
}

html.nb-ivory-theme #nbAppMain input::placeholder,
html.nb-ivory-theme #nbAppMain textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* ═══ SETTINGS — full premium shell ═══ */
html.nb-ivory-theme #settingsSection,
html.nb-ivory-theme body.nanban-pro-app #settingsSection {
  background: transparent !important;
  color: #0c0a09 !important;
}

html.nb-ivory-theme #settingsSection .settings-page-hero {
  padding: 8px 0 20px !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html.nb-ivory-theme #settingsSection .settings-page-hero h2 {
  font-family: "Plus Jakarta Sans", "Noto Sans Tamil", "Inter", sans-serif !important;
  font-size: clamp(1.625rem, 3.5vw, 2.25rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
  color: #0c0a09 !important;
}

html.nb-ivory-theme #settingsSection .settings-page-hero p {
  color: #475569 !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
}

html.nb-ivory-theme #settingsSection .settings-sidenav {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08) !important;
}

html.nb-ivory-theme #settingsSection .settings-sidenav-title {
  color: #64748b !important;
  font-weight: 700 !important;
}

html.nb-ivory-theme #settingsSection .nb-set-cat-btn {
  color: #475569 !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
}

html.nb-ivory-theme #settingsSection .nb-set-cat-btn--active {
  color: #b91c1c !important;
  font-weight: 700 !important;
}

html.nb-ivory-theme #settingsSection .settings-nav-item {
  color: #64748b !important;
  font-weight: 600 !important;
}

html.nb-ivory-theme #settingsSection .settings-nav-item--active {
  color: #b91c1c !important;
  font-weight: 700 !important;
}

html.nb-ivory-theme #settingsSection .nb-set-advanced-chip {
  background: #f8fafc !important;
  border: 1px dashed rgba(15, 23, 42, 0.15) !important;
  color: #475569 !important;
  font-weight: 600 !important;
}

html.nb-ivory-theme #settingsSection #nanbanSettingsBento {
  gap: 20px !important;
}

html.nb-ivory-theme #settingsSection .settings-pane-panel.nb-set-pane--visible,
html.nb-ivory-theme #settingsSection .glass-card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06) !important;
  color: #18181b !important;
}

html.nb-ivory-theme #settingsSection .nb-set-profile-card {
  padding: 28px !important;
}

html.nb-ivory-theme #settingsSection .nb-set-card-head h3 {
  font-family: "Plus Jakarta Sans", "Noto Sans Tamil", sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #0c0a09 !important;
  letter-spacing: -0.03em !important;
}

html.nb-ivory-theme #settingsSection .nb-set-card-sub {
  color: #64748b !important;
  font-size: 0.9375rem !important;
}

html.nb-ivory-theme #settingsSection h3,
html.nb-ivory-theme #settingsSection h4 {
  font-family: "Plus Jakarta Sans", "Noto Sans Tamil", sans-serif !important;
  font-weight: 800 !important;
  color: #0c0a09 !important;
  letter-spacing: -0.025em !important;
}

html.nb-ivory-theme #settingsSection label,
html.nb-ivory-theme #settingsSection .nb-set-label {
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
}

html.nb-ivory-theme #settingsSection .nb-set-label-sub {
  color: #64748b !important;
  font-weight: 500 !important;
}

html.nb-ivory-theme #settingsSection .nb-set-hint {
  color: #64748b !important;
  font-size: 0.8125rem !important;
  line-height: 1.55 !important;
}

html.nb-ivory-theme #settingsSection input:not([type="checkbox"]):not([type="radio"]):not(.nb-set-toggle-input),
html.nb-ivory-theme #settingsSection select,
html.nb-ivory-theme #settingsSection textarea {
  background: #ffffff !important;
  color: #0c0a09 !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  font-size: 0.9375rem !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

html.nb-ivory-theme #settingsSection input[style*="border:none"],
html.nb-ivory-theme #settingsSection select[style*="border:none"],
html.nb-ivory-theme #settingsSection textarea[style*="border:none"] {
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
  color: #0c0a09 !important;
}

html.nb-ivory-theme #settingsSection select option {
  background: #ffffff !important;
  color: #18181b !important;
}

html.nb-ivory-theme #settingsSection .nb-set-toggle-text {
  color: #334155 !important;
  font-weight: 600 !important;
}

html.nb-ivory-theme #settingsSection .nb-set-hours-day,
html.nb-ivory-theme #settingsSection .nb-set-hours-closed-label {
  color: #334155 !important;
  font-weight: 600 !important;
}

html.nb-ivory-theme #settingsSection table th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 700 !important;
}

html.nb-ivory-theme #settingsSection table td {
  color: #334155 !important;
}

html.nb-ivory-theme #settingsSection details summary {
  color: #475569 !important;
  font-weight: 600 !important;
}

/* Semantic colored panels — preserve & enhance */
html.nb-ivory-theme #settingsSection [style*="background:#fef2f2"],
html.nb-ivory-theme #settingsSection [style*="background: #fef2f2"] {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

html.nb-ivory-theme #settingsSection [style*="background:#f0fdf4"],
html.nb-ivory-theme #settingsSection [style*="background: #f0fdf4"],
html.nb-ivory-theme #settingsSection #settingsRtoChecklistSection {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
}

html.nb-ivory-theme #settingsSection [style*="background:#fffbeb"],
html.nb-ivory-theme #settingsSection [style*="background: #fffbeb"] {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}

html.nb-ivory-theme #settingsSection [style*="background:#f8fafc"],
html.nb-ivory-theme #settingsSection [style*="background: #f8fafc"] {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html.nb-ivory-theme #settingsSection [style*="background:linear-gradient"],
html.nb-ivory-theme #settingsSection [style*="background: linear-gradient"] {
  /* keep inline gradients */
}

html.nb-ivory-theme #settingsSection [style*="color:#b45309"],
html.nb-ivory-theme #settingsSection h3[style*="color:#b45309"],
html.nb-ivory-theme #settingsSection h3[style*="color:var(--chit-color)"] {
  color: #b45309 !important;
}

html.nb-ivory-theme #settingsSection [style*="color:#166534"],
html.nb-ivory-theme #settingsSection [style*="color: #166534"] {
  color: #166534 !important;
}

html.nb-ivory-theme #settingsSection [style*="color:#1d4ed8"],
html.nb-ivory-theme #settingsSection [style*="color: #1d4ed8"] {
  color: #1d4ed8 !important;
}

html.nb-ivory-theme #settingsSection [style*="color:#9a3412"] {
  color: #9a3412 !important;
}

html.nb-ivory-theme #settingsSection [style*="color:var(--es-primary)"],
html.nb-ivory-theme #settingsSection h3[style*="color:var(--es-primary)"] {
  color: #059669 !important;
}

html.nb-ivory-theme #settingsSection [style*="color:var(--text-muted)"] {
  color: #64748b !important;
}

html.nb-ivory-theme #settingsSection [style*="color:var(--text-main)"] {
  color: #18181b !important;
}

html.nb-ivory-theme #settingsSection .tag-list .tag,
html.nb-ivory-theme #settingsSection .service-grid > * {
  color: #334155 !important;
}

/* Tesla typography dark report overrides → light */
html.nb-ivory-theme body.nanban-pro-app #reportSection .metric-card,
html.nb-ivory-theme body.nanban-pro-app #reportSection .nb-report-cash-card {
  background: #ffffff !important;
  color: #18181b !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: none !important;
}

html.nb-ivory-theme body.nanban-pro-app #reportSection .metric-card h3 {
  color: #64748b !important;
  text-shadow: none !important;
}

html.nb-ivory-theme body.nanban-pro-app #reportSection #repCloseRanjith,
html.nb-ivory-theme body.nanban-pro-app #reportSection #repCloseNandha,
html.nb-ivory-theme body.nanban-pro-app #reportSection #repCloseOffice {
  color: #18181b !important;
}
