/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --bg-0: #020203;
    --bg-1: #07070a;
    --bg-2: #0c0c10;
    --bg-3: #14141a;
    --panel: rgba(10, 11, 14, 0.94);
    --panel-soft: rgba(14, 15, 20, 0.82);
    --red: #ff1f1f;
    --red-2: #c40b0b;
    --red-soft: rgba(255, 31, 31, 0.16);
    --amber: #ffb347;
    --cyan: #5cf2ff;
    --white: #f4f5f7;
    --grey-1: #c8cbd2;
    --grey-2: #9298a3;
    --grey-3: #6e737d;
    --grey-4: #2a2c33;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.22);
    --line-red: rgba(255, 31, 31, 0.55);
    --shadow-1: 0 18px 48px rgba(0, 0, 0, 0.65);
    --glow-red: 0 0 22px rgba(255, 31, 31, 0.20);
    --mono: "IBM Plex Mono", "Fira Mono", "Courier New", monospace;
    --display: "Orbitron", "Rajdhani", "Helvetica Neue", sans-serif;
    --radius: 4px;
    --radius-lg: 8px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --transition: 160ms ease;
}

/* ============================================================
   RESET + BASE
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(1100px 520px at 78% -12%, rgba(255, 31, 31, 0.12), transparent 70%),
        radial-gradient(820px 520px at 0% 110%, rgba(92, 242, 255, 0.04), transparent 65%),
        linear-gradient(180deg, #020203 0%, #08080c 55%, #020203 100%);
    color: var(--white);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--white);
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */

.deck-shell {
    width: min(1280px, calc(100vw - 36px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 0 42px;
    display: grid;
    gap: 14px;
}

.deck-grid {
    display: grid;
    gap: 14px;
}

.deck-hud,
.hud-panel,
.lane-card,
.product-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 32%),
        linear-gradient(315deg, rgba(255, 31, 31, 0.09), transparent 38%),
        var(--panel);
    box-shadow: var(--shadow-1);
}

/* ============================================================
   HEADER HUD + NAV
   ============================================================ */

.deck-hud {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 0.9fr) minmax(280px, 1.3fr);
    border-left: 3px solid var(--red);
}

.hud-cell {
    min-height: 74px;
    padding: 12px 18px;
    border-right: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
}

.hud-cell:last-child {
    border-right: 0;
}

.hud-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-red);
    background: #050507;
    box-shadow: 0 0 18px rgba(255, 31, 31, 0.18), inset 0 0 0 1px rgba(255, 31, 31, 0.18);
    overflow: hidden;
}

.brand-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 31, 31, 0.55));
}

.brand-name,
.hud-cell-value {
    color: var(--white);
    font-family: var(--display);
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.brand-name {
    font-size: 1.1rem;
    letter-spacing: 0.14em;
    overflow-wrap: anywhere;
}

.hud-cell-label {
    display: block;
    color: var(--grey-3);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
}

.hud-cell-value {
    display: block;
    margin-top: 4px;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
}

.hud-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    width: 100%;
}

.hud-nav a,
.hud-nav button,
.action-button,
.table-link,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-1);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--display);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--transition), background-color var(--transition),
        border-color var(--transition), box-shadow var(--transition);
}

.hud-nav a,
.hud-nav button {
    padding: 8px 12px;
}

.hud-nav form {
    display: inline-flex;
    margin: 0;
}

/* Mobile menu button — only shown under 700px once JS tags the body. */
.nav-toggle {
    display: none;
}

.hud-nav a:hover,
.hud-nav button:hover,
.action-button:hover,
.table-link:hover,
.button-link:hover {
    color: var(--white);
    border-color: var(--red);
    background: rgba(255, 31, 31, 0.10);
}

/* ============================================================
   PANELS + BRACKET CHROME
   ============================================================ */

.hud-panel {
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.bracket {
    position: relative;
}

.bracket-inner {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bracket::before,
.bracket::after,
.bracket > .bracket-inner::before,
.bracket > .bracket-inner::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid var(--red);
    pointer-events: none;
    z-index: 3;
}

.bracket::before {
    top: 4px;
    left: 4px;
    border-right: 0;
    border-bottom: 0;
}

.bracket::after {
    top: 4px;
    right: 4px;
    border-left: 0;
    border-bottom: 0;
}

.bracket > .bracket-inner::before {
    bottom: 4px;
    left: 4px;
    border-right: 0;
    border-top: 0;
}

.bracket > .bracket-inner::after {
    bottom: 4px;
    right: 4px;
    border-left: 0;
    border-top: 0;
}

.window-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    color: var(--grey-2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.window-chrome > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--grey-1);
    font-family: var(--display);
    font-weight: 900;
}

.window-chrome > span:first-child::before {
    content: "";
    width: 6px;
    height: 16px;
    background: var(--red);
    box-shadow: 0 0 10px rgba(255, 31, 31, 0.45);
}

.live-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    color: var(--white);
    border: 1px solid var(--line-red);
    border-radius: var(--radius);
    background: rgba(255, 31, 31, 0.12);
    font-family: var(--display);
    font-weight: 900;
    font-size: 0.66rem;
    white-space: nowrap;
}

/* ============================================================
   TYPOGRAPHY ACCENTS
   ============================================================ */

.eyebrow {
    color: var(--red);
    font-family: var(--display);
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-tag {
    margin: 10px 0 0;
    color: var(--white);
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(1.55rem, 3.2vw, 2.75rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.hero-status,
.identity-line,
.muted,
.field-hint {
    color: var(--grey-2);
}

.hero-status {
    max-width: 760px;
    margin: 14px 0 0;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.identity-line strong {
    color: var(--grey-3);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.20em;
    margin-right: 8px;
    font-weight: 500;
}

/* ============================================================
   FORMS + ACTION BUTTONS
   ============================================================ */

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-grid.filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
}

.field-block {
    display: grid;
    gap: 6px;
}

.span-2,
.field-block.span-2 {
    grid-column: span 2;
}

.field-label {
    color: var(--grey-1);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.field-input {
    width: 100%;
    min-width: 0;
    color: var(--white);
    background: #050507;
    border: 1px solid var(--line-strong);
    border-left: 2px solid var(--line-red);
    border-radius: var(--radius);
    padding: 12px 13px;
    font-family: var(--mono);
    font-size: 15px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 1px rgba(255, 31, 31, 0.28);
}

textarea.field-input {
    resize: vertical;
}

.mini-input {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.submit-row,
.account-action-row,
.admin-inline-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    margin-top: 14px;
    border-top: 1px solid var(--line);
}

.action-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 15px;
}

.action-button.primary {
    color: #fff;
    border-color: var(--line-red);
    background: linear-gradient(180deg, #ff3434 0%, #c40b0b 64%, #6a0303 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.action-button.danger {
    color: var(--red);
    border-color: var(--line-red);
    background: var(--red-soft);
}

.action-button.danger:hover {
    color: #fff;
    background: var(--red);
}

/* ============================================================
   UN-LOCATED REVIEW (ADMIN IMPORT)
   ============================================================ */

.unlocated-review {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.unlocated-review > summary {
    list-style: none;
    width: 100%;
}

.unlocated-review > summary::-webkit-details-marker {
    display: none;
}

.unlocated-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.unlocated-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.30);
    border-radius: var(--radius);
}

.unlocated-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.unlocated-card img {
    width: 34px;
    height: auto;
    border-radius: 3px;
    flex: none;
}

.unlocated-name {
    font-weight: 700;
}

.unlocated-row form {
    margin: 0;
    flex: none;
}

/* ============================================================
   BANNERS + EMPTY STATES
   ============================================================ */

.error-banner,
.success-banner,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.30);
    font-size: 0.86rem;
}

.error-banner {
    border-color: var(--line-red);
    background: rgba(255, 31, 31, 0.14);
}

.success-banner {
    border-color: rgba(92, 242, 255, 0.42);
    background: rgba(92, 242, 255, 0.09);
}

.empty-state {
    color: var(--grey-1);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ============================================================
   CATEGORY LANES
   ============================================================ */

.lane-grid,
.product-grid {
    display: grid;
    gap: 14px;
}

.lane-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lane-card {
    min-height: 220px;
    padding: 20px;
    color: inherit;
    text-decoration: none;
    display: grid;
    align-content: space-between;
}

.lane-card,
.product-card {
    transition: border-color var(--transition), box-shadow var(--transition),
        transform var(--transition);
}

.lane-card:hover,
.product-card:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-1), var(--glow-red);
    transform: translateY(-2px);
}

.lane-title {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.lane-copy {
    color: var(--grey-2);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ============================================================
   TABS
   ============================================================ */

.account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.account-tabs a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: var(--grey-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color var(--transition), background-color var(--transition),
        border-color var(--transition);
}

.account-tabs a:hover,
.account-tabs a.active {
    color: var(--white);
    border-color: var(--red);
    background: rgba(255, 31, 31, 0.14);
}

/* ============================================================
   SUMMARY STAT GRIDS
   ============================================================ */

.account-summary-grid,
.overlay-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.window-chrome + .account-summary-grid {
    margin-top: 12px;
    margin-bottom: 14px;
}

.account-summary-grid div,
.overlay-stats-grid div {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.28);
}

.account-summary-grid strong,
.overlay-stats-grid strong {
    color: var(--grey-3);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.account-summary-grid span,
.overlay-stats-grid span {
    color: var(--white);
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

/* ============================================================
   PRODUCT CARDS (STOREFRONT)
   ============================================================ */

.product-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.product-card {
    display: grid;
    grid-template-rows: 230px auto auto;
    overflow: hidden;
}

.product-media {
    display: grid;
    place-items: center;
    min-height: 230px;
    max-height: 230px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.38);
    border-bottom: 1px solid var(--line);
    color: var(--grey-3);
    font-family: var(--display);
    font-weight: 900;
    letter-spacing: 0.12em;
}

.product-media img {
    max-width: 100%;
    max-height: 214px;
    object-fit: contain;
}

.image-zoom-trigger {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
}

.image-zoom-trigger:hover img,
.image-zoom-trigger:focus-visible img {
    filter: brightness(1.12);
}

.image-zoom-trigger:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
}

.product-body,
.product-actions {
    padding: 14px;
}

.product-head,
.product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.product-head {
    justify-content: space-between;
}

.product-card h2 {
    margin: 12px 0 4px;
    color: var(--white);
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.product-price {
    color: var(--white);
    font-family: var(--display);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.product-meta span {
    padding: 3px 8px;
    color: var(--white);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.product-desc {
    color: var(--grey-1);
    font-size: 0.92rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* ============================================================
   PAGER
   ============================================================ */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.pager-status {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--grey-1);
}

.action-button.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   NAV BADGES + NOTICE FLAG
   ============================================================ */

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--grey-1);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.nav-signin {
    background: var(--red);
    color: var(--white) !important;
    padding: 7px 16px;
    border: 1px solid var(--red);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.nav-signin:hover {
    background: transparent;
    color: var(--red) !important;
}

.nav-messages {
    position: relative;
}

.nav-messages.has-alert {
    color: var(--white) !important;
    border-color: var(--amber);
    background: rgba(255, 179, 71, 0.12);
}

.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 2px;
    background: var(--red);
    color: #fff;
    border-radius: 9px;
    font-size: 0.68rem;
    line-height: 18px;
    text-align: center;
    vertical-align: middle;
}

.site-notice-flag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    color: var(--white);
    text-decoration: none;
    border: 1px solid rgba(255, 179, 71, 0.68);
    background:
        linear-gradient(90deg, rgba(255, 179, 71, 0.18), rgba(255, 31, 31, 0.08)),
        rgba(0, 0, 0, 0.48);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.site-notice-flag strong {
    color: var(--amber);
    font-family: var(--display);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-notice-flag span {
    color: var(--grey-1);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ============================================================
   ADMIN TABS + CLAIM CELLS
   ============================================================ */

.admin-tabs {
    margin-top: 14px;
    flex-wrap: wrap;
}

.message-card.unread {
    border-left: 3px solid var(--red);
}

.claim-item-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.claim-thumb {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border: 1px solid var(--line);
    flex: 0 0 auto;
    background: rgba(0, 0, 0, 0.3);
}

.thumb-trigger {
    width: 40px;
    height: 56px;
    flex: 0 0 auto;
}

.product-actions {
    display: grid;
    gap: 8px;
    align-content: end;
    border-top: 1px solid var(--line);
}

.product-actions form {
    margin: 0;
}

.claim-lock {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-4);
    color: var(--grey-2);
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
}

/* ============================================================
   STATUS PILLS
   ============================================================ */

.claim-status {
    display: inline-flex;
    padding: 3px 8px;
    color: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--display);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.claim-status-available,
.claim-status-active {
    border-color: var(--line-red);
    background: rgba(255, 31, 31, 0.10);
}

.claim-status-claimed,
.claim-status-paid,
.claim-status-ready,
.claim-status-pending {
    border-color: rgba(255, 179, 71, 0.55);
    background: rgba(255, 179, 71, 0.10);
}

.claim-status-sold,
.claim-status-shipped,
.claim-status-picked_up,
.claim-status-done {
    border-color: rgba(92, 242, 255, 0.55);
    background: rgba(92, 242, 255, 0.11);
}

.claim-status-hidden,
.claim-status-draft,
.claim-status-canceled,
.claim-status-released,
.claim-status-error {
    color: var(--grey-2);
    border-color: var(--grey-4);
    background: rgba(0, 0, 0, 0.34);
}

.claim-status-error {
    color: var(--white);
    border-color: var(--line-red);
    background: rgba(255, 31, 31, 0.16);
}

/* ============================================================
   ADMIN TOOLBAR + TABLES
   ============================================================ */

.admin-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 180px 160px auto;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 16px;
}

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.28);
}

.admin-table-wrap::-webkit-scrollbar {
    height: 8px;
}

.admin-table-wrap::-webkit-scrollbar-thumb {
    background: var(--grey-4);
    border-radius: 4px;
}

.admin-table-wrap::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}

.compact-wrap {
    margin: 14px 0;
}

.compact-wrap .admin-table {
    min-width: 420px;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.admin-table th,
.admin-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--grey-3);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.admin-table td {
    color: var(--grey-1);
}

.admin-table small {
    display: block;
    color: var(--grey-3);
    overflow-wrap: anywhere;
}

.claim-display {
    display: block;
    color: var(--white);
    font-family: var(--display);
    font-weight: 900;
    letter-spacing: 0.07em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

/* ============================================================
   ADMIN ITEM CARDS + MESSAGES
   ============================================================ */

.admin-item-list,
.message-list {
    display: grid;
    gap: 12px;
}

.admin-item-card,
.message-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.30);
    padding: var(--space-4);
}

.admin-user-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-user-title {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-user-title span {
    color: var(--white);
    font-family: var(--display);
    font-weight: 900;
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.admin-user-title small {
    color: var(--grey-3);
    font-size: 0.7rem;
    letter-spacing: 0.10em;
}

.admin-user-card-actions {
    display: flex;
    gap: 8px;
}

.stock-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--grey-1);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.button-link {
    padding: 7px 10px;
}

.admin-inline-actions form,
.table-form,
.reply-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.assign-form {
    flex: 1 1 320px;
}

.message-form {
    margin-bottom: 14px;
}

.message-card {
    display: grid;
    gap: 6px;
}

.message-card strong {
    color: var(--red);
    font-family: var(--display);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.message-card.from-admin strong {
    color: var(--cyan);
}

.message-card span,
.message-card small {
    color: var(--grey-3);
    font-size: 0.74rem;
}

.message-card p {
    margin: 0;
    color: var(--grey-1);
    overflow-wrap: anywhere;
}

/* ============================================================
   IMPORT PREVIEW + PAYLOADS
   ============================================================ */

.import-preview {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.payload-preview {
    max-width: 720px;
    max-height: 220px;
    margin: 8px 0 0;
    padding: 10px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--grey-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.42);
    font-size: 0.72rem;
}

.error-text {
    color: var(--amber);
    overflow-wrap: anywhere;
}

.webhook-hint {
    margin-top: 12px;
    overflow-wrap: anywhere;
}

/* ============================================================
   FOOTER
   ============================================================ */

.deck-foot {
    color: var(--grey-3);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1020px) {
    .deck-hud,
    .lane-grid,
    .field-grid.filters,
    .field-grid.compact,
    .admin-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .hud-cell {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .hud-cell:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 700px) {
    .deck-shell {
        width: calc(100vw - 16px);
        padding: 10px 0 28px;
    }

    .deck-hud,
    .lane-grid,
    .field-grid,
    .field-grid.filters,
    .field-grid.compact,
    .admin-toolbar {
        grid-template-columns: 1fr;
    }

    .span-2,
    .field-block.span-2 {
        grid-column: span 1;
    }

    .hud-panel {
        padding: 16px;
    }

    .hud-nav {
        justify-content: flex-start;
    }

    .hero-tag {
        font-size: 1.35rem;
        letter-spacing: 0.08em;
    }

    .action-button,
    .account-tabs a,
    .hud-nav a,
    .hud-nav button,
    .site-notice-flag {
        width: 100%;
    }

    .site-notice-flag {
        align-items: flex-start;
        flex-direction: column;
    }

    .submit-row,
    .account-action-row,
    .admin-user-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    /* Two-up product browsing on phones — card-shop style. */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-card {
        grid-template-rows: 150px auto auto;
    }

    .product-media {
        min-height: 150px;
        max-height: 150px;
    }

    .product-media img {
        max-height: 138px;
    }

    .product-card h2 {
        font-size: 0.85rem;
    }

    .product-body,
    .product-actions {
        padding: 10px;
    }

    /* Lane cards carry too much chrome for half-width; stack them. */
    .lane-card {
        min-height: 150px;
        padding: 16px;
    }

    .hud-nav a,
    .hud-nav button {
        min-height: 44px;
    }

    /* The decorative status cell crowds small screens. */
    .status-cell {
        display: none;
    }

    /* Let the pill drop under the label instead of squeezing it,
       and never force a pill wider than its panel. */
    .window-chrome {
        flex-wrap: wrap;
    }

    .live-pill {
        max-width: 100%;
        white-space: normal;
    }

    /* Collapsible nav (JS-gated; without JS the nav simply stays open). */
    body.js-nav .nav-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    body.js-nav .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        width: 100%;
        padding: 8px 12px;
        color: var(--grey-1);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.03);
        font-family: var(--display);
        font-size: 0.7rem;
        font-weight: 900;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        cursor: pointer;
    }

    body.js-nav .nav-toggle[aria-expanded="true"] {
        color: var(--white);
        border-color: var(--red);
        background: rgba(255, 31, 31, 0.10);
    }

    body.js-nav .hud-nav {
        display: none;
    }

    body.js-nav .hud-nav.nav-open {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    body.js-nav .hud-nav.nav-open form {
        display: flex;
    }

    /* Comfortable touch targets for inline admin controls. */
    .mini-input,
    .table-link,
    .button-link {
        min-height: 44px;
    }
}

/* ============================================================
   SCAN TICKER
   ============================================================ */

.scan-ticker {
    margin: 14px 0 4px;
    padding: 12px 16px;
    border: 1px solid var(--red);
    background: rgba(255, 31, 31, 0.08);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
}

.scan-ticker-label {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--grey-1);
    font-size: 0.72rem;
}

.scan-ticker-value {
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--white);
}

.scan-ticker-sub {
    color: var(--grey-2);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    width: 100%;
}

/* ============================================================
   IMAGE LIGHTBOX
   ============================================================ */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.86);
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox-panel {
    position: relative;
    display: grid;
    gap: 12px;
    max-width: min(94vw, 760px);
    max-height: 94vh;
    padding: 14px;
    border: 1px solid var(--line);
    background: rgba(8, 8, 10, 0.96);
}

.image-lightbox img {
    max-width: 100%;
    max-height: calc(94vh - 90px);
    object-fit: contain;
}

.image-lightbox-title {
    color: var(--grey-1);
    font-family: var(--display);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.image-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.72);
    color: var(--white);
    cursor: pointer;
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
    border-color: var(--red);
    outline: none;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Keyboard focus ring (text inputs keep their red border treatment). */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="file"]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .lane-card:hover,
    .product-card:hover {
        transform: none;
    }
}
