/* Network Tools > HRA remediation (src/js/nt/hratracker.js) */

/* The page toggles many elements with hidden, several of which have their own
   display rule (.tiles is a grid, the filter rows and forms are flex/grid):
   hidden always wins inside this page. */
.nt-hratracker [hidden] { display: none !important; }

/* view switch: its own segmented control (the router resets .subtabs) */
.nt-hrt-bar { flex-wrap: wrap; gap: 10px; }
.nt-hrt-views { display: flex; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.nt-hrt-views a { color: var(--muted); text-decoration: none; padding: 5px 14px; border-radius: 6px; }
.nt-hrt-views a.active { background: var(--border); color: var(--text); }
.nt-hrt-bar-acts { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.nt-hrt-tiles { grid-template-columns: repeat(5, 1fr); }

/* filters: the roll-up row (kind pills, area, lead, search) and the item row */
.nt-hrt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 16px; }
.nt-hrt-filters .nt-pills { margin-bottom: 0; }
.nt-hrt-filters .nt-search { margin-left: 0; }
.nt-hrt-ifilters { margin-bottom: 12px; }
.nt-hrt-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.nt-hrt-items-head .btn-link { margin-left: auto; }

/* status: a mark beside the text, never colored text. One set for items,
   targets and roll-ups; applies to badges, chips, selects and timeline bars. */
.nt-hratracker .nt-hrt-st-done, .nt-hratracker .nt-hrt-st-resolved, .nt-hratracker .nt-hrt-st-validated { box-shadow: inset 3px 0 0 #2f9e6b; }
.nt-hratracker .nt-hrt-st-in_progress, .nt-hratracker .nt-hrt-st-active { box-shadow: inset 3px 0 0 var(--accent); }
.nt-hratracker .nt-hrt-st-blocked { box-shadow: inset 3px 0 0 var(--critical); }
.nt-hratracker .nt-hrt-st-accepted, .nt-hratracker .nt-hrt-st-paused { box-shadow: inset 3px 0 0 var(--warn); }
.nt-hratracker .nt-hrt-st-na, .nt-hratracker .nt-hrt-st-cancelled { border-style: dashed; }
.nt-hratracker .nt-hrt-tl-bar.nt-hrt-st-active { box-shadow: none; } /* the bar's fill is the same blue: an active mark would look like progress */
.nt-badge.nt-hrt-overdue { box-shadow: inset 3px 0 0 var(--critical); }
.nt-badge.nt-hrt-msp { margin-left: 6px; box-shadow: inset 3px 0 0 var(--warn); }
.nt-badge.nt-hrt-sev-text { color: var(--text); } /* gap, attested, no, flag: off the severity ramp */
.nt-hratracker span.nowrap { white-space: nowrap; } /* the dashboard's .nowrap is td-only */

/* chips: linked items (id + severity swatch) and covering roll-ups */
.nt-hrt-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.nt-hrt-chip { display: inline-flex; align-items: center; font: inherit; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.nt-hrt-chip .swatch { margin-right: 4px; }
.nt-hrt-chip.nt-hrt-done { box-shadow: inset 3px 0 0 #2f9e6b; }
.nt-hrt-camp-chip { cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.nt-hrt-camp-chip:hover { border-color: var(--accent); }
.nt-hrt-x { font: inherit; font-size: 13px; line-height: 1; color: var(--muted); background: none; border: 0; padding: 0 0 0 6px; cursor: pointer; }
.nt-hrt-x:hover { color: var(--text); }
.nt-hrt-addlink { padding: 0; font-size: 12px; }
.nt-hrt-linkpick { max-width: 260px; font-size: 12px; }

/* roll-up table and its opened detail */
.nt-hrt-campaigns > tbody > tr > td { vertical-align: top; }
.nt-hrt-chev { color: var(--muted); display: inline-block; width: 12px; }
.nt-hrt-campaigns .nt-hrt-nolead { white-space: nowrap; }
.nt-hrt-progcol { min-width: 140px; width: 16%; }
.nt-hrt-prog { display: flex; align-items: center; gap: 8px; }
.nt-hrt-prog .nt-progress { flex: 1; }
.nt-hrt-detail > td { background: var(--bg); padding: 0; }
.nt-hrt-detail-box { padding: 12px 14px 14px; }
.nt-hrt-summary { margin: 0 0 12px; max-width: 900px; line-height: 1.5; white-space: pre-line; }
.nt-hrt-camp-edit { display: grid; grid-template-columns: repeat(4, minmax(150px, 220px)); gap: 0 14px; }
.nt-hrt-targets td { vertical-align: top; }
.nt-hrt-tcenter { min-width: 130px; }
.nt-hrt-notecell { max-width: 280px; white-space: pre-line; }

/* inline edit controls (tables) */
.nt-hratracker td input, .nt-hratracker td select, .nt-hratracker td textarea,
.nt-hrt-filters input[type="search"] {
  font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; color-scheme: dark;
}
.nt-hrt-detail td input, .nt-hrt-detail td select, .nt-hrt-detail td textarea { background: var(--panel); }
.nt-hratracker input[type="date"] { color-scheme: dark; }
.nt-hrt-in-scope { width: 200px; min-height: 2.4em; resize: vertical; } /* two lines, so a whole scope reads while editing */
.nt-hrt-in-owner { width: 160px; }
.nt-hrt-in-note { width: 220px; min-height: 2.4em; resize: vertical; }
.nt-hrt-text { min-width: 240px; max-width: 460px; }
/* By center and All items: narrower owner and notes, and roll-up chips that
   wrap, so ID through Notes fit the 1280px page without scrolling. */
.nt-hrt-items .nt-hrt-in-owner { width: 120px; }
.nt-hrt-items .nt-hrt-in-note { width: 130px; }
.nt-hrt-items .nt-hrt-text { min-width: 180px; }
.nt-hrt-items .nt-hrt-chips { min-width: 150px; }
.nt-hrt-items .nt-hrt-camp-chip { white-space: normal; max-width: 170px; text-align: left; border-radius: 8px; padding: 2px 8px; overflow: visible; }
/* a save error repeated beside the control that failed */
.nt-hrt-inline-note { margin: 6px 0 0; padding: 4px 8px; font-size: 12px; max-width: 260px; }

/* add a target */
.nt-hrt-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.nt-hrt-add h3 { font-size: 14px; margin: 0 0 10px; }
.nt-hrt-add-open { padding: 0; margin-top: 10px; }
.nt-hrt-pick { margin-bottom: 12px; }
.nt-hrt-pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 6px; }
.nt-hrt-pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; background: var(--panel); }
.nt-hrt-pick-row { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: start; padding: 4px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.nt-hrt-pick-row:last-child { border-bottom: 0; }

/* by center */
.nt-hrt-center-head { flex-wrap: wrap; }
.nt-hrt-center-head select { max-width: 100%; }
.nt-hrt-ratings { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 10px; }
.nt-hrt-rating { min-width: 90px; }
.nt-hrt-items td { vertical-align: top; }

/* timeline: one bar per roll-up on a month axis (positions set from JS via CSSOM) */
.nt-hrt-tl { min-width: 0; }
.nt-hrt-tl-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 12px; align-items: stretch; }
.nt-hrt-tl-row[data-open] { cursor: pointer; border-radius: 4px; }
.nt-hrt-tl-row[data-open]:hover, .nt-hrt-tl-row[data-open]:focus { background: rgba(57, 135, 229, 0.08); outline: none; }
.nt-hrt-tl-row[data-open]:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.nt-hrt-tl-label { padding: 6px 0 6px 4px; min-width: 0; }
.nt-hrt-tl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-hrt-tl-track { position: relative; min-height: 44px; border-left: 1px solid var(--border); }
.nt-hrt-tl-axisrow .nt-hrt-tl-label { padding: 0; }
.nt-hrt-tl-axis { position: relative; height: 38px; border-bottom: 1px solid var(--border); }
.nt-hrt-tl-month { position: absolute; top: 2px; font-size: 11px; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--border); white-space: nowrap; }
.nt-hrt-tl-year { display: inline; }
.nt-hrt-tl-todaylabel { color: var(--text); border-left-color: var(--text); top: 20px; } /* under the month names, never over them */
.nt-hrt-tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--text); opacity: 0.6; z-index: 1; pointer-events: none; }
.nt-hrt-tl-bar { position: absolute; top: 14px; height: 14px; min-width: 4px; background: var(--border); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.nt-hrt-tl-fill { height: 100%; width: 0; background: var(--accent); }
/* overdue: a critical outline on the bar plus the badge beside it */
.nt-hrt-tl-bar.nt-hrt-tl-late { outline: 2px solid var(--critical); outline-offset: 1px; }
.nt-hrt-tl-flag { position: absolute; right: 4px; top: 12px; z-index: 2; background: var(--panel); }

@media (max-width: 1100px) {
  .nt-hrt-tiles { grid-template-columns: repeat(3, 1fr); }
  .nt-hrt-camp-edit { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

/* phone (a 390px frame): one column for tiles, forms and the timeline; wide
   tables scroll inside their .table-scroll */
@media (max-width: 700px) {
  .nt-hrt-tiles { grid-template-columns: repeat(2, 1fr); }
  .nt-hrt-bar-acts { margin-left: 0; }
  .nt-hrt-views a { padding: 5px 10px; }
  .nt-hrt-filters select, .nt-hrt-filters .nt-search { width: 100%; }
  .nt-hrt-camp-edit { grid-template-columns: 1fr; }
  /* An opened roll-up sits in a row of the wide roll-up table: pin its box to
     the visible width so the summary and fields read without scrolling, and
     its targets table scrolls inside its own .table-scroll. */
  .nt-hrt-detail-box { position: sticky; left: 0; width: calc(100vw - 56px); }
  .nt-hrt-tl-row { grid-template-columns: 1fr; gap: 0; }
  .nt-hrt-tl-year { display: none; } /* "Nov 2026" ran into "Dec" at phone width */
  /* the roll-up title was squeezed to one word a line */
  .nt-hrt-campaigns > tbody > tr > td:first-child { min-width: 220px; }
  .nt-hrt-progcol { min-width: 100px; }
  .nt-hrt-tl-axisrow .nt-hrt-tl-label { display: none; }
  .nt-hrt-tl-label { padding-bottom: 0; }
  .nt-hrt-tl-track { min-height: 34px; }
  .nt-hrt-tl-bar { top: 8px; }
  .nt-hrt-tl-flag { top: 6px; }
  .nt-hrt-pick-row { grid-template-columns: auto 1fr; }
  .nt-hrt-pick-row > span:last-child { grid-column: 2; }
  .nt-hratracker td input, .nt-hratracker td select, .nt-hratracker td textarea { font-size: 16px; }
}
