.hr-leave-modal {
    inset: 0;
    position: fixed;
    z-index: 10060;
}

.hr-leave-modal[aria-hidden="true"] {
    display: none;
}

.hr-leave-modal__backdrop {
    background: rgba(15, 23, 42, 0.58);
    inset: 0;
    position: absolute;
}

.hr-leave-panel {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
    left: 50%;
    max-height: min(92vh, 920px);
    max-width: 1020px;
    min-height: 560px;
    overflow: hidden;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(94vw, 1020px);
}

.hr-leave-panel__header {
    align-items: flex-start;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 22px 24px 18px;
}

.hr-leave-panel__header h2,
.hr-leave-panel__header p {
    margin: 0;
}

.hr-leave-panel__header h2 {
    color: #111827;
    font-size: 1.35rem;
    line-height: 1.25;
}

.hr-leave-panel__header > div > p:last-child {
    color: #64748B;
    font-size: 0.82rem;
    margin-top: 5px;
}

.hr-leave-panel__eyebrow,
.hr-leave-section-heading__eyebrow {
    color: #0F9F7A;
    font-size: 0.68rem;
    font-weight: 900;
    margin-bottom: 4px !important;
    text-transform: uppercase;
}

.hr-leave-icon-button {
    align-items: center;
    background: #F1F5F9;
    border: 0;
    border-radius: 50%;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.hr-leave-tabs {
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 0 18px;
    scrollbar-width: thin;
}

.hr-leave-tabs button {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    color: #64748B;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.77rem;
    font-weight: 800;
    gap: 7px;
    min-height: 52px;
    padding: 9px 13px;
    white-space: nowrap;
}

.hr-leave-tabs button.is-active {
    border-bottom-color: #F45A32;
    color: #F45A32;
}

.hr-leave-tabs button b {
    align-items: center;
    background: #EF4444;
    border-radius: 999px;
    color: #FFFFFF;
    display: inline-flex;
    font-size: 0.62rem;
    height: 20px;
    justify-content: center;
    min-width: 20px;
    padding: 0 5px;
}

.hr-leave-alert {
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 14px 24px 0;
    padding: 11px 13px;
}

.hr-leave-alert.is-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #047857;
}

.hr-leave-alert.is-danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.hr-leave-loading {
    align-items: center;
    color: #64748B;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    min-height: 360px;
}

.hr-leave-loading[hidden],
.hr-leave-view[hidden],
.hr-leave-tabs button[hidden],
.hr-leave-settings-section[hidden],
.hr-leave-field[hidden] {
    display: none !important;
}

.hr-leave-loading i {
    color: #F45A32;
    font-size: 2rem;
}

.hr-leave-loading p {
    margin: 0;
}

.hr-leave-view {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 26px;
}

.hr-leave-section-heading {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hr-leave-section-heading h3,
.hr-leave-section-heading p {
    margin: 0;
}

.hr-leave-section-heading h3 {
    color: #111827;
    font-size: 1rem;
}

.hr-leave-balance-section,
.hr-leave-list-section,
.hr-leave-settings-section {
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 20px;
}

.hr-leave-list-section,
.hr-leave-settings-section + .hr-leave-settings-section {
    padding-top: 20px;
}

.hr-leave-balance-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hr-leave-balance {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.hr-leave-balance span,
.hr-leave-balance small {
    color: #64748B;
    display: block;
    font-size: 0.68rem;
}

.hr-leave-balance strong {
    color: #0F172A;
    display: block;
    font-size: 1.15rem;
    margin: 5px 0;
}

.hr-leave-request-list,
.hr-leave-approval-list,
.hr-leave-type-list {
    display: grid;
    gap: 10px;
}

.hr-leave-empty {
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
    color: #64748B;
    font-size: 0.78rem;
    margin: 0;
    padding: 22px;
    text-align: center;
}

.hr-leave-request,
.hr-leave-approval,
.hr-leave-type-row {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.hr-leave-request__top,
.hr-leave-approval__top,
.hr-leave-type-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.hr-leave-request h4,
.hr-leave-approval h4,
.hr-leave-type-row h4 {
    color: #111827;
    font-size: 0.88rem;
    margin: 0;
}

.hr-leave-request p,
.hr-leave-approval p,
.hr-leave-type-row p {
    color: #64748B;
    font-size: 0.75rem;
    line-height: 1.45;
    margin: 3px 0 0;
}

.hr-leave-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 5px 8px;
    white-space: nowrap;
}

.hr-leave-status.is-pending {
    background: #FFF7ED;
    color: #C2410C;
}

.hr-leave-status.is-approved {
    background: #ECFDF5;
    color: #047857;
}

.hr-leave-status.is-rejected,
.hr-leave-status.is-cancelled {
    background: #FEF2F2;
    color: #B91C1C;
}

.hr-leave-timeline {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.hr-leave-timeline__step {
    align-items: flex-start;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    gap: 9px;
    min-width: 0;
    padding: 10px;
}

.hr-leave-timeline__dot {
    align-items: center;
    background: #E2E8F0;
    border-radius: 50%;
    color: #475569;
    display: inline-flex;
    flex: 0 0 24px;
    font-size: 0.62rem;
    height: 24px;
    justify-content: center;
}

.hr-leave-timeline__step > div,
.hr-leave-timeline__step strong,
.hr-leave-timeline__step span,
.hr-leave-timeline__step small,
.hr-leave-timeline__step b {
    display: block;
    min-width: 0;
}

.hr-leave-timeline__step strong {
    color: #0F172A;
    font-size: 0.72rem;
}

.hr-leave-timeline__step span,
.hr-leave-timeline__step small {
    color: #64748B;
    font-size: 0.64rem;
    line-height: 1.4;
    margin-top: 2px;
}

.hr-leave-timeline__step.is-approved .hr-leave-timeline__dot {
    background: #D1FAE5;
    color: #047857;
}

.hr-leave-timeline__step.is-rejected .hr-leave-timeline__dot,
.hr-leave-timeline__step.is-overdue .hr-leave-timeline__dot {
    background: #FEE2E2;
    color: #B91C1C;
}

.hr-leave-timeline__step.is-overdue {
    border-color: #FCA5A5;
}

.hr-leave-timeline__step b {
    color: #B91C1C;
    font-size: 0.62rem;
    margin-top: 4px;
}

.hr-leave-request__actions,
.hr-leave-approval__actions,
.hr-leave-form__actions {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.hr-leave-text-button {
    background: transparent;
    border: 0;
    color: #F45A32;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 900;
}

.hr-leave-form {
    display: grid;
    gap: 20px;
}

.hr-leave-form__intro {
    align-items: flex-start;
    background: #ECFDF5;
    border-left: 4px solid #10B981;
    display: flex;
    gap: 12px;
    padding: 14px;
}

.hr-leave-form__intro--warning {
    background: #FFF7ED;
    border-left-color: #F97316;
}

.hr-leave-form__intro > i {
    color: #059669;
    font-size: 1.2rem;
    margin-top: 2px;
}

.hr-leave-form__intro--warning > i {
    color: #EA580C;
}

.hr-leave-form__intro h3,
.hr-leave-form__intro p {
    margin: 0;
}

.hr-leave-form__intro h3 {
    color: #111827;
    font-size: 0.92rem;
}

.hr-leave-form__intro p {
    color: #475569;
    font-size: 0.74rem;
    line-height: 1.5;
    margin-top: 4px;
}

.hr-leave-form__grid,
.hr-leave-inline-form {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-leave-custom-fields {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-leave-field small {
    color: #64748B;
    font-size: 0.65rem;
    line-height: 1.4;
}

.hr-leave-inline-form {
    align-items: end;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 14px;
}

.hr-leave-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.hr-leave-field--wide {
    grid-column: 1 / -1;
}

.hr-leave-field > span,
.hr-leave-check span {
    color: #475569;
    font-size: 0.7rem;
    font-weight: 900;
}

.hr-leave-field > span b {
    color: #DC2626;
}

.hr-leave-field input,
.hr-leave-field select,
.hr-leave-field textarea {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    font-size: 0.8rem;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

.hr-leave-field textarea {
    min-height: 92px;
    resize: vertical;
}

.hr-leave-field input:focus,
.hr-leave-field select:focus,
.hr-leave-field textarea:focus {
    border-color: #F45A32;
    box-shadow: 0 0 0 3px rgba(244, 90, 50, 0.12);
    outline: 0;
}

.hr-leave-check {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    min-height: 42px;
}

.hr-leave-button {
    align-items: center;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 900;
    gap: 7px;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
}

.hr-leave-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.hr-leave-button--primary {
    background: #F45A32;
    color: #FFFFFF;
}

.hr-leave-button--danger {
    background: #B91C1C;
    color: #FFFFFF;
}

.hr-leave-button--ghost {
    background: #F1F5F9;
    color: #475569;
}

.hr-leave-button--approve {
    background: #059669;
    color: #FFFFFF;
}

.hr-leave-button--reject {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

@media (max-width: 760px) {
    .hr-leave-panel {
        border-radius: 0;
        height: 100dvh;
        max-height: none;
        min-height: 0;
        width: 100vw;
    }

    .hr-leave-panel__header {
        padding: 16px;
    }

    .hr-leave-panel__header > div > p:last-child {
        display: none;
    }

    .hr-leave-tabs {
        padding: 0 8px;
    }

    .hr-leave-tabs button {
        min-height: 48px;
        padding: 8px 10px;
    }

    .hr-leave-tabs button span {
        font-size: 0.7rem;
    }

    .hr-leave-view {
        padding: 16px;
    }

    .hr-leave-alert {
        margin: 10px 16px 0;
    }

    .hr-leave-balance-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hr-leave-form__grid,
    .hr-leave-inline-form,
    .hr-leave-custom-fields {
        grid-template-columns: 1fr;
    }

    .hr-leave-field--wide {
        grid-column: auto;
    }

    .hr-leave-request__top,
    .hr-leave-approval__top,
    .hr-leave-type-row {
        align-items: flex-start;
    }

    .hr-leave-form__actions,
    .hr-leave-approval__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
