body.app-shell-body {
    padding-top: 0 !important;
    min-height: 100vh;
    background: var(--shell-bg);
    color: var(--shell-text);
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: var(--shell-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px 0 16px;
    background: rgba(243, 245, 249, 0.88);
    backdrop-filter: blur(16px);
}

[data-theme="dark"] .app-header__brand,
.app-header__brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

[data-theme="dark"] .app-header {
    background: rgba(15, 23, 42, 0.88);
}

[data-theme="dark"] .app-sidebar {
    background: rgba(15, 23, 42, 0.88);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    color: var(--shell-text);
    text-decoration: none;
}

.app-brand:hover,
.app-brand:focus {
    color: var(--shell-text);
    text-decoration: none;
}

.app-brand__logo {
    display: block;
    width: 22px;
    height: auto;
}

.app-brand__copy {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.app-brand-menu {
    position: relative;
}

.app-brand-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--shell-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.app-brand-menu__toggle:hover,
.app-brand-menu__toggle:focus {
    color: var(--shell-text);
    outline: 0;
}

.app-brand-menu__toggle i {
    color: var(--shell-text-soft);
    font-size: 12px;
}

.app-brand-menu__dropdown {
    display: block;
    margin-top: 14px;
    left: 0;
    min-width: 214px;
    padding: 8px;
    border: 1px solid var(--shell-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .app-brand-menu__dropdown {
    background: rgba(17, 24, 39, 0.98);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.42);
}

.app-brand-menu__dropdown > li + li {
    margin-top: 2px;
}

.app-brand-menu__dropdown > li.is-active .app-brand-menu__item {
    background: var(--shell-surface-muted);
    color: var(--shell-text);
    font-weight: 600;
}

.app-brand-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 9px;
    color: var(--shell-text-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition:
        background var(--shell-transition),
        color var(--shell-transition);
}

.app-brand-menu__item:hover,
.app-brand-menu__item:focus {
    background: var(--shell-surface-muted);
    color: var(--shell-text);
    text-decoration: none;
}

.app-brand-menu__dropdown > li.is-active .app-brand-menu__item i {
    color: var(--shell-primary-strong);
}

.app-brand-menu__item i {
    width: 16px;
    font-size: 15px;
    color: var(--shell-text-soft);
    text-align: center;
}

.app-brand-menu__dropdown.ng-hide {
    display: none !important;
}

.app-brand__eyebrow {
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    color: var(--shell-text);
}

.app-brand__divider {
    color: var(--shell-text-soft);
}

.app-brand__section {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.app-brand__section i {
    font-size: 11px;
    color: var(--shell-text-soft);
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-header__icon-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    background: var(--shell-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background var(--shell-transition),
        transform var(--shell-transition);
}

.app-primary-action:hover,
.app-primary-action:focus {
    color: #fff;
    background: var(--shell-primary-strong);
    text-decoration: none;
    transform: translateY(-1px);
}

.app-topbar-btn,
.app-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--shell-text-muted);
    transition:
        border-color var(--shell-transition),
        transform var(--shell-transition),
        color var(--shell-transition),
        background var(--shell-transition);
}

.app-topbar-btn:hover,
.app-topbar-btn:focus,
.app-status-chip:hover,
.app-status-chip:focus {
    color: var(--shell-text);
    border-color: var(--shell-border);
    background: var(--shell-surface);
    text-decoration: none;
    transform: translateY(0);
}

.app-topbar-btn i {
    font-size: 14px;
}

.app-topbar-btn__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.app-status-chip {
    position: relative;
    width: 34px;
    height: 34px;
    border-color: var(--shell-border);
    background: var(--shell-surface-muted);
}

.app-status-chip__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    color: #111827;
    font-size: 12px;
    font-weight: 700;
}

.app-status-chip__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--shell-border-strong);
}

.app-status-chip__dot.is-healthy {
    background: var(--shell-success);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.app-status-chip__dot.is-unhealthy {
    background: var(--shell-danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.app-status-chip__dot--avatar {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 2px var(--shell-surface);
}

.app-status-chip__text {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.app-shell-dropdown {
    margin-top: 8px;
    min-width: 220px;
    border: 1px solid var(--shell-border);
    border-radius: 14px;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
    overflow: hidden;
}

.language-selector {
    position: relative;
}

.language-selector .app-shell-dropdown {
    display: block;
    right: 0;
    left: auto;
}

.language-selector .app-shell-dropdown.ng-hide {
    display: none !important;
}

.app-shell__body {
    display: flex;
    min-height: 100vh;
    padding-top: calc(var(--shell-header-height) + var(--shell-gap) - 14px);
}

.app-sidebar {
    position: fixed;
    top: calc(var(--shell-header-height) + var(--shell-gap));
    left: 0;
    bottom: 0;
    width: var(--shell-sidebar-width);
    padding: 0 0 11px;
    background: rgba(243, 245, 249, 0.88);
}

.app-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.app-sidebar__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--shell-text-muted);
    text-decoration: none;
    transition:
        background var(--shell-transition),
        color var(--shell-transition),
        border-color var(--shell-transition);
}

.app-sidebar__link i {
    font-size: 16px;
}

.app-sidebar__link:hover,
.app-sidebar__link:focus {
    color: var(--shell-text);
    background: var(--shell-surface-muted);
    border-color: var(--shell-border);
    text-decoration: none;
}

.app-sidebar__link.is-active {
    color: var(--shell-primary-strong);
    background: rgba(255, 255, 255, 0.84);
    border-color: rgba(37, 99, 235, 0.1);
    box-shadow: none;
}

[data-theme="dark"] .app-sidebar__link:hover,
[data-theme="dark"] .app-sidebar__link:focus {
    color: var(--shell-text);
    background: rgba(23, 32, 51, 0.92);
    border-color: var(--shell-border);
}

[data-theme="dark"] .app-sidebar__link.is-active {
    color: var(--shell-primary);
    background: rgba(23, 32, 51, 0.98);
    border-color: rgba(96, 165, 250, 0.24);
}

.app-workspace {
    width: 100%;
    margin-left: var(--shell-sidebar-width);
    padding: 0 14px 12px 0;
}

.app-subnav {
    position: sticky;
    top: var(--shell-header-height);
    z-index: 990;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 0;
    padding: 0 26px 0 32px;
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius-xl) var(--shell-radius-xl) 0 0;
    background: var(--shell-surface);
    min-height: 58px;
}

.app-subnav__left {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.app-subnav__group {
    display: flex;
    flex-wrap: wrap;
    gap: 34px;
}

.app-subnav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 57px;
    padding: 0 0 2px;
    border-bottom: 0;
    color: var(--shell-text);
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    transition:
        color var(--shell-transition),
        border-color var(--shell-transition);
}

.app-subnav__link:hover,
.app-subnav__link:focus {
    color: var(--shell-text);
    text-decoration: none;
}

.app-subnav__link.is-active {
    color: var(--shell-text);
    font-weight: 700;
}

.app-subnav__link.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: #1f2f46;
}

.app-subnav__caret {
    color: var(--shell-text-soft);
    font-size: 12px;
}

.app-subnav__link:not(.app-subnav__link--has-submenu) .app-subnav__caret {
    display: none;
}

.app-subnav__meta {
    display: flex;
    align-items: center;
    margin-left: auto;
    min-width: 24px;
}

.app-period-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--shell-border);
    border-radius: 8px;
    background: var(--shell-surface);
    color: var(--shell-text);
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
}

.app-period-pill:hover,
.app-period-pill:focus {
    outline: 0;
    border-color: var(--shell-border-strong);
}

.app-content {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--shell-header-height) - var(--shell-gap));
}

.app-content__surface {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 600px;
    border: 1px solid var(--shell-border);
    border-top: 0;
    border-radius: 0 0 var(--shell-radius-xl) var(--shell-radius-xl);
    background: var(--shell-surface);
}

.app-content__scroll {
    flex: 1 1 auto;
}

.app-content__inner {
    padding: 18px 22px 26px;
}

.app-auth-alert {
    margin: 28px;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 4px 0;
    color: var(--shell-text-soft);
    font-size: 12px;
}

.app-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.16), transparent 24%),
        var(--shell-bg);
}

.app-login-screen__panel {
    width: min(100%, 760px);
    padding: 34px 36px 40px;
    border: 1px solid var(--shell-border);
    border-radius: 32px;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
}

.app-login-screen__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    color: var(--shell-text);
}

.app-login-screen__brand .app-brand__logo {
    width: 28px;
}

.app-login-card {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 30px 30px 28px;
    border: 1px solid var(--shell-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.app-login-card__header {
    margin-bottom: 24px;
}

.app-login-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    color: var(--shell-text);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.app-login-card__title i {
    color: var(--shell-primary);
    font-size: 20px;
}

.app-login-card__subtitle {
    margin: 0;
    color: var(--shell-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.app-login-form .form-group {
    margin-bottom: 18px;
}

.app-login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--shell-text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-login-form .form-control {
    min-height: 48px;
    height: 48px;
    padding: 0 15px;
    border-radius: 14px;
    font-size: 16px;
}

.app-login-form__alert {
    margin-bottom: 18px;
    border-radius: 14px;
}

.app-login-form__submit {
    min-height: 48px;
    margin-top: 8px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 991px) {
    .app-header {
        height: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .app-shell__body {
        flex-direction: column;
        padding-top: 96px;
    }

    .app-header__brand {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .app-brand-menu__dropdown {
        right: 0;
        left: auto;
    }

    .app-sidebar {
        position: static;
        width: auto;
        margin: 0 16px 10px;
        border: 1px solid var(--shell-border);
        border-radius: 14px;
    }

    .app-sidebar__nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .app-sidebar__link {
        min-width: 108px;
    }

    .app-workspace {
        margin-left: 0;
        padding: 0 16px 16px;
    }

    .app-subnav {
        position: static;
        flex-wrap: wrap;
        padding: 0 12px;
    }

    .app-subnav__left {
        width: 100%;
        overflow-x: auto;
    }

    .app-content__inner {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .app-header__actions {
        width: 100%;
        justify-content: space-between;
    }

    .app-header__brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-brand__copy {
        width: 100%;
    }

    .app-primary-action {
        min-width: 0;
        padding: 0 12px;
    }

    .app-subnav {
        position: static;
        min-height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .app-content__inner,
    .app-login-screen__panel {
        padding: 18px;
    }

    .app-login-screen {
        padding: 18px;
    }

    .app-login-card {
        width: 100%;
        padding: 24px 20px 22px;
        border-radius: 20px;
    }

    .app-login-card__title {
        font-size: 28px;
    }

    .app-footer {
        flex-direction: column;
    }
}
