.control-label.help {

    display: inline-block;

    cursor: help;

    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: #999;

    text-underline-offset: 4px;
}

.control-label.help i {
    margin-left: .35rem;
    font-size: .75rem;
    opacity: .7;
}

.pac-container {
    z-index: 2000 !important;
}

/* Shared CRUD shell: one continuous fieldset, one common header. */
.tuc-crud-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bs-body-bg);
}

.tuc-crud-panel__header {
    min-height: 3.5rem;
    padding: .75rem 1rem;
    background: var(--bs-secondary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.tuc-crud-panel__title {
    line-height: 1.25;
}

.tuc-crud-panel__body {
    padding: 1rem;
}

@media (max-width: 575.98px) {
    .tuc-crud-panel__header {
        align-items: flex-start !important;
        flex-direction: column;
    }
}

/* Shared CRUD grid grammar. Modules define data; common defines presentation. */
.tuc-grid-view {
    overflow-x: auto;
}

/* Older module views still instantiate Yii's native GridView. Keep their
 * data and columns untouched, but give them the same readable table grammar
 * while they are progressively moved to the common widget. */
.grid-view:not(.tuc-grid-view) {
    overflow-x: auto;
}

.grid-view:not(.tuc-grid-view) > table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    border: 1px solid var(--bs-border-color);
}

.grid-view:not(.tuc-grid-view) > table > :not(caption) > * > * {
    padding: .65rem .75rem;
    border: 1px solid var(--bs-border-color);
    vertical-align: middle;
}

.grid-view:not(.tuc-grid-view) > table > thead > tr:first-child > th {
    background: var(--bs-tertiary-bg);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.grid-view:not(.tuc-grid-view) > table > thead > tr:last-child > td {
    background: var(--bs-body-bg);
}

.tuc-grid-view .summary {
    margin-bottom: .5rem;
}

.tuc-grid-view .pagination {
    flex-wrap: wrap;
    gap: .25rem;
}

.grid-view:not(.tuc-grid-view) .pagination {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: 1rem;
    margin-bottom: 0;
    padding-left: 0;
    list-style: none;
}

/* Pagination is consistently aligned with row actions, regardless of the
 * individual GridView layout used by a module. */
.tuc-grid-view .tuc-grid-pager {
    display: flex;
    justify-content: flex-end;
}

.tuc-grid-view .page-item + .page-item {
    margin-left: 0;
}

.tuc-grid-view .page-link {
    border-radius: var(--bs-border-radius);
}

.tuc-grid {
    width: 100%;
    margin-bottom: 0;
}

.tuc-grid > :not(caption) > * > * {
    padding: .65rem .75rem;
    border-color: var(--bs-border-color);
    vertical-align: middle;
}

.tuc-grid > thead > .tuc-grid__header > th {
    background: var(--bs-tertiary-bg);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.tuc-grid > thead > .tuc-grid__filters > td {
    background: var(--bs-body-bg);
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.tuc-grid__filters .form-control,
.tuc-grid__filters .form-select {
    width: 100%;
    min-width: 5rem;
}

.tuc-grid-actions {
    width: 1%;
    min-width: max-content;
    text-align: right;
    white-space: nowrap;
}

.tuc-grid-actions > a + a {
    margin-left: .25rem;
}

.tuc-grid-action {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    padding: 0;
}
