/* ============================================================
   Cosmos Store — Global Stylesheet
   ============================================================ */

/* Store.Web now links the Cosmos token files directly (see Components/App.razor), so the
   shared dialogs resolve their colours from the canonical set. The nine local declarations
   that used to sit here are gone; four of them were Bootstrap 5 stock greys shadowing the
   shared theme, so Store chrome shifts slightly onto the platform values. */

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    color: #212529;
    height: 100%;
}

a { color: #1a1a2e; }
a:hover { color: #2d2d5e; }

h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.25rem; color: #1a1a2e; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }

/* ── Utility ──────────────────────────────────────────────── */
.text-muted  { color: #6c757d !important; }
.text-danger { color: #dc3545 !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }

/* ── Shared Buttons ───────────────────────────────────────── */
.btn-primary {
    padding: .55rem 1.4rem;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: #2d2d5e; }

.btn-secondary {
    padding: .55rem 1.2rem;
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-secondary:hover:not(:disabled) { background: #f0f0f0; }

.btn-danger {
    padding: .55rem 1.2rem;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
}
.btn-danger:hover:not(:disabled) { background: #b02a37; }

button:disabled { opacity: .45; cursor: default; }

/* ── Shared Badges ────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 99px;
    white-space: nowrap;
}
.badge--active   { background: #d4edda; color: #155724; }
.badge--inactive { background: #f8d7da; color: #721c24; }
.badge--tracked  { background: #d1ecf1; color: #0c5460; }
.badge--pending  { background: #fff3cd; color: #856404; }
.badge--complete { background: #d4edda; color: #155724; }
.badge--cancelled{ background: #f8d7da; color: #721c24; }
.badge--refunded { background: #e2d9f3; color: #4a235a; }
.badge--out      { background: #f8d7da; color: #721c24; }

/* ── Admin page subtitle ─────────────────────────────────── */
.admin-subtitle {
    margin: -.25rem 0 1rem;
    font-size: .88rem;
    color: #666;
}

/* ── Loading Spinner ──────────────────────────────────────── */
.spinner-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 0;
    color: #555;
    font-size: .95rem;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #ddd;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error Message ────────────────────────────────────────── */
.error-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: .75rem 1rem;
    color: #856404;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* ── No Results ───────────────────────────────────────────── */
.no-results { color: #888; padding: 2rem 0; font-size: 1rem; }

/* ── Catalog header ───────────────────────────────────────── */
.catalog-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.catalog-header h1 { margin: 0; flex: 1; }
.catalog-header__actions { display: flex; gap: .4rem; }
.btn-icon {
    width: 2rem; height: 2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    color: #555;
    transition: background .15s, border-color .15s;
}
.btn-icon:hover      { background: #f0f2f5; border-color: #aaa; }
.btn-icon--active    { background: #1a1a2e; border-color: #1a1a2e; color: #fff; }

/* ── Catalog filter panel ─────────────────────────────────── */
.catalog-filter-panel {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: .85rem 1rem;
    margin-bottom: 1.5rem;
}
.catalog-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: flex-end;
}
.catalog-filter-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 160px;
    flex: 1 1 160px;
}
.catalog-filter-field label {
    font-size: .78rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.catalog-filter-field--check {
    flex: 0 0 auto;
    justify-content: flex-end;
    padding-bottom: .45rem;
}
.catalog-filter-field--check label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.catalog-clear-btn {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 .7rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #555;
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.catalog-clear-btn:hover { background: #f0f0f0; border-color: #aaa; color: #222; }

.filter-input {
    padding: .4rem .75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .88rem;
    width: 100%;
    background: #fff;
    box-sizing: border-box;
}
.filter-input:focus { outline: 2px solid #1a1a2e; outline-offset: 1px; }
.filter-input--mono { font-family: monospace; letter-spacing: .04em; }
/* Compact variant used inside the DataGrid filter row */
.filter-input--grid { padding: .25rem .4rem; font-size: .8rem; }
.filter-input--stacked { margin-top: .25rem; }
/* Full description shown in the catalog "Description" column */
.catalog-row__desc-full { font-size: .85rem; color: #555; line-height: 1.3; }

/* Toggle switch — only the switch itself is clickable; the text label is a sibling, so
   clicking beside the switch (text/gap/cell) does NOT toggle it. */
.toggle-field { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: #444; white-space: nowrap; user-select: none; }
.toggle-field--grid { font-size: .76rem; gap: .3rem; }
.toggle-switch { position: relative; display: inline-block; width: 34px; height: 18px; flex: none; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-switch__slider { position: absolute; inset: 0; background: #c4c8d0; border-radius: 999px; transition: background .15s; pointer-events: none; }
.toggle-switch__slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle-switch input:checked + .toggle-switch__slider { background: #2e7d32; }
.toggle-switch input:checked + .toggle-switch__slider::before { transform: translateX(16px); }

/* VAT slider toggle in the storefront top menu — reuses the "In stock" switch above, but the
   .toggle-field default text colour (#444) is for light panels, so override it for the dark nav.
   In the top bar inherit the nav's text colour; in the dark dropdown use the menu item colour. */
.store-nav__vat-toggle { color: inherit; }
.store-nav__user-menu .store-nav__vat-toggle { color: #e0e0e0; padding: .55rem 1rem; }

/* Checkbox filter labels (header toolbar + grid filter row) */
.catalog-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: #444; white-space: nowrap; }
.catalog-check--grid { font-size: .78rem; }

/* ── DataGrid integration (Store.Web is not Bootstrap-based) ── */
/* Top-align filter inputs — the Manufacturer cell stacks two, so the rest must not center */
.cosmos-datagrid-filter-row th { vertical-align: top; }
.cosmos-datagrid tbody tr { cursor: pointer; }
.cosmos-datagrid tbody tr:hover { background: #f5f7fa; }
.cosmos-datagrid tbody tr.table-active { background: #eaf0fb; }
.cosmos-datagrid td .catalog-row__action,
.cosmos-datagrid td.catalog-row__action { text-align: right; white-space: nowrap; }
.cosmos-datagrid .col-actions { white-space: nowrap; }
.catalog-row__thumb { text-align: center; }
.catalog-row__thumb img { max-width: 44px; max-height: 38px; object-fit: contain; border-radius: 3px; vertical-align: middle; }

/* ── Catalog list (table) view ────────────────────────────── */
.catalog-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 1.5rem;
    font-size: .9rem;
}
.catalog-table th,
.catalog-table td {
    padding: .55rem .85rem;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
}
.catalog-table th { background: #f0f2f5; font-weight: 600; color: #333; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.catalog-table tbody tr:last-child td { border-bottom: none; }
.catalog-row { cursor: pointer; transition: background .12s; }
.catalog-row:hover { background: #f5f7fa; }
.catalog-row--inactive { opacity: .55; }
.catalog-row__name { display: block; font-weight: 500; }
.catalog-row__desc { display: block; font-size: .8rem; color: #888; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.catalog-row__partno { display: block; font-family: monospace; font-size: .75rem; color: #777; margin-top: .15rem; }
.catalog-row__manufacturer { white-space: nowrap; font-size: .88rem; }
.catalog-row__model { display: block; font-size: .78rem; color: #888; margin-top: .1rem; }
.catalog-row__price { white-space: nowrap; font-weight: 500; }
.catalog-row__qty   { white-space: nowrap; }
.catalog-row__action { white-space: nowrap; text-align: right; }
.sku { font-size: .82rem; color: #555; background: #f0f2f5; padding: .1rem .35rem; border-radius: 3px; }
.catalog-avail { font-size: .78rem; color: #888; }
.product-card__sku { font-family: monospace; font-size: .75rem; color: #999; margin-bottom: .15rem; }
.product-card__manufacturer { font-size: .82rem; color: #666; display: block; margin-bottom: .2rem; font-style: italic; }

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: box-shadow .2s, border-color .2s;
    background: #fff;
}
.product-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); border-color: #aaa; }
.product-card__image { width: 100%; height: 150px; background: #f0f2f5; border-radius: 6px; margin-bottom: .6rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card__image img { width: 100%; height: 100%; object-fit: contain; }
.product-card__noimage { font-size: .8rem; color: #aaa; }
.product-card h3 { margin: 0 0 .2rem; font-size: 1rem; }
.product-card__category { font-size: .8rem; color: #888; display: block; margin-bottom: .35rem; }
.product-card__desc {
    font-size: .875rem;
    color: #555;
    margin: .4rem 0 .6rem;
    min-height: 2.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card__footer { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.75rem;
}
.pagination button {
    padding: .4rem .9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    font-size: .9rem;
    transition: background .15s;
}
.pagination button:hover:not(:disabled) { background: #e9ecef; }
.pagination button:disabled { opacity: .4; cursor: default; }

/* ── Product Detail ───────────────────────────────────────── */
.product-detail { max-width: 700px; }
.product-detail__meta { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
.product-detail__desc { color: #555; font-size: .95rem; margin-bottom: 1.5rem; line-height: 1.55; }
.product-detail__add {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.product-detail__add label { font-weight: 500; font-size: .9rem; }
.qty-input {
    width: 72px;
    padding: .4rem .5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .95rem;
    text-align: center;
}
.success-msg { color: #155724; font-weight: 600; font-size: .9rem; }

/* ── Cart ─────────────────────────────────────────────────── */
.empty-cart { color: #888; font-size: 1rem; padding: 2rem 0; }
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.cart-table th,
.cart-table td { padding: .65rem .85rem; border-bottom: 1px solid #e0e0e0; text-align: left; font-size: .9rem; }
.cart-table th { background: #f5f5f5; font-weight: 600; color: #333; }
.cart-table tbody tr:last-child td { border-bottom: none; }
.cart-table tfoot td { border-top: 2px solid #ccc; border-bottom: none; font-weight: 600; background: #fafafa; }
.btn-remove {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 1.05rem;
    cursor: pointer;
    padding: .2rem .45rem;
    border-radius: 4px;
}
.btn-remove:hover:not(:disabled) { background: #fdf0ee; color: #922b21; }
.cart-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: .5rem; }

/* ── Orders Table ─────────────────────────────────────────── */
.orders-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.orders-table th,
.orders-table td { padding: .65rem .85rem; border-bottom: 1px solid #e0e0e0; text-align: left; font-size: .9rem; }
.orders-table th { background: #f5f5f5; font-weight: 600; color: #333; }
.orders-table tbody tr:last-child td { border-bottom: none; }
.orders-table tbody tr:hover { background: #f9f9f9; }
.orders-table a { color: #1a1a2e; font-weight: 500; }

/* ── Order Detail ─────────────────────────────────────────── */
.order-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.order-meta__item label { font-size: .75rem; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: .15rem; }
.order-meta__item span  { font-size: .95rem; font-weight: 500; }

/* ── Blazor Error UI ──────────────────────────────────────── */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: .9rem;
    color: #856404;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #fff;
    border-radius: 6px;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── Status Badges (Order / Return status) ────────────────── */
.status-badge {
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 99px;
    white-space: nowrap;
}
.status-draft      { background: #e9ecef; color: #495057; }
.status-confirmed  { background: #cce5ff; color: #004085; }
.status-processing { background: #fff3cd; color: #856404; }
.status-shipped    { background: #d4edda; color: #155724; }
.status-delivered  { background: #d1ecf1; color: #0c5460; }
.status-cancelled  { background: #f8d7da; color: #721c24; }
.status-refunded   { background: #e2d9f3; color: #4a235a; }

/* Payment-status modifiers (used by order lists + the order details slide-over). */
.payment-unpaid     { background: #e9ecef; color: #495057; }
.payment-authorized { background: #cce5ff; color: #004085; }
.payment-paid       { background: #d4edda; color: #155724; }
.payment-refunded   { background: #e2d9f3; color: #4a235a; }
.payment-failed     { background: #f8d7da; color: #721c24; }

/* ── Detail / Back link ───────────────────────────────────── */
.detail-back { margin-bottom: 1rem; }
.detail-back a { color: #555; text-decoration: none; font-size: .9rem; }
.detail-back a:hover { color: #000; }

/* ── Product Detail layout ────────────────────────────────── */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 700px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-info h1 { margin: 0 0 .5rem; }
.detail-image { margin-bottom: 1rem; background: #f0f2f5; border-radius: 8px; padding: .5rem; text-align: center; }
.detail-image img { max-width: 100%; max-height: 320px; object-fit: contain; }
.detail-category { color: #666; margin: 0 0 .75rem; font-size: .9rem; }
.detail-desc { color: #444; line-height: 1.6; margin-bottom: 1rem; }
.detail-badges { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.detail-meta-line { margin: 0 0 .35rem; font-size: .9rem; color: #555; }
.detail-meta-label { font-weight: 600; color: #444; margin-right: .35rem; }
.detail-actions {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.qty-row { display: flex; align-items: center; gap: .75rem; }
.unavailable { color: #888; font-style: italic; }
.detail-offers-hint { color: #555; font-size: .9rem; margin: 0; }
.detail-offers { margin-top: 1.75rem; }
.detail-offers h3 { margin: 0 0 .75rem; }
/* The offers grid spans the full width; let columns size to content and allow horizontal scroll if cramped. */
.detail-offers .cosmos-datagrid { width: 100%; }
.detail-offers .cosmos-datagrid td,
.detail-offers .cosmos-datagrid th { white-space: nowrap; }

/* ── View link (Orders table) ─────────────────────────────── */
.view-link { color: #1a1a2e; font-weight: 600; text-decoration: none; font-size: .85rem; }
.view-link:hover { text-decoration: underline; }

/* ── Order Header ─────────────────────────────────────────── */
.order-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.order-header h1 { margin: 0; }

/* ── Auth pages (Login / Register) ───────────────────────── */
.auth-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
}
.auth-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 2rem 2.25rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.5rem;
    text-align: center;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: 1rem;
}
.form-group label {
    font-size: .85rem;
    font-weight: 600;
    color: #444;
}
.form-input {
    padding: .5rem .75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: .95rem;
    background: #fafafa;
    transition: border-color .15s;
    width: 100%;
}
.form-input:focus {
    outline: none;
    border-color: #1a1a2e;
    background: #fff;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.btn-full { width: 100%; margin-top: .5rem; }
.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .88rem;
    color: #666;
}
.auth-switch a { color: #1a1a2e; font-weight: 600; }
.auth-notice {
    background: #fff7e6;
    border: 1px solid #f0c040;
    color: #8a6d00;
    padding: .6rem .8rem;
    border-radius: 6px;
    font-size: .88rem;
    margin-bottom: 1rem;
    text-align: center;
}
.validation-message { color: #dc3545; font-size: .8rem; margin-top: .15rem; }

/* ── Nav admin link ───────────────────────────────────────── */
.store-nav__admin {
    color: #f0c040;
    font-weight: 600;
}
.store-nav__admin:hover { color: #f5d76e; }

/* ── Admin layout ─────────────────────────────────────────── */
.admin-wrap { max-width: 1100px; }

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.admin-toolbar h1 { margin: 0; flex: 1; }
.admin-toolbar__actions { display: flex; align-items: center; gap: .75rem; }

/* ── Admin table ──────────────────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 1.5rem;
}
.admin-table th,
.admin-table td {
    padding: .6rem .85rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    font-size: .88rem;
}
.admin-table th { background: #f0f2f5; font-weight: 600; color: #333; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #f9f9f9; }
.admin-table .col-actions { white-space: nowrap; text-align: right; }

/* ── Admin form panel ─────────────────────────────────────── */
.admin-form-panel {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    max-width: 860px;
}
.admin-form-panel h2 { margin-top: 0; font-size: 1.1rem; }
.admin-form-actions { display: flex; gap: .75rem; margin-top: 1rem; }

/* form-row inside admin forms: flexible multi-column layout */
.admin-form-panel .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-start;
}
.admin-form-panel .form-group--grow  { flex: 1 1 200px; }
.admin-form-panel .form-group--fixed { flex: 0 0 180px; }
.admin-form-panel .form-group--center { justify-content: center; }
.form-hint     { font-size: .78rem; color: #888; margin-top: .1rem; }
.admin-amsync-notice {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: .45rem .8rem;
    color: #0c5460;
    font-size: .82rem;
    margin-bottom: .75rem;
}
.form-input--mono { font-family: monospace; letter-spacing: .04em; }
.required      { color: #dc3545; margin-left: .15rem; }

/* ── Small action buttons in table rows ───────────────────── */
.btn-sm {
    padding: .28rem .7rem;
    font-size: .8rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s;
}
.btn-sm-primary  { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.btn-sm-primary:hover:not(:disabled)  { background: #2d2d5e; }
.btn-sm-danger   { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-sm-danger:hover:not(:disabled)   { background: #b02a37; }
.btn-sm-success  { background: #198754; color: #fff; border-color: #198754; }
.btn-sm-success:hover:not(:disabled)  { background: #146c43; }
.btn-sm-warning  { background: #ffc107; color: #212529; border-color: #ffc107; }
.btn-sm-warning:hover:not(:disabled)  { background: #e0a800; }
.btn-sm-secondary{ background: #fff; color: #444; border-color: #ccc; }
.btn-sm-secondary:hover:not(:disabled){ background: #f0f0f0; }

/* Anchors styled as buttons (links that navigate but look like buttons). */
a.btn-sm, a.btn-secondary, a.btn-primary, a.btn-danger,
a.btn-sm-primary, a.btn-sm-secondary, a.btn-sm-danger, a.btn-sm-success, a.btn-sm-warning {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

/* Close (×) button used by the shared SlideOverDialog header.
   SlideOverDialog uses Bootstrap's .btn-close class, but Store.Web has no Bootstrap,
   so define a visible × here. */
.btn-close {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-close::before {
    content: "\00d7"; /* × */
    font-size: 1.4rem;
    line-height: 1;
}
.btn-close:hover { background: #f0f0f0; color: #000; }

/* ── Admin status actions ─────────────────────────────────── */
.status-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Unauthorized notice ──────────────────────────────────── */
.unauthorized {
    text-align: center;
    padding: 4rem 1rem;
    color: #888;
}
.unauthorized h2 { font-size: 1.4rem; color: #555; margin-bottom: .5rem; }


/* ── Admin dropdown group ─────────────────────────────────── */
.store-nav__admin-group {
    position: relative;
    display: inline-block;
}
.store-nav__admin {
    background: none;
    border: none;
    color: #f0c040;
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
}
.store-nav__admin:hover { color: #f5d76e; }

.store-nav__admin-menu {
    display: none;
    position: absolute;
    top: calc(100% + .4rem);
    left: 0;
    background: #1a1a2e;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    min-width: 150px;
    z-index: 100;
    flex-direction: column;
    overflow: hidden;
}
.store-nav__admin-group--open .store-nav__admin-menu {
    display: flex;
}
.store-nav__admin-menu a {
    color: #e0e0e0;
    padding: .55rem 1rem;
    text-decoration: none;
    font-size: .9rem;
    transition: background .12s;
}
.store-nav__admin-menu a:hover { background: #2d2d5e; color: #fff; }

/* ── VAT incl./excl. toggle badge (storefront top menu) ── */
.store-nav__vat {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .3);
    color: inherit;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    padding: .3rem .6rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
}
.store-nav__vat:hover { background: rgba(255, 255, 255, .18); }
.store-nav__vat--incl {
    background: rgba(240, 192, 64, .18);
    border-color: #f0c040;
    color: #f5d76e;
}

/* ── Username dropdown (account submenu) — mirrors the admin dropdown ── */
.store-nav__user-group {
    position: relative;
    display: inline-block;
}
.store-nav__user-toggle {
    background: none;
    border: none;
    color: inherit;
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
}
.store-nav__user-toggle:hover { opacity: .85; }

.store-nav__user-menu {
    display: none;
    position: absolute;
    top: calc(100% + .4rem);
    right: 0;
    background: #1a1a2e;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    min-width: 160px;
    z-index: 100;
    flex-direction: column;
    overflow: hidden;
}
.store-nav__user-group--open .store-nav__user-menu {
    display: flex;
}
/* NOTE: the backdrop/menu layering below relies on the top <nav> (.store-nav) NOT
   establishing its own stacking context. Do not add position+z-index / transform / opacity
   / filter to .store-nav, or these z-index values become scoped inside it and the open
   dropdown will fall BEHIND the backdrop. */
/* Lift the open dropdown group above the click-outside backdrop (z-index 90) so its
   button + menu stay interactive while clicks elsewhere fall through to the backdrop. */
.store-nav__admin-group--open,
.store-nav__user-group--open {
    z-index: 110;
}
/* Transparent full-viewport catcher rendered while a top-menu dropdown is open;
   clicking it collapses the menu (see MainLayout CloseAllMenus). */
.store-nav__backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: transparent;
}
.store-nav__user-menu a,
.store-nav__user-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    font: inherit;
    color: #e0e0e0;
    cursor: pointer;
    padding: .55rem 1rem;
    text-decoration: none;
    font-size: .9rem;
    transition: background .12s;
    white-space: nowrap;
}
.store-nav__user-menu a:hover,
.store-nav__user-menu button:hover { background: #2d2d5e; color: #fff; }

/* ── Catalog filter: sort control ────────────────────────── */
.catalog-filter-field--sort {
    flex: 0 0 180px;
}

/* ── Stock / offers table (Product Detail) ────────────────── */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    margin-bottom: .5rem;
}
.stock-table th,
.stock-table td {
    padding: .45rem .7rem;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: middle;
}
.stock-table th {
    background: #f0f2f5;
    font-weight: 600;
    color: #444;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.stock-table tbody tr:last-child td { border-bottom: none; }
.stock-table tbody tr:hover { background: #f7f9fb; }
.offer-price  { white-space: nowrap; font-weight: 500; }
.offer-vat    { font-size: .75rem; color: #888; margin-left: .25rem; }
.offer-avail  { text-align: center; color: #555; }
.offer-action { white-space: nowrap; text-align: right; }

/* ── Per-offer quantity row ───────────────────────────────── */
.offer-qty-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    justify-content: flex-end;
}
.qty-input--sm {
    width: 56px;
    padding: .28rem .4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .85rem;
    text-align: center;
}

/* ── Product Source badges (item 6) ───────────────────────── */
/* "AM" badge: blue-grey tone — distinct from the teal badge--tracked */
.badge--am    { background: #dde7f5; color: #1a4a8a; }
/* "Store" badge: soft purple/neutral — clearly store-native */
.badge--store { background: #ede8f5; color: #4a2d8a; }
/* "Service" badge: neutral slate — a non-human account, deliberately unlike Staff/Customer */
.badge--service { background: #e6eaed; color: #37474f; }

/* ── Cart total row below DataGrid ───────────────────────── */
.cart-total-row td {
    padding: .65rem .85rem;
    border-top: 2px solid #ccc;
    font-weight: 600;
    background: #fafafa;
}

/* ── Slide-over detail dialogs (product / order / customer details) ──────── */
.admin-detail-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .45rem 1.25rem;
    align-items: baseline;
    margin: 0 0 1.25rem;
}
.admin-detail-grid dt {
    font-size: .72rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.admin-detail-grid dd {
    margin: 0;
    font-size: .95rem;
    font-weight: 500;
    color: #1f2226;
}

.admin-detail-addresses {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.admin-detail-addresses li {
    padding: .4rem 0;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
    color: #444;
}
.admin-detail-addresses li:last-child { border-bottom: none; }

.order-items {
    width: 100%;
    border-collapse: collapse;
    margin-top: .5rem;
    font-size: .9rem;
}
.order-items th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #888;
    font-weight: 600;
    padding: .4rem .5rem;
    border-bottom: 2px solid #e6e7ea;
}
.order-items td {
    padding: .45rem .5rem;
    border-bottom: 1px solid #eee;
}
.order-items tr:last-child td { border-bottom: none; }

/* ── Slide-over dialog body + read-only form helpers ─────────────────────── */
/* The shared SlideOverDialog .body is padding:0; overflow:hidden and lays its
   children out in a flex column. A single .so-body child becomes the padded,
   scrollable content region. */
.so-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}
/* Reset native fieldset chrome — we use <fieldset disabled> purely to make a
   whole form read-only in one place. */
.dialog-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.form-readonly-value {
    font-size: .95rem;
    font-weight: 500;
    padding: .35rem 0;
}

/* Edit form hosted in a slide-over: the fields region scrolls and the action
   footer is pinned to the bottom of the panel (matches the AircraftManagement
   dialog pattern). The footer stays inside the <EditForm> so submit still
   validates. */
.so-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.so-form__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}
.so-form__error {
    flex: 0 0 auto;
    margin: .75rem 1.5rem 0;
}
.so-form__footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.5rem;
    border-top: 1px solid var(--cosmos-border);
    background: var(--cosmos-canvas);
}

/* ── Fulfillment pick sheet (per-line pick qty + backorder/close) ───────── */
.pick-sheet { width: 100%; border-collapse: collapse; margin: .5rem 0; }
.pick-sheet th, .pick-sheet td { padding: .3rem .5rem; border-bottom: 1px solid #eee; text-align: left; }
.pick-sheet__done { opacity: .6; }
.pick-qty { width: 5rem; }
.shortfall-toggle { font-size: .8rem; display: inline-flex; gap: .3rem; align-items: center; }
.shipment-history { margin-top: .5rem; }
.shipment-history__row { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; padding: .2rem 0; }
.pick-cell { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* Admin settings — one store-mode radio option per line. */
.store-mode-option { display: flex; align-items: baseline; gap: .5rem; margin: .35rem 0; font-size: .9rem; }

