﻿/* ============================================================================
   Special Orders final implementation
   ----------------------------------------------------------------------------
   The last complete Special Orders design, retained as the canonical
   implementation.

   Source: Pasted text (2)(2).txt:2319-3190.
   ============================================================================ */

.special-orders-page .store-admin-shell-promo-code {
    gap: 0.625rem;
}

.special-orders-overview-card {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.special-orders-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding: 0.5rem 0.875rem;
    background: var(--store-surface-subtle, #f5f6f4);
    border-bottom: 1px solid var(--store-border, #d8ddd8);
}

.special-orders-heading {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.special-orders-heading-copy {
    min-width: 0;
}

.special-orders-title {
    margin: 0 !important;
    overflow: hidden;
    color: var(--store-text, #1d2a23);
    font-size: 1.1rem !important;
    font-weight: 750;
    line-height: 1.2 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.special-orders-description {
    display: block;
    margin-top: 0.0625rem;
    color: var(--store-text-muted, #667069);
    font-size: 0.72rem;
    line-height: 1.25;
}

.special-orders-primary-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    min-height: 2rem;
    padding: 0.25rem 0.625rem;
    background: #fff;
    border: 1px solid var(--store-border, #d8ddd8);
    border-radius: 0.5rem;
}

.special-orders-primary-count-label {
    color: var(--store-text-muted, #667069);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.special-orders-primary-count-value {
    color: var(--store-main-color, #006838);
    font-size: 1.05rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.special-orders-overview-grid {
    display: grid;
    grid-template-columns: minmax(11rem, 0.7fr) minmax(18rem, 1fr) minmax(17rem, 0.95fr) minmax(28rem, 1.45fr);
    align-items: stretch;
    gap: 0.625rem;
    width: 100%;
    min-width: 0;
    padding: 0.625rem 0.875rem;
}

.special-orders-metric-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: stretch;
    gap: 0.375rem;
    min-width: 0;
}

.special-orders-metric {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    min-height: 2.45rem;
    padding: 0.4375rem 0.625rem;
    background: #fff;
    border: 1px solid var(--store-border, #d8ddd8);
    border-left: 3px solid var(--store-main-color, #006838);
    border-radius: 0.45rem;
}

.special-orders-metric--success {
    border-left-color: var(--mud-palette-success, #2e7d32);
}

.special-orders-metric--danger {
    border-left-color: var(--mud-palette-error, #d32f2f);
}

.special-orders-metric-label {
    min-width: 0;
    color: var(--store-text-muted, #667069);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.special-orders-metric-value {
    flex: 0 0 auto;
    color: var(--store-text, #1d2a23);
    font-size: 0.95rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.special-orders-metric--success .special-orders-metric-value {
    color: var(--mud-palette-success, #2e7d32);
}

.special-orders-metric--danger .special-orders-metric-value {
    color: var(--mud-palette-error, #d32f2f);
}

.special-orders-financial-summary, .special-orders-scan-card, .special-orders-actions-card {
    min-width: 0;
    padding: 0.625rem 0.75rem;
    background: var(--store-surface-subtle, #f5f6f4);
    border: 1px solid var(--store-border, #d8ddd8);
    border-radius: 0.5rem;
}

.special-orders-section-label {
    margin-bottom: 0.375rem;
    color: var(--store-text-muted, #667069);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.special-orders-financial-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.75rem;
    min-width: 0;
    margin: 0;
}

.special-orders-financial-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.625rem;
    min-width: 0;
}

.special-orders-financial-item--primary {
    grid-column: 1 / -1;
    padding-bottom: 0.3125rem;
    margin-bottom: 0.0625rem;
    border-bottom: 1px solid var(--store-border, #d8ddd8);
}

.special-orders-financial-label, .special-orders-financial-value {
    margin: 0;
}

.special-orders-financial-label {
    color: var(--store-text-muted, #667069);
    font-size: 0.68rem;
    line-height: 1.2;
}

.special-orders-financial-value {
    flex: 0 0 auto;
    color: var(--store-text, #1d2a23);
    font-size: 0.76rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.special-orders-financial-item--primary .special-orders-financial-label {
    color: var(--store-text, #1d2a23);
    font-weight: 700;
}

.special-orders-financial-item--primary .special-orders-financial-value {
    color: var(--store-main-color, #006838);
    font-size: 0.88rem;
}

.special-orders-financial-value--negative {
    color: var(--mud-palette-error, #d32f2f);
}

.special-orders-scan-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.special-orders-scan-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4375rem;
}

.special-orders-scan-icon {
    display: inline-flex;
    flex: 0 0 1.75rem;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--store-main-color, #006838);
    background: #fff;
    border: 1px solid var(--store-border, #d8ddd8);
    border-radius: 0.375rem;
}

    .special-orders-scan-icon .mud-icon-root {
        font-size: 1rem;
    }

.special-orders-scan-title {
    margin: 0 !important;
    color: var(--store-text, #1d2a23);
    font-size: 0.82rem !important;
    font-weight: 750;
    line-height: 1.2 !important;
}

.special-orders-scan-description {
    color: var(--store-text-muted, #667069);
    font-size: 0.67rem;
    line-height: 1.2;
}

.special-orders-control-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--store-text-muted, #667069);
    font-size: 0.66rem;
    font-weight: 650;
}

.special-orders-scan-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4375rem;
}

.special-orders-scan-input {
    width: 100%;
    min-width: 0;
    height: 2.25rem;
    padding: 0 0.7rem;
    color: var(--store-text, #1d2a23);
    font-family: inherit;
    font-size: 0.82rem;
    background: #fff;
    border: 1px solid var(--store-border-strong, #bcc8c0);
    border-radius: 0.375rem;
    outline: none;
}

    .special-orders-scan-input:focus {
        border-color: var(--store-main-color, #006838);
        box-shadow: 0 0 0 3px rgba(0, 104, 56, 0.12);
    }

.special-orders-update-button {
    min-width: 5.75rem;
    min-height: 2.25rem;
}

.special-orders-actions-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.special-orders-actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    margin-bottom: 0.375rem;
}

.special-orders-actions-title {
    margin: 0 !important;
    color: var(--store-text, #1d2a23);
    font-size: 0.82rem !important;
    font-weight: 750;
    line-height: 1.2 !important;
}

.special-orders-selected-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.4rem;
    padding: 0.1rem 0.375rem;
    background: #fff;
    border: 1px solid var(--store-border, #d8ddd8);
    border-radius: 999px;
}

.special-orders-selected-label {
    color: var(--store-text-muted, #667069);
    font-size: 0.6rem;
    font-weight: 650;
}

.special-orders-selected-value {
    min-width: 0.875rem;
    color: var(--store-main-color, #006838);
    font-size: 0.7rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.special-orders-action-groups {
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
    width: 100%;
    min-width: 0;
}

.special-orders-action-group {
    min-width: 0;
}

    .special-orders-action-group + .special-orders-action-group {
        padding-top: 0.375rem;
        border-top: 1px solid var(--store-border, #d8ddd8);
    }

.special-orders-action-group-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--store-text-muted, #667069);
    font-size: 0.6rem;
    font-weight: 750;
    letter-spacing: 0.035em;
    line-height: 1.15;
    text-transform: uppercase;
}

.special-orders-action-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
}

.special-orders-action-button {
    min-height: 1.75rem;
    padding-inline: 0.45rem !important;
    font-size: 0.64rem !important;
    white-space: nowrap;
}

.special-orders-table-card {
    flex: 1 1 auto;
    min-height: 0;
}

.special-orders-table-toolbar {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.special-orders-table-main-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem);
    align-items: end;
    gap: 1rem;
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.875rem;
}

.special-orders-table-selection {
    min-width: 0;
}

.special-orders-table-selection-heading {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    margin-bottom: 0.25rem;
}

.special-orders-toolbar-label {
    display: block;
    color: var(--store-text-muted, #667069);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.035em;
    line-height: 1.15;
    text-transform: uppercase;
}

.special-orders-selection-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.special-orders-toolbar-button {
    min-height: 1.75rem;
    padding-inline: 0.5rem !important;
    font-size: 0.66rem !important;
    white-space: nowrap;
}

.special-orders-table-filter {
    width: 100%;
    min-width: 0;
}

.special-orders-filter-input {
    width: 100%;
}

.special-orders-table-note {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0.875rem;
    color: var(--store-text-muted, #667069);
    background: #fff;
    border-top: 1px solid var(--store-border, #d8ddd8);
}

.special-orders-table-note-icon {
    flex: 0 0 auto;
    color: var(--mud-palette-info, #0288d1);
    font-size: 0.875rem;
}

.special-orders-table-note-text {
    color: inherit;
    font-size: 0.65rem;
    line-height: 1.2;
}

.special-orders-data-table table {
    min-width: 74rem;
}

.special-orders-data-table th {
    white-space: nowrap;
}

.special-orders-data-table td {
    vertical-align: middle;
}

.special-orders-select-column, .special-orders-select-cell {
    width: 3.25rem;
    min-width: 3.25rem;
    text-align: center !important;
}

.special-orders-data-table .store-data-id-column, .special-orders-data-table .store-data-id-cell {
    width: 4.75rem;
    min-width: 4.75rem;
}

.special-orders-date-column, .special-orders-date-cell {
    width: 6.5rem;
    min-width: 6.5rem;
    white-space: nowrap;
}

.special-orders-status-column, .special-orders-status-cell {
    width: 7rem;
    min-width: 7rem;
    text-align: center !important;
}

.special-orders-subject-column, .special-orders-subject-cell {
    width: 10.5rem;
    min-width: 10.5rem;
}

.special-orders-code-column, .special-orders-code-cell {
    width: 5.25rem;
    min-width: 5.25rem;
}

.special-orders-preview-column, .special-orders-preview-cell {
    width: 5rem;
    min-width: 5rem;
    text-align: center !important;
}

.special-orders-money-column {
    width: 6.5rem;
    min-width: 6.5rem;
}

.special-orders-status-chip {
    min-width: 5.5rem;
    min-height: 1.7rem;
    padding-inline: 0.4rem;
    justify-content: center;
    cursor: pointer;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.special-orders-subject {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
}

.special-orders-subject-name {
    margin: 0 !important;
    overflow-wrap: anywhere;
    color: var(--store-text, #1d2a23);
    font-size: 0.78rem !important;
    font-weight: 700;
    line-height: 1.2 !important;
}

.special-orders-subject-detail {
    margin: 0 !important;
    overflow-wrap: anywhere;
    color: var(--store-text-muted, #667069);
    font-size: 0.69rem !important;
    line-height: 1.15 !important;
}

.special-orders-custom-detail {
    margin: 0.1rem 0 0 !important;
    overflow-wrap: anywhere;
    color: var(--store-text-muted, #667069);
    font-size: 0.65rem !important;
    line-height: 1.15 !important;
}

.special-orders-item-preview {
    display: block;
    width: 4.25rem;
    max-width: 100%;
    height: 4.25rem;
    margin-inline: auto;
    object-fit: contain;
    background: var(--store-surface-subtle, #f5f6f4);
    border: 1px solid var(--store-border, #d8ddd8);
    border-radius: 0.3125rem;
}

.special-orders-amount-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.0625rem;
}

.special-orders-amount {
    margin: 0 !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.special-orders-row-status {
    margin: 0 !important;
    font-size: 0.62rem !important;
    font-weight: 700;
    line-height: 1.1 !important;
    white-space: nowrap;
}

@media (max-width: 1399.98px) {
    .special-orders-overview-grid {
        grid-template-columns: minmax(11rem, 0.75fr) minmax(18rem, 1fr) minmax(17rem, 1fr);
    }

    .special-orders-actions-card {
        grid-column: 1 / -1;
    }

    .special-orders-action-groups {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: end;
        gap: 0.75rem;
    }

    .special-orders-action-group + .special-orders-action-group {
        padding-top: 0;
        padding-left: 0.75rem;
        border-top: 0;
        border-left: 1px solid var(--store-border, #d8ddd8);
    }
}

@media (max-width: 1099.98px) {
    .store-admin-page-promo-code.special-orders-page {
        height: auto;
        min-height: calc(100dvh - var(--store-app-bar-height, 4rem));
        overflow: auto;
    }

    .special-orders-page .store-admin-shell-promo-code {
        height: auto;
    }

    .special-orders-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .special-orders-actions-card {
        grid-column: 1 / -1;
    }

    .special-orders-table-card {
        flex: none;
        min-height: 32rem;
    }

    .special-orders-table-main-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 599.98px) {
    .special-orders-overview-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .special-orders-title {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .special-orders-primary-count {
        width: 100%;
        justify-content: space-between;
    }

    .special-orders-overview-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.625rem;
    }

    .special-orders-actions-card {
        grid-column: auto;
    }

    .special-orders-financial-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .special-orders-financial-item--primary {
        grid-column: auto;
    }

    .special-orders-scan-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .special-orders-update-button {
        width: 100%;
    }

    .special-orders-action-groups {
        display: flex;
        flex-direction: column;
    }

    .special-orders-action-group + .special-orders-action-group {
        padding-top: 0.4375rem;
        padding-left: 0;
        border-top: 1px solid var(--store-border, #d8ddd8);
        border-left: 0;
    }

    .special-orders-selection-buttons, .special-orders-action-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .special-orders-toolbar-button, .special-orders-action-button {
        width: 100%;
    }
}
