/*
 * Created Date/By: 2026-10-16 / OpenAI for Jonathan Kilburn
 * Description: Manufacturer Review Orders detail-only view and accordions.
 * Modified Date/By: 2026-10-16 / OpenAI for Jonathan Kilburn
 * Mod Description: Hide Results without destroying search/filter state and
 * present existing Order sections as accessible, Clinic-style disclosures.
 *
 * PURPOSE
 * -------
 * A narrowly-scoped UI hotfix on the approved stable Manufacturer Portal.
 * No adjustments to other grids, forms, dashboards or API behavior.
 */

/* The listing is still mounted so the existing search/status selection and
 * result rows can be restored instantly by the Back or Close button. */
#content.nimble-mfg-unified > .portal-table-card.mfg-order-results-is-hidden,
#content.nimble-mfg-unified > .portal-table-card[hidden] {
    display: none !important;
}

/* The always-visible Order heading and compact status cards remain outside
 * the long accordion stack. */
#content.nimble-mfg-unified .mfg-order-detail {
    margin-top: 13px;
    padding: 19px 21px;
    border-color: #d4e5f7;
    border-radius: 13px;
    box-shadow: 0 5px 16px rgba(22, 62, 108, .075);
}
#content.nimble-mfg-unified .mfg-order-detail > .detail-heading {
    margin-bottom: 15px;
    padding-bottom: 12px;
    gap: 11px;
    flex-wrap: wrap;
}
#content.nimble-mfg-unified .mfg-order-detail > .detail-heading h2 {
    color: #11365d;
    font-size: 1.14rem;
    font-weight: 760;
    line-height: 1.3;
}
#content.nimble-mfg-unified .mfg-order-detail > .review-summary-grid {
    margin-bottom: 15px !important;
}
#content.nimble-mfg-unified .mfg-order-detail > .review-summary-grid > div {
    background: #f6faff;
    border-color: #d6e5f7;
}

/* Each original Order section is a native keyboard-accessible details block.
 * Independent expansion is intentional: users can view Order information and
 * invoice/payment forms together without one closing the other. */
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion {
    margin: 0 0 10px;
    padding: 0;
    border: 1px solid #d4e4f6;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(26, 65, 118, .045);
    overflow: hidden;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion:first-of-type {
    border-top: 1px solid #d4e4f6;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 11px 14px;
    margin: 0;
    border: 0;
    background: #f5f9ff;
    color: #153c68;
    list-style: none;
    cursor: pointer;
    user-select: none;
    font-size: .85rem;
    line-height: 1.32;
    font-weight: 740;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary::-webkit-details-marker {
    display: none;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary::marker {
    content: "";
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary:hover {
    background: #ecf4ff;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary:focus-visible {
    outline: 2px solid #1686ef;
    outline-offset: -3px;
    border-radius: 10px;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion[open] > summary {
    border-bottom: 1px solid #d9e9fb;
    background: #edf5ff;
    color: #0e59a6;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary > .bi:first-child {
    display: grid;
    place-items: center;
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e3f0ff;
    color: #0b79e7;
    font-size: 1.04rem;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary h3 {
    display: block;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    color: inherit;
    font-size: .86rem;
    line-height: 1.35;
    font-weight: 755;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion .mfg-order-accordion-chevron {
    flex: 0 0 auto;
    margin-left: auto;
    color: #3977b8;
    font-size: .77rem;
    transition: transform .15s ease;
}
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion[open] .mfg-order-accordion-chevron {
    transform: rotate(180deg);
}
#content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body,
#content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-history > div.mt-3 {
    min-width: 0;
    margin: 0 !important;
    padding: 15px 17px 17px;
}
#content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body > :last-child {
    margin-bottom: 0;
}
#content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body .table-responsive {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid #dfebf8;
    border-radius: 9px;
}
#content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body .form-label {
    color: #385b7d;
    font-size: .76rem;
}
#content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body .mfg-order-action-grid,
#content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body .payment-summary-grid {
    margin-top: 2px;
}
@media (max-width: 767.98px) {
    #content.nimble-mfg-unified .mfg-order-detail {
        padding: 14px 12px;
    }
    #content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-accordion > summary {
        padding: 10px 11px;
    }
    #content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-body,
    #content.nimble-mfg-unified .mfg-order-detail > details.mfg-order-history > div.mt-3 {
        padding: 12px 11px;
    }
}
@media (prefers-reduced-motion: reduce) {
    #content.nimble-mfg-unified .mfg-order-detail .mfg-order-accordion-chevron {
        transition: none;
    }
}
