:root {
    --shell-navy: #17233c;
    --shell-navy-soft: #223250;
    --shell-blue: #2f6fed;
    --shell-blue-hover: #255dcc;
    --shell-bg: #f4f6f9;
    --shell-card: #ffffff;
    --shell-text: #1f2937;
    --shell-muted: #6b7280;
    --shell-border: #e2e7ef;
    --shell-border-strong: #d5dce7;
    --shell-header-height: 68px;
    --shell-nav-height: 48px;
    --shell-radius: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--shell-bg);
    color: var(--shell-text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.shell {
    min-height: 100vh;
}

.shell-header {
    min-height: var(--shell-header-height);
    background: var(--shell-navy);
    color: #ffffff;
}

.shell-header__inner {
    width: 100%;
    min-height: var(--shell-header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.shell-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.shell-brand__link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.shell-brand__mark {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    font-size: 18px;
    font-weight: 700;
}

.shell-brand__name {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.shell-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    margin-right: 8px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.shell-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px 0;
    border-radius: 999px;
    background: #ffffff;
}

.shell-account {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shell-company,
.shell-user {
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.055);
}

.shell-company {
    max-width: 260px;
    padding: 6px 12px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.shell-company__eyebrow {
    color: rgba(255, 255, 255, 0.64);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.07em;
    line-height: 1.2;
    text-transform: uppercase;
}

.shell-company__name {
    width: 100%;
    overflow: hidden;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-user {
    max-width: 300px;
    padding: 5px 10px 5px 6px;
    gap: 9px;
}

.shell-user__avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--shell-navy);
    font-size: 12px;
    font-weight: 750;
}

.shell-user__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shell-user__name,
.shell-user__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-user__name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.shell-user__email {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.shell-navigation {
    min-height: var(--shell-nav-height);
    border-bottom: 1px solid var(--shell-border);
    background: #ffffff;
}

.shell-navigation__inner {
    min-height: var(--shell-nav-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
}

.shell-navigation__placeholder {
    display: flex;
    align-items: center;
    gap: 24px;
}

.shell-navigation__placeholder span {
    display: block;
    width: 72px;
    height: 8px;
    border-radius: 999px;
    background: #edf0f5;
}

.shell-navigation__placeholder span:nth-child(2) {
    width: 52px;
}

.shell-navigation__placeholder span:nth-child(3) {
    width: 64px;
}

.shell-navigation__placeholder span:nth-child(4) {
    width: 58px;
}

.shell-navigation__placeholder span:nth-child(5) {
    width: 74px;
}

.shell-main {
    min-height: calc(
        100vh - var(--shell-header-height) - var(--shell-nav-height)
    );
}

.shell-main__inner {
    width: 100%;
    padding: 24px;
}

.shell-page-head {
    min-height: 62px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.shell-breadcrumb {
    margin-bottom: 5px;
    color: var(--shell-muted);
    font-size: 12px;
}

.shell-page-title {
    margin: 0;
    color: var(--shell-text);
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.025em;
}

.shell-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shell-content-card,
.shell-state__card {
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius);
    background: var(--shell-card);
}

.shell-content-card {
    min-height: 360px;
}

.shell-content-card__empty {
    min-height: 360px;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.shell-content-card__empty h2,
.shell-state__card h1 {
    margin: 0 0 8px;
    color: var(--shell-text);
    font-weight: 650;
}

.shell-content-card__empty h2 {
    font-size: 18px;
}

.shell-content-card__empty p,
.shell-state__card p {
    max-width: 560px;
    margin: 0;
    color: var(--shell-muted);
}

.shell-state {
    min-height: calc(
        100vh - var(--shell-header-height) - var(--shell-nav-height) - 48px
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.shell-state--ready {
    min-height: 0;
    display: block;
}

.shell-state__card {
    width: min(100%, 560px);
    padding: 44px 32px;
    text-align: center;
}

.shell-state__card h1 {
    font-size: 22px;
    letter-spacing: -0.02em;
}

.shell-state__card p {
    margin-right: auto;
    margin-left: auto;
}

.shell-state__icon,
.shell-state__spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
}

.shell-state__icon {
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef3ff;
    color: var(--shell-blue);
    font-size: 18px;
    font-weight: 750;
}

.shell-state__spinner {
    border: 3px solid #e5e9f0;
    border-top-color: var(--shell-blue);
    border-radius: 50%;
    animation: shell-spin 0.75s linear infinite;
}

.shell-button {
    min-height: 38px;
    margin-top: 22px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.shell-button--primary {
    background: var(--shell-blue);
    color: #ffffff;
}

.shell-button--primary:hover {
    background: var(--shell-blue-hover);
}

@keyframes shell-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .shell-header__inner,
    .shell-navigation__inner,
    .shell-main__inner {
        padding-right: 18px;
        padding-left: 18px;
    }

    .shell-company {
        max-width: 210px;
    }

    .shell-user {
        max-width: 220px;
    }

    .shell-user__email {
        display: none;
    }
}

@media (max-width: 680px) {
    :root {
        --shell-header-height: 60px;
        --shell-nav-height: 0px;
    }

    .shell-header__inner {
        min-height: var(--shell-header-height);
        padding-right: 12px;
        padding-left: 12px;
        gap: 12px;
    }

    .shell-menu-toggle {
        display: block;
    }

    .shell-brand__mark {
        display: none;
    }

    .shell-brand__name {
        font-size: 18px;
    }

    .shell-company {
        display: none;
    }

    .shell-user {
        max-width: none;
        min-height: 38px;
        padding: 3px;
        border: 0;
        background: transparent;
    }

    .shell-user__avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .shell-user__text {
        display: none;
    }

    .shell-navigation {
        min-height: 0;
        border-bottom: 0;
        overflow: hidden;
        max-height: 0;
        transition: max-height 160ms ease;
    }

    .shell-navigation.is-mobile-open {
        max-height: 180px;
        border-bottom: 1px solid var(--shell-border);
    }

    .shell-navigation__inner {
        min-height: 0;
        padding: 14px 16px;
    }

    .shell-navigation__placeholder {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 11px;
    }

    .shell-navigation__placeholder span,
    .shell-navigation__placeholder span:nth-child(n) {
        width: 100%;
        max-width: 180px;
    }

    .shell-main__inner {
        padding: 18px 14px;
    }

    .shell-page-head {
        min-height: 52px;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .shell-page-title {
        font-size: 23px;
    }

    .shell-state {
        min-height: calc(100vh - var(--shell-header-height) - 36px);
    }

    .shell-state--ready {
        min-height: 0;
    }

    .shell-state__card {
        padding: 34px 22px;
    }

    .shell-content-card,
    .shell-content-card__empty {
        min-height: 300px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shell-state__spinner {
        animation-duration: 1.8s;
    }

    .shell-navigation {
        transition: none;
    }
}


.route-state {
    min-height: 320px;
}

.route-state__card {
    min-height: 320px;
    padding: 44px 28px;
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.route-state__card h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 650;
}

.route-state__card p {
    max-width: 560px;
    margin: 0;
    color: var(--shell-muted);
}

.route-state__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.route-home {
    min-height: 360px;
    padding: 34px;
}

.route-home__intro {
    max-width: 720px;
}

.route-home__eyebrow {
    color: var(--shell-blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.route-home h2 {
    margin: 7px 0 9px;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.025em;
}

.route-home p {
    margin: 0;
    color: var(--shell-muted);
}

.route-home__status {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--shell-border);
    border-radius: 9px;
    overflow: hidden;
}

.route-home__status > div {
    min-height: 92px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.route-home__status > div + div {
    border-left: 1px solid var(--shell-border);
}

.route-home__status strong {
    margin-bottom: 4px;
    font-size: 13px;
}

.route-home__status span {
    color: var(--shell-muted);
    font-size: 12px;
}

@media (max-width: 680px) {
    .route-home {
        min-height: 300px;
        padding: 24px 20px;
    }

    .route-home__status {
        grid-template-columns: 1fr;
    }

    .route-home__status > div + div {
        border-top: 1px solid var(--shell-border);
        border-left: 0;
    }
}


/* CTB-02.4 — visual refinement layer */

.shell-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shell-header__inner {
    min-height: 62px;
}

.shell-brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 16px;
}

.shell-brand__name {
    font-size: 18px;
    letter-spacing: -0.018em;
}

.shell-company,
.shell-user {
    min-height: 40px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
}

.shell-company:hover,
.shell-user:hover {
    background: rgba(255, 255, 255, 0.075);
}

.shell-company:focus-visible,
.shell-user:focus-visible,
.shell-menu-toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.2);
    outline-offset: 1px;
}

.shell-user__avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 11px;
}

.shell-main__inner {
    padding-top: 22px;
}

.shell-page-head {
    margin-bottom: 14px;
}

.shell-breadcrumb {
    margin-bottom: 4px;
    color: #788291;
}

.shell-page-title {
    font-size: 24px;
}

.shell-content-card {
    border-color: #e2e7ef;
    box-shadow: none;
}

.route-home {
    min-height: 320px;
    padding: 30px;
}

.route-home__status {
    background: #fbfcfd;
}

@media (max-width: 680px) {
    .shell-header__inner {
        min-height: 58px;
    }

    .shell-main__inner {
        padding-top: 16px;
    }

    .shell-page-title {
        font-size: 22px;
    }
}

/* CTB-02.5 — canonical application container + sticky workspace */

:root {
    --shell-container-max: 1320px;
    --shell-container-gutter: 32px;
}

html {
    scroll-padding-top: calc(
        var(--shell-nav-height)
        + 18px
    );
}

.app-container {
    width: min(
        calc(
            100%
            - (var(--shell-container-gutter) * 2)
        ),
        var(--shell-container-max)
    );
    margin-right: auto;
    margin-left: auto;
}

.shell-header {
    position: relative;
    z-index: 110;
}

.shell-navigation {
    position: sticky;
    z-index: 100;
    top: 0;
}

.shell-header__inner,
.shell-navigation__inner {
    padding-right: 0;
    padding-left: 0;
}

.shell-main__inner {
    padding-right: 0;
    padding-left: 0;
}

.shell-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.4;
}

.shell-breadcrumb span + span::before {
    margin: 0 7px;
    color: #b1b8c3;
    content: "/";
}

@media (max-width: 900px) {
    :root {
        --shell-container-gutter: 20px;
    }

    .shell-header__inner,
    .shell-navigation__inner,
    .shell-main__inner {
        padding-right: 0;
        padding-left: 0;
    }
}

@media (max-width: 680px) {
    :root {
        --shell-container-gutter: 14px;
    }

    .shell-header__inner,
    .shell-main__inner {
        padding-right: 0;
        padding-left: 0;
    }

    .shell-navigation__inner {
        width: 100%;
        padding: 14px var(--shell-container-gutter);
    }

    .shell-navigation {
        top: 0;
    }
}
