:root {
    --app-button-border: #a927f9;
    --app-button-text: #a927f9;
    --app-button-bg: #ffffff;
    --app-button-bg-hover: #9106e7;
    --app-button-text-hover: #ffffff;
    --app-button-shadow: 0 3px 8px rgba(169, 39, 249, 0.08);
    --app-button-shadow-hover: 0 4px 10px rgba(145, 6, 231, 0.12);
    --app-button-ring: 0 0 0 0.14rem rgba(169, 39, 249, 0.15);
    --app-button-disabled-bg: #f7f5fb;
    --app-button-disabled-border: #eadffc;
    --app-button-disabled-text: #c0aed8;
    --app-loading-text: #334155;
    --app-loading-muted: #64748b;
    --app-loading-bg: #ffffff;
    --app-loading-border: #dbe4f0;
    --app-loading-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    --app-loading-font-size: 13px;
    --app-loading-title-size: 20px;
    --app-loading-title-weight: 700;
    --app-button-height: 36px;
    --app-button-radius: 11px;
    --app-button-padding-y: 0.34rem;
    --app-button-padding-x: 0.82rem;
    --app-button-font-size: 0.83rem;
    --app-button-gap: 0.28rem;
    --app-button-table-height: 28px;
    --app-button-table-radius: 9px;
    --app-button-table-padding-y: 0.18rem;
    --app-button-table-padding-x: 0.5rem;
    --app-button-table-font-size: 0.75rem;
    --app-button-table-gap: 0.18rem;
}

.btn:not(.btn-close),
a.btn,
input.btn,
input[type="submit"],
input[type="button"],
input[type="reset"],
button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle),
button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle),
button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle),
div.dataTables_wrapper div.dt-buttons .dt-button,
button.dt-button,
a.dt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--app-button-gap);
    min-height: var(--app-button-height);
    padding: var(--app-button-padding-y) var(--app-button-padding-x);
    border: 1px solid var(--app-button-border) !important;
    border-radius: var(--app-button-radius);
    background: var(--app-button-bg) !important;
    color: var(--app-button-text) !important;
    box-shadow: var(--app-button-shadow);
    font-weight: 500;
    font-size: var(--app-button-font-size);
    line-height: 1.2;
    text-decoration: none !important;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
}

.btn:not(.btn-close):hover,
.btn:not(.btn-close):focus,
.btn:not(.btn-close):active,
.btn:not(.btn-close).active,
a.btn:hover,
a.btn:focus,
a.btn:active,
input.btn:hover,
input.btn:focus,
input.btn:active,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="submit"]:active,
input[type="button"]:hover,
input[type="button"]:focus,
input[type="button"]:active,
input[type="reset"]:hover,
input[type="reset"]:focus,
input[type="reset"]:active,
button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):hover,
button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):focus,
button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):active,
button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):hover,
button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):focus,
button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):active,
button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):hover,
button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):focus,
button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):active,
div.dataTables_wrapper div.dt-buttons .dt-button:hover,
div.dataTables_wrapper div.dt-buttons .dt-button:focus,
div.dataTables_wrapper div.dt-buttons .dt-button:active,
button.dt-button:hover,
button.dt-button:focus,
button.dt-button:active,
a.dt-button:hover,
a.dt-button:focus,
a.dt-button:active {
    border-color: var(--app-button-bg-hover) !important;
    background: var(--app-button-bg-hover) !important;
    color: var(--app-button-text-hover) !important;
    box-shadow: var(--app-button-shadow-hover);
}

.btn:not(.btn-close):focus,
a.btn:focus,
input.btn:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):focus,
button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):focus,
button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):focus,
div.dataTables_wrapper div.dt-buttons .dt-button:focus,
button.dt-button:focus,
a.dt-button:focus {
    outline: none;
    box-shadow: var(--app-button-shadow-hover), var(--app-button-ring) !important;
}

.btn:not(.btn-close).disabled,
.btn:not(.btn-close):disabled,
a.btn.disabled,
input.btn:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled,
input[type="reset"]:disabled,
button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):disabled,
button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):disabled,
button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle):disabled,
div.dataTables_wrapper div.dt-buttons .dt-button.disabled,
button.dt-button:disabled,
a.dt-button.disabled {
    border-color: var(--app-button-disabled-border) !important;
    background: var(--app-button-disabled-bg) !important;
    color: var(--app-button-disabled-text) !important;
    box-shadow: none !important;
    transform: none;
    opacity: 1;
}

.btn-sm,
div.dataTables_wrapper div.dt-buttons .dt-button.btn-sm,
button.dt-button.btn-sm,
a.dt-button.btn-sm {
    min-height: 32px;
    padding: 0.28rem 0.66rem;
    border-radius: 10px;
    font-size: 0.79rem;
}

.btn-s,
.btn-xs {
    min-height: 28px;
    padding: 0.18rem 0.48rem;
    border-radius: 9px;
    font-size: 0.75rem;
}

.btn-lg,
div.dataTables_wrapper div.dt-buttons .dt-button.btn-lg,
button.dt-button.btn-lg,
a.dt-button.btn-lg {
    min-height: 40px;
    padding: 0.44rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.btn i,
a.btn i,
button.dt-button i,
a.dt-button i {
    line-height: 1;
}

.btn-sm,
.btn-s,
.btn-xs {
    gap: 0.28rem;
    box-shadow: 0 2px 6px rgba(169, 39, 249, 0.06);
}

/* Keep DataTable actions compact without shrinking non-table form buttons. */
div.dataTables_wrapper .btn:not(.btn-close),
div.dataTables_wrapper a.btn,
div.dataTables_wrapper input.btn,
div.dataTables_wrapper input[type="submit"],
div.dataTables_wrapper input[type="button"],
div.dataTables_wrapper input[type="reset"],
div.dataTables_wrapper button[type="submit"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle),
div.dataTables_wrapper button[type="button"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle),
div.dataTables_wrapper button[type="reset"]:not(.btn-close):not(.swal2-styled):not(.swal-button):not(.toast-close):not(.attm-user-toggle),
div.dataTables_wrapper div.dt-buttons .dt-button,
div.dataTables_wrapper button.dt-button,
div.dataTables_wrapper a.dt-button {
    min-height: var(--app-button-table-height);
    padding: var(--app-button-table-padding-y) var(--app-button-table-padding-x);
    font-size: var(--app-button-table-font-size);
    gap: var(--app-button-table-gap);
    border-radius: var(--app-button-table-radius);
}

div.dataTables_wrapper table .btn.btn-sm,
div.dataTables_wrapper table .btn.btn-xs,
div.dataTables_wrapper table a.btn.btn-sm,
div.dataTables_wrapper table a.btn.btn-xs,
div.dataTables_wrapper table button.btn.btn-sm,
div.dataTables_wrapper table button.btn.btn-xs,
div.dataTables_wrapper table input.btn.btn-sm,
div.dataTables_wrapper table input.btn.btn-xs {
    min-height: 24px;
    padding: 0.12rem 0.38rem;
    font-size: 0.72rem;
    gap: 0.16rem;
    border-radius: 8px;
}

div.dataTables_wrapper table .btn.btn-sm i,
div.dataTables_wrapper table .btn.btn-xs i,
div.dataTables_wrapper table a.btn.btn-sm i,
div.dataTables_wrapper table a.btn.btn-xs i,
div.dataTables_wrapper table button.btn.btn-sm i,
div.dataTables_wrapper table button.btn.btn-xs i {
    font-size: 0.72rem;
}

div.dataTables_wrapper table .btn.btn-sm:not(.btn-block):not(.btn-wide),
div.dataTables_wrapper table .btn.btn-xs:not(.btn-block):not(.btn-wide),
div.dataTables_wrapper table a.btn.btn-sm:not(.btn-block):not(.btn-wide),
div.dataTables_wrapper table a.btn.btn-xs:not(.btn-block):not(.btn-wide),
div.dataTables_wrapper table button.btn.btn-sm:not(.btn-block):not(.btn-wide),
div.dataTables_wrapper table button.btn.btn-xs:not(.btn-block):not(.btn-wide) {
    min-width: 24px;
}

.wo-loading-card,
.tp-emp-loading__card,
.tp-emp-view-loading__card,
div.dataTables_wrapper .dataTables_processing {
    color: var(--app-loading-text);
    font-size: var(--app-loading-font-size);
}

.wo-loading-card,
.tp-emp-loading__card,
.tp-emp-view-loading__card {
    border-color: var(--app-loading-border);
    background: var(--app-loading-bg);
    box-shadow: var(--app-loading-shadow);
}

.wo-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(238, 242, 247, 0.76);
    backdrop-filter: blur(8px);
}

.wo-loading-overlay.is-visible {
    display: flex;
}

.wo-modal-loading-host {
    position: relative;
}

.wo-modal-loading-host .wo-loading-overlay {
    position: absolute;
    border-radius: 0;
}

.wo-loading-card {
    position: relative;
    width: min(420px, 92vw);
    padding: 28px 26px;
    border: 1px solid rgba(19, 35, 67, 0.08);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(0, 186, 195, 0.12), transparent 42%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.96));
    overflow: hidden;
}

.wo-loading-card::before {
    content: "";
    position: absolute;
    inset: auto -24% -42% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43, 155, 240, 0.18), rgba(43, 155, 240, 0));
    pointer-events: none;
}

.wo-loading-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.wo-loading-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(18, 160, 182, 0.1);
    color: #0f6c7e;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wo-loading-spinner {
    position: relative;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(15, 108, 126, 0.12);
    border-top-color: #1698ae;
    border-right-color: #4b79ff;
    animation: wo-loader-spin 1s linear infinite;
}

.wo-loading-spinner::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 3px dashed rgba(75, 121, 255, 0.22);
    animation: wo-loader-spin-reverse 2.4s linear infinite;
}

.wo-loading-spinner::after {
    content: "";
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #18a9bf, #4b79ff);
    box-shadow: 0 0 18px rgba(75, 121, 255, 0.22);
}

.wo-loading-title {
    margin: 0 0 8px;
    color: #17253d;
    line-height: 1.2;
}

.wo-loading-subtitle {
    margin: 0 0 20px;
    line-height: 1.6;
}

.wo-loading-progress {
    position: relative;
    height: 10px;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(24, 169, 191, 0.12);
}

.wo-loading-progress-bar {
    position: absolute;
    inset: 0 auto 0 -35%;
    width: 38%;
    border-radius: inherit;
    background: linear-gradient(90deg, #18a9bf, #4b79ff);
    animation: wo-loader-progress 1.35s ease-in-out infinite;
}

.wo-loading-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.wo-loading-note {
    max-width: 68%;
    line-height: 1.5;
}

.wo-loading-timer {
    white-space: nowrap;
    font-weight: 700;
    color: #17253d;
}

@keyframes wo-loader-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes wo-loader-spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes wo-loader-progress {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(165%);
    }

    100% {
        transform: translateX(330%);
    }
}

.loader-wrapper {
    background: rgba(238, 242, 247, 0.9) !important;
    backdrop-filter: blur(8px);
}

.loader-wrapper::before {
    content: "";
    position: absolute;
    width: min(420px, 92vw);
    height: min(220px, 42vh);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(0, 186, 195, 0.12), transparent 42%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.96));
    border: 1px solid rgba(19, 35, 67, 0.08);
    box-shadow: var(--app-loading-shadow);
}

.loader-wrapper .loader-index {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(15, 108, 126, 0.12);
    border-top-color: #1698ae;
    border-right-color: #4b79ff;
    animation: wo-loader-spin 1s linear infinite;
    filter: none !important;
}

.loader-wrapper .loader-index::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 3px dashed rgba(75, 121, 255, 0.22);
    animation: wo-loader-spin-reverse 2.4s linear infinite;
}

.loader-wrapper .loader-index::after {
    content: "";
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #18a9bf, #4b79ff);
    box-shadow: 0 0 18px rgba(75, 121, 255, 0.22);
}

.loader-wrapper svg {
    display: none;
}

.wo-loading-title {
    font-size: var(--app-loading-title-size);
    font-weight: var(--app-loading-title-weight);
}

.wo-loading-subtitle,
.wo-loading-note,
.wo-loading-timer,
.wo-loading-badge,
.tp-emp-loading__card span,
.tp-emp-view-loading__card span {
    font-size: var(--app-loading-font-size);
}

.wo-loading-subtitle,
.wo-loading-note,
.tp-emp-view-loading__card,
.tp-emp-loading__card {
    color: var(--app-loading-muted);
}
