/*
 * Created Date/By: 2026-10-16 / OpenAI for Jonathan Kilburn
 * Description: Application-wide Manufacturer Portal visual alignment.
 * Modified Date/By: 2026-10-16 / OpenAI for Jonathan Kilburn
 * Mod Description: Reuse approved Nimble Dashboard and Clinic Management palette
 * across authenticated review queues, forms, tables, metrics, and administration.
 *
 * PURPOSE
 * -------
 * Match the Clinic visual standard without replacing Manufacturer workflow
 * authorization, form fields, onclick handlers, API requests or table content.
 * Scope styling beneath #content.nimble-mfg-unified; preserve the existing
 * branded dashboard hero, specialized analytics charts and auth screens.
 */
#content.nimble-mfg-unified {
    --unified-ink: #112f56;
    --unified-muted: #526d8d;
    --unified-line: #d6e4f6;
    --unified-blue: #0b74de;
    --unified-soft: #edf5ff;
    --unified-elevation: 0 5px 16px rgba(22, 62, 108, .075);
    min-width: 0;
    color: var(--unified-ink);
    font-size: .86rem;
    line-height: 1.48;
}
#content.nimble-mfg-unified .page-heading-wrap {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    min-height: 133px;
    margin: 0 0 19px;
    padding: 35px 27px 20px;
    border: 1px solid rgba(57, 136, 225, .44);
    border-radius: 13px;
    background:
        radial-gradient(ellipse at 69% 4%, #0e62c4 0%, transparent 56%),
        linear-gradient(112deg, #06264a, #0e3f80 58%, #062c60);
    color: #fff;
    box-shadow: 0 7px 19px rgba(11, 53, 104, .16);
}
#content.nimble-mfg-unified .page-heading-wrap::before {
    content: "MANUFACTURER PORTAL";
    position: absolute;
    z-index: 1;
    top: 15px;
    left: 27px;
    color: #bcdfff;
    font-size: .66rem;
    font-weight: 740;
    line-height: 1.3;
    letter-spacing: .15em;
}
#content.nimble-mfg-unified .page-heading-wrap::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background:
        url("/assets/nimble-mark.svg") no-repeat 82% 52% / 270px 180px,
        radial-gradient(circle, #92d9ff 1px, transparent 1.5px) 68% 14% / 15px 15px;
    mask-image: linear-gradient(90deg, transparent 37%, #000 68%, #000 100%);
}
#content.nimble-mfg-unified .page-heading-wrap > * {
    position: relative;
    z-index: 2;
}
#content.nimble-mfg-unified .page-heading-wrap .page-heading {
    min-width: 0;
    max-width: min(850px, 80%);
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
#content.nimble-mfg-unified .page-heading-wrap .page-heading h1 {
    margin: 0 0 7px;
    padding: 0;
    color: #fff;
    font-size: clamp(1.33rem, 1.9vw, 1.85rem);
    line-height: 1.15;
    font-weight: 780;
    letter-spacing: -.028em;
}
#content.nimble-mfg-unified .page-heading-wrap .page-heading p,
#content.nimble-mfg-unified .page-heading-wrap .page-heading .text-secondary {
    color: #e0edff !important;
    font-size: .82rem;
    line-height: 1.52;
    opacity: 1;
}
#content.nimble-mfg-unified .page-heading-wrap .page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    min-width: 0;
}
#content.nimble-mfg-unified .page-heading-wrap .page-actions .btn {
    color: #eef7ff;
    background: rgba(216, 236, 255, .14);
    border: 1px solid rgba(207, 231, 255, .42);
    box-shadow: none;
}
#content.nimble-mfg-unified .page-heading-wrap .page-actions .btn.btn-primary {
    color: #fff;
    background: #137ce9;
    border-color: #137ce9;
}
#content.nimble-mfg-unified .page-heading-wrap .page-actions .btn:hover {
    background: #dcecff;
    color: #083a74;
}
#content.nimble-mfg-unified .page-heading-wrap .page-actions .btn.btn-primary:hover {
    background: #0a64ce;
    color: #fff;
}
#content.nimble-mfg-unified .portal-panel,
#content.nimble-mfg-unified .portal-table-card,
#content.nimble-mfg-unified .detail-card,
#content.nimble-mfg-unified .decision-section,
#content.nimble-mfg-unified .nested-form {
    min-width: 0;
    border: 1px solid var(--unified-line);
    border-radius: 13px;
    background-color: #fff;
    box-shadow: var(--unified-elevation);
}
#content.nimble-mfg-unified .portal-panel {
    padding: 17px 19px;
}
#content.nimble-mfg-unified .portal-panel + .portal-panel {
    margin-top: 15px;
}
#content.nimble-mfg-unified .portal-table-card {
    padding: 0;
    overflow: visible;
}
#content.nimble-mfg-unified .detail-card {
    margin-top: 17px;
}
#content.nimble-mfg-unified .decision-section,
#content.nimble-mfg-unified .nested-form {
    background: #f6faff;
    padding: 17px;
}
#content.nimble-mfg-unified .portal-panel .panel-title,
#content.nimble-mfg-unified .detail-card .panel-title,
#content.nimble-mfg-unified .review-section h3,
#content.nimble-mfg-unified .decision-section h3,
#content.nimble-mfg-unified .portal-panel > h2 {
    color: var(--unified-ink);
    font-size: .98rem;
    line-height: 1.35;
    font-weight: 760;
}
#content.nimble-mfg-unified .portal-panel > .panel-title,
#content.nimble-mfg-unified .detail-heading {
    border-bottom: 1px solid #dfebf8;
    padding-bottom: 11px;
    margin-bottom: 14px;
}
#content.nimble-mfg-unified .form-label,
#content.nimble-mfg-unified .form-check-label,
#content.nimble-mfg-unified .field-label {
    color: #304c6c;
    font-size: .78rem;
    font-weight: 670;
    line-height: 1.4;
}
#content.nimble-mfg-unified :is(.form-control, .form-select) {
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #cbddf1;
    border-radius: 9px;
    background-color: #fff;
    color: #183754;
    font-size: .8rem;
    line-height: 1.35;
    box-shadow: none;
}
#content.nimble-mfg-unified :is(.form-control-sm, .form-select-sm) {
    min-height: 34px;
    padding: 5px 9px;
    font-size: .75rem;
}
#content.nimble-mfg-unified textarea.form-control {
    min-height: 90px;
}
#content.nimble-mfg-unified :is(.form-control, .form-select):focus {
    outline: none;
    border-color: #64a9ef;
    box-shadow: 0 0 0 3px rgba(13, 115, 224, .13);
}
#content.nimble-mfg-unified :is(.form-control, .form-select):disabled,
#content.nimble-mfg-unified :is(.form-control, .form-select)[readonly] {
    background-color: #f3f7fc;
    color: #536a85;
    opacity: 1;
}
#content.nimble-mfg-unified .form-check-input {
    width: 17px;
    height: 17px;
    border: 1px solid #a9bfd7;
    margin-top: .14em;
}
#content.nimble-mfg-unified .form-check-input:checked {
    border-color: #0b70dd;
    background-color: #0b70dd;
}
#content.nimble-mfg-unified .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 37px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: .78rem;
    font-weight: 660;
    line-height: 1.3;
}
#content.nimble-mfg-unified .btn-sm {
    min-height: 31px;
    padding: 5px 9px;
    font-size: .72rem;
}
#content.nimble-mfg-unified .btn-primary {
    color: #fff;
    border-color: #0b72da;
    background: linear-gradient(110deg, #0d80f2, #0862cf);
}
#content.nimble-mfg-unified .btn-primary:hover {
    border-color: #065ebc;
    background: #075fbe;
}
#content.nimble-mfg-unified .btn-outline-primary {
    background: #f0f6ff;
    border-color: #c4dbf6;
    color: #0a66bf;
}
#content.nimble-mfg-unified .btn-outline-primary:hover {
    color: #074a93;
    background: #e4f0ff;
    border-color: #8abdf0;
}
#content.nimble-mfg-unified .btn:focus-visible,
#content.nimble-mfg-unified a:focus-visible,
#content.nimble-mfg-unified .form-check-input:focus-visible {
    outline: 2px solid #087be9;
    outline-offset: 2px;
}
#content.nimble-mfg-unified .portal-table-card .table-toolbar {
    padding: 13px 16px;
    border-bottom: 1px solid #dfeaf8;
    background: #f8fbff;
    border-radius: 12px 12px 0 0;
}
#content.nimble-mfg-unified .portal-table-card .table-toolbar strong {
    color: #15365d;
    font-size: .85rem;
    font-weight: 760;
}
#content.nimble-mfg-unified .portal-table-card .table-toolbar :is(input, select) {
    max-width: min(340px, 100%) !important;
}
#content.nimble-mfg-unified .portal-table-card .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    border: 0;
    border-radius: 0 0 12px 12px;
}
#content.nimble-mfg-unified table.table {
    --bs-table-bg: #fff;
    --bs-table-border-color: #e1eaf5;
    --bs-table-hover-bg: #edf5ff;
    margin: 0;
    color: #254564;
    font-size: .78rem;
}
#content.nimble-mfg-unified table.table > thead > tr > th {
    padding: 11px 12px;
    background-color: #eef5ff;
    --bs-table-bg: #eef5ff;
    --bs-table-color: #31547a;
    color: #31547a;
    border-color: #d8e5f6;
    font-size: .68rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
#content.nimble-mfg-unified table.table > tbody > tr > td {
    padding: 10px 12px;
    vertical-align: middle;
    line-height: 1.4;
    border-color: #e8eff8;
}
#content.nimble-mfg-unified table.table > tbody > tr:nth-child(even) > td {
    background: #fbfdff;
}
#content.nimble-mfg-unified table.table > tbody > tr:hover > td {
    background: #edf5ff;
}
#content.nimble-mfg-unified .review-summary-grid > div,
#content.nimble-mfg-unified .payment-summary-grid > div,
#content.nimble-mfg-unified .subrecord-card,
#content.nimble-mfg-unified .form-check-card {
    border: 1px solid #d5e4f4;
    border-radius: 10px;
    background-color: #f6faff;
    box-shadow: none;
}
#content.nimble-mfg-unified .review-summary-grid > div > strong,
#content.nimble-mfg-unified .payment-summary-grid > div > strong {
    color: #173a61;
    overflow-wrap: anywhere;
}
#content.nimble-mfg-unified .alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: .79rem;
    line-height: 1.5;
}
#content.nimble-mfg-unified .status-badge {
    font-size: .69rem;
    padding: 5px 10px;
    border-radius: 50rem;
}
#content.nimble-mfg-unified .empty-state {
    padding: 30px 20px;
    color: #5b738f;
    background: #f8fbff;
}
#content.nimble-mfg-unified .dashboard-hero {
    /* Dashboard already owns its header. Never decorate its data cards as heroes. */
    color: #fff;
}
#content.nimble-mfg-unified .dashboard-hero p {
    color: #e4efff;
}
#content.nimble-mfg-unified .metric-filter-panel {
    background: #fff;
}
#content.nimble-mfg-unified :is(.stock-total, .mfg-analytics-card strong) {
    color: #133762;
}
/* Auth and registration pages retain their approved split-screen layout. */
.portal-auth .auth-form-wrap :is(.form-control, .form-select) {
    min-height: 43px;
    border: 1px solid #c7dbf2;
    border-radius: 10px;
    color: #183753;
    font-size: .85rem;
}
.portal-auth .auth-form-wrap :is(.form-control, .form-select):focus {
    border-color: #167bdf;
    box-shadow: 0 0 0 3px rgba(15, 120, 224, .13);
}
.portal-auth .auth-form-wrap .form-label {
    color: #2b4969;
    font-size: .8rem;
    font-weight: 650;
}
.portal-auth .auth-form-wrap .btn {
    border-radius: 10px;
    font-size: .84rem;
    min-height: 42px;
}
@media (max-width: 1199.98px) {
    #content.nimble-mfg-unified .page-heading-wrap {
        padding: 37px 21px 19px;
    }
}
@media (max-width: 767.98px) {
    #content.nimble-mfg-unified .page-heading-wrap {
        flex-wrap: wrap;
        align-items: flex-start;
        min-height: 132px;
        padding: 36px 17px 18px;
        gap: 12px;
        background-size: 200px 145px, auto, auto;
        background-position: right -55px center, center, center;
    }
    #content.nimble-mfg-unified .page-heading-wrap::before {
        left: 17px;
    }
    #content.nimble-mfg-unified .page-heading-wrap .page-heading {
        max-width: 100%;
    }
    #content.nimble-mfg-unified .page-heading-wrap .page-actions {
        justify-content: flex-start;
        width: 100%;
    }
    #content.nimble-mfg-unified .portal-panel {
        padding: 14px;
    }
    #content.nimble-mfg-unified .portal-table-card .table-toolbar {
        padding: 11px 12px;
    }
}
@media (max-width: 575.98px) {
    #content.nimble-mfg-unified .portal-table-card .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    #content.nimble-mfg-unified .portal-table-card .table-toolbar input {
        width: 100%;
    }
    #content.nimble-mfg-unified .page-heading-wrap .page-actions .btn {
        flex: 1 1 auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    #content.nimble-mfg-unified .btn {
        transition: none;
    }
}


/* Payment reversals and confirmations are modal dialogs outside #content.
 * Preserve the existing focus, keyboard, and API behavior. */
.nimble-modal-backdrop .nimble-modal-dialog {
    border: 1px solid #c9dff5;
    border-radius: 14px;
    background: #fff;
    color: #193a60;
    box-shadow: 0 18px 55px rgba(7, 35, 74, .26);
}
.nimble-modal-backdrop .nimble-modal-header {
    border-bottom: 1px solid #dce9f7;
    color: #17365b;
}
.nimble-modal-backdrop .nimble-modal-body .form-label {
    font-size: .8rem;
    font-weight: 660;
    color: #2d4c6f;
}
.nimble-modal-backdrop .nimble-modal-body .form-control {
    border-radius: 9px;
    border-color: #c8dcf0;
    font-size: .83rem;
}
.nimble-modal-backdrop .nimble-modal-footer {
    border-top: 1px solid #dce9f7;
}
.nimble-modal-backdrop :is(.btn, .form-control):focus-visible {
    outline: 2px solid #0d78e8;
    outline-offset: 2px;
}
