:root {
    --tce-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --tce-fast: 0.15s;
    --tce-base: 0.22s;
    --tce-slow: 0.35s;
}

html {
    scroll-behavior: smooth;
}

.tce-preload *,
.tce-preload *::before,
.tce-preload *::after {
    transition: none !important;
}

a,
button,
summary,
input,
select,
textarea,
.action-btn,
.link-btn,
.danger-btn,
.disabled-btn,
.icon-btn,
.sidebar-clock-btn,
.asset-count-pill,
.filter-form a,
.card,
.dashboard-card,
.lo-card,
.stat-link,
.status-badge {
    transition:
        background-color var(--tce-base) var(--tce-ease),
        color var(--tce-base) var(--tce-ease),
        border-color var(--tce-base) var(--tce-ease),
        box-shadow var(--tce-base) var(--tce-ease),
        transform var(--tce-fast) var(--tce-ease),
        opacity var(--tce-base) var(--tce-ease);
}

.action-btn:hover,
.filter-form button:hover,
.employee-form button:hover,
.inline-review-form button:hover,
button[type="submit"]:hover,
.sidebar-clock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -10px rgba(7, 17, 39, 0.55);
}

.action-btn:active,
button:active,
.link-btn:active,
.danger-btn:active,
.disabled-btn:active {
    transform: translateY(0) scale(0.97);
}

.icon-btn:hover {
    transform: translateY(-1px);
}

.icon-btn:active {
    transform: scale(0.92);
}

.card:hover,
.dashboard-card:hover,
.lo-card:hover,
.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -18px rgba(7, 17, 39, 0.45);
}

.asset-count-pill:hover {
    transform: translateY(-1px);
}

.sidebar-menu a {
    transition:
        background-color var(--tce-base) var(--tce-ease),
        color var(--tce-base) var(--tce-ease),
        transform var(--tce-fast) var(--tce-ease);
}

.sidebar-menu a:hover {
    transform: translateX(3px);
}

.sidebar-menu a:active {
    transform: translateX(1px);
}

.data-table tr {
    transition: background-color var(--tce-fast) var(--tce-ease);
}

.data-table tr:hover {
    background-color: rgba(47, 111, 237, 0.06);
}

body.dark-mode .data-table tr:hover {
    background-color: rgba(138, 180, 248, 0.10);
}

:focus-visible {
    outline: 2px solid rgba(47, 111, 237, 0.55);
    outline-offset: 2px;
}

.success-message,
.error-message {
    animation: tceSlideDown var(--tce-base) var(--tce-ease) both;
}

details > *:not(summary) {
    animation: tceFade var(--tce-base) var(--tce-ease) both;
}

.notification-item,
.tce-glogin__card {
    animation: tceRise var(--tce-slow) var(--tce-ease) both;
}

.tce-glogin__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -12px rgba(7, 17, 39, 0.6);
}

.tce-glogin__submit:active {
    transform: translateY(0) scale(0.98);
}

@keyframes tceRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tceFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tceSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tceSpin {
    to {
        transform: rotate(360deg);
    }
}

.tce-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(47, 111, 237, 0.25);
    border-top-color: rgba(47, 111, 237, 0.9);
    border-radius: 50%;
    animation: tceSpin 0.7s linear infinite;
    vertical-align: middle;
}

.is-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity var(--tce-base) var(--tce-ease);
}

.tce-datewrap {
    position: relative;
    display: block;
}

.tce-datewrap .tce-dateproxy {
    width: 100%;
    padding-right: 38px;
}

.tce-datehidden {
    position: absolute;
    left: 12px;
    bottom: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.tce-datebtn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.tce-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 17, 39, 0.55);
    opacity: 0;
    transition: opacity var(--tce-base) var(--tce-ease);
}

.tce-modal-overlay[hidden] {
    display: none !important;
}

.tce-modal-overlay {
    pointer-events: none;
}

.tce-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.tce-modal {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    color: #14203a;
    border: 1px solid #e1e6f0;
    border-radius: 18px;
    padding: 26px 26px 22px;
    box-shadow: 0 30px 70px -30px rgba(7, 17, 39, 0.65);
    text-align: center;
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    transition: transform var(--tce-base) var(--tce-ease), opacity var(--tce-base) var(--tce-ease);
}

.tce-modal-overlay.is-open .tce-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.tce-modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2F6FED;
    background: rgba(47, 111, 237, 0.12);
}

.tce-modal-icon svg {
    width: 26px;
    height: 26px;
}

.tce-modal--danger .tce-modal-icon {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.12);
}

.tce-modal-title {
    font-family: "Archivo", sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #14203a;
}

.tce-modal-message {
    font-size: 14px;
    line-height: 1.55;
    color: #4d5668;
    margin: 0 0 22px;
}

.tce-modal-input-wrap {
    display: block;
    margin: 0 0 20px;
    text-align: left;
}

.tce-modal-input-wrap[hidden] {
    display: none;
}

.tce-modal-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d3d8e8;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
    color: #14203a;
    background: #ffffff;
}

.tce-modal-input:focus {
    outline: none;
    border-color: #2F6FED;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18);
}

.tce-modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.tce-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tce-modal-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-width: 108px;
    transition: background-color var(--tce-fast) var(--tce-ease), transform var(--tce-fast) var(--tce-ease), box-shadow var(--tce-fast) var(--tce-ease);
}

.tce-modal-btn:active {
    transform: translateY(0) scale(0.97);
}

.tce-modal-btn--ghost {
    background: #eef1f8;
    color: #34405a;
    border-color: #dfe4f0;
}

.tce-modal-btn--ghost:hover {
    background: #e2e7f3;
}

.tce-modal-btn--primary {
    background: #2F6FED;
    color: #ffffff;
}

.tce-modal-btn--primary:hover {
    background: #1f5fe0;
    box-shadow: 0 10px 22px -12px rgba(47, 111, 237, 0.8);
}

.tce-modal-btn--danger {
    background: #DC2626;
    color: #ffffff;
}

.tce-modal-btn--danger:hover {
    background: #c11f1f;
    box-shadow: 0 10px 22px -12px rgba(220, 38, 38, 0.8);
}

body.dark-mode .tce-modal {
    background: #0f1b33;
    color: #eaf0fb;
    border-color: #24314f;
}

body.dark-mode .tce-modal-title {
    color: #eaf0fb;
}

body.dark-mode .tce-modal-message {
    color: #aab6d0;
}

body.dark-mode .tce-modal-input {
    background: #0b1526;
    color: #eaf0fb;
    border-color: #2d3c5e;
}

body.dark-mode .tce-modal-btn--ghost {
    background: #1c2947;
    color: #cdd7ec;
    border-color: #2d3c5e;
}

body.dark-mode .tce-modal-btn--ghost:hover {
    background: #243356;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
