/* --- SCOPED CSS FOR DRAWER --- */
.dd-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;
}

.dd-drawer {
    width: 520px;
    max-width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Custom Scrollbar for Drawer */
.dd-body::-webkit-scrollbar {
    width: 6px;
}

.dd-body::-webkit-scrollbar-track {
    background: transparent;
}

.dd-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

    .dd-body::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* Header (Sticky) */
.dd-header {
    position: sticky;
    top: 0;
    background-color: #ffffff;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid #f3f4f6;
    z-index: 10;
}

.dd-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: opacity 0.2s;
}

    .dd-back-btn:hover {
        opacity: 0.6;
    }

.dd-header-text h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.dd-header-text p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Body Container */
.dd-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Top Info Cards (Subtle Gradients) */
.dd-info-card {
    background: linear-gradient(145deg, #ffffff 0%, #f4fdf8 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.dd-full-width {
    width: 100%;
}

.dd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* IMAGE SIZING CLASSES (FIXED) */
.dd-avatar-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.dd-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dd-avatar-fallback {
    width: 100%;
    height: 100%;
}

/* Used for icons inside the small colored square boxes */
.dd-box-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Used for the standalone Settings/Gear icon next to the section title */
.dd-section-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.dd-info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dd-label {
    font-size: 13px;
    color: #9ca3af;
}

.dd-value {
    font-size: 16px;
    font-weight: 600;
}

/* Icon Boxes */
.dd-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dd-bg-purple-light {
    background-color: #f8f5ff;
}

.dd-bg-green-light {
    background-color: #ecfdf5;
}

.dd-text-green {
    color: #047857;
}

/* Section Title */
.dd-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: -4px;
}

    .dd-section-title h3 {
        margin: 0;
        font-size: 17px;
        font-weight: 600;
        color: #064e3b;
    }

/* Metric Cards with Colored Gradients */
.dd-metric-card {
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.dd-card-blue {
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid #dbeafe;
}

.dd-card-purple {
    background: linear-gradient(145deg, #ffffff 0%, #faf5ff 100%);
    border: 1px solid #f3e8ff;
}

.dd-card-green {
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid #dcfce7;
}

.dd-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dd-metric-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Colored Metric Backgrounds & Texts */
.dd-bg-blue {
    background-color: #e0f2fe;
}

.dd-bg-purple {
    background-color: #f3e8ff;
}

.dd-bg-green {
    background-color: #d1fae5;
}

.dd-metric-title {
    font-size: 16px;
    font-weight: 600;
}

.dd-title-blue {
    color: #1e3a8a;
}

.dd-title-purple {
    color: #4c1d95;
}

.dd-title-green {
    color: #064e3b;
}

.dd-metric-value {
    font-size: 22px;
    font-weight: 700;
}

.dd-value-blue {
    color: #2563eb;
}

.dd-value-purple {
    color: #9333ea;
}

.dd-badge-eligible {
    background-color: #d1fae5;
    color: #047857;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.dd-metric-desc {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

/* Scheme Participation Bottom Card */
.dd-participation-card {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-top: 8px;
    margin-bottom: 24px;
}

    .dd-participation-card h4 {
        margin: 0 0 20px 0;
        font-size: 16px;
        font-weight: 600;
        color: #064e3b;
    }

.dd-participation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dd-part-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dd-part-label {
    font-size: 14px;
    color: #9ca3af;
}

.dd-part-value {
    font-size: 17px;
    font-weight: 700;
    color: #047857;
}

/* Responsive */
@media (max-width: 480px) {
    .dd-info-grid {
        grid-template-columns: 1fr;
    }

    .dd-drawer {
        width: 100vw;
    }

    .dd-header, .dd-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}

