/* 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 */
    --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;

    /* Interaction accent — ice blue */
    --brand: #2997FF;
    --brand-hover: #5AC8FA;
    --accent: #C7C7CC; /* titanium silver (decorative) */
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    /* Layered blacks */
    --page-bg: #070708;
    --content-bg: #0C0D0F;
    --surface: #111215;
    --surface-raised: #181A1F;
    --surface-muted: #1C1E24;
    --glass: rgba(25, 27, 32, 0.68);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #F5F5F7;
    --text-muted: #A1A1AA;
    --text-dim: #71717A;

    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.28);

    /* 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) —— */
.app-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background: #070708;
}

.app-background::before {
    content: "";
    position: absolute;
    width: 700px;
    height: 700px;
    top: -300px;
    right: -200px;
    background: radial-gradient(
        circle,
        rgba(70, 120, 255, 0.14) 0%,
        rgba(70, 120, 255, 0.05) 38%,
        transparent 70%
    );
    filter: blur(30px);
    animation: ambient-drift 24s ease-in-out infinite alternate;
    will-change: transform;
}

.app-background::after {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -280px;
    left: 10%;
    background: radial-gradient(
        circle,
        rgba(125, 90, 255, 0.09),
        transparent 68%
    );
    filter: blur(45px);
    animation: ambient-drift-secondary 30s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes ambient-drift {
    from { transform: translate3d(-20px, -10px, 0) scale(1); }
    to { transform: translate3d(-110px, 80px, 0) scale(1.16); }
}

@keyframes ambient-drift-secondary {
    from { transform: translate3d(-40px, 30px, 0); }
    to { transform: translate3d(130px, -70px, 0) scale(1.12); }
}

.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;
    opacity: 0.025;
    mix-blend-mode: soft-light;
    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: var(--mouse-x);
    top: var(--mouse-y);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(
        circle,
        rgba(90, 150, 255, 0.04) 0%,
        rgba(90, 150, 255, 0.015) 35%,
        transparent 62%
    );
    filter: blur(28px);
    will-change: left, top;
}

@keyframes glass-reflection {
    0%, 65% { left: -70%; }
    100% { left: 140%; }
}

/* —— Glass material —— */
.glass-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.075),
            rgba(255, 255, 255, 0.025)
        ),
        rgba(18, 19, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.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: -70%;
    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);
    animation: glass-reflection 12s ease-in-out infinite;
}

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

.matte-surface {
    background: var(--surface);
    border: 1px solid var(--border);
    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.08),
            rgba(255, 255, 255, 0.02)
        ),
        rgba(18, 19, 23, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    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: -70%;
    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);
    animation: glass-reflection 14s ease-in-out infinite;
}

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

.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: linear-gradient(
        110deg,
        #8e7137 0%,
        #efd48c 36%,
        #fff0b9 50%,
        #c49d4c 72%,
        #7d612d 100%
    );
    background-size: 220% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: brand-gold-shimmer 6s ease-in-out infinite;
}

@keyframes brand-gold-shimmer {
    0%, 68%, 100% { background-position: 100% center; }
    82% { background-position: 0 center; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-brand .brand-golden {
        animation: none;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.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;
}

.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;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0.02)
        ),
        rgba(18, 19, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    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: -70%;
    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);
    animation: glass-reflection 12s ease-in-out infinite;
}

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

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

.topbar-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-lg);
    color: var(--text);
}

.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;
}

/* 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: rgba(22, 24, 29, 0.98);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    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-sidebar {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        margin: 0.5rem;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        border-radius: 14px;
    }
    .sidebar-brand {
        border-bottom: none;
        margin-bottom: 0;
        padding: 0.25rem 0.5rem;
        width: auto;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
    }
    .sidebar-footer {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .sidebar-user { margin-bottom: 0; }
    .app-main { margin-left: 0; }
    .app-topbar { margin: 0.5rem 0.75rem 0; }
}

/* —— Page header —— */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.35rem;
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0 0 0.2rem;
    color: var(--text);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-display);
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

.kpi-value,
.inv-stat-value,
.stat-card .stat-value {
    font-size: var(--text-kpi);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-display);
}

.label-caps {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--text-muted);
}

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

.card.glass-panel,
.card.glass-metric {
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

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

.card-header h5,
.card-header .h5 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-lg);
    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)),
        rgba(25, 27, 32, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.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: rgba(255, 255, 255, 0.06);
    --bs-table-hover-bg: var(--surface-raised);
    --bs-table-hover-color: var(--text);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.06);
    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: rgba(17, 18, 21, 0.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.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;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0.02)
        ),
        rgba(18, 19, 23, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    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(-3px);
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.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(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    position: relative;
}

.stat-card .stat-value {
    font-size: var(--text-kpi);
    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 {
    background: rgba(41, 151, 255, 0.2);
    color: #5AC8FA;
    border: 1px solid rgba(90, 200, 250, 0.35);
    font-weight: 700;
    animation: livePulse 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; transform: scale(1); }
    50% { opacity: 0.82; transform: scale(0.98); }
}

.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); }

/* —— 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(75, 90, 130, 0.14), transparent 40%),
        radial-gradient(ellipse 60% 40% at 15% 90%, rgba(41, 151, 255, 0.06), transparent 50%),
        #070708;
}

.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.075),
            rgba(255, 255, 255, 0.025)
        ),
        rgba(18, 19, 23, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    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,
.modal-content {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        rgba(18, 19, 23, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !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 {
        animation: none;
    }
}
