.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--border);
}
.badge.healthy { background: #1e3a2f; color: var(--ok); }
.badge.warning { background: #3d3520; color: #fbbf24; }
.badge.critical { background: #3d2020; color: var(--err); }
.badge.risk-low { background: #1e3a2f; color: var(--ok); }
.badge.risk-medium { background: #3d3520; color: #fbbf24; }
.badge.risk-high { background: #3d2820; color: #fb923c; }
.badge.risk-critical { background: #3d2020; color: var(--err); }
.scope-group { border: 1px solid var(--border); margin: 0.5rem 0; padding: 0.5rem 1rem; border-radius: 6px; }
.scope-item { display: block; margin: 0.35rem 0; }
.scope-item .block { display: block; font-size: 0.85rem; }
.preset-btns button { margin-right: 0.35rem; margin-bottom: 0.5rem; }
.settings-subnav { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.settings-subnav button.active { background: var(--accent); color: #fff; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-inner { max-width: 520px; width: 92%; max-height: 90vh; overflow: auto; }

.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 0.5rem 0.65rem; text-align: left; }
.data-table th { background: var(--panel); }
.warn { color: #fbbf24; font-weight: 600; }
#settings-mfa-qr svg { max-width: 220px; background: #fff; padding: 8px; border-radius: 8px; }
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }

:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4d;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --ok: #3dd68c;
  --err: #f87171;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem clamp(0.85rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 120;
  min-height: 3.25rem;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.app-brand h1 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: 0.01em; }
.app-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.app-user #user-info { margin: 0; max-width: 22rem; text-align: right; font-size: 0.8rem; }
.lang-placeholder {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.4rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  user-select: none;
}
.btn-icon {
  padding: 0.35rem 0.55rem;
  min-width: 2.1rem;
  line-height: 1;
}
.btn-help {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}
.btn-help:hover { border-color: var(--accent); }
.help-wrap { position: relative; }
.help-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  min-width: 16rem;
  max-width: min(22rem, 90vw);
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.help-popover h3 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.help-popover #platform-version {
  margin: 0;
  white-space: pre-line;
  font-size: 0.82rem;
  line-height: 1.45;
}
.help-hint { margin: 0.65rem 0 0; font-size: 0.78rem; }
.help-hint code { font-size: 0.85em; }

.app-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 2rem;
}

#login-section { padding: 1.5rem clamp(1rem, 3vw, 2rem); max-width: 480px; }

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 3.25rem);
}

.app-sidebar {
  flex: 0 0 15.5rem;
  width: 15.5rem;
  max-height: calc(100vh - 3.25rem);
  overflow-y: auto;
  position: sticky;
  top: 3.25rem;
  z-index: 90;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.65rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sidebar-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.35rem 0.55rem 0.2rem;
  font-weight: 600;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
  max-width: 1440px;
}

.sidebar-backdrop {
  display: none;
}

.nav-icon {
  display: inline-block;
  min-width: 1.15em;
  margin-right: 0.4rem;
  text-align: center;
  opacity: 0.9;
  font-size: 1.05em;
}

h2 { font-size: 1.1rem; margin-top: 0; }

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  max-width: 420px;
  margin-top: 0.25rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

button {
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.2;
}
button:hover { filter: brightness(1.1); }
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.toolbar h2 { margin: 0; flex: 1 1 auto; min-width: 120px; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted, #8b949e);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.devices-bulk-bar {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.95);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.devices-bulk-bar.is-active {
  border-color: var(--accent, #58a6ff);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.25);
}
.devices-bulk-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.devices-bulk-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.devices-bulk-actions .btn-sm.is-disabled,
.devices-bulk-actions .btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.devices-bulk-action-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}
.devices-bulk-action-label select {
  min-width: 14rem;
  max-width: 22rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
  background: var(--bg, #0d1117);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.devices-bulk-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.8rem;
}
.devices-bulk-queue-label select {
  margin-left: 0.35rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
  background: var(--bg, #0d1117);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.devices-bulk-hint { font-size: 0.75rem; }
.dev-timeline {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted, #8b949e);
  font-size: 0.9rem;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.65);
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 8.5rem;
}
.filter-field-grow { flex: 1 1 14rem; min-width: 12rem; }
.filter-field-check { justify-content: flex-end; min-width: auto; }
.filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted, #8b949e);
}
.filter-field input,
.filter-field select {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  background: var(--panel, #161b22);
  color: var(--text);
  border: 1px solid var(--border, #30363d);
  border-radius: 5px;
}
.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--accent, #58a6ff);
}
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
}
.ops-hint { margin: 0 0 0.5rem; font-size: 0.8rem; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  align-items: flex-end;
}
.filter-row label {
  margin: 0;
  flex: 0 1 auto;
  min-width: 120px;
  max-width: 200px;
  font-size: 0.8rem;
}
.filter-row input, .filter-row select {
  max-width: 100%;
  margin-top: 0.2rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 4px;
}
.btn-primary { background: var(--accent); color: #fff; border: none; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: #7f1d1d; color: #fecaca; border: 1px solid #991b1b; }
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.pagination-meta { margin: 0.5rem 0; font-size: 0.85rem; }
.data-table.compact td, .data-table.compact th { padding: 0.35rem 0.5rem; font-size: 0.82rem; }
.ops-section { margin-bottom: 1.5rem; width: 100%; }
.ops-section h3 { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; }
.ops-grid,
#tab-overview .widgets-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}
.ops-card {
  padding: 1rem 1.1rem;
  min-height: 5.75rem;
  margin-top: 0;
}
.ops-card.healthy { border-left: 3px solid #22c55e; }
.ops-card.warning { border-left: 3px solid #eab308; }
.ops-card.critical { border-left: 3px solid #ef4444; }
.ops-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted, #888); }
.ops-value { font-size: 1.65rem; font-weight: 600; line-height: 1.15; }
.ops-sub { font-size: 0.78rem; margin-top: 0.25rem; }
#tab-overview .warnings-panel { width: 100%; margin-bottom: 1rem; }
#overview-widgets { width: 100%; }
.btn-warning { background: #854d0e; color: #fef3c7; border: 1px solid #a16207; }
button:not(.btn-sm) { padding: 0.35rem 0.65rem; font-size: 0.82rem; }
.table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.detail-panel, .result-panel {
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--border);
}
tr.detail-row td { background: var(--panel); padding: 0 !important; }
.scroll-pre {
  max-height: 280px;
  overflow: auto;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.35rem 0;
}
.inv-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.inv-tab-body { min-height: 80px; }
td.action-row, th:last-child { white-space: nowrap; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }

/* Class "tabs" kept on sidebar for existing JS selectors (.tabs button[data-tab]). */
.tabs button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.42rem 0.55rem;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.25;
}
.tabs button:hover {
  color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}
.tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.warnings-panel { margin-bottom: 1rem; }
.warn-item {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.9rem;
}
.warn-critical { border-color: #c0392b; background: rgba(192, 57, 43, 0.12); }
.warn-high { border-color: #e67e22; background: rgba(230, 126, 34, 0.1); }
.warn-medium { border-color: #f39c12; }
.warn-low { border-color: var(--border); opacity: 0.95; }

.widgets { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.widgets .card { min-width: 140px; }
.widgets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.85rem; margin-bottom: 1rem; width: 100%; }
.progress-bar { display: inline-block; width: 80px; height: 8px; background: var(--border); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.progress-bar.wide { width: 100%; max-width: 320px; display: block; margin: 0.5rem 0; }
.progress-fill { height: 100%; background: var(--ok); border-radius: 4px; transition: width 0.3s ease; }
.is-loading { opacity: 0.6; pointer-events: none; }
[aria-busy="true"] { cursor: wait; }

.card {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.card pre {
  overflow: auto;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}
tr:hover { background: rgba(255,255,255,0.03); }

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  max-width: 420px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.error { border-color: var(--err); color: var(--err); }
.toast.ok { border-color: var(--ok); }

.install-cmd {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 6px;
  margin: 0.5rem 0;
}

.table-wrap { overflow-x: auto; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); box-shadow: 0 1px 0 var(--border); }
.data-table.compact th, .data-table.compact td { padding: 0.35rem 0.5rem; font-size: 0.82rem; }
.table-toolbar { display: flex; gap: 0.75rem; align-items: center; margin: 0.5rem 0; flex-wrap: wrap; }
.table-search { min-width: 180px; padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: inherit; }
.table-meta { font-size: 0.8rem; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 1.5rem; text-align: center; }
.inv-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.75rem 0; }
.inv-tabs .inv-tab.active { background: var(--accent); color: #fff; }
.scope-group { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0.35rem 0; }
.scope-group legend { font-size: 0.8rem; font-weight: 600; padding: 0 0.25rem; }
.scope-item { display: block; margin: 0.35rem 0; font-size: 0.85rem; }
.scope-item .block { display: block; margin-left: 1.4rem; font-size: 0.78rem; }
.preset-btns button { margin-right: 0.35rem; margin-bottom: 0.5rem; }
.badge.risk-critical { background: rgba(248,81,73,0.2); color: var(--err); }
.badge.risk-high { background: rgba(210,153,34,0.2); color: var(--warn); }
.badge.risk-medium { background: rgba(88,166,255,0.15); color: var(--accent); }
.badge.risk-low { background: rgba(46,160,67,0.15); color: var(--ok); }
td.warn, .warn-item { color: var(--warn); }
.loading-inline { font-style: italic; }
body.density-compact .data-table th, body.density-compact .data-table td { padding: 0.25rem 0.4rem; font-size: 0.78rem; }

/* Devices table: readable status cells without horizontal scroll */
.devices-table-wrap { overflow-x: auto; max-width: 100%; }
.devices-table { table-layout: fixed; width: 100%; min-width: 960px; }
.devices-table .col-dev-check { width: 2.5rem; }
.devices-table .col-dev-name { width: 17%; }
.devices-table .col-dev-role { width: 11%; }
.devices-table .col-dev-health { width: 13%; }
.devices-table .col-dev-status { width: 8%; }
.devices-table .col-dev-agent { width: 11%; }
.devices-table .col-dev-updates { width: 10%; }
.devices-table .col-dev-compliance { width: 12%; }
.devices-table .col-dev-seen { width: 9%; }
.devices-table .col-dev-action { width: 6%; }
.devices-table th:first-child,
.devices-table td:first-child {
  text-align: center;
  vertical-align: middle;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.devices-table .device-select,
.devices-table #devices-select-all {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent, #58a6ff);
}
.sortable-th { user-select: none; }
.sortable-th:hover { color: var(--accent); }

/* Device detail — operational overview */
.dev-health-block { margin-bottom: 1rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: rgba(0,0,0,0.15); }
.dev-health-score { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.dev-health-num { font-size: 1.1rem; font-weight: 700; }
.dev-health-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.25rem 1rem; }
.dev-health-item { font-size: 0.85rem; line-height: 1.35; }
.dev-health-item.ok { color: var(--ok); }
.dev-health-item.warn { color: var(--warn); }
.dev-health-item.critical { color: var(--err); }
.dev-kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem 1rem; margin: 1rem 0; }
.dev-kv-item { padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.dev-kv-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 0.2rem; }
.dev-kv-value { font-size: 0.88rem; word-break: break-word; }
.dev-metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.dev-metric { padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; }
.dev-metric-head { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }
.dev-metric-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.dev-metric-fill { height: 100%; background: var(--ok); border-radius: 3px; }
.dev-metric-warning .dev-metric-fill { background: var(--warn); }
.dev-metric-critical .dev-metric-fill { background: var(--err); }
.dev-metric-detail { font-size: 0.75rem; margin-top: 0.25rem; }
.dev-metric-static { padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.dev-counts-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.dev-count-chip { padding: 0.25rem 0.55rem; border-radius: 4px; background: rgba(88,166,255,0.1); font-size: 0.8rem; }
.dev-tag { display: inline-block; padding: 0.1rem 0.4rem; margin: 0.1rem; border-radius: 4px; background: var(--border); font-size: 0.75rem; }
.dev-compliance-checklist { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.dev-compliance-row { display: flex; gap: 0.5rem; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; }
.dev-compliance-row.ok { border-left: 3px solid var(--ok); }
.dev-compliance-row.warn { border-left: 3px solid var(--warn); }
.dev-compliance-row.fail { border-left: 3px solid var(--err); }
.dev-compliance-row.optional { border-left: 3px solid var(--accent, #58a6ff); background: rgba(88,166,255,0.06); }
.dev-compliance-icon { font-weight: 700; min-width: 1.2rem; }
.dev-compliance-reason { font-size: 0.8rem; margin-top: 0.15rem; }
.dev-compliance-actions { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.dev-compliance-optional-note { margin: 0.5rem 0 0.75rem; padding: 0.5rem 0.65rem; border: 1px solid rgba(88,166,255,0.35); border-radius: 6px; }
.dev-compliance-optional-note ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.dev-updates-header { margin-bottom: 0.75rem; }
.dev-update-badges { margin-top: 0.35rem; }
.dev-service-groups h4 { margin: 1rem 0 0.35rem; font-size: 0.9rem; }

.devices-table td, .devices-table th { white-space: normal; word-break: break-word; vertical-align: top; }
.devices-table .cell-name .cell-sub { display: block; font-size: 0.78rem; line-height: 1.25; }
.devices-table .cell-status { line-height: 1.3; }
.status-cell { display: flex; flex-direction: column; gap: 0.15rem; align-items: flex-start; max-width: 100%; }
.status-cell .badge { flex-shrink: 0; }
.reason-short { font-size: 0.75rem; color: var(--muted, #888); line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; word-break: break-word; }
.btn-link.btn-xs.reason-more { font-size: 0.72rem; padding: 0; border: 0; background: none; color: var(--accent, #4a9); cursor: pointer; text-decoration: underline; }
.compliance-checks-table .wrap-cell { white-space: normal; word-break: break-word; max-width: 14rem; }
.badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.75rem; background: var(--border); }
.badge.healthy { background: rgba(46,160,67,0.2); color: var(--ok); }
.badge.critical { background: rgba(248,81,73,0.2); color: var(--err); }
.badge.warning { background: rgba(210,153,34,0.2); color: var(--warn); }
.badge.pending { background: rgba(88,166,255,0.15); color: var(--accent); }
.btn-warning { background: var(--warn); color: #111; border: none; }
.btn-warning:hover { filter: brightness(1.05); }
.detail-row td { background: rgba(0,0,0,0.2); }
.detail-panel { padding: 0.75rem 0; }
.scroll-pre { max-height: 320px; overflow: auto; font-size: 0.8rem; }
.ops-card.clickable { cursor: pointer; }
.ops-card.clickable:hover { outline: 1px solid var(--accent, #3b82f6); }
.enroll-platform-tabs { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.enroll-plat.active { outline: 2px solid var(--accent, #3b82f6); }
.enroll-plat-panel.hidden { display: none; }
.token-block { user-select: all; }

.remote-session-banner {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin: 0 0 0.85rem;
}
.remote-session-banner p { margin: 0.35rem 0 0; }
.remote-session-pending {
  border-color: #a16207;
  background: rgba(234, 179, 8, 0.12);
}
.remote-session-pending strong { color: var(--warn); }
.remote-session-ready {
  border-color: #2ea043;
  background: rgba(46, 160, 67, 0.12);
}
.remote-session-ready strong { color: var(--ok); }
.remote-session-idle {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.remote-launch-link {
  display: inline-block;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent, #58a6ff);
  text-decoration: underline;
}

.ops-card.clickable:hover { outline: 1px solid var(--accent, #3b82f6); }

@media (min-width: 901px) {
  #btn-sidebar-toggle { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 3.25rem;
    bottom: 0;
    max-height: none;
    z-index: 140;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 3.25rem 0 0 0;
    z-index: 130;
    background: rgba(0, 0, 0, 0.45);
  }
  .sidebar-backdrop.hidden { display: none; }
  .app-user #user-info { max-width: 12rem; }
}

@media (max-width: 768px) {
  main { padding: 0; }
  .app-user #user-info { text-align: left; max-width: none; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .app-header { flex-wrap: wrap; }
}
