.app-shell {
    display: flex;
    flex: 1 0 auto;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.side {
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    flex: 0 0 260px;
    background: var(--card);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 20;
}

.side-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    padding: 14px 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #0c0e12;
}

.side-head .brand {
    min-width: 0;
}

.side-head .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-head .who {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-head .brand img,
.side-bar .brand img {
    width: 40px;
    height: 40px;
    padding: 7px;
    box-shadow: 0 0 0 1px rgba(61, 255, 166, 0.4);
}

.side-close {
    display: none;
}

.side-chop {
    display: block;
    margin: 8px 8px 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 180, 180, 0.55);
    border-radius: 12px;
    background: rgba(255, 180, 180, 0.1);
    color: var(--text);
    text-decoration: none;
}

.side-chop[hidden] { display: none; }

.side-chop-title {
    display: block;
    font-weight: 700;
    color: var(--danger);
}

.side-chop-note {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.35;
}

.side-chop-track {
    display: block;
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.side-chop-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
}

.side-chop:hover,
.side-chop:focus-visible {
    background: rgba(255, 180, 180, 0.16);
}

.side-chop:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

.side-analytics {
    padding: 0 12px 8px;
}
.side-analytics-title {
    margin: 0 0 6px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.side-analytics-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.side-analytics-list li {
    min-width: 0;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}
.side-analytics-list span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.3;
}
.side-analytics-list strong {
    display: block;
    margin-top: 2px;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}
.side-analytics-more {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--green);
    text-decoration: none;
}
.side-analytics-more:hover,
.side-analytics-more:focus-visible {
    text-decoration: underline;
}

.side-label {
    margin: 14px 12px 4px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.side-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    min-height: 0;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
}

.side-nav .nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-nav .nav-count {
    margin-left: auto;
    min-width: 1.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.side-nav a:hover,
.side-out button:hover {
    background: rgba(255, 255, 255, 0.04);
}

.side-nav a[aria-current="page"] {
    color: var(--green);
    background: rgba(61, 255, 166, 0.08);
    box-shadow: inset 3px 0 0 var(--green);
}

.side-nav a[aria-current="page"] .nav-count {
    background: var(--green);
    color: var(--green-ink);
}

.side-nav a:focus-visible,
.side-toggle:focus-visible,
.side-close:focus-visible,
.side-out button:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.side-foot {
    flex: 0 0 auto;
    background: #0c0e12;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.side-out {
    margin-top: 0;
    padding: 4px 8px 12px;
    border-top: 0;
}

.side-out button {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app-column {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.side-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 60px;
    padding: 8px 16px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: #0c0e12;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-bar .brand {
    display: flex;
    flex: 0 0 auto;
}

.side-bar .brand span {
    display: none;
}

.side-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-bar .who {
    flex: 0 1 auto;
    max-width: 42%;
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-toggle {
    display: none;
}

.side-backdrop {
    display: none;
}

@media (max-width: 767px) {
    .app-shell {
        display: block;
    }

    .side-bar .who {
        max-width: 34%;
        padding: 4px 8px;
        font-size: 0.82rem;
    }

    .side-toggle,
    .side-close {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        min-height: 44px;
        padding: 8px 14px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 999px;
        background: transparent;
        color: var(--text);
        font: inherit;
        cursor: pointer;
    }

    .side {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, calc(100vw - 48px));
        max-width: 100%;
        transform: translateX(-105%);
        transition: transform 160ms ease;
        z-index: 40;
        overflow: hidden;
    }

    body.side-open .side {
        transform: none;
    }

    body.side-open {
        overflow: hidden;
    }

    body.side-open .side-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        border: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.55);
    }

    .app-column .ship-filters {
        top: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .side {
        transition: none;
    }
}
