/* Appearance modes share the component structure and icon set. */
html[data-lmis-theme="light"] {
    color-scheme: light;
    --lm-ink: #102b49;
    --lm-muted: #435d77;
    --lm-line: #bdcfe0;
    --lm-wash: #e3edf7;
    --lm-shadow: 0 3px 0 #b8cfe345, 0 13px 28px #163e611c;
    --lm-lift: 0 5px 0 #aac7df60, 0 22px 40px #163e612b;
}
html[data-lmis-theme="light"] body {
    background: radial-gradient(ellipse at 88% 0%, #c4e4e2, transparent 34rem),
                linear-gradient(145deg, #dce8f5, #f0f6fb 55%, #dfedf5);
}
html[data-lmis-theme="light"] body .db-label { color: #506780; }
html[data-lmis-theme="light"] body .db-card {
    border-color: #bfd2e3;
    border-block-end-color: #91b9d5;
}
html[data-lmis-theme="light"] body .lp-form-subtitle { color: #4b627a; }

.lmis-appearance-toggle {
    position: fixed;
    inset-inline-end: 1rem;
    inset-block-end: .8rem;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-block-size: 2.7rem;
    padding: .6rem .8rem;
    border: 1px solid #8faec9;
    border-radius: 2rem;
    color: #163b61;
    background: linear-gradient(145deg, #fff, #dcecf9);
    box-shadow: inset 0 1px 0 #fff, 0 3px 0 #96b9d0, 0 8px 20px #10274430;
    font: 600 .85rem/1.25 Arial, Tahoma, sans-serif;
    cursor: pointer;
}
.lmis-appearance-toggle svg { inline-size: 1.15rem; block-size: 1.15rem; flex-shrink: 0; }
.lmis-appearance-toggle .appearance-sun { display: none; }
html[data-lmis-theme="dark"] .lmis-appearance-toggle .appearance-sun { display: block; }
html[data-lmis-theme="dark"] .lmis-appearance-toggle .appearance-moon { display: none; }
.lmis-appearance-toggle:focus-visible { outline: 3px solid #15a3ac; outline-offset: 4px; }
html[data-lmis-theme] .footer { padding-block-end: 4rem; }

html[data-lmis-theme="dark"] {
    color-scheme: dark;
    --lm-ink: #e1ecfa;
    --lm-muted: #b1c3d9;
    --lm-line: #354f70;
    --lm-surface: #152b46;
    --lm-wash: #10233b;
    --lm-navy: #d6eaff;
    --lm-blue: #95caff;
    --lm-teal: #7de0d1;
    --lm-focus: #79e1d8;
    --lm-shadow: inset 0 1px 0 #b1d6ff12, 0 3px 0 #071321, 0 13px 28px #02071145;
    --lm-lift: inset 0 1px 0 #b1d6ff20, 0 5px 0 #071321, 0 22px 42px #02071180;
    --lm-hero: radial-gradient(ellipse at 95% 0%, #267b8d55, transparent 58%), linear-gradient(120deg, #183453, #224b70 70%, #1a5363);
}
html[data-lmis-theme="dark"] body {
    --bs-body-color: #e1ecfa;
    --bs-body-bg: #0c1a2e;
    --bs-border-color: #354f70;
    --bs-link-color: #95caff;
    --bs-link-hover-color: #9ce6e0;
    background: radial-gradient(ellipse at 85% 0%, #1c455e, transparent 40rem),
                linear-gradient(145deg, #0c1a2e, #11253d 55%, #10253a);
    color: var(--lm-ink);
}
html[data-lmis-theme="dark"] body :is(.top-nav-bar, .nav-container, .admin-workspace-rail, .admin-rail-account, #offcanvasResponsive) {
    background: linear-gradient(155deg, #1a3553, #13283f);
    border-color: var(--lm-line) !important;
}
html[data-lmis-theme="dark"] body :is(.text-black, .text-dark) { color: #e1ecfa !important; }
html[data-lmis-theme="dark"] body :is(.bg-light, .bg-white) { background-color: #152b46 !important; }
html[data-lmis-theme="dark"] body :is(.text-muted, .db-label, .db-sub, .lp-form-subtitle, .material-dialog-caption) { color: #b1c3d9 !important; }
html[data-lmis-theme="dark"] body :is(.text-success) { color: #83e1bc !important; }
html[data-lmis-theme="dark"] body :is(.text-danger, .validation-message, .invalid-feedback) { color: #ffacb5 !important; }
html[data-lmis-theme="dark"] body .text-warning { color: #ffd282 !important; }
html[data-lmis-theme="dark"] body :is(.card, .db-card, .settings-card, .filters-form, .actions, .filter-form,
    .modal-content, .dropdown-menu, .popover, .discussion-post-card, .discussion-feed-card,
    .discussion-reply, .discussion-composer, .materials-picker, .material-queue-card,
    .lp-form-box, .list-group-item, .accordion-item, .flatpickr-calendar) {
    color: var(--lm-ink);
    background: linear-gradient(145deg, #1c3552, #152a44);
    border-color: var(--lm-line);
    box-shadow: var(--lm-shadow);
}
html[data-lmis-theme="dark"] body :is(.db-value, .lp-form-title, .card-title, .material-name, .go-previous-page) { color: #e1ecfa; }
html[data-lmis-theme="dark"] body :is(.db-section-rule, .horizontal-line) { background: #3b617f; }
html[data-lmis-theme="dark"] body :is(.db-platform-bar, .settings-card .img-container, .material-name-icon, .material-type, .discussion-count) {
    background: #254a6b; color: #dbeeff;
}
html[data-lmis-theme="dark"] body .db-hero { background: var(--lm-hero); }
html[data-lmis-theme="dark"] body :is(.lp-brand, .landing-page-part1) { background: var(--lm-hero); }
html[data-lmis-theme="dark"] body :is(.lp-form-panel, .landing-page-part2, .landing-page-part3, .landing-page-part4, .landing-page-part5, .landing-page-part6) {
    background: linear-gradient(145deg, #10233b, #19364e);
    color: #e1ecfa;
}
html[data-lmis-theme="dark"] body .landing-page-part3 .title { color: #7de0d1; }
html[data-lmis-theme="dark"] body :is(.lp-brand-title, .lp-brand-sub) { color: #e1ecfa; }
html[data-lmis-theme="dark"] body .lp-label { color: #c8daee; }
html[data-lmis-theme="dark"] body :is(.form-control, .form-select, .lp-input, .sk-select, .sk-multi-select,
    .select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple) {
    color: #e1ecfa;
    background-color: #0d2036;
    border-color: #45627e;
}
html[data-lmis-theme="dark"] body :is(.form-control, .lp-input)::placeholder { color: #a3b7cd; opacity: 1; }
html[data-lmis-theme="dark"] body :is(.form-control, .form-select, .lp-input):focus {
    background-color: #102b43; color: #fff; border-color: #79e1d8; box-shadow: 0 0 0 .2rem #79e1d823;
}
html[data-lmis-theme="dark"] body input:-webkit-autofill {
    -webkit-text-fill-color: #e1ecfa !important;
    box-shadow: 0 0 0 1000px #0d2036 inset !important;
    -webkit-box-shadow: 0 0 0 1000px #0d2036 inset !important;
}
html[data-lmis-theme="dark"] body :is(.select2-dropdown, .select2-results__option, .flatpickr-months, .flatpickr-weekdays) {
    background: #18314e; color: #e1ecfa; border-color: #45627e;
}
html[data-lmis-theme="dark"] body :is(.select2-selection__rendered, .flatpickr-day, .flatpickr-current-month, .flatpickr-weekday) { color: #d6e6f8 !important; }
html[data-lmis-theme="dark"] body .flatpickr-day:hover { background: #335879; }
html[data-lmis-theme="dark"] body :is(.btn-primary, .btn-tertiary, .material-submit, #Button_Login) {
    --bs-btn-color: #fff;
    --bs-btn-bg: #256699;
    --bs-btn-border-color: #548cbb;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #287b88;
    --bs-btn-hover-border-color: #6eb7c0;
    background-color: #256699;
    color: #fff;
}
html[data-lmis-theme="dark"] body .btn-outline-secondary {
    --bs-btn-color: #d5e7fb !important; --bs-btn-border-color: #5d809e;
    --bs-btn-hover-bg: #315677; --bs-btn-hover-border-color: #789ebd; --bs-btn-hover-color: #fff;
}
html[data-lmis-theme="dark"] body .btn-outline-danger {
    --bs-btn-color: #ffadb8; --bs-btn-border-color: #b36b79;
    --bs-btn-hover-bg: #6d2d40; --bs-btn-hover-border-color: #d88c9a;
}
html[data-lmis-theme="dark"] body :is(.dropdown-item, .nav-link, .top-nav-bar .nav-link, #admin-side-bar .nav-link, .side-bar-link) { color: #d6e6f8; }
html[data-lmis-theme="dark"] body :is(.dropdown-item, .list-group-item-action):is(:hover, :focus) { background: #2c4d6e; color: #fff; }
html[data-lmis-theme="dark"] body #admin-side-bar .nav-link:is(:hover, :focus-visible) { background: #294a6b; }
html[data-lmis-theme="dark"] body #admin-side-bar .nav-link.active { background: linear-gradient(125deg, #286b9a, #187580); color: #fff; }
html[data-lmis-theme="dark"] body :is(.nav-tabs, .details-nav ul, ul.details-nav, ul.community-tabs) { background: #142b45; border-color: #354f70; }
html[data-lmis-theme="dark"] body :is(.nav-tabs, .details-nav, .community-tabs) :is(.nav-link, button, a).active {
    background: #2c566f !important; color: #d9fff6 !important; border-color: #527b91 !important;
}
html[data-lmis-theme="dark"] body :is(.quickgrid, .table) {
    --bs-table-color: #e1ecfa; --bs-table-bg: #152b46; --bs-table-striped-bg: #1d3652;
    --bs-table-hover-bg: #284964; --bs-table-border-color: #354f70; color: #e1ecfa;
}
html[data-lmis-theme="dark"] body :is(.quickgrid, .table, .materials-grid) thead th,
html[data-lmis-theme="dark"] body .card.custom-table-head { background-color: #294d6b; color: #e2f0ff; }
html[data-lmis-theme="dark"] body :is(.quickgrid, .materials-grid) tbody td { background-color: #152b46; color: #d4e4f6; border-color: #354f70; }
html[data-lmis-theme="dark"] body :is(.quickgrid, .materials-grid) tbody tr:hover > td { background-color: #23455f; }
html[data-lmis-theme="dark"] body .custom-striped tbody tr:nth-of-type(odd) { background-color: #1d3652 !important; }
html[data-lmis-theme="dark"] body :is(.pagination .page-link, .material-menu-toggle, .discussion-index-filters > form) { background: #1c3652; color: #d6e6f8; border-color: #45627e; }
html[data-lmis-theme="dark"] body .pagination .active > .page-link { background: #286b9a; color: #fff; }
html[data-lmis-theme="dark"] body :is(.messaging-heading, .messaging-card, .messaging-members, .messaging-recipient-options .form-check) {
    background: linear-gradient(145deg, #1e3d5b, #152c46); color: #e1ecfa; border-color: #42607e;
    box-shadow: var(--lm-shadow) !important;
}
html[data-lmis-theme="dark"] body .messaging-recipient-options .form-check:has(:checked) { background: #275867; color: #dcfff7; }
html[data-lmis-theme="dark"] body .material-choice { color: #e1ecfa; background: linear-gradient(145deg, #264968, #19344e); border-color: #42627f; }
html[data-lmis-theme="dark"] body .material-choice--link { background: linear-gradient(145deg, #205253, #17383e); }
html[data-lmis-theme="dark"] body .material-choice--video { background: linear-gradient(145deg, #443f6c, #282a4d); }
html[data-lmis-theme="dark"] body :is(.material-dialog-header, .material-dialog-icon, .upload-area, .material-dropzone, .materials-empty) {
    background: linear-gradient(145deg, #203f5b, #152c46); color: #d8eaff; border-color: #6087a7 !important;
}
html[data-lmis-theme="dark"] body .material-dialog-title { color: #c9e7ff; }
html[data-lmis-theme="dark"] body .material-dialog--link .material-dialog-title { color: #a2efda; }
html[data-lmis-theme="dark"] body .material-dialog--video .material-dialog-title { color: #d1c4ff; }
html[data-lmis-theme="dark"] body :is(.material-delete, .material-menu .material-delete) { color: #ffadb8; }
html[data-lmis-theme="dark"] body .material-menu .material-delete:is(:hover, :focus) { background: #582d42; }
html[data-lmis-theme="dark"] body .discussion-reply { background: linear-gradient(145deg, #1b414d, #152b46); border-color: #4e7f8a; }
html[data-lmis-theme="dark"] body .discussion-replies { border-color: #4e7f8a; }
html[data-lmis-theme="dark"] body .discussion-reply::before { border-color: #4e7f8a; }
html[data-lmis-theme="dark"] body .progress { background: #35516c; }
html[data-lmis-theme="dark"] body .fc {
    --fc-border-color: #354f70; --fc-page-bg-color: #152b46; --fc-neutral-bg-color: #1c3652;
    --fc-today-bg-color: #20454d; --fc-button-bg-color: #286b9a; --fc-button-border-color: #527b91;
}
html[data-lmis-theme="dark"] body .fc .fc-view-harness { background: #152b46; }
html[data-lmis-theme="dark"] body .btn-close { filter: invert(1) grayscale(1) brightness(2); }
html[data-lmis-theme="dark"] body :is(#admin-side-bar .nav-link, .admin-rail-account, .material-choice,
    .material-dialog-icon, .material-menu-toggle, .material-menu .dropdown-item, .material-name-icon,
    .top-nav-bar, .go-previous-page) img[src$=".svg"]:not([src*="/logos/"]) {
    filter: brightness(0) invert(1);
}
html[data-lmis-theme="dark"] body :is(.navbar-brand, .lp-logo-link, #sidebar-nav > .row a):has(img[src*="/logos/"]) {
    background: #f5faff; border: 1px solid #bacfe2; border-radius: .8rem; padding: .45rem .6rem;
}
html[data-lmis-theme="dark"] .lmis-appearance-toggle {
    color: #dbeeff; background: linear-gradient(145deg, #315d7d, #183550); border-color: #7898b7;
    box-shadow: inset 0 1px 0 #c6e6ff40, 0 3px 0 #061323, 0 9px 22px #0007;
}
@media (prefers-reduced-motion: no-preference) {
    .lmis-appearance-toggle { transition: background-color .15s ease, box-shadow .15s ease, translate .15s ease; }
    .lmis-appearance-toggle:hover { translate: 0 -2px; }
}
@media print {
    .lmis-appearance-toggle { display: none !important; }
}

/* Keep component-specific light backgrounds from overriding dark surfaces. */
html[data-lmis-theme="dark"] body .custom-modal .material-dialog .modal-content {
    background: linear-gradient(145deg, #1c3552, #152a44);
    color: #e1ecfa;
    border-color: #52738f;
    box-shadow: var(--lm-lift);
}
html[data-lmis-theme="dark"] body .btn-outline-secondary {
    color: #d5e7fb !important;
    background-color: transparent;
    border-color: #5d809e;
}
html[data-lmis-theme="dark"] body .btn-outline-secondary:is(:hover, :focus-visible) {
    color: #fff;
    background-color: #315677;
}
html[data-lmis-theme="dark"] body :is(.borderless-button, .material-browse) { color: #d5e7fb !important; }
html[data-lmis-theme="dark"] body img:is([src*="logo-mcit-"], [src*="logo-part1-"]) {
    background-color: #f5faff;
    border-radius: .65rem;
    box-shadow: 0 2px 0 #7393ad;
}

/* Detail tabs: override the legacy forced black text in both markup variants. */
html[data-lmis-theme="dark"] body .details-nav :is(a, button) {
    color: #d6e6f8 !important;
    background-color: transparent;
}
html[data-lmis-theme="dark"] body .details-nav :is(a, button):not(.active):is(:hover, :focus-visible) {
    color: #f0f7ff !important;
    background-color: #23445f !important;
}
html[data-lmis-theme="dark"] body .details-nav :is(a, button):is(.active, [aria-selected="true"]) {
    color: #d9fff6 !important;
    background-color: #2c566f !important;
    border-color: #527b91 !important;
    box-shadow: inset 0 1px 0 #b5e8ff26, 0 2px 0 #071321;
}

/* Brighter platform title and readable pagination in dark appearance. */
html[data-lmis-theme="dark"] body .db-platform-name {
    background-image: linear-gradient(110deg, #f0f7ff 5%, #a8dcff 48%, #6de7d4 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #dcefff;
    filter: drop-shadow(0 1px 7px #61c9ed35);
}
html[data-lmis-theme="dark"] body .pagination .page-item .page-link {
    color: #d6e6f8 !important;
    background-color: #1c3652 !important;
    border-color: #52718e !important;
}
html[data-lmis-theme="dark"] body .pagination .page-item .page-link:is(:hover, :focus, :focus-visible),
html[data-lmis-theme="dark"] body .pagination .page-item.active .page-link {
    color: #e1fff8 !important;
    background-color: #2c566f !important;
    border-color: #78b7c2 !important;
}
html[data-lmis-theme="dark"] body .pagination .page-item .page-link span { color: inherit !important; }
html[data-lmis-theme="dark"] body .pagination .page-item.disabled .page-link,
html[data-lmis-theme="dark"] body .pagination .page-item.disabled .page-link span {
    color: #9eb3ca !important;
    background-color: #172b41 !important;
    border-color: #354f70 !important;
}
body .db-card-drilldown {
    display: block;
    inline-size: 100%;
    text-align: start;
    font: inherit;
    cursor: pointer;
    color: inherit;
}
body .db-card-drilldown:focus-visible { outline: 3px solid var(--lm-focus); outline-offset: 4px; }
body .db-card-drilldown:is(:hover, :focus-visible) { box-shadow: var(--lm-lift); }
body .db-details-modal .modal-content { border-radius: 1.2rem; overflow: hidden; }
body .db-details-summary { display: flex; align-items: center; gap: 1rem; margin-block-end: 1rem; }
body .db-details-summary strong { font-size: 2rem; color: var(--lm-blue); }
body .db-details-modal td { overflow-wrap: anywhere; max-inline-size: 24rem; }
html[data-lmis-theme="dark"] body .db-details-modal :is(.modal-header, .modal-footer) { border-color: #354f70; }


/* Every KPI uses the same restrained lift, including links and detail-dialog cards. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    body :is(.db-card, .db-card-link .db-card) {
        transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    }
    body :is(.db-card, .db-card-link .db-card):is(:hover, :focus-visible) {
        transform: translateY(-6px) scale(1.012);
        box-shadow: var(--lm-lift);
    }
}
@media (prefers-reduced-motion: reduce) {
    body :is(.db-card, .db-card-link .db-card):is(:hover, :focus-visible) { transform: none; transition: none; }
}
body .dashboard-users-scope { border-inline-start: 4px solid var(--lm-teal); }
body .dashboard-users-scope h2 { color: var(--lm-ink); }

body .dashboard-materials-page .material-name { display: block; min-inline-size: 12rem; max-inline-size: 26rem; overflow-wrap: anywhere; }
body .dashboard-materials-page td { vertical-align: middle; }
body .dashboard-materials-page th { white-space: nowrap; }
body .dashboard-users-grid { overflow-x: auto; max-inline-size: 100%; }
body .dashboard-users-grid .quickgrid { min-inline-size: 75rem; }
body .dashboard-users-grid th { white-space: nowrap; }
body .dashboard-users-grid td { overflow-wrap: anywhere; }
/* Charts use the same surfaces and 3D treatment as KPI cards in both appearances. */
body .dashboard-insights { margin-block: 2rem; }
body .insight-note { color: var(--lm-muted); font-size: .9rem; line-height: 1.7; }
body .insight-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; margin-block-end: 1rem; }
body .insight-summary { padding: 1.25rem; text-decoration: none; color: var(--lm-ink); gap: .55rem; border-radius: 1.2rem; border-block-start: 3px solid #37a6ba; box-shadow: var(--lm-shadow); }
body .insight-summary i { color: var(--lm-blue); font-size: 1.4rem; }
body .insight-summary strong { font-size: 1.9rem; line-height: 1.2; color: var(--lm-ink); }
body .insight-summary small { color: var(--lm-muted); line-height: 1.6; }
body .insight-summary:hover { box-shadow: var(--lm-lift); color: var(--lm-ink); }
body .insight-meter,.insight-rank-track { display: block; block-size: .6rem; background: var(--lm-line); border-radius: 1rem; overflow: hidden; }
body .insight-meter>span,.insight-rank-track>span { display: block; block-size: 100%; border-radius: inherit; background: linear-gradient(90deg,#2767ac,#31b9b4); box-shadow: inset 0 1px 0 #ffffff66; }
body .insight-charts-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
body .insight-wide { grid-column: span 2; }
body .insight-panel { padding: clamp(1rem,2vw,1.5rem); border-radius: 1.25rem; box-shadow: var(--lm-shadow); min-inline-size: 0; }
body .insight-panel h3 { font-size: 1.08rem; line-height: 1.6; margin: 0 0 .5rem; color: var(--lm-ink); }
body .insight-panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
body .insight-panel-heading>a { font-size: .9rem; }
body .insight-rank { display: grid; gap: .35rem; margin-block-start: .55rem; padding: .6rem .5rem; border-radius: .6rem; color: var(--lm-ink); text-decoration: none; }
body .insight-rank:hover { background: #3ab5d115; color: var(--lm-ink); }
body .insight-rank-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; font-size: .92rem; }
body .insight-rank-heading>span { overflow-wrap: anywhere; }
body .insight-rank-heading strong { flex-shrink: 0; }
body .insight-rank small { color: var(--lm-muted); }
body .insight-donut { display: block; inline-size: min(100%,15rem); margin: .65rem auto; overflow: visible; }
body .insight-donut a { cursor: pointer; }
body .insight-donut a:hover circle { stroke-width: 19; }
body .insight-donut-number { fill: var(--lm-ink); font: 700 17px Arial,Tahoma,sans-serif; }
body .insight-donut-label { fill: var(--lm-muted); font: 7px Arial,Tahoma,sans-serif; }
body .insight-legend { display: flex; align-items: center; gap: .5rem; padding: .65rem .2rem; color: var(--lm-ink); text-decoration: none; border-block-end: 1px solid var(--lm-line); line-height: 1.6; }
body .insight-legend>strong { margin-inline-start: auto; flex-shrink: 0; }
body .insight-dot { inline-size: .7rem; block-size: .7rem; border-radius: 50%; flex-shrink: 0; }
body .insight-dot.downloads { background: #3ab5d1; } body .insight-dot.videos { background: #9c84ef; }
body .insight-timeline { display: block; inline-size: 100%; min-block-size: 9rem; margin-block: 1rem; }
body .insight-timeline a:hover rect { fill: #9c84ef; }
body .insight-axis { fill: var(--lm-muted); font: 11px Arial,Tahoma,sans-serif; }
body .insight-period-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: var(--lm-muted); font-size: .9rem; }
body .insight-beneficiary-stack { display: flex; overflow: hidden; border-radius: .8rem; min-block-size: 3.5rem; margin-block: 1.5rem; box-shadow: inset 0 1px 0 #ffffff44,0 3px 0 #102c4b44; }
body .insight-beneficiary-stack>a { display: grid; place-items: center; min-inline-size: 2.8rem; padding: .5rem; color: white; background: #286b9a; text-decoration: none; font-weight: 700; }
body .insight-beneficiary-stack>a:last-child { background: #806014; }
body .insight-organization-list { max-block-size: 24rem; overflow: auto; padding-inline-end: .4rem; }
body .dashboard-insights a:focus-visible { outline: 3px solid var(--lm-focus); outline-offset: 3px; }
body .material-scope-links { display: flex; flex-wrap: wrap; gap: .5rem; }
body .material-scope-links>a { display: inline-block; padding: .45rem .7rem; border: 1px solid var(--lm-line); border-radius: .7rem; color: var(--lm-ink); text-decoration: none; }
body .material-count-link { display: inline-block; padding: .35rem .65rem; font-weight: 700; border: 1px solid var(--lm-line); border-radius: .6rem; }
body .material-count-link:hover { background: #3ab5d122; }
body .material-scope-count { font-size: 1.1rem; line-height: 1.9; }
@media (max-width: 1199.98px) { body .insight-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } body .insight-charts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } body .insight-wide { grid-column: span 1; } }
@media (max-width: 767.98px) { body .insight-charts-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 479.98px) { body .insight-summary-grid { grid-template-columns: minmax(0,1fr); } }

body .insight-timeline { direction: ltr; overflow: visible; }
body .insight-timeline text { direction: ltr; unicode-bidi: bidi-override; }
body .insight-summary strong[dir="ltr"] { text-align: start; }
html[dir="rtl"] body .insight-summary strong[dir="ltr"] { text-align: right; }
/* Consistent compact headers for dashboard drilldown tables only. */
body :is(.dashboard-materials-page .table, .dashboard-users-grid .quickgrid, .db-details-modal .table) th {
    font-size: .875rem;
    font-weight: 650;
    line-height: 1.5;
    white-space: normal;
    vertical-align: middle;
    padding: .7rem .65rem;
    text-align: start;
}
body :is(.dashboard-materials-page .table, .dashboard-users-grid .quickgrid, .db-details-modal .table) td {
    padding: .75rem .65rem;
    line-height: 1.6;
    vertical-align: middle;
}
body .dashboard-users-grid .sort-header-btn { font-size: inherit; line-height: inherit; white-space: normal; text-align: start; }
body .dashboard-users-grid .quickgrid { min-inline-size: 64rem; }
body .dashboard-materials-page .table { min-inline-size: 64rem; }
body .dashboard-materials-page .material-name { min-inline-size: 10rem; max-inline-size: 20rem; }
body .dashboard-materials-page td:last-child { min-inline-size: 8.5rem; }
body .dashboard-materials-page .table :is(th,td):is(:nth-child(5),:nth-child(6),:nth-child(7),:nth-child(8)) { text-align: center; }
body .dashboard-materials-page td [dir="ltr"], body .dashboard-users-grid td [dir="ltr"] { white-space: nowrap; font-variant-numeric: tabular-nums; }
body .dashboard-materials-page td .btn { font-size: .875rem; padding: .4rem .6rem; line-height: 1.5; }
body .dashboard-users-grid .quickgrid { width: 100%; }
/* Compact overview: retain the KPI set and progressively disclose related analysis. */
body .db-compact { padding: .8rem 1rem 1.25rem; }
body .db-compact .db-platform-bar { margin-block-end: .45rem; }
body .db-compact .db-platform-name { font-size: 1.1rem; }
body .db-compact .db-hero { padding: .65rem 1rem; margin-block-end: .75rem; border-radius: 1rem; }
body .db-compact .db-hero-title { font-size: 1.2rem; margin-block-end: .2rem; }
body .db-compact .db-hero-greeting { font-size: .75rem; }
body .db-compact .db-hero-badge { padding: .5rem .8rem; }
body .db-compact .db-hero-badge-date { font-size: .95rem; }
body .db-compact .db-section { margin-block-end: .7rem; }
body .db-compact .db-section-head { margin-block-end: .4rem; gap: .5rem; }
body .db-compact .db-section-pill { font-size: .9rem; padding: .3rem .65rem; }
body .db-compact .db-section-pill img { inline-size: 1rem; block-size: 1rem; }
body .db-compact .row { --bs-gutter-x: .7rem; --bs-gutter-y: .7rem; }
body .db-compact .db-card {
    display: grid; grid-template-columns: 2.1rem minmax(0,1fr); grid-template-rows: auto auto auto;
    align-content: center; align-items: center; gap: .15rem .6rem;
    min-block-size: 5.1rem; padding: .55rem .7rem; border-radius: .9rem !important;
}
body .db-compact .db-icon { grid-column: 1; grid-row: 1 / span 3; inline-size: 2.1rem; block-size: 2.1rem; margin: 0; border-radius: .6rem; font-size: 1.05rem; }
body .db-compact .db-icon img { inline-size: 1.15rem; block-size: 1.15rem; }
body .db-compact .db-label { grid-column: 2; grid-row: 1; min-block-size: 2.4em; margin: 0; font-size: .82rem; line-height: 1.2; overflow-wrap: anywhere; }
body .db-compact .db-value { grid-column: 2; grid-row: 2; font-size: 1.5rem; line-height: 1.05; margin: 0; }
body .db-compact .db-sub { grid-column: 2; grid-row: 3; display: block; margin: 0; font-size: .72rem; line-height: 1.2; }
body .db-compact .db-card::after { inline-size: 3.5rem; block-size: 3.5rem; inset-inline-end: -1rem; bottom: -1rem; }
body .db-compact .dashboard-insights { margin: .45rem 0 0; }
body .db-compact :is(.insight-topic,.db-calendar-details) { border: 1px solid var(--lm-line); border-radius: .75rem; background: var(--lm-surface); }
body .db-compact :is(.insight-topic,.db-calendar-details)>summary { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .75rem; padding: .45rem .65rem; cursor: pointer; list-style: none; color: var(--lm-ink); font-size: .85rem; margin: 0; }
body .db-compact :is(.insight-topic,.db-calendar-details)>summary::-webkit-details-marker { display: none; }
body .db-compact :is(.insight-topic,.db-calendar-details)>summary::after { content: '+'; margin-inline-start: auto; font: 600 1.1rem/1 Arial,sans-serif; color: var(--lm-blue); }
body .db-compact :is(.insight-topic,.db-calendar-details)[open]>summary::after { content: '−'; }
body .db-compact :is(.insight-topic,.db-calendar-details)>summary:focus-visible { outline: 3px solid var(--lm-focus); outline-offset: 3px; border-radius: .6rem; }
body .db-compact .insight-topic>summary small { font-size: .8rem; color: var(--lm-muted); }
body .db-compact :is(.insight-topic-body,.db-calendar-body) { padding: .65rem; border-block-start: 1px solid var(--lm-line); }
body .db-compact .insight-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; margin-block-end: .65rem; }
body .db-compact .insight-summary { padding: .7rem .8rem; gap: .3rem; border-radius: .8rem !important; }
body .db-compact .insight-summary strong { font-size: 1.35rem; }
body .db-compact .insight-summary i { font-size: 1rem; }
body .db-compact .insight-summary :is(span,small) { font-size: .8rem; line-height: 1.4; }
body .db-compact .insight-panel { padding: .75rem; border-radius: .85rem !important; }
body .db-compact .insight-panel h3 { font-size: .95rem; line-height: 1.4; margin-block-end: .3rem; }
body .db-compact .insight-note { font-size: .8rem; line-height: 1.45; margin-block-end: .4rem; }
body .db-compact .insight-wide { grid-column: auto; }
body .db-compact .insight-charts-grid { gap: .65rem; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); }
body .db-compact .insight-topic-materials .insight-charts-grid { grid-template-areas: 'top mix' 'top activity'; }
body .db-compact .insight-top-resources { grid-area: top; }
body .db-compact .insight-mix { grid-area: mix; display: grid; grid-template-columns: 7rem minmax(0,1fr); align-items: center; column-gap: .65rem; }
body .db-compact .insight-mix h3 { grid-column: 1 / -1; }
body .db-compact .insight-mix .insight-donut { grid-column: 1; grid-row: 2 / span 2; inline-size: 6.5rem; margin: .3rem 0; }
body .db-compact .insight-mix .insight-legend { grid-column: 2; }
body .db-compact .insight-activity { grid-area: activity; }
body .db-compact .insight-rank { gap: .2rem; margin-block-start: .2rem; padding: .3rem; }
body .db-compact .insight-rank-heading { font-size: .85rem; line-height: 1.4; }
body .db-compact .insight-rank small { font-size: .78rem; }
body .db-compact .insight-rank-track { block-size: .4rem; }
body .db-compact .insight-legend { padding: .35rem .1rem; font-size: .82rem; line-height: 1.4; }
body .db-compact .insight-timeline { min-block-size: 5.5rem; max-block-size: 7rem; margin-block: .4rem; }
body .db-compact .insight-period-summary { font-size: .8rem; }
body .db-compact .insight-beneficiary-stack { min-block-size: 2.4rem; margin-block: .7rem; }
body .db-compact .insight-organization-list { max-block-size: 14rem; }
body .db-compact .insight-topic-users .insight-panel { display: grid; grid-template-columns: 7rem repeat(3,minmax(0,1fr)); align-items: center; gap: .2rem 1rem; }
body .db-compact .insight-topic-users .insight-panel :is(h3,p) { grid-column: 1 / -1; }
body .db-compact .insight-topic-users .insight-donut { inline-size: 6.5rem; margin: .2rem 0; }
body .db-compact .insight-topic-visits .insight-summary { display: grid; grid-template-columns: 1.5rem minmax(0,1fr) auto; align-items: center; }
body .db-compact .insight-topic-visits .insight-summary i { grid-column: 1; grid-row: 1 / span 2; }
body .db-compact .insight-topic-visits .insight-summary>span { grid-column: 2; }
body .db-compact .insight-topic-visits .insight-summary>small { grid-column: 2; grid-row: 2; }
body .db-compact .insight-topic-visits .insight-summary>strong { grid-column: 3; grid-row: 1 / span 2; }
body .db-compact .insight-method { margin-block-start: .5rem; font-size: .8rem; color: var(--lm-muted); }
body .db-compact .insight-method>summary { cursor: pointer; }
@media (max-width: 767.98px) {
    body .db-compact .insight-summary-grid { grid-template-columns: minmax(0,1fr); }
    body .db-compact .insight-charts-grid { grid-template-columns: minmax(0,1fr); }
    body .db-compact .insight-topic-materials .insight-charts-grid { grid-template-areas: 'mix' 'top' 'activity'; }
    body .db-compact .insight-topic-users .insight-panel { grid-template-columns: 6rem minmax(0,1fr); }
    body .db-compact .insight-topic-users .insight-donut { grid-column: 1; grid-row: 3 / span 3; }
    body .db-compact .insight-topic-users .insight-legend { grid-column: 2; }
}
@media (max-width: 575.98px) {
    body .db-compact { padding: .6rem .65rem 1rem; }
    body .db-compact [class*='row-cols-'] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-inline: 0; inline-size: 100%; gap: .5rem; }
    body .db-compact [class*='row-cols-']>.col { inline-size: auto; padding: 0; }
    body .db-compact .db-card { grid-template-columns: 1.65rem minmax(0,1fr); gap: .1rem .4rem; padding: .5rem; }
    body .db-compact .db-icon { inline-size: 1.65rem; block-size: 1.65rem; }
    body .db-compact .db-value { font-size: 1.3rem; }
    body .db-compact .db-platform-name { font-size: .95rem; white-space: normal; text-align: center; }
}

body .db-compact .db-card { align-content: start; grid-template-rows: minmax(2rem,auto) 1.6rem auto; }
body .db-compact .db-hero-greeting { display: none; }
body .db-compact .db-hero-body { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
body .db-compact .db-hero-title { margin: 0; }
body .db-compact .db-overview-topics { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr); gap: .75rem; align-items: start; }
body .db-compact .db-overview-topics>.db-section:only-child { grid-column: 1 / -1; }
@media (max-width: 1199.98px) { body .db-compact .db-overview-topics { grid-template-columns: minmax(0,1fr); gap: 0; } }
/* Align values within each KPI row even when translated labels wrap. */
body .db-compact :is(.db-user-stats,.db-material-kpis,.db-visit-kpis) .db-card { display: flex; flex-direction: column; align-items: stretch; padding-inline-start: 3.4rem; }
body .db-compact :is(.db-user-stats,.db-material-kpis,.db-visit-kpis) .db-icon { position: absolute; inset-inline-start: .7rem; inset-block-start: 50%; translate: 0 -50%; }
body .db-compact :is(.db-user-stats,.db-material-kpis,.db-visit-kpis) .db-label { flex: 1; }
body .db-compact :is(.db-user-stats,.db-material-kpis,.db-visit-kpis) .db-value { flex-shrink: 0; margin-block-start: .15rem; }
body .db-compact .db-material-kpis .db-sub { min-block-size: 2.4em; }
body .db-compact .db-visit-kpis .db-sub { min-block-size: 3.6em; }
@media (max-width: 575.98px) {
    body .db-compact :is(.db-user-stats,.db-material-kpis,.db-visit-kpis) .db-card { padding-inline-start: 2.6rem; }
    body .db-compact :is(.db-user-stats,.db-material-kpis,.db-visit-kpis) .db-icon { inset-inline-start: .5rem; }
}
/* All compact visualizations stay visible; the calendar alone is expandable. */
body .db-compact .db-overview-topics { display: block; }
body .db-compact .insight-topic { border: 0; background: transparent; margin: .5rem 0 .7rem; }
body .db-compact .insight-topic-body { padding: 0; border: 0; }
body .db-compact :is(.db-users-visual-layout,.db-system-visual-layout,.db-visits-visual-layout) {
    display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: .75rem; align-items: center;
}
body .db-compact .db-topic-kpis { min-inline-size: 0; }
body .db-compact :is(.db-users-visual-layout,.db-system-visual-layout,.db-visits-visual-layout)>.insight-topic { margin: 0; min-inline-size: 0; }
body .db-compact :is(.db-users-visual-layout,.db-system-visual-layout,.db-visits-visual-layout)>.db-topic-kpis:only-child { grid-column: 1 / -1; }
body .db-compact .db-visits-visual-layout { grid-template-columns: minmax(0,2.2fr) minmax(16rem,1fr); }
body .db-compact .insight-topic-users .insight-panel,
body .db-compact .insight-visitor-gauge { display: grid; grid-template-columns: 6rem minmax(0,1fr); gap: .2rem .65rem; align-items: center; }
body .db-compact .insight-topic-users .insight-panel>h3,
body .db-compact .insight-visitor-gauge>h3 { grid-column: 1 / -1; }
body .db-compact .insight-topic-users .insight-panel>p { grid-column: 1 / -1; }
body .db-compact .insight-topic-users .insight-donut { grid-column: 1; grid-row: 3 / span 3; inline-size: 5.7rem; margin: 0; }
body .db-compact .insight-topic-users .insight-legend { grid-column: 2; }
body .db-compact .insight-topic-users .insight-donut-number { font-size: 15px; }
body .db-compact .insight-visitor-gauge .insight-donut { grid-column: 1; grid-row: 2 / span 2; inline-size: 5.7rem; margin: .3rem 0; }
body .db-compact .insight-visitor-gauge .insight-legend { grid-column: 2; }
body .db-compact .insight-visitor-gauge .insight-note { grid-column: 1 / -1; margin-block: .25rem 0; }
body .db-compact .insight-visitor-gauge .insight-donut-number { direction: ltr; unicode-bidi: embed; font-size: 16px; }
body .db-compact .insight-topic-system .insight-rank-track { block-size: .5rem; }
body .db-compact .system-course-bar { background: linear-gradient(90deg,#7260b8,#b08ce1); }
body .db-compact .insight-topic-system .insight-note { margin-block: .4rem 0; }
body .db-compact .insight-method { border-block-start: 1px solid var(--lm-line); padding-block-start: .45rem; }
body .db-compact .insight-method>strong { font-size: .8rem; }
@media (max-width: 1279.98px) {
    body .db-compact .db-visits-visual-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 991.98px) {
    body .db-compact :is(.db-users-visual-layout,.db-system-visual-layout) { grid-template-columns: minmax(0,1fr); }
}

@media (min-width: 1280px) { body .db-compact .db-visits-visual-layout { grid-template-columns: minmax(0,3.6fr) minmax(14rem,1fr); } }

/* Keep detail actions legible in narrow table columns, in both writing directions. */
body :is(.quickgrid-wrapper,.table-responsive) a.btn[href*="/details/"],
body a.user-details-action {
    display: inline-flex; align-items: center; justify-content: center;
    white-space: nowrap; overflow-wrap: normal; word-break: normal;
    font-size: .875rem; line-height: 1.4; padding: .4rem .6rem !important;
    min-inline-size: 4.5rem;
}
body .quickgrid .user-actions-column { min-inline-size: 8rem; inline-size: 8rem; }

/* Keep the landing contact action readable beside the dashboard action. */
body .landing-page-part1 .landing-contact-button { background: #fff; color: #183b60; border-color: #a8c1db; }
html[data-lmis-theme="dark"] body .landing-page-part1 .landing-contact-button {
    background: #d9edff !important; color: #102e4b !important; border-color: #a9d6fa !important;
    font-weight: 600; opacity: 1; box-shadow: 0 4px 12px #0004;
}
html[data-lmis-theme="dark"] body .landing-page-part1 .landing-contact-button:is(:hover, :focus-visible) {
    background: #fff !important; color: #102e4b !important; border-color: #fff !important;
}
html[data-lmis-theme="dark"] body .landing-page-part1 .landing-contact-button:focus-visible {
    outline: 3px solid #79dcca; outline-offset: 3px;
}

/* A shared, gently tinted dashboard surface with a visible raised edge. */
html[data-lmis-theme="light"] body .db-page {
    --db-surface-shadow: inset 0 1px 0 #ffffffb3, 0 4px 0 #a8bfd780, 0 10px 22px #183b6026;
    --db-surface-lift: inset 0 1px 0 #ffffffcc, 0 5px 0 #9fbad480, 0 18px 30px #183b6033;
}
html[data-lmis-theme="light"] body .db-page :is(.db-card, .card) {
    background: linear-gradient(145deg, #e3edf7, #d8e6f2);
    border-color: #b5cadf; border-block-end-color: #90b0cd;
    box-shadow: var(--db-surface-shadow);
}
html[data-lmis-theme="dark"] body .db-page {
    --db-surface-lift: inset 0 1px 0 #80b3df26, 0 5px 0 #07162699, 0 18px 30px #0006;
}
html[data-lmis-theme] body .db-page :is(.db-card, .insight-summary, .insight-panel):is(:hover, :focus-within) {
    box-shadow: var(--db-surface-lift); border-block-end-color: #5899b6;
}
@media (prefers-reduced-motion: no-preference) {
    body .db-page :is(.db-card, .insight-summary, .insight-panel) {
        transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
    }
    body .db-page :is(.db-card, .insight-summary, .insight-panel):focus-within { transform: translateY(-4px); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    body .db-page :is(.db-card, .insight-summary, .insight-panel):hover { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
    body .db-page :is(.db-card, .insight-summary, .insight-panel) { transition: none; }
    body .db-page :is(.db-card, .insight-summary, .insight-panel):is(:hover, :focus-within) { transform: none; }
}

/* Separate raised light cards from the page and share the page wash with calendars. */
html[data-lmis-theme="light"] body {
    --lm-page-background: radial-gradient(ellipse at 88% 0%, #b4d8d5, transparent 34rem), linear-gradient(145deg, #bccfe1, #cddde9 55%, #bcd5df);
    background: var(--lm-page-background);
}
html[data-lmis-theme="light"] body :is(.db-calendar-details, #calendar-container > .card, #calendar, #calendar .fc-view-harness) {
    background: var(--lm-page-background);
}
html[data-lmis-theme="light"] body #calendar {
    --fc-page-bg-color: #cddde9; --fc-neutral-bg-color: #c2d4e3;
    --fc-border-color: #9bb6cc; --fc-today-bg-color: #a7d4d559;
}
html[data-lmis-theme="light"] body #calendar :is(.fc-scrollgrid, .fc-scrollgrid-section > td, .fc-daygrid-body, .fc-daygrid-day) { background-color: transparent; }
/* Explicit colors beat the calendar component's legacy black link/button rules. */
html[data-lmis-theme="dark"] body #calendar :is(.fc-daygrid-day-number, .fc-col-header-cell-cushion, .fc-list-day-text, .fc-list-day-side-text, .fc-timegrid-axis-cushion, .fc-timegrid-slot-label-cushion) {
    color: #dfedff !important; opacity: 1;
}
body #calendar .fc-daygrid-day-number {
    display: inline-flex; align-items: center; justify-content: center;
    min-inline-size: 1.9rem; min-block-size: 1.9rem; border-radius: .5rem;
}
html[data-lmis-theme="dark"] body #calendar :is(.fc-daygrid-day-number, .fc-col-header-cell-cushion, .fc-list-day-text, .fc-list-day-side-text):is(:hover, :focus-visible, :active) {
    color: #fff !important; background: #386c97; box-shadow: 0 2px 6px #0005;
}
html[data-lmis-theme="dark"] body #calendar .fc-day-today .fc-daygrid-day-number { color: #fff !important; background: #246d79; }
html[data-lmis-theme="dark"] body #calendar a:focus-visible { outline: 2px solid #79e1d8; outline-offset: 2px; }
html[data-lmis-theme="dark"] body #calendar .fc-button {
    background: #264f73 !important; border-color: #6186a7 !important; color: #e7f2ff !important;
}
html[data-lmis-theme="dark"] body #calendar .fc-button .fc-icon { color: inherit !important; }
html[data-lmis-theme="dark"] body #calendar .fc-button:is(:hover, :focus-visible, :active, .fc-button-active) { background: #3978a1 !important; color: #fff !important; }
html[data-lmis-theme="dark"] body #calendar .fc-day-today { background-color: #20454d !important; }
/* Share the light page palette across desktop, collapsed, and mobile navigation. */
html[data-lmis-theme="light"] body :is(.admin-workspace-rail, .nav-container, #offcanvasResponsive, .admin-rail-account) {
    background: var(--lm-page-background) !important;
    border-color: #9bb6cc;
}
html[data-lmis-theme="light"] body :is(.admin-workspace-rail, #offcanvasResponsive) :is(#sidebar, #sidebar-nav, .offcanvas-header, .offcanvas-body) {
    background: transparent;
}

/* Signed-in employee/instructor surfaces share the navy dark palette. */
html[data-lmis-theme="dark"] body .top-nav-bar .nav-link:is(:hover, :focus-visible, .active, [aria-current="page"]) {
    background: linear-gradient(135deg, #2d607f, #235567) !important;
    color: #f3f8ff !important; box-shadow: inset 0 1px 0 #b7e6ff33, 0 3px 8px #06142255;
}
html[data-lmis-theme="dark"] body .top-nav-bar .nav-link:focus-visible { outline: 2px solid #79e1d8; outline-offset: 2px; }
html[data-lmis-theme="dark"] body .employee-cover {
    background: radial-gradient(ellipse at 15% 0%, #438d994d, transparent 65%), linear-gradient(120deg, #244866, #1b3b59 70%, #235469);
    border: 1px solid #4b7393; border-block-end: 3px solid #102c45; border-radius: 1rem;
    box-shadow: inset 0 1px 0 #b6ddff33, 0 5px 0 #07162666, 0 15px 28px #0005;
}
html[data-lmis-theme="dark"] body .employee-cover .employee-name { color: #f0f7ff; text-shadow: 0 2px 3px #08233f80; }
html[data-lmis-theme="dark"] body .employee-cover .cover-books { filter: drop-shadow(0 8px 6px #06172866); }
html[data-lmis-theme="dark"] body .bg-color-bright-gray {
    background-color: #203c57 !important; color: #e1ecfa !important; border-color: #4a6b88 !important;
}
html[data-lmis-theme="dark"] body .bg-color-bright-gray :is(p, span) { color: inherit; }
html[data-lmis-theme="dark"] body .employee-dashboard .bg-color-bright-gray:not(.progress) {
    box-shadow: inset 0 1px 0 #a3cdec1f, 0 3px 0 #091d3080, 0 9px 20px #0003;
}
html[data-lmis-theme="dark"] body .employee-dashboard a.btn[href^="/home/"]:not(.btn-primary):not(.btn-outline-secondary) { color: #b9ddff !important; }
html[data-lmis-theme="dark"] body .employee-dashboard a.btn[href^="/home/"]:not(.btn-primary):not(.btn-outline-secondary):is(:hover, :focus-visible) { color: #fff !important; background: #2d5373; }
html[data-lmis-theme="dark"] body .employee-dashboard a.btn > img { filter: brightness(0) invert(.9); }
html[data-lmis-theme="dark"] body .employee-course-card { color: #e1ecfa !important; }
html[data-lmis-theme="dark"] body .employee-course-card > div {
    background: linear-gradient(145deg, #223f5d, #19334e); border-color: #527695 !important;
    box-shadow: inset 0 1px 0 #acd7ff26, 0 3px 0 #081a2c66, 0 10px 22px #0003;
}
html[data-lmis-theme="dark"] body .employee-dashboard .progress-bar { background-color: #6ebbd3 !important; }

/* Shared surfaces for menu pages, drilldowns, editors and dialogs. */
html[data-lmis-theme="light"] {
    --lm-surface: #e3edf7; --lm-field: #f0f6fb; --lm-field-muted: #d5e2ed;
    --lm-panel-fill: linear-gradient(145deg, #e3edf7, #d8e6f2);
    --lm-panel-edge: #afc6dc; --lm-field-shadow: inset 0 2px 4px #244b6b12, 0 1px 0 #ffffffa6;
}
html[data-lmis-theme="dark"] {
    --lm-field: #10273e; --lm-field-muted: #233d56;
    --lm-panel-fill: linear-gradient(145deg, #1c3552, #152a44);
    --lm-panel-edge: #45627e; --lm-field-shadow: inset 0 2px 4px #0003, 0 1px 0 #9fcbec17;
}
html[data-lmis-theme="light"] body :is(.card, .settings-card, .filters-form, .filter-form, .modal-content, .dropdown-menu, .popover, .discussion-post-card, .discussion-feed-card, .discussion-composer, .messaging-card, .messaging-members, .materials-picker, .lp-form-box) {
    background: var(--lm-panel-fill); color: var(--lm-ink); border-color: var(--lm-panel-edge); box-shadow: var(--lm-shadow);
}
html[data-lmis-theme] body :is(.modal-header, .modal-footer, .card-header, .card-footer, .popover-header) {
    color: var(--lm-ink); border-color: var(--lm-line);
}
html[data-lmis-theme="dark"] body :is(.card-header, .card-footer, .popover-header, .popover-body, .modal-header, .modal-footer, .accordion-body, .input-group-text) {
    background-color: #1b3651; color: #e1ecfa;
}
html[data-lmis-theme] body :is(.form-control, .form-select, .sk-select, .sk-multi-select, .lp-input, .transparent-input) {
    background-color: var(--lm-field); color: var(--lm-ink); box-shadow: var(--lm-field-shadow);
}
html[data-lmis-theme] body :is(.form-control, .form-select, .sk-select, .sk-multi-select, .lp-input):not(.is-invalid, .invalid, .is-valid) { border-color: var(--lm-panel-edge); }
html[data-lmis-theme] body :is(.form-control, .form-select, .lp-input)::placeholder { color: var(--lm-muted); opacity: 1; }
html[data-lmis-theme] body :is(.form-control, .form-select, .lp-input):is(:disabled, [readonly]) {
    background-color: var(--lm-field-muted); color: var(--lm-muted); opacity: 1;
}
html[data-lmis-theme] body select option { background: var(--lm-field); color: var(--lm-ink); }
html[data-lmis-theme] body :is(.form-control, .form-select, .sk-select, .sk-multi-select, .lp-input, .transparent-input):focus {
    outline-color: var(--lm-focus); border-color: var(--lm-focus); box-shadow: var(--lm-field-shadow), 0 0 0 .2rem color-mix(in srgb, var(--lm-focus) 20%, transparent);
}
html[data-lmis-theme="dark"] body :is(.text-bg-light, .text-bg-white, .bg-white, .bg-light) { color: #e1ecfa !important; }
html[data-lmis-theme="dark"] body :is(.accordion-button, .list-group-item, .input-group-text, .form-control-custom, .input-group-append) { color: #e1ecfa; background-color: #1c3652; border-color: #45627e; }
html[data-lmis-theme="dark"] body .accordion-button:not(.collapsed) { color: #efffff; background: #2b566e; box-shadow: inset 0 -1px 0 #5b809c; }
html[data-lmis-theme="dark"] body .accordion-button::after { filter: brightness(0) invert(.9); }
html[data-lmis-theme="dark"] body .list-group-item:is(.active, [aria-selected="true"]) { background: #2c6278; color: #fff; border-color: #73abba; }
html[data-lmis-theme="dark"] body :is(.nav-tabs, .community-tabs) .nav-link:not(.active):is(:hover, :focus-visible) { background: #294c69; color: #fff; }
html[data-lmis-theme="dark"] body :is(.table, .quickgrid) :is(.sort-header-btn, .col-title, .col-title-text) { color: #e1ecfa; }
html[data-lmis-theme="dark"] body :is(.table, .quickgrid) .btn-link { color: #b8dcff; }
html[data-lmis-theme="dark"] body :is(.table, .quickgrid) :is(th, td) { border-color: #3b5874; }
html[data-lmis-theme="dark"] body :is(.table-light, .table-secondary) { --bs-table-bg: #25435e; --bs-table-color: #e1ecfa; }
html[data-lmis-theme="dark"] body .dropdown-item:disabled,
html[data-lmis-theme="dark"] body .dropdown-item.disabled { color: #99abc1; background: transparent; }
html[data-lmis-theme="dark"] body .select2-results__option--highlighted[aria-selected] { background: #2d6179 !important; color: #fff !important; }
html[data-lmis-theme="dark"] body .select2-selection__choice { background: #294d68 !important; color: #e1ecfa; border-color: #668ba7 !important; }
html[data-lmis-theme="dark"] body .select2-search__field { background: #10273e; color: #e1ecfa; }
html[data-lmis-theme="dark"] body :is(.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.flatpickr-disabled) { color: #859cb3 !important; }
html[data-lmis-theme="dark"] body .flatpickr-day:is(.selected, .startRange, .endRange) { background: #296d89; color: #fff !important; border-color: #82cbd6; }
html[data-lmis-theme="dark"] body a[style*="color:black"],
html[data-lmis-theme="dark"] body a[style*="color: black"],
html[data-lmis-theme="dark"] body .discussion-target-link { color: #b8dcff !important; }
html[data-lmis-theme="dark"] body .btn-link { color: #b8dcff; }
html[data-lmis-theme="dark"] body :is(.alert-info, .alert-secondary, .alert-light) { background: #203e58; color: #dcefff; border-color: #527b96; }
html[data-lmis-theme="dark"] body .alert-success { background: #153e39; color: #b6f3d9; border-color: #4c8f7a; }
html[data-lmis-theme="dark"] body :is(.alert-danger, .lp-error) { background: #482b3b; color: #ffd0d6; border-color: #a9697b; }
html[data-lmis-theme="dark"] body .alert-warning { background: #463c25; color: #ffe5ab; border-color: #9c8550; }
html[data-lmis-theme] body :is(.dropdown-menu, .popover, .modal-content) { box-shadow: var(--lm-lift); }
html[data-lmis-theme] body :is(.accordion-item, .form-control-custom) { border-color: var(--lm-panel-edge); }
html[data-lmis-theme] body :is(.form-check-input, .btn, .page-link, .accordion-button, .dropdown-item):focus-visible { outline: 2px solid var(--lm-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
    body :is(a.settings-card, a.card, .employee-course-card > div) { transition: transform .2s ease, box-shadow .2s ease; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    body :is(a.settings-card, a.card, .employee-course-card > div):hover { transform: translateY(-3px); box-shadow: var(--lm-lift); }
}
@media print {
    html[data-lmis-theme] body { background: white !important; color: black !important; }
    html[data-lmis-theme] body :is(.card, .table, .quickgrid, .form-control, .form-select) { background: white !important; color: black !important; box-shadow: none !important; }
}
html[data-lmis-theme="light"] body .list-group-item:is(.active, [aria-selected="true"]) { background: #246694; color: #fff; border-color: #246694; }
html[data-lmis-theme="light"] body :is(.alert-info, .alert-secondary, .alert-light) { background: #d7eafa; color: #194464; border-color: #a7c8e1; }
html[data-lmis-theme="light"] body .alert-success { background: #d6ece3; color: #1c513d; border-color: #99c7b4; }
html[data-lmis-theme="light"] body .alert-danger { background: #f4dfe3; color: #782c3d; border-color: #d9a6b2; }
html[data-lmis-theme="light"] body .accordion-button { background: #e3edf7; color: #183b60; }
html[data-lmis-theme="light"] body .accordion-button:not(.collapsed) { background: #cadfeb; color: #14465a; }
/* Override legacy important colors in shared alert and accordion styles. */
html[data-lmis-theme="light"] body :is(.alert-info, .alert-secondary, .alert-light) { background-color: #d7eafa !important; color: #194464 !important; }
html[data-lmis-theme="light"] body .alert-success { background-color: #d6ece3 !important; color: #1c513d !important; }
html[data-lmis-theme="light"] body .alert-danger { background-color: #f4dfe3 !important; color: #782c3d !important; }
html[data-lmis-theme="dark"] body :is(.alert-info, .alert-secondary, .alert-light) { background-color: #203e58 !important; color: #dcefff !important; }
html[data-lmis-theme="dark"] body .alert-success { background-color: #153e39 !important; color: #b6f3d9 !important; }
html[data-lmis-theme="dark"] body .alert-danger { background-color: #482b3b !important; color: #ffd0d6 !important; }
html[data-lmis-theme="light"] body .accordion .accordion-button { background-color: #e3edf7 !important; color: #183b60 !important; }
html[data-lmis-theme="light"] body .accordion .accordion-button:not(.collapsed) { background-color: #cadfeb !important; color: #14465a !important; }
html[data-lmis-theme="dark"] body .accordion .accordion-button { background-color: #1c3652 !important; color: #e1ecfa !important; }
html[data-lmis-theme="dark"] body .accordion .accordion-button:not(.collapsed) { background-color: #2b566e !important; color: #efffff !important; }
html[data-lmis-theme="light"] body :is(.accordion-item, .accordion-body, .list-group-item, .input-group-text) { background-color: #e3edf7; color: #102b49; border-color: #afc6dc; }
html[data-lmis-theme="light"] body .list-group-item:is(.active, [aria-selected="true"]) { background: #246694; color: #fff; }
html[data-lmis-theme="light"] body .list-group-item-action:is(:hover, :focus-visible):not(.active) { background-color: #c8deed; color: #102b49; }
html[data-lmis-theme="light"] body .table { --bs-table-bg: #e8f0f7; --bs-table-color: #102b49; }
html[data-lmis-theme="dark"] body .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d6e6f8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
html[data-lmis-theme] body :is(.form-control, .form-select).is-invalid { border-color: #c74d65; }
html[data-lmis-theme="dark"] body :is(.form-control, .form-select).is-invalid { border-color: #f09aab; }
