/*
 * Align > Datafeed Overview: the pop-ups opened from the page (run list, step parameters, re-run confirmation,
 * run list queue, system monitoring) as alignvu UI v2.1 Dialogs. Markup: application/views/dataflow/incoming.php;
 * behaviour: js/modules/align/datafeed_overview/run_list.js, monitoring.js and dialogs.js.
 */

/* Dialog width for a table with several columns */
.modal-content.app-dialog--wide {
    width: min(1040px, calc(100vw - 32px));
}

/* ---------- Layout: the title, tabs and buttons stay put; only the body scrolls ---------- */

.app-dfo-dialog .app-dfo-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

/* a Dialog opened over another (parameters, re-run confirmation) */
.modal-backdrop.app-dfo-dialog-over {
    z-index: 10000;
}

.app-dfo-dialog .app-dialog__head .av-text {
    margin: 0;
}

.app-dfo-dialog .app-dfo-dialog__loading {
    margin: 0;
    padding: 16px 0;
}

.app-dfo-dialog .app-dfo-dialog__empty {
    padding: var(--space-6);
}

.app-dfo-dialog .app-dfo-dialog__empty p {
    margin: 0;
}

/* ---------- Tables: columns share the width, long text wraps ---------- */

.app-dfo-dialog .app-dfo-dialog__table th,
.app-dfo-dialog .app-dfo-dialog__table td {
    vertical-align: top;
    overflow-wrap: anywhere;
}

.app-dfo-dialog .app-dfo-dialog__table th {
    white-space: normal;
}

.app-dfo-dialog .app-dfo-dialog__table .av-num {
    text-align: right;
}

.app-dfo-dialog col.app-dfo-dialog__col-step { width: 8%; }
.app-dfo-dialog col.app-dfo-dialog__col-num { width: 12%; }
.app-dfo-dialog col.app-dfo-dialog__col-status { width: 15%; }
.app-dfo-dialog col.app-dfo-dialog__col-date { width: 16%; }
.app-dfo-dialog col.app-dfo-dialog__col-param { width: 35%; }
.app-dfo-dialog col.app-dfo-dialog__col-icons { width: calc(2 * 30px + 2 * var(--space-4)); }
.app-dfo-dialog col.app-dfo-dialog__col-action { width: 150px; }

.app-dfo-runlist .app-dfo-runlist__history col.app-dfo-dialog__col-date { width: 25%; }

.app-dfo-dialog .app-dfo__date {
    white-space: nowrap;
}

.app-dfo-dialog .app-dfo__time {
    color: var(--muted);
    white-space: nowrap;
}

/* a datafeed's provider under its name */
.app-dfo-dialog .app-dfo-dialog__name {
    display: block;
}

.app-dfo-dialog .app-dfo-dialog__sub {
    display: block;
    font-size: 12px;
    line-height: 18px;
    color: var(--muted);
}

.app-dfo-dialog .app-dfo-dialog__value {
    white-space: pre-wrap;
}

/* a step's Parameters and Re-run */
.app-dfo-dialog .app-dfo-dialog__icons {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
}

.app-dfo-dialog .app-dfo-dialog__iconbtn {
    width: 30px;
    height: 30px;
}

.app-dfo-dialog td.app-dfo-dialog__action {
    text-align: right;
}

.app-dfo-dialog .app-dfo-dialog__action .av-btn {
    white-space: nowrap;
}

/* ---------- Run list: summary, Latest / History and entity type tabs ---------- */

.app-dfo-runlist .app-dfo-runlist__summary {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.app-dfo-runlist .app-dfo-runlist__summary[hidden],
.app-dfo-runlist .av-tabs[hidden],
.app-dfo-runlist .app-dfo-runlist__more[hidden] {
    display: none;
}

/* many entity types: the tabs scroll sideways */
.app-dfo-runlist .av-tabs {
    flex: none;
    overflow-x: auto;
}

.app-dfo-runlist .av-tab {
    flex: none;
    white-space: nowrap;
}

.app-dfo-runlist .app-dfo-runlist__more {
    margin-top: 12px;
}
