/* Module-specific screen layouts. Shared controls and table scrolling live in responsive.css. */
@media screen {
    /* Accounting record columns and actions must not break into individual letters. */
    .hub-module .accounting-table {
        width: 100%;
        table-layout: auto;
    }

    .hub-module .accounting-table :is(th, td) {
        overflow-wrap: normal;
        word-break: normal;
        vertical-align: middle;
    }

    .hub-module .accounting-table .accounting-amount {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .hub-module .accounting-table .accounting-action {
        text-align: right;
    }

    .hub-module .accounting-table .accounting-action .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 4.5rem;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    /* Custom personnel dialogs have a form directly inside the panel rather
       than a Bootstrap .modal-body; keep the whole bounded panel scrollable. */
    body .e201-disc {
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .hub-module :is(.e201, .e201-card, .e201-hero, .e201-hero-main, .e201-hero-main > div,
        .e201-grid > *, .e201-viol-layout > *, .e201-leave-layout > *, .e201-memo-stats > *,
        .xl-wrap, .xl-sheet, .ha-card > *, .hr-hol-board, .hr-hol-page) {
        min-width: 0;
        max-width: 100%;
    }

    .hub-module :is(.e201-who, .e201-hero h3, .e201-rows strong, .e201-memo-main,
        .ha-title, .ha-reason, .ha-files, .hr-hol-detail__title, .hr-hol-detail__body) {
        overflow-wrap: anywhere;
    }

    .hub-module .e201-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    }

    .hub-module .e201-leave-layout {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    }

    .hub-module :is(.e201-leave-table-wrap, .xl-sheet) {
        width: 100%;
        max-width: 100%;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .hub-module .e201-tabs {
        max-width: 100%;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    .hub-module :is(.e201-card > header, .e201-viol-banner, .e201-memo-banner,
        .e201-memo-list li, .ha-top) {
        flex-wrap: wrap;
    }

    .hub-module .e201-viol-title > i,
    .hub-module .e201-memo-banner-copy > i {
        flex-shrink: 0;
    }

    .hub-module :is(.e201-card select, .e201-mail input, .e201-leave-toggle),
    body .e201-disc :is(input, select, textarea) {
        min-width: 0;
        max-width: 100%;
    }

    .hub-module .hr-hol-detail__card {
        max-width: calc(100vw - 2rem);
        max-height: calc(100dvh - 2rem);
        overflow-y: auto;
        overflow-wrap: anywhere;
    }

    .hub-module .required-duty-times {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .hub-module .employee-separation-search {
        min-width: 0;
        max-width: 100%;
    }

    .hub-module .employee-separation-search input {
        min-width: 0;
    }
}

@media screen and (min-width: 641px) {
    .hub-module .accounting-table--travel { min-width: 76rem; }
    .hub-module .accounting-table--liquidations { min-width: 100rem; }

    .hub-module .accounting-table :is(.accounting-reference, .accounting-date, .accounting-amount, .accounting-source, .accounting-action) {
        white-space: nowrap;
    }

    .hub-module .accounting-table .accounting-text {
        min-width: 10rem;
        max-width: 18rem;
    }

    .hub-module .accounting-table .accounting-title {
        min-width: 16rem;
        max-width: 26rem;
    }

    .hub-module .accounting-table .accounting-status {
        min-width: 15rem;
    }

    .hub-module .accounting-table .accounting-status .badge {
        display: table;
        margin-block: .2rem;
    }

    /* Keep the record action available while its other columns scroll. */
    .hub-module .accounting-table .accounting-action {
        position: sticky;
        right: 0;
        z-index: 1;
        min-width: 6rem;
        background: #fff;
        box-shadow: -1px 0 0 #e7eef6;
    }

    .hub-module .accounting-table thead .accounting-action {
        z-index: 2;
        background: #f8fafc;
    }

    .hub-module .accounting-table.table-hover > tbody > tr:hover > .accounting-action {
        background: #f8fbff;
    }
}

/* These views need their main record above the supporting sidebar on tablets. */
@media screen and (max-width: 1100px) {
    .hub-module .e201-viol-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-module .e201-viol-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media screen and (max-width: 900px) {
    .hub-module :is(.e201-grid, .e201-leave-layout) {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-module .e201-memo-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 600px) {
    .hub-module :is(.e201-card, .e201-hero) {
        padding: 16px;
    }

    .hub-module .e201-hero-main {
        flex-wrap: wrap;
    }

    .hub-module .e201-hero-side {
        align-items: flex-start;
        text-align: left;
    }

    .hub-module .e201-viol-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-module .e201-actions {
        width: 100%;
        margin-left: 0;
    }

    .hub-module :is(.e201-actions .e201-btn, .e201-viol-add, .e201-memo-create,
        .e201-leave-actions > button, .e201-leave-actions > a) {
        justify-content: center;
        min-height: 44px;
        white-space: normal;
    }

    .hub-module :is(.e201-viol-delete, .e201-memo-more, .e201-viol-pager button),
    body .e201-disc-close {
        min-width: 44px;
        min-height: 44px;
    }

    body .e201-disc {
        padding: 12px;
    }

    body .e201-disc-head {
        margin-right: 44px;
        padding: 12px;
        overflow-wrap: anywhere;
    }

    body .e201-disc-grid {
        grid-template-columns: minmax(0, 1fr);
        padding-inline: 0;
    }

    body .e201-disc-actions {
        flex-wrap: wrap;
        padding-inline: 0;
    }

    body .e201-disc-actions > button {
        flex: 1 1 120px;
        min-height: 44px;
    }

    .hub-module .required-duty-times {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-module .employee-separation-search {
        width: 100%;
    }

    .hub-module .employee-separation-search input {
        flex: 1 1 0;
        width: 0;
    }

    .hub-module .ha-list {
        padding: 12px;
    }

    .hub-module :is(.ha-main, .ha-side) {
        padding: 14px;
    }

    .hub-module .ha-status {
        max-width: 100%;
        white-space: normal;
    }

    .hub-module .ha-actions .ha-secondary {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-module .hr-hol-brand {
        gap: 8px;
        max-width: 100%;
    }

    .hub-module .hr-hol-brand__text {
        min-width: 0;
    }

    .hub-module .hr-hol-brand__school {
        overflow-wrap: anywhere;
    }

    .hub-module .hr-hol-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hub-module .hr-hol-nav__btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .hub-module .hr-hol-detail__close {
        width: 44px;
        height: 44px;
    }

    .hub-module .hr-hol-detail__title {
        margin-right: 44px;
    }
}
