:root {
    --app-header-height: 60px;
}

.app-shell .rz-body {
    min-width: 0;
    padding: 0;
}

.app-header {
    position: static;
    min-width: 0;
    border-bottom: 1px solid var(--app-border);
}

.app-header-content {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 320px) auto auto;
    align-items: center;
    gap: 12px;
    height: var(--app-header-height);
    padding: 4px 12px 4px 0;
}

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

.app-brand-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 4px;
}

.app-brand-logo {
    display: block;
    width: 120px;
    height: auto;
}

.app-company-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.app-company-label {
    flex-shrink: 0;
    color: var(--app-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.app-company-select.rz-dropdown {
    flex: 1;
    width: 100%;
    min-width: 0;
}

.app-profile-shortcut.rz-button {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-profile-menu {
    position: relative;
    z-index: 1000;
}

.app-page-content {
    min-width: 0;
    padding: 16px;
}

.app-page-content > .row {
    margin-inline: 0;
}

.app-page-title {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 10px 0 12px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    overflow-wrap: anywhere;
}

.app-list-toolbar,
.app-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.app-list-toolbar {
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-list-toolbar > * {
    min-width: 0;
    max-width: 100%;
}

.app-actions > .rz-button,
.app-actions > .btn {
    flex: 0 1 auto;
    max-width: 100%;
    min-height: 40px;
    height: auto;
    margin: 0;
    white-space: normal;
}

.app-actions .rz-button-text {
    white-space: normal;
    overflow-wrap: anywhere;
}

.rz-dialog {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
}

.rz-dialog-content {
    min-width: 0;
}

@media (max-width: 1024px) {
    .app-header-content {
        grid-template-columns: minmax(160px, 1fr) minmax(220px, 320px) auto;
        gap: 8px;
    }

    .app-profile-shortcut.rz-button {
        display: none;
    }
}

@media (max-width: 600px) {
    :root {
        --app-header-height: 104px;
    }

    .app-header-content {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: 44px 40px;
        gap: 4px 8px;
        padding: 4px 12px 10px;
    }

    .app-header-brand {
        grid-area: 1 / 1;
        margin-left: -12px;
    }

    .app-brand-logo {
        width: 104px;
    }

    .app-company-switcher {
        grid-area: 2 / 1 / 3 / -1;
    }

    .app-profile-menu {
        grid-area: 1 / 2;
    }

    .app-page-content {
        padding: 12px;
    }

    .app-page-title {
        font-size: 18px;
        padding-top: 4px;
        margin-bottom: 12px;
    }

    .app-list-toolbar > .app-actions {
        width: 100%;
    }

    .app-actions > .rz-button,
    .app-actions > .btn {
        flex: 1 1 10rem;
        min-height: 44px;
    }

    .app-actions-compact > .rz-button,
    .app-actions-compact > .btn,
    .asset-editor-footer.app-actions > .rz-button,
    .app-actions.flex-column > .rz-button {
        flex: 0 1 auto;
    }
}
