/* HRConnect Design System — shared responsive, motion and print contracts. */
@layer components {
    body.hrc-design-system-v1 .qm-user-chip__meta {
        display: var(--hrc-responsive-user-meta-display, block);
        min-width: 0;
    }

    @media (max-width: 1439.98px) {
        body.hrc-design-system-v1:where(.hrc-responsive-profile-container) {
            --hrc-responsive-layout-container-padding-inline: clamp(var(--hrc-space-4), 2vw, var(--hrc-space-6));
        }
    }

    @media (max-width: 1199.98px) {
        body.hrc-design-system-v1:where(.hrc-responsive-profile-summary) {
            --hrc-erp-kpi-grid-columns: repeat(2, minmax(0, 1fr));
            --hrc-responsive-summary-grid-columns: repeat(2, minmax(0, 1fr));
            --hrc-responsive-user-meta-display: none;
        }
    }

    @media (max-width: 1023.98px) {
        body.hrc-design-system-v1:where(.hrc-responsive-profile-tablet) {
            --hrc-native-hero-actions-justify: flex-start;
            --hrc-native-hero-columns: minmax(0, 1fr);
            --hrc-native-hero-padding: var(--hrc-space-6);
            --hrc-native-page-padding-inline: var(--hrc-page-gutter-tablet);
            --hrc-responsive-hero-columns: minmax(0, 1fr);
            --hrc-responsive-hero-padding: var(--hrc-space-6);
        }

        body.hrc-design-system-v1 :where(.hrc-hero__actions, .hrc-page-header__actions) {
            justify-content: flex-start;
        }
    }

    @media (max-width: 767.98px) {
        body.hrc-design-system-v1:where(.hrc-responsive-profile-mobile) {
            --hrc-erp-kpi-grid-columns: minmax(0, 1fr);
            --hrc-native-hero-min-height: 0;
            --hrc-native-hero-padding: var(--hrc-space-5);
            --hrc-native-page-padding-inline: var(--hrc-page-gutter-mobile);
            --hrc-responsive-dialog-body-max-height: calc(100dvh - 150px);
            --hrc-responsive-dialog-margin: .5rem;
            --hrc-responsive-dialog-max-height: calc(100dvh - 1rem);
            --hrc-responsive-dialog-max-width: none;
            --hrc-responsive-dialog-width: calc(100vw - 1rem);
            --hrc-responsive-summary-grid-columns: minmax(0, 1fr);
            --hrc-responsive-summary-grid-gap: var(--hrc-space-3);
            --hrc-responsive-hero-min-height: 0;
            --hrc-responsive-hero-padding: var(--hrc-space-5);
            --hrc-responsive-hero-title-size: 1.5rem;
            --hrc-responsive-layout-container-padding-inline: var(--hrc-space-3);
            --hrc-responsive-layout-page-gap: var(--hrc-space-4);
            --hrc-responsive-pagination-align: stretch;
            --hrc-responsive-panel-padding: var(--hrc-space-4);
            --hrc-responsive-tab-min-height: var(--hrc-control-height-lg);
            --hrc-responsive-toast-inset: auto var(--hrc-space-2) var(--hrc-space-2);
            --hrc-responsive-toast-width: auto;
        }

        body.hrc-design-system-v1 :where(.hrc-hero__actions, .hrc-page-header__actions, .hrc-quick-actions) {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            width: 100%;
        }

        body.hrc-design-system-v1 :where(.hrc-hero__actions, .hrc-page-header__actions, .hrc-quick-actions) > :where(.hrc-btn, .btn) {
            width: 100%;
        }

    }

    @media (max-width: 390px) {
        body.hrc-design-system-v1 :where(.hrc-hero, .hrc-page-header),
        body.hrc-design-system-v1 .hrc-filter-panel,
        body.hrc-design-system-v1 .hrc-form-section {
            padding: var(--hrc-space-4);
            border-radius: var(--hrc-radius-sm);
        }

        body.hrc-design-system-v1 .hrc-btn {
            min-height: var(--hrc-control-height-lg);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        body.hrc-design-system-v1 *,
        body.hrc-design-system-v1 *::before,
        body.hrc-design-system-v1 *::after {
            scroll-behavior: auto;
            transition-duration: .01ms;
            animation-duration: .01ms;
            animation-iteration-count: 1;
        }
    }

    @media print {
        body.hrc-design-system-v1:where(.hrc-responsive-profile-print) {
            background: var(--hrc-static-white);
            color: var(--hrc-neutral-900);
        }

        body.hrc-design-system-v1 :where(.qm-sidebar, .qm-topbar, .qm-mobile-drawer, .hrc-quick-actions, .hrc-form-footer, .hrc-toast-region, dialog:not([open])) {
            display: none;
        }

        body.hrc-design-system-v1 :where(.hrc-layout-container, .qm-content) {
            width: 100%;
            max-width: none;
            padding: 0;
        }

        body.hrc-design-system-v1 :where(.hrc-surface, .hrc-card, .hrc-section, .hrc-hero, .hrc-page-header, .hrc-kpi, .hrc-stat-card, .hrc-filter-panel, .hrc-form-section, .hrc-table-scroll) {
            break-inside: avoid;
            border-color: var(--hrc-neutral-300);
            background: var(--hrc-static-white);
            color: var(--hrc-neutral-900);
            box-shadow: none;
        }

        body.hrc-design-system-v1:where(.hrc-responsive-profile-print) .hrc-table {
            min-width: 0;
        }

        body.hrc-design-system-v1:where(.hrc-responsive-profile-print) .hrc-table :where(th, td) {
            background: var(--hrc-static-white);
            color: var(--hrc-neutral-900);
        }
    }
}
