/* The admin area's own layout: toolbars, panels, forms and the import findings (from the EPR Wizard's
 * admin.css). Tokens only; every flex/grid rule has its [hidden] twin. */

.admin-intro { margin-bottom: var(--sp-4); }

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.admin-toolbar[hidden] { display: none; }
.admin-toolbar .field { flex: 1 1 12rem; margin: 0; }

.admin-panel { margin-bottom: var(--sp-6); }
.admin-panel[hidden] { display: none; }

.admin-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
}
.admin-card[hidden] { display: none; }
.admin-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}
.admin-card__head[hidden] { display: none; }
.admin-card__title { margin: 0; font-size: var(--fs-300); }

.admin-meta { font-size: var(--fs-100); color: var(--color-text-muted); }

.admin-form {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.admin-form[hidden] { display: none; }
.admin-form__wide { grid-column: 1 / -1; }
.admin-form .field { margin: 0; }

.admin-code { font-family: var(--font-mono); font-size: var(--fs-200); }

.admin-warning {
    background: var(--color-warning-bg);
    border-radius: var(--radius-sm);
    padding: var(--sp-2) var(--sp-3);
}
.admin-warning[hidden] { display: none; }

/* What a check found, under the file or field it is about. */
.findings { list-style: none; margin: var(--sp-2) 0 0; padding: 0; font-size: var(--fs-200); }
.findings[hidden] { display: none; }
.finding { padding: var(--sp-1) var(--sp-2); border-radius: var(--radius-sm); margin-bottom: var(--sp-1); }
.finding--error { background: var(--color-danger-bg); color: var(--color-danger); }
.finding--warning { background: var(--color-warning-bg); }

.admin-break { overflow-wrap: anywhere; }

.admin-actions { margin-bottom: var(--sp-3); }

/* A contract tab: the tab's own columns, as many as it has, so the card scrolls sideways rather than the
   page. A long note or source shows its start; the whole text is in the row's form. */
.contract-table th, .contract-table td { white-space: nowrap; }
.contract-table__text { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.contract-table__required { margin-left: 2px; color: var(--color-danger); }
/* A row's buttons stay on one line; beside a wide tab they stay in view while it scrolls, except on a
   phone, where a column pinned at the edge would hide half of what it scrolls past. */
.contract-table__actions .btn-row { flex-wrap: nowrap; }
@media (min-width: 600px) {
    .contract-table__actions {
        position: sticky;
        right: 0;
        background: var(--color-surface);
        box-shadow: inset 1px 0 0 var(--color-border);
    }
    .contract-table th.contract-table__actions { background: var(--color-surface-alt); }
}
.contract-table__caption { caption-side: top; padding: var(--sp-2) var(--sp-3); text-align: left; font-weight: 600; }
