/* --- SCOPED CSS FOR STOCK AGEING DETAILS DRAWER --- */
.sad-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 */
.sad-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: sadSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    overflow: hidden;
}

@keyframes sadSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
.sad-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 32px 16px 32px;
    border-bottom: 1px solid #f1f5f9;
    background-color: #f8fafc; /* Slight gray tint for header as seen in some variations, or keep white */
    background-color: #ffffff;
    z-index: 10;
}

.sad-header-titles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .sad-header-titles h2 {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
        color: #334155;
    }

.sad-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #dcfce7; /* Light emerald */
    color: #16a34a; /* Emerald text */
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.sad-badge-inline {
    margin-left: 8px;
}

.sad-dot {
    width: 6px;
    height: 6px;
    background-color: #16a34a;
    border-radius: 50%;
}

.sad-close-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

    .sad-close-icon:hover {
        opacity: 0.6;
    }

/* Custom Scrollbar for Body */
.sad-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

    .sad-body::-webkit-scrollbar {
        width: 6px;
    }

    .sad-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .sad-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

        .sad-body::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

/* Sections WITH Green Dividers */
.sad-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d1fae5; /* Very light green line separating sections */
}

    .sad-section:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .sad-section h3 {
        margin: 0 0 4px 0;
        font-size: 14px;
        font-weight: 700;
        color: #059669; /* Emerald Green */
    }

.sad-row {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
}

.sad-label {
    width: 140px; /* Fixed width to align colons perfectly */
    flex-shrink: 0;
    color: #64748b;
    font-weight: 500;
}

.sad-value {
    flex: 1;
    color: #334155;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
}

.sad-val-flex {
    align-items: center;
}

.sad-colon {
    margin-right: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Footer */
.sad-footer {
    padding: 20px 32px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    display: flex;
    justify-content: flex-end;
}

.sad-btn-solid {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #14532d; /* Very dark forest green */
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .sad-btn-solid:hover {
        background-color: #166534;
    }

/* Responsive */
@media (max-width: 480px) {
    .sad-drawer {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }

    .sad-label {
        width: 110px;
    }
}

