/* ===== RF Sight — Technician Console (delta over /shared/base.css) ===== */
:root { --ok: #27ae60; --warn: #f39c12; --bad: #e74c3c; --info: #3498db; }

/* keep the header pinned at the top */
.topstick { position: sticky; top: 0; z-index: 40; }
/* "Viewing incident · Company" info shown inside the header while viewing one */
.view-info { color: rgba(255, 255, 255, .92); font-size: .88em; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-info[hidden] { display: none; }
.view-info #tbLabel { opacity: .85; font-weight: 500; }
.view-info #tbScenario { color: rgba(255, 255, 255, .78); font-weight: 500; }

/* views replace the admin console's single flex <main> */
.view { display: none; padding: 20px; max-width: 1400px; margin: 0 auto; }
.view.active { display: block; }
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.view-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.view-head h2 { font-size: 1.02em; color: var(--text); }

/* incident list — two panels side by side with a draggable splitter,
   stacked on narrow/phone screens (mirrors the admin console layout) */
#techList { display: flex; gap: 0; align-items: flex-start; }
#techList > .panel { flex: 1; min-width: 300px; }
@media (max-width: 820px) {
  #techList { flex-direction: column; align-items: stretch; gap: 14px; }
  #techList > .panel { min-width: 0; width: 100%; }
  #techList .mgmt-resizer { display: none; }
}

/* non-collapsible panel header */
.panel-head.static { cursor: default; }
.panel-head.static .count { margin-left: auto; }

/* god dashboard grid */
.incident-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.incident-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; cursor: pointer; transition: border-color .15s;
  display: flex; flex-direction: column; gap: 12px;
}
.incident-card:hover { border-color: var(--accent); }
.ic-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ic-company { font-size: 1.05em; font-weight: 600; }
.ic-scenario { color: var(--muted); font-size: .82em; margin-top: 2px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-size: .7em; font-weight: 700; letter-spacing: .5px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.ic-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ic-stat { background: var(--item); border-radius: 8px; padding: 8px; text-align: center; }
.ic-stat .v { font-size: 1.1em; font-weight: 700; font-variant-numeric: tabular-nums; }
.ic-stat .l { color: var(--muted); font-size: .66em; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.ic-stat.warn .v { color: var(--warn); }
.ic-stat.bad .v { color: var(--bad); }
.ic-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .76em; }
.empty-ico { font-size: 3em; opacity: 1; }
.empty p { margin: 6px 0; }

/* detail head */
.detail-title h1 { font-size: 1.3em; }
.detail-title .scenario-name { color: var(--muted); font-size: .85em; }
.detail-meta { margin-left: auto; display: flex; gap: 22px; }
.meta-cell { display: flex; flex-direction: column; text-align: right; }
.meta-cell .meta-lbl { color: var(--muted); font-size: .68em; text-transform: uppercase; letter-spacing: .5px; }
.meta-cell strong { font-size: 1em; font-variant-numeric: tabular-nums; }

/* KPI strip */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.kpi .k-val { font-size: 1.5em; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k-lbl { color: var(--muted); font-size: .7em; text-transform: uppercase; letter-spacing: .5px; }
.kpi.ok .k-val { color: var(--ok); }
.kpi.warn .k-val { color: var(--warn); }
.kpi.bad .k-val { color: var(--bad); }
.kpi.info .k-val { color: var(--info); }

/* detection-config grid */
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.config-cell { background: var(--item); border-radius: 10px; padding: 10px 12px; }
.config-cell .cv { font-size: 1.05em; font-weight: 700; font-variant-numeric: tabular-nums; }
.config-cell .cl { color: var(--muted); font-size: .72em; margin-top: 2px; }

/* telemetry table */
.table-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.table-tools .list-search { min-width: 180px; }
.chk { color: var(--muted); font-size: .82em; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.tele-table { width: 100%; border-collapse: collapse; font-size: .84em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tele-table th { background: var(--item); color: var(--muted); text-align: right; font-weight: 600; padding: 9px 10px; position: sticky; top: 0; font-size: .82em; text-transform: uppercase; letter-spacing: .3px; cursor: help; }
.tele-table th:first-child, .tele-table td:first-child { text-align: left; }
.tele-table td { padding: 8px 10px; text-align: right; border-top: 1px solid var(--border); }
.tele-table td.txt { text-align: left; }
.tele-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.tele-table tr.row-alert { background: rgba(231, 76, 60, .09); }
.tele-table tr.row-stale td { color: var(--muted); }
.u-name { font-weight: 600; }
.fix { padding: 1px 6px; border-radius: 4px; font-size: .8em; font-weight: 700; }
.fix.geo { color: var(--ok); border: 1px solid var(--ok); }
.fix.rel { color: var(--warn); border: 1px solid var(--warn); }
.bat-cell { display: inline-flex; align-items: center; gap: 5px; }
.bat-bar { width: 34px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; display: inline-block; }
.bat-bar > i { display: block; height: 100%; background: var(--ok); }
.bat-bar.warn > i { background: var(--warn); }
.bat-bar.bad > i { background: var(--bad); }
.badge { padding: 1px 8px; border-radius: 999px; font-size: .76em; font-weight: 700; }
.badge.distress { background: var(--bad); color: #fff; }
.badge.nomotion { background: var(--warn); color: #1b2430; }
.badge.lowbat { background: #b9770e; color: #fff; }
.badge.lostsignal { background: #555; color: #fff; }
.dash { color: var(--muted); }

@media (max-width: 820px) {
  .view { padding: 14px; }
  .detail-meta { gap: 14px; }
}

/* event log (real-time + saved) */
.log-list { display: flex; flex-direction: column; gap: 4px; }
.log-row {
  display: flex; align-items: center; gap: 10px; background: var(--item);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: .86em;
}
.log-row .log-t { color: var(--info); font-family: ui-monospace, Consolas, monospace; font-size: .92em; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.log-row .log-body { flex: 1; min-width: 0; color: var(--text); display: flex; align-items: center; gap: 8px; }
.log-row.alert { border-inline-start: 3px solid var(--bad); background: rgba(231, 76, 60, .1); }
.ev-clear { color: var(--muted); font-size: .82em; }

/* saved incidents list */
.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-row {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s;
}
.saved-row:hover { border-color: var(--accent); }
.saved-row .sv-main { flex: 1; min-width: 0; }
.saved-row .sv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-row .sv-sub { color: var(--muted); font-size: .8em; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-row .sv-meta { color: var(--muted); font-size: .82em; font-variant-numeric: tabular-nums; flex-shrink: 0; }
