/* --- SCOPED CSS FOR CSR-1 PROGRAM DETAILS DRAWER --- */
.csr-pd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: flex;
    justify-content: flex-end;
}

.csr-pd-drawer {
    width: 440px;
    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', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: csrPdSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    overflow: hidden;
}

@keyframes csrPdSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
.csr-pd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px 18px 32px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    z-index: 10;
}

.csr-pd-header-titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .csr-pd-header-titles h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: #334155;
    }

    .csr-pd-header-titles p {
        margin: 0;
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
    }

.csr-pd-close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .csr-pd-close-icon:hover {
        opacity: 0.6;
    }

/* Body & Scrollbar */
.csr-pd-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

    .csr-pd-body::-webkit-scrollbar {
        width: 6px;
    }

    .csr-pd-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .csr-pd-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

        .csr-pd-body::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

/* Sections */
.csr-pd-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .csr-pd-section h3 {
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        color: #10b981;
    }

/* Info Box Wrappers */
.csr-pd-info-box {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Row Layouts */
.csr-pd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    line-height: 1.4;
    padding: 0; /* Box gap handles spacing now */
}

.csr-pd-label {
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.csr-pd-value {
    color: #1e293b;
    font-weight: 600;
    text-align: right;
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.csr-pd-font-bold {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

/* Total Expense Row */
.csr-pd-expense-total {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

    .csr-pd-expense-total .csr-pd-label {
        font-weight: 700;
        color: #1e293b;
    }

    .csr-pd-expense-total .csr-pd-value {
        font-size: 14px;
        font-weight: 700;
        color: #0f172a;
    }

/* Approved Badge */
.csr-pd-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.csr-pd-badge-approved {
    background-color: #d1fae5;
    color: #059669;
}

/* Focus Areas Pills */
.csr-pd-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.csr-pd-pill-green {
    background-color: #d1fae5;
    color: #059669;
}

.csr-pd-pill-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

/* Timeline Styling */
.csr-pd-timeline {
    display: flex;
    flex-direction: column;
    padding-left: 4px;
    margin-top: 4px;
}

.csr-pd-tl-item {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 28px;
}

    .csr-pd-tl-item:last-child {
        padding-bottom: 0;
    }

.csr-pd-tl-line {
    position: absolute;
    top: 24px;
    bottom: 0;
    left: 11px;
    width: 2px;
    background-color: #10b981;
    z-index: 1;
}

.csr-pd-tl-item:last-child .csr-pd-tl-line {
    display: none;
}

.csr-pd-tl-icon {
    position: relative;
    z-index: 2;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #10b981;
    flex-shrink: 0;
}

.csr-pd-tl-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

    .csr-pd-tl-content h4 {
        margin: 0;
        font-size: 13px;
        font-weight: 700;
        color: #1e293b;
    }

.csr-pd-tl-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.csr-pd-date-pill {
    background-color: #334155;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

/* Footer Buttons */
.csr-pd-footer {
    padding: 16px 32px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    gap: 12px;
}

.csr-pd-btn-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
    color: #ffffff;
    border: none;
}

.csr-pd-btn-dark {
    background-color: #334155;
}

    .csr-pd-btn-dark:hover {
        background-color: #1e293b;
    }

.csr-pd-btn-green {
    background-color: #166534;
}

    .csr-pd-btn-green:hover {
        background-color: #14532d;
    }

.csr-pd-btn-blue {
    background-color: #2563eb;
}

    .csr-pd-btn-blue:hover {
        background-color: #1d4ed8;
    }

/* Responsive */
@media (max-width: 480px) {
    .csr-pd-drawer {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }

    .csr-pd-footer {
        flex-direction: column;
        padding: 16px 24px;
        gap: 12px;
    }

    .csr-pd-btn-action {
        width: 100%;
    }

    .csr-pd-body {
        padding: 24px;
    }

    .csr-pd-header {
        padding: 20px 24px;
    }
}

