@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Sora:wght@600;700&display=swap');

:root {
    --rx-content-offset: 236px;
    --rx-bg-0: #f2f7fb;
    --rx-bg-1: #e7f0f8;
    --rx-bg-2: #dce8f3;
    --rx-panel: #f7fbff;
    --rx-panel-strong: #ffffff;
    --rx-line: #c5d6e8;
    --rx-text: #0f233a;
    --rx-muted: #4b5d73;
    --rx-accent: #0b7ac6;
    --rx-accent-2: #13a06f;
    --rx-shadow: 0 20px 45px rgba(18, 63, 102, 0.14);
}

.theme-dark {
    --rx-bg-0: #081523;
    --rx-bg-1: #0c1f31;
    --rx-bg-2: #122a40;
    --rx-panel: #10263a;
    --rx-panel-strong: #0f2235;
    --rx-line: #295070;
    --rx-text: #eaf3ff;
    --rx-muted: #9db5cc;
    --rx-accent: #3ab6ff;
    --rx-accent-2: #44d9a2;
    --rx-shadow: 0 24px 52px rgba(0, 0, 0, 0.35);
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif !important;
    background:
        radial-gradient(circle at 8% 8%, rgba(46, 142, 214, 0.16), transparent 45%),
        radial-gradient(circle at 88% 10%, rgba(19, 160, 111, 0.12), transparent 40%),
        linear-gradient(145deg, var(--rx-bg-0) 0%, var(--rx-bg-1) 54%, var(--rx-bg-2) 100%) !important;
    color: var(--rx-text) !important;
}

.site-header {
    position: fixed !important;
    top: 16px !important;
    left: 14px !important;
    bottom: 16px !important;
    width: 208px !important;
    border-radius: 24px !important;
    border: 1px solid var(--rx-line) !important;
    background: color-mix(in srgb, var(--rx-panel) 88%, transparent) !important;
    box-shadow: var(--rx-shadow) !important;
    backdrop-filter: blur(16px) !important;
    z-index: 120 !important;
    overflow: hidden !important;
}

.site-nav {
    height: 100% !important;
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
}

.site-nav-left {
    border-bottom: 1px solid color-mix(in srgb, var(--rx-line) 75%, transparent) !important;
    padding: 14px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.brand-stack {
    min-width: 0;
}

.site-nav-quick {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(56px, 1fr));
    align-items: center;
    gap: 8px;
    width: 100%;
}

.site-nav-quick .site-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 6px 8px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem !important;
}

.site-nav-quick .nav-greeting {
    grid-column: 1 / -1;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    max-width: 100%;
    text-align: left;
}

.site-nav-quick .nav-mail-link,
.site-nav-quick .nav-bell-link {
    min-width: 56px !important;
    min-height: 34px !important;
    line-height: 1 !important;
    font-size: 1rem !important;
}

.site-nav-separator {
    height: 1px;
    width: 100%;
    margin: 2px 0 0;
    background: color-mix(in srgb, var(--rx-line) 72%, transparent);
}

.site-nav-link.nav-logout-link-sidebar {
    margin-top: 2px;
    border-color: color-mix(in srgb, #cf4a5f 50%, var(--rx-line)) !important;
    background: color-mix(in srgb, #2a1820 42%, var(--rx-panel-strong)) !important;
}

.mobile-header-brand {
    display: none;
}

.brand-link {
    position: relative;
    display: inline-block;
    animation: brandFloat 2.8s ease-in-out infinite;
}

.brand-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(108, 194, 255, 0.9) 45%, transparent 100%);
    transform: scaleX(0.7);
    transform-origin: center;
    animation: brandLinePulse 2.8s ease-in-out infinite;
}

.nav-sidebar-toggle {
    display: none;
}

.mobile-nav-fab {
    display: none;
}

.brand-link {
    font-family: 'Sora', 'Manrope', sans-serif !important;
    font-size: 1.06rem !important;
    letter-spacing: 0.01em !important;
    color: var(--rx-text) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.brand-version {
    color: #c6daf5 !important;
    font-size: 0.78rem !important;
    font-weight: 700;
}

.site-nav-drawer {
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 1fr !important;
}

.site-nav-drawer-top {
    display: none;
}

.site-nav-drawer-brand,
.site-nav-drawer-quick {
    display: none;
}

.site-nav-drawer .site-nav-right {
    display: none !important;
}

.site-nav-center {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 14px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.site-nav-link {
    width: 100% !important;
    border-radius: 12px !important;
    border: 1px solid color-mix(in srgb, var(--rx-line) 70%, transparent) !important;
    background: color-mix(in srgb, var(--rx-panel-strong) 88%, transparent) !important;
    color: var(--rx-text) !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    padding: 10px 12px !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.site-nav-link:hover {
    transform: translateX(2px) !important;
    border-color: color-mix(in srgb, var(--rx-accent) 55%, var(--rx-line)) !important;
}

.site-nav-link.active {
    border-color: color-mix(in srgb, var(--rx-accent) 70%, var(--rx-line)) !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--rx-accent) 16%, var(--rx-panel-strong)), color-mix(in srgb, var(--rx-accent-2) 9%, var(--rx-panel-strong))) !important;
    box-shadow: 0 8px 20px rgba(11, 122, 198, 0.2) !important;
}

.site-nav-right {
    display: none !important;
}

.nav-greeting {
    color: var(--rx-muted) !important;
    font-size: 0.72rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-page .chat-panel {
    border: 1px solid rgba(108, 158, 234, 0.28) !important;
    background: linear-gradient(170deg, rgba(9, 25, 48, 0.96) 0%, rgba(8, 20, 40, 0.95) 100%) !important;
}

.chat-page .chat-list {
    border-radius: 14px;
    border: 1px solid rgba(112, 160, 232, 0.24);
    background: linear-gradient(180deg, rgba(8, 22, 44, 0.92) 0%, rgba(6, 17, 35, 0.92) 100%);
    padding: 12px;
}

.chat-page .chat-bubble {
    border: 1px solid rgba(114, 159, 229, 0.3);
    background: linear-gradient(165deg, rgba(13, 35, 67, 0.96) 0%, rgba(10, 27, 51, 0.96) 100%);
    border-radius: 14px;
}

.chat-page .chat-item-own .chat-bubble {
    border-color: rgba(94, 179, 255, 0.36);
    background: linear-gradient(160deg, rgba(18, 52, 92, 0.96) 0%, rgba(13, 36, 67, 0.96) 100%);
}

.chat-page .chat-form textarea {
    border-radius: 12px;
    border-color: rgba(107, 152, 221, 0.4);
    background: rgba(9, 23, 45, 0.95);
}

@media (max-width: 820px) {
    .chat-page .chat-panel {
        padding: 12px !important;
    }

    .chat-page .chat-list {
        max-height: 52vh;
        padding: 10px;
    }

    .chat-page .chat-item,
    .chat-page .chat-item-own {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 8px;
    }

    .chat-page .chat-bubble {
        max-width: 96%;
        padding: 9px 10px;
    }
}

.mobile-bottom-nav {
    display: none !important;
}

.page {
    margin-left: var(--rx-content-offset) !important;
    margin-right: 18px !important;
    margin-top: 14px !important;
    margin-bottom: 18px !important;
    width: auto !important;
    max-width: none !important;
    display: block !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    min-height: calc(100vh - 32px) !important;
    padding: 18px !important;
}

body .page.app-page,
body .page.dashboard-page,
body .page.inventory-page {
    display: block !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    margin-left: var(--rx-content-offset) !important;
    padding: 18px !important;
}

.app-shell,
.dashboard-shell,
.dashboard-live,
.settings-shell,
.inventory-shell,
.admin-shell,
.marketing-shell,
.marketplace-shell,
.owner-inbox-shell,
.commission-shell,
.shipments-shell,
.transactions-shell,
.preparation-shell {
    width: 100% !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
}

body.inventory-body .app-shell,
body.inventory-body .inventory-shell {
    max-width: min(1520px, calc(100vw - 220px)) !important;
}

body.outbound-body .app-shell,
body.outbound-body .outbound-shell {
    width: 100% !important;
    max-width: min(1520px, calc(100vw - 220px)) !important;
    margin: 0 auto !important;
}

body.outbound-body .outbound-shell .action-card {
    width: 100% !important;
    max-width: none !important;
}

body.outbound-body .outbound-shell .inline-form,
body.outbound-body .outbound-shell .row-2.compact {
    width: 100% !important;
}

body.outbound-body .outbound-shell .row-2.compact {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
}

body:not(.dashboard-body):not(.inventory-body) .app-shell {
    max-width: 1320px !important;
}

body .dashboard-live {
    display: grid !important;
    align-content: start !important;
    gap: 14px !important;
}

body.dashboard-body .page,
body.dashboard-body .page.app-page {
    margin-left: calc(var(--rx-content-offset) + 6px) !important;
    max-width: calc(100vw - var(--rx-content-offset) - 18px) !important;
    padding: 20px !important;
}

body.dashboard-body .page > .app-shell.dashboard-live {
    width: 100% !important;
    max-width: 1020px !important;
    margin: 0 auto !important;
    justify-self: stretch !important;
}

body.dashboard-body .dashboard-top-row,
body.dashboard-body .dashboard-hero,
body.dashboard-body .kpi-grid,
body.dashboard-body .chart-grid,
body.dashboard-body .recent-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

body.dashboard-body .kpi-grid-primary,
body.dashboard-body .kpi-grid-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

body.dashboard-body .chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body.dashboard-body .dashboard-hero {
    background: linear-gradient(165deg, #0a1a31 0%, #09162a 55%, #081222 100%) !important;
    border: 1px solid rgba(104, 145, 210, 0.28) !important;
    box-shadow: 0 18px 36px rgba(2, 8, 20, 0.42) !important;
}

body.dashboard-body .dashboard-rank-card,
body.dashboard-body .chart-card,
body.dashboard-body .recent-card {
    background: linear-gradient(165deg, #09182f 0%, #081426 55%, #061120 100%) !important;
    border: 1px solid rgba(100, 141, 206, 0.25) !important;
    box-shadow: 0 16px 34px rgba(1, 7, 20, 0.45) !important;
}

body.dashboard-body .dashboard-rank-card {
    animation: softPulseCard 3.2s ease-in-out infinite;
}

body.dashboard-body .dashboard-greeting {
    font-size: clamp(2rem, 2.4vw, 2.55rem) !important;
    line-height: 1.15 !important;
}

body.dashboard-body .kpi-value {
    font-size: clamp(1.45rem, 1.95vw, 2.05rem) !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em;
    line-height: 1.06 !important;
}

body.dashboard-body .kpi.card {
    padding: 7px 9px !important;
    min-height: 76px !important;
}

body.dashboard-body .kpi h2 {
    font-size: 1.03rem !important;
}

body.dashboard-body .dashboard-version-pill {
    position: absolute;
    top: 10px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    z-index: 2;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #dff1ff;
    border: 1px solid rgba(118, 178, 245, 0.46);
    background: rgba(7, 27, 49, 0.84);
}

body.dashboard-body .dashboard-version-pill span {
    letter-spacing: 0;
    line-height: 1;
}

body.dashboard-body .dashboard-rank-card strong[data-animate-number] {
    font-size: 1.36rem !important;
    font-weight: 800 !important;
}

body.dashboard-body .profit-expense-table-card tbody td:nth-child(2) {
    color: #53d6a6 !important;
    font-weight: 700;
}

body.dashboard-body .profit-expense-table-card tbody td:nth-child(3) {
    color: #ff9a47 !important;
    font-weight: 700;
}

body.inventory-body .page.inventory-page {
    padding-inline: clamp(14px, 2vw, 30px) !important;
}

body.inventory-body .inventory-shell {
    max-width: min(1520px, calc(100vw - 220px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.inventory-body .inventory-shell .card,
body.inventory-body .inventory-shell .table-card,
body.inventory-body .inventory-shell .chart-card {
    margin-left: auto !important;
    margin-right: auto !important;
}

@keyframes softPulseCard {
    0%, 100% {
        box-shadow: 0 16px 34px rgba(1, 7, 20, 0.45);
    }
    50% {
        box-shadow: 0 18px 40px rgba(56, 123, 218, 0.28);
    }
}

@keyframes glowSlide {
    0% {
        transform: translateX(-140%);
        opacity: 0;
    }
    30% {
        opacity: 0.34;
    }
    100% {
        transform: translateX(150%);
        opacity: 0;
    }
}

@keyframes brandFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

@keyframes brandLinePulse {
    0%, 100% { opacity: 0.35; transform: scaleX(0.6); }
    50% { opacity: 0.9; transform: scaleX(1); }
}

body.dashboard-body .dashboard-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 0%, rgba(105, 188, 255, 0.18) 45%, transparent 80%);
    animation: glowSlide 4.5s ease-in-out infinite;
}

body.dashboard-body .dashboard-rank-card h2,
body.dashboard-body .dashboard-rank-card .dashboard-level-totalxp,
body.dashboard-body .dashboard-rank-card .dashboard-level-subline,
body.dashboard-body .dashboard-hero h1,
body.dashboard-body .dashboard-hero .dashboard-summary-line,
body.dashboard-body .chart-card h2,
body.dashboard-body .recent-card h2,
body.dashboard-body .chart-card,
body.dashboard-body .recent-card {
    color: #dce9ff !important;
}

body.dashboard-body .dashboard-hero .muted,
body.dashboard-body .dashboard-rank-card .muted,
body.dashboard-body .chart-card .muted,
body.dashboard-body .recent-card .muted {
    color: #9ab0cd !important;
}

body.dashboard-body .dashboard-level-corner,
body.dashboard-body .dashboard-level-corner-action {
    background: rgba(12, 28, 51, 0.9) !important;
    border-color: rgba(121, 168, 236, 0.35) !important;
    color: #dce9ff !important;
}

body.dashboard-body .dashboard-summary-metric.is-neutral {
    color: #dce9ff !important;
}

body.dashboard-body .dashboard-growth-arrow.is-up,
body.dashboard-body .dashboard-summary-metric.is-positive {
    color: #53d6a6 !important;
}

body.dashboard-body .dashboard-growth-arrow.is-down,
body.dashboard-body .dashboard-summary-metric.is-negative {
    color: #ff8b8b !important;
}

.card,
.chart-card,
.kpi.card,
.table-card,
.form-card,
.dashboard-hero,
.dashboard-license-news,
.dashboard-rank-card,
.license-status-card {
    border-radius: 18px !important;
    border: 1px solid color-mix(in srgb, var(--rx-line) 70%, transparent) !important;
    background: color-mix(in srgb, var(--rx-panel-strong) 90%, transparent) !important;
    box-shadow: 0 14px 34px rgba(16, 48, 84, 0.11) !important;
}

h1,
h2,
.card h1,
.card h2 {
    font-family: 'Sora', 'Manrope', sans-serif !important;
    color: var(--rx-text) !important;
    letter-spacing: 0.01em;
}

.button-link,
button,
input[type='submit'] {
    border-radius: 12px !important;
    border: 1px solid color-mix(in srgb, var(--rx-line) 75%, transparent) !important;
}

.button-link.primary,
button.primary,
input[type='submit'].primary {
    background: linear-gradient(135deg, var(--rx-accent), color-mix(in srgb, var(--rx-accent) 65%, var(--rx-accent-2))) !important;
    color: #fff !important;
    border-color: color-mix(in srgb, var(--rx-accent) 70%, #0b4f81) !important;
}

input,
select,
textarea {
    border-radius: 12px !important;
    border: 1px solid color-mix(in srgb, var(--rx-line) 74%, transparent) !important;
    background: color-mix(in srgb, var(--rx-panel-strong) 92%, transparent) !important;
    color: var(--rx-text) !important;
}

.table-scroll {
    overflow-x: auto;
}

.sales-table,
.inventory-table,
.transactions-table,
.shipments-table,
.owner-inbox-table,
.preparation-table,
.marketplace-item-table,
.marketplace-daily-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid color-mix(in srgb, var(--rx-line) 70%, transparent);
    border-radius: 14px;
    overflow: hidden;
}

.sales-table th,
.inventory-table th,
.transactions-table th,
.shipments-table th,
.owner-inbox-table th,
.preparation-table th,
.marketplace-item-table th,
.marketplace-daily-table th {
    background: color-mix(in srgb, var(--rx-accent) 9%, var(--rx-panel));
}

.site-nav-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    html,
    body {
        overscroll-behavior-y: none !important;
        overflow-x: clip !important;
    }

    .site-header {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: auto !important;
        height: 64px !important;
        border-radius: 0 !important;
        border-inline: 0 !important;
        box-shadow: 0 12px 26px rgba(8, 23, 39, 0.2) !important;
        backdrop-filter: none !important;
        overflow: visible !important;
        z-index: 1003 !important;
    }

    .site-nav {
        height: 64px !important;
        grid-template-rows: 1fr !important;
        position: relative !important;
        overflow: visible !important;
    }

    .site-nav-left {
        border-bottom: 0 !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 12px 10px !important;
        gap: 0 !important;
        position: relative !important;
    }

    .brand-stack,
    .brand-link,
    .brand-version,
    .site-nav-left .brand-stack {
        display: none !important;
    }

    .brand-link {
        font-size: 0.92rem !important;
        max-width: 108px;
    }

    .mobile-header-brand {
        display: grid !important;
        justify-items: center;
        line-height: 1.05;
        pointer-events: none;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translateX(-50%) translateY(-50%) !important;
        text-align: center;
        width: 100%;
        max-width: min(250px, calc(100% - 112px));
        z-index: 140;
        overflow: hidden;
    }

    .mobile-header-brand-title {
        font-family: 'Sora', 'Manrope', sans-serif !important;
        font-size: 0.96rem !important;
        font-weight: 700 !important;
        color: #e8f1ff !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .mobile-header-brand-version {
        font-size: 0.66rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em;
        color: #9fb6d8 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .brand-version {
        display: none;
    }

    .site-nav-quick {
        display: none !important;
    }

    .site-nav-quick .site-nav-link {
        width: auto !important;
        min-width: 30px !important;
        flex: 0 0 auto !important;
    }

    .site-nav-quick .nav-greeting {
        display: none;
    }

    .site-nav-quick .nav-logout-link {
        display: inline-flex !important;
        padding: 6px 8px !important;
        font-size: 0.66rem !important;
        width: auto !important;
        min-width: 44px;
        justify-content: center;
    }

    .site-nav-quick .nav-logout-link::before {
        content: none;
    }

    .site-nav-quick .nav-mail-link,
    .site-nav-quick .nav-bell-link {
        min-width: 28px !important;
        padding: 5px !important;
        font-size: 0.78rem !important;
    }

    .nav-sidebar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid color-mix(in srgb, var(--rx-line) 75%, transparent);
        background: color-mix(in srgb, var(--rx-panel-strong) 90%, transparent);
        color: var(--rx-text);
        font-size: 1.1rem;
        cursor: pointer;
        position: absolute !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 151 !important;
    }

    .mobile-nav-fab {
        position: fixed !important;
        top: max(12px, env(safe-area-inset-top)) !important;
        left: 12px !important;
        z-index: 1100 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 13px !important;
        border: 1px solid rgba(121, 162, 230, .34) !important;
        background: rgba(6, 17, 32, .94) !important;
        color: #f3f8ff !important;
        box-shadow: 0 18px 44px rgba(0, 0, 0, .34) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        font-size: 1.25rem !important;
        line-height: 1 !important;
        cursor: pointer !important;
    }

    body.nav-drawer-open .mobile-nav-fab {
        border-color: rgba(79, 140, 255, .72) !important;
        background: linear-gradient(135deg, rgba(79, 140, 255, .94), rgba(53, 221, 255, .54)) !important;
    }

    .site-nav-drawer {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(84vw, 320px) !important;
        background: #08172c !important;
        border-right: 1px solid color-mix(in srgb, var(--rx-line) 75%, transparent) !important;
        box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28) !important;
        transform: translateX(-102%) !important;
        transition: transform 0.24s ease !important;
        z-index: 1002 !important;
        padding-top: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        pointer-events: auto !important;
        grid-template-rows: auto 1fr !important;
    }

    .site-nav-drawer-top {
        display: grid !important;
        gap: 5px;
        padding: 6px 10px;
        border-bottom: 1px solid color-mix(in srgb, var(--rx-line) 65%, transparent);
        background: rgba(7, 24, 42, 0.92);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .site-nav-drawer-top {
        display: none !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .site-nav-drawer-brand {
        display: grid !important;
        gap: 2px;
        font-family: 'Sora', 'Manrope', sans-serif !important;
        color: #dce9ff !important;
        line-height: 1.2;
    }

    .site-nav-drawer-brand-title {
        font-size: 0.98rem !important;
        font-weight: 700 !important;
        color: #e8f1ff !important;
    }

    .site-nav-drawer-version {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        color: #a8c1e5 !important;
    }

    .site-nav-drawer-quick {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .site-nav-drawer-quick .nav-greeting {
        display: inline-flex !important;
        flex: 1 0 100%;
        font-size: 0.7rem !important;
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-nav-drawer-quick .nav-mail-link,
    .site-nav-drawer-quick .nav-bell-link {
        display: inline-flex !important;
    }

    .site-nav-drawer-quick .site-nav-link {
        width: auto !important;
        min-width: 26px !important;
        padding: 5px 6px !important;
        font-size: 0.68rem !important;
        flex: 0 0 auto;
    }

    .site-nav-drawer-quick .nav-logout-link {
        min-width: 64px !important;
        font-size: 0.72rem !important;
        font-weight: 700;
        display: inline-flex !important;
    }

    .site-nav-right,
    .site-nav-drawer .site-nav-right,
    .site-nav-center .site-nav-right,
    .site-nav-center .nav-mail-link,
    .site-nav-center .nav-bell-link,
    .site-nav-center .nav-greeting {
        display: none !important;
    }

    .site-nav-center .nav-logout-link.nav-logout-link-sidebar {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .site-nav-center .site-nav-separator {
        display: block !important;
    }

    body.nav-drawer-open .site-nav-drawer {
        transform: translateX(0) !important;
        pointer-events: auto !important;
    }

    .site-nav-drawer,
    .site-nav-drawer * {
        pointer-events: auto !important;
    }

    .site-nav-right {
        grid-template-columns: 1fr auto auto auto;
    }

    .site-nav-backdrop {
        display: block !important;
        position: fixed !important;
        inset: 64px 0 0 0 !important;
        background: rgba(2, 10, 24, 0.56) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.2s ease !important;
        z-index: 1001 !important;
    }

    body.nav-drawer-open .site-nav-backdrop {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    body.nav-drawer-open .page {
        filter: none !important;
    }

    .page {
        margin: 72px 0 0 0 !important;
        min-height: calc(100vh - 72px) !important;
        padding: 12px !important;
        overflow-x: clip !important;
    }

    body .page.app-page,
    body .page.dashboard-page,
    body .page.inventory-page {
        margin: 72px 0 0 0 !important;
        padding: 12px !important;
    }

    body.inventory-body .inventory-shell {
        max-width: 100% !important;
    }

    body.outbound-body .app-shell,
    body.outbound-body .outbound-shell {
        max-width: 100% !important;
    }

    body.dashboard-body .kpi-grid-primary,
    body.dashboard-body .kpi-grid-secondary,
    body.dashboard-body .chart-grid {
        grid-template-columns: 1fr !important;
    }

    body.dashboard-body .kpi-value {
        font-size: clamp(1.25rem, 5.8vw, 1.7rem) !important;
    }
}

/* iPhone/Safari safety net: force mobile layout even when viewport width heuristics fail. */
@media (hover: none) and (pointer: coarse) {
    html,
    body {
        overflow-x: clip !important;
        max-width: 100% !important;
        overscroll-behavior-y: none !important;
    }

    .site-header {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: auto !important;
        height: 64px !important;
        border-radius: 0 !important;
    }

    .site-nav {
        position: relative !important;
    }

    .site-nav-left {
        position: relative !important;
        justify-content: flex-start !important;
    }

    .mobile-header-brand {
        display: grid !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translateX(-50%) translateY(-50%) !important;
        text-align: center;
        pointer-events: none !important;
        width: 100%;
        max-width: min(250px, calc(100% - 112px));
        overflow: hidden;
        z-index: 140 !important;
    }

    .site-nav-drawer-top {
        display: grid !important;
    }

    .site-nav-drawer-brand {
        display: grid !important;
    }

    .site-nav-drawer-quick {
        display: inline-flex !important;
    }

    .nav-sidebar-toggle {
        position: absolute !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 151 !important;
    }

    body .page,
    body .page.app-page,
    body .page.dashboard-page,
    body .page.inventory-page {
        margin: 72px 0 0 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        overflow-x: clip !important;
    }

    body .app-shell,
    body .dashboard-live,
    body .inventory-shell,
    body .outbound-shell,
    body .marketplace-shell,
    body .settings-shell,
    body .owner-inbox-shell,
    body .admin-shell,
    body .marketing-shell,
    body .commission-shell,
    body .shipments-shell,
    body .transactions-shell,
    body .preparation-shell {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        overflow-x: clip !important;
    }

    body.dashboard-body .page,
    body.dashboard-body .page.app-page,
    body.dashboard-body .page.dashboard-page {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.dashboard-body .page > .app-shell.dashboard-live,
    body.dashboard-body .dashboard-live {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        justify-self: stretch !important;
    }

    body.dashboard-body .dashboard-top-row,
    body.dashboard-body .kpi-grid-primary,
    body.dashboard-body .kpi-grid-secondary,
    body.dashboard-body .chart-grid {
        grid-template-columns: 1fr !important;
    }

    body.dashboard-body .dashboard-version-pill {
        display: none !important;
    }

    body.dashboard-body .dashboard-level-corner-wrap {
        position: static !important;
        justify-content: flex-start !important;
        margin: 0 0 8px 0 !important;
        width: 100% !important;
    }

    body.dashboard-body .dashboard-summary-line {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    body.dashboard-body .dashboard-hero {
        padding-top: 14px !important;
        overflow-x: clip !important;
    }
}

@media (max-width: 820px) {
    body .app-shell,
    body .app-shell > article,
    body .card,
    body .table-card {
        min-width: 0 !important;
    }

    body .table-scroll {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 1024px) {
    .mobile-header-brand {
        display: grid !important;
        position: fixed !important;
        left: 50vw !important;
        top: 32px !important;
        transform: translate(-50%, -50%) !important;
        justify-items: center !important;
        align-content: center !important;
        width: auto !important;
        min-width: 150px !important;
        max-width: min(230px, calc(100vw - 130px)) !important;
        text-align: center !important;
        pointer-events: none !important;
        z-index: 160 !important;
    }

    .mobile-header-brand-title {
        font-size: 1.05rem !important;
        font-weight: 850 !important;
        line-height: 1.05 !important;
        color: #f2f7ff !important;
        letter-spacing: 0 !important;
    }

    .mobile-header-brand-version {
        margin-top: 2px !important;
        font-size: 0.66rem !important;
        font-weight: 800 !important;
        line-height: 1 !important;
        color: #a8bad7 !important;
        letter-spacing: 0 !important;
    }

    .site-nav-drawer {
        width: min(76vw, 300px) !important;
        padding: 8px 10px 16px !important;
        overflow-y: auto !important;
    }

    .site-nav-drawer-top {
        display: grid !important;
        justify-items: center !important;
        gap: 6px !important;
        padding: 2px 0 10px !important;
        margin: 0 0 10px !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(96, 148, 210, 0.22) !important;
        background: transparent !important;
        position: sticky !important;
        top: 0 !important;
    }

    .site-nav-drawer-brand {
        display: none !important;
    }

    .site-nav-drawer-brand-title {
        font-size: 0.98rem !important;
        font-weight: 800 !important;
    }

    .site-nav-drawer-version {
        font-size: 0.66rem !important;
    }

    .site-nav-drawer-quick {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(44px, auto)) !important;
        justify-content: center !important;
        justify-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .site-nav-drawer-quick .nav-greeting {
        display: flex !important;
        grid-column: 1 / -1 !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
        font-size: 0.74rem !important;
        color: #b8c8e2 !important;
    }

    .site-nav-drawer-quick .nav-mail-link,
    .site-nav-drawer-quick .nav-bell-link {
        min-width: 38px !important;
        min-height: 32px !important;
        padding: 5px 8px !important;
        border-radius: 12px !important;
        justify-content: center !important;
    }

    .site-nav-center {
        gap: 8px !important;
    }

    .site-nav-center .site-nav-link {
        min-height: 38px !important;
        border-radius: 12px !important;
        padding: 8px 10px !important;
        font-size: 0.86rem !important;
    }
}
