/*
 * Admin redesign (2026-11-22): Atlas and the Wavilu admin page in the shell of
 * the dashboard (top bar, area rail, view tabs). Only what these pages need on
 * top of css/admin-shell.css and css/admin-redesign.css. Tokens only.
 */

/* A guest of the collaborator portal has no rail. */
.admin-app.rd-no-rail { grid-template-columns: minmax(0, 1fr); }
.staff-guest .admin-rail { display: none; }
.staff-guest .admin-app { grid-template-columns: minmax(0, 1fr); }

/* The page fills the column beside the rail; no page-level sideways scroll. */
.admin-app > .main-content {
    width: 100%;
    min-width: 0;
}

/* The heading of a view: its name, where the rows come from, its one action. */
.rd-view-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
    min-height: 36px;
}
.rd-view-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}
.rd-view-source {
    color: var(--color-text-2);
    font-size: 13px;
}
.rd-view-head > .btn,
.rd-view-head > .rd-view-actions { margin-left: auto; }
.rd-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Search and segmented filters above a list. */
.rd-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
}
.rd-search {
    flex: 1 1 240px;
    max-width: 360px;
    min-width: 0;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--color-control-border, var(--color-border));
    border-radius: 8px;
    background: var(--color-surface-1);
    color: var(--color-text-1);
    font: inherit;
}

/* A table whose row opens the item beside it. */
.rd-pick-table tbody tr[data-pick] { cursor: pointer; }
.rd-pick-table td { vertical-align: top; }
.rd-pick-table td:first-child { min-width: 160px; }
.rd-row-open {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.rd-row-open:hover { text-decoration: underline; }
.rd-split > .section { margin-bottom: 0; min-width: 0; }
.rd-panel { min-width: 0; }
.rd-panel-empty {
    padding: 24px 16px;
    color: var(--color-text-2);
}

/* A row of the panel: a label with its switch. */
.rd-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}
.rd-switch-row:last-of-type { border-bottom: 0; }
.rd-panel-section {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.rd-panel-section > h4 {
    margin: 0 0 8px;
    color: var(--color-text-2);
    font-size: 13px;
    font-weight: 600;
}
.rd-panel-actions > .rd-spacer { flex: 1; }

/* Fields of a dialog, one under the other. */
.rd-dialog-form {
    display: grid;
    gap: 12px;
}
.rd-dialog-form .form-field { margin: 0; }
.rd-dialog-form textarea { width: 100%; }
.rd-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Atlas: each page sits in the main column of the shell, so the outer padding
   of its own layout goes. */
.atlas-main > .crm-shell { padding: 0 0 32px; }
.atlas-main > .crm-acquisition-dashboard { padding: 0; }
.atlas-main > .crm-auth-notice,
.atlas-main > .documents-auth-notice,
.atlas-main > .collab-auth-notice { padding: 32px 0; }
.atlas-main > .documents-shell {
    max-width: none;
    padding: 0 0 32px;
}
.atlas-main > .documents-shell > .documents-toolbar { padding: 0 0 12px; }
.atlas-main > .collab-shell {
    max-width: none;
    padding: 0 0 32px;
}
/* The health and stage filters are one segmented filter above the list. */
.rd-seg > .crm-band-chip:hover { color: var(--color-text-1); }

@media (max-width: 820px) {
    .admin-app > .main-content { padding: 16px 12px; }
    .rd-search { max-width: none; }
    .rd-view-head > .btn,
    .rd-view-head > .rd-view-actions { margin-left: 0; }
    /* A wide table scrolls inside its card; a name stays on one line. */
    .rd-split .table-container table,
    .section > .table-container table { min-width: 560px; }
}
