/* --- SCOPED CSS FOR RECORD DETAILS DRAWER --- */
.rd-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;
}

/* Floating Drawer Design */
.rd-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: rdSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    overflow: hidden;
}

@keyframes rdSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
.rd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px 20px 32px;
    border-bottom: 1px solid #f1f5f9;
    background-color: #ffffff;
    z-index: 10;
}

.rd-header-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

    .rd-header-titles h2 {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
        color: #1e293b;
    }

.rd-pill-solid-purple {
    background-color: #ede9fe; /* Light purple */
    color: #7c3aed; /* Deep purple */
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.rd-close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .rd-close-icon:hover {
        opacity: 0.6;
    }

/* Custom Scrollbar for Body */
.rd-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Reduced gap to accommodate padding-bottom of sections */
}

    .rd-body::-webkit-scrollbar {
        width: 6px;
    }

    .rd-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .rd-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

        .rd-body::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

/* Sections WITH Green Dividers */
.rd-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d1fae5; /* Very light green line separating sections */
}

    .rd-section:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .rd-section h3 {
        margin: 0 0 4px 0;
        font-size: 14px;
        font-weight: 700;
        color: #16a34a; /* Distinct Green Header */
    }

.rd-row {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
}

.rd-label {
    width: 170px; /* Fixed width to align colons perfectly */
    flex-shrink: 0;
    color: #64748b;
    font-weight: 500;
}

.rd-value {
    flex: 1;
    color: #334155;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
}

.rd-val-flex {
    align-items: center;
}

.rd-colon {
    margin-right: 16px;
    color: #64748b;
    font-weight: 500;
}

.rd-pill-outline-purple {
    background-color: #ffffff;
    border: 1px solid #ddd6fe;
    color: #7c3aed;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-left: 2px;
}

/* Red Alert Box */
.rd-alert-box {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rd-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
}

.rd-alert-text {
    font-size: 13px;
    color: #475569;
    padding-left: 26px; /* Aligns with text, ignoring icon width */
    line-height: 1.6;
}

/* Footer */
.rd-footer {
    padding: 20px 32px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.rd-btn-outline {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .rd-btn-outline:hover {
        background-color: #f8fafc;
        border-color: #94a3b8;
        color: #334155;
    }

.rd-btn-solid {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #14532d; /* Very dark forest green */
    color: #ffffff;
    border: 1px solid #14532d;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .rd-btn-solid:hover {
        background-color: #166534;
    }

/* Responsive */
@media (max-width: 580px) {
    .rd-drawer {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }

    .rd-label {
        width: 120px;
    }

    .rd-footer {
        flex-direction: column-reverse;
    }

    .rd-btn-outline, .rd-btn-solid {
        width: 100%;
        justify-content: center;
    }
}

