/* ========================================================================== */
/* Entria design foundation                                                   */
/* Canonical visual language for every authenticated product and module.      */
/* ========================================================================== */

:root {
    --entria-ink: #0d1b2a;
    --entria-ink-soft: #213455;
    --entria-muted: #667391;
    --entria-surface: #ffffff;
    --entria-surface-soft: #f8faff;
    --entria-border: #dce5f3;
    --entria-border-soft: #e8eef6;
    --entria-primary: #2563eb;
    --entria-accent: #14b8a6;
    --entria-control-height: 48px;
    --entria-control-radius: 14px;
    --entria-panel-radius: 20px;
    --entria-modal-radius: 24px;
    --entria-icon-button-size: 42px;
    --entria-gap-sm: 8px;
    --entria-gap-md: 14px;
    --entria-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.05);
    --entria-shadow-modal: 0 28px 70px rgba(15, 23, 42, 0.22);
    --entria-focus: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.portal-content { color: var(--entria-ink); }

.portal-content-inner > :where(
    .school-screen, .wellbeing-screen, .assessment-screen, .results-screen,
    .action-plan-screen, .comms-screen, .cases-screen, .gov-screen, .dossier-screen
) { min-width: 0; }

/* Titles and introductory copy */
.portal-content :where(
    .dashboard-header, .school-page-header, .action-plan-header, .assessment-header,
    .results-header, .comms-header, .cases-page-header, .gov-header,
    .dossier-header, .policy-detail-header, .wellbeing-hero
) p {
    color: var(--entria-muted) !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
}

.portal-content :where(
    .school-panel-header h2, .school-section-title, .school-subpanel h3,
    .school-ops-panel h3, .action-plan-lane > header, .comms-lane > header
) {
    color: var(--entria-ink-soft);
    font-weight: 800;
}

/* Panels and cards */
.portal-content :where(
    .dashboard-panel, .panel-card, .panel-subcard, .kpi-card, .school-panel,
    .school-subpanel, .school-table-shell, .action-plan-list-panel,
    .action-plan-calendar article, .wellbeing-card
) {
    border-color: var(--entria-border-soft);
    border-radius: var(--entria-panel-radius);
    background: var(--entria-surface);
    box-shadow: var(--entria-shadow-soft);
}

/* Buttons */
.portal-content :where(
    .school-primary-button, .school-secondary-button, .school-filter-button,
    .school-secondary-link-button, .wellbeing-primary, .wellbeing-secondary
) {
    min-height: var(--entria-control-height);
    padding-inline: 18px;
    border-radius: var(--entria-control-radius);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
}

.portal-content :where(.school-primary-button, .wellbeing-primary) {
    border: 0;
    background: linear-gradient(135deg, var(--entria-primary) 0%, var(--entria-accent) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.portal-content :where(
    .school-secondary-button, .school-filter-button, .school-secondary-link-button,
    .wellbeing-secondary
) {
    border: 1px solid var(--entria-border);
    background: #fff;
    color: var(--entria-ink-soft);
    box-shadow: none;
}

.portal-content :where(
    .school-primary-button, .school-secondary-button, .school-filter-button,
    .school-secondary-link-button, .wellbeing-primary, .wellbeing-secondary,
    .school-icon-button, .app-modal-close
):focus-visible {
    outline: none;
    box-shadow: var(--entria-focus);
}

.portal-content :where(.school-icon-button, .app-modal-close) {
    display: inline-grid;
    place-items: center;
    width: var(--entria-icon-button-size);
    height: var(--entria-icon-button-size);
    min-width: var(--entria-icon-button-size);
    min-height: var(--entria-icon-button-size);
    padding: 0;
    border: 1px solid var(--entria-border);
    border-radius: 13px;
    background: #fff;
    color: #40506a;
    box-shadow: none;
}

.portal-content :where(.school-icon-button, .app-modal-close):hover {
    border-color: #b9c9df;
    background: #f8faff;
    color: var(--entria-primary);
}

.portal-content :where(
    .school-primary-button, .school-secondary-button, .school-filter-button,
    .school-secondary-link-button, .wellbeing-primary, .wellbeing-secondary,
    .school-icon-button, .app-modal-close
):disabled {
    transform: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.portal-content :where(
    .school-primary-button, .school-secondary-button, .school-filter-button,
    .school-secondary-link-button, .school-icon-button
) svg {
    width: 18px;
    height: 18px;
    flex: none;
}

/* Labels and controls */
.portal-content :where(
    .school-labeled-field, .action-plan-filters label, .action-plan-form-grid label,
    .comms-form-grid label
) {
    gap: var(--entria-gap-sm);
    color: #5f6e87;
    font-size: 0.82rem;
    font-weight: 750;
}

.portal-content :where(
    .school-search-field, .school-date-field input, select.school-select-field,
    input.school-input-field, input.school-code-input, .school-check-field,
    .app-form-textarea, .action-plan-form-grid input, .action-plan-form-grid select,
    .action-plan-form-grid textarea, .wellbeing-form-grid input,
    .wellbeing-form-grid select, .wellbeing-form-grid textarea
) {
    width: 100%;
    min-height: var(--entria-control-height);
    border: 1px solid var(--entria-border);
    border-radius: var(--entria-control-radius);
    background-color: #fff;
    color: var(--entria-ink-soft);
    font: inherit;
    font-weight: 650;
    box-shadow: none;
}

.portal-content :where(
    .school-search-field, .school-date-field input, select.school-select-field,
    input.school-input-field, input.school-code-input, .app-form-textarea,
    .action-plan-form-grid input, .action-plan-form-grid select,
    .action-plan-form-grid textarea, .wellbeing-form-grid input,
    .wellbeing-form-grid select, .wellbeing-form-grid textarea
):focus,
.portal-content .school-search-field:focus-within {
    border-color: rgba(37, 99, 235, 0.58);
    outline: none;
    box-shadow: var(--entria-focus);
}

.portal-content :where(
    .school-date-field input, select.school-select-field,
    input.school-input-field, input.school-code-input
) { padding-inline: 14px; }

.portal-content :where(
    .app-form-textarea, .action-plan-form-grid textarea, .wellbeing-form-grid textarea
) {
    min-height: 112px;
    padding: 13px 14px;
    line-height: 1.5;
    resize: vertical;
}

.portal-content .school-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-inline: 14px;
}

.portal-content .school-search-field > svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
    flex: 0 0 18px;
    color: #72809a;
}

.portal-content .school-search-field input {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font-weight: 650;
}

/* Compatibility for screens that wrap a select inside .school-select-field. */
.portal-content div.school-select-field {
    display: flex;
    align-items: center;
    min-height: var(--entria-control-height);
    overflow: hidden;
    border: 1px solid var(--entria-border);
    border-radius: var(--entria-control-radius);
    background: #fff;
}

.portal-content div.school-select-field:focus-within {
    border-color: rgba(37, 99, 235, 0.58);
    box-shadow: var(--entria-focus);
}

.portal-content div.school-select-field > select {
    width: 100%;
    min-height: calc(var(--entria-control-height) - 2px);
    padding: 0 38px 0 14px;
    border: 0;
    outline: 0;
    background-color: transparent;
    color: var(--entria-ink-soft);
    font: inherit;
    font-weight: 650;
}

/* Filter command bars: one rhythm across JornadaBot and Entorno laboral. */
.portal-content :where(
    .school-toolbar-grid, .school-filters-row, .action-plan-filters, .comms-filters,
    .comms-ack-filters, .assessment-filters, .results-filters, .cases-filters
) { gap: var(--entria-gap-md); }

.portal-content :where(
    .action-plan-filters, .comms-filters, .comms-ack-filters,
    .assessment-filters, .results-filters, .cases-filters
) {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Tables */
.portal-content :where(
    .school-table-shell, .action-plan-list-panel, .wellbeing-centers-table-shell
) {
    border: 1px solid var(--entria-border-soft);
    border-radius: var(--entria-panel-radius);
    background: #fff;
}

.portal-content :where(
    .school-data-table, .action-plan-table, .wellbeing-centers-table
) th {
    padding: 14px 16px;
    background: #f8faff;
    color: #5f6e87;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
}

.portal-content :where(
    .school-data-table, .action-plan-table, .wellbeing-centers-table
) td {
    padding: 15px 16px;
    border-top: 1px solid var(--entria-border-soft);
    color: var(--entria-ink-soft);
    vertical-align: middle;
}

.portal-content :where(
    .school-data-table, .action-plan-table, .wellbeing-centers-table
) tbody tr:hover td { background: #fbfcff; }

.portal-content :where(
    .school-status-pill, .school-type-pill, .priority, .action-plan-status
) {
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
}

/* Modals */
.app-modal-backdrop {
    z-index: 2000;
    padding: 24px;
    background: rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(5px);
}

.app-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(100%, 820px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    border: 1px solid var(--entria-border);
    border-radius: var(--entria-modal-radius);
    background: #fff;
    box-shadow: var(--entria-shadow-modal);
}

.app-modal.app-modal-small,
.app-modal.small { width: min(100%, 560px); }

.app-modal.app-modal-wide,
.app-modal.wide { width: min(100%, 1180px); }

.app-modal-header,
.app-modal-footer {
    gap: 14px;
    padding: 20px 24px;
}

.app-modal-header { border-bottom: 1px solid var(--entria-border-soft); }
.app-modal-footer {
    border-top: 1px solid var(--entria-border-soft);
    background: #fff;
}

.app-modal-title { gap: 5px; }
.app-modal-title h3 {
    color: var(--entria-ink);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
}

.app-modal-title p {
    color: var(--entria-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.app-modal-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 24px;
}

.app-form-grid { gap: 16px; }

@media (max-width: 760px) {
    .app-modal-backdrop {
        align-items: end;
        padding: 10px;
    }

    .app-modal,
    .app-modal.app-modal-small,
    .app-modal.app-modal-wide,
    .app-modal.small,
    .app-modal.wide {
        width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 20px;
    }

    .app-modal-header,
    .app-modal-body,
    .app-modal-footer { padding: 16px; }

    .app-modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .app-modal-footer > :where(button, a) { width: 100%; }

    .portal-content :where(
        .action-plan-filters, .comms-filters, .comms-ack-filters,
        .assessment-filters, .results-filters, .cases-filters
    ) {
        padding: 0;
        border-radius: 0;
    }
}
/* Final compatibility layer for isolated component styles. */
.portal-content .school-primary-button,
.portal-content .school-secondary-button,
.portal-content .school-filter-button,
.portal-content .school-secondary-link-button {
    min-height: var(--entria-control-height);
    padding-inline: 18px;
    border-radius: var(--entria-control-radius);
    font-size: .92rem;
    font-weight: 800;
}

.portal-content .school-primary-button {
    border-color: transparent;
    background: linear-gradient(135deg, var(--entria-primary) 0%, var(--entria-accent) 100%);
    color: #fff;
}

.portal-content .school-secondary-button,
.portal-content .school-filter-button,
.portal-content .school-secondary-link-button {
    border-color: var(--entria-border);
    background: #fff;
    color: var(--entria-ink-soft);
}

.portal-content .school-icon-button {
    width: var(--entria-icon-button-size);
    height: var(--entria-icon-button-size);
    min-width: var(--entria-icon-button-size);
    min-height: var(--entria-icon-button-size);
    border-color: var(--entria-border);
    border-radius: 13px;
    background: #fff;
}

.portal-content .school-labeled-field > :where(
    input.school-code-input,
    input.school-input-field,
    select.school-select-field
),
.portal-content .school-date-field > input {
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
}

.portal-content .school-labeled-field > .app-form-textarea {
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
}

.portal-content .action-plan-filters,
.portal-content .comms-filters.school-toolbar-grid,
.portal-content .comms-ack-filters.school-toolbar-grid,
.portal-content .cases-filters,
.portal-content .cases-guide-toolbar,
.portal-content .assessment-list-filters {
    gap: var(--entria-gap-md);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.portal-content .action-plan-filters :where(select, input),
.portal-content .cases-filters :where(select, input),
.portal-content .cases-guide-toolbar select,
.portal-content .assessment-list-filters select {
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
}

.portal-content .action-plan-filters .action-plan-search > div,
.portal-content .comms-filters .school-select-field,
.portal-content .comms-filters .school-search-field,
.portal-content .comms-ack-filters .school-select-field,
.portal-content .comms-ack-filters .school-search-field,
.portal-content .school-toolbar-grid-referrals .school-search-field {
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
}

.portal-content .comms-filters .school-select-field select,
.portal-content .comms-filters .school-search-field input {
    height: calc(var(--entria-control-height) - 2px);
}

.portal-content .action-plan-filters .action-plan-clear,
.portal-content .comms-filters .comms-clear,
.portal-content .comms-ack-filters .comms-clear,
.portal-content .cases-clear-filters,
.portal-content .cases-guide-toolbar button {
    min-height: var(--entria-control-height);
}

.portal-content .school-data-table th,
.portal-content .action-plan-table th,
.portal-content .wellbeing-centers-table th {
    padding: 14px 16px;
    background: #f8faff;
    color: #5f6e87;
    font-size: .82rem;
    font-weight: 750;
    text-transform: none;
}

.portal-content .school-data-table td,
.portal-content .action-plan-table td,
.portal-content .wellbeing-centers-table td {
    padding: 15px 16px;
    border-top-color: var(--entria-border-soft);
}

body .app-modal-backdrop > .app-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    border-color: var(--entria-border);
    border-radius: var(--entria-modal-radius);
    background: #fff;
    box-shadow: var(--entria-shadow-modal);
}

body .app-modal-backdrop > .app-modal > .app-modal-header,
body .app-modal-backdrop > .app-modal > .app-modal-footer {
    padding: 20px 24px;
}

body .app-modal-backdrop > .app-modal > .app-modal-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 22px 24px;
}

body .app-modal-backdrop > .app-modal > .app-modal-header .app-modal-close {
    width: var(--entria-icon-button-size);
    height: var(--entria-icon-button-size);
    min-width: var(--entria-icon-button-size);
    min-height: var(--entria-icon-button-size);
    border-color: var(--entria-border);
    border-radius: 13px;
}

@media (max-width: 760px) {
    .portal-content .action-plan-filters,
    .portal-content .comms-filters.school-toolbar-grid,
    .portal-content .comms-ack-filters.school-toolbar-grid,
    .portal-content .cases-filters,
    .portal-content .cases-guide-toolbar,
    .portal-content .assessment-list-filters {
        padding: 0;
        border-radius: 0;
    }

    body .app-modal-backdrop > .app-modal > .app-modal-header,
    body .app-modal-backdrop > .app-modal > .app-modal-body,
    body .app-modal-backdrop > .app-modal > .app-modal-footer {
        padding: 16px;
    }
}
/* Command bars sit on the page; data tables keep their own surface. */
.portal-content .school-panel:has(.school-toolbar-grid),
.portal-content .school-panel:has(.school-filters-row),
.portal-content .school-panel:has(.school-toolbar),
.portal-content .school-panel:has(.school-toolbar-actions-row) {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Standard data-list pattern: Employees is the visual reference for every operational table. */
.portal-content .school-table-shell {
    max-height: none;
    scrollbar-gutter: auto;
    box-shadow: none;
}

.portal-content .attendance-table-panel,
.portal-content .evidence-table-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.portal-content .attendance-table-panel > .school-subpanel-header,
.portal-content .evidence-table-panel > .school-subpanel-header {
    margin: 0 0 14px;
    padding: 0;
}

.portal-content .attendance-table-preparing {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    border-color: var(--entria-border-soft);
    background: #ffffff;
}

.portal-content .attendance-table-preparing .attendance-table {
    visibility: hidden;
}

.portal-content .attendance-table-preparing::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    content: "Preparando vista de asistencia...";
    color: var(--entria-muted);
    font-size: 0.94rem;
    font-weight: 700;
    text-align: center;
    background: #ffffff;
}

.portal-content .attendance-table-panel .column-picker {
    z-index: 100;
}

.portal-content .attendance-table-panel .column-picker-menu {
    z-index: 120;
    max-height: min(420px, 70vh);
    overflow-y: auto;
}

.portal-content .evidence-table-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
}

.portal-content .evidence-table {
    min-width: 980px;
}

.portal-content .company-vacation-table-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.portal-content .company-vacation-table {
    min-width: 1320px;
    table-layout: auto;
}

.portal-content .company-vacation-table th {
    white-space: nowrap;
}

.portal-content .company-vacation-table .school-actions-cell {
    position: sticky;
    right: 0;
    z-index: 1;
    min-width: 120px;
    padding-left: 12px;
    background: #ffffff;
    box-shadow: -10px 0 16px rgba(15, 35, 65, 0.035);
}

.portal-content .company-vacation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
}

.portal-content .company-vacation-table thead .school-actions-cell {
    z-index: 2;
    background: #f8faff;
}

.portal-content .school-data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.portal-content .school-data-table .school-actions-cell {
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
}

.portal-content .company-catalog-table .school-actions-cell {
    display: table-cell;
}

.portal-content .company-coverage-table td:last-child {
    display: table-cell;
}

.portal-content .company-coverage-dot {
    margin-right: 8px;
    vertical-align: middle;
}

.portal-content .company-catalog-table td.school-actions-cell .school-icon-button + .school-icon-button {
    margin-left: 8px;
}

.portal-content .company-catalog-table-shell {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: auto;
}

.portal-content .company-department-table {
    min-width: 720px;
}

.portal-content .school-table-shell .dashboard-empty-state {
    min-height: 84px;
    padding: 20px;
}

.portal-content .company-catalog-summary-shell {
    margin-top: 18px;
    overflow-x: auto;
    overflow-y: visible;
}

.portal-content .company-catalog-summary-table {
    min-width: 720px;
    table-layout: fixed;
}

.portal-content .company-catalog-summary-table th:first-child {
    width: auto;
}

.portal-content .company-catalog-summary-table .company-catalog-summary-count {
    width: 180px;
}

.portal-content .company-catalog-summary-table .school-actions-cell {
    width: 150px;
}

.portal-content .company-catalog-summary-table .company-catalog-toggle {
    min-width: 108px;
}

.portal-content .company-catalog-expanded-row > td {
    padding: 0;
    background: #f8faff;
}

.portal-content .company-catalog-inline-detail {
    display: grid;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid var(--entria-border-soft);
    border-bottom: 1px solid var(--entria-border-soft);
}

.portal-content .company-catalog-inline-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
    align-items: end;
    gap: 18px;
}

.portal-content .company-catalog-inline-header h3 {
    margin: 0;
    color: var(--entria-ink);
    font-size: 1.1rem;
    font-weight: 800;
}

.portal-content .company-catalog-inline-header p {
    margin: 5px 0 0;
    color: var(--entria-muted);
}

.portal-content .company-catalog-modal-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(200px, 0.8fr);
    gap: 12px;
    align-items: end;
}

.portal-content .company-catalog-empty {
    padding: 32px 18px;
    color: var(--entria-muted);
    text-align: center;
}

@media (max-width: 760px) {
    .portal-content .company-catalog-inline-header,
    .portal-content .company-catalog-modal-filters,
    .portal-content .company-catalog-inline-header .company-catalog-modal-filters {
        grid-template-columns: 1fr;
    }
}

.portal-content .checkpoint-table-shell {
    overflow: auto;
    border-radius: var(--entria-panel-radius);
}

.portal-content .checkpoint-table {
    min-width: 980px;
    table-layout: fixed;
}

.portal-content .checkpoint-table th:nth-child(1) { width: 18%; }
.portal-content .checkpoint-table th:nth-child(2) { width: 23%; }
.portal-content .checkpoint-table th:nth-child(3) { width: 11%; }
.portal-content .checkpoint-table th:nth-child(4) { width: 11%; }
.portal-content .checkpoint-table th:nth-child(5) { width: 22%; }
.portal-content .checkpoint-table th:nth-child(6) { width: 10%; }
.portal-content .checkpoint-table th:nth-child(7) { width: 104px; }

.portal-content .checkpoint-table > :is(thead, tbody) > tr > :last-child {
    min-width: 104px;
    padding-left: 16px;
    padding-right: 24px;
    text-align: center;
}

.portal-content .checkpoint-table .checkpoint-action-menu {
    justify-content: center;
    width: 100%;
}

.portal-content .checkpoint-action-popover {
    position: fixed;
    inset: 50% auto auto 50%;
    z-index: 2200;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    max-height: min(420px, calc(100dvh - 32px));
    margin: 0;
    overflow-y: auto;
    transform: translate(-50%, -50%);
}

@supports (position-area: block-end) {
    .portal-content .checkpoint-action-popover {
        inset: auto;
        position-area: block-end span-inline-start;
        position-try-fallbacks:
            flip-block,
            flip-inline,
            flip-block flip-inline;
        margin: 8px 0 0;
        transform: none;
    }
}

.portal-content .school-table-link {
    color: #2563eb;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.portal-content .school-table-link:hover {
    text-decoration: underline;
}

.portal-content .biometric-device-table-shell {
    container: biometric-devices / inline-size;
    overflow: visible;
}

.portal-content .biometric-device-table {
    min-width: 0;
    table-layout: fixed;
}

/* Reserve all three actions, then distribute exactly the remaining width. */
.portal-content .biometric-device-table th:nth-child(1) { width: calc(30% - 48px); }
.portal-content .biometric-device-table th:nth-child(2) { width: calc(22% - 35.2px); }
.portal-content .biometric-device-table th:nth-child(3) { width: calc(20% - 32px); }
.portal-content .biometric-device-table th:nth-child(4) { width: calc(16% - 25.6px); }
.portal-content .biometric-device-table th:nth-child(5) { width: calc(12% - 19.2px); }
.portal-content .biometric-device-table th:nth-child(6) { width: 160px; }

.portal-content .biometric-device-table th,
.portal-content .biometric-device-table td > div:not(.biometric-device-actions) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.portal-content .biometric-device-table .school-actions-cell {
    padding-inline: 6px;
    text-align: center;
}

@container biometric-devices (max-width: 700px) {
    .portal-content .biometric-device-table,
    .portal-content .biometric-device-table tbody {
        display: block;
    }

    .portal-content .biometric-device-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .portal-content .biometric-device-table tbody tr[data-device-id] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        padding: 16px;
        border-bottom: 1px solid var(--entria-border-soft);
    }

    .portal-content .biometric-device-table td {
        display: block;
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0;
        border: 0;
    }

    .portal-content .biometric-device-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--entria-muted);
        font-size: 0.75rem;
        font-weight: 750;
    }

    .portal-content .biometric-device-table :is(.school-person-title, .school-person-subtitle, .school-status-pill) {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .portal-content .biometric-device-table .school-actions-cell {
        display: flex;
        padding: 0;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .portal-content .biometric-device-table td > .biometric-device-actions {
        width: auto;
    }

    .portal-content .biometric-device-table td[colspan] {
        padding: 16px;
        overflow-wrap: anywhere;
    }
}

.portal-content .biometric-event-filter-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    width: 100%;
    max-width: none;
    min-width: 0;
    align-items: end;
}

.portal-content .biometric-event-filter-grid :where(.school-code-input, .school-select-field) {
    width: 100%;
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
}

@media (max-width: 1280px) {
    .portal-content .biometric-event-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-content :where(
    .checkpoint-table,
    .biometric-device-table,
    .biometric-command-table,
    .biometric-events-table
) {
    border-collapse: separate;
    border-spacing: 0;
}

.portal-content :where(
    .checkpoint-table,
    .biometric-device-table,
    .biometric-command-table,
    .biometric-events-table
) > thead > tr:first-child > th:first-child {
    border-top-left-radius: 15px;
}

.portal-content :where(
    .checkpoint-table,
    .biometric-device-table,
    .biometric-command-table,
    .biometric-events-table
) > thead > tr:first-child > th:last-child {
    border-top-right-radius: 15px;
}

.portal-content :where(
    .checkpoint-table,
    .biometric-device-table,
    .biometric-command-table,
    .biometric-events-table
) > tbody > tr:last-child > td:first-child {
    border-bottom-left-radius: 15px;
}

.portal-content :where(
    .checkpoint-table,
    .biometric-device-table,
    .biometric-command-table,
    .biometric-events-table
) > tbody > tr:last-child > td:last-child {
    border-bottom-right-radius: 15px;
}

.portal-content .attendance-table-shell {
    max-height: none;
    scrollbar-gutter: auto;
}

.portal-content .shift-assignment-filter-grid {
    grid-template-columns: repeat(5, minmax(130px, 1fr)) minmax(190px, 1.35fr);
    width: 100%;
    max-width: none;
    min-width: 0;
    align-items: end;
}

.portal-content .shift-assignment-filter-grid :where(.school-code-input, .school-select-field) {
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
}

.portal-content .shift-assignment-filter-grid > .shift-assignment-employee-filter {
    grid-column: auto;
}

.portal-content .shift-schedule-form-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    width: 100%;
    max-width: none;
    min-width: 0;
    align-items: end;
}

.portal-content .shift-schedule-form-grid > .shift-employee-picker,
.portal-content .shift-schedule-form-grid > .shift-schedule-reason-field {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

.portal-content .shift-schedule-form-grid .shift-employee-code-row,
.portal-content .shift-schedule-form-grid .shift-employee-code-row > .app-form-textarea {
    width: 100%;
    min-width: 0;
}

.portal-content .shift-schedule-form-grid .shift-check-field {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 1280px) {
    .portal-content .shift-schedule-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .portal-content .shift-assignment-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .portal-content .biometric-event-filter-grid {
        grid-template-columns: 1fr;
    }

    .portal-content .shift-assignment-filter-grid {
        grid-template-columns: 1fr;
    }

    .portal-content .shift-schedule-form-grid,
    .portal-content .shift-schedule-form-grid .shift-employee-code-row {
        grid-template-columns: 1fr;
    }

    .portal-content .shift-schedule-form-grid .shift-search-button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 900px) {
    .portal-content .company-department-table,
    .portal-content .company-position-table,
    .portal-content .checkpoint-table,
    .portal-content .attendance-table {
        min-width: 900px;
    }
}
/* Legacy report tables inherit the same typography and row rhythm. */
.portal-content :where(.results-table, .data-table) {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.portal-content :where(.results-table, .data-table) th {
    padding: 14px 16px;
    background: #f8faff;
    color: #5f6e87;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
}

.portal-content :where(.results-table, .data-table) td {
    padding: 15px 16px;
    border-top: 1px solid var(--entria-border-soft);
    color: var(--entria-ink-soft);
    vertical-align: middle;
}

.portal-content :where(.results-table, .data-table) tbody tr:hover td {
    background: #fbfcff;
}

.portal-content .results-table-wrap {
    border-color: var(--entria-border-soft);
    border-radius: var(--entria-panel-radius);
    background: #ffffff;
    box-shadow: none;
}

/* Keep every employee column on the same horizontal scrolling surface. */
@media (min-width: 761px) {
    .portal-content .employees-table-shell {
        overflow-x: auto;
    }

    .portal-content .employees-table th,
    .portal-content .employees-table td {
        padding-inline: 10px;
    }

    .portal-content .employees-table .school-actions-cell {
        position: static;
        right: auto;
        z-index: auto;
        width: 116px;
        min-width: 116px;
        padding-inline: 8px;
        box-shadow: none;
    }
}

/* Employees and vacations become readable cards on narrow mobile screens. */
@media (max-width: 760px) {
    .portal-content :where(.employees-screen, .company-vacations-screen) .school-table-top-pagination {
        width: 100%;
        margin-block: 12px 14px;
    }

    .portal-content :where(.employees-screen, .company-vacations-screen) .school-table-top-pagination .school-table-footer-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 12px;
    }

    .portal-content :where(.employees-screen, .company-vacations-screen) .school-pagination {
        flex-wrap: nowrap;
    }

    .portal-content :where(.employees-screen, .company-vacations-screen) .school-table-shell {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .portal-content :where(.employees-table, .company-vacation-table) {
        display: block;
        width: 100%;
        min-width: 0 !important;
        table-layout: auto;
        border: 0;
        background: transparent;
    }

    .portal-content :where(.employees-table, .company-vacation-table) thead {
        display: none;
    }

    .portal-content :where(.employees-table, .company-vacation-table) tbody {
        display: grid;
        gap: 12px;
        width: 100%;
    }

    .portal-content :where(.employees-table, .company-vacation-table) tbody tr {
        position: relative;
        display: grid;
        gap: 0;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        border: 1px solid var(--entria-border);
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.035);
    }

    .portal-content :where(.employees-table, .company-vacation-table) tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 18px;
        width: auto !important;
        min-width: 0 !important;
        padding: 10px 16px;
        border: 0;
        border-top: 1px solid var(--entria-border-soft);
        color: var(--entria-ink-soft);
        text-align: right;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    .portal-content :where(.employees-table, .company-vacation-table) tbody td::before {
        flex: 0 0 42%;
        content: attr(data-label);
        color: var(--entria-muted);
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.35;
        text-align: left;
    }

    .portal-content :where(.employees-table, .company-vacation-table) :where(.employee-mobile-primary, .company-vacation-employee-cell) {
        display: block;
        padding: 16px;
        border-top: 0;
        text-align: left;
    }

    .portal-content :where(.employees-table, .company-vacation-table) :where(.employee-mobile-primary, .company-vacation-employee-cell)::before {
        display: none;
    }

    .portal-content :where(.employees-table, .company-vacation-table) .school-person-cell {
        align-items: flex-start;
        min-width: 0;
    }

    .portal-content :where(.employees-table, .company-vacation-table) .school-person-cell > div:last-child {
        min-width: 0;
    }

    .portal-content :where(.employees-table, .company-vacation-table) :where(.school-person-title, .school-person-subtitle) {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        hyphens: none;
    }

    .portal-content .employees-table .employee-mobile-checkbox {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 1;
        display: block;
        width: auto !important;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .portal-content .employees-table .employee-mobile-checkbox::before {
        display: none;
    }

    .portal-content .employees-table:has(.employee-mobile-checkbox) .employee-mobile-primary {
        padding-right: 54px;
    }

    .portal-content :where(.employees-table, .company-vacation-table) .school-actions-cell {
        position: static;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
        padding: 12px 16px;
        background: #fbfcff;
        box-shadow: none;
    }

    .portal-content :where(.employees-table, .company-vacation-table) .school-actions-cell::before {
        margin-right: auto;
        text-align: left;
    }

    .portal-content .company-vacation-table .company-vacation-mobile-secondary {
        display: none;
    }

    .portal-content .company-vacation-table .school-actions-cell .school-secondary-button {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 14px;
    }

    .portal-content .company-vacation-table .school-actions-cell {
        flex-wrap: wrap;
    }

    .portal-content .company-vacation-table .school-actions-cell::before {
        flex: 0 0 100%;
    }

    .portal-content :where(.employees-screen, .company-vacations-screen) .school-table-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .portal-content :where(.employees-screen, .company-vacations-screen) .school-table-footer .school-table-footer-actions {
        justify-content: space-between;
        width: 100%;
    }
}

/* Shared mobile treatment for the remaining simple data tables in Entria. */
@media (max-width: 760px) {
    .portal-content :where(
        .school-table-shell,
        .action-plan-list-panel,
        .results-table-wrap
    ).entria-mobile-card-table-shell {
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) {
        display: block;
        width: 100%;
        min-width: 0 !important;
        max-width: 100%;
        table-layout: auto;
        border: 0;
        border-collapse: separate;
        background: transparent;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) tbody {
        display: grid;
        gap: 12px;
        width: 100%;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) tbody tr {
        position: relative;
        display: grid;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        border: 1px solid var(--entria-border);
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.035);
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) tbody td {
        position: static;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 18px;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 10px 16px;
        border: 0;
        border-top: 1px solid var(--entria-border-soft);
        background: transparent;
        box-shadow: none;
        color: var(--entria-ink-soft);
        line-height: 1.4;
        text-align: right;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        hyphens: none;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) tbody td:first-child {
        border-top: 0;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) tbody td::before {
        flex: 0 0 42%;
        max-width: 42%;
        content: attr(data-label);
        color: var(--entria-muted);
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.35;
        text-align: left;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) tbody td[data-label=""]::before {
        display: none;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) :where(
        .school-person-cell,
        .school-person-title,
        .school-person-subtitle
    ) {
        min-width: 0;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        hyphens: none;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .school-person-cell {
        justify-content: flex-end;
        text-align: left;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-select-cell {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 1;
        display: block;
        width: auto !important;
        padding: 0;
        border: 0;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-select-cell::before {
        display: none;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-select-cell + td {
        min-height: 54px;
        padding-right: 54px;
        border-top: 0;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-actions-cell {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        padding: 12px 16px;
        background: #fbfcff;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-actions-cell::before {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 2px;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-actions-cell :where(
        button,
        a
    ) {
        max-width: 100%;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-empty-row {
        display: block;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-empty-row td {
        display: block;
        padding: 24px 16px;
        border: 0;
        text-align: center;
    }

    .portal-content .entria-mobile-card-table:not(.employees-table):not(.company-vacation-table) .entria-mobile-empty-row td::before {
        display: none;
    }
}

/* Shared overview cards for employees, attendance and report review. */
.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metric-card {
    position: relative;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    min-height: 112px;
    padding: 16px;
    border-radius: 15px;
    text-align: left;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metric-label {
    color: #172c4e;
    font-size: 0.83rem;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metric-value {
    font-size: 1.72rem;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metric-subvalue {
    font-size: 0.77rem;
    line-height: 1.3;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metric-icon {
    background: #ebf3ff;
    box-shadow: none;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .theme-green .school-metric-icon {
    background: #e8f8ef;
}

.portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .theme-gold .school-metric-icon {
    background: #fff3df;
    color: #e9960b;
}

.portal-content .employees-screen .employee-pending-metric {
    width: 100%;
    padding-right: 34px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.portal-content .employees-screen .employee-pending-metric[aria-pressed="true"] {
    border-color: #f0b850;
    background: #fffaf0;
}

.employee-metric-arrow {
    position: absolute;
    right: 14px;
    color: #284971;
    font-size: 1.5rem;
    font-weight: 800;
}

.portal-content .employees-screen .employee-directory-toolbar {
    position: relative;
    z-index: 6;
    display: grid;
    grid-template-columns: minmax(260px, 2.3fr) repeat(2, minmax(120px, 0.72fr)) auto;
    align-items: end;
    gap: 10px;
    margin: 8px 0 14px;
}

.portal-content .employees-screen .employee-directory-toolbar > * {
    min-width: 0;
}

.portal-content .employees-screen .employee-directory-toolbar .school-labeled-field {
    font-size: 0.76rem;
}

.portal-content .employees-screen .employee-directory-toolbar .school-primary-button,
.portal-content .employees-screen .employee-directory-toolbar .school-secondary-button {
    min-height: 44px;
    white-space: nowrap;
}

.portal-content .employees-screen .employee-directory-actions,
.portal-content .employees-screen .employee-directory-primary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-content .employees-screen .employee-directory-actions {
    justify-content: flex-end;
}

.portal-content .employees-screen .employee-import-menu > button {
    width: 100%;
}

.portal-content .employees-screen .employee-import-menu .employee-file-menu-panel {
    right: 0;
    left: auto;
}

.portal-content .employees-screen .employee-advanced-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #dce8f9;
    border-radius: 12px;
    background: #f8fbff;
}

.portal-content .employees-screen .employee-advanced-filters label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #24405f;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.portal-content .employees-screen .employee-advanced-filters input {
    width: 17px;
    height: 17px;
    accent-color: #2467e8;
}

.portal-content .employees-screen .employee-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

.portal-content .employees-screen .employee-active-filters > span {
    color: var(--entria-muted);
    font-size: .8rem;
    font-weight: 700;
}

.portal-content .employees-screen .employee-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid #cfe0fc;
    border-radius: 999px;
    background: #eaf2ff;
    color: #1d5bc2;
    font: inherit;
    font-size: .78rem;
    font-weight: 750;
    cursor: pointer;
}

.portal-content .employees-screen .employee-active-filter:hover {
    background: #dceaff;
}

.portal-content .employees-screen .employee-active-filter:focus-visible {
    outline: 2px solid var(--entria-primary);
    outline-offset: 2px;
}

.portal-content .employees-screen .employee-active-filter span {
    font-size: 1rem;
    line-height: 1;
}

.portal-content .employees-screen .table-view-header {
    margin: 8px 0 12px;
}

.portal-content .employees-screen .employee-results-count {
    color: #536784;
    font-size: 0.82rem;
    font-weight: 750;
}

.portal-content .employees-screen .employee-columns-button {
    min-height: 38px;
    font-size: 0.79rem;
}

.portal-content :is(.employees-screen, .company-review-screen) .employee-selection-toolbar {
    position: relative;
    z-index: 5;
    align-items: center;
    margin: 0 0 -1px;
    padding: 10px 14px;
    border: 1px solid #cfe0fc;
    border-radius: 13px 13px 0 0;
    background: #edf5ff;
}

.portal-content :is(.employees-screen, .company-review-screen) .employee-selection-summary {
    display: grid;
    gap: 3px;
    font-size: 0.78rem;
}

.portal-content :is(.employees-screen, .company-review-screen) .employee-selection-summary strong {
    color: #183864;
    font-size: 0.82rem;
}

.portal-content :is(.employees-screen, .company-review-screen) .employee-selection-actions {
    gap: 7px;
}

.portal-content :is(.employees-screen, .company-review-screen) .employee-selection-actions .school-secondary-button {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.portal-content .employees-screen > .school-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.portal-content .employees-screen .employee-table-scroll-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    color: var(--entria-muted);
    font-size: .78rem;
    font-weight: 700;
}

.portal-content .employees-screen .employee-table-scroll-tools[hidden] { display: none; }
.portal-content .employees-screen .employee-table-scroll-tools > span { flex: none; }
.portal-content .employees-screen .employee-table-top-scroll {
    flex: 1;
    min-width: 0;
    height: 19px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 10px;
    background: #edf3fc;
    scrollbar-color: #9bb9e5 #edf3fc;
}
.portal-content .employees-screen .employee-table-top-scroll:focus-visible {
    outline: 2px solid var(--entria-primary);
    outline-offset: 2px;
}
.portal-content .employees-screen .employee-table-top-scroll-content { height: 1px; }

@media (min-width: 761px) {
.portal-content .employees-screen .employees-table-shell {
    border: 1px solid var(--entria-border);
    border-radius: var(--entria-panel-radius);
    background: var(--entria-surface);
    box-shadow: none;
}

.portal-content .employees-screen .employees-table {
    width: max-content;
    min-width: 100%;
}

.portal-content .employees-screen .employees-table th,
.portal-content .employees-screen .employee-sort-button {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.portal-content .employees-screen .employees-table,
.portal-content .employees-screen .employees-table tbody td {
    background: var(--entria-surface);
}

.portal-content .employees-screen .employees-table tbody tr:hover td {
    background: rgba(232, 241, 255, 0.5);
}

.portal-content .employees-screen .employees-table th {
    padding: 14px 16px;
    background: var(--entria-surface-soft);
    color: #5f6e87;
}

.portal-content .employees-screen .employee-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    cursor: pointer;
}

.portal-content .employees-screen .employee-sort-button span {
    color: #8a9bb5;
    font-size: .8em;
}

.portal-content .employees-screen th[aria-sort="ascending"] .employee-sort-button span,
.portal-content .employees-screen th[aria-sort="descending"] .employee-sort-button span {
    color: var(--entria-primary);
}

.portal-content .employees-screen .employee-sort-button:focus-visible {
    outline: 2px solid var(--entria-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

.portal-content .employees-screen .employees-table td {
    padding: 24px 16px;
    color: var(--entria-ink-soft);
}
}

@media (max-width: 760px) {
    .portal-content .employees-screen .employee-table-scroll-tools { display: none; }
    .portal-content .employees-screen .employees-table-shell,
    .portal-content .employees-screen .employees-table {
        background: transparent;
    }
}

.portal-content .employees-screen .employees-table .employees-col-person { min-width: 285px; }
.portal-content .employees-screen .employees-table .employees-col-role-area { min-width: 185px; }
.portal-content .employees-screen .employees-table .employees-col-schedule { min-width: 155px; }
.portal-content .employees-screen .employees-table .employees-col-access { min-width: 170px; }
.portal-content .employees-screen .employees-table .employees-col-status { min-width: 105px; }
.portal-content .employees-screen .employees-table .employees-col-configuration { min-width: 155px; }
.portal-content .employees-screen .employees-table .employees-col-birth-date { min-width: 175px; }

.portal-content .employees-screen .employees-table .school-person-title {
    line-height: 1.3;
}

.portal-content .employees-screen .employees-table .school-person-subtitle {
    margin-top: 3px;
    line-height: 1.3;
}

.portal-content .employees-screen .employee-directory-cell-stack {
    display: grid;
    gap: 4px;
    color: #657791;
    font-size: 0.78rem;
}

.portal-content .employees-screen .employee-directory-cell-stack strong {
    color: #203959;
    font-size: 0.82rem;
}

.portal-content .employees-screen :is(.employee-access-pill, .employee-configuration-pill) {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
}

.portal-content .employees-screen .employee-access-pill.is-active,
.portal-content .employees-screen .employee-configuration-pill.is-complete {
    background: #e6f7ed;
    color: #168050;
}

.portal-content .employees-screen .employee-access-pill.is-pending,
.portal-content .employees-screen .employee-configuration-pill.is-pending {
    background: #fff4e4;
    color: #a65d09;
}

.portal-content .employees-screen .employee-access-pill.is-none {
    background: #ffedf0;
    color: #bf3f50;
}

.portal-content .employees-screen .employee-configuration-pill.is-muted {
    background: #edf2f7;
    color: #64748b;
}

@media (max-width: 1600px) {
    .portal-content .employees-screen .employee-directory-toolbar {
        grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(120px, 0.7fr));
    }

    .portal-content .employees-screen .employee-directory-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
    }
}

@media (max-width: 1100px) {
    .portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-content .employees-screen .employee-directory-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-content .employees-screen .employee-directory-toolbar > :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 650px) {
    .portal-content :is(.employees-screen, .company-attendance-screen, .company-review-screen) .school-metrics-grid,
    .portal-content .employees-screen .employee-directory-toolbar {
        grid-template-columns: 1fr;
    }

    .portal-content .employees-screen .employee-directory-toolbar > :first-child {
        grid-column: auto;
    }

    .portal-content .employees-screen .employee-directory-actions,
    .portal-content .employees-screen .employee-directory-primary-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .portal-content .employees-screen .employee-directory-actions > button,
    .portal-content .employees-screen .employee-directory-primary-actions > button,
    .portal-content .employees-screen .employee-import-menu,
    .portal-content .employees-screen .employee-import-menu > button {
        width: 100%;
    }

    .portal-content :is(.employees-screen, .company-review-screen) .employee-selection-actions .school-secondary-button {
        white-space: normal;
    }
}

/* Employee creation and editing forms. */
.employee-form-backdrop { padding: 12px; background: rgba(15, 30, 56, 0.45); }
.employee-form-backdrop.is-new { padding: 0; background: #f8fbff; }
.employee-form-backdrop .employee-form-modal { width: min(100%, 1150px); max-height: calc(100dvh - 24px); }
.employee-form-backdrop .employee-form-modal.is-new { width: min(100%, 1280px); background: #f8fbff; }
body .employee-form-backdrop > .employee-form-modal { max-height: calc(100dvh - 24px); }
body .employee-form-backdrop > .employee-form-modal.is-new { background: #f8fbff; }
body .employee-form-backdrop.is-new > .employee-form-modal { width: 100%; max-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
.employee-form-modal .employee-form-header { padding: 14px 20px; background: inherit; }
body .employee-form-backdrop > .employee-form-modal > .employee-form-header { padding: 14px 20px; }
.employee-form-modal .employee-form-header .app-modal-title h3 { font-size: 1.35rem; }
.employee-form-modal .employee-form-header .app-modal-title p { margin: 2px 0 0; font-size: 0.84rem; }
.employee-form-modal .employee-form-header .app-modal-close { width: auto; min-width: 34px; padding: 4px 12px; font-size: 0.82rem; font-weight: 800; }
body .employee-form-backdrop > .employee-form-modal > .employee-form-header .app-modal-close { width: auto; min-width: 34px; }
.employee-form-modal .employee-form-breadcrumb { margin-bottom: 6px; color: #577398; font-size: 0.78rem; }
.employee-form-modal .employee-form-body { padding: 14px 20px 20px; }
body .employee-form-backdrop > .employee-form-modal > .employee-form-body { padding: 14px 20px 20px; }
.employee-form-modal .employee-form-layout { max-width: 1240px; margin: 0 auto; }
.employee-form-modal .employee-form-layout.is-new { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(250px, 0.85fr); gap: 14px; }
.employee-form-modal .employee-form-main { display: grid; gap: 12px; align-items: stretch; min-width: 0; }
.employee-form-modal .employee-form-layout.is-edit .employee-form-main { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "personal labor" "attendance payroll" "attendance portal"; }
.employee-form-modal .employee-form-layout.is-new .employee-form-main { grid-template-columns: 1fr; grid-template-areas: "personal" "labor" "attendance" "payroll" "portal"; }
.employee-form-modal .employee-form-personal { grid-area: personal; }
.employee-form-modal .employee-form-labor { grid-area: labor; }
.employee-form-modal .employee-form-attendance { grid-area: attendance; }
.employee-form-modal .employee-form-payroll { grid-area: payroll; }
.employee-form-modal .employee-form-portal { grid-area: portal; }
.employee-form-modal .employee-form-card { min-width: 0; padding: 13px; border: 1px solid #dce7f7; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(37, 67, 115, 0.035); }
.employee-form-modal .employee-form-card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.employee-form-modal .employee-form-card-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #edf4ff; color: #2365ce; font-size: 1rem; font-weight: 800; }
.employee-form-modal .employee-form-card h4 { margin: 0; color: #152c4d; font-size: 0.92rem; font-weight: 800; }
.employee-form-modal .employee-form-card p { margin: 2px 0 0; color: #607592; font-size: 0.78rem; line-height: 1.4; }
.employee-form-modal .employee-form-fields { display: grid; gap: 10px 12px; }
.employee-form-modal .employee-form-fields.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.employee-form-modal .employee-form-fields .full-width { grid-column: 1 / -1; }
.employee-form-modal .school-labeled-field { min-width: 0; gap: 4px; color: #4b6383; font-size: 0.78rem; }
.employee-form-modal .school-labeled-field > span { font-weight: 700; }
.employee-form-modal .school-labeled-field b, .employee-form-modal .employee-form-info b { color: #d54152; }
.employee-form-modal .school-labeled-field small { color: #66809f; font-size: 0.74rem; line-height: 1.4; }
.employee-form-modal .school-code-input, .employee-form-modal .school-select-field { min-height: 38px; padding: 7px 10px; border-radius: 8px; font-size: 0.84rem; font-weight: 500; }
.employee-form-modal .employee-date-field { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.employee-form-modal .employee-date-field > .school-code-input { flex: 1 1 auto; min-width: 0; }
.employee-form-modal .employee-date-picker { position: relative; display: grid; flex: 0 0 38px; place-items: center; border: 1px solid #dce5f3; border-radius: 8px; background: #fff; color: #526987; cursor: pointer; }
.employee-form-modal .employee-date-picker svg { width: 18px; height: 18px; pointer-events: none; }
.employee-form-modal .employee-date-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.employee-form-modal .employee-date-picker input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.employee-form-modal .employee-date-picker:focus-within { outline: 2px solid #2b68db; outline-offset: 2px; }
.employee-form-modal .employee-form-summary { display: flex; align-items: center; gap: 13px; margin: 0 auto 14px; padding: 11px 15px; max-width: 1240px; border: 1px solid #dce7f7; border-radius: 12px; background: #fff; }
.employee-form-modal .employee-form-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #e3edff; color: #265cb7; font-size: 0.92rem; font-weight: 800; }
.employee-form-modal .employee-form-avatar.large { width: 65px; height: 65px; border: 1px dashed #adc8f3; font-size: 1.1rem; }
.employee-form-modal .employee-form-summary > div:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.employee-form-modal .employee-form-summary strong { color: #152b4c; font-size: 0.92rem; }
.employee-form-modal .employee-form-summary span { color: #687c99; font-size: 0.78rem; }
.employee-form-modal .employee-form-summary-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.employee-form-modal .employee-form-summary-badges span { padding: 6px 10px; border-radius: 999px; background: #e9f8f2; color: #168258; font-weight: 800; }
.employee-form-modal .employee-form-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px; border: 1px solid #dbe7f8; border-radius: 9px; background: #f8fbff; cursor: pointer; }
.employee-form-modal .employee-form-switch input { width: 31px; height: 19px; accent-color: #2267df; }
.employee-form-modal .employee-form-switch span { display: grid; gap: 2px; }
.employee-form-modal .employee-form-switch strong { color: #223c61; font-size: 0.82rem; }
.employee-form-modal .employee-form-switch small { color: #667b98; font-size: 0.74rem; }
.employee-form-modal .employee-form-portal-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 10px; padding: 10px; border: 1px solid #ccebdc; border-radius: 9px; background: #effbf5; font-size: 0.8rem; }
.employee-form-modal .employee-form-portal-status strong { color: #168b60; }
.employee-form-modal .employee-form-portal-status span { color: #415a78; }
.employee-form-modal .employee-form-muted { padding: 10px; }
.employee-form-modal .employee-form-aside { display: grid; align-content: start; gap: 12px; }
.employee-form-modal .employee-form-avatar-card { display: flex; align-items: center; gap: 12px; }
.employee-form-modal .employee-form-info { border-color: #cfe3ff; background: #eff7ff; }
.employee-form-modal .employee-form-info h4 { color: #2466cf; }
.employee-form-modal .employee-form-status-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin: 10px 0; padding: 3px; border-radius: 8px; background: #eef2f8; }
.employee-form-modal .employee-form-status-choice button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: #536b8b; font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.employee-form-modal .employee-form-status-choice button.is-selected { background: linear-gradient(100deg, #2868e7, #159dbc); color: #fff; }
.employee-form-modal .employee-form-footer { justify-content: flex-end; padding: 11px 20px; }
body .employee-form-backdrop > .employee-form-modal > .employee-form-footer { padding: 11px 20px; }
.employee-form-modal .employee-form-footer button { min-width: 110px; }

@media (max-width: 900px) {
    .employee-form-modal .employee-form-layout.is-new { grid-template-columns: 1fr; }
    .employee-form-modal .employee-form-layout.is-edit .employee-form-main { grid-template-columns: 1fr; grid-template-areas: "personal" "labor" "attendance" "payroll" "portal"; }
    .employee-form-modal .employee-form-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .employee-form-modal .employee-form-summary-badges { margin-left: 0; }
    .employee-form-modal .employee-form-summary { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .employee-form-backdrop { padding: 0; }
    body .employee-form-backdrop > .employee-form-modal { max-height: 100dvh; border-radius: 0; }
    .employee-form-modal .employee-form-header, .employee-form-modal .employee-form-body, .employee-form-modal .employee-form-footer { padding-inline: 14px; }
    body .employee-form-backdrop > .employee-form-modal > .employee-form-header,
    body .employee-form-backdrop > .employee-form-modal > .employee-form-body,
    body .employee-form-backdrop > .employee-form-modal > .employee-form-footer { padding-inline: 14px; }
    .employee-form-modal .employee-form-fields.two-columns, .employee-form-modal .employee-form-aside { grid-template-columns: 1fr; }
    .employee-form-modal .employee-form-header .app-modal-close { max-width: 145px; white-space: normal; }
}

/* Asignación de turnos: misma escala tipográfica y controles de Entria. */
.portal-content .shift-assignments-screen { gap: 16px; }
.portal-content .shift-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.portal-content .shift-page-header h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -.025em; }
.portal-content .shift-page-header p { margin-top: 3px; font-size: .95rem !important; }
.portal-content .shift-primary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-content .shift-primary-actions .school-primary-button,
.portal-content .shift-primary-actions .school-secondary-button { min-width: 0; white-space: nowrap; }
.portal-content .shift-assignment-filter-panel { padding: 16px 18px; }
.portal-content .shift-assignment-filter-grid {
    display: grid;
    grid-template-columns: minmax(340px, 2.3fr) repeat(3, minmax(130px, 1fr)) minmax(170px, 1.1fr) auto auto;
    align-items: end;
    gap: 10px;
}
.portal-content .shift-assignment-filter-grid > .shift-assignment-employee-filter { grid-column: auto; }
.portal-content .shift-assignment-filter-grid .school-labeled-field { min-width: 0; }
.portal-content .shift-period-field { display: grid; gap: 7px; }
.portal-content .shift-period-actions { display: flex; flex-wrap: nowrap; gap: 5px; }
.portal-content .shift-period-button { min-height: var(--entria-control-height); padding: 0 11px; border: 1px solid var(--entria-border); border-radius: 10px; background: #fff; color: var(--entria-ink-soft); font: inherit; font-size: .84rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.portal-content .shift-period-button.active { border-color: transparent; background: linear-gradient(135deg, var(--entria-primary), var(--entria-accent)); color: #fff; }
.portal-content .shift-assignment-employee-filter .school-code-input { width: 100%; }
.portal-content .shift-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.portal-content .shift-assignment-advanced-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--entria-border-soft); }
.portal-content .shift-assignment-advanced-filters .school-labeled-field { min-width: 170px; }
.portal-content .shift-assignment-tabs { gap: 8px; margin: 0; padding: 0; border-bottom: 0; }
.portal-content .shift-assignment-tabs .school-tab { min-height: 46px; padding: 11px 16px; border: 1px solid var(--entria-border); border-bottom: 3px solid transparent; border-radius: 12px 12px 0 0; background: #fff; font-size: .91rem; font-weight: 800; }
.portal-content .shift-assignment-tabs .school-tab.active { color: var(--entria-ink-soft); border-bottom-color: var(--entria-accent); }
.portal-content .shift-assignment-list-panel { padding: 0; overflow: hidden; }
.portal-content .shift-list-heading { margin: 0; padding: 16px 18px 10px; }
.portal-content .shift-list-heading .school-section-title { font-size: 1.06rem; }
.portal-content .shift-assignment-table-shell,
.portal-content .shift-upcoming-table-shell { border: 0; border-radius: 0; box-shadow: none; }
.portal-content .shift-assignment-table { min-width: 1270px; }
.portal-content .shift-assignment-table th,
.portal-content .shift-upcoming-table th { padding: 11px 12px; font-size: .78rem; }
.portal-content .shift-assignment-table td,
.portal-content .shift-upcoming-table td { padding: 10px 12px; font-size: .89rem; }
.portal-content .shift-assignment-table .school-person-cell > span:last-child,
.portal-content .shift-assignment-table td > .school-person-subtitle,
.portal-content .shift-upcoming-table td > .school-person-subtitle { display: grid; gap: 2px; }
.portal-content .shift-assignment-table .school-avatar { width: 36px; height: 36px; font-size: .81rem; }
.portal-content .shift-assignment-table .school-person-title,
.portal-content .shift-upcoming-table .school-person-title { font-size: .88rem; }
.portal-content .shift-assignment-table .school-person-subtitle,
.portal-content .shift-upcoming-table .school-person-subtitle { font-size: .78rem; }
.portal-content .shift-assignment-table .shift-vigency-pill,
.portal-content .shift-upcoming-table .shift-vigency-pill { min-width: 0; padding: 5px 10px; font-size: .78rem; }
.portal-content .shift-assignment-table .shift-vigency-pill.is-future,
.portal-content .shift-upcoming-table .shift-vigency-pill.is-future { background: #fff1e6; color: #c75022; }
.portal-content .shift-row-actions { display: flex; gap: 4px; }
.portal-content .shift-row-actions .school-icon-button { width: 34px; height: 34px; }
.portal-content .shift-assignment-table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--entria-border-soft); }
.portal-content .shift-bulk-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.portal-content .shift-bulk-actions > span { margin-right: 4px; color: var(--entria-muted); font-size: .86rem; }
.portal-content .shift-bulk-actions .school-secondary-button { min-height: 38px; padding-inline: 12px; font-size: .8rem; }
.portal-content .shift-assignment-table-footer .school-table-footer { margin: 0; padding: 0; border: 0; }
.portal-content .shift-upcoming-panel { padding: 0; overflow: hidden; }
.portal-content .shift-upcoming-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.portal-content .shift-upcoming-heading .school-secondary-button { min-height: 36px; padding-inline: 10px; font-size: .8rem; }
.portal-content .shift-upcoming-heading .school-section-title { font-size: 1.08rem; }
.portal-content .shift-upcoming-heading p,
.portal-content .shift-upcoming-more { margin: 3px 0 0; color: var(--entria-muted); font-size: .86rem; }
.portal-content .shift-upcoming-more { padding: 10px 18px 14px; }
.portal-content .shift-upcoming-table { min-width: 900px; }
@media (max-width: 1450px) {
    .portal-content .shift-assignment-filter-grid { grid-template-columns: minmax(320px, 2fr) repeat(3, minmax(130px, 1fr)); }
    .portal-content .shift-assignment-employee-filter { grid-column: 1 / 3 !important; }
}
@media (max-width: 980px) {
    .portal-content .shift-page-header { flex-direction: column; }
    .portal-content .shift-assignment-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-content .shift-period-field { grid-column: 1 / -1; }
    .portal-content .shift-assignment-employee-filter { grid-column: auto !important; }
}
@media (max-width: 600px) {
    .portal-content .shift-assignment-filter-grid { grid-template-columns: 1fr; }
    .portal-content .shift-period-field { grid-column: auto; }
    .portal-content .shift-period-actions { flex-wrap: wrap; }
    .portal-content .shift-assignment-employee-filter { grid-column: auto !important; }
    .portal-content .shift-primary-actions { width: 100%; }
    .portal-content .shift-primary-actions > button { flex: 1 1 100%; }
}

/* Captura de asignaciones con la tipografía y escala de Entria. */
.portal-content .shift-assignment-editor { display: grid; gap: 14px; min-width: 0; }
.portal-content .shift-editor-header h2 { margin: 0; color: var(--entria-ink-soft); font-size: 1.9rem; font-weight: 800; letter-spacing: -.025em; }
.portal-content .shift-editor-header p { margin: 2px 0 0; color: var(--entria-muted); font-size: .95rem; }
.portal-content .shift-editor-scope-card,
.portal-content .shift-editor-step-card,
.portal-content .shift-editor-validation { padding: 18px; border: 1px solid var(--entria-border); border-radius: 16px; }
.portal-content .shift-editor-step-heading { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.portal-content .shift-editor-step-heading h3 { margin: 0; color: var(--entria-ink-soft); font-size: 1rem; font-weight: 800; }
.portal-content .shift-editor-step-heading p { margin: 2px 0 0; color: var(--entria-muted); font-size: .82rem; line-height: 1.4; }
.portal-content .shift-editor-step-number { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--entria-primary); color: #fff; font-size: .9rem; font-weight: 800; }
.portal-content .shift-editor-step-number.is-warning { background: #f5b426; }
.portal-content .shift-editor-scope-card > .shift-editor-step-heading { align-items: center; }
.portal-content .shift-editor-target-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.portal-content .shift-editor-target-tabs button,
.portal-content .shift-editor-date-presets button { min-height: 40px; padding: 0 16px; border: 1px solid var(--entria-border); border-radius: 10px; background: #fff; color: var(--entria-ink-soft); font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; }
.portal-content .shift-editor-target-tabs button { min-width: 145px; }
.portal-content .shift-editor-target-tabs button.active,
.portal-content .shift-editor-date-presets button.active { border-color: var(--entria-primary); background: #e9f1ff; color: #1d5bc2; }
.portal-content .shift-editor-target-tabs button.active { background: var(--entria-primary); color: #fff; }
.portal-content .shift-editor-target-tabs button:disabled { cursor: default; }
.portal-content .shift-editor-employee-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 18px; }
.portal-content .shift-editor-employee-row .school-labeled-field { min-width: 0; }
.portal-content .shift-editor-employee-row .school-code-input { width: 100%; }
.portal-content .shift-editor-employee-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.portal-content .shift-editor-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 9px; border-radius: 999px; background: #e9f1ff; color: #1c57b1; font-size: .82rem; font-weight: 750; }
.portal-content .shift-editor-chip.is-missing { background: #fff0ed; color: #bc3d32; }
.portal-content .shift-editor-chip button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 1.15rem; line-height: .8; cursor: pointer; }
.portal-content .shift-editor-selection-count { margin: 8px 0 0; color: var(--entria-muted); font-size: .82rem; }
.portal-content .shift-editor-scope-select { max-width: 520px; margin-top: 18px; }
.portal-content .shift-editor-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 12px; }
.portal-content .shift-editor-step-card { display: grid; align-content: start; gap: 13px; min-width: 0; }
.portal-content .shift-editor-step-card .school-labeled-field { min-width: 0; }
.portal-content .shift-editor-step-card :where(.school-select-field, .school-code-input, .app-form-textarea) { width: 100%; border-color: var(--entria-border); border-radius: 10px; font-size: .9rem; }
.portal-content .shift-editor-step-card .app-form-textarea { min-height: 75px; resize: vertical; }
.portal-content .shift-editor-schedule-summary { padding: 11px 12px; border-radius: 10px; background: #f1f6ff; color: #536986; font-size: .84rem; line-height: 1.5; }
.portal-content .shift-editor-date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portal-content .shift-editor-date-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.portal-content .shift-editor-date-presets button { min-height: 35px; padding-inline: 10px; font-size: .78rem; }
.portal-content .shift-editor-validation { background: #fffdfa; border-color: #f4d891; }
.portal-content .shift-editor-validation-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.portal-content .shift-editor-validation-heading > .school-secondary-button { margin-left: auto; min-height: 38px; padding-inline: 12px; font-size: .82rem; }
.portal-content .shift-editor-validation-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-content .shift-editor-validation-counts span,
.portal-content .shift-editor-result-pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.portal-content .shift-editor-validation-counts .is-ok,
.portal-content .shift-editor-result-pill.is-ok { background: #e3f8ed; color: #087348; }
.portal-content .shift-editor-validation-counts .is-warning { background: #fff3d9; color: #a66a06; }
.portal-content .shift-editor-result-pill.is-conflict { background: #ffebeb; color: #b83232; }
.portal-content .shift-editor-preview-hint { margin: 14px 0 0; color: var(--entria-muted); font-size: .86rem; }
.portal-content .shift-editor-error { margin: 10px 0 0; color: #b83232; font-size: .84rem; font-weight: 700; }
.portal-content .shift-editor-preview-table-shell { margin-top: 14px; border-radius: 10px; }
.portal-content .shift-editor-preview-table { min-width: 750px; }
.portal-content .shift-editor-preview-table th { padding: 9px 12px; font-size: .78rem; }
.portal-content .shift-editor-preview-table td { padding: 9px 12px; font-size: .85rem; }
.portal-content .shift-editor-preview-table td:first-child strong,
.portal-content .shift-editor-preview-table td:first-child small { display: block; }
.portal-content .shift-editor-preview-table td:first-child small { color: var(--entria-muted); }
.portal-content .shift-editor-conflict-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 12px; }
.portal-content .shift-editor-conflict-actions .school-check-field { margin: 0; }
.portal-content .shift-editor-conflict-actions .school-check-field small { display: block; }
.portal-content .shift-editor-calendar-details { margin-top: 12px; color: var(--entria-ink-soft); font-size: .85rem; }
.portal-content .shift-editor-calendar-details summary { cursor: pointer; font-weight: 700; }
.portal-content .shift-editor-calendar-details .shift-calendar-scroll { margin-top: 10px; }
.portal-content .shift-editor-footer { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-top: 1px solid var(--entria-border); background: var(--entria-surface-soft); }
@media (max-width: 1150px) {
    .portal-content .shift-editor-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-content .shift-editor-target-tabs { width: 100%; margin-left: 43px; }
    .portal-content .shift-editor-scope-card > .shift-editor-step-heading { flex-wrap: wrap; }
}
@media (max-width: 720px) {
    .portal-content .shift-editor-detail-grid { grid-template-columns: 1fr; }
    .portal-content .shift-editor-employee-row { grid-template-columns: 1fr; }
    .portal-content .shift-editor-target-tabs { margin-left: 0; }
    .portal-content .shift-editor-target-tabs button { flex: 1 1 120px; min-width: 0; }
    .portal-content .shift-editor-validation-heading > .school-secondary-button { width: 100%; margin-left: 0; }
}

/* Rotaciones rápidas: composición en pasos, vista previa y conflictos. */
.portal-content .shift-rotation-editor { display: grid; gap: 13px; min-width: 0; }
.portal-content .shift-rotation-top-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px; }
.portal-content .shift-rotation-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.portal-content .shift-rotation-pattern-card,
.portal-content .shift-rotation-validity-card,
.portal-content .shift-rotation-reason-card,
.portal-content .shift-rotation-review-card { padding: 18px; border: 1px solid var(--entria-border); border-radius: 16px; min-width: 0; }
.portal-content .shift-rotation-pattern-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.portal-content .shift-rotation-pattern-fields > .school-labeled-field { min-width: 0; }
.portal-content .shift-rotation-pattern-fields .school-select-field,
.portal-content .shift-rotation-validity-card .school-code-input,
.portal-content .shift-rotation-reason-card :where(.school-select-field, .app-form-textarea) { width: 100%; border-color: var(--entria-border); border-radius: 10px; font-size: .88rem; }
.portal-content .shift-rotation-pattern-fields .school-labeled-field small { margin-top: 4px; color: var(--entria-muted); font-size: .76rem; line-height: 1.4; }
.portal-content .shift-rotation-pattern-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.portal-content .shift-rotation-pattern-links .school-secondary-button { min-height: 34px; padding-inline: 10px; font-size: .78rem; }
.portal-content .shift-rotation-calculated-period { margin: 0; padding: 10px 12px; border-radius: 9px; background: #f1f6ff; color: var(--entria-ink-soft); font-size: .82rem; }
.portal-content .shift-rotation-period-options { color: var(--entria-muted); font-size: .8rem; }
.portal-content .shift-rotation-period-options summary { cursor: pointer; font-weight: 700; }
.portal-content .shift-rotation-period-options .school-labeled-field { margin-top: 9px; }
.portal-content .shift-rotation-reason-card { display: grid; gap: 12px; }
.portal-content .shift-rotation-reason-fields { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr); align-items: start; gap: 12px; }
.portal-content .shift-rotation-reason-fields .school-labeled-field { min-width: 0; }
.portal-content .shift-rotation-reason-card .app-form-textarea { min-height: 55px; resize: vertical; }
.portal-content .shift-rotation-review-card { display: grid; gap: 11px; }
.portal-content .shift-rotation-preview-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.portal-content .shift-rotation-preview-heading > .school-secondary-button { flex: none; }
.portal-content .shift-rotation-block-table-shell,
.portal-content .shift-rotation-conflict-table-shell { border-radius: 10px; }
.portal-content .shift-rotation-block-table { min-width: 0; }
.portal-content .shift-rotation-block-table th,
.portal-content .shift-rotation-conflict-table th { padding: 9px 11px; font-size: .77rem; }
.portal-content .shift-rotation-block-table td,
.portal-content .shift-rotation-conflict-table td { padding: 8px 11px; font-size: .84rem; }
.portal-content .shift-rotation-block-pill { display: inline-block; padding: 7px 10px; border-radius: 9px; background: #e8f1ff; color: #1e57a9; font-size: .81rem; font-weight: 700; }
.portal-content .shift-rotation-block-table tr:nth-child(even) .shift-rotation-block-pill { background: #def8e9; color: #137651; }
.portal-content .shift-editor-step-number.is-success { background: #0d9c78; }
.portal-content .shift-rotation-validation-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.portal-content .shift-rotation-conflict-alert { display: grid; gap: 2px; padding: 11px 13px; border: 1px solid #f7d4af; border-radius: 10px; background: #fff7ed; color: #995119; font-size: .82rem; }
.portal-content .shift-rotation-conflict-alert strong { font-weight: 800; }
.portal-content .shift-rotation-conflict-table { min-width: 620px; }
.portal-content .shift-rotation-conflict-table td:first-child strong,
.portal-content .shift-rotation-conflict-table td:first-child small { display: block; }
.portal-content .shift-rotation-conflict-table td:first-child small { color: var(--entria-muted); }
.portal-content .shift-rotation-all-clear { margin: 0; padding: 12px; border-radius: 10px; background: #ecfaf3; color: #087348; font-size: .84rem; }
@media (max-width: 1150px) {
    .portal-content .shift-rotation-top-grid,
    .portal-content .shift-rotation-review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .portal-content .shift-rotation-pattern-fields,
    .portal-content .shift-rotation-reason-fields { grid-template-columns: 1fr; }
    .portal-content .shift-rotation-block-table { min-width: 520px; }
    .portal-content .shift-rotation-preview-heading > .school-secondary-button { width: 100%; }
}

/* Rotation pattern editor */
body .app-modal-backdrop > .shift-pattern-modal { width: min(100%, 1120px); }
body .app-modal-backdrop > .shift-pattern-modal > .shift-pattern-modal-body { padding: 14px 18px 18px; }
.shift-pattern-modal .app-modal-title h3 { font-size: 1.35rem; }
.shift-pattern-modal .app-modal-title p { font-size: .84rem; }
.shift-pattern-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, .95fr); align-items: start; gap: 12px; }
.shift-pattern-main, .shift-pattern-aside { display: grid; align-content: start; gap: 12px; min-width: 0; }
.shift-pattern-section { min-width: 0; padding: 14px; border: 1px solid var(--entria-border); border-radius: 12px; background: #fff; }
.shift-pattern-section h4 { margin: 0; color: var(--entria-ink); font-size: .94rem; font-weight: 800; }
.shift-pattern-section-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.shift-pattern-section-heading p { margin: 2px 0 0; color: var(--entria-muted); font-size: .79rem; line-height: 1.35; }
.shift-pattern-section-icon { display: grid; flex: none; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #eaf2ff; color: #1767d7; font-size: 1.05rem; font-weight: 800; }
.shift-pattern-type-section { padding: 11px 0 12px; border-left: 0; border-right: 0; border-top: 0; border-radius: 0; }
.shift-pattern-type-section h4 { margin: 0 0 9px 5px; font-size: .85rem; }
.shift-pattern-type-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.shift-pattern-type-option { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 66px; padding: 10px; border: 1px solid var(--entria-border); border-radius: 10px; background: #fff; color: var(--entria-ink); text-align: left; cursor: pointer; }
.shift-pattern-type-option.is-selected { border-color: #1767e9; background: #f5f9ff; box-shadow: inset 0 0 0 1px #1767e9; }
.shift-pattern-type-option > span:last-child { display: grid; min-width: 0; gap: 2px; }
.shift-pattern-type-option strong { font-size: .83rem; }
.shift-pattern-type-option small { color: var(--entria-muted); font-size: .72rem; line-height: 1.25; }
.shift-pattern-type-icon { display: grid; flex: none; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #eaf2ff; color: #1767e9; font-size: 1.45rem; font-weight: 700; }
.shift-pattern-info-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 10px; }
.shift-pattern-info-fields > * { min-width: 0; }
.shift-pattern-info-fields .app-form-textarea { width: 100%; min-height: 42px; resize: vertical; }
.shift-pattern-active-field { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.shift-pattern-active-field input { accent-color: #1767e9; width: 18px; height: 18px; }
.shift-pattern-active-field > span { display: grid; gap: 2px; }
.shift-pattern-active-field strong { font-size: .78rem; white-space: nowrap; }
.shift-pattern-active-field small { max-width: 110px; color: var(--entria-muted); font-size: .69rem; line-height: 1.25; }
.shift-pattern-config-section { display: grid; gap: 11px; }
.shift-pattern-config-section .shift-pattern-section-heading { margin-bottom: 2px; }
.shift-pattern-config-section .school-labeled-field > span { font-size: .78rem; }
.shift-pattern-config-section .school-select-field, .shift-pattern-config-section .school-code-input { min-height: 38px; }
.shift-pattern-config-section .shift-rest-rule-days > div { display: flex; flex-wrap: wrap; gap: 6px; }
.shift-pattern-config-section .shift-rest-rule-days label { padding: 6px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.shift-pattern-config-section .shift-rest-rule-days label:has(input:checked) { border-color: #9dc2fa; background: #eff6ff; color: #175bb5; }
.shift-pattern-config-section .shift-rest-rule-days input { accent-color: #1767e9; }
.shift-pattern-config-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shift-pattern-config-fields > * { min-width: 0; }
.shift-pattern-fixed-value { display: flex; align-items: center; min-height: 38px; padding: 0 10px; border: 1px solid var(--entria-border); border-radius: 9px; color: var(--entria-ink); font-size: .83rem; font-weight: 700; }
.shift-pattern-warning { margin: 0; padding: 10px 11px; border-radius: 9px; background: #fff4df; color: #845319; font-size: .76rem; line-height: 1.4; }
.shift-pattern-summary { display: grid; gap: 0; margin: 0; }
.shift-pattern-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 37px; border-bottom: 1px solid var(--entria-border-soft); }
.shift-pattern-summary > div:last-child { border-bottom: 0; }
.shift-pattern-summary dt { color: var(--entria-muted); font-size: .78rem; }
.shift-pattern-summary dd { margin: 0; color: var(--entria-ink); font-size: .79rem; font-weight: 800; text-align: right; }
.shift-pattern-summary dd small { display: block; margin-top: 2px; color: var(--entria-muted); font-size: .72rem; font-weight: 500; }
.shift-pattern-info-note { margin: 8px 0 0; padding: 10px; border-radius: 9px; background: #edf5ff; color: #3c638f; font-size: .76rem; line-height: 1.4; }
.shift-pattern-preview-list { display: grid; gap: 5px; }
.shift-pattern-preview-row { display: grid; grid-template-columns: 80px minmax(65px, 1fr) minmax(0, 1.2fr); align-items: center; gap: 7px; min-height: 34px; border: 1px solid var(--entria-border-soft); border-radius: 8px; overflow: hidden; font-size: .75rem; }
.shift-pattern-preview-row strong { align-self: stretch; display: flex; align-items: center; padding: 0 8px; background: #f3f7fd; color: #466083; font-size: .72rem; }
.shift-pattern-preview-row span { color: #526988; text-align: center; }
.shift-pattern-preview-row b { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 9px; border-radius: 999px; background: #e5f0ff; color: #175bb5; font-size: .72rem; }
.shift-pattern-preview-row:nth-child(even) b { background: #e5f8ef; color: #147a53; }
.shift-pattern-preview-repeat { display: flex; justify-content: space-between; gap: 7px; margin-top: 3px; padding: 9px; border: 1px dashed #abc9f8; border-radius: 8px; color: #466083; font-size: .75rem; }
.shift-pattern-preview-caption { margin: 9px 0 0; color: var(--entria-muted); font-size: .75rem; line-height: 1.4; }
.shift-pattern-config-section .shift-pattern-segments { gap: 8px; }
.shift-pattern-config-section .shift-pattern-segment { grid-template-columns: 28px minmax(85px, .8fr) 65px minmax(110px, 1.1fr) minmax(80px, 1fr) auto; gap: 7px; padding: 9px; border-radius: 9px; }
.shift-pattern-config-section .shift-segment-order { width: 28px; height: 28px; border-radius: 8px; font-size: .75rem; }
.shift-pattern-footer { justify-content: space-between; }
.shift-pattern-footer p { margin: 0; color: var(--entria-muted); font-size: .77rem; }
.shift-pattern-footer > div { display: flex; gap: 9px; }
@media (max-width: 850px) {
    .shift-pattern-layout { grid-template-columns: 1fr; }
    .shift-pattern-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shift-pattern-info-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shift-pattern-active-field { grid-column: 1 / -1; }
    .shift-pattern-config-section .shift-pattern-segment { grid-template-columns: 28px repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .shift-pattern-aside, .shift-pattern-type-options, .shift-pattern-info-fields, .shift-pattern-config-fields { grid-template-columns: 1fr; }
    .shift-pattern-footer { align-items: stretch; }
    .shift-pattern-footer > div { display: flex; flex-direction: column-reverse; }
    .shift-pattern-footer > div button { width: 100%; }
    .shift-pattern-config-section .shift-pattern-segment { grid-template-columns: 28px minmax(0, 1fr); }
}

/* Saved rotation pattern gallery */
body .app-modal-backdrop > .shift-pattern-manager-modal { width: min(100%, 1120px); grid-template-rows: auto minmax(0, 1fr); }
body .app-modal-backdrop > .shift-pattern-manager-modal > .shift-pattern-manager-body { padding: 18px 22px 22px; }
.shift-pattern-manager-modal .app-modal-title h3 { font-size: 1.35rem; }
.shift-pattern-manager-modal .app-modal-title p { font-size: .84rem; }
.shift-pattern-manager-header-actions { display: flex; align-items: center; gap: 10px; }
.shift-pattern-manager-header-actions .school-primary-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; }
.shift-pattern-manager-header-actions .school-primary-button svg { width: 18px; height: 18px; }
.shift-pattern-manager-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.shift-pattern-manager-search { display: flex; align-items: center; gap: 9px; width: min(100%, 420px); min-height: 42px; padding: 0 11px; border: 1px solid var(--entria-border); border-radius: 10px; background: #fff; color: var(--entria-muted); }
.shift-pattern-manager-search:focus-within { border-color: #5a9af3; box-shadow: 0 0 0 3px #ddecff; }
.shift-pattern-manager-search svg { flex: none; width: 18px; height: 18px; }
.shift-pattern-manager-search input { width: 100%; min-width: 0; height: 39px; border: 0; outline: 0; background: transparent; color: var(--entria-ink); font: inherit; font-size: .82rem; }
.shift-pattern-manager-filters { display: flex; align-items: end; gap: 10px; }
.shift-pattern-manager-filters .school-labeled-field { width: 170px; }
.shift-pattern-manager-filters .school-labeled-field > span { font-size: .75rem; }
.shift-pattern-manager-filters .school-select-field { min-height: 42px; font-size: .82rem; }
.shift-pattern-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.shift-pattern-gallery-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 258px; padding: 16px; border: 1px solid var(--entria-border); border-radius: 12px; background: #fff; }
.shift-pattern-gallery-card.is-muted { background: #fcfdff; }
.shift-pattern-gallery-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.shift-pattern-gallery-title h4 { margin: 0; color: var(--entria-ink); font-size: 1rem; font-weight: 800; line-height: 1.25; }
.shift-pattern-gallery-title .shift-pattern-status-pill { justify-self: auto; padding: 4px 11px; font-size: .73rem; }
.shift-pattern-gallery-type { display: flex; align-items: center; gap: 6px; color: #2768c1; font-size: .77rem; }
.shift-pattern-gallery-type > span:last-child { padding: 3px 8px; border-radius: 999px; background: #eaf2ff; }
.shift-pattern-gallery-type > span:first-child { font-size: 1.13rem; font-weight: 800; line-height: 1; }
.shift-pattern-gallery-meta, .shift-pattern-gallery-detail, .shift-pattern-gallery-description { margin: 0; color: #5a6d8b; font-size: .8rem; line-height: 1.35; }
.shift-pattern-gallery-meta + .shift-pattern-gallery-meta { margin-top: -4px; }
.shift-pattern-gallery-sequence { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 32px; margin-top: 2px; }
.shift-pattern-gallery-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 29px; padding: 3px 7px; border-radius: 7px; font-size: .69rem; font-weight: 800; white-space: nowrap; }
.shift-pattern-gallery-chip.is-primary { background: #e6f0ff; color: #1b62c8; }
.shift-pattern-gallery-chip.is-alternate { background: #ece9ff; color: #5b50b5; }
.shift-pattern-gallery-chip.is-rest { background: #def8ec; color: #187456; }
.shift-pattern-gallery-chip.is-weekday-0 { background: #e7f1ff; color: #2665bb; }
.shift-pattern-gallery-chip.is-weekday-1 { background: #def8ec; color: #187456; }
.shift-pattern-gallery-chip.is-weekday-2 { background: #fff1cf; color: #986800; }
.shift-pattern-gallery-chip.is-weekday-3 { background: #ece9ff; color: #5b50b5; }
.shift-pattern-gallery-chip.is-weekday-4 { background: #ffe5e8; color: #b24455; }
.shift-pattern-gallery-chip.is-repeat { min-width: 33px; margin-left: 3px; background: #f3f6fb; color: #476384; font-size: 1.15rem; line-height: 1; }
.shift-pattern-gallery-arrow { color: #6d7f9b; font-size: .77rem; }
.shift-pattern-gallery-overflow { color: var(--entria-muted); font-size: .75rem; }
.shift-pattern-gallery-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .75rem; }
.shift-pattern-gallery-bottom { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 7px; }
.shift-pattern-gallery-usage { color: var(--entria-muted); font-size: .75rem; }
.shift-pattern-gallery-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.shift-pattern-gallery-actions > button { min-height: 35px; padding: 5px 10px; font-size: .75rem; white-space: nowrap; }
.shift-pattern-gallery-actions > button:disabled { opacity: .5; }
.shift-pattern-gallery-actions > button svg { width: 15px; height: 15px; }
.shift-pattern-gallery-actions > button.school-secondary-button { display: inline-flex; align-items: center; gap: 5px; }
.shift-pattern-gallery-more { position: relative; }
.shift-pattern-gallery-more summary { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--entria-border); border-radius: 9px; color: var(--entria-ink); cursor: pointer; list-style: none; }
.shift-pattern-gallery-more summary::-webkit-details-marker { display: none; }
.shift-pattern-gallery-more summary svg { width: 17px; height: 17px; }
.shift-pattern-gallery-more > div { position: absolute; z-index: 4; right: 0; top: calc(100% + 4px); width: 150px; padding: 4px; border: 1px solid var(--entria-border); border-radius: 9px; background: #fff; box-shadow: var(--entria-shadow-modal); }
.shift-pattern-gallery-more button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: #bd3333; text-align: left; font: inherit; font-size: .76rem; cursor: pointer; }
.shift-pattern-gallery-more button:hover { background: #fff0f0; }
.shift-pattern-gallery-more button svg { width: 15px; height: 15px; }
@media (max-width: 850px) {
    .shift-pattern-gallery { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    .shift-pattern-manager-header-actions { gap: 6px; }
    .shift-pattern-manager-header-actions .school-primary-button { min-height: 36px; padding: 6px 9px; font-size: .75rem; }
    .shift-pattern-manager-toolbar { align-items: stretch; flex-direction: column; }
    .shift-pattern-manager-search { width: 100%; }
    .shift-pattern-manager-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shift-pattern-manager-filters .school-labeled-field { width: 100%; }
    .shift-pattern-gallery-card { min-height: 0; }
}
@media (max-width: 430px) {
    .shift-pattern-manager-header { flex-wrap: wrap; }
    .shift-pattern-manager-header-actions { width: 100%; justify-content: space-between; }
}

/* Recurring crews overview */
.portal-content .shift-crew-section { display: grid; gap: 14px; min-width: 0; }
.portal-content .shift-crew-back { justify-self: start; padding: 0; border: 0; background: transparent; color: #426b9d; font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; }
.portal-content .shift-crew-back:hover { color: var(--entria-primary); text-decoration: underline; }
.portal-content .shift-crew-heading-row { align-items: center; gap: 12px; }
.portal-content .shift-crew-heading-row .school-section-title { color: var(--entria-ink-soft); font-size: 1.9rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.portal-content .shift-crew-heading-row .shift-section-helper { max-width: 860px; color: var(--entria-muted); font-size: .95rem; line-height: 1.4; }
.portal-content .shift-crew-heading-row .school-primary-button { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.portal-content .shift-crew-heading-row .school-primary-button svg { width: 17px; height: 17px; }
.portal-content .shift-crew-toolbar { display: grid; grid-template-columns: minmax(190px, 1.5fr) repeat(3, minmax(135px, .8fr)) auto minmax(155px, .9fr); align-items: end; gap: 10px; padding: 16px 18px; border: 1px solid var(--entria-border); border-radius: 16px; background: #fff; }
.portal-content .shift-crew-toolbar .school-labeled-field { min-width: 0; }
.portal-content .shift-crew-toolbar .school-labeled-field > span { color: var(--entria-muted); font-size: .82rem; }
.portal-content .shift-crew-toolbar .school-select-field { min-height: 44px; font-size: .86rem; }
.portal-content .shift-crew-search { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 0 11px; border: 1px solid var(--entria-border); border-radius: 10px; background: #fff; color: var(--entria-muted); }
.portal-content .shift-crew-search:focus-within { border-color: #6aa3ef; box-shadow: 0 0 0 3px #e5f0ff; }
.portal-content .shift-crew-search svg { flex: none; width: 17px; height: 17px; }
.portal-content .shift-crew-search input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: var(--entria-ink); font: inherit; font-size: .86rem; }
.portal-content .shift-crew-result-count { align-self: center; color: #4b6182; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.portal-content .shift-crew-table-shell { overflow-x: auto; border-radius: 16px; }
.portal-content .shift-crew-table { width: 100%; min-width: 1220px; table-layout: fixed; }
.portal-content .shift-crew-table th { padding: 12px; background: #f8fbff; color: #4c617f; font-size: .78rem; }
.portal-content .shift-crew-table td { padding: 14px 12px; vertical-align: middle; color: var(--entria-ink); font-size: .85rem; }
.portal-content .shift-crew-table th:nth-child(1) { width: 17%; }
.portal-content .shift-crew-table th:nth-child(2) { width: 12%; }
.portal-content .shift-crew-table th:nth-child(3) { width: 22%; }
.portal-content .shift-crew-table th:nth-child(4) { width: 15%; }
.portal-content .shift-crew-table th:nth-child(5) { width: 13%; }
.portal-content .shift-crew-table th:nth-child(6) { width: 8%; }
.portal-content .shift-crew-table th:nth-child(7) { width: 13%; }
.portal-content .shift-crew-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.portal-content .shift-crew-identity > div { display: grid; min-width: 0; gap: 3px; }
.portal-content .shift-crew-identity strong, .portal-content .shift-crew-pattern-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.portal-content .shift-crew-identity small, .portal-content .shift-crew-pattern-cell small, .portal-content .shift-crew-state-cell small, .portal-content .shift-crew-next-cell small { color: var(--entria-muted); font-size: .77rem; line-height: 1.4; }
.portal-content .shift-crew-avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; background: #e8f8f4; color: #0d8872; }
.portal-content .shift-crew-table tr:nth-child(3n + 2) .shift-crew-avatar { background: #eaf2ff; color: #2568c4; }
.portal-content .shift-crew-table tr:nth-child(3n + 3) .shift-crew-avatar { background: #f1eaff; color: #754fbe; }
.portal-content .shift-crew-avatar svg { width: 21px; height: 21px; }
.portal-content .shift-crew-members-cell, .portal-content .shift-crew-state-cell, .portal-content .shift-crew-next-cell { display: grid; align-content: center; justify-items: start; gap: 5px; }
.portal-content .shift-crew-members-cell > strong { font-weight: 700; }
.portal-content .shift-crew-members-cell > .school-secondary-button { min-height: 34px; padding: 5px 9px; font-size: .78rem; }
.portal-content .shift-crew-members-details { position: relative; }
.portal-content .shift-crew-members-details summary { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 9px; border: 1px solid var(--entria-border); border-radius: 8px; color: #355b92; font-size: .78rem; font-weight: 700; list-style: none; cursor: pointer; white-space: nowrap; }
.portal-content .shift-crew-members-details summary::-webkit-details-marker { display: none; }
.portal-content .shift-crew-members-details > div { display: grid; gap: 5px; width: 100%; max-height: 240px; overflow-y: auto; margin-top: 4px; padding: 9px; border: 1px solid var(--entria-border); border-radius: 9px; background: #fff; box-shadow: var(--entria-shadow-modal); }
.portal-content .shift-crew-members-details > div > span { display: grid; gap: 1px; padding: 5px; border-bottom: 1px solid var(--entria-border-soft); }
.portal-content .shift-crew-members-details > div > span:last-child { border-bottom: 0; }
.portal-content .shift-crew-members-details > div strong { font-size: .8rem; }
.portal-content .shift-crew-members-details > div small { color: var(--entria-muted); font-size: .74rem; }
.portal-content .shift-crew-pattern-cell { display: grid; gap: 6px; min-width: 0; }
.portal-content .shift-crew-pattern-cell > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.portal-content .shift-crew-pattern-type { padding: 4px 8px; border-radius: 999px; background: #eaf2ff; color: #2765b5; font-size: .76rem; white-space: nowrap; }
.portal-content .shift-crew-pattern-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.portal-content .shift-crew-pattern-chips .shift-pattern-gallery-chip { min-width: 26px; min-height: 26px; padding: 3px 6px; border-radius: 6px; font-size: .72rem; }
.portal-content .shift-crew-state-cell > strong { padding: 5px 10px; border-radius: 999px; background: #e9f8ef; color: #15704e; font-size: .8rem; }
.portal-content .shift-crew-state-cell > strong.is-rest { background: #eaf2ff; color: #275ea9; }
.portal-content .shift-crew-state-cell > strong.is-empty { background: #edf1f6; color: #66758c; }
.portal-content .shift-crew-next-cell > strong { font-weight: 750; }
.portal-content .shift-crew-next-cell > span { color: #145fb9; font-size: .8rem; font-weight: 750; }
.portal-content .shift-crew-row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.portal-content .shift-crew-row-actions > .school-secondary-button { min-height: 38px; padding: 6px 10px; font-size: .8rem; }
.portal-content .shift-crew-more { position: relative; }
.portal-content .shift-crew-more summary { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--entria-border); border-radius: 9px; list-style: none; cursor: pointer; }
.portal-content .shift-crew-more summary::-webkit-details-marker { display: none; }
.portal-content .shift-crew-more summary svg { width: 16px; height: 16px; }
.portal-content .shift-crew-more > div { width: 155px; margin-top: 4px; padding: 4px; border: 1px solid var(--entria-border); border-radius: 9px; background: #fff; box-shadow: var(--entria-shadow-modal); }
.portal-content .shift-crew-more button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--entria-ink); text-align: left; font: inherit; font-size: .8rem; cursor: pointer; }
.portal-content .shift-crew-more button:hover { background: #eef5ff; }
.portal-content .shift-crew-more button svg { width: 15px; height: 15px; }
.portal-content .shift-crew-explainer { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; margin-top: 3px; padding: 18px; border: 1px solid var(--entria-border); border-radius: 16px; background: #fbfdff; }
.portal-content .shift-crew-explainer > div { display: flex; align-items: start; gap: 12px; padding-right: 18px; border-right: 1px solid var(--entria-border-soft); }
.portal-content .shift-crew-explainer-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: #eaf2ff; color: #1c68c9; font-size: 1.15rem; font-weight: 800; }
.portal-content .shift-crew-explainer h3 { margin: 3px 0 5px; color: var(--entria-ink); font-size: 1rem; }
.portal-content .shift-crew-explainer p { margin: 0; color: var(--entria-muted); font-size: .84rem; line-height: 1.55; }
.portal-content .shift-crew-explainer ol { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.portal-content .shift-crew-explainer li { padding-left: 2px; color: #2870cc; font-size: .82rem; }
.portal-content .shift-crew-explainer li strong, .portal-content .shift-crew-explainer li span { display: block; }
.portal-content .shift-crew-explainer li strong { color: var(--entria-ink); }
.portal-content .shift-crew-explainer li span { margin-top: 2px; color: var(--entria-muted); }
@media (max-width: 1180px) {
    .portal-content .shift-crew-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .portal-content .shift-crew-search { grid-column: span 2; }
    .portal-content .shift-crew-result-count { justify-self: end; }
}
@media (max-width: 680px) {
    .portal-content .shift-crew-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-content .shift-crew-search { grid-column: 1 / -1; }
    .portal-content .shift-crew-result-count { justify-self: start; }
    .portal-content .shift-crew-explainer { grid-template-columns: 1fr; }
    .portal-content .shift-crew-explainer > div { padding-right: 0; border-right: 0; }
}
@media (max-width: 430px) {
    .portal-content .shift-crew-toolbar { grid-template-columns: 1fr; }
    .portal-content .shift-crew-search { grid-column: auto; }
    .portal-content .shift-crew-heading-row .school-primary-button { width: 100%; justify-content: center; }
}

/* Crew creation and editing */
.portal-content .shift-crew-editor { display: grid; gap: 13px; min-width: 0; }
.portal-content .shift-crew-editor-header { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.portal-content .shift-crew-editor-header .shift-crew-back { flex: none; }
.portal-content .shift-crew-editor-header > div { min-width: 0; margin-right: auto; }
.portal-content .shift-crew-editor-header h2 { margin: 0; color: var(--entria-ink-soft); font-size: 1.9rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.portal-content .shift-crew-editor-header p { margin: 3px 0 0; color: var(--entria-muted); font-size: .95rem; }
.portal-content .shift-crew-help { position: relative; }
.portal-content .shift-crew-help summary { min-height: 40px; padding: 8px 12px; border: 1px solid var(--entria-border); border-radius: 10px; background: #fff; color: #355782; font-size: .82rem; font-weight: 750; list-style: none; cursor: pointer; }
.portal-content .shift-crew-help summary::-webkit-details-marker { display: none; }
.portal-content .shift-crew-help > p { position: absolute; z-index: 5; right: 0; top: calc(100% + 5px); width: 240px; padding: 10px; border: 1px solid var(--entria-border); border-radius: 9px; background: #fff; box-shadow: var(--entria-shadow-modal); color: var(--entria-muted); font-size: .75rem; line-height: 1.45; }
.portal-content .shift-crew-editor-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(290px, .95fr); align-items: start; gap: 12px; }
.portal-content .shift-crew-editor-main, .portal-content .shift-crew-editor-aside { display: grid; align-content: start; gap: 12px; min-width: 0; }
.portal-content .shift-crew-editor-card { display: grid; gap: 13px; min-width: 0; padding: 18px; border: 1px solid var(--entria-border); border-radius: 16px; background: #fff; }
.portal-content .shift-crew-editor-card-heading { display: flex; align-items: center; gap: 10px; }
.portal-content .shift-crew-editor-card-heading > span:first-child { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--entria-primary); color: #fff; font-size: .9rem; font-weight: 800; }
.portal-content .shift-crew-editor-card-heading > div { min-width: 0; margin-right: auto; }
.portal-content .shift-crew-editor-card-heading h3, .portal-content .shift-crew-editor-aside-heading h3 { margin: 0; color: var(--entria-ink-soft); font-size: 1rem; font-weight: 800; line-height: 1.3; }
.portal-content .shift-crew-editor-card-heading p { margin: 2px 0 0; color: var(--entria-muted); font-size: .82rem; line-height: 1.4; }
.portal-content .shift-crew-editor-card .school-labeled-field { min-width: 0; }
.portal-content .shift-crew-editor-card .school-labeled-field > span { font-size: .82rem; }
.portal-content .shift-crew-editor-card .school-labeled-field small { margin-top: 3px; color: var(--entria-muted); font-size: .76rem; line-height: 1.4; }
.portal-content .shift-crew-editor-card :where(.school-code-input, .school-select-field, .app-form-textarea) { width: 100%; min-height: 40px; border-color: var(--entria-border); border-radius: 10px; font-size: .9rem; }
.portal-content .shift-crew-editor-card .app-form-textarea { resize: vertical; }
.portal-content .shift-crew-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.portal-content .shift-crew-editor-employee-row { margin-top: 0; }
.portal-content .shift-crew-editor-card .shift-editor-employee-chips { margin-top: 0; }
.portal-content .shift-crew-editor-card .shift-editor-selection-count { margin: 0; }
.portal-content .shift-crew-text-button { padding: 0; border: 0; background: transparent; color: #1466cf; font: inherit; font-size: .82rem; font-weight: 750; cursor: pointer; }
.portal-content .shift-crew-text-button:hover { text-decoration: underline; }
.portal-content .shift-crew-editor-rotation-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.portal-content .shift-crew-editor-pattern-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.portal-content .shift-crew-editor-pattern-strip button { min-width: 40px; min-height: 34px; padding: 5px 7px; border: 1px solid transparent; border-radius: 8px; background: #e5f0ff; color: #1d63ba; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.portal-content .shift-crew-editor-pattern-strip button:nth-of-type(2n) { background: #e7f8ef; color: #197854; }
.portal-content .shift-crew-editor-pattern-strip button.is-rest { background: #edf0f5; color: #526782; }
.portal-content .shift-crew-editor-pattern-strip button.is-selected { border-color: #1767e9; box-shadow: 0 0 0 1px #1767e9; }
.portal-content .shift-crew-editor-pattern-strip > span { margin-left: 4px; color: #496a96; font-size: 1.05rem; }
.portal-content .shift-crew-editor-pattern-caption { margin: -4px 0 0; color: var(--entria-muted); font-size: .82rem; }
.portal-content .shift-crew-editor-advanced .shift-crew-editor-card-heading { align-items: start; }
.portal-content .shift-crew-editor-advanced .school-check-field { max-width: 340px; padding: 9px 12px; font-size: .82rem; }
.portal-content .shift-crew-editor-advanced .school-check-field > span { display: grid; gap: 3px; min-width: 0; }
.portal-content .shift-crew-editor-advanced .school-check-field strong { line-height: 1.3; }
.portal-content .shift-crew-editor-advanced .school-check-field small { display: block; color: var(--entria-muted); font-size: .76rem; font-weight: 400; line-height: 1.4; }
.portal-content .shift-crew-editor-advanced > details > summary { color: #2867b9; font-size: .82rem; font-weight: 700; cursor: pointer; }
.portal-content .shift-crew-editor-advanced-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; margin-top: 10px; }
.portal-content .shift-crew-editor-advanced-fields .school-check-field { grid-column: 1 / -1; width: 100%; max-width: none; }
.portal-content .shift-crew-editor-aside-heading { display: flex; align-items: center; gap: 8px; }
.portal-content .shift-crew-editor-aside-heading > svg { flex: none; width: 27px; height: 27px; padding: 5px; border-radius: 8px; background: #eaf2ff; color: #1767d7; }
.portal-content .shift-crew-editor-aside-heading h3 { margin-right: auto; }
.portal-content .shift-crew-editor-aside-heading label { width: 116px; }
.portal-content .shift-crew-editor-aside-heading .school-select-field { min-height: 34px; padding: 4px 8px; font-size: .78rem; }
.portal-content .shift-crew-editor-summary { display: grid; gap: 0; margin: 0; padding: 8px; border: 1px solid var(--entria-border-soft); border-radius: 9px; background: #f9fbff; }
.portal-content .shift-crew-editor-summary > div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; padding: 8px 5px; font-size: .84rem; }
.portal-content .shift-crew-editor-summary dt { color: var(--entria-muted); }
.portal-content .shift-crew-editor-summary dd { min-width: 0; margin: 0; color: var(--entria-ink); font-weight: 700; overflow-wrap: anywhere; }
.portal-content .shift-crew-editor-preview-table { overflow-x: auto; border: 1px solid var(--entria-border); border-radius: 9px; }
.portal-content .shift-crew-editor-preview-table table { width: 100%; border-collapse: collapse; }
.portal-content .shift-crew-editor-preview-table th { padding: 9px 11px; background: #f5f9ff; color: #536986; text-align: left; font-size: .77rem; }
.portal-content .shift-crew-editor-preview-table td { padding: 8px 11px; border-top: 1px solid var(--entria-border-soft); color: #355071; font-size: .84rem; white-space: nowrap; }
.portal-content .shift-crew-editor-preview-table td small { color: var(--entria-muted); font-size: .76rem; }
.portal-content .shift-crew-editor-preview-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #2a78d9; }
.portal-content .shift-crew-editor-preview-dot.is-rest { background: #7a899e; }
.portal-content .shift-crew-editor-preview-empty { margin: 0; color: var(--entria-muted); font-size: .84rem; }
.portal-content .shift-crew-editor-preview-note { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid #d1e8fb; border-radius: 10px; background: #eef8ff; color: #386b92; font-size: .82rem; line-height: 1.4; }
.portal-content .shift-crew-editor-preview-note strong { color: #1d628f; }
.portal-content .shift-crew-editor-footer > button { min-height: 40px; }
@media (max-width: 960px) {
    .portal-content .shift-crew-editor-layout { grid-template-columns: 1fr; }
    .portal-content .shift-crew-editor-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .portal-content .shift-crew-editor-fields, .portal-content .shift-crew-editor-rotation-fields, .portal-content .shift-crew-editor-advanced-fields, .portal-content .shift-crew-editor-aside { grid-template-columns: 1fr; }
    .portal-content .shift-crew-editor-advanced .shift-crew-editor-card-heading { flex-wrap: wrap; }
    .portal-content .shift-crew-editor-advanced .school-check-field { width: 100%; max-width: none; }
    .portal-content .shift-crew-editor-footer { flex-direction: column-reverse; }
    .portal-content .shift-crew-editor-footer > button { width: 100%; }
}

/* Reports review: follow the employee directory's type, controls and cards. */
.portal-content .company-review-screen .company-executive-header { display: block; }
.portal-content .company-review-screen .company-executive-header h1 {
    font-size: 2.3rem;
    line-height: .98;
    letter-spacing: -.04em;
    font-weight: 800;
}
.portal-content .company-review-screen .company-executive-header p {
    color: var(--entria-muted);
    font-size: 1rem;
    line-height: 1.55;
}
.portal-content .company-review-screen :where(.school-panel, .school-subpanel, .school-table-shell) {
    border-color: var(--entria-border);
    border-radius: var(--entria-panel-radius);
    background: var(--entria-surface);
    box-shadow: var(--entria-shadow-soft);
}
.portal-content .company-review-screen .company-report-date-picker > summary,
.portal-content .company-review-screen .company-report-more-filters > summary {
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
    color: var(--entria-ink-soft);
    font-size: .92rem;
}
.portal-content .company-review-screen .company-report-areas {
    border-color: var(--entria-border);
    border-radius: var(--entria-control-radius);
    background: var(--entria-surface-soft);
}
.portal-content .company-review-screen .company-report-areas button {
    border-radius: 10px;
    color: var(--entria-ink-soft);
    font-size: .88rem;
}
.portal-content .company-review-screen .company-report-areas button.active {
    border-color: #bcd4fc;
    background: #eaf2ff;
    color: #1d5bc2;
}
.portal-content .company-review-screen .company-closure-state,
.portal-content .company-review-screen .company-closure-step,
.portal-content .company-review-screen .company-review-summary-card,
.portal-content .company-review-screen .company-review-bulk {
    border-radius: 14px;
}
.portal-content .company-review-screen .company-review-summary-card,
.portal-content .company-review-screen .company-review-bulk { border-color: var(--entria-border); }
.portal-content .company-review-screen .company-review-summary-card { background: var(--entria-surface); }
.portal-content .company-review-screen .company-review-summary-card span { color: var(--entria-ink-soft); font-size: .83rem; }
.portal-content .company-review-screen .company-review-summary-card small { color: var(--entria-muted); font-size: .77rem; line-height: 1.3; }
.portal-content .company-review-screen .company-review-summary-card strong { font-size: 1.72rem; }
.portal-content .company-review-screen .company-review-filters button {
    min-height: 38px;
    padding: 7px 13px;
    border-color: var(--entria-border);
    color: var(--entria-ink-soft);
    font-size: .79rem;
}
.portal-content .company-review-screen .company-review-filters button.active {
    border-color: #bcd4fc;
    background: #eaf2ff;
    color: #1d5bc2;
}
.portal-content .company-review-screen .company-closure-review-panel .school-table-shell {
    overflow-x: auto;
    box-shadow: none;
}
.portal-content .company-review-screen .company-closure-review-table {
    min-width: 1100px;
    table-layout: auto;
}
.portal-content .company-review-screen .company-closure-review-table th {
    padding: 14px 16px;
    background: var(--entria-surface-soft);
    color: #5f6e87;
}
.portal-content .company-review-screen .company-closure-review-table td {
    padding: 15px 16px;
    color: var(--entria-ink-soft);
}
.portal-content .company-review-screen .company-closure-review-table th:nth-child(2) { width: 105px; }
.portal-content .company-review-screen .company-closure-review-table th:nth-child(3) { width: 20%; }
.portal-content .company-review-screen .company-closure-review-table th:nth-child(6) { width: 19%; }
.portal-content .company-review-screen .company-review-person strong { color: var(--entria-ink); font-size: .88rem; }
.portal-content .company-review-screen .company-review-person span { color: var(--entria-muted); font-weight: 500; }
.portal-content .company-review-screen .company-review-change-button {
    min-height: 36px;
    border-radius: 10px;
}

/* Attendance uses the same compact rhythm as the employee directory. */
.portal-content .company-attendance-screen .school-toolbar-actions-row {
    gap: 10px;
    margin-bottom: 14px;
}
.portal-content .company-attendance-screen .school-toolbar-grid-attendance {
    grid-template-columns: minmax(205px, 1.15fr) minmax(250px, 1.7fr) repeat(3, minmax(125px, .8fr));
    gap: 10px;
    align-items: end;
    margin: 8px 0 14px;
}
.portal-content .company-attendance-screen .school-toolbar-grid-attendance > * { min-width: 0; }
.portal-content .company-attendance-screen .school-toolbar-grid-attendance .school-labeled-field { font-size: .76rem; }
.portal-content .company-attendance-screen .company-attendance-date-navigation .school-page-button {
    min-height: var(--entria-control-height);
    border-color: var(--entria-border);
    border-radius: 12px;
    background: var(--entria-surface);
}
.portal-content .company-attendance-screen .school-two-column-grid {
    gap: 12px;
    margin-top: 12px;
}
.portal-content .company-attendance-screen .school-two-column-grid > .school-subpanel {
    min-width: 0;
    border-color: var(--entria-border);
    border-radius: var(--entria-panel-radius);
    box-shadow: var(--entria-shadow-soft);
}
.portal-content .company-attendance-screen .attendance-table-panel .table-view-header { margin: 8px 0 12px; }
.portal-content .company-attendance-screen .attendance-table-shell {
    border: 1px solid var(--entria-border);
    border-radius: var(--entria-panel-radius);
    background: var(--entria-surface);
    box-shadow: none;
}
.portal-content .company-attendance-screen .attendance-table th {
    padding: 14px 16px;
    background: var(--entria-surface-soft);
    color: #5f6e87;
}
.portal-content .company-attendance-screen .attendance-table td {
    padding: 15px 16px;
    color: var(--entria-ink-soft);
    background: var(--entria-surface);
}
.portal-content .company-attendance-screen .attendance-table tbody tr:hover td { background: rgba(232, 241, 255, .5); }
.portal-content .company-attendance-screen .attendance-table .school-person-title { line-height: 1.3; }
.portal-content .company-attendance-screen .attendance-table .school-person-subtitle { margin-top: 3px; line-height: 1.3; }
@media (max-width: 1300px) {
    .portal-content .company-attendance-screen .school-toolbar-grid-attendance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .portal-content .company-attendance-screen .school-toolbar-grid-attendance > :nth-child(2) { grid-column: span 2; }
}
@media (max-width: 760px) {
    .portal-content .company-attendance-screen .school-toolbar-grid-attendance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-content .company-attendance-screen .school-toolbar-grid-attendance > :nth-child(2) { grid-column: auto; }
}
@media (max-width: 650px) {
    .portal-content .company-attendance-screen .school-toolbar-grid-attendance,
    .portal-content .company-attendance-screen .school-two-column-grid { grid-template-columns: minmax(0, 1fr); }
}
