/* ---------- Model DQ Dialogs (application/views/configuration/configure/last_run_analytics.php, script
   js/modules/align/model_dq/): a mapped model field's data quality. They share the native data quality Dialogs'
   app-align-dq classes (css/v21_align_tables.css); these rules add the Model DQ's own ids and layout. ---------- */

/* the coverage and flag sample Dialogs (the ids beat the old full-height rules in css/align_to.css) */
#column-coverage-model-data-quality-primary-modal .modal-content.app-dialog.app-model-dq-column {
    width: min(760px, calc(100vw - 32px));
    height: auto;
    max-height: calc(100vh - 48px);
}

#model-dq-field-flag-sample-modal .modal-content.app-dialog.app-model-dq-flag {
    width: min(1040px, calc(100vw - 32px));
    height: auto;
    max-height: calc(100vh - 48px);
}

#model-data-quality-primary-modal .modal-content.app-dialog .modal-body,
#column-coverage-model-data-quality-primary-modal .modal-content.app-dialog .modal-body,
#model-dq-field-flag-sample-modal .modal-content.app-dialog .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

#model-data-quality-primary-modal [hidden],
#column-coverage-model-data-quality-primary-modal [hidden],
#model-dq-field-flag-sample-modal [hidden] {
    display: none;
}

/* the filter: (Field,) Comparator and Value share the line, the buttons after them; it wraps when narrow */
.app-model-dq__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.app-model-dq__filters .av-field {
    flex: 1 1 200px;
    min-width: 0;
}

.app-model-dq__filters .app-align-dq__filter-actions {
    flex: none;
}

/* the sample: Key | Original | Cleaned share the width, one line each (the full text is the tooltip) */
.app-model-dq__sample {
    table-layout: fixed;
    width: 100%;
}

.app-model-dq__sample th:nth-child(1) {
    width: 22%;
}

.app-model-dq__sample th,
.app-model-dq__sample td {
    min-width: 0;
    max-width: none;
}

.app-model-dq__sample tbody th {
    font-weight: 400;
}

.app-model-dq__sample tbody th .app-align-dq__column-link {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* the main sample fills the Dialog's height; the flag sample's frame keeps the shared 520px */
#model-data-quality-primary-modal .app-align-dq__sample-frame {
    flex: 1 1 auto;
    min-height: 160px;
    max-height: none;
}

/* Records without a value: a count that searches those records */
.app-align-dq__details .field-record-without-count {
    font-variant-numeric: tabular-nums;
}

/* the coverage Dialog's tables: the label column narrow, the counts with their share bars */
.app-model-dq-column__lengths th:first-child {
    width: 1%;
    white-space: nowrap;
}

.app-model-dq-column__flags th:first-child {
    width: 40%;
}
