/* Common action treatment throughout HCIS, HR, Payroll and People Development. */
body.hcis-ui #app-content :is(
    button:not(.entity-select-trigger):not([role=combobox]):not([aria-haspopup]),
    a.button, a.hr-button, a.hcis-action-button, a.btn-primary, a.btn-cancel, a.btn-export, a.ib-action-btn, a.repo-result-btn, a.print-button, a[role=button], a[data-download],
    a[class*="rounded"][class*="px-"], a[title]:has(svg)
) {
    align-items:center; justify-content:center; gap:6px;
    box-sizing:border-box; min-width:0; min-height:32px; height:32px;
    width:auto; padding:5px 10px; border-radius:6px; box-shadow:none;
    font-family:inherit; font-size:13px; font-weight:600; line-height:20px;
    letter-spacing:normal; white-space:nowrap; text-decoration:none; cursor:pointer;
}
/* Old module utilities must not force full-width or oversized action buttons. */
body.hcis-ui #app-content :is(button, a):is(.button, .hr-button, .hcis-action-button, [data-download], .text-white):not(.entity-select-trigger):not([aria-haspopup]) {
    width:auto !important; min-height:32px !important; height:32px !important;
    padding:5px 10px !important; border-radius:6px !important;
    font-size:13px !important; line-height:20px !important; box-shadow:none !important;
}
/* Preserve white action text inside unlayered/scoped module typography. */
body.hcis-ui :is(button,a).text-white,
body.hcis-ui :is(button,a).text-white:is(:hover,:focus-visible,:active),
body.hcis-ui .hcis-action-primary,
body.hcis-ui .button.primary,
body.hcis-ui .hr-primary { color:#fff !important; }
body.hcis-ui :is(button,a):is(.hcis-action-primary,.button.primary,.hr-primary,[class~="bg-[#1e3a5f]"],[class~="bg-blue-600"],[class~="bg-blue-700"],[class~="bg-blue-800"],[class~="bg-gray-800"],[class~="bg-gray-900"]) {
    background:#1e3a5f; border-color:#1e3a5f; color:#fff;
}
body.hcis-ui :is(button,a):is(.hcis-action-primary,.button.primary,.hr-primary,[class~="bg-[#1e3a5f]"],[class~="bg-blue-600"],[class~="bg-blue-700"],[class~="bg-blue-800"],[class~="bg-gray-800"],[class~="bg-gray-900"]):is(:hover,:focus-visible,:active) {
    background:#244c7a; border-color:#244c7a; color:#fff;
}
body.hcis-ui .hcis-action-button { border:1px solid #cbd5e1; background:#fff; color:#1e3a5f; }
body.hcis-ui .hcis-action-button:hover { background:#eff6ff; }
body.hcis-ui .hcis-action-button.hcis-action-primary { background:#1e3a5f; border-color:#1e3a5f; }
body.hcis-ui .hcis-action-button.hcis-action-primary:is(:hover,:focus-visible,:active) { background:#244c7a; border-color:#244c7a; }
/* Secondary and destructive action text remains readable in scoped Payroll CSS. */
body.hcis-ui #app-content a:is([class~="text-slate-800"],[class~="text-slate-700"],[class~="text-gray-700"],[class~="text-gray-600"],[class~="text-blue-600"]) { color:#1e3a5f; }
body.hcis-ui #app-content a:is([class~="text-red-600"],[class~="text-red-500"],[class~="text-rose-600"]) { color:#dc2626; }
/* Icon-only actions keep a square target. */
body.hcis-ui #app-content :is(.icon-button,.table-settings-button,.hcis-settings-action,[class~="w-8"][class~="h-8"]):not(.entity-select-trigger):not([role=combobox]) {
    width:32px !important; height:32px !important; min-width:32px; padding:6px !important;
}
body.hcis-ui #app-content :is(button,a):is(:focus-visible) { outline:2px solid #2563eb; outline-offset:2px; }
body.hcis-ui #app-content button:disabled { cursor:not-allowed !important; opacity:.5 !important; }
/* Primary utility buttons also need an explicit surface; module hover rules
   otherwise turn indigo/cyan/gradient actions into white-on-pale buttons. */
body.hcis-ui #app-content :is(button,a).text-white {
    background:#1e3a5f !important; border-color:#1e3a5f !important; color:#fff !important;
}
body.hcis-ui #app-content :is(button,a).text-white:is(:hover,:focus-visible,:active) {
    background:#244c7a !important; border-color:#244c7a !important;
}
body.hcis-ui #app-content :is(button,a).text-white:is([class*="bg-red-"],[class*="bg-rose-"]) {
    background:#b91c1c !important; border-color:#b91c1c !important;
}
body.hcis-ui #app-content :is(button,a).text-white:is([class*="bg-red-"],[class*="bg-rose-"]):is(:hover,:focus-visible,:active) {
    background:#991b1b !important; border-color:#991b1b !important;
}
body.hcis-ui #app-content :is(button,a).text-white:is([class*="bg-green-"],[class*="bg-emerald-"]) {
    background:#15803d !important; border-color:#15803d !important;
}
body.hcis-ui #app-content :is(button,a).text-white:is([class*="bg-green-"],[class*="bg-emerald-"]):is(:hover,:focus-visible,:active) {
    background:#166534 !important; border-color:#166534 !important;
}
/* Table actions are portaled to body by table-actions.js. */
body.hcis-ui .table-action-popup .table-action-item {
    display:flex; align-items:center; width:100%; height:32px; min-height:32px;
    padding:5px 10px; box-sizing:border-box; border-radius:6px;
    font-size:13px; font-weight:600; line-height:20px; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis; box-shadow:none;
}
body.hcis-ui .table-action-popup .table-action-item:focus-visible { outline:2px solid #2563eb; outline-offset:-2px; }
body.hcis-ui input[type=file]::file-selector-button {
    min-height:32px; padding:5px 10px; border:1px solid #1e3a5f;
    border-radius:6px; background:#1e3a5f; color:#fff;
    font-family:inherit; font-size:13px; font-weight:600; line-height:20px; cursor:pointer;
}
body.hcis-ui input[type=file]::file-selector-button:hover { background:#244c7a; border-color:#244c7a; }
/* Login is the standalone page outside the application content shell. */
/* Login actions use their dedicated full-width styles in resources/css/login.css. */
/* Base-layer important declarations outrank legacy Tailwind ! utilities. */
@layer base {
    body.hcis-ui #app-content :is(
        button:not(.entity-select-trigger):not([role=combobox]):not([aria-haspopup]),
        a.button,a.hr-button,a.hcis-action-button,a.btn-primary,a.btn-cancel,a.btn-export,a.ib-action-btn,a.repo-result-btn,a.print-button,a[role=button],a[data-download],
        a[class*="rounded"][class*="px-"],a[title]:has(svg)
    ) {
        display:inline-flex;
        min-height:32px !important; height:32px !important; width:auto !important;
        padding:5px 10px !important; border-radius:6px !important;
        font-size:13px !important; line-height:20px !important; box-shadow:none !important;
        transform:none !important; scale:1 !important;
    }
    body.hcis-ui #app-content :is(.icon-button,.table-settings-button,.hcis-settings-action,[class~="w-8"][class~="h-8"]):not(.entity-select-trigger):not([role=combobox]) {
        width:32px !important; min-width:32px !important; padding:6px !important;
    }
}

/* Hidden/cloaked controls retain their visibility behavior. */
body.hcis-ui #app-content :is(button,a)[hidden],
body.hcis-ui #app-content :is(button,a)[x-cloak] { display:none !important; }
body.hcis-ui .table-action-popup .table-action-item[hidden] { display:none !important; }
body.hcis-ui #app-content :is(button,a).btn-primary {
    background:#1e3a5f; border:1px solid #1e3a5f; color:#fff !important;
}
body.hcis-ui #app-content :is(button,a).btn-primary:is(:hover,:focus-visible,:active) {
    background:#244c7a; border-color:#244c7a; color:#fff !important;
}
body.hcis-ui #app-content :is(button,a).btn-cancel {
    background:#fff; border:1px solid #cbd5e1; color:#1e3a5f;
}
@layer base {
    body.hcis-ui #app-content :is(button,a):has(svg):not(:has(span)):is([class~="p-1.5"],[class~="p-2"]) {
        width:32px !important; min-width:32px !important; padding:6px !important;
    }
}
