.v4-page {
    align-items: stretch;
    flex-direction: column;
    height: 100vh;
    justify-content: flex-start;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.v4-page .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.v4-page .brand {
    justify-self: start;
}

.v4-page .topbar-right {
    justify-self: end;
}

.app-nav {
    align-self: stretch;
    display: flex;
    justify-content: center;
}

.app-nav-link {
    align-items: center;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 14px;
    font-weight: 650;
    padding: 0 16px;
    text-decoration: none;
}

.app-nav-link:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.app-nav-link.active {
    border-bottom-color: var(--brand);
    color: var(--text);
}

.v4-dashboard {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: 0;
    max-width: none;
    min-height: 0;
    overflow: hidden;
    padding: 64px 0 0;
    width: 100%;
}

.v4-dashboard-panel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

#dashboard-sessions-panel {
    display: flex;
}

#page-sessions .agent-list-panel {
    border: 0;
    border-radius: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#page-sessions .agent-top-list {
    align-content: start;
    flex: 1;
    grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    width: 100%;
}

#page-sessions #dashboard-monitor-panel {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 32px 24px;
}

#page-sessions .monitor-toolbar {
    background: var(--bg);
    margin-bottom: 0;
    padding: 12px 0 14px;
    position: sticky;
    top: 0;
    z-index: 2;
}

#page-sessions .monitor-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
}

.v4-session-page {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.native-session-shell {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: calc(100vh - 128px);
    margin-top: 64px;
    min-height: 0;
    overflow: hidden;
}

.native-workbench-stage {
    background: #0f141c;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.native-workbench-frame {
    background: #0f141c;
    border: 0;
    display: block;
    height: 100%;
    width: 100%;
}

.native-workbench-frame[hidden],
.native-workbench-state[hidden] {
    display: none;
}

.native-workbench-state {
    align-items: center;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    inset: 0;
    justify-content: center;
    padding: 32px;
    position: absolute;
    text-align: center;
}

.native-workbench-state strong {
    color: #f8fafc;
    font-size: 16px;
}

.native-workbench-state > span {
    color: #94a3b8;
    max-width: 520px;
}

.native-workbench-state .spinner {
    margin-bottom: 4px;
}

@media (max-width: 760px) {
    .v4-page .brand > span {
        display: none;
    }

    .app-nav-link {
        padding: 0 10px;
    }
}

@media (max-width: 520px) {
    .v4-page .user-profile {
        display: none;
    }

    .app-nav-link {
        font-size: 13px;
        padding: 0 8px;
    }
}
