/* Base Drawer CSS */
.apd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    justify-content: flex-end;
}

.apd-drawer {
    width: 900px;
    max-width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    margin: 16px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    animation: apdSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    overflow: hidden;
}

@keyframes apdSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.apd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px 20px 32px;
    background-color: #EDF1EF;
    border-bottom: 1px solid #e2e8f0;
    z-index: 10;
    flex-shrink: 0;
}

.apd-header-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .apd-header-titles h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: #1e293b;
    }

    .apd-header-titles p {
        margin: 0;
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
    }

.apd-close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .apd-close-icon:hover {
        opacity: 0.6;
    }

/* Dynamic Badges */
.apd-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 2px;
}

.apd-badge-purple {
    background-color: #F3E8FF;
    color: #7E22CE;
}

.apd-badge-red {
    background-color: #FEE2E2;
    color: #B91C1C;
}

.apd-badge-green {
    background-color: #DCFCE7;
    color: #15803D;
}

.apd-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

    .apd-body::-webkit-scrollbar {
        width: 6px;
    }

    .apd-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .apd-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

.apd-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .apd-section h3 {
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        color: #1e293b;
    }

.apd-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .apd-section-head h3 {
        margin: 0;
    }

/* Stepper Variations */
.apd-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 4px 0;
}

.apd-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.apd-step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
}

.apd-step-active {
    background-color: #14b8a6;
    color: #ffffff;
    border: 3px solid #ccfbf1;
    box-shadow: 0 0 0 1px #99f6e4;
}

.apd-step-pending {
    background-color: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.apd-step-success {
    background-color: #10B981;
    color: #ffffff;
    border: 3px solid #D1FAE5;
}

.apd-step-cyan {
    background-color: #06B6D4;
    color: #ffffff;
    border: 3px solid #CFFAFE;
}

.apd-step-circle svg {
    width: 18px;
    height: 18px;
}

.apd-step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.apd-step-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.apd-step-status {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

.apd-status-review {
    color: #dc2626;
}

.apd-status-success {
    color: #10B981;
}

.apd-status-danger {
    color: #DC2626;
}

.apd-step-connector {
    flex: 1;
    height: 2px;
    background-color: #e2e8f0;
    border-radius: 2px;
    margin: 0 6px;
    position: relative;
    min-width: 30px;
    align-self: center;
}

.apd-connector-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 55%;
    background-color: #ea580c;
    border-radius: 2px;
}

/* Alert Banner Variations */
.apd-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
}

    .apd-alert svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

.apd-alert-warning {
    background-color: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

.apd-alert-success {
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #15803D;
}

.apd-alert-danger {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

/* Static Fields */
.apd-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background-color: #1e293b;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

    .apd-btn-edit svg {
        width: 12px;
        height: 12px;
    }

.apd-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

    .apd-fields-grid.apd-fields-3 {
        grid-template-columns: 1fr 1fr 1.5fr;
    }

.apd-field {
    background-color: #F8F8F8;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .apd-field label {
        font-size: 11px;
        font-weight: 500;
        color: #64748b;
    }

.apd-field-value {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.apd-doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apd-doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.apd-doc-icon {
    width: 36px;
    height: 36px;
    background-color: #eef2ff;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    flex-shrink: 0;
}

    .apd-doc-icon svg {
        width: 18px;
        height: 18px;
    }

.apd-doc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apd-doc-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.apd-doc-status {
    font-size: 11px;
    font-weight: 500;
}

.apd-btn-download {
    padding: 6px 14px;
    background-color: transparent;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.apd-textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    font-size: 13px;
    color: #334155;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

/* State Summary Boxes */
.apd-summary-box {
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid transparent;
}

.apd-box-purple {
    background-color: #F8FAFF;
    border-color: #E0E7FF;
}

    .apd-box-purple .apd-box-title {
        color: #4338CA;
    }

.apd-box-red {
    background-color: #FEF2F2;
    border-color: #FECACA;
}

    .apd-box-red .apd-box-title {
        color: #DC2626;
    }

.apd-box-green {
    background-color: #F0FDF4;
    border-color: #BBF7D0;
}

    .apd-box-green .apd-box-title {
        color: #16A34A;
    }

.apd-box-title {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 700;
}

.apd-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.apd-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .apd-summary-item label {
        font-size: 11px;
        font-weight: 600;
        color: #64748B;
    }

    .apd-summary-item span {
        font-size: 13px;
        font-weight: 700;
        color: #1E293B;
    }

.apd-summary-full {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 12px;
}

    .apd-summary-full label {
        font-size: 11px;
        font-weight: 600;
        color: #64748B;
    }

    .apd-summary-full p {
        margin: 0;
        font-size: 13px;
        font-weight: 700;
        color: #1E293B;
    }

/* Previous Remarks & Payment Details */
.apd-remarks-container {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.apd-remark-block h5 {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 700;
}

.apd-remark-block p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #1E293B;
    font-weight: 600;
}

.apd-remark-block small {
    font-size: 11px;
    color: #94A3B8;
}

.apd-payment-list {
    display: flex;
    flex-direction: column;
}

.apd-payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #E2E8F0;
    font-size: 13px;
}

    .apd-payment-row span {
        color: #64748B;
        font-weight: 500;
    }

    .apd-payment-row strong {
        color: #1E293B;
        font-weight: 700;
    }

/* Footer Buttons */
.apd-footer {
    padding: 18px 32px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.apd-btn-outline {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.apd-btn-action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.apd-btn-reject {
    background-color: transparent;
    color: #dc2626;
    border: 1px solid #ef4444;
}

.apd-btn-validate {
    background-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

/* Reject Modal */
.rm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.rm-container {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
}

.rm-icon-wrapper {
    width: 56px;
    height: 56px;
    background-color: #FEF2F2;
    color: #DC2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

    .rm-icon-wrapper svg {
        width: 28px;
        height: 28px;
    }

.rm-title {
    font-size: 20px;
    font-weight: 700;
    color: #DC2626;
    margin: 0 0 8px 0;
}

.rm-subtitle {
    font-size: 13px;
    color: #475569;
    margin: 0 0 6px 0;
}

.rm-warning {
    font-size: 12px;
    color: #DC2626;
    margin: 0 0 24px 0;
}

.rm-form {
    text-align: left;
}

.rm-form-group {
    margin-bottom: 16px;
}

.rm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.rm-select, .rm-textarea {
    width: 100%;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1E293B;
    outline: none;
}

.rm-textarea {
    min-height: 100px;
    resize: vertical;
}

.rm-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.rm-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.rm-btn-cancel {
    background-color: #FFFFFF;
    color: #334155;
    border: 1px solid #CBD5E1;
}

.rm-btn-reject {
    background-color: #DC2626;
    color: #FFFFFF;
    border: none;
}

