/* DistinctPayroll ↔ Connectwell UI kit adapter styles (ported from CMMS cmms-kit.css). css/kit is copied verbatim from
   CMMS; this file maps app markup onto the kit tokens so it matches the kit in light and dark mode. Loaded after css/kit.
   The Payroll-specific part is at the end. */

/* ---------------- Top bar ---------------- */
.cw-topbar .cw-amc-chip { align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: var(--wip-bg); color: var(--wip); border: 1px solid var(--wip-line); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; margin-right: var(--s1); }
.cw-topbar .cw-amc-chip:hover { filter: brightness(.97); }

/* ---------------- Bell panel and toasts (notification-ui.js injects its own light colours) ---------------- */
.cn-panel { background: var(--card) !important; border-color: var(--line) !important; box-shadow: var(--sh-3) !important; border-radius: var(--r-lg) !important; }
.cn-panel .cn-ph { border-bottom-color: var(--line); }
.cn-panel .cn-ph b { color: var(--title); font-size: var(--fs-lg); }
.cn-panel .cn-ph button { color: var(--info); }
.cn-panel .cn-ph button:hover { background: var(--info-bg); }
.cn-panel .cn-appr { background: var(--wip-bg); border-bottom-color: var(--wip-line); color: var(--wip); }
.cn-panel .cn-appr:hover { color: var(--wip); filter: brightness(.98); }
.cn-panel .cn-appr .cn-n { background: var(--wip); }
.cn-panel .cn-pf { color: var(--info); border-top-color: var(--line); background: var(--card); }
.cn-toast { background: var(--card); border-color: var(--line); box-shadow: var(--sh-3); }
.cn-toast .cn-title { color: var(--title); }
.cn-toast .cn-desc { color: var(--text-2); }
.cn-toast .cn-lead, .cn-toast .cn-top { color: var(--muted); }
.cn-toast .cn-foot, .cn-toast .cn-x { color: var(--faint); }
.cn-toast .cn-x:hover { background: var(--hover); color: var(--text); }
:root[data-theme="dark"] .cn-panel .cn-it, :root[data-theme="dark"] .cn-panel .cn-row { color: var(--text); }

/* ---------------- Action confirm dialog (Shared/_ConfirmModal, cmmsActionConfirm) ----------------
   Drawn as the kit's one dialog (the same look CIS gives SweetAlert2 in css/kit/cw-kit.css): a toned icon disc beside
   a left-aligned title and lead, the body below, and a footer band with Cancel first and the action last. Layout and
   colour only — ids, buttons, reason box, busy state and the focus trap are unchanged. */
.cfm { background: var(--scrim, rgba(15, 23, 42, .45)); }
.cfm .cfm__box { --cfm-c: var(--ok); --cfm-h: var(--ok-hover, var(--ok)); --cfm-t: var(--ok-bg); background: var(--card); color: var(--text); border-radius: var(--r-xl); box-shadow: var(--sh-3); }
.cfm .cfm__box[data-tone="primary"] { --cfm-c: var(--ok); --cfm-t: var(--ok-bg); }
.cfm .cfm__box[data-tone="danger"] { --cfm-c: var(--crit); --cfm-h: var(--crit); --cfm-t: var(--crit-bg); }
.cfm .cfm__box[data-tone="warning"] { --cfm-c: var(--wip); --cfm-h: var(--wip); --cfm-t: var(--wip-bg); }
.cfm .cfm__box[data-tone="info"] { --cfm-c: var(--info); --cfm-h: var(--info); --cfm-t: var(--info-bg); }
.cfm .cfm__hero { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; text-align: left; padding: 20px 52px 0 20px; }
.cfm .cfm__icon { grid-column: 1; grid-row: 1 / span 2; width: 40px; height: 40px; margin: 0; }
.cfm .cfm__icon svg { width: 20px; height: 20px; }
.cfm .cfm__title { grid-column: 2; font-size: 16px; line-height: 1.35; color: var(--ink); margin: 2px 0 4px; }
.cfm .cfm__lead { grid-column: 2; font-size: var(--fs-md); color: var(--text-2); line-height: 1.55; }
.cfm .cfm__x { top: 12px; right: 12px; width: 30px; height: 30px; padding: 0; border-radius: var(--r-md); color: var(--muted); }
.cfm .cfm__x:hover { background: var(--hover); color: var(--text); }
.cfm .cfm__body { padding: 14px 20px 4px 74px; }
.cfm .cfm__box:has(#cfmRecord:not([hidden])) .cfm__body,
.cfm .cfm__box:has(#cfmReasonWrap:not([hidden])) .cfm__body,
.cfm .cfm__box:has(.cfm__extra:not(:empty)) .cfm__body { padding-left: 20px; }
.cfm .cfm__record { background: var(--surface-2); border-color: var(--line); }
.cfm .cfm__code { color: var(--ink); }
.cfm .cfm__desc, .cfm .cfm__points li, .cfm .cfm__extra, .cfm .cfm__list { color: var(--text-2); }
.cfm .cfm__stage { background: var(--card); border-color: var(--line); color: var(--text-2); }
.cfm .cfm__what, .cfm .cfm__opt, .cfm .cfm__count { color: var(--muted); }
.cfm .cfm__points li::before { background: var(--faint); }
.cfm .cfm__quote { background: var(--surface-2); border-left-color: var(--line-strong); color: var(--text-2); }
.cfm .cfm__reason label, .cfm .cfm__field label { color: var(--text); }
.cfm .cfm__req { color: var(--crit); }
.cfm .cfm__reason textarea, .cfm .cfm__field input, .cfm .cfm__field select, .cfm .cfm__field textarea { background: var(--card); color: var(--text); border-color: var(--line); border-radius: var(--r-md); }
.cfm .cfm__reason textarea:focus, .cfm .cfm__field :is(input, select, textarea):focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cfm .cfm__err { background: var(--crit-bg); border-color: var(--crit-line); color: var(--crit); }
.cfm .cfm__busy { background: color-mix(in srgb, var(--card) 86%, transparent); color: var(--ink); }
.cfm .cfm__foot { justify-content: flex-end; gap: var(--s2); margin-top: 18px; padding: var(--s3) 20px; border-top: 1px solid var(--line-2, var(--line)); background: var(--surface-3, var(--surface-2)); }
.cfm .cfm__btn { flex: 0 0 auto; min-height: var(--h-btn); height: var(--h-btn); padding: 0 var(--s4); border-radius: var(--r-md); font-size: var(--fs-md); }
.cfm .cfm__btn:not(.cfm__btn--go) { order: 1; background: transparent; border-color: transparent; color: var(--text-2); }
.cfm .cfm__btn:not(.cfm__btn--go):hover { background: var(--hover); color: var(--text); }
.cfm .cfm__btn--go { order: 3; }

/* ---------------- Breadcrumbs ----------------
   Pages that draw their own breadcrumb (masters, asset hierarchy, scan, classification …) keep it — it carries the
   page's own links and chips — so the kit's form breadcrumb (cw-form.js) steps aside there; their crumb takes the kit look. */
.dashboard__content:has(.masters-crumb, .a360-crumb) > .cw-form-crumb { display: none; }
.masters-crumb, .a360-crumb { font-size: var(--fs-sm) !important; color: var(--muted) !important; }
.masters-crumb a, .a360-crumb a { color: var(--muted) !important; text-decoration: none !important; }
.masters-crumb a:hover, .a360-crumb a:hover { color: var(--accent) !important; }
.masters-crumb b, .a360-crumb b { color: var(--text) !important; }

/* ---------------- Home ---------------- */
#cmmsHome .cw-dot-unread { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
#cmmsHome .cw-home__line .cw-home__meta { font-weight: 500; }

/* ---------------- Menu ---------------- */
/* the unread count on the Notifications item sits on the item's row, at its end */
#sidebar .dashboard__navLink > a:has(> .nav-notif-badge) { display: flex; align-items: center; }
#sidebar .dashboard__navLink > a > .nav-notif-badge { order: 2; margin-left: auto; flex: 0 0 auto; height: 18px; min-width: 18px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; align-items: center; justify-content: center; }
#sidebar .dashboard__navLink > a > .nav-link-content { flex: 1 1 auto; min-width: 0; }
#sidebar.collapsed .dashboard__navLink > a > .nav-notif-badge { display: none !important; }

/* ---------------- Dark mode: solid buttons ----------------
   cw-dark-legacy.css (generated) gives base buttons that were hard-coded white (.gt-btn, .pick__btn, .pc-btn, .sapx-btn)
   the card colour with !important, which would also flatten their solid variants; those keep their fill here. */
:root[data-theme="dark"] :is(.gt-btn--primary, .org-pcard .pc-btn.primary, .sapx-btn.primary) { background-color: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
:root[data-theme="dark"] :is(.gt-btn--primary:hover:not(:disabled), .org-pcard .pc-btn.primary:hover, .sapx-btn.primary:hover) { background-color: var(--accent-hover) !important; border-color: var(--accent-hover) !important; color: #fff !important; }
:root[data-theme="dark"] .gt-btn--ok { background-color: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }
:root[data-theme="dark"] .gt-btn--ok:hover:not(:disabled) { background-color: var(--ok-hover) !important; border-color: var(--ok-hover) !important; color: #fff !important; }
:root[data-theme="dark"] .gt-btn--danger { color: var(--crit) !important; }
:root[data-theme="dark"] .gt-btn--danger:hover:not(:disabled) { background-color: var(--crit-bg) !important; }
:root[data-theme="dark"] :is(.gt-btn, .pick__btn):disabled { opacity: .5; }

/* ---------------- Badges ---------------- */
/* Yellow / cyan / light badges always carry dark text (Bootstrap draws white on yellow, 1.6:1, and the kit turns dark
   text light in dark mode); Bootstrap's yellow text-warning is unreadable on white, so it takes the kit's amber. */
.badge:is(.bg-warning, .bg-info, .bg-light, .text-bg-warning, .text-bg-info, .text-bg-light) { color: #1f2937 !important; }
.text-warning { color: var(--wip) !important; }

/* ---------------- Section tabs (asset 360, transfer / retire detail, Asset Fields) ----------------
   CMMS's .a360-tabs were dark pills; the kit's tabs are underline tabs (cw-components .cw-tabs): muted labels, the
   open one in the accent with an accent underline, counts as soft chips. Same buttons and data-* hooks. */
:root .a360-tabs { gap: 2px; padding: 0 var(--s3); background: var(--card); border-bottom: 1px solid var(--line-2, var(--line)); align-items: flex-end; }
/* (:root[data-theme] + !important: the generated dark rules for these selectors are !important too; this file loads later) */
:root[data-theme] .a360-tabs button:not(.sec-min) { padding: 12px var(--s3) 10px !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; background: transparent !important; color: var(--muted) !important; font-size: var(--fs-md) !important; font-weight: 600; white-space: nowrap; }
:root[data-theme] .a360-tabs button:not(.sec-min):hover { color: var(--text) !important; }
:root[data-theme] .a360-tabs button:not(.sec-min).active { color: var(--accent) !important; border-bottom-color: var(--accent) !important; }
:root[data-theme] .a360-tabs .a360-tabcount { background: var(--chip-bg, var(--surface-2)) !important; color: var(--text-2) !important; }
:root[data-theme] .a360-tabs button:not(.sec-min).active .a360-tabcount { background: var(--accent-soft) !important; color: var(--accent) !important; }
:root[data-theme] .a360-tabs button:not(.sec-min).is-empty:not(.active) { color: var(--faint) !important; }
:root[data-theme] .a360-tabs > .sec-min { align-self: center; }
:root[data-theme] .a360-tabs .a360-tabcount.cap { background: var(--wip-bg) !important; color: var(--wip) !important; }
/* ---------------- Main tabs over sub-tabs ----------------
   A main tab that opens a row of tabs below it is drawn as the kit's pill tabs (cw-register .cw-ptabs, mockup .ptabs,
   CIS Review › Review / Meetings / Archive): outlined pills, the open one filled in the ink colour. The sub-tabs under it
   stay underline tabs. Asset 360: Activity / Maintenance / Records / History over .a360-tabs, and Basic / Extended over
   the Extended sections (it was a bright blue half-and-half switch). Same buttons and data-* hooks. */
:root[data-theme] :is(.a360-tabgroups, .info-toggle) { display: flex !important; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: 10px var(--s4) !important; background: var(--card) !important; border-bottom: 1px solid var(--line-2, var(--line)) !important; }
:root[data-theme] :is(.a360-tabgroups, .info-toggle) > button:not(.sec-min) {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 120px; height: 32px; padding: 0 14px !important; margin: 0 !important;
  border: 1px solid var(--line) !important; border-radius: var(--r-md) !important; background: var(--card) !important; color: var(--text-2) !important;
  font-size: 12.5px !important; font-weight: 600 !important; box-shadow: none !important; white-space: nowrap;
}
:root[data-theme] :is(.a360-tabgroups, .info-toggle) > button:not(.sec-min):hover { border-color: var(--line-strong) !important; color: var(--text) !important; }
:root[data-theme] :is(.a360-tabgroups, .info-toggle) > button:not(.sec-min).active { background: var(--inverse) !important; border-color: var(--inverse) !important; color: var(--on-inverse) !important; }
:root[data-theme] :is(.a360-tabgroups, .info-toggle) > button:not(.sec-min):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-theme] .a360-tabgroups .a360-tabcount { background: var(--chip-bg) !important; color: var(--text-2) !important; }
:root[data-theme] .a360-tabgroups button.active .a360-tabcount { background: color-mix(in srgb, var(--on-inverse) 20%, transparent) !important; color: var(--on-inverse) !important; }
:root[data-theme] .a360-tabgroups button.active .a360-tabalert { color: var(--on-inverse) !important; }
/* …and the Extended sections under Basic / Extended are its sub-tabs: underline tabs like .a360-tabs, the section number a
   chip (the asset form's own .asset-steps, without .info-steps, keep their step look) */
:root[data-theme] .asset-steps.info-steps { gap: 2px; padding: 0 var(--s3) !important; margin: 0 !important; background: var(--card) !important; border-bottom: 1px solid var(--line-2, var(--line)); align-items: flex-end; }
:root[data-theme] .asset-steps.info-steps a { gap: 7px; padding: 12px var(--s3) 10px !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--muted) !important; font-size: var(--fs-md) !important; font-weight: 600; }
:root[data-theme] .asset-steps.info-steps a:hover { color: var(--text) !important; }
:root[data-theme] .asset-steps.info-steps a.active { color: var(--accent) !important; border-bottom-color: var(--accent) !important; }
:root[data-theme] .asset-steps.info-steps .num { width: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 20px; background: var(--chip-bg) !important; color: var(--text-2) !important; font-size: 11px; }
:root[data-theme] .asset-steps.info-steps a.active .num { background: var(--accent-soft) !important; color: var(--accent) !important; }
/* Asset Fields: its add button is the page's create action — the kit's primary (brand red), as on every register */
:root[data-theme] .af-page .af-toolbar #afAddCat { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
:root[data-theme] .af-page .af-toolbar #afAddCat:hover { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }

/* ---------------- Bootstrap floating labels (Change Password …) ----------------
   The kit's compact control height (--h-input) squeezed .form-floating fields so the label sat on the typed text;
   they keep Bootstrap's floating geometry, in kit colours. */
.form-floating > .form-control, .form-floating > .form-select { height: calc(3.5rem + 2px) !important; min-height: calc(3.5rem + 2px) !important; padding: 1rem .75rem !important; line-height: 1.25 !important; font-size: var(--fs-md) !important; }
.form-floating > .form-control::placeholder { color: transparent !important; }
.form-floating > .form-control:focus, .form-floating > .form-control:not(:placeholder-shown), .form-floating > .form-select { padding-top: 1.625rem !important; padding-bottom: .625rem !important; }
.form-floating > label { padding: 1rem .75rem !important; height: 100% !important; display: block !important; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--fs-md) !important; font-weight: 500 !important; color: var(--muted) !important; }
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label, .form-floating > .form-select ~ label { transform: scale(.85) translateY(-.5rem) translateX(.15rem); }
.form-floating > label::after { background: transparent !important; }

/* ---------------- Buttons never wrap their label ---------------- */
/* (a narrow table column squeezed "Open setup" onto two lines; zero specificity, so a page that wants wrapping keeps it) */
:where(.btn, .gt-btn, .cw-btn, td button, td a.btn) { white-space: nowrap; }

/* ---------------- Approve / reject dialog (Assets/Details .decide-modal) ----------------
   Same build as the action confirm (.cfm above): drawn as the kit dialog — toned icon disc beside a left-aligned
   title and lead, footer band with Cancel first and the decision last. Ids, fields and handlers unchanged. */
:root .decide-modal { background: var(--scrim, rgba(15, 23, 42, .45)); }
:root[data-theme] .decide-modal__box { background: var(--card) !important; color: var(--text); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-3); }
:root .decide-modal__hero { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; text-align: left; padding: 20px 52px 0 20px; }
:root .decide-modal__icon { grid-column: 1; grid-row: 1 / span 2; width: 40px; height: 40px; margin: 0; }
:root .decide-modal__icon svg { width: 20px; height: 20px; }
:root[data-theme] .decide-modal__box.is-reject .decide-modal__icon { background: var(--crit-bg) !important; color: var(--crit) !important; }
:root[data-theme] .decide-modal__box.is-approve .decide-modal__icon { background: var(--ok-bg) !important; color: var(--ok) !important; }
:root .decide-modal__title { grid-column: 2; font-size: 16px; line-height: 1.35; margin: 2px 0 4px; }
:root[data-theme] .decide-modal__title { color: var(--ink) !important; }
:root .decide-modal__lead { grid-column: 2; font-size: var(--fs-md); line-height: 1.55; }
:root .decide-modal__hero-x { top: 12px; right: 12px; width: 30px; height: 30px; padding: 0; border-radius: var(--r-md); }
:root .decide-modal__hero-x:hover { background: var(--hover); }
:root .decide-modal__body { padding: 14px 20px 4px; }
:root .decide-modal__foot { justify-content: flex-end; gap: var(--s2); margin-top: 18px; padding: var(--s3) 20px; border-top: 1px solid var(--line-2, var(--line)); background: var(--surface-3, var(--surface-2)); }
:root .decide-modal__foot [data-decide-close] { order: 1; background: transparent; border-color: transparent; color: var(--text-2); }
:root .decide-modal__foot [data-decide-close]:hover { background: var(--hover); color: var(--text); }
:root .decide-modal__foot .btn:not([data-decide-close]) { order: 3; }
:root .decide-modal__foot .btn { flex: 0 0 auto; min-height: var(--h-btn); height: var(--h-btn); padding: 0 var(--s4); border-radius: var(--r-md); font-size: var(--fs-md); }

/* ---------------- Every dialog stands off the page in dark mode ---------------- */
/* (dark cards on a dark page: a hairline edge and the kit's deeper scrim) */
:root[data-theme="dark"] :is(.cfm__box, .pickmodal__box, .gpv-modal__box, .modal-content, .e-dialog, .decide-modal__box) { border: 1px solid var(--line-strong) !important; }
:root[data-theme="dark"] :is(.cfm, .pickmodal, .gpv-modal, .decide-modal) { background: var(--scrim) !important; }

/* ---------------- Grid view dialogs (Shared/_GridViewSharingPartial) in dark mode ----------------
   They sit inside the register's .dashboard__tableHead, so the kit's dark rule for that toolbar's buttons (cw-dark.css)
   also flattened their coloured buttons — the red Save / Update view (its script rewrites the inline red to rgb()) and
   Bootstrap's approve / reject / share buttons. They keep their own colours here (ids outrank that rule). */
:root[data-theme="dark"] :is(#saveViewModal, #manageViewsModal, #shareViewModal, #adminApprovalModal) .modal-footer .btn[style*="227, 31, 36"],
:root[data-theme="dark"] :is(#saveViewModal, #manageViewsModal, #shareViewModal, #adminApprovalModal) .modal-footer .btn[style*="#E31F24"] { background-color: var(--accent) !important; color: #fff !important; }
:root[data-theme="dark"] :is(#saveViewModal, #manageViewsModal, #shareViewModal, #adminApprovalModal) .btn:is(.btn-success, .btn-danger, .btn-primary, .btn-warning) { background-color: var(--bs-btn-bg) !important; border-color: var(--bs-btn-border-color) !important; color: var(--bs-btn-color) !important; }

/* ---------------- Toasts clear the form's sticky action bar ---------------- */
/* (toastr's bottom-right toast covered Cancel / Save on create and edit pages) */
body:has(.cw-factions-bar) #toast-container:is(.toast-bottom-right, .toast-bottom-left, .toast-bottom-center, .toast-bottom-full-width) { bottom: 84px; }

/* ---------------- Notifications page: kit inbox day groups (cmms-kit.js inbox) ---------------- */
#notificationListContainer .notification-list > .cw-ngrp { list-style: none; margin: 0; }
#notificationListContainer .notification-list > .cw-ngrp:first-child { border-top: 0; }
#notificationToolbar .btn .cw-i { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
#notificationToolbar .btn { display: inline-flex; align-items: center; }

/* ---------------- Loaders: the CIS save card (app-loader.js) ----------------
   One look for every action loader, as in CIS: a card with the accent ring and "Saving…" on a dimmed, blurred page.
   Geometry from CIS site.css (.loader.cis-save-overlay); colours from css/kit/cw-kit.css, so light and dark follow
   the tokens. Navigation shows the kit's progress line instead (cw-shell.js .cw-navbar); grids their skeleton rows. */
.loader.cis-save-overlay { position: fixed; inset: 0; z-index: 20000; display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.loader.cis-save-overlay.show { display: flex; }
.cis-save-overlay .loader-card { min-width: 180px; padding: 28px 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cis-save-overlay .spinner { width: 40px; height: 40px; border-width: 4px; border-style: solid; border-radius: 50%; animation: cw-save-spin .8s linear infinite; }
.cis-save-overlay .loader-text { font-size: 14px; letter-spacing: .01em; }
@keyframes cw-save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cis-save-overlay .spinner { animation-duration: 2s; } }
/* The Save / Submit button while its action runs (app-loader.js, CIS site.css .cis-save-busy): a small ring in the
   button's own text colour (white on the red primary, ink on plain buttons) and "Saving…", not pressable */
.cis-save-busy { pointer-events: none !important; opacity: .78 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; }
.cis-save-spinner { display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: cw-save-spin .7s linear infinite; }

/* ======================================================================================================================
   DistinctPayroll
   ====================================================================================================================== */

/* Sidebar brand: Payroll's own logo (the kit swaps in the Connectwell logo in dark mode; keep ours, on a light chip). */
/* The logo already reads "Distinct Payroll Services", so it fills the row on its own (no app tag beside it). */
#sidebar .cw-sb__brand { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
#sidebar .cw-sb__brand .dashboard__logo-full { height: 40px; max-height: 40px; width: auto; max-width: 100%; object-fit: contain; }
:root[data-theme="dark"] #sidebar .dashboard__logo-full { content: normal; background: #fff; border-radius: 8px; padding: 4px 10px; box-sizing: content-box; max-width: calc(100% - 20px); }
#sidebar .cw-sb__brand .dashboard__logo-icon { width: 28px; height: 28px; object-fit: contain; }

/* Payroll's theme colours (css/app/distinctpayroll-theme.css) follow the kit, so its light-only rules work in dark mode. */
:root[data-theme="dark"] {
    --dp-surface: var(--card);
    --dp-sidebar-bg: var(--card);
    --dp-border: var(--line);
    --dp-text: var(--text);
    --dp-primary-light: var(--row-hover);
}
:root[data-theme="dark"] .e-grid .e-headercell { background-color: var(--cis-grid-header-bg, var(--surface-2)) !important; }
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell:not(.e-active),
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-active,
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-focused,
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-selectionbackground { background-color: var(--surface-2) !important; }
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:hover .e-rowcell,
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:hover .e-rowcell.e-active,
:root[data-theme="dark"] .dashboard__table .e-grid .e-row:hover .e-rowcell.e-focused { background-color: var(--row-hover) !important; }

/* Login: the kit turns .login__left images white (made for CMMS's logo); Payroll's left side is a full-colour picture. */
.login__left img.login__illustration { filter: none; }

/* Dashboard (css/app/dashboard.css is drawn for light mode only): cards, text and icon chips follow the kit tokens. */
:root[data-theme="dark"] :is(.dashboard-overview__hero, .dashboard-kpi, .dashboard-stat-card, .dashboard-stat-card--highlight,
    .dashboard-overview__table-wrap, .dashboard-chart-card) { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .dashboard-overview__hero { background: linear-gradient(120deg, var(--card) 0%, var(--card) 55%, var(--accent-soft) 100%); }
:root[data-theme="dark"] .dashboard-stat-card--highlight { border-color: var(--accent-line); }
:root[data-theme="dark"] .dashboard-stat-card:hover { border-color: var(--line-strong); }
:root[data-theme="dark"] :is(.dashboard-stat-card__footer, .dashboard-overview__table-head, .dashboard-chart-card__header,
    .dashboard-overview__table-wrap .table thead th) { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] :is(.dashboard-overview__section-head, .dashboard-charts-section) { border-color: var(--line); }
:root[data-theme="dark"] :is(.dashboard-overview__hero-text h1, .dashboard-overview__section-title, .dashboard-kpi__value,
    .dashboard-stat-card__value, .dashboard-chart-card__title, .dashboard-overview__table-wrap .table thead th) { color: var(--title); }
:root[data-theme="dark"] :is(.dashboard-overview__hero-text p, .dashboard-kpi__label, .dashboard-stat-card__label,
    .dashboard-overview__table-wrap .table tbody td) { color: var(--text-2); }
:root[data-theme="dark"] :is(.dashboard-overview__section-sub, .dashboard-kpi__meta, .dashboard-stat-card__meta,
    .dashboard-chart-card__subtitle, .dashboard-chart-card__empty, .dashboard-chart-card__empty i) { color: var(--muted); }
:root[data-theme="dark"] .dashboard-overview__table-wrap .table { --bs-table-bg: transparent; --bs-table-color: var(--text-2); }
:root[data-theme="dark"] .dashboard-overview__table-wrap .table td { border-color: var(--line); }
/* icon chips: a soft tint of their own colour instead of a pastel square */
:root[data-theme="dark"] :is(.dashboard-kpi__icon--primary, .dashboard-stat-card__icon--blue, .dashboard-chart-card__header-icon) { background: rgba(99, 102, 241, .16); color: #a5b4fc; }
:root[data-theme="dark"] :is(.dashboard-kpi__icon--accent, .dashboard-stat-card__icon--red, .dashboard-chart-card__header-icon--accent) { background: rgba(239, 68, 68, .16); color: #fca5a5; }
:root[data-theme="dark"] :is(.dashboard-kpi__icon--success, .dashboard-stat-card__icon--green, .dashboard-chart-card__header-icon--green) { background: rgba(16, 185, 129, .16); color: #6ee7b7; }
:root[data-theme="dark"] .dashboard-kpi__icon--info { background: rgba(6, 182, 212, .16); color: #67e8f9; }
:root[data-theme="dark"] .dashboard-stat-card__icon--amber { background: rgba(245, 158, 11, .16); color: #fcd34d; }
:root[data-theme="dark"] .dashboard-stat-card__icon--slate { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
:root[data-theme="dark"] .dashboard-stat-card--highlight .dashboard-stat-card__value { color: #f87171; }
