/*
 * Gate portal: page pieces shared by the core and several pages (device record, remote PowerShell window, lookups).
 * Shared components live in kit/kit.css; values come from kit/tokens.css. No override layer: the old console bridge
 * (.cx-legacy) and the KPI/figure tiles were removed with the redesign.
 */

/* ---- top bar extras */
.cx-search-toggle { display: none; }
.cx-search-results .cx-pop-item .cx-chip { font-size: var(--t-12); }
.cx-pop-filter { margin: var(--s-2) var(--s-3); min-width: 0; }
.cx-pop-filter input { height: 32px; }

/* ---- remote searchable selector (core lookupField) */
.cx-lookup-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-height: 22px; font-size: var(--t-13); }
.cx-lookup-chosen strong { color: var(--c-ink); font-weight: 600; }
.cx-lookup-list { margin: 0; padding: var(--s-1) 0; list-style: none; max-height: 240px; overflow: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); box-shadow: var(--e-2); }
.cx-lookup-list li { display: grid; padding: 6px var(--s-3); cursor: pointer; }
.cx-lookup-list li.cx-faint { cursor: default; }
.cx-lookup-list li[role=option]:hover, .cx-lookup-list li[role=option]:focus { background: var(--c-accent-soft); outline: none; }
.cx-lookup-list small { color: var(--c-text-3); font-size: var(--t-13); }

/* ---- device record */
.cx-device-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: var(--s-4); align-items: start; }
.cx-device-cols > div { display: grid; gap: var(--s-4); min-width: 0; align-content: start; }
.cx-device-tab { min-width: 0; }
.cx-resource { display: grid; gap: 6px; }
.cx-resource .cx-meter { min-width: 0; }
.cx-resources { margin: 0; }
.cx-resources .cx-meter { min-width: 0; }
.cx-drawer-body .cx-alert, .cx-drawer-body .cx-panel { margin-bottom: var(--s-3); }
.cx-drawer-foot-link { display: flex; justify-content: flex-end; }
.cx-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-subhead { margin-bottom: var(--s-3); }
.cx-subhead h2 { font-size: var(--t-16); }

/* ---- remote PowerShell window (ticket page): a dark terminal is the one deliberate dark surface in the content area */
.cx-terminal-backdrop { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: var(--s-4); background: rgba(10, 20, 38, .45); }
.cx-terminal { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; width: min(960px, 100%); height: min(640px, 100%); border: 1px solid var(--c-navy-700); border-radius: var(--r-lg); background: var(--c-navy-950); color: var(--c-on-dark-2); box-shadow: var(--e-3); overflow: hidden; }
.cx-terminal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-navy-800); }
.cx-terminal-head strong { display: block; color: var(--c-on-dark); font-size: var(--t-14); }
.cx-terminal-head small { display: block; color: var(--c-on-dark-2); font-size: var(--t-13); }
.cx-terminal-head .cx-iconbtn { color: var(--c-on-dark-2); }
.cx-terminal-head .cx-iconbtn:hover { background: var(--c-navy-800); color: var(--c-on-dark); }
.cx-terminal-status { padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--c-navy-800); color: var(--c-on-dark-2); font-size: var(--t-13); }
.cx-terminal-output { margin: 0; padding: var(--s-3) var(--s-4); overflow: auto; color: var(--c-on-dark); font: var(--t-13)/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-terminal-input { display: flex; gap: var(--s-2); padding: var(--s-3); border-top: 1px solid var(--c-navy-800); }
.cx-terminal-input input { flex: 1; min-width: 0; height: 34px; padding: 0 var(--s-3); border: 1px solid var(--c-navy-700); border-radius: var(--r-md); background: var(--c-navy-900); color: var(--c-on-dark); font: var(--t-13) var(--f-mono); }
.cx-terminal-foot { padding: var(--s-2) var(--s-4) var(--s-3); color: var(--c-on-dark-2); font-size: var(--t-13); }

/* Native remote desktop viewer (console/remote-desktop.js) */
.cx-rd-backdrop { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: var(--s-3); background: rgba(10, 20, 38, .55); }
.cx-rd { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; width: 100%; height: 100%; max-width: 1800px; border: 1px solid var(--c-navy-700); border-radius: var(--r-lg); background: var(--c-navy-950); color: var(--c-on-dark-2); box-shadow: var(--e-3); overflow: hidden; }
.cx-rd-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-navy-800); }
.cx-rd-title { flex: 1 1 240px; min-width: 0; }
.cx-rd-title strong { display: block; color: var(--c-on-dark); font-size: var(--t-14); }
.cx-rd-title small { display: block; color: var(--c-on-dark-2); font-size: var(--t-13); }
.cx-rd-badges { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cx-rd-badge { padding: 2px 8px; border: 1px solid var(--c-navy-700); border-radius: 999px; font-size: var(--t-12, 12px); color: var(--c-on-dark-2); }
.cx-rd-badge.is-warn, .cx-rd-timer.is-warn { border-color: #b7791f; color: #f6c26b; }
.cx-rd-timer { font-size: var(--t-13); color: var(--c-on-dark-2); }
.cx-rd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--c-navy-800); }
.cx-rd-select { height: 30px; padding: 0 var(--s-2); border: 1px solid var(--c-navy-700); border-radius: var(--r-md); background: var(--c-navy-900); color: var(--c-on-dark); font-size: var(--t-13); }
.cx-rd-status { padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--c-navy-800); color: var(--c-on-dark-2); font-size: var(--t-13); }
.cx-rd-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; background: #05080f; }
.cx-rd-canvas { display: block; max-width: 100%; max-height: 100%; image-rendering: auto; cursor: none; outline: none; background: #000; }
.cx-rd-canvas:focus-visible { box-shadow: 0 0 0 2px var(--c-teal-500, #2bb3a3); }
.cx-rd-cursor { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #000; pointer-events: none; }
.cx-rd-foot { padding: var(--s-2) var(--s-4) var(--s-3); color: var(--c-on-dark-2); font-size: var(--t-13); }

@media (max-width: 1100px) { .cx-device-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .cx-search-toggle { display: inline-flex; }
  .cx-top-search.is-open ~ .cx-search-toggle { display: none; }
}

/* ---- technician cockpit (pages/cockpit.js): all-clients health table, My queue, the "Your company" band */
.cx-mb { margin-bottom: var(--s-3); }
.cx-text-warn { color: var(--c-warn); font-weight: 600; }
.cx-right-stack { justify-items: end; text-align: right; }
.cx-table .cx-right-stack { min-width: 128px; }
.cx-right-stack .cx-cell-sub { white-space: nowrap; }
.cx-cockpit { min-width: 0; }
.cx-cockpit .cx-section-band { margin-bottom: var(--s-3); }
.cx-cockpit-note { margin-top: var(--s-2); color: var(--c-text-3); font-size: var(--t-13); }
.cx-icon-tile { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-md); background: var(--c-accent-soft); color: var(--c-accent); flex: none; }
.cx-section-band { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); margin-bottom: var(--s-4); padding: var(--s-3) var(--s-4); border: 1px solid var(--c-band-line, #e6ebf4); border-radius: var(--r-lg); background: linear-gradient(180deg, #f9fbff, var(--c-band, #f6f8fc)); }
.cx-section-band h2 { font-size: var(--t-16); }
.cx-section-band .cx-panel-sub { flex: 1 1 260px; color: var(--c-text-2); font-size: var(--t-13); }
.cx-wrap-text { white-space: normal; max-width: 420px; }
@media (max-width: 600px) {
  .cx-cockpit-queue .cx-tasklist > li { flex-wrap: wrap; row-gap: var(--s-1); }
  .cx-cockpit-queue .cx-tasklist > li > .cx-task-main { flex-basis: 100%; }
}
