/* Probation gratuity transactions */

.transactions-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 34px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(125deg, #075d45, #07845f);
    box-shadow: 0 18px 42px rgba(7, 93, 69, 0.18);
    margin-bottom: 20px;
}

.transactions-hero span {
    font-size: 0.78rem;
    color: #caeadf;
}

.transactions-hero h1 {
    margin: 7px 0;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.transactions-hero p {
    margin: 0;
    color: #d9efe8;
}

.transaction-list-card {
    min-height: 430px;
}

.load-more {
    display: block;
    margin: 14px auto;
}

.transaction-form > header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(130deg, #eef8f4, #fff);
    border-bottom: 1px solid var(--border-color);
}

.transaction-form > header span {
    font-size: 0.78rem;
    color: var(--muted-color);
}

.transaction-form > header h2 {
    margin: 5px 0 0;
}

.transaction-form form {
    padding: 22px 28px;
}

.form-stage {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--card-bg);
    margin-bottom: 16px;
}

.stage-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stage-title > b {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    height: 34px;
    border-radius: 12px;
    background: #e2f5ed;
    color: #087858;
}

.stage-title h3 {
    margin: 0;
}

.stage-title p {
    margin: 0;

    font-size: 0.78rem;
    color: var(--muted-color);
    margin-top: 3px;
}

.verified-badge {
    margin-inline-start: auto;
    padding: 7px 10px;
    border-radius: 20px;
    background: #e2f5ed;
    color: #087858;
    font-size: 0.75rem;
}

.employee-lookup {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    padding: 0 14px;
    background: var(--input-bg, #fff);
}

.employee-lookup input {
    width: 100%;
    padding: 13px 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    outline: 0;
}

.employee-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    max-height: 245px;
    overflow: auto;
}

.employee-result {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 10px;
    text-align: start;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--card-bg);
    color: var(--text-color);
}

.employee-result:hover {
    border-color: #15956c;
    background: #effaf6;
}

.employee-result.selected {
    border-color: #15956c;
    background: #effaf6;
}

.employee-result strong {
    display: block;
}

.employee-result small {
    display: block;

    color: var(--muted-color);
    margin-top: 2px;
}

.employee-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #e2f5ed;
    color: #087858;
}

.employee-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.employee-facts article {
    position: relative;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.employee-facts article > i {
    color: #07845f;
}

.employee-facts article span {
    display: block;
}

.employee-facts article strong {
    display: block;
}

.employee-facts article small {
    display: block;
}

.employee-facts article span {
    margin-top: 8px;
    color: var(--muted-color);
    font-size: 0.72rem;
}

.employee-facts article strong {
    margin-top: 4px;
}

.employee-facts article small {
    margin-top: 4px;
    color: var(--muted-color);
}

.evaluation-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 12px;
}

.evaluation-strip > div {
    text-align: center;
    padding: 12px;
    border-radius: 13px;
    background: var(--soft-bg, #f4f7f6);
}

.evaluation-strip span {
    display: block;
}

.evaluation-strip strong {
    display: block;
}

.evaluation-strip span {
    font-size: 0.72rem;
    color: var(--muted-color);
}

.evaluation-strip strong {
    font-size: 1.1rem;
    color: #087858;
    margin-top: 5px;
}

.evaluation-strip .featured {
    background: #e2f5ed;
}

.transaction-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.transaction-inputs label > span {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
}

.transaction-inputs textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg, #fff);
    color: var(--text-color);
    padding: 12px;
}

.transaction-inputs input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg, #fff);
    color: var(--text-color);
    padding: 12px;
}

.transaction-inputs textarea {
    min-height: 95px;
    resize: vertical;
}

.amount-input {
    display: flex;
    align-items: center;
    gap: 7px;
}

.amount-input span {
    font-weight: 700;
    color: var(--muted-color);
}

.transaction-form footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

[data-theme='dark'] .transaction-form > header {
    background: linear-gradient(130deg, #183d33, #14231f);
}

[data-theme='dark'] .employee-avatar {
    background: #183d33;
    color: #79d4b6;
}

[data-theme='dark'] .stage-title > b {
    background: #183d33;
    color: #79d4b6;
}

[data-theme='dark'] .verified-badge {
    background: #183d33;
    color: #79d4b6;
}

[data-theme='dark'] .evaluation-strip .featured {
    background: #183d33;
    color: #79d4b6;
}

@media (max-width: 760px) {
    .transactions-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .transaction-form form {
        padding: 16px;
    }

    .employee-results {
        grid-template-columns: 1fr;
    }

    .employee-facts {
        grid-template-columns: 1fr;
    }

    .transaction-inputs {
        grid-template-columns: 1fr;
    }

    .evaluation-strip {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .evaluation-strip span {
        font-size: 0.62rem;
    }
}

/* Keep the transaction editor contained inside one opaque, scrollable dialog. */

.transaction-modal-backdrop {
    z-index: 1200;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 24px;
}

.transaction-form {
    display: flex;
    flex-direction: column;
    width: min(1600px, calc(100vw - 40px));
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #17211b;
    background: var(--card, #fff);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.transaction-form > header {
    flex: 0 0 auto;
    min-height: 112px;
    padding: 24px 34px;
    padding-inline-end: 90px;
    border-radius: 20px;
}

.transaction-form > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: var(--card, #fff);
}

.transaction-form-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    align-content: start;
    grid-template-columns: minmax(320px, 0.8fr) minmax(560px, 1.7fr);
    gap: 16px;
    padding: 22px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.transaction-form .form-stage {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--card, #fff);
    border-color: var(--line);
}

.transaction-form .employee-select-stage {
    grid-column: 1;
}

.transaction-form .employee-context {
    grid-column: 1 / -1;
}

.transaction-form .form-stage:last-child {
    grid-column: 2;
    grid-row: 1;
}

.transaction-form .stage-title {
    margin-bottom: 12px;
}

.transaction-employee-select > span {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8rem;
    font-weight: 700;
}

.transaction-employee-select .searchable-select {
    width: 100%;
}

.transaction-employee-select .select-trigger {
    width: 100%;

    min-height: 48px;
    color: inherit;
    background: var(--card, #fff);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.transaction-inputs label > span {
    font-weight: 700;
}

.transaction-control {
    display: flex;
    align-items: center;
    min-height: 46px;
    overflow: hidden;
    color: var(--muted);
    background: var(--card, #fff);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.transaction-control:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(23, 107, 67, 0.11);
}

.transaction-control > i {
    flex: 0 0 auto;
    margin-inline: 13px 5px;
    color: var(--green);
    font-size: 1rem;
}

.transaction-inputs .transaction-control input {
    width: 100%;
    margin: 0;
    padding: 11px 9px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: 0;
}

.transaction-inputs .transaction-control textarea {
    width: 100%;
    margin: 0;
    padding: 11px 9px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: 0;
}

.transaction-inputs .textarea-control {
    align-items: flex-start;
}

.transaction-inputs .textarea-control > i {
    margin-top: 13px;
}

.transaction-inputs .textarea-control textarea {
    min-height: 86px;
}

.transaction-control.amount-input > span {
    flex: 0 0 auto;
    margin-inline: 7px 12px;
    font-size: 0.78rem;
}

.compact-load-more {
    margin: 9px 0 0;
    min-height: 34px;
    padding: 6px 11px;
    font-size: 0.72rem;
}

.select-option.select-load-more {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    color: var(--green);
    background: #edf7f1;
    border-top: 1px solid #d9e9df;
    font-weight: 800;
}

html[data-theme='dark'] .select-option.select-load-more {
    color: #c5e77b;
    background: #292143;
    border-color: #4b4368;
}

.transaction-actions {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
    padding: 14px 20px;
    background: var(--card, #fff);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(16, 37, 29, 0.06);
}

.transaction-actions button {
    min-width: 132px;
    min-height: 43px;
    justify-content: center;
}

html[data-theme='dark'] .transaction-form {
    color: #f7f7fb;
    background: #17142f;
}

html[data-theme='dark'] .transaction-form > form {
    color: #f7f7fb;
    background: #17142f;
}

html[data-theme='dark'] .transaction-form .form-stage {
    color: #f7f7fb;
    background: #17142f;
}

html[data-theme='dark'] .transaction-form .employee-result {
    color: #f7f7fb;
    background: #17142f;
}

html[data-theme='dark'] .transaction-actions {
    background: #17142f;
    border-color: #3d365a;
}

html[data-theme='dark'] .transaction-employee-select .select-trigger {
    color: #f7f7fb;
    background: #251e3d;
    border-color: #4b4368;
}

html[data-theme='dark'] .transaction-control {
    color: #f7f7fb;
    background: #251e3d;
    border-color: #4b4368;
}

html[data-theme='dark'] .transaction-control > i {
    color: #b7d86f;
}

/* Salary supplement / recovery form: keep each stage on its own row. */

.salary-adjustment-form .transaction-form-scroll {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    margin-inline: auto;
    padding-block: 26px;
}

.salary-adjustment-form .form-stage {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    margin: 0;
}

.salary-adjustment-form .employee-context {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    margin: 0;
}

.salary-adjustment-form .form-stage:last-child {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    margin: 0;
}

.salary-adjustment-form .salary-identity-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.salary-adjustment-form .salary-identity-fields > label {
    width: 100%;
    min-width: 0;
}

.salary-adjustment-form .salary-identity-fields .searchable-select {
    width: 100%;
    min-width: 0;
}

.salary-adjustment-form .salary-identity-fields .select-trigger {
    width: 100%;
    min-width: 0;
}

.salary-adjustment-form .salary-details-stage {
    margin-top: 0;
}

.salary-adjustment-form .salary-detail-fields {
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.75fr);
    align-items: start;
}

.salary-adjustment-form .salary-detail-fields .textarea-control {
    min-height: 118px;
}

.salary-adjustment-form .salary-detail-fields textarea {
    min-height: 116px;
}

.salary-adjustment-form .salary-detail-fields .amount-input {
    min-height: 52px;
}

.salary-adjustment-form .employee-context {
    padding: 14px 18px;
    background: #f5faf7;
}

.salary-adjustment-form .employee-summary-title {
    margin: 0;
}

.salary-adjustment-form .employee-summary-title > div {
    min-width: 0;
}

.salary-context-label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.7rem;
}

.salary-context-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.78rem;
}

.salary-context-facts span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.salary-context-facts i {
    color: var(--green);
}

html[data-theme='dark'] .salary-adjustment-form .employee-context {
    background: #211b38;
    border-color: #4b4368;
}

html[data-theme='dark'] .salary-context-label {
    color: #c8c2d8;
}

html[data-theme='dark'] .salary-context-facts {
    color: #c8c2d8;
}

@media (max-width: 820px) {
    .salary-adjustment-form .salary-identity-fields {
        grid-template-columns: 1fr;
    }

    .salary-adjustment-form .salary-detail-fields {
        grid-template-columns: 1fr;
    }

    .salary-adjustment-form .transaction-form-scroll {
        padding: 12px;
    }
}

@media (max-width: 760px) {
    .transaction-modal-backdrop {
        padding: 0;
        align-items: stretch;
    }

    .transaction-form {
        width: 100%;
        max-height: 100dvh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .transaction-form-scroll {
        padding: 12px;

        display: block;
    }

    .transaction-actions {
        padding: 12px;
    }

    .transaction-actions button {
        min-width: 0;
        flex: 1;
    }
}

#pageHost .transaction-form > header {
    border-radius: 17px 17px 0 0;
    padding: 14px 20px;
}

#pageHost .transaction-form > :last-child {
    border-end-start-radius: 17px;
    border-end-end-radius: 17px;
}
