/* --- SCOPED CSS FOR SALES DETAILS DRAWER --- */
.sd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4); /* Dark backdrop */
    z-index: 9998;
    display: flex;
    justify-content: flex-end;
}

/* Floating Drawer Design */
.sd-drawer {
    width: 440px;
    max-width: calc(100vw - 32px);
    height: calc(100vh - 32px); /* Floats off the top and bottom */
    margin: 16px; /* Floats off the right edge */
    background-color: #ffffff;
    border-radius: 16px; /* Rounded on all sides */
    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: sdSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    overflow: hidden;
}

@keyframes sdSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
.sd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px 16px 28px;
    border-bottom: 1px solid #f1f5f9;
    background-color: #ffffff;
    z-index: 10;
}

.sd-header-titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .sd-header-titles h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: #1e293b;
    }

.sd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #dcfce7; /* Light emerald */
    color: #059669; /* Deep emerald */
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.sd-badge-inline {
    margin-left: 8px;
}

.sd-dot {
    width: 6px;
    height: 6px;
    background-color: #059669;
    border-radius: 50%;
}

.sd-close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .sd-close-icon:hover {
        opacity: 0.6;
    }

/* Custom Scrollbar for Body */
.sd-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Reduced gap to account for padding-bottom in sections */
}

    .sd-body::-webkit-scrollbar {
        width: 6px;
    }

    .sd-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .sd-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

        .sd-body::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

/* Sections WITH Green Dividers */
.sd-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d1fae5; /* Very light green line separating sections */
}

    .sd-section:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .sd-section h3 {
        margin: 0 0 4px 0;
        font-size: 14px;
        font-weight: 700;
        color: #059669; /* Emerald Green */
    }

.sd-row {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
}

.sd-label {
    width: 140px; /* Fixed width to align colons perfectly */
    flex-shrink: 0;
    color: #64748b;
    font-weight: 500;
}

.sd-value {
    flex: 1;
    color: #334155;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
}

.sd-val-flex {
    align-items: center;
}

.sd-colon {
    margin-right: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Footer */
.sd-footer {
    padding: 20px 28px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-end;
}

.sd-btn-close {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #064e3b; /* Very dark green */
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .sd-btn-close:hover {
        background-color: #022c22;
    }

/* Responsive */
@media (max-width: 480px) {
    .sd-drawer {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }

    .sd-label {
        width: 110px;
    }
}

