/* The Recovery report, on top of the portal's app.css and the MDS tokens.
   The dashboard is a slide: it fits 16:9 at 1280 x 720 and prints on one landscape page. */

.block { display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbc { color: var(--text-weak); font-weight: 400; }
/* Figures that do not add up: marked, not shown as a number. */
.check { color: var(--warn-text); background: var(--warn-bg); border-radius: var(--radius-s); padding: 0 6px; font-weight: 600; }
form.inline { display: inline-flex; gap: 2px; }
form.role-form { display: inline-flex; align-items: center; gap: calc(8 * var(--mds-unit)); }
form.role-form select { width: auto; }
.link-button { border: 0; background: none; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }

/* Status tints: green for up + remediated, amber for up but not remediated, red for not
   recovered, and the same for the impact columns. The text says the same as the colour. */
.cell-green { background: var(--ok-bg); color: var(--ok-text); }
.cell-amber { background: var(--warn-bg); color: var(--warn-text); }
.cell-red { background: var(--err-bg); color: var(--err-text); }
.rag { font-weight: 600; }

/* ---------- the dashboard ---------- */
.report-body { background: var(--surface); }
.report-page { max-width: 1280px; padding: 32px 40px; gap: 24px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.report-head h1 { font: 400 32px/40px var(--font-head); }
.report-sub { margin-top: 4px; color: var(--text-weak); font-size: 16px; line-height: 24px; }
.report-head-side { display: grid; justify-items: end; gap: 8px; }
.report-label { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-weak); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; }
.report-tools { display: flex; align-items: center; gap: 16px; font-size: 12px; line-height: 16px; }
.report-tools form { display: inline; }

/* KPI tiles: no coloured edge; the value carries the colour. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; align-content: start; gap: 4px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.kpi-label { font-size: 14px; line-height: 20px; color: var(--text-weak); }
.kpi-value { font: 400 40px/48px var(--font-head); font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; line-height: 16px; color: var(--text-weak); }
.kpi-up_remediated .kpi-value { color: var(--mds_brand_appearance_success_default_text-color); }
.kpi-up_not_remediated .kpi-value { color: var(--mds_brand_appearance_warning_default_text-color); }
.kpi-not_recovered .kpi-value { color: var(--err); }
.kpi-value .tbc { color: var(--text-weak); }

.report-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.report-table thead th { font-size: 13px; line-height: 18px; font-weight: 700; background: var(--surface-weak); vertical-align: bottom; }
.report-table .num { text-align: right; }
.report-table tbody th { font-weight: 600; white-space: nowrap; }
.report-table tbody td { font-size: 16px; line-height: 24px; }
.report-table tbody td.num { font-weight: 600; }
.report-table tbody tr:last-child > * { border-bottom: 0; }
/* The whole row opens the domain: the name's link covers the row. */
.report-row { position: relative; }
.report-row:hover > * { box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.03); }
.row-link { color: var(--text); }
.row-link::after { content: ""; position: absolute; inset: 0; }
.row-link:focus-visible { outline: none; }
.report-row:focus-within { outline: 2px solid var(--text); outline-offset: -2px; }
.report-foot { color: var(--text-weak); font-size: 13px; line-height: 18px; }

@media (max-width: 900px) {
  .report-page { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-head { flex-direction: column; }
  .report-head-side { justify-items: start; }
}

@media print {
  @page { size: landscape; margin: 10mm; }
  .report-tools, .top-bar, .tab-bar, .devbar { display: none; }
  .report-page { padding: 0; max-width: none; }
  .report-table-wrap, .kpi { break-inside: avoid; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- statuses ---------- */
.status-up_remediated { background: var(--ok-bg); color: var(--ok-text); }
.status-up_not_remediated { background: var(--warn-bg); color: var(--warn-text); }
.status-not_recovered { background: var(--err-bg); color: var(--err-text); }

/* ---------- configure ---------- */
.page-wide { max-width: 1600px; }
.split { display: grid; grid-template-columns: minmax(520px, 4fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.split > .panel { min-width: 0; }
.split-left { position: sticky; top: 16px; }
@media (max-width: 1280px) { .split { grid-template-columns: 1fr; } .split-left { position: static; } }

.domain-table th, .domain-table td { vertical-align: middle; }
.domain-row th a { color: var(--text); }
.domain-table th[scope="row"] { white-space: nowrap; }
.domain-table .row-actions { padding-right: 12px; }
.domain-row.is-selected > * { background: var(--blue-weak); }
.domain-row.is-selected th { box-shadow: inset 4px 0 0 var(--blue); }
/* While dragging applications, the domains are where they can go. */
.is-dragging .domain-row > * { outline: 1px dashed var(--line); outline-offset: -3px; }
.domain-row.is-drop-target > * { background: var(--ok-bg); }
.counts, .impacts { white-space: nowrap; }
.impacts { margin-top: 4px; }
.impacts .impact { font-size: 12px; line-height: 18px; padding: 0 6px; font-weight: 400; }
.count { display: inline-block; min-width: 24px; padding: 0 6px; border-radius: var(--radius-s); text-align: center; font-weight: 600; font-size: 13px; line-height: 20px; font-variant-numeric: tabular-nums; }
.row-actions { white-space: nowrap; }

.segmented { display: inline-flex; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented a { padding: 4px 12px; font-size: 14px; line-height: 20px; color: var(--text); }
.segmented a + a { border-left: 1px solid var(--line); }
.segmented a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.segmented a:hover { text-decoration: none; background: var(--hover-fill); }
.segmented a[aria-current="page"]:hover { background: var(--primary); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.filter-bar .field { min-width: 180px; flex: 1 1 180px; }
.filter-bar .check { height: 40px; white-space: nowrap; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-weak); position: sticky; top: 0; z-index: 1; }
.bulk-bar [data-selected-count] { min-width: 80px; }
.inline-field { display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; font-size: 14px; }
.inline-field select { height: 32px; max-width: 220px; }

.app-table td, .app-table th { vertical-align: middle; }
.app-table .tick { width: 40px; }
.app-table .tick input { width: 18px; height: 18px; accent-color: var(--primary); }
.app-table tr[draggable="true"] { cursor: grab; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.toggle button { border: 0; background: var(--surface); padding: 4px 12px; font: inherit; font-size: 14px; line-height: 20px; cursor: pointer; color: var(--text); }
.toggle button + button { border-left: 1px solid var(--line); }
.toggle button[value="up"][aria-pressed="true"] { background: var(--warn-bg); color: var(--warn-text); font-weight: 600; }
.toggle button[value="down"][aria-pressed="true"] { background: var(--err-bg); color: var(--err-text); font-weight: 600; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager > span { margin-right: auto; }
.plain-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.narrow-form { max-width: 720px; }
.danger-link { color: var(--err-text); }
.filter-bar .field-narrow { flex: 0 0 200px; min-width: 0; }
