/* ── Overlay & Drawer ── */
.apd-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: flex;
    justify-content: flex-end;
}

.apd-drawer {
    width: 55%;
    max-width: 55%;
    height: 100vh;
    background-color: #ffffff;
    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;
    }
}

/* ── Header ── */
.apd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 28px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.apd-header-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .apd-header-titles h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #111827;
    }

    .apd-header-titles p {
        margin: 0;
        font-size: 12px;
        font-weight: 500;
        color: #9ca3af;
    }

.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;
    }

/* ── Body ── */
.apd-body {
    padding: 20px 28px 28px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

    .apd-body::-webkit-scrollbar {
        width: 6px;
    }

    .apd-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .apd-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

/* ── Section ── */
.apd-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .apd-section h3 {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }

/* ── Alerts ── */
.apd-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

    .apd-alert svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

.apd-alert-success {
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

/* ── Field Grid (Card style) ── */
.apd-fields-grid {
    display: grid;
    gap: 12px;
}

.apd-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.apd-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.apd-field {
    background-color: #F8FAFC;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 64px;
}

    .apd-field label {
        font-size: 11px;
        font-weight: 500;
        color: #6b7280;
    }

.apd-field-value {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

    .apd-field-value.apd-text-accent {
        color: #05199A;
    }

/* ── Badges ── */
.apd-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
}

.apd-badge-green {
    background-color: #DCFCE7;
    color: #15803D;
}

.apd-badge-blue {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* ── Vertical Timeline ── */
.apd-vtimeline {
    display: flex;
    flex-direction: column;
    padding-left: 4px;
}

.apd-vstep {
    display: flex;
    gap: 14px;
    position: relative;
}

.apd-vstep-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.apd-vstep-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
}

.apd-vstep-done {
    background-color: #DCFCE7;
    border: 2px solid #22C55E;
    color: #16A34A;
}

    .apd-vstep-done svg {
        width: 14px;
        height: 14px;
        color: #16A34A;
    }

.apd-vstep-pending {
    background-color: #F3F4F6;
    border: 2px solid #D1D5DB;
}

.apd-vstep-line {
    width: 2px;
    flex-grow: 1;
    min-height: 24px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.apd-vline-done {
    background-color: #86EFAC;
}

.apd-vstep-content {
    flex-grow: 1;
    padding-bottom: 18px;
    padding-top: 2px;
}

.apd-vstep:last-child .apd-vstep-content {
    padding-bottom: 0;
}

.apd-vstep-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.apd-vstep-sub {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.apd-vstep-time {
    font-size: 11px;
    color: #9ca3af;
}

/* ── Documents ── */
.apd-doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apd-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.apd-doc-icon {
    width: 36px;
    height: 36px;
    background-color: #EEF2FF;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.apd-doc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apd-doc-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.apd-doc-status {
    font-size: 11px;
    font-weight: 500;
    color: #16A34A;
}

.apd-btn-download {
    padding: 6px 14px;
    background-color: #ffffff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .apd-btn-download:hover {
        background-color: #EEF2FF;
    }

/* ── Footer ── */
.apd-footer {
    padding: 16px 28px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.apd-btn-outline {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

    .apd-btn-outline:hover {
        background-color: #f9fafb;
    }

.apd-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.apd-btn-validate {
    background-color: #3372CF;
    color: #ffffff;
}

    .apd-btn-validate:hover {
        background-color: #1d4ed8;
    }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .apd-drawer {
        width: 75%;
        max-width: 75%;
    }

    .apd-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .apd-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .apd-drawer {
        width: 100%;
        max-width: 100%;
    }

    .apd-cols-3, .apd-cols-4 {
        grid-template-columns: 1fr;
    }

    .apd-header {
        padding: 16px 18px;
    }

    .apd-body {
        padding: 16px 18px;
    }

    .apd-footer {
        padding: 14px 18px;
    }
}
