/* RustPress admin — operations screens of iteration 2 (SPEC-ITER2 §9.5). Owner: admin-operaciones.
   Route wrappers carry `.rp-fleet.rp-ops` (fleet.css gives the layout, cards, stats and tables);
   this file adds what is specific to operations. Light admin, the palette of widgets.css,
   responsive down to 375 px. Server data is always text: nothing here relies on generated HTML. */

.rp-ops { --rp-ops-gap: var(--rp-fleet-gap, 16px); }
.rp-ops > .rp-card, .rp-ops > section, .rp-ops > .rp-fleet-grid, .rp-ops > .rp-fleet-paged, .rp-ops > div > .rp-card { margin-bottom: var(--rp-ops-gap); }
.rp-ops .rp-fleet-grid { margin-bottom: var(--rp-ops-gap); }
.rp-ops .rp-fleet-grid > .rp-card { margin: 0; }
.rp-ops .notice.inline { margin: 0 0 12px; }
.rp-ops .rp-card-body > .notice.inline:last-child { margin-bottom: 0; }
.rp-ops .rp-fleet-sub { max-width: 90ch; }
.rp-ops code, .rp-ops-code { font-size: 12px; overflow-wrap: anywhere; }
.rp-ops .rp-fleet-head-actions .button { white-space: nowrap; }
.rp-ops .rp-card-head .rp-ops-field { flex-direction: row; align-items: center; gap: 6px; }
.rp-ops .rp-card-head .rp-ops-field label { margin: 0; }

/* ------------------------------------------------------------ forms */
.rp-ops-form { display: grid; gap: 12px; max-width: 760px; }
.rp-ops-form .regular-text, .rp-ops-form .large-text, .rp-ops-form select { max-width: 100%; }
.rp-ops-form .large-text { width: 100%; box-sizing: border-box; }
.rp-ops-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-ops-field > label, .rp-ops-field-label { font-weight: 600; color: var(--rp-text-strong); }
.rp-ops-field .description { margin: 0; color: var(--rp-muted); font-size: 12px; }
.rp-ops-field.is-check { flex-direction: column; }
.rp-ops-field.is-check > label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.rp-ops-field[hidden], .rp-ops [hidden] { display: none !important; }
.rp-ops-formrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.rp-ops-fieldset { border: 1px solid var(--rp-border-light); border-radius: 6px; padding: 10px 14px 14px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.rp-ops-fieldset legend { font-weight: 600; padding: 0 4px; color: var(--rp-text-strong); }
.rp-ops-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.rp-ops-form > .rp-ops-actions, .rp-ops-form .rp-ops-actions:first-child { margin-top: 0; }
.rp-ops-actions .rp-ops-field { flex-direction: row; align-items: center; gap: 6px; }
.rp-ops-inlineform { max-width: 620px; }
.rp-ops .rp-filters .rp-ops-field { flex: 0 1 auto; gap: 2px; }
.rp-ops .rp-filters .rp-ops-field > label { font-size: 12px; font-weight: 500; color: var(--rp-muted); }
/* The label sits on top of its control: never a flex item that grows (the console's narrow
   `.rp-filters label { flex: 1 1 140px }` would turn that basis into 140px of height here). */
.rp-ops .rp-filters .rp-ops-field > label, .rp-ops .rp-filters .rp-ops-field > .rp-ops-field-label { flex: 0 0 auto; }
.rp-ops .rp-filters input[type=search] { min-width: 180px; }
.rp-ops .rp-filters .rp-check { margin-left: auto; }
.rp-ops-details { margin: 0 0 12px; border: 1px solid var(--rp-border-light); border-radius: 6px; padding: 8px 12px; background: #fcfcfc; }
.rp-ops-details > summary { cursor: pointer; font-weight: 600; color: var(--rp-blue); }
.rp-ops-details[open] > summary { margin-bottom: 8px; }
.rp-ops-details textarea { width: 100%; box-sizing: border-box; margin-bottom: 8px; }

/* Choice cards (wizard and new migration): a radio inside a bordered label. */
.rp-ops-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.rp-ops-cards legend { font-weight: 600; color: var(--rp-text-strong); margin-bottom: 8px; padding: 0; }
.rp-ops-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: start; padding: 10px 12px; background: #fff; border: 1px solid var(--rp-border-light); border-radius: 6px; cursor: pointer; }
.rp-ops-card input { margin: 2px 0 0; grid-row: span 2; }
.rp-ops-card-title { font-weight: 600; color: var(--rp-text-strong); }
.rp-ops-card-text { grid-column: 2; color: var(--rp-muted); font-size: 12px; }
.rp-ops-card:hover { border-color: var(--rp-blue); }
.rp-ops-card:has(input:checked) { border-color: var(--rp-blue); box-shadow: 0 0 0 1px var(--rp-blue); background: var(--rp-info-bg); }
.rp-ops-card:has(input:focus-visible) { outline: 2px solid var(--rp-blue); outline-offset: 2px; }

/* ------------------------------------------------------------ small building blocks */
.rp-ops-cellstack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.rp-ops-cellstack small { display: block; overflow-wrap: anywhere; }
.rp-ops-pills { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rp-ops-pilllink { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--rp-text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-ops-pilllink:hover .rp-pill, .rp-ops-pilllink:focus-visible .rp-pill { box-shadow: 0 0 0 1px currentColor; }
.rp-ops-statlink { display: flex; text-decoration: none; color: inherit; border-radius: var(--rp-fleet-radius, 6px); }
.rp-ops-statlink > .rp-fleet-stat { flex: 1; transition: border-color .1s ease-in-out; }
.rp-ops-statlink:hover > .rp-fleet-stat, .rp-ops-statlink:focus-visible > .rp-fleet-stat { border-color: var(--rp-blue); }
.rp-ops-statlink:hover .rp-fleet-stat-label, .rp-ops-statlink:focus-visible .rp-fleet-stat-label { color: var(--rp-blue); }
.rp-ops-path { font-family: var(--rp-mono); font-size: 12px; overflow-wrap: anywhere; word-break: break-all; }
a.rp-ops-path { text-decoration: none; }
a.rp-ops-path:hover, a.rp-ops-path:focus { text-decoration: underline; }
.rp-ops-hash { font-size: 12px; }
.rp-ops-note { background: var(--rp-warn-bg); border-left: 3px solid var(--rp-yellow); padding: 8px 12px; margin: 0 0 12px; }
.rp-ops-stamp { display: inline-block; margin-left: auto; font-size: 12px; }
.rp-ops-tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.rp-ops-tablebar .tablenav { flex: 1 1 auto; }
.rp-ops-auto { white-space: nowrap; }
.rp-list-table tr.rp-ops-row-bad > td:first-child, .rp-list-table tr.rp-ops-row-bad > th:first-child { box-shadow: inset 3px 0 0 var(--rp-bad); }
.rp-ops-sample { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.rp-ops-sample li { overflow-wrap: anywhere; }
.rp-ops-errlist { margin: 6px 0 10px 18px; }
.rp-ops-warnlist { margin: 4px 0 8px 18px; list-style: disc; }
.rp-ops-warnlist li { margin: 2px 0; overflow-wrap: anywhere; }
.rp-ops-migstatus { display: inline-flex; align-items: center; gap: 4px; }
.rp-ops-fielddiff { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.rp-ops-fielddiff del { color: var(--rp-bad); text-decoration: line-through; }
.rp-ops-fielddiff ins { color: var(--rp-good); text-decoration: none; font-weight: 600; }
.rp-ops-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rp-ops-chips:empty { display: none; }
.rp-ops-chip { padding-right: 2px; }
.rp-ops-chip small { color: var(--rp-muted); }
.rp-ops-chip-x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 6px; color: var(--rp-muted); border-radius: 50%; }
.rp-ops-chip-x:hover, .rp-ops-chip-x:focus-visible { color: var(--rp-bad); background: var(--rp-bad-bg); }
.rp-ops-sitepicker .rp-sitesearch { max-width: 480px; }

/* Progress of jobs inside tables, cards and modals. */
.rp-ops-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.rp-ops-progress progress { flex: 1 1 80px; min-width: 60px; max-width: 140px; height: 8px; }
.rp-ops-progress-text { font-size: 12px; color: var(--rp-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-ops-jobinline { display: grid; gap: 6px; padding: 10px 12px; margin: 10px 0 0; background: var(--rp-info-bg); border: 1px solid #c5d9ed; border-radius: 6px; }
.rp-ops-joblabel { color: var(--rp-text-strong); }
.rp-ops-joblink { font-size: 12px; justify-self: start; }
.rp-ops-rowjob .rp-ops-jobinline { margin: 6px 0 0; padding: 6px 8px; }
.rp-ops-rowjob .rp-job { max-width: 220px; }
.rp-ops-jobmodal { display: grid; gap: 10px; }
.rp-ops-jobstatus { display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.rp-ops-steplive:empty { display: none; }

/* ------------------------------------------------------------ overview and capacity */
.rp-ops-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.rp-ops-target { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon label" "icon value" "icon goal"; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 6px; border: 1px solid; background: #fff; }
.rp-ops-target.is-ok { border-color: #b8e6bf; background: var(--rp-good-bg); }
.rp-ops-target.is-bad { border-color: #f1adad; background: var(--rp-bad-bg); }
.rp-ops-target.is-none { border-color: var(--rp-border-light); background: #f6f7f7; }
.rp-ops-target-icon { grid-area: icon; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; color: #fff; }
.rp-ops-target.is-ok .rp-ops-target-icon { background: var(--rp-good); }
.rp-ops-target.is-bad .rp-ops-target-icon { background: var(--rp-bad); }
.rp-ops-target.is-none .rp-ops-target-icon { background: var(--rp-muted); }
.rp-ops-target.is-none .rp-ops-target-value { color: var(--rp-muted); font-size: 16px; }
.rp-ops-target-label { grid-area: label; font-size: 12px; color: var(--rp-text); }
.rp-ops-target-value { grid-area: value; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--rp-text-strong); }
.rp-ops-target.is-bad .rp-ops-target-value { color: var(--rp-bad); }
.rp-ops-target-goal { grid-area: goal; font-size: 11px; color: var(--rp-muted); }
.rp-ops-instances td, .rp-ops-instances th { white-space: nowrap; }
.rp-ops-instances small { display: block; }
.rp-ops-caches .rp-ops-budgetcell { min-width: 220px; }
.rp-ops-budget { display: grid; grid-template-columns: minmax(80px, 160px) auto; align-items: center; gap: 8px; }
.rp-ops-budget .rp-fleet-meter { max-width: none; height: 8px; }
.rp-ops-budget-text { font-size: 12px; color: var(--rp-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-ops-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.rp-ops-charts > *, .rp-ops-mix, .rp-ops-latency { min-width: 0; }

/* ------------------------------------------------------------ domains */
.rp-ops-verify .rp-copyfield { margin: 0; }
.rp-ops-steps-list { margin: 0 0 0 18px; padding: 0; display: grid; gap: 12px; }
.rp-ops-steps-list > li > strong:first-child { color: var(--rp-text-strong); }
.rp-ops-copygrid { display: grid; grid-template-columns: minmax(0, 90px) minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.rp-ops-copygrid > .rp-copyfield:last-child { grid-column: 1 / -1; }
.rp-ops-steps-list > li > .rp-copyfield { margin-top: 8px; }
.rp-ops-domain { background: #fff; border: 1px solid var(--rp-border-light); border-radius: 6px; margin: 0 0 10px; }
.rp-ops-domain > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.rp-ops-domain > summary::-webkit-details-marker { display: none; }
.rp-ops-domain > summary::before { content: "▸"; color: var(--rp-muted); transition: transform .15s ease-in-out; }
.rp-ops-domain[open] > summary::before { transform: rotate(90deg); }
.rp-ops-domain > summary:focus-visible { outline: 2px solid var(--rp-blue); outline-offset: -2px; border-radius: 6px; }
.rp-ops-domain > summary .rp-ops-cellstack { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
.rp-ops-domain > summary .rp-ops-cellstack small { display: inline; }
.rp-ops-domain-host { font-size: 14px; color: var(--rp-text-strong); overflow-wrap: anywhere; margin-right: auto; }
.rp-ops-domain > div { padding: 0 12px 12px; border-top: 1px solid #f0f0f1; }
.rp-ops-domain .rp-fleet-grid { margin: 12px 0 0; }

/* ------------------------------------------------------------ PMS */
.rp-ops-stepper .rp-stepper { margin-bottom: 12px; }
.rp-ops-wizbody { display: grid; gap: 12px; }
.rp-ops-wiznav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rp-border-light); }
.rp-ops-wizard .rp-card-body > .notice { margin-bottom: 12px; }
.rp-ops-secret { display: grid; gap: 8px; }
.rp-ops-test { display: grid; gap: 8px; }
.rp-ops-test .notice { margin: 0; }
.rp-ops-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-ops-sugg { margin: 4px 4px 0 0 !important; }
.rp-ops-ambiguous { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rp-ops-ambiguous li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-ops-connlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rp-ops-testresult:empty { display: none; }
.rp-ops-testresult { margin-top: 10px; }
.rp-ops-steps { margin-top: 8px; }

/* ------------------------------------------------------------ migrations */
.rp-ops-stepnav .rp-stepper { margin-bottom: var(--rp-ops-gap); }
.rp-ops-stepbody > * + * { margin-top: var(--rp-ops-gap); }
.rp-ops-stepbody .rp-fleet-grid, .rp-ops-stepbody .rp-fleet-stats { margin-bottom: 0; }
.rp-ops-stepbody h2:focus { outline: none; }
.rp-ops-migstats { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.rp-ops-migstats .rp-fleet-stat-value { font-size: 18px; }
.rp-ops-stepdots { display: inline-flex; gap: 3px; align-items: center; }
.rp-ops-stepdots > span { width: 10px; height: 10px; border-radius: 50%; background: #dcdcde; }
.rp-ops-stepdots > .is-done { background: var(--rp-green); }
.rp-ops-stepdots > .is-running { background: var(--rp-blue); animation: rp-ops-pulse 1.4s ease-in-out infinite; }
.rp-ops-stepdots > .is-failed { background: var(--rp-red); }
@keyframes rp-ops-pulse { 50% { opacity: .35; } }
.rp-ops-mapedit { display: grid; gap: 3px; min-width: 0; }
.rp-ops-mapedit-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rp-ops-mapedit-row select { flex: 0 0 auto; }
.rp-ops-newpath { flex: 1 1 120px; min-width: 100px; font-family: var(--rp-mono); font-size: 12px; }
.rp-ops-mapnote { font-size: 12px; min-height: 0; }
.rp-ops-mapnote:empty { display: none; }
.rp-ops-parity { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.rp-ops-parity-score { display: grid; justify-items: center; text-align: center; gap: 8px; }
.rp-ops-parity-score p { margin: 0; }
.rp-ops-parity-checks { min-width: 0; overflow-x: auto; }
.rp-ops-checks { width: 100%; }
.rp-ops-checkscore { white-space: nowrap; }
.rp-ops-checkscore .rp-fleet-meter { width: 90px; }
.rp-ops-checklist { list-style: none; margin: 0; padding: 0; }
.rp-ops-check { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid #f0f0f1; }
.rp-ops-check:last-child { border-bottom: 0; }
.rp-ops-check-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 13px; background: var(--rp-neutral-bg); color: var(--rp-neutral); }
.rp-ops-check.is-ok .rp-ops-check-icon { background: var(--rp-good-bg); color: var(--rp-good); }
.rp-ops-check.is-warn .rp-ops-check-icon { background: var(--rp-warn-bg); color: var(--rp-warn); box-shadow: inset 0 0 0 1px #f0d48a; }
.rp-ops-check.is-fail .rp-ops-check-icon { background: var(--rp-bad-bg); color: var(--rp-bad); }
.rp-ops-check-main { min-width: 0; }
.rp-ops-check-main strong { color: var(--rp-text-strong); }
.rp-ops-check-main p { margin: 3px 0 0; color: var(--rp-muted); }
.rp-ops-check-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.rp-ops-preview p { margin: 0 0 4px; }
.rp-ops-previewlink { font-weight: 600; overflow-wrap: anywhere; }
.rp-ops-cutbtn:not(:disabled) { background: var(--rp-red-dark); border-color: var(--rp-red-dark); }
.rp-ops-cutbtn:not(:disabled):hover, .rp-ops-cutbtn:not(:disabled):focus { background: #8a2424; border-color: #8a2424; }
.rp-ops-batchprojects small { display: block; }
.rp-ops .rp-diff { max-height: 180px; }
.rp-ops .rp-diff.is-split { min-width: 260px; }

/* ------------------------------------------------------------ site screens */
.rp-ops-site { max-width: 1100px; }
.rp-ops-site > h1 { font-weight: 600; }

/* ------------------------------------------------------------ responsive */
/* Between the phone layout (stacked rows, ≤ 782 px) and a wide screen, the fixed column widths of
   the list tables would squeeze the main column: let the table size itself and scroll inside its box. */
@media (min-width: 783px) and (max-width: 1280px) {
  .rp-ops .rp-list-table { table-layout: auto; }
  .rp-ops .rp-list-table th.manage-column { width: auto !important; }
  .rp-ops .rp-list-table .column-primary { min-width: 200px; }
  .rp-ops .rp-list-table td:not(.column-primary) { min-width: 88px; }
  .rp-ops .rp-list-table td .rp-ops-mapedit { min-width: 230px; }
}
@media (max-width: 960px) {
  .rp-ops-parity { grid-template-columns: minmax(0, 1fr); }
  .rp-ops-check { grid-template-columns: 28px minmax(0, 1fr); }
  .rp-ops-check-actions { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 782px) {
  .rp-ops .rp-filters .rp-ops-field { flex: 1 1 140px; }
  .rp-ops .rp-filters .rp-ops-field select, .rp-ops .rp-filters .rp-ops-field input { width: 100%; min-width: 0; }
  .rp-ops .rp-filters .rp-check { margin-left: 0; }
  .rp-ops-copygrid { grid-template-columns: minmax(0, 1fr); }
  .rp-ops-target-value { font-size: 18px; }
  .rp-ops-wiznav { flex-direction: column-reverse; align-items: stretch; }
  .rp-ops-wiznav .button { text-align: center; }
  .rp-ops-budget { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rp-ops .rp-diff.is-split { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .rp-ops .rp-diff.is-split .rp-diff-col + .rp-diff-col { border-left: 0; border-top: 1px solid var(--rp-border-light); }
  .rp-ops .rp-list-table .rp-ops-mapedit-row { margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-ops-stepdots > .is-running { animation: none; }
  .rp-ops-domain > summary::before { transition: none; }
}
.rp-ops .rp-filters label.rp-check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--rp-text); }
.rp-ops-form .rp-card-body { display: grid; gap: 12px; }
.rp-ops-form .rp-card-body > .rp-ops-cards, .rp-ops-form .rp-card-body > div > .rp-ops-field + .rp-ops-field { margin: 0; }
.rp-ops-form .rp-card-body > div:not([class]) { display: grid; gap: 12px; }
.rp-ops-form select, .rp-ops-wizbody select, .rp-modal .rp-ops-form select { width: auto; min-width: 220px; max-width: 100%; }
.rp-ops-newform { max-width: 820px; }
.rp-ops-field { align-items: flex-start; }
.rp-ops-field > label, .rp-ops-field > .description, .rp-ops-field > .rp-ops-sitepicker, .rp-ops-field > .rp-filedrop-wrap,
.rp-ops-field > textarea, .rp-ops-field > .large-text, .rp-ops-field > .rp-fleet-levelsettings, .rp-ops-field > .rp-selection { align-self: stretch; }
@media (max-width: 782px) {
  .rp-ops-field > select, .rp-ops-field > input.regular-text { align-self: stretch; width: 100%; min-width: 0; }
}
