/* RustPress admin — console and fleet operations (SPEC-ITER2 §9.3–§9.5). Owner: admin-consola.
   Scoped under .rp-console (route wrappers, on top of .rp-fleet from fleet.css) and .rp-console-*
   (modals), plus the editor's global-block (.rp-gblock-*). Responsive down to 375 px. */

/* ---------------------------------------------------------------- layout primitives */
.rp-console-stack { display: grid; gap: 10px; }
.rp-console-stack > p { margin: 0; }
.rp-console-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rp-console-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 4px 24px; align-items: start; }
.rp-console-cols > * { min-width: 0; }
.rp-console-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.rp-console-card .rp-card-body { padding: 16px; }
.rp-console-count { margin: 0 0 4px; color: var(--rp-muted); }
.rp-console-pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.rp-console-tag { display: inline-block; margin: 0 4px 2px 0; padding: 1px 6px; border-radius: 3px; background: #f0f0f1; font-size: 12px; }
.rp-console-inline-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.rp-console-inline-list li { margin: 0; }
.rp-console-search { min-width: min(100%, 320px); }
.rp-console-short { max-width: 190px; }
.rp-console-mini { max-width: 420px; }

/* ---------------------------------------------------------------- forms */
/* admin.css styles every text-like input except tel. */
.rp-console input[type=tel], .rp-modal input[type=tel] { font: inherit; font-size: 14px; color: #2c3338; border: 1px solid #8c8f94; border-radius: 4px; background: #fff; padding: 0 8px; min-height: 30px; line-height: 2; }
.rp-console-versions .button { white-space: normal; height: auto; line-height: 1.4; padding-top: 3px; padding-bottom: 3px; }
.rp-console-form { display: grid; gap: 12px; }
.rp-console-field { display: grid; gap: 4px; margin: 0 0 10px; min-width: 0; }
.rp-console-field > label, .rp-console-label { font-weight: 600; color: var(--rp-text-strong); }
.rp-console-field input:not([type=checkbox]):not([type=radio]):not(.screen-reader-text), .rp-console-field select, .rp-console-field textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.rp-console-field select[multiple] { min-height: 90px; }
.rp-console-field .description { margin: 0; color: var(--rp-muted); font-size: 12px; }
.rp-console-field.is-check label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.rp-console-fieldset { border: 1px solid var(--rp-border-light); border-radius: 6px; padding: 10px 14px 4px; margin: 0; min-width: 0; }
.rp-console-fieldset > legend { padding: 0 6px; font-weight: 600; color: var(--rp-text-strong); }
.rp-console-checks { border: 0; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; min-width: 0; }
.rp-console-checks > legend { width: 100%; padding: 0 0 4px; font-weight: 600; color: var(--rp-text-strong); }
.rp-console-check { display: inline-flex; gap: 6px; align-items: center; }
.rp-console-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.rp-console-advanced { margin: 4px 0 10px; }
.rp-console-advanced > summary { cursor: pointer; color: var(--rp-blue); margin-bottom: 8px; }
.rp-console-markup { font-family: var(--rp-mono); font-size: 12px; line-height: 1.5; min-height: 180px; }
.rp-console-error { color: var(--rp-red-dark); margin: 6px 0 0; }
.rp-console-errors { margin: 0; padding-left: 18px; }
.rp-console-errors li { margin: 0 0 2px; }
.rp-console-applies { display: grid; gap: 4px; }

/* ---------------------------------------------------------------- console home */
.rp-console-hero { background: #fff; border: 1px solid var(--rp-border-light); border-radius: 8px; padding: 18px 20px; margin: 0 0 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.rp-console-hero-label { margin: 0 0 8px; font-size: 15px; }
.rp-console-hero .rp-sitesearch { max-width: 640px; }
.rp-console-hero .rp-sitesearch-input { font-size: 15px; padding: 8px 12px; min-height: 40px; }
.rp-console-hero p { margin: 8px 0 0; }
.rp-console-sitelist, .rp-console-accounts, .rp-console-shortcuts, .rp-console-sample { list-style: none; margin: 0; padding: 0; }
.rp-console-sitelist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f1; }
.rp-console-sitelist li:last-child { border-bottom: 0; }
.rp-console-sitelink { display: grid; gap: 1px; text-decoration: none; min-width: 0; }
.rp-console-sitelink strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-console-visit { white-space: nowrap; font-size: 12px; }
.rp-console-accounts li { padding: 5px 0; }
.rp-console-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rp-console-shortcuts a { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--rp-border-light); border-radius: 6px; text-decoration: none; height: 100%; box-sizing: border-box; }
.rp-console-shortcuts a span { color: var(--rp-muted); font-size: 12px; }
.rp-console-shortcuts a:hover { border-color: var(--rp-blue); }
.rp-console-hub { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.rp-console-hub-card { display: grid; gap: 6px; padding: 16px; background: #fff; border: 1px solid var(--rp-border-light); border-radius: 8px; text-decoration: none; height: 100%; box-sizing: border-box; color: var(--rp-text); }
.rp-console-hub-card strong { font-size: 15px; color: var(--rp-blue); }
.rp-console-hub-card:hover, .rp-console-hub-card:focus { border-color: var(--rp-blue); }
.rp-console-hub-count:empty { display: none; }

/* ---------------------------------------------------------------- site lists */
.rp-console-sites-table td { vertical-align: middle; }
.rp-console-sites-table .column-primary small { display: block; }
.rp-console-rowlinks { margin-top: 4px; font-size: 12px; }
.rp-console-rowlinks .button-link { font-size: 12px; padding: 0; vertical-align: baseline; text-decoration: none; }
.rp-console-sites-table th.column-primary { width: 34%; }
.rp-console-sep { color: var(--rp-muted); }
.rp-console-siteref { display: inline-grid; gap: 1px; min-width: 0; }
.rp-console-siteref small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-console-sitepick { max-width: 560px; }
.rp-console-chosen { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--rp-border-light); border-radius: 4px; background: #f6f7f7; }
.rp-console-sitefilter .rp-sitesearch { min-width: 200px; }
.rp-console-userpicker input { min-width: 150px; }

/* ---------------------------------------------------------------- audit */
.rp-console-audit-table td { vertical-align: top; }
.rp-console-audit-table td small { display: block; }
.rp-audit-details > td { background: #f6f7f7; }
.rp-console-audit-detail { display: grid; gap: 8px; padding: 4px 0; }
.rp-console-audit-detail .rp-kv { margin: 0; }

/* ---------------------------------------------------------------- security / 2FA */
.rp-console-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.rp-console-steps > li > p { margin: 0 0 8px; }
.rp-console-qr { display: block; width: 200px; height: 200px; background: #fff; border: 1px solid var(--rp-border-light); border-radius: 6px; padding: 8px; box-sizing: content-box; }
.rp-console-2fa-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.rp-console-2fa-form label { display: grid; gap: 4px; font-weight: 600; }
.rp-console-2fa-form .description { width: 100%; margin: 0; }
.rp-console-2fa-form [role=alert] { width: 100%; }
.rp-console-code { width: 9em; font-family: var(--rp-mono); font-size: 18px; letter-spacing: .2em; text-align: center; }
.rp-console-codeaction { margin: 0 0 8px; }
.rp-console-codes { display: grid; gap: 10px; }
.rp-console-codelist { columns: 2; column-gap: 24px; margin: 0; padding-left: 26px; font-family: var(--rp-mono); }
.rp-console-codelist li { margin: 0 0 4px; break-inside: avoid; }
.rp-console-sessions td { vertical-align: middle; }
.rp-console-enroll { min-height: 100vh; display: grid; place-content: center; gap: 14px; padding: 24px 16px; box-sizing: border-box; }
.rp-console-enroll-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; font-weight: 600; color: var(--rp-text-strong); }
.rp-console-enroll-card { width: min(560px, calc(100vw - 32px)); box-sizing: border-box; background: #fff; border: 1px solid var(--rp-border-light); border-radius: 8px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.rp-console-enroll-card h1 { padding-top: 0; margin-bottom: 8px; }
.rp-console-enroll-foot { text-align: center; color: var(--rp-muted); margin: 0; }
.rp-console.rp-console-fullscreen { max-width: none; }

/* ---------------------------------------------------------------- blueprints / provisioning */
.rp-console-versions tr.is-current td { background: #f0f6fc; }
.rp-console-keys { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.rp-console-created { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--rp-border-light); border-radius: 6px; background: #f6f7f7; }
.rp-console-created p { margin: 0; }
.rp-console-rows tr.is-invalid td, .rp-console-rows tr.is-failed td { background: #fcf0f1; }
.rp-console-rows td { vertical-align: top; }
.rp-console-rows th:nth-child(1) { width: 56px; }
.rp-console-rows th:nth-child(3) { width: 110px; }
.rp-console-rows th:nth-child(4) { width: 38%; }
.rp-console-stats { margin-top: 4px; }

/* ---------------------------------------------------------------- global blocks */
.rp-console-editor-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.rp-console-preview { min-height: 80px; }
.rp-console-frame { width: 100%; min-height: 180px; border: 1px solid var(--rp-border-light); border-radius: 4px; background: #fff; }
.rp-console-compliance p { margin: 0 0 8px; }
.rp-console-blocked { display: grid; gap: 6px; }

/* ---------------------------------------------------------------- change sets */
.rp-console-ops { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.rp-console-op { border: 1px solid var(--rp-border-light); border-radius: 6px; background: #fff; }
.rp-console-op-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #f0f0f1; background: #f6f7f7; border-radius: 6px 6px 0 0; }
.rp-console-op-tools { display: inline-flex; gap: 4px; }
.rp-console-op-body { padding: 10px 12px 2px; }
.rp-console-op-empty { padding: 12px; color: var(--rp-muted); border: 1px dashed var(--rp-border); border-radius: 6px; }
.rp-console-opsetting .rp-setting { margin: 0; }
.rp-console-opsbuilder > .rp-console-row select { width: auto; max-width: 100%; }
.rp-console-opvalue { margin: 6px 0; word-break: break-word; }
.rp-console-oplist { margin: 0 0 12px; padding-left: 20px; }
.rp-console-preview-result { display: grid; gap: 10px; }
.rp-console-preview-result > p { margin: 0; }
.rp-console-samples { display: grid; gap: 8px; }
.rp-console-sample { border: 1px solid var(--rp-border-light); border-radius: 6px; background: #fff; }
details.rp-console-sample > summary { cursor: pointer; padding: 8px 12px; }
.rp-console-change { padding: 0 12px 10px; }
.rp-console-change p { margin: 6px 0; }

/* ---------------------------------------------------------------- legal */
.rp-console-coverage { display: flex; align-items: center; gap: 8px; }
.rp-console-coverage .rp-fleet-meter { flex: 1 1 auto; min-width: 60px; }
.rp-console-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rp-console-timeline > li { border-left: 3px solid var(--rp-border-light); padding-left: 12px; }
.rp-console-timeline p { margin: 0 0 4px; }
.rp-console-sample li { padding: 6px 0; border-bottom: 1px solid #f0f0f1; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.rp-console-object { display: inline; }

/* ---------------------------------------------------------------- editor: global block */
.rp-gblock-label { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.rp-gblock-select { min-width: min(100%, 280px); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .rp-console-editor-grid { grid-template-columns: minmax(0, 1fr); }
  /* Fixed column widths do not fit next to the menu: let the content size the columns. */
  .rp-console table.rp-list-table.fixed { table-layout: auto; }
  .rp-console table.rp-list-table.fixed th[style] { width: auto !important; }
}
@media (max-width: 782px) {
  .rp-console-hero { padding: 14px; }
  .rp-console .rp-filters label { flex: 1 1 140px; }
  .rp-console .rp-filters select, .rp-console .rp-filters input { min-width: 0; width: 100%; }
  .rp-console-codelist { columns: 1; }
  .rp-console-sitelist li { flex-wrap: wrap; }
}
.rp-console-wholefleet { margin: 6px 0; }
.rp-console-applyfh { display: grid; gap: 8px; max-height: 50vh; overflow: auto; margin: 0 0 10px; }
.rp-console-applyfh .notice { margin: 0; }

/* ---------------------------------------------------------------- plugins (SPEC-ITER3 §9.5) */
.rp-plugins { display: grid; gap: 12px; }
.rp-plugins-list td { vertical-align: top; }
.rp-plugins-list tr.is-off td.column-primary strong { color: var(--rp-muted); }
.rp-plugins-pack { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 9px; background: #e7f0f9; color: var(--rp-blue-dark); white-space: nowrap; }
.rp-plugins-state { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-plugins-state-text { font-size: 12px; color: var(--rp-muted); }
.rp-plugins-hint { display: block; flex-basis: 100%; color: var(--rp-muted); font-size: 12px; }
.rp-plugins-inherit { font-size: 12px; }
.rp-plugins-switch { position: relative; width: 38px; height: 22px; border-radius: 11px; border: 1px solid var(--rp-border); background: #dcdcde; cursor: pointer; padding: 0; flex: 0 0 auto; transition: background .15s; }
.rp-plugins-switch .rp-plugins-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.rp-plugins-switch[aria-checked="true"] { background: var(--rp-blue); border-color: var(--rp-blue-dark); }
.rp-plugins-switch[aria-checked="true"] .rp-plugins-knob { left: 18px; }
.rp-plugins-switch:focus-visible { outline: 2px solid var(--rp-blue); outline-offset: 2px; }
.rp-plugins-switch:disabled { cursor: not-allowed; opacity: .55; }
.rp-plugins-lock { white-space: nowrap; }
.rp-plugins-core { margin-top: 8px; }
.rp-plugins-readonly { margin: 4px 0 0; }
.rp-plugins-joblist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-plugins-job-title { display: block; font-weight: 600; margin-bottom: 4px; }
.rp-plugins-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100040; }
.rp-plugins-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; z-index: 100045; box-shadow: -4px 0 18px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.rp-plugins-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--rp-border-light); }
.rp-plugins-drawer-head h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.rp-plugins-drawer-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--rp-muted); padding: 2px 6px; }
.rp-plugins-drawer-x:focus-visible { outline: 2px solid var(--rp-blue); }
.rp-plugins-drawer-body { flex: 1 1 auto; overflow: auto; padding: 14px 16px; }
.rp-plugins-drawer-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--rp-border-light); }
.rp-plugins-facts { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.rp-plugins-facts .is-warn { color: #8a5a00; }
.rp-plugins-sample { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.rp-plugins-error p { margin: 4px 0; }
.rp-plugins-intro { margin-top: 0; }
@media (max-width: 782px) {
  .rp-plugins-drawer { width: 100vw; }
}
