/* ==========================================================================
   FlexOps Ship Manager - Custom Styles
   Application-specific styles not covered by the shared library.

   Shared styles are loaded from FlexOps.Blazor.Shared:
     - flexops-tokens.css        (design tokens)
     - flexops-components.css    (skeleton, empty state, skip link, animations)
     - flexops-radzen-overrides.css (focus, scrollbar, Radzen polish)
     - flexops-portal-base.css   (typography, cards, badges, form helpers)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Test Results Console (API Diagnostics)
   Wrapper div carries #test-results-console — the id specificity (1,0,0)
   beats Radzen's .rz-textarea rules without needing !important.
   Markup lives in Components/Pages/Testing/ApiTesting.razor.
   -------------------------------------------------------------------------- */
#test-results-console .rz-textarea {
    background-color: #0F172A;
    color: #22D3EE;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: var(--text-sm);
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid #334155;
    border-radius: 8px;
    resize: none;
    cursor: text;
    caret-color: #22D3EE;
    outline: none;
    box-sizing: border-box;
    user-select: text;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#test-results-console .rz-textarea:focus-visible {
    outline: 2px solid #22D3EE;
    outline-offset: -2px;
}

#test-results-console .rz-textarea::selection {
    background: #334155;
    color: #22D3EE;
}

#test-results-console .rz-textarea::-moz-selection {
    background: #334155;
    color: #22D3EE;
}

/* --------------------------------------------------------------------------
   Data Grids
   Shared chrome for every RadzenDataGrid: frame, header, row hover, paginator.
   Comfortable by default — cell padding and font size are left to Radzen, so
   report and configuration screens read rather than scan. Layer .operator-grid
   on top for the dense production-floor treatment.
   -------------------------------------------------------------------------- */
.data-grid {
    --data-grid-border: var(--flexops-border-secondary);
    --data-grid-header-bg: var(--flexops-bg-tertiary);
    --data-grid-row-hover: rgba(108, 59, 170, 0.06);
    border: 1px solid var(--data-grid-border);
    border-radius: var(--flexops-radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
}

/* Surface only. Header TYPE is owned by the --rz-grid-header-* variables in
   flexops-radzen-overrides.css §1, so every grid in every app reads the same.
   Setting font-size here styled the th while Radzen's .rz-column-title label
   kept its own size, so the value never reached the text. */
.data-grid .rz-grid-table thead th {
    background: var(--data-grid-header-bg);
    color: var(--flexops-text-secondary);
}

.data-grid .rz-grid-table td,
.data-grid .rz-grid-table th {
    vertical-align: middle;
}

.data-grid .rz-data-row:hover > td,
.data-grid .rz-grid-table tbody tr:hover > td {
    background: var(--data-grid-row-hover);
}

.data-grid .rz-paginator {
    border-top: 1px solid var(--data-grid-border);
    padding-block: var(--flexops-space-1);
}

.data-grid .operator-id {
    color: var(--flexops-text-quaternary);
    font-family: var(--flexops-font-mono);
    font-size: 0.8rem;
}

.data-grid .operator-primary {
    font-weight: var(--font-weight-bold);
    color: var(--flexops-text-primary);
}

/* --------------------------------------------------------------------------
   Operator Grids
   Dense, scan-first modifier for production-floor workflows. Layers on top of
   .data-grid and is never used alone — ReportGridDesignTests pins both the
   pairing and the set of pages that must NOT carry this modifier.
   -------------------------------------------------------------------------- */
/* Scan-first density, set on the cells themselves rather than through Radzen's
   --rz-grid-cell-* variables. Those variables look like the density lever and read
   like one, but FlexOps.Blazor.Shared pins `.rz-data-grid .rz-grid-table tbody td`
   to a literal padding, which outranks the variable mechanism entirely — so setting
   the vars here rendered exactly nothing. Verified in-browser: perturbing
   --rz-grid-cell-padding moves no pixels. These selectors carry one more class than
   the shared rule (0,3,2 vs 0,2,2) and therefore win.
   Not bound to the compact toggle — the production floor always wants dense rows.
   ponytail: dense-by-default by design; add toggle-binding only if operators ask. */
.data-grid.operator-grid .rz-grid-table tbody td {
    padding: var(--flexops-space-2) var(--flexops-space-3);
    font-size: 0.875rem;
}

.data-grid.operator-grid .rz-grid-table {
    min-width: max-content;
}

/* Operator grids used to re-declare header type here at 0.75rem/700/uppercase.
   That was Radzen's own default restated, and it made these grids the loudest and
   widest headers in the product — capitals are wider, so long titles hit the
   column edge first, which is what made New Orders read worse than its neighbours.
   Header type now comes from the --rz-grid-header-* variables in
   flexops-radzen-overrides.css §1, shared by all five apps. */

.data-grid.operator-grid .rz-badge {
    min-width: 4.5rem;
    justify-content: center;
    font-size: 0.72rem;
    line-height: 1.2;
}

.data-grid.operator-grid .rz-button.rz-button-sm {
    min-width: 1.9rem;
    min-height: 1.9rem;
}

/* --------------------------------------------------------------------------
   Module Entitlement Badges
   Compact inline indicators for dashboard cards that link to gated workflows.
   -------------------------------------------------------------------------- */
.module-required-badge {
    align-self: center;
    flex: 0 0 auto;
    font-size: 0.7rem;
    line-height: 1.1;
    min-width: auto;
    padding-inline: 0.45rem;
    white-space: nowrap;
}

.shipmanager-module-upgrade {
    margin: 0 auto;
    max-width: 1120px;
    padding: 1.25rem;
}

.shipmanager-module-upgrade-comparison {
    flex-wrap: wrap;
}

.shipmanager-locked-workflow {
    position: relative;
    margin-top: 1rem;
    min-height: 28rem;
}

.shipmanager-locked-preview {
    pointer-events: none;
    user-select: none;
}

.shipmanager-locked-preview-content {
    filter: blur(3px);
    opacity: 0.48;
}

.shipmanager-locked-workflow-card {
    position: absolute;
    left: 50%;
    top: 2rem;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 2rem));
    z-index: 2;
}

.shipmanager-locked-entitlement-context {
    /* Translucent panel over content — mix the theme surface so it adapts
       instead of a fixed white wash (which read as a bright block in dark). */
    background: color-mix(in srgb, var(--flexops-bg-primary) 56%, transparent);
    border: 1px solid var(--rz-border-color);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    width: fit-content;
}

.shipmanager-locked-entitlement-context .rz-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No max-width: 768px block — see the note in theme.css. Desktop-only at 1280px
   minimum, so these only fired outside the supported range. */

.order-lookup-option {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    min-width: 0;
    width: 100%;
}

.order-lookup-option-code {
    color: var(--flexops-text-secondary);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.order-lookup-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The FlexOps palette remaps Radzen's selected fill; keep its foreground paired
   with that fill in both light and dark mode. */
.rz-dropdown-panel {
    --rz-dropdown-item-selected-background-color: var(--color-bg-brand-solid_hover);
    --rz-dropdown-item-selected-color: var(--color-text-white);
    --rz-dropdown-item-selected-hover-background-color: var(--color-bg-brand-solid_hover);
    --rz-dropdown-item-selected-hover-color: var(--color-text-white);
}

.top-products-ranked-list {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem 0.35rem 0.35rem;
}

.top-products-ranked-row {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) 3rem;
}

.top-products-ranked-name {
    color: var(--flexops-text-primary);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.top-products-ranked-track {
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent);
    border-radius: 0.25rem;
    height: 1.55rem;
    overflow: hidden;
}

.top-products-ranked-fill {
    background: var(--rz-primary);
    border-radius: inherit;
    height: 100%;
    min-width: 0.2rem;
}

.top-products-ranked-value {
    color: var(--flexops-text-secondary);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

@media (max-width: 768px) {
    .top-products-ranked-row {
        grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr) 2.5rem;
    }
}