/* Enforces one accessible light-mode text hierarchy after feature-owned stylesheets. */

body:not(.theme-dark) .app-content {
    color: var(--hub-text-primary, #0f172a);
}

body:not(.theme-dark) .app-content :is(
    .module-page,
    .integration-page,
    .dashboard-readable,
    .ai-readable,
    .admin-page) {
    --hub-page-text: var(--hub-text-primary, #0f172a);
    --hub-page-heading: var(--hub-text-primary, #0f172a);
    --hub-page-muted: var(--hub-text-secondary, #334155);
    --hub-page-subtle: var(--hub-text-tertiary, #475569);
}

body:not(.theme-dark) .app-content :is(
    .module-page,
    .integration-page,
    .dashboard-readable,
    .ai-readable,
    .admin-page) :is(
    .module-page-title,
    .dashboard-card-title,
    .panel-title,
    .card-title,
    .metric-value,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6) {
    color: var(--hub-text-primary, #0f172a);
}

body:not(.theme-dark) .app-content .text-muted {
    color: var(--hub-text-secondary, #334155) !important;
}

body:not(.theme-dark) .app-content :is(
    .module-page,
    .integration-page,
    .dashboard-readable,
    .ai-readable,
    .admin-page) .text-muted {
    color: var(--hub-text-secondary, #334155) !important;
}

body:not(.theme-dark) .app-content :is(
    .module-page,
    .integration-page,
    .dashboard-readable,
    .ai-readable,
    .admin-page) :is(
    .module-page-subtitle,
    .dashboard-card-subtitle,
    .card-subtitle,
    .modal-subtitle,
    .approval-meta-note,
    .approval-row-subtitle,
    .article-description,
    .order-line-description,
    .module-result-copy,
    [class*="subtitle"],
    [class*="description"]) {
    color: var(--hub-text-secondary, #334155);
}

body:not(.theme-dark) .app-content :is(
    .module-page,
    .integration-page,
    .dashboard-readable,
    .ai-readable,
    .admin-page) :is(
    .module-page-meta,
    .dashboard-card-meta,
    .form-text,
    .approval-meta-label,
    .module-kpi-label,
    .text-secondary,
    [class*="-meta"],
    [class*="__meta"]) {
    color: var(--hub-text-tertiary, #475569);
}

body:not(.theme-dark) .app-content :is(
    .module-page,
    .integration-page,
    .dashboard-readable,
    .ai-readable,
    .admin-page) :is(
    small.text-muted,
    .small.text-muted,
    label.text-muted,
    .table thead th) {
    color: var(--hub-text-tertiary, #475569) !important;
}

body:not(.theme-dark) .app-content :where(
    .form-control,
    .form-select,
    input,
    textarea)::placeholder {
    color: var(--hub-text-placeholder, #64748b);
    opacity: 1;
}

body:not(.theme-dark) .app-content :where(
    .disabled,
    :disabled,
    [aria-disabled="true"]) {
    --hub-page-muted: #64748b;
    --hub-page-subtle: #64748b;
}

body:not(.theme-dark) .app-content :is(
    .disabled,
    :disabled,
    [aria-disabled="true"]) :where(.text-muted, [class*="-meta"], [class*="__meta"]),
body:not(.theme-dark) .app-content :is(
    .disabled.text-muted,
    :disabled.text-muted,
    [aria-disabled="true"].text-muted) {
    color: #64748b !important;
}

/* Keep light tabs readable even when Bootstrap's active nav color is white. */
body:not(.theme-dark) .app-content .admin-page .admin-tab-toggle .nav-link,
body:not(.theme-dark) .app-content .admin-page .admin-tab-toggle .nav-link.active {
    color: #263b53;
    -webkit-text-fill-color: #263b53;
}

body:not(.theme-dark) .app-content .admin-page .admin-tab-toggle .nav-link:hover,
body:not(.theme-dark) .app-content .admin-page .admin-tab-toggle .nav-link:focus-visible {
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
}
