/* Defects page, History page and Alarm log (30 Oct navigation merge). Tokens only (assets/tokens.css). Extends app.css, pages-planner.css and pages-alarms.css. */

/* filter rows: the shared row first, then the page's own row */
.hub-filters{row-gap:var(--space-8);column-gap:var(--space-16)}
.hub-extra{row-gap:var(--space-8);column-gap:var(--space-16)}
.hub-extra > .lbl,.hub-extra .scope-g > .lbl{margin-right:var(--space-2)}
.page-acts .btn[disabled]{cursor:not-allowed}

/* the four leading columns of every defect table */
.tbl-hub td.hub-glc{width:var(--size-icon-md);padding-right:0}
.tbl-hub td.hub-idc{white-space:nowrap}
.hub-gl{display:inline-flex;align-items:center}

/* two short lines in one cell (belt and ground position; status and its change badge; toggle and its reason) */
.hub-two{display:inline-flex;flex-direction:column;gap:var(--space-2);vertical-align:middle}
.hub-two > span{white-space:nowrap}
.hub-two > .note{white-space:normal}

/* Defects: the repair buttons and the repair buttons stay pinned at the right edge while the middle columns scroll inside the table */
.hub-act{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-8)}
.hub-act > .sw-t{white-space:nowrap}
.hub-act-btns{display:flex;flex-direction:column;align-items:flex-end}
.fl-table td.hub-sticky,.fl-table th.hub-sticky{position:sticky;right:0;box-shadow:inset 1px 0 0 var(--border-subtle)}
.fl-table td.hub-sticky{background:var(--surface-raised);z-index:1}
.fl-table th.hub-sticky{z-index:2;text-align:right}
.fl-table tr.out-plan td.hub-sticky{background:var(--surface-sunken)}
.fl-table tr.click:hover td.hub-sticky{background:var(--surface-hover)}
.fl-table tr.sel td.hub-sticky{background:var(--interactive-selected)}
@media (max-width:45em){
  .fl-table td.hub-sticky{position:static;box-shadow:none}
  .hub-act{justify-content:flex-start;flex-wrap:wrap}
  .hub-act-btns{flex-direction:row;flex-wrap:wrap}
}

/* History: server pages of 50, "1–50 of 1,284" with Previous and Next */
.hub-pager{display:flex;align-items:center;justify-content:space-between;gap:var(--space-12);padding:var(--space-8) var(--space-12);border-top:var(--line)}
.hub-pager .btn[disabled]{cursor:not-allowed}

/* two short lines in a History cell: who, then why (the quiet line truncates, its title holds the whole reason) */
.hub-two > .hstack{column-gap:var(--space-8);flex-wrap:wrap}
.hub-two > .hub-why{max-width:calc(var(--layout-popover-width) * .8)}

/* the menu of the less common actions (Silence, False alarm) */
.menu.hub-menu{position:fixed;top:calc(var(--pop-y, 0) * var(--space-1));left:calc(var(--pop-x, 0) * var(--space-1));min-width:auto}
.hub-why{max-width:calc(var(--layout-popover-width) * .6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Now strip above the list: open by level, scheduled, awaiting camera check, health, and when it was true */
.hub-now{flex-wrap:wrap;align-items:stretch;margin-bottom:var(--space-12)}
.hub-now .hub-asof{margin-left:auto;align-self:center;white-space:nowrap}
.page-acts .hub-export{flex-wrap:wrap;column-gap:var(--space-8)}
.page-acts .hub-export > .lbl{color:var(--text-secondary)}

/* change badge: a level rise wears the new level's glyph and colour */
.chg{display:inline-flex;align-items:center;gap:var(--space-4);border:var(--size-border-width-thin) solid var(--border-strong);border-radius:var(--radius-badge);padding:0 var(--space-6);min-height:var(--size-icon-md);font:var(--font-label);color:var(--text-primary);background:var(--surface-raised);white-space:nowrap}
.chg.critical{color:var(--level-critical-text);border-color:var(--level-critical-text)}
.chg.major{color:var(--level-major-text);border-color:var(--level-major-text)}

@media (max-width:45em){
  .hub-now .hub-asof{margin-left:0;flex-basis:100%}
}
