/*
 * <ui-page> — page container for dashboards: heading bar + scrollable body
 * wrapped in a white card with light border, rounded corners, soft shadow.
 * Light DOM. Themed via /shared/design/tokens.css.
 */

ui-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--ui-color-bg, #fff);
    border: 2px solid var(--ui-border-color, #e2e8f0);
    border-radius: var(--ui-radius-lg, 10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05),
                0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

ui-page > .ui-page-heading {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--ui-spacing-3, 12px);
    padding: 20px var(--ui-spacing-4, 16px);
    border-bottom: 2px solid var(--ui-border-color, #e2e8f0);
    background: linear-gradient(to bottom, var(--ui-surface-sunken), var(--ui-surface-muted));
}
ui-page > .ui-page-heading .ui-page-title-block {
    min-width: 0;
    flex: 0 1 auto;
}
ui-page > .ui-page-heading .ui-page-title {
    font-size: var(--ui-font-size-md, 13px);
    font-weight: 600;
    color: var(--ui-color-text, #0f172a);
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
ui-page > .ui-page-heading .ui-page-subtitle {
    font-size: var(--ui-font-size-xs, 11px);
    color: var(--ui-color-text-muted, #64748b);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
ui-page > .ui-page-heading .ui-page-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--ui-spacing-2, 8px);
    flex-shrink: 0;
}

ui-page > .ui-page-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: var(--ui-color-bg, #fff);
}
ui-page[body-pad="md"] > .ui-page-body { padding: var(--ui-spacing-4, 16px); }
ui-page[body-pad="lg"] > .ui-page-body { padding: var(--ui-spacing-6, 24px); }
ui-page[body-pad="none"] > .ui-page-body { padding: 0; }

/* Nested ui-page (например карточка-секция внутри страницы) — без card-shadow
   и тоньше border, чтобы не «гремело» внутри основной обёртки. */
ui-page ui-page {
    box-shadow: none;
    border-radius: var(--ui-radius-md, 7px);
}

/* no-card mode — drops the outer chrome entirely. Use when ui-page is
   embedded inside another card-like shell (e.g. .admin-page-shell), so
   we don't double up borders/shadows/rounded corners. */
ui-page[no-card] {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
ui-page[no-card] > .ui-page-heading {
    background: linear-gradient(to bottom, var(--ui-surface-sunken), var(--ui-surface-muted));
    border-bottom: 1px solid var(--ui-border-color, #e2e8f0);
}
