/* App Shell Redesign — P2 workspace rail (GS-264 + GS-446/450). Loaded only when
   the new shell is on and the rail has groups. Mono labels, pulled active key,
   platform swatches + LIVE marker. Hub strip styles preserved (GS-286). */

.shell-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}

/* Per-workspace accent for rail chrome. */
.shell-layout[data-workspace="ai"]  { --ws-accent: #E0A63C; --ws-accent-soft: rgba(224, 166, 60, 0.12); }
.shell-layout[data-workspace="mp"]  { --ws-accent: #34C08F; --ws-accent-soft: rgba(52, 192, 143, 0.12); }
.shell-layout[data-workspace="biz"] { --ws-accent: #4B8DE8; --ws-accent-soft: rgba(75, 141, 232, 0.12); }
.shell-layout[data-workspace="admin"] { --ws-accent: #A855F7; --ws-accent-soft: rgba(168, 85, 247, 0.14); }

.shell-rail {
    flex: 0 0 236px;
    width: 236px;
    align-self: stretch;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 14px 10px 20px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary, #0C1116);
}

.shell-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 12px;
}

.shell-rail-workspace {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ws-accent);
}

.shell-rail-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.shell-rail-nav { display: flex; flex-direction: column; gap: 2px; }

.shell-rail-group { margin-bottom: 18px; }

.shell-rail-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 10px 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted, #5E6B78);
}

.shell-rail-caret { transition: transform 0.15s; opacity: 0.6; }
.shell-rail-group.is-collapsed .shell-rail-caret { transform: rotate(-90deg); }
.shell-rail-group.is-collapsed .shell-rail-items { display: none; }

.shell-rail-items { display: flex; flex-direction: column; gap: 1px; }

.shell-rail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--text-muted, #8A97A3);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    position: relative;
}

.shell-rail-pin {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.shell-rail-item:hover .shell-rail-pin,
.shell-rail-item:focus-within .shell-rail-pin,
.shell-rail-item.is-pinned .shell-rail-pin {
    opacity: 1;
}
.shell-rail-pin:hover { background: var(--ws-accent-soft); color: var(--ws-accent); }
.shell-rail-item.is-pinned .shell-rail-pin { color: var(--ws-accent); }

.shell-rail-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary, #B9C4CE);
}

/* GS-450: active = accent tint + 3px key bar pulled to rail outer edge. */
.shell-rail-item.is-active {
    background: var(--ws-accent-soft);
    color: var(--text-primary, #F4F7F9);
    font-weight: 500;
}

.shell-rail-item.is-active::before {
    content: "";
    position: absolute;
    left: -12px; /* rail padding 12px → flush with outer edge */
    top: 5px;
    bottom: 5px;
    width: 3px;
    background: var(--ws-accent);
    border-radius: 0 1px 1px 0;
}

/* All Auctions is an AI workspace surface — gold, not a platform colour. */
.shell-rail-item--all-auctions {
    color: #E0A63C;
}
.shell-rail-item--all-auctions:hover,
.shell-rail-item--all-auctions.is-active {
    color: #E0A63C;
}

/* GS-450 platform swatches + LIVE marker. */
.shell-plat-swatch {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    background: var(--plat-swatch, currentColor);
    clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
}

.shell-rail-item--plat {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-transform: uppercase;
}

.shell-rail-item--plat-pickles { --plat-swatch: var(--plat-pickles, #4E9BE8); color: var(--plat-pickles, #4E9BE8); }
.shell-rail-item--plat-manheim { --plat-swatch: var(--plat-manheim, #62B8E3); color: var(--plat-manheim, #62B8E3); }
.shell-rail-item--plat-iaai { --plat-swatch: var(--plat-iaai, #E25358); color: var(--plat-iaai, #E25358); }
.shell-rail-item--plat-autorola { --plat-swatch: var(--plat-autorola, #F5921E); color: var(--plat-autorola, #F5921E); }
.shell-rail-item--plat-copart { --plat-swatch: var(--plat-copart, #F0A04B); color: var(--plat-copart, #F0A04B); }

.shell-live-mark {
    margin-left: auto;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    color: var(--text-muted, #5E6B78);
    flex-shrink: 0;
}

.shell-rail-item--live:hover .shell-live-mark,
.shell-rail-item--live.is-active .shell-live-mark {
    color: var(--plat-swatch, var(--ws-accent));
}

/* LIVE rows: pin sits after LIVE mark when both present */
.shell-rail-item--live .shell-rail-pin {
    margin-left: 4px;
}

/* Active badge-style pin/count treatment reserved for future count badges */
.shell-rail-item.is-active .shell-rail-badge {
    color: #0B0E12;
    background: var(--ws-accent);
    font-weight: 600;
    clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%);
    border-radius: 4px 0 4px 4px;
}

/* Brand-associated auction-house shaders (Lots + Live). Idle tint + active pill. */
.shell-rail-item.shell-rail-item--plat-pickles {
    color: var(--plat-pickles);
}
.shell-rail-item.shell-rail-item--plat-pickles:hover {
    color: var(--plat-pickles);
    background: var(--plat-pickles-soft);
}
.shell-rail-item.shell-rail-item--plat-pickles.is-active {
    color: var(--plat-pickles);
    background: var(--plat-pickles-soft);
}
.shell-rail-item.shell-rail-item--plat-pickles.is-pinned .shell-rail-pin,
.shell-rail-item.shell-rail-item--plat-pickles .shell-rail-pin:hover {
    color: var(--plat-pickles);
}

.shell-rail-item.shell-rail-item--plat-iaai {
    color: var(--plat-iaai);
}
.shell-rail-item.shell-rail-item--plat-iaai:hover {
    color: var(--plat-iaai);
    background: var(--plat-iaai-soft);
}
.shell-rail-item.shell-rail-item--plat-iaai.is-active {
    color: var(--plat-iaai);
    background: var(--plat-iaai-soft);
}
.shell-rail-item.shell-rail-item--plat-iaai.is-pinned .shell-rail-pin,
.shell-rail-item.shell-rail-item--plat-iaai .shell-rail-pin:hover {
    color: var(--plat-iaai);
}

.shell-rail-item.shell-rail-item--plat-manheim {
    color: var(--plat-manheim);
}
.shell-rail-item.shell-rail-item--plat-manheim:hover {
    color: var(--plat-manheim);
    background: var(--plat-manheim-soft);
}
.shell-rail-item.shell-rail-item--plat-manheim.is-active {
    color: var(--plat-manheim);
    background: var(--plat-manheim-soft);
}
.shell-rail-item.shell-rail-item--plat-manheim.is-pinned .shell-rail-pin,
.shell-rail-item.shell-rail-item--plat-manheim .shell-rail-pin:hover {
    color: var(--plat-manheim);
}

.shell-rail-item.shell-rail-item--plat-autorola {
    color: var(--plat-autorola);
}
.shell-rail-item.shell-rail-item--plat-autorola:hover {
    color: var(--plat-autorola);
    background: var(--plat-autorola-soft);
}
.shell-rail-item.shell-rail-item--plat-autorola.is-active {
    color: var(--plat-autorola);
    background: var(--plat-autorola-soft);
}

.shell-rail-item.shell-rail-item--plat-copart {
    color: var(--plat-copart);
}
.shell-rail-item.shell-rail-item--plat-copart:hover {
    color: var(--plat-copart);
    background: var(--plat-copart-soft);
}
.shell-rail-item.shell-rail-item--plat-copart.is-active {
    color: var(--plat-copart);
    background: var(--plat-copart-soft);
}

.shell-rail-icon { flex-shrink: 0; opacity: 0.85; }
.shell-rail-item-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shell-content { flex: 1 1 auto; min-width: 0; }

/* P2 lifts the boxed max-width for flag-on app pages so content uses the width
   beside the rail. Public/doc pages keep their own measure (they are 'none'
   workspace and never hit this layout). */
.shell-page-container.shell-page-container {
    max-width: none;
    width: 100%;
}

.shell-rail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

/* Mobile: rail becomes an off-canvas drawer toggled by the mobile menu btn. */
@media (max-width: 1024px) {
    .shell-rail {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        max-height: none;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
    }
    .shell-rail.is-open { transform: translateX(0); }
    .shell-rail-close { display: block; }
    .shell-rail-overlay.is-open { display: block; }
    .shell-layout { display: block; }
    .shell-content { width: 100%; }
}

/* GS-304: lock body scroll while the mobile rail drawer is open. */
body.shell-rail-open { overflow: hidden; }
/* ===================================================================   GS-286 — My Business hubs: rail hub items + hub tab strip.
   All accents via --ws-accent tokens (rebrand GS-294/295), never hardcoded hex.
   ========================================================================== */

/* Hub rail item — a normal rail item with a trailing chevron indicating it
   opens a hub page. Reuses .shell-rail-item base styling. */
.shell-rail-item--hub .shell-rail-hub-caret {
    margin-left: auto;
    opacity: 0.5;
    flex-shrink: 0;
    transition: transform 0.12s, opacity 0.12s;
}
.shell-rail-item--hub:hover .shell-rail-hub-caret { opacity: 0.9; }
.shell-rail-item--hub.is-active .shell-rail-hub-caret { opacity: 1; }

/* Hub tab strip — sits in the page-head area above the sub-page content. */
.shell-hub {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.shell-hub-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: 10px;
    color: var(--ws-accent);
}
.shell-hub-head .shell-rail-icon { opacity: 1; }
.shell-hub-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.shell-hub-tabs {
    display: flex;
    align-items: stretch;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    flex: 1 1 auto;
}
.shell-hub-tabs::-webkit-scrollbar { height: 4px; }
.shell-hub-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.shell-hub-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px 11px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s;
    position: relative;
}
.shell-hub-tab:hover { color: var(--text-primary); }
.shell-hub-tab.is-active {
    color: var(--ws-accent);
    border-bottom-color: var(--ws-accent);
    font-weight: 600;
}

/* Connection-status dot (Sales Channels): green = active, grey = not set up. */
.shell-hub-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted);
}
.shell-hub-dot--active { background: var(--success, #34C08F); }
.shell-hub-dot--inactive { background: var(--text-muted); opacity: 0.5; }

/* Badge (counts) on a tab. */
.shell-hub-badge {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--ws-accent-soft);
    color: var(--ws-accent);
}

/* Per-tab pin affordance — GS-281 semantics, hover-reveal on pointer devices. */
.shell-hub-pin {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    line-height: 1;
    transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.shell-hub-tab:hover .shell-hub-pin,
.shell-hub-tab:focus-within .shell-hub-pin { opacity: 1; }
.shell-hub-pin:hover { background: var(--ws-accent-soft); color: var(--ws-accent); }
/* Touch devices have no hover — keep the pin visible so it stays reachable. */
@media (hover: none) {
    .shell-hub-pin { opacity: 0.6; }
}

/* 390px: the head can wrap above the tabs so the strip stays usable. */
@media (max-width: 640px) {
    .shell-hub {
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 8px 14px 0;
    }
    .shell-hub-head { padding-bottom: 4px; }
    .shell-hub-tabs { flex-basis: 100%; }
}

/* structural rail variants (lint pair) */
.shell-rail-item--plat {}
.shell-rail-item--live {}
.shell-rail-item--all-auctions {}
.shell-plat-swatch {}
.shell-live-mark {}
.shell-rail-badge {}
