/* Data table: sticky header, density, grouping, selection. */
.table-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.table-root--sparse {
  flex: 0 1 auto;
}

.table-scroll,
.device-table-scroll {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  max-width: 100%;
  background: var(--surface);
}
.table-scroll--adaptive,
.device-table-scroll.table-scroll--adaptive {
  /* Contained horizontal scroll only — the viewport budget keeps the default
     column set within the visible width, but this is a safety net (e.g. a
     user manually adding many extra columns) so the *page* never overflows. */
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  background: var(--surface);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Fleet device list — only this element scrolls vertically on desktop/tablet */
.device-list-region .device-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
}

.device-list-region .device-table-scroll::-webkit-scrollbar {
  width: 8px;
}
.device-list-region .device-table-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
.device-list-region .device-table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
.device-list-region .device-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Continuous list — temporary load indicator only (no permanent end footer) */
.table-end {
  flex: none;
  border-top: none;
}
.table-end[hidden] {
  display: none !important;
}
.table-end__inner {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.table-end__inner--error {
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Sparse lists grow with content; overflowing lists fill remaining viewport via flex */
.table-root--sparse {
  flex: none !important;
}
.table-root--sparse .table-scroll {
  flex: none;
  overflow: visible;
  max-height: none;
}
.table-root--scrollable {
  flex: 1 1 auto;
  min-height: 0;
}
.table-root--scrollable .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.pagination-root {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-13);
}
.data-table--adaptive {
  table-layout: fixed;
  width: 100%;
}
.data-table--adaptive tbody td {
  max-width: none;
  height: auto;
  min-height: var(--row-h);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  box-sizing: border-box;
  padding-top: var(--cell-py);
  padding-bottom: var(--cell-py);
}
.data-table--adaptive .col-actions {
  width: 56px;
  max-width: 56px;
}
.data-table.data-table--adaptive thead th.col-check,
.data-table.data-table--adaptive tbody td.col-check {
  width: 38px !important;
  max-width: 38px !important;
  min-width: 38px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center;
  box-sizing: border-box;
}
.data-table.data-table--adaptive thead th.col-check input,
.data-table.data-table--adaptive tbody td.col-check input {
  margin: 0;
  vertical-align: middle;
}
.data-table--adaptive tbody td.col-check,
.data-table--adaptive thead th.col-check {
  vertical-align: middle;
}
.data-table--adaptive tbody td.col-actions .row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-height: 100%;
}
/*
 * Single source of truth for horizontal cell padding — identical for thead th
 * and tbody td, on every data column, with no per-column exceptions. This
 * selector is intentionally placed after the generic `.data-table thead th`
 * rule (and matched in specificity) so it always wins for the adaptive table.
 */
.data-table.data-table--adaptive thead th,
.data-table--adaptive tbody td {
  padding-left: var(--cell-px, 10px);
  padding-right: var(--cell-px, 10px);
}
.data-table.data-table--adaptive thead th.col-actions,
.data-table.data-table--adaptive tbody td.col-actions {
  padding-left: 2px !important;
  padding-right: 4px !important;
}
[data-density="compact"] .data-table--adaptive {
  --cell-px: 8px;
}
[data-density="comfortable"] .data-table--adaptive {
  --cell-px: 12px;
}

/* Device column — content-width, no status gutter; uses .table-cell-stack directly */
.device-cell {
  width: 100%;
}
.device-cell.table-cell-stack {
  overflow: visible;
}
/* Extra breathing room so wrapped names never crowd the next column. */
.data-table tbody td.col-device,
.data-table thead th.col-device {
  padding-right: 20px;
}
.data-table tbody td.col-device {
  overflow: visible;
  white-space: normal;
}
.device-cell__sep {
  color: var(--text-muted);
  font-weight: 600;
}
.device-cell__hardware {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-cell__update {
  font-size: 11px;
  font-weight: 600;
  color: var(--warn-text);
}
.device-cell__battery {
  white-space: nowrap;
  flex: none;
  line-height: 1.25;
}
.device-cell__battery .device-battery {
  font-size: 11px;
}

.data-table--adaptive {
  --row-h: 88px;
  --cell-py: 17px;
  --cell-stack-gap: 6px;
}
[data-density="compact"] .data-table--adaptive {
  --row-h: 68px;
  --cell-py: 11px;
  --cell-stack-gap: 4px;
}
[data-density="comfortable"] .data-table--adaptive {
  --row-h: 104px;
  --cell-py: 19px;
  --cell-stack-gap: 7px;
}

.data-table--adaptive tbody td {
  height: auto;
  min-height: var(--row-h);
}

.data-table.data-table--adaptive thead th {
  padding-top: 0;
  padding-bottom: 0;
  height: 44px;
  font-size: 10px;
  letter-spacing: 0.05em;
}

/*
 * Header label wrapper — keeps label aligned with body cell content.
 */
.th-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 100%;
}
.column-sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-user-drag: none;
  user-select: none;
}
.column-sort:disabled { cursor: default; }
.column-sort:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.th-status-mark {
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
}

/*
 * Shared cell structural component — every composite (two-line) cell in the
 * Devices table uses this, and every single-line cell is wrapped in it too,
 * so vertical alignment is identical across every column and row.
 */
.table-cell-stack {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--cell-stack-gap, 4px);
  min-height: 100%;
  overflow: hidden;
}
.table-cell-primary {
  display: block;
  max-width: 100%;
  line-height: 1.3;
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--text);
}
.table-cell-secondary {
  display: block;
  max-width: 100%;
  line-height: 1.25;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.table-cell-stack .table-cell-primary,
.table-cell-stack .table-cell-secondary {
  width: 100%;
}
/* Lower-emphasis single-line values (Last seen, Owner, App version, Device ID) */
.table-cell-primary--regular {
  font-weight: 500;
  color: var(--text);
}
.table-cell-secondary.expiry--warn { color: var(--warn-text); font-weight: 700; }
.table-cell-secondary.expiry--danger { color: var(--danger); font-weight: 700; }

/* Current IP — never abbreviate on desktop; column is sized to fit IPv4 + actions. */
.ip-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: none;
  min-width: 0;
  height: 100%;
  white-space: nowrap;
  overflow: visible;
}
.ip-cell.table-cell-stack {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  overflow: visible;
}
.ip-cell__addr {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: left;
  flex: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.data-table--adaptive tbody td.col-currentIp,
.data-table.data-table--adaptive thead th.col-currentIp {
  width: 252px;
  min-width: 252px;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.data-table--adaptive tbody td.col-currentIp {
  white-space: nowrap;
}
.data-table--adaptive col[data-col="currentIp"] {
  width: 252px;
  min-width: 252px;
}
.ip-cell__actions {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.ip-cell__btn {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--icon-muted);
  transition: color 0.12s ease;
}
.ip-cell__btn .icon { width: 14px; height: 14px; }
tr:hover .ip-cell__btn {
  color: var(--icon-secondary);
}
.ip-cell__btn:hover { color: var(--blue); }
.ip-cell__btn:disabled { color: var(--text-disabled); cursor: not-allowed; }
.ip-cell__feedback {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 4px;
}
.ip-cell__feedback--ok { color: var(--ok); }
.ip-cell__feedback--ok .icon { width: 14px; height: 14px; }
.ip-cell__feedback--err { color: var(--danger); white-space: normal; }
.ip-cell__retry {
  border: none;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 0 0 4px;
}

.device-battery {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
}
.device-battery-gauge {
  display: inline-flex;
  align-items: center;
  flex: none;
  color: inherit;
}
.device-battery-gauge__shell {
  position: relative;
  width: 22px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--surface);
}
.device-battery-gauge__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: currentColor;
  border-radius: 1px;
  min-width: 0;
}
.device-battery-gauge__cap {
  width: 2px;
  height: 5px;
  margin-left: 1px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
  flex: none;
}
.device-battery__bolt {
  display: inline-flex;
  align-items: center;
  flex: none;
  margin-left: 1px;
  color: var(--blue);
}
.device-battery__bolt .icon {
  width: 11px;
  height: 11px;
}
.device-battery--charging .device-battery-gauge__shell {
  border-color: color-mix(in srgb, currentColor 55%, var(--blue) 45%);
}
.device-battery__pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.device-battery--ok { color: var(--ok); }
.device-battery--warn { color: var(--warn-text); }
.device-battery--danger { color: var(--danger); }

/* Network — two lines: type (+ Wi-Fi Boost) on top, carrier below */
.network-cell .table-cell-primary {
  font-size: 12.5px;
}
.network-cell .net-wifi-icon {
  display: inline-flex;
  vertical-align: -2px;
  margin-left: 3px;
  color: var(--text-muted);
}
.network-cell .net-wifi-icon .icon { width: 12px; height: 12px; }

.lifecycle-plan { font-weight: 600; font-size: var(--fs-13); }
/* Numeric expiry — small and tabular, never louder than the plan name. */
.lifecycle-expiry {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.table-cell-secondary.lifecycle-expiry.expiry--warn,
.table-cell-secondary.lifecycle-expiry.expiry--danger {
  font-weight: 600;
}
/* Time drops to its own line so the column only has to fit the date. */
.lifecycle-cell .lifecycle-expiry {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}
.lifecycle-cell .lifecycle-expiry__time {
  font-weight: 500;
}

.usage-cell__ports {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.usage-cell .ports-cell__link { text-align: left; }
.usage-cell .ports-cell__add {
  flex: none;
}

/* Collapsible row details — hidden by default; rendered only when user expands */
.row-details {
  display: none;
}
.row-details.is-expanded {
  display: table-row;
}
.row-details.is-expanded td {
  padding: 6px var(--cell-px, 10px) 8px calc(38px + var(--cell-px, 10px)) !important;
  height: auto !important;
  min-height: 0 !important;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--border-soft);
}
tr.is-selected + .row-details.is-expanded td,
.row-details.is-expanded.is-selected td {
  background: var(--selected);
}
tr.is-details-expanded.is-selected + .row-details.is-expanded td {
  background: var(--selected);
}
tr.is-selected + .row-details.is-expanded:hover td,
.row-details.is-expanded.is-selected:hover td,
tr.is-details-expanded:hover + .row-details.is-expanded td {
  background: var(--blue-soft-2);
}
tr:hover + .row-details.is-expanded td,
.row-details.is-expanded:hover td {
  background: var(--hover);
}
.row-details__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 20px;
  padding: 2px 0;
}
.row-details__block {
  min-width: 0;
}
.row-details__block-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  line-height: 1.2;
}
.row-details__block-value {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}
.row-details__hint {
  color: var(--blue);
  font-weight: 700;
}
.row-details-toggle .icon {
  width: 14px;
  height: 14px;
}
.row-details-toggle.is-expanded {
  color: var(--blue);
}
.column-customizer__badge--details {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
}

/* Owner allows controlled wrapping to a 2nd line only when a name truly doesn't fit */
.table-cell-primary--wrap {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.25;
}

/* Columns panel — same Monday layout language as Filters */
.popover.filter-panel.popover--columns {
  width: min(640px, calc(100vw - 32px));
  max-width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
}

.popover--columns .filter-panel__columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.popover--columns .column-panel__title-spacer {
  visibility: hidden;
  user-select: none;
}

.bottom-sheet--columns .filter-panel__head-row {
  justify-content: flex-start;
}

.bottom-sheet--columns .filter-panel__body {
  max-height: none;
}

@media (max-width: 960px) {
  .popover.filter-panel.popover--columns {
    width: min(520px, calc(100vw - 24px));
    max-width: min(520px, calc(100vw - 24px));
  }

  .popover--columns .filter-panel__columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .popover.filter-panel.popover--columns {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .popover--columns .filter-panel__columns {
    grid-template-columns: 1fr;
  }

  .popover--columns .column-panel__title-spacer {
    display: none;
  }
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border-soft);
  padding: 0 10px;
  height: 38px;
  text-align: left;
  font-size: var(--fs-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}
.data-table thead th.is-sortable { cursor: pointer; }
.data-table thead th.is-sortable:hover { color: var(--text-secondary); }
.data-table thead th .sort-icon { width: 12px; height: 12px; margin-left: 3px; vertical-align: -2px; color: var(--icon-muted); }
.data-table thead th.is-sorted .sort-icon { color: var(--blue); }

.data-table tbody tr { transition: background 0.08s; }
.data-table tbody tr:hover { background: var(--hover); }
.data-table tbody tr.is-selected { background: var(--selected); }
.data-table tbody tr.is-selected:hover { background: var(--blue-soft-2); }
.data-table tbody tr.is-flash { animation: row-flash 0.6s ease; }
@keyframes row-flash { 50% { background: var(--blue-soft-2); } }
@media (prefers-reduced-motion: reduce) { .data-table tbody tr.is-flash { animation: none; } }

.data-table tbody td {
  padding: var(--cell-py) 10px;
  height: var(--row-h);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  max-width: 220px;
}
.data-table tbody td.col-check,
.data-table thead th.col-check {
  width: 38px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  background: var(--surface);
}
.data-table thead th.col-check {
  background: var(--surface-2);
}
.data-table--adaptive tbody td.col-check,
.data-table--adaptive thead th.col-check {
  /* Checkbox column scrolls with the table — never pinned horizontally */
  width: 38px !important;
  max-width: 38px !important;
  min-width: 38px !important;
  position: static !important;
  left: auto !important;
  box-shadow: none !important;
}
.data-table tbody td.col-check input[type="checkbox"],
.data-table thead th.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
  accent-color: var(--blue);
}
.data-table tbody tr.is-selected td.col-check { background: var(--selected); }
.data-table tbody tr:hover td.col-check { background: var(--hover); }
.data-table tbody tr.is-selected:hover td.col-check { background: var(--blue-soft-2); }

/* Header-less health rail — only wide enough for one severity icon. */
.data-table tbody td.col-rail,
.data-table thead th.col-rail {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
}
.data-table--adaptive tbody td.col-rail,
.data-table--adaptive thead th.col-rail {
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  position: static !important;
  left: auto !important;
  box-shadow: none !important;
}
/* Sits on the device name line, not the middle of the row. */
.data-table tbody td.col-rail {
  vertical-align: top;
  padding-top: var(--cell-py);
}
.data-table td.col-rail .issue-badge {
  /* Block-level so the cell baseline cannot nudge the icon off the name line. */
  display: flex;
  width: 16px;
  height: 17px;
  margin: 0 auto;
  border-radius: 3px;
  opacity: 0.9;
}
.data-table td.col-rail .issue-badge .icon {
  width: 12px;
  height: 12px;
}
.data-table td.col-rail .issue-badge:hover,
.data-table td.col-rail .issue-badge[aria-expanded="true"] {
  opacity: 1;
  background: transparent;
}

.data-table tbody td.col-sticky,
.data-table thead th.col-sticky {
  position: sticky;
  left: 36px;
  z-index: 1;
  background: var(--surface);
  box-shadow: 2px 0 4px rgba(15,23,42,0.04);
}
.data-table thead th.col-sticky { z-index: 3; background: var(--surface-2); }
.data-table tbody tr.is-selected td.col-sticky { background: var(--selected); }
.data-table tbody tr:hover td.col-sticky { background: var(--hover); }

.data-table tbody td.col-actions,
.data-table thead th.col-actions {
  width: 48px;
  max-width: 48px;
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -2px 0 4px rgba(15,23,42,0.04);
  white-space: nowrap;
  padding-left: 2px;
  padding-right: 4px;
}
.data-table tbody td.col-actions .row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.data-table thead th.col-actions { z-index: 3; background: var(--surface-2); }
.data-table tbody tr.is-selected td.col-actions { background: var(--selected); }
.data-table tbody tr:hover td.col-actions { background: var(--hover); }

.data-table tbody tr[data-clickable] { cursor: pointer; }

.group-row td {
  position: sticky;
  left: 0;
  background: var(--surface-2) !important;
  font-weight: 700;
  font-size: var(--fs-12);
  color: var(--text-secondary);
  height: 36px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid var(--border);
}
.group-row__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  font-weight: inherit;
  padding: 0;
}
.group-row__toggle .icon { width: 14px; height: 14px; }
.group-row__count { color: var(--text-muted); font-weight: 600; }

.cell2 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.cell2__primary { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.cell__sub { font-size: var(--fs-12); color: var(--text-muted); font-weight: 500; }
.cell__id { font-size: 11px; color: var(--text-secondary); font-weight: 500; font-family: var(--mono); font-variant-numeric: tabular-nums; }
[data-density="compact"] .cell__sub--compact-hide { display: none; }
.skeleton-row td { pointer-events: none; }

.expiry--warn { color: var(--warn-text); font-weight: 700; }
.expiry--danger { color: var(--danger); font-weight: 700; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  flex-wrap: wrap;
}
.table-footer__info { font-size: var(--fs-13); color: var(--text-secondary); font-weight: 600; }

.pagination { display: flex; align-items: center; gap: 4px; }
.pagination__btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-13);
  font-weight: 700;
  color: var(--text-secondary);
}
.pagination__btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.pagination__btn:disabled { color: var(--text-disabled); border-color: var(--border-soft); cursor: not-allowed; }
.pagination__btn.is-active { background: var(--blue-soft); border-color: var(--blue-border); color: var(--blue); }
.pagination__ellipsis { padding: 0 4px; color: var(--text-muted); }
.pagination__size {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-13);
  font-weight: 600;
  margin-left: 8px;
}

/* Legacy bottom bulk bar — no longer used by Fleet */
.bulk-bar { display: none !important; }
.bulk-root { display: none !important; height: 0 !important; overflow: hidden !important; }
.bulk-bar__clear {
  border: none; background: transparent;
  color: var(--blue); font-weight: 700; font-size: var(--fs-13);
  text-decoration: underline;
}

/* Selection action bar — replaces quick filters in the control deck slot */
.selection-bar-root {
  flex: none;
  position: relative;
  z-index: 5;
  background: transparent;
}
.selection-bar-root[hidden] {
  display: none !important;
}
.selection-bar {
  background: var(--blue-soft);
  border: 1px solid var(--blue-border-soft);
  border-radius: var(--radius-sm);
  min-height: 40px;
  height: auto;
}
.selection-bar__main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  height: auto;
  padding: 5px 6px 5px 10px;
  flex-wrap: wrap;
}
.selection-bar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: none;
}
.selection-bar__check {
  display: inline-flex;
  flex: none;
}
.selection-bar__check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--blue);
  color: var(--text-on-blue, #fff);
}
.selection-bar__check-box .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}
.selection-bar__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex: none;
}
.selection-bar__match {
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.selection-bar__match[disabled] {
  text-decoration: none;
  color: var(--text-secondary);
  cursor: default;
}
.selection-bar__spacer { flex: 1 1 auto; min-width: 8px; }
.selection-bar__job {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  flex: none;
}
.selection-bar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.selection-bar__actions::-webkit-scrollbar { display: none; }
.selection-bar__action,
.selection-bar__more {
  height: 28px;
  padding: 0 10px;
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
}
.selection-bar__action:hover,
.selection-bar__more:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}
.selection-bar__action .icon,
.selection-bar__more .icon {
  width: 14px;
  height: 14px;
}
.selection-bar__dismiss {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  flex: none;
}
.selection-bar__dismiss:hover {
  color: var(--text);
  background: var(--hover);
}
.selection-bar__dismiss .icon {
  width: 16px;
  height: 16px;
}

.rename-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
  max-height: 140px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}
textarea.form-input {
  height: auto;
  min-height: 120px;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
}

@media (max-width: 1280px) {
  .data-table .col-p3 { display: none; }
}
.data-table--adaptive { font-size: 14px; }
[data-density="comfortable"] .data-table--adaptive { --row-h: 88px; --cell-py: 13px; --cell-stack-gap: 5px; }
[data-density="compact"] .data-table--adaptive { --row-h: 68px; --cell-py: 9px; --cell-stack-gap: 4px; }
.data-table--adaptive .table-cell-primary { font-size: 14px; }
.data-table--adaptive .table-cell-secondary, .data-table--adaptive .device-cell__hardware { font-size: 12px; }
.data-table--adaptive .ip-cell__addr { font-size: 13px; }
.fleet-expired-label { display: block; font-size: 12px; font-weight: 600; color: var(--danger); }
[data-theme="dark"] .data-table--adaptive tr[data-plan-expired="true"] > td { background: color-mix(in srgb, #ef7c86 4%, var(--surface)); }
[data-theme="dark"] .data-table--adaptive tr[data-plan-expired="true"] > td:first-child { box-shadow: inset 2px 0 #ef7c86; }
[data-theme="dark"] .data-table--adaptive tr[data-plan-expired="true"]:hover > td { background: color-mix(in srgb, #ef7c86 7%, var(--surface)); }
[data-theme="dark"] .data-table--adaptive tr[data-plan-expired="true"].is-selected > td { background: var(--selected); }
.data-table.data-table--adaptive th.col-device,
.data-table.data-table--adaptive td.col-device { width: 300px; min-width: 300px; }
.data-table.data-table--adaptive th.col-currentIp,
.data-table.data-table--adaptive td.col-currentIp,
.data-table.data-table--adaptive col[data-col="currentIp"] { width: 220px; min-width: 220px; }
.data-table--adaptive .device-name-link { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; width: 100%; font-size: 14px; line-height: 1.4; }
.data-table--adaptive .device-cell__hardware { white-space: normal; overflow: visible; line-height: 1.4; }
.data-table--adaptive .device-cell__description { font-size: 12px; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.data-table.data-table--adaptive .table-cell-primary { font-weight: 400; }
.data-table.data-table--adaptive .device-name-link { font-weight: 600; }
.data-table.data-table--adaptive .table-cell-secondary { font-weight: 400; }
.data-table.data-table--adaptive td.col-traffic .table-cell-primary { font-size: 13px; font-family: inherit; font-weight: 400; font-variant-numeric: tabular-nums; }
.data-table.data-table--adaptive .ip-cell__addr { font-weight: 400; }
.data-table.data-table--adaptive .network-cell .table-cell-primary,
.data-table.data-table--adaptive .network-cell .table-cell-secondary { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; max-width: none; line-height: 1.45; font-size: 13px; font-weight: 400; }
[data-theme="dark"] .data-table--adaptive .expiry--danger { color: var(--text-secondary); font-weight: 400; }
[data-theme="dark"] .data-table--adaptive .fleet-expired-label { color: var(--danger-text); font-weight: 600; }
.data-table--adaptive .usage-cell__ports { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.data-table--adaptive .ports-cell__link {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.data-table--adaptive .ports-cell { align-items: flex-start; gap: 3px; }
.data-table--adaptive .ports-cell__add { flex-shrink: 0; padding: 2px; }
.data-table--adaptive td.col-threads { text-align: center; }
.data-table--adaptive td.col-threads .table-cell-stack { align-items: center; }
.data-table--adaptive th.col-threads .th-inner,
.data-table--adaptive th.col-threads .column-sort { justify-content: center; width: 100%; }
.fleet-list-selection-tools { display: flex; justify-content: flex-end; padding: 4px 8px 8px; }
.fleet-selectable-list:not(.is-selection-mode) .col-check { display: none; }
.data-table--adaptive .device-cell { position: relative; }
.data-table--adaptive .device-cell__hardware { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.data-table--adaptive .device-cell__battery-inline { display: inline-flex; align-items: center; margin-left: 8px; }
.data-table--adaptive .device-name-link { padding-right: 20px; box-sizing: border-box; }
.data-table.data-table--adaptive .table-cell-primary,
.data-table.data-table--adaptive .device-name-link { font-size: 13px; }
[data-density="comfortable"] .data-table--adaptive { --row-h: 68px; --cell-py: 11px; --cell-stack-gap: 4px; }
[data-density="compact"] .data-table--adaptive { --row-h: 56px; --cell-py: 8px; --cell-stack-gap: 3px; }

.device-cell__hardware-text { display: contents; }
