/* Live Inventory — Liquid Glass · layered blacks · ice blue accent */

:root {
    --font-display: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Type scale (dense data — keep values stable) */
    --text-xs: 0.6875rem;   /* 11 */
    --text-sm: 0.8125rem;   /* 13 */
    --text-base: 0.875rem;  /* 14 */
    --text-lg: 1.0625rem;   /* 17 */
    --text-xl: 1.1875rem;   /* 19 */
    --text-2xl: 1.75rem;    /* 28 */
    --text-3xl: 1.875rem;   /* 30 */
    --text-kpi: 1.625rem;
    --leading-tight: 1.15;
    --leading-snug: 1.35;
    --leading-body: 1.5;
    --tracking-label: 0.04em;
    --tracking-display: -0.02em;

    /* Role type tokens — pages declare intent, not pixels */
    --type-display: clamp(2.5rem, 4.5vw, 3.5rem); /* page title: 40–56px */
    --type-section: 1.75rem;                     /* 28px — clear step above cards */
    --type-card: 1.125rem;                       /* 18px item/card title */
    --type-body: 0.875rem;
    --type-meta: 0.8125rem;
    --type-label: 0.75rem;                       /* uppercase eyebrow */
    --type-kpi: 2.5rem;
    --weight-display: 600;
    --weight-section: 700;

    /* Spacing ladder */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --section-gap: clamp(2.5rem, 5vw, 4rem);

    /* Interaction accent — ice blue. Despite the name, --brand is what the app
       uses for anything clickable; the brand colour is gold, below. */
    --brand: #2997FF;
    --brand-hover: #5AC8FA;
    --accent: #C7C7CC; /* titanium silver (decorative) */
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    /* Brand gold — chrome only. Shared with landing.css so the public page and
       the app cannot drift. Gold sits within a few degrees of --warning and of
       the gold material swatch, so it must never mark a status or a material:
       next to those it stops reading as brand and starts reading as data. */
    --gold: #d9b45b;
    --gold-rgb: 217, 180, 91; /* for rgba() washes and rules */
    --gold-light: #f1d691;
    --gold-dark: #927331;
    --gold-sheen: #fff0b9; /* specular highlight in the metallic ramp */
    --gold-metal: linear-gradient(
        110deg,
        var(--gold-dark) 0%,
        var(--gold-light) 36%,
        var(--gold-sheen) 50%,
        var(--gold) 72%,
        var(--gold-dark) 100%
    );

    /* Layered blacks */
    --page-bg: #070708;
    --content-bg: #0C0D0F;
    --surface: #111215;
    --surface-raised: #181A1F;
    --surface-muted: #1C1E24;
    --glass: rgba(25, 27, 32, 0.68);
    /* Solid stand-in for glass when backdrop-filter is off (same look over dark bg) */
    --glass-solid: rgb(28, 30, 36);
    --surface-glass:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        rgba(28, 30, 38, 0.92);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.24);
    --text: #F5F5F7;
    --text-muted: #A1A1AA;
    --text-dim: #71717A;

    --radius-inset: 12px;
    --radius: 18px;
    --radius-sm: 11px;
    --radius-feature: 22px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
    --shadow-feature: 0 28px 70px rgba(0, 0, 0, 0.55);

    /* Motion — restrained */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-snap: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur-fast: 140ms;
    --dur: 180ms;
    --dur-slow: 220ms;

    --mouse-x: 65%;
    --mouse-y: 20%;
}

/* —— Ambient background (light, not data) —— */
/* Gold → black site wash. Origin sits just past the sidebar so the gold
   reads in the main column (viewport 0,0 is buried under the nav). Content
   bottom-right stays near-black. No live blur — softness is in the stops. */
.app-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(
            ellipse 110% 85% at 18% 0%,
            rgba(var(--gold-rgb), 0.68) 0%,
            rgba(var(--gold-rgb), 0.32) 20%,
            rgba(80, 60, 22, 0.48) 38%,
            rgba(18, 14, 8, 0.92) 56%,
            #070708 72%,
            #000000 100%
        ),
        #070708;
}

/* Soft specular bloom on top of the wash — keeps the corner luminous without
   another competing hue. Anchored into the main column, not the sidebar. */
.app-background::before {
    content: "";
    position: absolute;
    width: 55vmax;
    height: 45vmax;
    top: -16vmax;
    left: max(0px, calc(220px - 8vmax));
    background: radial-gradient(
        circle,
        rgba(var(--gold-rgb), 0.32) 0%,
        rgba(var(--gold-rgb), 0.1) 42%,
        transparent 70%
    );
}

.app-background::after {
    display: none;
}

.inventory-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.background-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    /* Heavier than the old 0.025 wash — the brand reference is a matte film grain,
       not a whisper. Still below the point where it fights type. */
    opacity: 0.11;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}

.cursor-glow {
    position: fixed;
    width: 340px;
    height: 340px;
    left: 0;
    top: 0;
    /* JS moves this via transform only (compositor) — never left/top */
    transform: translate3d(-999px, -999px, 0) translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    /* Softness in the gradient — no live filter:blur / permanent will-change */
    background: radial-gradient(
        circle,
        rgba(90, 150, 255, 0.05) 0%,
        rgba(90, 150, 255, 0.02) 32%,
        transparent 62%
    );
}

/* —— Glass material ——
   Cards use solid-glass (look-alike over dark bg). Real backdrop-filter
   stays on sticky chrome (.app-sidebar / .app-topbar / .modal-content). */
.glass-panel {
    position: relative;
    overflow: hidden;
    background: var(--surface-glass);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-feature);
    box-shadow:
        var(--shadow-feature),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.12),
        transparent 24%,
        transparent 72%,
        rgba(255, 255, 255, 0.035)
    );
    z-index: 0;
}

.glass-panel::after {
    content: "";
    position: absolute;
    top: -50%;
    left: 62%;
    width: 45%;
    height: 200%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.055),
        transparent
    );
    transform: rotate(18deg);
}

.glass-panel > * {
    position: relative;
    z-index: 1;
}

.matte-surface {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: none;
}

/* —— Status capsules —— */
.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.status--available {
    color: #A7F3D0;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.20);
}

.status--low {
    color: #FDE68A;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.20);
}

.status--out {
    color: #FCA5A5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.20);
}

/* —— Base —— */
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--text);
    background: transparent;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.logger-mode {
    background: transparent;
    padding-bottom: env(safe-area-inset-bottom);
}

body.logger-mode .app-sidebar,
body.logger-mode .app-topbar { display: none; }
body.logger-mode .app-main { margin-left: 0; }
body.logger-mode .app-content { max-width: 100%; padding: 0; }

a { color: var(--brand-hover); }
a:hover { color: #fff; }

.text-muted { color: var(--text-muted) !important; }

h1, h2, h3, h4, h5, h6,
.sidebar-brand,
.page-title,
.stat-card .stat-value {
    font-family: var(--font-display);
    letter-spacing: var(--tracking-display);
    color: var(--text);
    font-weight: 600;
}

/* —— App shell: floating glass sidebar + top bar —— */
body.has-shell {
    display: block;
}

.app-sidebar {
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    bottom: 0.85rem;
    width: 220px;
    display: flex;
    flex-direction: column;
    padding: 1.15rem 0.9rem;
    z-index: 200;
    /* glass (more opaque for large panel) */
    background:
        linear-gradient(
            160deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.03)
        ),
        var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.1),
        transparent 28%,
        transparent 70%,
        rgba(255, 255, 255, 0.03)
    );
    z-index: 0;
}

.app-sidebar::after {
    content: "";
    position: absolute;
    top: -50%;
    left: 58%;
    width: 45%;
    height: 200%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transform: rotate(18deg);
}

.app-sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.sidebar-head .sidebar-brand {
    flex: 1;
}

.nav-close,
.nav-toggle,
.nav-backdrop {
    display: none;
}

.sidebar-brand {
    display: block;
    width: 100%;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.55rem;
    line-height: 1.1;
    color: transparent !important;
    text-decoration: none;
    letter-spacing: -0.04em;
    padding: 0.55rem 0.5rem 1.2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.85rem;
}

.sidebar-brand .brand-games {
    background: linear-gradient(180deg, #ffffff 0%, #e7e7e9 40%, #96969c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.sidebar-brand .brand-golden {
    background: var(--gold-metal);
    background-size: 220% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Thin scrollbar so long menus stay usable on short viewports */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    color: var(--text-muted) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    transition:
        background var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.sidebar-link::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: 999px;
    background: var(--brand-hover);
    transform: translateY(-50%);
    opacity: 0;
    transition:
        height var(--dur) var(--ease-out),
        opacity var(--dur) var(--ease-out);
}

.sidebar-link .nav-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    opacity: 0.8;
    stroke-width: 2;
}

.sidebar-link:hover .nav-icon,
.sidebar-link.active .nav-icon {
    opacity: 1;
    color: var(--text);
}

.sidebar-link:hover {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: var(--text) !important;
    background: rgba(41, 151, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(90, 200, 250, 0.28);
}

.sidebar-link.active::before {
    height: 58%;
    opacity: 1;
}

.sidebar-link.active .nav-icon {
    color: var(--brand-hover);
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.sidebar-subnav {
    display: none;
    flex-direction: column;
    gap: 0.08rem;
    margin: 0.05rem 0 0.2rem;
    padding: 0.15rem 0 0.1rem 1.15rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    margin-left: 1.15rem;
}

.sidebar-group.is-open .sidebar-subnav {
    display: flex;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    color: var(--text-muted) !important;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition:
        background var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out);
}

.sidebar-sublink:hover {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-sublink.active {
    color: var(--text) !important;
    background: rgba(41, 151, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(90, 200, 250, 0.24);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
    margin-top: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user {
    font-size: var(--text-sm);
    color: var(--text-dim);
    margin-bottom: 0.55rem;
    padding: 0 0.25rem;
    font-weight: 500;
}

.app-main {
    margin-left: calc(220px + 1.7rem);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.auth-main {
    min-height: 100vh;
}

.app-topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 100;
    margin: 0.75rem 1.25rem 0;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.09),
            rgba(255, 255, 255, 0.03)
        ),
        var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.app-topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.1),
        transparent 30%,
        transparent 75%,
        rgba(255, 255, 255, 0.03)
    );
    z-index: 0;
}

.app-topbar::after {
    content: "";
    position: absolute;
    top: -50%;
    left: 68%;
    width: 40%;
    height: 200%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.055),
        transparent
    );
    transform: rotate(18deg);
}

.app-topbar > * {
    position: relative;
    z-index: 1;
}

.topbar-default {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.topbar-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-lg);
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Hidden until the in-content masthead scrolls out — avoids duplicate titles */
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity var(--dur) var(--ease-out),
        transform var(--dur) var(--ease-out);
    pointer-events: none;
}

.topbar-heading.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

body.logger-mode .topbar-heading,
body.no-page-masthead .topbar-heading {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.topbar-user-mobile { display: none; color: var(--text-dim); font-size: 0.85rem; }

.app-content {
    padding: 1.25rem 1.5rem 2rem;
    width: 100%;
    max-width: 1280px;
    background: transparent;
}

.nav-toggle,
.nav-close {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.nav-toggle:hover,
.nav-close:hover {
    border-color: rgba(90, 200, 250, 0.4);
    background: rgba(41, 151, 255, 0.14);
}

/* Inventory command bar (glass) */
.inv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
}

.inv-toolbar .inv-search {
    flex: 1 1 220px;
    min-width: 180px;
    position: relative;
}

.inv-toolbar .inv-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 0.5rem 1rem 0.5rem 2.55rem;
    font-size: var(--text-sm);
    font-weight: 500;
}

.inv-toolbar .inv-search input:focus {
    outline: none;
    border-color: rgba(90, 200, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.2);
}

.inv-toolbar .inv-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-dim);
    pointer-events: none;
    stroke-width: 2;
}

.inv-toolbar .inv-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.inv-toolbar .inv-select-wrap .select-icon {
    position: absolute;
    left: 0.75rem;
    width: 0.95rem;
    height: 0.95rem;
    color: var(--text-dim);
    pointer-events: none;
    z-index: 1;
    stroke-width: 2;
}

.inv-toolbar .inv-select-wrap select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.inv-toolbar .form-select,
.inv-toolbar select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 0.5rem 2rem 0.5rem 0.9rem;
    font-size: var(--text-sm);
    font-weight: 500;
    min-width: 10rem;
    color-scheme: dark;
}

/* Themed custom select (native option lists stay unreadable on Windows) */
.inv-custom-select {
    position: relative;
    min-width: 10rem;
}

.inv-custom-select__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.5rem 2rem 0.5rem 2.15rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}

.inv-custom-select__trigger:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
}

.inv-custom-select__trigger:focus-visible {
    outline: none;
    border-color: rgba(90, 200, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.18);
}

.inv-custom-select__trigger::after {
    content: "";
    position: absolute;
    right: 0.85rem;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 1.5px solid var(--text-dim);
    border-bottom: 1.5px solid var(--text-dim);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.inv-custom-select.is-open .inv-custom-select__trigger {
    border-color: rgba(90, 200, 250, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.inv-custom-select__menu {
    position: fixed;
    z-index: 1200;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: rgb(22, 24, 29);
    box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.14s var(--ease-out), transform 0.14s var(--ease-out), visibility 0.14s;
}

.inv-custom-select__menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.inv-custom-select__option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out);
}

.inv-custom-select__option:hover,
.inv-custom-select__option:focus-visible {
    outline: none;
    background: rgba(41, 151, 255, 0.16);
    color: #fff;
}

.inv-custom-select__option.is-active {
    background: rgba(41, 151, 255, 0.22);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .inv-custom-select__menu,
    .inv-custom-select__trigger,
    .inv-custom-select__option {
        transition: none;
    }
}

.inv-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.inv-cat-pills .cat-pill {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.38rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.inv-cat-pills .cat-pill:hover {
    color: var(--text);
    border-color: rgba(90, 200, 250, 0.35);
}

.inv-cat-pills .cat-pill.active {
    color: var(--text);
    background: rgba(41, 151, 255, 0.18);
    border-color: rgba(90, 200, 250, 0.4);
}

@media (max-width: 991px) {
    .app-main { margin-left: 0; }
    .app-topbar {
        top: 0;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        padding-top: max(0.65rem, env(safe-area-inset-top));
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
    .app-content {
        padding: 1rem 0.85rem calc(1.5rem + env(safe-area-inset-bottom));
    }
    .topbar-user-mobile { display: block; max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; }
    .nav-toggle { display: inline-flex; }
    .nav-close { display: inline-flex; }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 250;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.nav-open { overflow: hidden; }

    .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: min(300px, 86vw) !important;
        height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-top: none !important;
        border-bottom: none !important;
        padding:
            max(0.85rem, env(safe-area-inset-top))
            0.9rem
            max(0.85rem, env(safe-area-inset-bottom))
            max(0.9rem, env(safe-area-inset-left)) !important;
        z-index: 260 !important;
        transform: translate3d(-110%, 0, 0) !important;
        transition: transform 0.22s ease, visibility 0.22s ease !important;
        overflow: hidden !important;
        visibility: hidden;
        pointer-events: none;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }
    body.nav-open .app-sidebar {
        transform: translate3d(0, 0, 0) !important;
        visibility: visible;
        pointer-events: auto;
    }
    .sidebar-head {
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.35rem;
        padding-bottom: 0.35rem;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    .sidebar-brand {
        border-bottom: none;
        margin-bottom: 0;
        padding: 0.35rem 0.25rem;
        text-align: left;
        font-size: 1.35rem;
    }
    .sidebar-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        flex: 1;
        min-height: 0;
        gap: 0.15rem;
        padding-top: 0.5rem;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .sidebar-link {
        min-height: 44px;
        padding: 0.7rem 0.85rem;
    }
    .sidebar-footer {
        margin-top: 0.9rem;
        padding-top: 0.85rem;
        flex-shrink: 0;
    }
    .page-header {
        gap: var(--space-3);
    }
    .page-title {
        font-size: clamp(2rem, 7vw, 2.5rem);
    }
    .page-header .btn {
        min-height: 44px;
    }
}

/* —— Page masthead —— */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
    margin: 0 0 var(--section-gap);
    padding: var(--space-4) 0 var(--space-12);
    /* No fill wash — a rectangular background always hard-stops at the
       content edges and reads as a box. Site gold lives on .app-background;
       the masthead only keeps the solid rule. */
    border-bottom: 1px solid rgba(var(--gold-rgb), 0.55);
    background: none;
}

.page-header .label-caps,
.page-eyebrow {
    display: block;
    margin: 0 0 var(--space-3);
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--type-display);
    font-weight: var(--weight-display);
    margin: 0 0 var(--space-3);
    color: #fff;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.0625rem; /* 17px */
    line-height: var(--leading-snug);
    max-width: 38rem;
}

.kpi-value,
.inv-stat-value,
.stat-card .stat-value {
    font-size: var(--type-kpi);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-display);
    color: #fff;
}

.label-caps,
.page-eyebrow {
    font-size: 0.8125rem; /* 13px — readable as a real tier */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--gold);
}

/* —— Section primitives —— */
.section {
    margin-bottom: var(--section-gap);
}

.section:last-child {
    margin-bottom: 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--type-section);
    font-weight: var(--weight-section);
    letter-spacing: -0.025em;
    color: #fff;
    line-height: var(--leading-tight);
    margin: 0;
}

.section-desc {
    margin: var(--space-1) 0 0;
    color: var(--text-muted);
    font-size: var(--type-meta);
    line-height: var(--leading-snug);
    max-width: 40rem;
}

/* Four-tier elevation */
.surface-recessed {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: none;
}

.surface-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.surface-feature {
    background: var(--surface-glass);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-feature);
    box-shadow:
        var(--shadow-feature),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.surface-overlay {
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.09),
            rgba(255, 255, 255, 0.03)
        ),
        var(--glass);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* —— Cards (matte workspace by default) —— */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface-raised);
    color: var(--text);
    overflow: hidden;
}

.card.glass-panel,
.card.glass-metric {
    border-color: var(--border-strong);
    border-radius: var(--radius-feature);
    box-shadow:
        var(--shadow-feature),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.card-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.15rem;
    color: var(--text);
}

.card-header h5,
.card-header .h5 {
    font-family: var(--font-display);
    font-weight: var(--weight-section);
    font-size: var(--type-card);
    letter-spacing: var(--tracking-display);
    color: var(--text);
}

.card-body {
    background: var(--surface);
    color: var(--text);
}

.list-group-item {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.list-group-item a { color: var(--text); font-weight: 500; }
.list-group-item a:hover { color: var(--brand-hover); }

/* —— Forms (matte — data integrity) —— */
.form-control,
.form-select {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color-scheme: dark;
}

.form-select option,
select option {
    background-color: var(--surface-raised);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background: var(--surface-muted);
    border-color: rgba(90, 200, 250, 0.55);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.18);
}

.form-control::placeholder { color: var(--text-dim); }
.form-label {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* —— Buttons: primary / secondary / tertiary —— */
.btn-primary,
.btn-outline-primary,
.btn-secondary,
.btn-tertiary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary,
.primary-button {
    background: linear-gradient(
        180deg,
        rgba(80, 170, 255, 0.95),
        rgba(35, 120, 235, 0.95)
    );
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 6px 18px rgba(0, 100, 255, 0.22);
}

.btn-primary:hover,
.btn-primary:focus,
.primary-button:hover,
.primary-button:focus {
    background: linear-gradient(
        180deg,
        rgba(100, 185, 255, 0.98),
        rgba(45, 135, 245, 0.98)
    );
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 8px 22px rgba(0, 100, 255, 0.28);
}

.btn-outline-primary,
.btn-secondary,
.secondary-button {
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 600;
    border-radius: var(--radius-sm);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        var(--glass-solid);
}

.btn-outline-primary:hover,
.btn-secondary:hover,
.secondary-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(90, 200, 250, 0.35);
    color: #fff;
}

.btn-tertiary,
.tertiary-button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-tertiary:hover,
.tertiary-button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.btn-outline-light {
    border-radius: var(--radius-sm);
    font-weight: 500;
    border-color: var(--border-strong);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.btn-outline-light:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
}

.btn-sm { border-radius: 9px; }

/* —— Tables (matte, dense) —— */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: var(--surface-raised);
    --bs-table-hover-color: var(--text);
    color: var(--text);
    border-color: var(--border);
    font-variant-numeric: tabular-nums;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.06);
    border-right: none;
    border-left: none;
    color: var(--text);
}

.table th {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--text-muted) !important;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgb(17, 18, 21) !important;
}

.table td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    min-height: 48px;
    font-size: var(--text-sm);
    font-weight: 500;
}

.table-bordered > :not(caption) > * {
    border-width: 0;
    border-bottom-width: 1px;
    border-color: rgba(255, 255, 255, 0.06);
}

.table-bordered {
    border: none;
}

.table code {
    font-size: 0.85em;
    color: var(--text);
    background: var(--surface-muted);
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

/* —— Stat cards (glass summary) —— */
.stat-card,
.dashboard-card {
    border-left: none;
    padding: 1.05rem 1.15rem !important;
    position: relative;
    overflow: hidden;
    /* Nav/shortcut cards stay quieter than feature panels */
    background: var(--surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius) !important;
    box-shadow: none;
    transition:
        transform var(--dur) ease,
        border-color var(--dur) ease,
        background-color var(--dur) ease,
        box-shadow var(--dur) ease;
}

.stat-card:hover,
.dashboard-card:hover {
    transform: translateY(-2px);
    border-color: var(--border) !important;
    background: var(--surface-raised) !important;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.1),
        transparent 26%,
        transparent 74%,
        rgba(255, 255, 255, 0.03)
    );
}

.stat-card.warning { box-shadow: inset 3px 0 0 var(--warning), 0 12px 32px rgba(0, 0, 0, 0.28); }
.stat-card.danger { box-shadow: inset 3px 0 0 var(--danger), 0 12px 32px rgba(0, 0, 0, 0.28); }
.stat-card.success { box-shadow: inset 3px 0 0 var(--success), 0 12px 32px rgba(0, 0, 0, 0.28); }

.stat-card .stat-label {
    font-size: var(--type-label);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.45rem;
    position: relative;
}

.stat-card .stat-value {
    font-size: var(--type-card);
    font-weight: 600;
    line-height: var(--leading-tight);
    margin: 0;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-display);
    position: relative;
}

/* —— Badges & misc —— */
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(41, 151, 255, 0.2);
    color: #5AC8FA;
    border: 1px solid rgba(90, 200, 250, 0.35);
    font-weight: 700;
}

/* Opacity-only pulse on a tiny dot — no transform/scale (keeps compositor idle). */
.badge-live::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #5AC8FA;
    flex: 0 0 auto;
    animation: liveDotPulse 2s ease-in-out infinite;
}

.badge.bg-success {
    background: var(--surface-muted) !important;
    color: #fff !important;
    border: 1px solid var(--border-strong);
}

.badge.bg-secondary {
    background: var(--surface-muted) !important;
    color: var(--text-muted) !important;
}

.badge.bg-danger {
    background: #3a1f1f !important;
    color: var(--danger) !important;
    border: 1px solid #742a2a;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@keyframes liveDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.low-stock {
    color: var(--danger);
    font-weight: 600;
}

.alert {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.alert-danger {
    background: #2a1515;
    color: #feb2b2;
    border-color: #742a2a;
}

.alert-success {
    background: #151a15;
    color: #c6f6d5;
    border-color: #2f855a;
}

.alert-warning {
    background: #1a1810;
    color: #fefcbf;
    border-color: #744210;
}

.alert-info {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--border-strong);
}

.search-results {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    display: none;
    box-shadow: var(--shadow);
    color: var(--text);
}

.search-results.show { display: block; }

.search-result-item {
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.search-result-item:hover { background: var(--surface-muted); }
.search-result-item.selected { background: #2a2a2a; }

/* —— Schedule —— */
.schedule-table th,
.schedule-table td {
    vertical-align: middle;
    text-align: center;
}

.schedule-table thead th {
    font-size: var(--text-xs);
    background: var(--surface-muted);
}

.platform-head {
    background: #000 !important;
    color: #fff !important;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-sm) !important;
    letter-spacing: 0.02em;
    text-transform: none !important;
    padding: 0.75rem 0.5rem !important;
    border-bottom: 1px solid var(--border-strong) !important;
}

.slot-head {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted) !important;
    background: var(--surface-raised) !important;
    font-weight: 700 !important;
}

.day-label {
    text-align: left !important;
    font-family: var(--font-display);
    font-weight: 700;
    white-space: nowrap;
    min-width: 6.5rem;
    font-size: var(--text-sm);
    color: #fff;
}

.day-today {
    background: rgba(41, 151, 255, 0.08) !important;
}

.day-today .day-label {
    color: #fff;
}

.schedule-cell {
    min-width: 5.75rem;
    padding: 0.85rem 0.45rem !important;
    background: var(--surface);
}

.schedule-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-base);
    line-height: 1.25;
    color: #fff;
}

.schedule-empty {
    color: var(--text-dim);
    font-size: var(--text-sm);
    font-style: italic;
}

.schedule-notes {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.platform-tiktok { border-top: 3px solid var(--accent); }
.platform-whatnot { border-top: 3px solid var(--brand); }
.platform-tbd { border-top: 3px solid var(--text-dim); }

/* —— Channel accents (Amendment MC) ——
   Every Channel carries its own colour, set inline as --channel-accent from
   Channel.accent_color. It is a category mark, never a status — and never
   gold (gold is chrome, see the brand note at the top of this file). */
.channel-col { border-top: 3px solid var(--channel-accent, var(--accent)); }
.channel-head-link { color: inherit; text-decoration: none; }
.channel-head-link:hover { color: var(--brand-hover); }
.channel-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--channel-accent, var(--text-dim));
    flex: none;
}
.channel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-decoration: none;
}
a.channel-chip:hover { border-color: rgba(90, 200, 250, 0.35); color: var(--text); }
.channel-chip.is-active { background: rgba(90, 200, 250, 0.12); border-color: rgba(90, 200, 250, 0.4); }
.channel-chip.is-muted { color: var(--text-muted); }
.sched-channel-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.sched-mobile-channel { display: inline-flex; align-items: center; gap: 0.35rem; }
.month-stream .channel-dot { width: 0.45rem; height: 0.45rem; margin-right: 0.2rem; }

/* —— Login —— */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 70% 0%, rgba(90, 120, 180, 0.18), transparent 42%),
        radial-gradient(ellipse 60% 40% at 15% 90%, rgba(41, 151, 255, 0.08), transparent 50%),
        var(--page-bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.75rem;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.09),
            rgba(255, 255, 255, 0.03)
        ),
        var(--glass-solid);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.login-brand {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-2xl);
    color: var(--text);
    letter-spacing: var(--tracking-display);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-card .form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
}

.login-card .form-control {
    border-radius: var(--radius-sm);
    border-color: var(--border-strong);
    background: var(--surface-muted);
    color: var(--text);
    padding: 0.65rem 0.85rem;
}

.login-card .form-control:focus {
    border-color: rgba(90, 200, 250, 0.55);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.18);
}

/* —— Bootstrap dark overrides —— */
.border { border-color: var(--border) !important; }
.bg-white { background: var(--surface) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }

/* Dropdown / modal glass */
.dropdown-menu {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
        var(--glass-solid) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
    color: var(--text);
}

/* Real frosted glass — overlay above page content */
.modal-content {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
        var(--glass) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
    color: var(--text);
}

.modal.fade .modal-dialog {
    transform: scale(0.98);
    transition: transform 200ms var(--ease-out);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.dropdown-item {
    color: var(--text-muted);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(41, 151, 255, 0.14);
    color: var(--text);
}

/* —— Sale logger shared chrome —— */
body.logger-mode,
.logger {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--page-bg);
}

.logger .logger-live,
.logger .logger-stat,
.logger .last-log-name,
.logger .last-log-weight,
.logger .tap,
.logger .flash-ok {
    font-family: var(--font-display);
}

.logger .label,
.logger .last-log-label {
    letter-spacing: 0.08em;
    font-family: var(--font-body);
}

/* —— Icons —— */
.icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: -0.125em;
    stroke-width: 2;
    flex-shrink: 0;
}

.icon-sm { width: 0.9rem; height: 0.9rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }

.hub-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.hub-tab .icon,
.platform-chip .icon,
.upload-zone .icon {
    opacity: 0.9;
}

.platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.upload-zone .upload-icon {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--brand-hover);
    margin-bottom: 0.5rem;
    stroke-width: 1.75;
}

/* —— Shared motion —— */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tapPop {
    0% { transform: scale(1); }
    40% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

.motion-enter {
    animation: fadeUp var(--dur-slow) var(--ease-out) both;
}

.motion-stagger > *:nth-child(1) { animation-delay: 0ms; }
.motion-stagger > *:nth-child(2) { animation-delay: 40ms; }
.motion-stagger > *:nth-child(3) { animation-delay: 80ms; }
.motion-stagger > *:nth-child(4) { animation-delay: 120ms; }
.motion-stagger > *:nth-child(5) { animation-delay: 160ms; }
.motion-stagger > *:nth-child(6) { animation-delay: 200ms; }
.motion-stagger > *:nth-child(7) { animation-delay: 240ms; }
.motion-stagger > *:nth-child(8) { animation-delay: 280ms; }
.motion-stagger > *:nth-child(9) { animation-delay: 320ms; }
.motion-stagger > *:nth-child(10) { animation-delay: 360ms; }
.motion-stagger > *:nth-child(n+11) { animation-delay: 400ms; }

.motion-stagger > * {
    animation: fadeUp var(--dur-slow) var(--ease-out) both;
}

.hover-lift {
    transition:
        transform var(--dur) ease,
        background var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur) ease;
}

.hover-lift:hover {
    background: var(--surface-raised);
    transform: translateY(-2px);
}

.tap-feedback:active {
    animation: tapPop var(--dur-fast) var(--ease-snap);
}

.btn-primary,
.btn-outline-primary,
.cat-pill,
.hub-tab,
.sidebar-link {
    transition:
        background var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-snap),
        box-shadow var(--dur-fast) var(--ease-out);
}

.btn-primary:active,
.btn-outline-primary:active,
.cat-pill:active,
.hub-tab:active {
    transform: scale(0.98);
}

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

    .app-background::before,
    .app-background::after,
    .glass-panel::after,
    .app-sidebar::after,
    .app-topbar::after {
        animation: none !important;
    }

    .cursor-glow {
        display: none;
    }

    .hover-lift:hover,
    .stat-card:hover,
    .dashboard-card:hover,
    .inv-stat:hover {
        transform: none;
    }

    .badge-live::before {
        animation: none;
        opacity: 1;
    }
}
