/*
 * Global high-contrast layer.
 * Loaded after every theme so text remains readable across all colour schemes.
 */
:root {
    --ui-ink: #111b2e;
    --ui-text: #344054;
    --ui-muted: #596579;
    --ui-border: #d8e0eb;
    --ui-border-strong: #c7d1df;
    --contrast-text: #26364d;
    --contrast-secondary: #526176;
    --contrast-muted: #647186;
    --contrast-placeholder: #69768a;
    --contrast-dark-text: #f8fbff;
    --contrast-dark-secondary: #d9e6f7;
    --contrast-dark-muted: #c3d4ea;
}

html, body { color: var(--contrast-text); }
body a { color: #075fce; }
body a:hover { color: #064aa3; }

/* Base typography on light surfaces. */
.layui-card,
.layui-layer-content,
.layui-table,
.layui-form,
.ui-page-card,
.entity-panel { color: var(--contrast-text); }
.layui-card-header,
.layui-form-label,
.layui-table-view .layui-table th,
.layui-table-header th,
.layui-tab-title li,
.layui-field-title legend { color: #435269 !important; }
.layui-table-view .layui-table td,
.layui-table td { color: #26364d; }
.layui-table-view .layui-table tbody tr:nth-child(even) { background: #f7f9fc; }
.layui-table-view .layui-table tbody tr:hover { background: #edf4ff !important; }

.help-block,
.help-label,
.text-muted,
.color-desc,
.layui-word-aux,
.ui-page-heading-copy small,
.project-tabs-heading span,
.project-order-table-title span,
.supplier-inline-head > div span { color: var(--contrast-muted) !important; }
.help-label b { color: #26364d !important; }

/* Form controls and placeholders. */
.layui-input,
.layui-select,
.layui-textarea,
.layui-form-select .layui-input,
select,
textarea,
input { color: #25344b; }
.layui-input::placeholder,
.layui-textarea::placeholder,
input::placeholder,
textarea::placeholder,
::-webkit-input-placeholder { color: var(--contrast-placeholder) !important; opacity: 1 !important; }
.layui-input[readonly],
.layui-textarea[readonly],
.layui-input[disabled],
.layui-textarea[disabled],
.layui-select[disabled],
.layui-disabled,
[disabled] { color: #536176 !important; -webkit-text-fill-color: #536176 !important; opacity: 1 !important; }
.layui-input[readonly],
.layui-textarea[readonly],
.layui-input[disabled],
.layui-textarea[disabled],
.layui-select[disabled] { border-color: #ccd6e3 !important; background: #eef2f7 !important; }
.layui-form-select dl dd { color: #34445b; }
.layui-form-select dl dd:hover { color: #183f7a; background: #edf4ff; }
.layui-form-checkbox span,
.layui-form-radio span { color: #3f4f65; }

/* Buttons and status colours that previously used low-contrast white text. */
.layui-btn { font-weight: 650; }
.layui-btn:not(.layui-btn-primary):not(.layui-btn-disabled),
.layui-btn-normal { color: #fff !important; }
.layui-btn-primary { color: #34445b !important; border-color: #bfcbd9 !important; background: #fff !important; }
.layui-btn-primary:hover { color: #174f9c !important; border-color: #7da6dc !important; background: #f4f8ff !important; }
.layui-btn-warm { color: #fff !important; border-color: #a94d08 !important; background: #b45309 !important; }
.layui-btn-danger { color: #fff !important; border-color: #ad1f1f !important; background: #c62828 !important; }
.layui-btn-disabled,
.layui-btn-disabled:hover,
.layui-btn[disabled] { color: #536176 !important; border-color: #cbd5e1 !important; background: #e7ecf2 !important; opacity: 1 !important; }
.layui-bg-orange { color: #fff !important; background-color: #b45309 !important; }
.layui-bg-green { color: #fff !important; background-color: #15803d !important; }
.layui-bg-red { color: #fff !important; background-color: #b91c1c !important; }
.layui-bg-gray { color: #3f4d61 !important; background-color: #dfe5ec !important; }
.layui-badge-rim { color: #435168 !important; border-color: #aebaca !important; background: #fff !important; }

/* Navigation and shell. */
.context-eyebrow { color: #66758a !important; }
.topbar-search,
.topbar-icon { color: #45556b !important; }
.topbar-search kbd { color: #59677a !important; border-color: #bdc8d6; }
.side-section-label,
.side-section-label small { color: #5b6e87 !important; }
.app-shell .side-menu-tree > .side-menu-group > a { color: #263850 !important; }
.app-shell .side-menu-tree .layui-nav-child dd > a { color: #3f5068 !important; }
.app-shell .side-menu-tree .side-menu-subgroup > a { color: #31445e !important; }
.app-shell .side-menu-tree .nav-dot { background: #647792; }
.side-system-status,
.side-system-status small { color: #53657e !important; }
.side-system-status strong { color: #263850 !important; }
.app-shell .side-menu-tree .layui-this > a,
.app-shell .side-menu-tree .layui-this > a span,
.app-shell .side-menu-tree .layui-this > a i,
.app-shell .side-menu-tree .layui-nav-child dd.layui-this > a,
.app-shell .side-menu-tree .layui-nav-child dd.layui-this > a span { color: #fff !important; }

/* Tabs, pagination and empty states. */
.layui-tab-title li,
.project-workspace-tabs > a,
.supplier-workspace-tabs > button,
.employee-income-tabs a { color: #46566d !important; }
.layui-tab-title .layui-this { color: var(--ui-primary) !important; }
.project-workspace-tabs > a.is-active,
.supplier-workspace-tabs > button.is-active,
.supplier-workspace-tabs > button.is-active strong,
.employee-income-tabs a.active { color: #fff !important; }
.employee-income-tabs a.active { color: #134f9f !important; }
.layui-laypage a,
.layui-laypage span { color: #435269; }
.layui-laypage .layui-laypage-curr em { color: #fff; }
.layui-table-view .layui-none,
.entity-empty,
.employee-empty,
.supplier-empty-cell,
.employee-cert-empty,
.dispatch-pool-empty,
.schedule-list-empty { color: #617086 !important; }

/* Common light cards and secondary copy used by business pages. */
.entity-kpi-grid span,
.entity-kpi-grid small,
.device-summary-card span,
.device-summary-card small,
.schedule-overview span,
.schedule-overview small,
.supplier-price-summary span,
.supplier-price-summary small,
.employee-income-kpis span,
.employee-income-kpis small,
.attendance-summary-cards span,
.employee-card-grid span,
.employee-card-grid small,
.income-formula-grid span,
.income-formula-grid small,
.project-cell-main small,
.project-cell-owner small,
.project-cell-stack b,
.project-cell-metrics b,
.stat-output-tabs small,
.stat-output-updated,
.stat-output-table-title span { color: #5d6b80 !important; }
.project-workspace-tabs > a small,
.supplier-workspace-tabs > button small { color: #647287 !important; }
.project-workspace-tabs > a.is-active small,
.supplier-workspace-tabs > button.is-active small { color: #eef5ff !important; }

/* Status pills: darker foregrounds on their soft backgrounds. */
.order-status-badge { font-weight: 750; }
.order-status-green { color: #126b34 !important; background: #d5f5df !important; }
.order-status-blue { color: #174f9c !important; background: #dceaff !important; }
.order-status-orange,
.order-status-amber { color: #884008 !important; background: #fde9b4 !important; }
.order-status-red { color: #9b1c1c !important; background: #fbdada !important; }
.order-status-purple { color: #5b21a8 !important; background: #eee2ff !important; }
.order-status-slate { color: #3f4d61 !important; background: #e2e8f0 !important; }
.supplier-state,
.employee-status,
.cert-warning-state { color: #824006 !important; background: #f9e6ad !important; }
.supplier-state.is-on,
.employee-status.paid,
.cert-warning-state.is-on { color: #126b34 !important; background: #d5f5df !important; }
.cert-warning-state.is-expired { color: #9b1c1c !important; background: #fbdada !important; }

/* Dark hero/banner surfaces need bright secondary text, not global muted grey. */
.project-workspace-summary,
.project-order-head,
.order-workspace-head,
.schedule-list-head,
.stat-output-head,
.employee-income-hero,
.supplier-workspace-summary,
.login-showcase,
.showcase-dashboard { color: var(--contrast-dark-text); }
.project-workspace-summary p,
.project-workspace-summary small,
.project-summary-meta span,
.project-summary-value span,
.project-summary-value small,
.project-order-head p,
.project-order-head small,
.order-workspace-head p,
.order-workspace-head small,
.order-value-summary span,
.schedule-list-head p,
.schedule-list-head small,
.stat-output-head p,
.stat-output-head small,
.stat-output-period small,
.employee-income-hero p,
.employee-income-hero small,
.employee-rule-state span,
.employee-rule-state small,
.login-showcase p,
.login-showcase small,
.showcase-dashboard span,
.showcase-dashboard small { color: var(--contrast-dark-secondary) !important; }
.project-summary-eyebrow,
.project-order-head > div > span,
.schedule-list-head > div > span,
.order-eyebrow,
.stat-output-head > div > span,
.employee-eyebrow,
.showcase-kicker { color: #8fd3ff !important; }
.project-workspace-summary h1,
.project-workspace-summary h2,
.project-workspace-summary strong,
.project-order-head h1,
.project-order-head h2,
.project-order-head strong,
.order-workspace-head h1,
.order-workspace-head h2,
.order-workspace-head strong,
.schedule-list-head h1,
.schedule-list-head h2,
.schedule-list-head strong,
.stat-output-head h1,
.stat-output-head h2,
.stat-output-head strong,
.employee-income-hero h1,
.employee-income-hero strong,
.login-showcase h1,
.login-showcase strong,
.showcase-dashboard strong { color: #fff !important; }

/* Modals, messages and dropdowns. */
.layui-layer-title { color: #25364d !important; background: #f7f9fc !important; border-bottom-color: #d8e0eb !important; font-weight: 700; }
.layui-layer-dialog .layui-layer-content { color: #2e3e55 !important; }
.layui-dropdown-menu li,
.quick-nav-item strong { color: #34445b !important; }
.quick-nav-item small,
.quick-nav-hint span,
.quick-nav-empty { color: #647287 !important; }

/* Preserve readable contrast for all selectable theme accents. */
.layui-layout-theme-red-1, .layui-layout-theme-red-2 { --ui-primary: #c9143d; --ui-primary-hover: #a90f32; }
.layui-layout-theme-blue-1, .layui-layout-theme-blue-2 { --ui-primary: #1d4ed8; --ui-primary-hover: #173fba; }
.layui-layout-theme-green-1, .layui-layout-theme-green-2 { --ui-primary: #0b6b64; --ui-primary-hover: #07554f; }
.layui-layout-theme-black-1, .layui-layout-theme-black-2 { --ui-primary: #334155; --ui-primary-hover: #1e293b; }

@media (max-width: 768px) {
    .employee-cert-alert-stats { align-items: flex-end; flex-direction: column; gap: 4px; }
    .employee-cert-alert-stats > i { display: none; }
}
