/* Light / dark mode overlay for the platform shell. */
:root {
    color-scheme: light;
    --theme-surface: #ffffff;
    --theme-surface-soft: #f8fafc;
    --theme-surface-muted: #eef6f8;
    --theme-text: #164e63;
    --theme-text-secondary: #64748b;
    --theme-text-muted: #94a3b8;
    --theme-border: #dbeafe;
    --theme-input-bg: #ffffff;
    --theme-input-border: #cbd5e1;
    --theme-shadow: 0 10px 32px rgba(8, 145, 178, 0.08);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary-color: #22d3ee;
    --primary-light: #67e8f9;
    --primary-dark: #0891b2;
    --cta-color: #34d399;
    --bg-light: #0f172a;
    --bg-white: #111827;
    --bg-body: #020617;
    --text-dark: #e5f7fb;
    --text-light: #a7bac7;
    --text-muted: #7f95a3;
    --border-color: rgba(103, 232, 249, 0.24);
    --border-light: rgba(103, 232, 249, 0.14);
    --theme-surface: #111827;
    --theme-surface-soft: #0f172a;
    --theme-surface-muted: #172033;
    --theme-text: #e5f7fb;
    --theme-text-secondary: #a7bac7;
    --theme-text-muted: #7f95a3;
    --theme-border: rgba(148, 163, 184, 0.26);
    --theme-input-bg: #0f172a;
    --theme-input-border: rgba(148, 163, 184, 0.34);
    --theme-shadow: 0 16px 46px rgba(0, 0, 0, 0.36);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.32);
    --shadow-hover: 0 18px 48px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] body {
    background: #020617 !important;
    background-image:
        radial-gradient(ellipse at 15% 10%, rgba(34, 211, 238, 0.11) 0%, transparent 42%),
        radial-gradient(ellipse at 85% 18%, rgba(52, 211, 153, 0.08) 0%, transparent 44%),
        linear-gradient(180deg, #020617 0%, #08111f 100%) !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .main-container,
html[data-theme="dark"] .page.active {
    background: transparent !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #020617 0%, #0f172a 100%) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .sidebar-logo {
    background: linear-gradient(180deg, #07111f 0%, #0b1220 100%) !important;
    border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .sidebar-logo-mark,
html[data-theme="dark"] .sidebar-user-row .user-avatar,
html[data-theme="dark"] .navbar-user .user-avatar,
html[data-theme="dark"] #topbarUserIcon {
    background-color: #0f172a !important;
    border-color: rgba(103, 232, 249, 0.28) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .sidebar-logo .sidebar-title,
html[data-theme="dark"] .sidebar-title {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .sidebar-section-label {
    color: #6f8396 !important;
}

html[data-theme="dark"] .sidebar-nav-item {
    color: #75889a !important;
}

html[data-theme="dark"] .sidebar-nav-item:hover,
html[data-theme="dark"] .sidebar-expandable.open > .sidebar-nav-item.has-sub {
    background: rgba(34, 211, 238, 0.08) !important;
    color: #c8eef5 !important;
}

html[data-theme="dark"] .sidebar-nav-item.active {
    background: rgba(34, 211, 238, 0.14) !important;
    color: #67e8f9 !important;
    box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.16) !important;
}

html[data-theme="dark"] .sidebar-nav-item.active::before {
    background: #22d3ee !important;
}

html[data-theme="dark"] .sidebar-sub-item {
    color: #6f8396 !important;
}

html[data-theme="dark"] .sidebar-sub-item:hover,
html[data-theme="dark"] .sidebar-sub-item.active {
    background: rgba(34, 211, 238, 0.08) !important;
    color: #bcecf4 !important;
}

html[data-theme="dark"] .topbar-breadcrumb a,
html[data-theme="dark"] .topbar-breadcrumb-link,
html[data-theme="dark"] .topbar-left {
    color: #b6cbd6 !important;
}

html[data-theme="dark"] .topbar-breadcrumb .bc-current,
html[data-theme="dark"] .topbar-breadcrumb a:hover,
html[data-theme="dark"] .topbar-breadcrumb-link:hover {
    color: #67e8f9 !important;
}

.theme-mode-toggle {
    min-width: 44px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #0f766e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-mode-toggle:hover,
.theme-mode-toggle:focus-visible {
    border-color: rgba(8, 145, 178, 0.48);
    color: #0891b2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.14);
}

html[data-theme="dark"] .theme-mode-toggle {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(103, 232, 249, 0.28);
    color: #e5f7fb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .theme-mode-toggle:hover,
html[data-theme="dark"] .theme-mode-toggle:focus-visible {
    border-color: rgba(103, 232, 249, 0.52);
    color: #67e8f9;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

html[data-theme="dark"] .login-overlay {
    background: linear-gradient(135deg, #020617, #0f172a 48%, #164e63) !important;
}

html[data-theme="dark"] .login-shell {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.44) !important;
}

html[data-theme="dark"] .login-form-panel {
    background: linear-gradient(180deg, #07111f, var(--theme-surface-soft)) !important;
}

html[data-theme="dark"] .login-field {
    background: var(--theme-input-bg) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] .login-language {
    background: rgba(15, 23, 42, 0.82) !important;
    color: var(--theme-text-secondary) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] .login-card .login-remember,
html[data-theme="dark"] .login-card .login-remember label {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .ops-home-group-head > span {
    background-color: rgba(15, 23, 42, 0.82) !important;
    color: #bcecf4 !important;
    border-color: rgba(103, 232, 249, 0.28) !important;
}

html[data-theme="dark"] .cr-cat-count {
    background-color: rgba(15, 23, 42, 0.82) !important;
    color: #bcecf4 !important;
    border-color: rgba(103, 232, 249, 0.28) !important;
}

html[data-theme="dark"] .ops-hr-modal-card {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44) !important;
}

html[data-theme="dark"] .ops-hr-modal-card h3,
html[data-theme="dark"] .ops-hr-modal-card label {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .ops-hr-modal-note {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .login-card,
html[data-theme="dark"] .navbar-user .user-dropdown,
html[data-theme="dark"] .sidebar-user-row .user-dropdown,
html[data-theme="dark"] .topbar-user-mobile-menu,
html[data-theme="dark"] .cr-home-hero-stat,
html[data-theme="dark"] .cr-home-card,
html[data-theme="dark"] .cr-home-panel,
html[data-theme="dark"] .cr-home-section,
html[data-theme="dark"] .ops-home-hero-stat,
html[data-theme="dark"] .ops-home-config,
html[data-theme="dark"] .ops-home-group,
html[data-theme="dark"] .ops-home-card,
html[data-theme="dark"] .ops-home-entry-card,
html[data-theme="dark"] .pm-project-list-pager,
html[data-theme="dark"] .pm-list-search,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .project-list-card,
html[data-theme="dark"] .project-summary-card,
html[data-theme="dark"] .kh-home-section,
html[data-theme="dark"] .kh-home-dept-card,
html[data-theme="dark"] .kh-browse-search,
html[data-theme="dark"] .kh-type-card,
html[data-theme="dark"] .module-card,
html[data-theme="dark"] .module-stat,
html[data-theme="dark"] .module-hero-stat,
html[data-theme="dark"] .module-section,
html[data-theme="dark"] .module-sub-section,
html[data-theme="dark"] .module-overview-card,
html[data-theme="dark"] .clinical-module-card,
html[data-theme="dark"] .clinical-card,
html[data-theme="dark"] .ops-home-entry,
html[data-theme="dark"] .ops-module-card,
html[data-theme="dark"] .ops-module-group,
html[data-theme="dark"] .ops-feature-card,
html[data-theme="dark"] .pm-project-card,
html[data-theme="dark"] .pm-overview-card,
html[data-theme="dark"] .pm-module-card,
html[data-theme="dark"] .kh-card,
html[data-theme="dark"] .kh-category-card,
html[data-theme="dark"] .kh-project-card,
html[data-theme="dark"] .kh-doc-card,
html[data-theme="dark"] .quick-card,
html[data-theme="dark"] .column-card,
html[data-theme="dark"] .monitor-card,
html[data-theme="dark"] .operation-card,
html[data-theme="dark"] .ai-info-card,
html[data-theme="dark"] .input-card,
html[data-theme="dark"] .output-card,
html[data-theme="dark"] .center-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .admin-section,
html[data-theme="dark"] .user-modal-content,
html[data-theme="dark"] .modal-content {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
    box-shadow: var(--theme-shadow) !important;
}

html[data-theme="dark"] .quick-card p,
html[data-theme="dark"] .operation-card p,
html[data-theme="dark"] .ai-info-card p,
html[data-theme="dark"] .input-card-header p,
html[data-theme="dark"] .login-card .login-subtitle,
html[data-theme="dark"] .login-card .login-footer,
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .stat-card .stat-label,
html[data-theme="dark"] .module-card p,
html[data-theme="dark"] .cr-home-hero p,
html[data-theme="dark"] .cr-home-card p,
html[data-theme="dark"] .cr-home-card-desc,
html[data-theme="dark"] .cr-home-hero-stat,
html[data-theme="dark"] .ops-home-shell p,
html[data-theme="dark"] .ops-home-card p,
html[data-theme="dark"] .ops-home-group p,
html[data-theme="dark"] .kh-page p,
html[data-theme="dark"] .kh-home-section p,
html[data-theme="dark"] .kh-home-dept-card p,
html[data-theme="dark"] .module-card .card-desc,
html[data-theme="dark"] .clinical-module-card-desc,
html[data-theme="dark"] .ops-module-card p,
html[data-theme="dark"] .ops-feature-card p,
html[data-theme="dark"] .pm-project-card p,
html[data-theme="dark"] .pm-overview-card p,
html[data-theme="dark"] .kh-card p,
html[data-theme="dark"] .kh-category-card p,
html[data-theme="dark"] .kh-project-card p,
html[data-theme="dark"] .kh-doc-card p {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .module-card h3,
html[data-theme="dark"] .module-card h4,
html[data-theme="dark"] .cr-home-hero h1,
html[data-theme="dark"] .cr-home-card h3,
html[data-theme="dark"] .cr-home-card-title,
html[data-theme="dark"] .ops-home-head h1,
html[data-theme="dark"] .ops-home-config h2,
html[data-theme="dark"] .ops-home-group h2,
html[data-theme="dark"] .ops-home-card h3,
html[data-theme="dark"] .kh-page h1,
html[data-theme="dark"] .kh-page h2,
html[data-theme="dark"] .kh-page h3,
html[data-theme="dark"] .kh-home-dept-card h3,
html[data-theme="dark"] .module-card .card-title,
html[data-theme="dark"] .clinical-module-card-name,
html[data-theme="dark"] .ops-module-card h3,
html[data-theme="dark"] .ops-feature-card h3,
html[data-theme="dark"] .pm-project-card h3,
html[data-theme="dark"] .pm-overview-card h3,
html[data-theme="dark"] .kh-card h3,
html[data-theme="dark"] .kh-category-card h3,
html[data-theme="dark"] .kh-project-card h3,
html[data-theme="dark"] .kh-doc-card h3 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .topbar-search input,
html[data-theme="dark"] .login-card input,
html[data-theme="dark"] .login-card select {
    background: var(--theme-input-bg) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] table,
html[data-theme="dark"] .token-table-wrap,
html[data-theme="dark"] .risk-table,
html[data-theme="dark"] .icf-table {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] th,
html[data-theme="dark"] .risk-table th,
html[data-theme="dark"] .icf-table th {
    background: var(--theme-surface-muted) !important;
    color: var(--theme-text-secondary) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] td,
html[data-theme="dark"] .risk-table td,
html[data-theme="dark"] .icf-table td {
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] tr:hover td {
    background: rgba(34, 211, 238, 0.06) !important;
}

html[data-theme="dark"] .sidebar-context-card {
    background: rgba(15, 23, 42, 0.72) !important;
    border-color: rgba(103, 232, 249, 0.16) !important;
}

html[data-theme="dark"] .sidebar-footer {
    background: rgba(2, 6, 23, 0.86) !important;
    border-top-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .home-hero {
    background: linear-gradient(135deg, #07111f 0%, #0f2433 54%, #0f3d43 100%) !important;
    color: var(--theme-text) !important;
    border-bottom-color: rgba(103, 232, 249, 0.18) !important;
}

html[data-theme="dark"] .module-hero,
html[data-theme="dark"] .cr-home-hero,
html[data-theme="dark"] .ops-home-head,
html[data-theme="dark"] #page-clinical .module-hero,
html[data-theme="dark"] #page-operations .module-hero,
html[data-theme="dark"] #page-project-management .module-hero,
html[data-theme="dark"] #page-knowledge-hub .module-hero {
    background: linear-gradient(135deg, #07111f 0%, #0f2433 52%, #0b3538 100%) !important;
    color: var(--theme-text) !important;
    border-bottom: 1px solid rgba(103, 232, 249, 0.18) !important;
}

html[data-theme="dark"] .ops-home-shell,
html[data-theme="dark"] .kh-page,
html[data-theme="dark"] .kh-home-flat {
    background: #020b14 !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .module-hero h1,
html[data-theme="dark"] .module-hero .hero-text h1,
html[data-theme="dark"] .module-hero .hero-title,
html[data-theme="dark"] .module-hero .hero-en {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .module-hero h1 span,
html[data-theme="dark"] .module-hero .hero-accent,
html[data-theme="dark"] .module-hero .hero-text h1 span {
    color: #67e8f9 !important;
}

html[data-theme="dark"] .module-hero .hero-desc,
html[data-theme="dark"] .module-hero p,
html[data-theme="dark"] .module-hero-stat label,
html[data-theme="dark"] .module-hero-stat span {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .module-overview,
html[data-theme="dark"] .cr-home-wrap,
html[data-theme="dark"] .cr-home-content,
html[data-theme="dark"] .ops-home-body,
html[data-theme="dark"] .ops-home-main,
html[data-theme="dark"] .clinical-module-grid,
html[data-theme="dark"] .ops-module-overview,
html[data-theme="dark"] .pm-overview,
html[data-theme="dark"] .kh-home,
html[data-theme="dark"] .kh-main,
html[data-theme="dark"] .kh-content {
    background: #020b14 !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .module-sub-header,
html[data-theme="dark"] .ops-module-group-head,
html[data-theme="dark"] .pm-section-head,
html[data-theme="dark"] .kh-section-head {
    color: var(--theme-text) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

html[data-theme="dark"] .module-sub-header h3,
html[data-theme="dark"] .ops-module-group-head h4,
html[data-theme="dark"] .pm-section-head h3,
html[data-theme="dark"] .kh-section-head h3 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .module-sub-header .sub-count,
html[data-theme="dark"] .ops-module-group-head p,
html[data-theme="dark"] .ops-module-group-head span,
html[data-theme="dark"] .pm-section-head p,
html[data-theme="dark"] .kh-section-head p {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .search-box,
html[data-theme="dark"] #crHomeSearchInput,
html[data-theme="dark"] .module-search,
html[data-theme="dark"] .clinical-search,
html[data-theme="dark"] .ops-search,
html[data-theme="dark"] .pm-search,
html[data-theme="dark"] .kh-search,
html[data-theme="dark"] .kh-global-search {
    background: rgba(15, 23, 42, 0.94) !important;
    color: var(--theme-text) !important;
    border-color: rgba(148, 163, 184, 0.34) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .module-search input,
html[data-theme="dark"] .clinical-search input,
html[data-theme="dark"] .ops-search input,
html[data-theme="dark"] .pm-search input,
html[data-theme="dark"] .kh-search input,
html[data-theme="dark"] .kh-global-search input {
    background: transparent !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .home-hero-title,
html[data-theme="dark"] .home-hero h1,
html[data-theme="dark"] .home-flow-header h3,
html[data-theme="dark"] .home-kpi-section-header h3,
html[data-theme="dark"] .home-flow-name,
html[data-theme="dark"] .home-kpi-value,
html[data-theme="dark"] .home-hero-stat strong,
html[data-theme="dark"] .home-bottom-card h3,
html[data-theme="dark"] .home-quick-label {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .home-hero-title span,
html[data-theme="dark"] .home-flow-header h3 i,
html[data-theme="dark"] .home-kpi-section-header h3 i {
    color: #67e8f9 !important;
}

html[data-theme="dark"] .home-hero-subtitle,
html[data-theme="dark"] .home-flow-header .home-flow-sub,
html[data-theme="dark"] .home-flow-desc,
html[data-theme="dark"] .home-flow-stats,
html[data-theme="dark"] .home-kpi-label,
html[data-theme="dark"] .home-kpi-detail,
html[data-theme="dark"] .home-hero-stat label,
html[data-theme="dark"] .home-hero-stat span,
html[data-theme="dark"] .home-bottom-card p,
html[data-theme="dark"] .home-activity-meta {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] .home-hero-search,
html[data-theme="dark"] .home-hero-side,
html[data-theme="dark"] .home-flow-card,
html[data-theme="dark"] .home-kpi-card,
html[data-theme="dark"] .home-bottom-card,
html[data-theme="dark"] .home-bottom-panel,
html[data-theme="dark"] .home-activity-item,
html[data-theme="dark"] .home-ai-item,
html[data-theme="dark"] .home-quick-item {
    background: rgba(17, 24, 39, 0.92) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
    box-shadow: var(--theme-shadow) !important;
}

html[data-theme="dark"] .home-flow-card.rbac-entry-locked,
html[data-theme="dark"] .ops-home-entry.rbac-entry-locked {
    background: rgba(15, 23, 42, 0.72) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .ai-assist-btn {
    background: rgba(15, 23, 42, 0.96) !important;
    color: #67e8f9 !important;
    border-color: rgba(103, 232, 249, 0.34) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38) !important;
}

html[data-theme="dark"] .ai-assist-btn::after {
    border-color: #0f172a !important;
}

html[data-theme="dark"] .ai-assist-btn:hover {
    background: #111827 !important;
    border-color: rgba(103, 232, 249, 0.56) !important;
}

html[data-theme="dark"] .ai-assist-panel,
html[data-theme="dark"] .ai-assist-model-bar,
html[data-theme="dark"] .ai-assist-messages,
html[data-theme="dark"] .ai-assist-input-bar,
html[data-theme="dark"] .ai-assist-empty,
html[data-theme="dark"] .ai-assist-msg.assistant,
html[data-theme="dark"] .ai-assist-typing {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .ai-assist-input,
html[data-theme="dark"] .ai-assist-model-sel {
    background: var(--theme-input-bg) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] body #page-clinical,
html[data-theme="dark"] body #page-clinical .cr-home-category {
    background: #020b14 !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-hero {
    background: linear-gradient(135deg, #07111f 0%, #0f2433 52%, #0b3538 100%) !important;
    border-bottom-color: rgba(103, 232, 249, 0.18) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-hero-text h1,
html[data-theme="dark"] body #page-clinical .cr-home-card-name,
html[data-theme="dark"] body #page-clinical .cr-cat-name,
html[data-theme="dark"] body #page-clinical .cr-home-bottom-title {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-hero-text h1 span {
    color: #67e8f9 !important;
    -webkit-text-fill-color: #67e8f9 !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-hero-text p,
html[data-theme="dark"] body #page-clinical .cr-home-card-desc,
html[data-theme="dark"] body #page-clinical .cr-cat-desc,
html[data-theme="dark"] body #page-clinical .cr-cat-count,
html[data-theme="dark"] body #page-clinical .cr-home-module-count,
html[data-theme="dark"] body #page-clinical .cr-home-hero-stat label,
html[data-theme="dark"] body #page-clinical .cr-home-hero-stat span {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-hero-stat,
html[data-theme="dark"] body #page-clinical .cr-home-card,
html[data-theme="dark"] body #page-clinical .cr-home-bottom-section {
    background: rgba(17, 24, 39, 0.92) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
    box-shadow: var(--theme-shadow) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-hero-stat strong {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-search input,
html[data-theme="dark"] body #page-clinical #crHomeSearchInput {
    background: rgba(15, 23, 42, 0.94) !important;
    color: var(--theme-text) !important;
    border-color: rgba(148, 163, 184, 0.34) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] body #page-clinical .cr-home-category-header {
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

html[data-theme="dark"] .home-flow-section,
html[data-theme="dark"] .home-kpi-section,
html[data-theme="dark"] .home-bottom-section,
html[data-theme="dark"] .home-bottom-grid {
    background: rgba(2, 6, 23, 0.74) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .cr-home-hero .btn,
html[data-theme="dark"] .cr-home-hero button,
html[data-theme="dark"] .ops-home-head .btn,
html[data-theme="dark"] .ops-home-head button {
    border-color: rgba(103, 232, 249, 0.34) !important;
}

html[data-theme="dark"] .badge,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .pill,
html[data-theme="dark"] [class*="badge"],
html[data-theme="dark"] [class*="tag"],
html[data-theme="dark"] [class*="pill"] {
    border-color: rgba(103, 232, 249, 0.24);
}

html[data-theme="dark"] .home-flow-seq {
    color: rgba(229, 247, 251, 0.13) !important;
}

html[data-theme="dark"] .home-kpi-bar {
    background: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] .home-kpi-month-select {
    background: #0f172a !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] .home-hero-side .home-hero-stat,
html[data-theme="dark"] .module-hero-stat {
    background: rgba(15, 23, 42, 0.72) !important;
    border-color: rgba(103, 232, 249, 0.18) !important;
}

@media (max-width: 640px) {
    .theme-mode-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0;
    }
    .theme-mode-toggle span {
        display: none;
    }
}

/* Platform-wide dark-mode hardening for late-loaded module styles. */
html[data-theme="dark"] body .main-container,
html[data-theme="dark"] body .main-container .page,
html[data-theme="dark"] body .main-container .page.active,
html[data-theme="dark"] body .main-container [id^="page-"],
html[data-theme="dark"] body .main-container [id$="-content"],
html[data-theme="dark"] body .main-container [id*="Content"],
html[data-theme="dark"] body .main-container [class*="shell"],
html[data-theme="dark"] body .main-container [class*="wrap"],
html[data-theme="dark"] body .main-container [class*="workspace"],
html[data-theme="dark"] body .main-container [class*="overview"],
html[data-theme="dark"] body .main-container [class*="main"] {
    background-color: #020b14 !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body .main-container [class*="hero"],
html[data-theme="dark"] body .main-container [class*="head"],
html[data-theme="dark"] body .main-container [class*="banner"] {
    background-color: #07111f !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] body .main-container [class*="card"]:not([class*="icon"]):not([class*="badge"]):not([class*="tag"]),
html[data-theme="dark"] body .main-container [class*="panel"]:not([class*="icon"]),
html[data-theme="dark"] body .main-container [class*="section"]:not([class*="icon"]),
html[data-theme="dark"] body .main-container [class*="group"]:not([class*="icon"]),
html[data-theme="dark"] body .main-container [class*="box"]:not([class*="icon"]),
html[data-theme="dark"] body .main-container [class*="item"]:not([class*="icon"]):not([class*="badge"]):not([class*="tag"]),
html[data-theme="dark"] body .main-container [class*="list"]:not([class*="icon"]),
html[data-theme="dark"] body .main-container [class*="table"]:not([class*="icon"]),
html[data-theme="dark"] body .main-container [class*="toolbar"],
html[data-theme="dark"] body .main-container [class*="filter"],
html[data-theme="dark"] body .main-container [class*="detail"],
html[data-theme="dark"] body .main-container [class*="modal"]:not([class*="overlay"]),
html[data-theme="dark"] body .main-container [class*="dialog"],
html[data-theme="dark"] body .main-container [class*="drawer"],
html[data-theme="dark"] body .main-container [class*="empty"],
html[data-theme="dark"] body .main-container article,
html[data-theme="dark"] body .main-container section {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] body .main-container #page-clinical .cr-home-cards,
html[data-theme="dark"] body .main-container .ops-hr-cell-title,
html[data-theme="dark"] body .main-container .ops-hr-cell-sub,
html[data-theme="dark"] body .main-container .ops-hr-code,
html[data-theme="dark"] body .main-container .ops-hr-actions {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .ops-hr-code {
    color: #67e8f9 !important;
}

html[data-theme="dark"] .ops-hr-object-bulkbar {
    background: var(--theme-surface-soft) !important;
    color: var(--theme-text-secondary) !important;
    border-color: var(--theme-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container [class*="row"]:not([class*="icon"]):not([class*="toolbar"]):not([class*="breadcrumb"]),
html[data-theme="dark"] body .main-container [class*="body"],
html[data-theme="dark"] body .main-container [class*="content"],
html[data-theme="dark"] body .main-container [class*="grid"] {
    background-color: transparent !important;
    color: var(--theme-text) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] body .main-container h1,
html[data-theme="dark"] body .main-container h2,
html[data-theme="dark"] body .main-container h3,
html[data-theme="dark"] body .main-container h4,
html[data-theme="dark"] body .main-container h5,
html[data-theme="dark"] body .main-container h6,
html[data-theme="dark"] body .main-container strong,
html[data-theme="dark"] body .main-container [class*="title"],
html[data-theme="dark"] body .main-container [class*="name"],
html[data-theme="dark"] body .main-container [class*="value"] {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body .main-container p,
html[data-theme="dark"] body .main-container label,
html[data-theme="dark"] body .main-container small,
html[data-theme="dark"] body .main-container span,
html[data-theme="dark"] body .main-container [class*="desc"],
html[data-theme="dark"] body .main-container [class*="sub"],
html[data-theme="dark"] body .main-container [class*="meta"],
html[data-theme="dark"] body .main-container [class*="note"],
html[data-theme="dark"] body .main-container [class*="hint"],
html[data-theme="dark"] body .main-container [class*="text"] {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] body .main-container a,
html[data-theme="dark"] body .main-container [class*="link"] {
    color: #67e8f9 !important;
}

html[data-theme="dark"] body .main-container input,
html[data-theme="dark"] body .main-container select,
html[data-theme="dark"] body .main-container textarea,
html[data-theme="dark"] body .main-container [contenteditable="true"] {
    background-color: var(--theme-input-bg) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] body .main-container button:not(.theme-mode-toggle):not([class*="primary"]):not([class*="danger"]):not([class*="success"]),
html[data-theme="dark"] body .main-container [class*="btn"]:not([class*="primary"]):not([class*="danger"]):not([class*="success"]) {
    background-color: #0f172a !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-input-border) !important;
}

html[data-theme="dark"] body .main-container [class*="badge"],
html[data-theme="dark"] body .main-container [class*="tag"],
html[data-theme="dark"] body .main-container [class*="pill"],
html[data-theme="dark"] body .main-container [class*="chip"] {
    background-color: rgba(15, 23, 42, 0.82) !important;
    color: #bcecf4 !important;
    border-color: rgba(103, 232, 249, 0.28) !important;
}

html[data-theme="dark"] body .main-container table,
html[data-theme="dark"] body .main-container thead,
html[data-theme="dark"] body .main-container tbody,
html[data-theme="dark"] body .main-container tr,
html[data-theme="dark"] body .main-container td,
html[data-theme="dark"] body .main-container th {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text-secondary) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html[data-theme="dark"] body .main-container th {
    background-color: var(--theme-surface-muted) !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body .main-container ::-webkit-scrollbar-track {
    background: #020b14 !important;
}

html[data-theme="dark"] body .main-container ::-webkit-scrollbar-thumb {
    background: rgba(103, 232, 249, 0.26) !important;
}

/* V10.5.614: dark + minimal entry pages need a dedicated hierarchy. */
html[data-theme="dark"][data-entry-mode="minimal"] {
    --entry-dark-page: #020b14;
    --entry-dark-section: #071320;
    --entry-dark-card: #0f1b2b;
    --entry-dark-card-hover: #132236;
    --entry-dark-border: rgba(125, 211, 252, .22);
    --entry-dark-border-strong: rgba(103, 232, 249, .34);
    --entry-dark-text: #e7f7fb;
    --entry-dark-muted: #9db4c5;
    --entry-dark-shadow: 0 10px 24px rgba(0, 0, 0, .28);
    --entry-dark-icon-shadow: inset -5px -5px 0 rgba(2, 6, 23, .18), 0 8px 16px rgba(8, 145, 178, .18);
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-home,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-section,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-shell,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-body {
    background: var(--entry-dark-page) !important;
    background-image: none !important;
    color: var(--entry-dark-text) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-section,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-home .home-flow-section,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-home-category,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-config,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-home-section {
    background: var(--entry-dark-section) !important;
    background-color: var(--entry-dark-section) !important;
    border-color: rgba(125, 211, 252, .16) !important;
    box-shadow: none !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-header h3,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-cat-name,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-config-head h3,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group-head h3,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-home-section-head strong {
    color: var(--entry-dark-text) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-card,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-home .home-flow-card,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-home .home-flow-card[class*="fc-"],
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-home-card,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-config .ops-home-entry,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-config .ops-home-entry:first-child,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card {
    background: var(--entry-dark-card) !important;
    background-color: var(--entry-dark-card) !important;
    border: 1px solid var(--entry-dark-border) !important;
    box-shadow: var(--entry-dark-shadow) !important;
    color: var(--entry-dark-text) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-card:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-home .home-flow-card:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-home .home-flow-card[class*="fc-"]:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-home-card:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card:hover,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card:hover {
    background: var(--entry-dark-card-hover) !important;
    background-color: var(--entry-dark-card-hover) !important;
    border-color: var(--entry-dark-border-strong) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .34) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-name,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-home-card-name,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry-title h4,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry::after,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card::after,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card::after {
    color: var(--entry-dark-text) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-sub,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-cat-desc,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group-head p,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-home-section-head em {
    color: var(--entry-dark-muted) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container .home-flow-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-clinical .cr-home-card-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry-mark,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-mark,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-mark {
    color: var(--entry-icon-blue) !important;
    box-shadow: var(--entry-dark-icon-shadow) !important;
}

/* V10.5.665: operations dark icons use restrained enterprise badges. */
html[data-theme="dark"] body .main-container #page-operations {
    --ops-dark-icon-bg: rgba(103, 232, 249, .12);
    --ops-dark-icon-border: rgba(125, 211, 252, .26);
    --ops-dark-icon-color: #67e8f9;
    --ops-dark-icon-shadow: none;
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-config .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-config .ops-home-entry-icon {
    width: 34px !important;
    height: 34px !important;
    margin: 0 !important;
    border-radius: 9px !important;
    border: 1px solid var(--ops-dark-icon-border) !important;
    background: var(--ops-dark-icon-bg) !important;
    background-image: none !important;
    color: var(--ops-dark-icon-color) !important;
    box-shadow: var(--ops-dark-icon-shadow) !important;
    font-size: 14px !important;
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-icon i,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry-icon i {
    color: currentColor !important;
    opacity: .98 !important;
    text-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(2n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(1) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(37, 99, 235, .16);
    --ops-dark-icon-color: #93c5fd;
    --ops-dark-icon-border: rgba(147, 197, 253, .24);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(3n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(2) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(20, 184, 166, .14);
    --ops-dark-icon-color: #5eead4;
    --ops-dark-icon-border: rgba(94, 234, 212, .22);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(4n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(1) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(245, 158, 11, .14);
    --ops-dark-icon-color: #fbbf24;
    --ops-dark-icon-border: rgba(251, 191, 36, .24);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(5n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(2) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(124, 58, 237, .15);
    --ops-dark-icon-color: #c4b5fd;
    --ops-dark-icon-border: rgba(196, 181, 253, .24);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(6n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(3) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(244, 63, 94, .13);
    --ops-dark-icon-color: #fda4af;
    --ops-dark-icon-border: rgba(253, 164, 175, .22);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(7n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(3) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(34, 197, 94, .13);
    --ops-dark-icon-color: #86efac;
    --ops-dark-icon-border: rgba(134, 239, 172, .22);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:nth-child(8n) .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(4) .ops-home-entry-icon {
    --ops-dark-icon-bg: rgba(56, 189, 248, .13);
    --ops-dark-icon-color: #7dd3fc;
    --ops-dark-icon-border: rgba(125, 211, 252, .24);
}

html[data-theme="dark"] body .main-container #page-operations .ops-home-entry:hover .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:hover .ops-home-entry-icon {
    border-color: color-mix(in srgb, var(--ops-dark-icon-color) 44%, transparent) !important;
    background: rgba(12, 28, 45, .96) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 10px 22px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(2n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(3n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(4n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(5n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(6n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(7n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry:nth-child(8n) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(1) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(2) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(3) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(2n) .ops-home-entry:nth-child(4) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(1) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(2) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(3) .ops-home-entry-icon,
html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-group:nth-of-type(3n) .ops-home-entry:nth-child(4) .ops-home-entry-icon {
    background: var(--ops-dark-icon-bg) !important;
    background-image: none !important;
    color: var(--ops-dark-icon-color) !important;
    border-color: var(--ops-dark-icon-border) !important;
    box-shadow: var(--ops-dark-icon-shadow) !important;
}

html[data-theme="dark"][data-entry-mode="minimal"] body .main-container #page-operations .ops-home-entry-title {
    align-items: center !important;
}

/* V10.5.666: dark entry pages share the same clean multi-color icon language. */
html[data-theme="dark"] body .main-container .home-flow-icon,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-mark {
    border: 1px solid color-mix(in srgb, var(--entry-icon-blue) 24%, transparent) !important;
    background: var(--entry-grad-blue) !important;
    background-image: none !important;
    color: var(--entry-icon-blue) !important;
    box-shadow: var(--entry-icon-shadow) !important;
}

html[data-theme="dark"] body .main-container .home-flow-card.fc-operations .home-flow-icon,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card:nth-child(2n) .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry:nth-child(2n) .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card:nth-child(2n) .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card:nth-child(2n) .kh-home-project-mark {
    border-color: color-mix(in srgb, var(--entry-icon-teal) 24%, transparent) !important;
    background: var(--entry-grad-teal) !important;
    background-image: none !important;
    color: var(--entry-icon-teal) !important;
}

html[data-theme="dark"] body .main-container .home-flow-card.fc-project .home-flow-icon,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card:nth-child(3n) .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry:nth-child(3n) .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card:nth-child(3n) .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card:nth-child(3n) .kh-home-project-mark {
    border-color: color-mix(in srgb, var(--entry-icon-green) 24%, transparent) !important;
    background: var(--entry-grad-green) !important;
    background-image: none !important;
    color: var(--entry-icon-green) !important;
}

html[data-theme="dark"] body .main-container .home-flow-card.fc-knowledge .home-flow-icon,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card:nth-child(4n) .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry:nth-child(4n) .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card:nth-child(4n) .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card:nth-child(4n) .kh-home-project-mark {
    border-color: color-mix(in srgb, var(--entry-icon-amber) 24%, transparent) !important;
    background: var(--entry-grad-amber) !important;
    background-image: none !important;
    color: var(--entry-icon-amber) !important;
}

html[data-theme="dark"] body .main-container #page-clinical .cr-home-card:nth-child(5n) .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry:nth-child(5n) .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card:nth-child(5n) .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card:nth-child(5n) .kh-home-project-mark {
    border-color: color-mix(in srgb, var(--entry-icon-violet) 24%, transparent) !important;
    background: var(--entry-grad-violet) !important;
    background-image: none !important;
    color: var(--entry-icon-violet) !important;
}

html[data-theme="dark"] body .main-container #page-clinical .cr-home-card:nth-child(6n) .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry:nth-child(6n) .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card:nth-child(6n) .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card:nth-child(6n) .kh-home-project-mark {
    border-color: color-mix(in srgb, var(--entry-icon-rose) 24%, transparent) !important;
    background: var(--entry-grad-rose) !important;
    background-image: none !important;
    color: var(--entry-icon-rose) !important;
}

html[data-theme="dark"] body .main-container .home-flow-name,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-top,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-name,
html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-title,
html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-title > div,
html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-title h4,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry::after,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-card::after,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-card::after {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* V10.5.673: remove dark-mode inner text stripes while keeping card surfaces. */
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-main,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-header,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-title-group,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-name,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-code,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-desc,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-meta,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-meta span,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-meta b,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-footer,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-badges,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-metrics,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat span,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat strong,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat small,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-progress,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-progress-fill,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-enter,
html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-title,
html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-title *,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-top,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-name,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-desc,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-home-entry::after,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-home-dept-card::after,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-home-project-card::after {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-progress {
    background: rgba(148, 163, 184, .14) !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-progress-fill {
    background: linear-gradient(90deg, #22d3ee, #34d399) !important;
}

/* V10.5.674: readable dark-mode project list cards. */
html[data-theme="dark"] body .main-container #page-project-management .pm-project-list-pager {
    background: #111827 !important;
    border-color: rgba(125, 211, 252, .22) !important;
    color: #9db4c5 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-list-pager select,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-list-pager button {
    background: #071320 !important;
    border-color: rgba(125, 211, 252, .24) !important;
    color: #e7f7fb !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card {
    background: #111827 !important;
    border-color: rgba(125, 211, 252, .22) !important;
    color: #e7f7fb !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card:hover {
    border-color: color-mix(in srgb, var(--pm-project-accent, #22d3ee) 54%, rgba(125, 211, 252, .26)) !important;
    background: #132033 !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .30) !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-name,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat strong {
    color: #e7f7fb !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-code,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-enter {
    color: #67e8f9 !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-desc,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-meta,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-footer,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat span,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-stat small {
    color: #9db4c5 !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-meta b {
    color: #6f8799 !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-card-metrics {
    border-left-color: rgba(125, 211, 252, .18) !important;
}

html[data-theme="dark"] body .main-container #page-project-management .pm-project-phase,
html[data-theme="dark"] body .main-container #page-project-management .pm-project-risk {
    background: rgba(103, 232, 249, .08) !important;
    border-color: rgba(103, 232, 249, .24) !important;
    color: #bcecf4 !important;
}

/* V10.5.675: project cockpit uses one dark surface per hierarchy level. */
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-project-bar,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-kpi,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-zone {
    background: var(--theme-surface) !important;
    background-image: none !important;
    border-color: rgba(125, 211, 252, .20) !important;
    color: var(--theme-text) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18) !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-strip,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-main,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-title,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-kpi .kpi-main,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-cards {
    background: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-selector label,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-title strong,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-zone-name,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-card-text h5 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-label,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-flow,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-kpi .kpi-label,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-zone-title small,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-card-text small {
    color: var(--theme-text-secondary) !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-kpi .kpi-sub,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-meta b {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-selector select {
    background: var(--theme-input-bg) !important;
    border-color: var(--theme-input-border) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-title code,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-category-tag,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-context-meta > span {
    background: var(--theme-surface-soft) !important;
    background-image: none !important;
    border-color: rgba(103, 232, 249, .22) !important;
    color: #bcecf4 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-linkage-btn {
    background: rgba(34, 211, 238, .08) !important;
    border-color: rgba(103, 232, 249, .28) !important;
    color: #67e8f9 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-linkage-btn:hover {
    background: rgba(34, 211, 238, .14) !important;
    border-color: rgba(103, 232, 249, .46) !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-zone-title {
    background: var(--theme-surface-soft) !important;
    background-image: none !important;
    border-bottom-color: rgba(125, 211, 252, .16) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-card {
    background: var(--theme-surface-soft) !important;
    background-image: none !important;
    border-color: rgba(125, 211, 252, .16) !important;
    color: var(--theme-text) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-card:hover {
    background: var(--theme-surface-muted) !important;
    border-color: rgba(103, 232, 249, .34) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .20) !important;
}

html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-kpi .kpi-icon,
html[data-theme="dark"] body .main-container #page-project-management #pm-dash-view .pm-dash-card-icon {
    background: color-mix(in srgb, currentColor 14%, transparent) !important;
    background-image: none !important;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body .main-container .home-flow-icon,
html[data-theme="dark"] body .main-container #page-operations .ops-home-entry-icon,
html[data-theme="dark"] body .main-container #page-clinical .cr-home-card-icon,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-entry-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-dept-mark,
html[data-theme="dark"] body .main-container #page-knowledge-hub .kh-page.kh-home-flat .kh-home-project-mark {
    background: color-mix(in srgb, currentColor 16%, transparent) !important;
    background-image: none !important;
    border-color: color-mix(in srgb, currentColor 28%, transparent) !important;
    box-shadow: none !important;
}
