* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(217, 15, 140, 0.28);
    outline-offset: 2px;
}

.mobile-nav-toggle,
.nav-backdrop {
    display: none;
}

.sidebar a.active {
    background: #d90f8c;
}

.sidebar a {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

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

.page {
    min-height: 100vh;
}

.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 20;
    width: 240px !important;
    height: 100vh !important;
    padding: 24px 20px !important;
    overflow: hidden !important;
    border-radius: 0 20px 20px 0 !important;
}

.sidebar a {
    line-height: 1.2;
}

.content {
    min-width: 0;
    margin-left: 240px;
}

input,
select,
textarea {
    max-width: 100%;
}

.file-upload-input {
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    width: 1px !important;
}

.file-upload-control {
    align-items: center;
    background-color: #ffdf00;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(255, 223, 0, 0.28), 0 2px 4px -1px rgba(255, 223, 0, 0.18);
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 0.75rem;
    justify-content: center;
    line-height: 1rem;
    padding: 0.75rem 1.5rem;
    text-align: center;
    text-transform: uppercase;
    transition: box-shadow 0.6s ease, opacity 0.6s ease, transform 0.2s ease;
    user-select: none;
    vertical-align: middle;
    width: fit-content;
}

.file-upload-control:hover {
    box-shadow: 0 10px 15px -3px rgba(255, 223, 0, 0.45), 0 4px 6px -2px rgba(255, 223, 0, 0.18);
}

.file-upload-control:active {
    box-shadow: none;
    opacity: 0.85;
}

.file-upload-control.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.file-upload-control svg {
    height: 1.25rem;
    width: 1.25rem;
}

.file-upload-input:focus-visible + .file-upload-name,
.file-upload-control:focus-visible {
    outline: 3px solid rgba(255, 223, 0, 0.36);
    outline-offset: 2px;
}

.file-upload-name {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 8px 0 0;
    word-break: break-word;
}

.password-field-wrap {
    position: relative;
    width: 100%;
}

.password-field-wrap input {
    width: 100%;
    padding-right: 48px !important;
}

.flip-card__form .password-field-wrap {
    width: 250px;
}

.flip-card__form--register .password-field-wrap {
    width: 250px;
}

.password-toggle {
    --password-toggle-color: #a5a5b0;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--password-toggle-color);
    fill: var(--password-toggle-color);
    font-size: 22px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    box-shadow: none !important;
    margin: 0 !important;
}

.flip-card__form .password-toggle {
    width: 34px !important;
    height: 34px !important;
}

.password-toggle:hover {
    background: #f3f4f6;
}

.password-toggle svg {
    position: absolute;
    animation: password-toggle-fill 0.25s ease;
}

.password-toggle .password-eye-slash,
.password-toggle.is-visible .password-eye {
    display: none;
}

.password-toggle.is-visible .password-eye-slash {
    display: block;
}

@keyframes password-toggle-fill {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pagination-wrap {
    margin-top: 18px;
    font-family: Arial, sans-serif;
}

.pagination-wrap svg {
    display: block;
    width: 20px;
    height: 20px;
}

.pagination-wrap nav > div:first-child {
    display: none;
}

.pagination-wrap nav > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-wrap nav > div:last-child > div:first-child {
    color: #6b7280;
    font-size: 14px;
}

.pagination-wrap nav > div:last-child > div:last-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-wrap a,
.pagination-wrap span[aria-current="page"] span,
.pagination-wrap span[aria-disabled="true"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
}

.pagination-wrap a:hover {
    border-color: #d90f8c;
    color: #d90f8c;
}

.pagination-wrap span[aria-current="page"] span {
    border-color: #d90f8c;
    background: #d90f8c;
    color: #fff;
}

.pagination-wrap span[aria-disabled="true"] span {
    color: #9ca3af;
    background: #f3f4f6;
}

@media (max-width: 980px) {
    .content {
        padding: 24px;
    }

    .cuti-card,
    .sisa-cuti-card,
    .profile-panel,
    .form-panel,
    .summary-panel,
    .table-panel {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 760px) {
    body.nav-open {
        overflow: hidden;
    }

    .mobile-nav-toggle {
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 70;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 8px;
        background: #1f2937;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 10px 22px rgba(17, 24, 39, 0.22);
    }

    .mobile-nav-toggle span,
    .mobile-nav-toggle::before,
    .mobile-nav-toggle::after {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition: transform 0.2s ease, opacity 0.2s ease;
        content: "";
    }

    .mobile-nav-toggle {
        flex-direction: column;
        gap: 5px;
    }

    body.nav-open .mobile-nav-toggle::before {
        transform: translateY(7px) rotate(45deg);
    }

    body.nav-open .mobile-nav-toggle span {
        opacity: 0;
    }

    body.nav-open .mobile-nav-toggle::after {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 45;
        display: block;
        pointer-events: none;
        background: rgba(17, 24, 39, 0);
        transition: background-color 0.2s ease;
    }

    body.nav-open .nav-backdrop {
        pointer-events: auto;
        background: rgba(17, 24, 39, 0.45);
    }

    .page {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed !important;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(82vw, 300px) !important;
        height: 100dvh !important;
        padding: 72px 16px 24px !important;
        border-radius: 0 18px 18px 0 !important;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        box-shadow: 18px 0 34px rgba(17, 24, 39, 0.22);
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-logo {
        width: 132px;
    }

    .content {
        width: 100%;
        margin-left: 0 !important;
        padding: 76px 16px 24px !important;
    }

    .welcomeword {
        position: static !important;
        gap: 12px;
        padding: 14px !important;
        margin-bottom: 18px !important;
    }

    .welcomeword h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .logout-button,
    .save-button,
    .search-button,
    .create-button,
    .reset-search,
    .secondary-button {
        min-height: 44px;
    }

    .cuti-card,
    .sisa-cuti-card {
        width: 100% !important;
    }

    .cuti-progress {
        width: 100% !important;
    }

    .table-panel {
        padding: 16px !important;
    }

    table {
        min-width: 720px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 100dvh;
        padding: 16px;
    }

    .flip-card__inner {
        width: min(300px, calc(100vw - 32px)) !important;
        margin: 0 auto;
    }

    .flip-card__front,
    .flip-card__back {
        width: 100% !important;
    }

    .flip-card__input {
        width: 100% !important;
    }

    .flip-card__form .password-field-wrap {
        width: 100% !important;
    }

    .notice,
    .error {
        top: 16px !important;
        width: calc(100vw - 32px) !important;
        max-width: 340px;
    }
}

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