@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --header: #0f172a;
  --header-muted: #94a3b8;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #ccfbf1;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 0 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
}

.header-nav {
  display: flex;
  gap: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.55) transparent;
}

.header-nav::-webkit-scrollbar { height: 4px; }
.header-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 4px;
}

.header-nav-wrap { position: relative; }

.header-nav-wrap.can-scroll-more::after {
  content: "›";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 4px;
  width: 1.75rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
  background: linear-gradient(to right, rgba(15, 23, 42, 0), #0f172a 55%);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--header-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.nav-tab:hover { color: #e2e8f0; }

.nav-tab.active {
  color: #fff;
  border-bottom-color: #14b8a6;
}

.nav-tab svg { width: 16px; height: 16px; opacity: 0.85; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.brand h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: var(--header-muted);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--header-muted);
  margin-top: 0.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
}

.status-dot.live { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.status-dot.loading { background: #fbbf24; animation: pulse 1.5s ease infinite; }
.status-dot.error { background: #f87171; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) { background: #f8fafc; }

.btn-icon { width: 16px; height: 16px; }

/* Main layout */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.alert.hidden { display: none; }
.hidden { display: none !important; }

.alert-error {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-loading {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
}

.sync-panel {
  background: var(--surface);
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.sync-panel.hidden {
  display: none;
}

.sync-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.sync-panel-head .alert-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: #0f766e;
}

.sync-panel-head .alert-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sync-progress-pct {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0d9488;
  white-space: nowrap;
}

.sync-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.875rem 0 0.75rem;
}

.sync-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: 999px;
  transition: width 0.45s ease;
  min-width: 2%;
}

.sync-phase-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sync-phase {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted);
}

.sync-phase.is-active {
  background: #ccfbf1;
  color: #0f766e;
}

.sync-phase.is-done {
  background: #d1fae5;
  color: #047857;
}

.sync-meta {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-title { font-weight: 600; margin: 0 0 0.25rem; }
.alert-text { margin: 0; font-size: 0.8125rem; opacity: 0.9; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .kpi-grid { grid-template-columns: repeat(5, 1fr); } }

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg { width: 20px; height: 20px; }

.kpi-icon.total { background: #ede9fe; color: #7c3aed; }
.kpi-icon.windows { background: #dbeafe; color: #2563eb; }
.kpi-icon.linux { background: #ffedd5; color: #ea580c; }
.kpi-icon.macos { background: #f3f4f6; color: #374151; }
.kpi-icon.new { background: #d1fae5; color: #059669; }

.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.25rem;
}

.kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

/* Toolbar */
.toolbar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 0.875rem 0 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background: #fff;
}

.filter-select {
  height: 40px;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8125rem;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  appearance: none;
  cursor: pointer;
  min-width: 130px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Table card */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.table-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.table-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.table-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.view-toggle {
  display: inline-flex;
  padding: 0.2rem;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 0.15rem;
}

.view-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

.view-toggle-btn:hover {
  color: var(--text);
}

.view-toggle-btn.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.asset-group-row {
  background: #f8fafc;
  cursor: pointer;
}

.asset-group-row:hover {
  background: #f1f5f9;
}

.asset-group-row td {
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.asset-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.asset-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.asset-group-row.is-expanded .asset-group-chevron {
  transform: rotate(90deg);
}

.asset-group-count {
  font-weight: 500;
  color: var(--accent);
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.port-child-row td:first-child {
  padding-left: 2.25rem;
}

.port-child-row .port-child-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.port-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 4.5rem;
  overflow: hidden;
}

.port-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  white-space: nowrap;
  max-width: 100%;
}

.port-chip.is-udp {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.table-scroll {
  max-height: calc(100vh - 320px);
  min-height: 320px;
  overflow: auto;
}

.data-table-fixed {
  table-layout: fixed;
  width: 100%;
}

.data-table thead tr {
  background: #f8fafc;
}

.data-table thead th.col-th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0;
  vertical-align: bottom;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.th-inner {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  min-width: 0;
}

.th-sort {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-sort:hover,
.data-table thead th.sort-active .th-sort {
  color: var(--text);
}

.data-table thead th.sort-active .th-sort {
  color: var(--accent);
}

.col-filter-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
}

.col-filter-btn:hover {
  background: #e2e8f0;
  color: var(--text);
}

.col-filter-btn.is-active {
  background: #ccfbf1;
  border-color: #99f6e4;
  color: var(--accent-hover);
}

.filter-chevron {
  font-size: 0.875rem;
  line-height: 1;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}

.col-resize-handle:hover,
.col-th.is-resizing .col-resize-handle {
  background: rgba(13, 148, 136, 0.35);
}

body.is-col-resizing {
  cursor: col-resize;
  user-select: none;
}

.col-th {
  position: relative;
}

.col-filter-menu {
  position: fixed;
  z-index: 200;
  width: 260px;
  max-width: calc(100vw - 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.col-filter-menu.hidden {
  display: none;
}

.col-filter-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}

.col-filter-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
}

.col-filter-body {
  padding: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.col-filter-text {
  width: 100%;
  height: 34px;
  padding: 0 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
}

.col-filter-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.col-filter-search {
  width: 100%;
  height: 32px;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.75rem;
}

.col-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
}

.col-filter-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0;
}

.col-filter-option span {
  line-height: 1.35;
  word-break: break-word;
}

.col-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table-fixed thead th.col-th {
  padding: 0;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}

.data-table thead th.sortable:hover { background: #f1f5f9; color: var(--text); }
.data-table thead th.sort-active { color: var(--accent); }

.data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
  overflow: hidden;
}

.cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cell-name {
  font-weight: 600;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-ip {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.cell-os {
  color: var(--text-muted);
}

.cell-sources,
.cell-tags {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-sources .badge,
.cell-tags .badge {
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  margin: 0.125rem 0.25rem 0.125rem 0;
}

.badge-source { background: #eff6ff; color: #1d4ed8; }
.badge-tag { background: #f0fdfa; color: #0f766e; border: 1px solid #ccfbf1; }
.badge-more { background: #f1f5f9; color: var(--text-muted); }
.badge-critical { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-high { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.cell-time { color: var(--text-muted); font-size: 0.75rem; }
.cell-time.recent { color: var(--accent); font-weight: 500; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

.empty-state p { margin: 0; font-size: 0.875rem; }

/* Pagination */
.table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.page-size-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.page-size-wrap select {
  height: 32px;
  padding: 0 1.5rem 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  background: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.page-btn {
  height: 32px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.7s linear infinite; }

/* Loading overlay on table */
.table-loading {
  position: relative;
}

.table-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  z-index: 20;
  display: none;
}

.table-loading.is-loading::after { display: block; }

/* Template banner */
.template-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
}

.template-banner strong { font-weight: 600; }

/* Tag type badges */
.badge-static {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-dynamic {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Row actions */
.row-actions {
  display: flex;
  gap: 0.375rem;
}

.btn-sm {
  padding: 0.3rem 0.625rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.modal-header p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-body { padding: 1.25rem 1.5rem; }

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Stakeholder dashboard */
.dashboard-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.dashboard-hero-main {
  min-width: 0;
  flex: 1 1 12rem;
}

.dashboard-hero h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.dashboard-hero-hint {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem 1rem;
  flex: 0 1 auto;
}

.dashboard-hero-ts {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.dashboard-tag-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.dashboard-tag-filter-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.dashboard-tag-select {
  width: auto;
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.375rem 1.75rem 0.375rem 0.625rem;
  font-size: 0.8125rem;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.dashboard-tag-select option {
  color: var(--text);
  background: var(--surface);
}

.dashboard-refresh-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(13, 148, 136, 0.12);
  overflow: hidden;
}

.dashboard-refresh-bar.hidden {
  display: none;
}

.dashboard-refresh-bar-fill {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, transparent, #0d9488, #14b8a6, transparent);
  animation: dashboard-refresh-slide 1.1s ease-in-out infinite;
}

@keyframes dashboard-refresh-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.dashboard-metrics-panel {
  position: relative;
}

.dashboard-metrics-panel.is-refreshing .exec-kpi,
.dashboard-metrics-panel.is-refreshing .chart-card {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dashboard-metrics-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4.5rem;
  background: rgba(248, 250, 252, 0.55);
  backdrop-filter: blur(2px);
}

.dashboard-metrics-overlay.hidden {
  display: none;
}

.dashboard-metrics-overlay-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.dashboard-metrics-spinner {
  width: 1.125rem;
  height: 1.125rem;
  color: #0d9488;
  flex-shrink: 0;
}

.dashboard-refresh-message {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.dashboard-tag-select:disabled {
  opacity: 0.65;
  cursor: wait;
}

.hero-meta {
  text-align: right;
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.risk-mod-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.risk-mod-badge.risk-accept {
  background: #fef3c7;
  color: #92400e;
}

.risk-mod-badge.risk-recast {
  background: #dbeafe;
  color: #1e40af;
}

.hero-meta strong {
  display: block;
  color: #e2e8f0;
  font-size: 0.875rem;
  margin-bottom: 0.125rem;
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) { .exec-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .exec-kpi-grid { grid-template-columns: repeat(6, 1fr); } }

.exec-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow);
}

.exec-kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.375rem;
}

.exec-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

.exec-kpi-value.critical { color: #dc2626; }
.exec-kpi-value.warning { color: #d97706; }
.exec-kpi-value.good { color: #059669; }
.exec-kpi-value.elevated { color: #d97706; }

.exec-kpi-delta {
  font-size: 0.6875rem;
  margin-top: 0.375rem;
  color: var(--text-muted);
}

.exec-kpi-delta.up { color: #dc2626; }
.exec-kpi-delta.down { color: #059669; }

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 900px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .chart-span-2 { grid-column: span 2; }
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chart-card-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.chart-card-header p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-body {
  padding: 1.25rem;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  gap: 0.5rem;
}

.chart-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}

/* CSS bar chart placeholder */
.bar-chart {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 0.5rem;
  height: 160px;
  padding: 0 0.5rem;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  max-width: 48px;
}

.bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: center;
}

.donut-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    #dc2626 0deg 36deg,
    #f97316 36deg 108deg,
    #eab308 108deg 180deg,
    #22c55e 180deg 288deg,
    #94a3b8 288deg 360deg
  );
  position: relative;
  margin: 0 auto;
}

.donut-placeholder::after {
  content: '';
  position: absolute;
  inset: 28px;
  background: var(--surface);
  border-radius: 50%;
}

.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.risk-posture {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}

.risk-meter {
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.risk-meter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.risk-meter-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.risk-meter-value.elevated { color: #d97706; }
.risk-meter-value.critical { color: #dc2626; }
.risk-meter-value.good { color: #059669; }

/* Tags — category groups & asset tag chips */
.tags-registry {
  padding: 0.5rem 0;
}

.category-group {
  border-bottom: 1px solid var(--border);
}

.category-group:last-child { border-bottom: none; }

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}

.category-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
  border-radius: 8px;
}

.category-toggle:hover { background: #f1f5f9; }

.category-header .btn { flex-shrink: 0; margin-right: 0.25rem; }

.category-header h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.category-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.category-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.category-group.is-open .category-chevron { transform: rotate(90deg); }

.category-values {
  display: none;
  padding: 0 1.25rem 1rem;
}

.category-group.is-open .category-values { display: block; }

.nested-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.nested-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.nested-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.nested-table tr:last-child td { border-bottom: none; }

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
}

.tag-chip.dynamic {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.tag-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  font-size: 0.875rem;
}

.tag-chip button:hover:not(:disabled) { opacity: 1; }

.tag-chip button:disabled { cursor: not-allowed; opacity: 0.3; }

.concern-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.concern-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.concern-list li:last-child { border-bottom: none; }

.concern-severity {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.375rem;
  flex-shrink: 0;
}

.concern-severity.critical { background: #dc2626; }
.concern-severity.high { background: #f97316; }
.concern-severity.medium { background: #eab308; }

.concern-text strong {
  display: block;
  font-size: 0.8125rem;
  margin-bottom: 0.125rem;
}

.concern-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tags Management page */
.tags-page .tags-kpi-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .tags-page .tags-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

.tags-page .kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tags-page .kpi-icon.vals { background: #ede9fe; color: #7c3aed; }
.tags-page .kpi-icon.assets { background: #dbeafe; color: #2563eb; }
.tags-page .kpi-icon i { font-size: 20px; }

.tags-page .status-dot.live { background: #22c55e; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.cat-panel-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tags-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 960px) {
  .tags-layout {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }
}

.tags-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.tags-page .cat-list.table-scroll,
.tags-page .tags-table-wrap.table-scroll {
  flex: 1;
  min-height: 320px;
  max-height: calc(100vh - 380px);
}

.btn-sm-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-sm-accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn-sm-accent:disabled { opacity: 0.5; cursor: not-allowed; }

.tags-search-wrap {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tags-search-wrap i {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.tags-search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8125rem;
}

.tags-search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.cat-list {
  padding: 0.5rem;
}

.cat-list .cat,
.cat-list button.cat {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 0.25rem;
  transition: background 0.15s, border-color 0.15s;
}

.cat-list .cat:hover { background: #f8fafc; }
.cat-list .cat.active {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.cat-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.cat-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.cat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cat-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.tags-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.toolbar-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-sel {
  height: 34px;
  padding: 0 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  background: #fff;
}

.tags-table-wrap {
  flex: 1;
  min-height: 0;
}

.tags-panel-values .table-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem;
}

.tags-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.tags-data-table th {
  text-align: left;
  padding: 0.5rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.tags-data-table td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.tags-data-table tr:last-child td { border-bottom: none; }

.tags-page .badge-static,
.tags-page .badge-dynamic {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.badge-active {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: #059669;
  font-weight: 500;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.asset-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.row-acts {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover:not(:disabled) {
  background: #f8fafc;
  color: var(--text);
  border-color: #cbd5e1;
}

.icon-btn.danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-soft);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn i { font-size: 14px; }

.tags-page .status-dot.cached { background: #f59e0b; }
.tags-page .status-dot.live { background: #22c55e; }

/* VM vulnerability dashboard */
.vm-kpi-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .vm-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .vm-kpi-grid { grid-template-columns: repeat(5, 1fr); }
}

.vm-secondary-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .vm-secondary-grid { grid-template-columns: repeat(3, 1fr); }
}

.exec-kpi-value.accent { color: var(--accent); }

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  padding: 0.5rem 0;
}

.chart-canvas-short {
  height: 200px;
}

.rate-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rate-badge.rate-good {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.rate-badge.rate-amber {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.rate-badge.rate-bad {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.sev-pill {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.sev-pill.empty { opacity: 0.35; color: var(--text-muted); }
.sev-pill.critical { background: #fef2f2; color: #b91c1c; }
.sev-pill.high { background: #fff7ed; color: #c2410c; }
.sev-pill.medium { background: #fefce8; color: #a16207; }
.sev-pill.low { background: #ecfdf5; color: #047857; }

.asset-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

#status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

/* Port Exposure Overview */
.port-exposure-overview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.exposure-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.exposure-kicker {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.exposure-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.exposure-head p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.exposure-total {
  min-width: 92px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  text-align: right;
}

.exposure-total strong {
  display: block;
  font-size: 1rem;
  line-height: 1.15;
}

.exposure-total span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.625rem;
}

.exposure-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.85fr);
}

.exposure-panel {
  min-width: 0;
}

.exposure-panel + .exposure-panel {
  border-left: 1px solid var(--border);
}

.exposure-panel-head {
  padding: 0.75rem 1rem 0.55rem;
}

.exposure-panel-head strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
}

.exposure-panel-head span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.625rem;
}

.exposure-bars {
  padding: 0.2rem 1rem 0.85rem;
}

.exposure-bar-row {
  display: grid;
  grid-template-columns: 44px minmax(75px, 100px) minmax(70px, 1fr) 42px;
  gap: 0.6rem;
  align-items: center;
  min-height: 29px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.exposure-bar-row:hover {
  background: #f8fafc;
}

.exposure-bar-row.is-selected {
  background: #f0fdfa;
  box-shadow: inset 3px 0 0 #0d9488;
}

.exposure-bar-row.is-selected .exposure-port,
.exposure-bar-row.is-selected .exposure-service,
.exposure-bar-row.is-selected strong {
  color: #0f766e;
  font-weight: 600;
}

.exposure-bar-row.is-selected .exposure-fill {
  background: #0d9488;
}

.exposure-bar-row.is-dimmed {
  opacity: 0.4;
}

.exposure-bar-row.is-dimmed:hover {
  opacity: 0.7;
  background: #f8fafc;
}

.exposure-bar-row + .exposure-bar-row {
  margin-top: 0.15rem;
}

.exposure-port {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: right;
}

.exposure-service {
  color: var(--text-muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exposure-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.exposure-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  background: #0d9488;
  border-radius: 999px;
}

.exposure-bar-row strong {
  font-size: 0.68rem;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.protocol-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.45rem 1rem 1rem;
  min-height: 154px;
}

.protocol-donut {
  --tcp-angle: 0deg;
  position: relative;
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border-radius: 50%;
  background: conic-gradient(#0d9488 0deg var(--tcp-angle), #cbd5e1 var(--tcp-angle) 360deg);
  display: grid;
  place-items: center;
}

.protocol-donut::before {
  content: "";
  position: absolute;
  inset: 12px;
  background: var(--surface);
  border-radius: 50%;
}

.protocol-donut-center {
  position: relative;
  text-align: center;
  z-index: 1;
}

.protocol-donut-center strong {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

.protocol-donut-center span {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.protocol-legend {
  flex: 1;
  min-width: 0;
}

.protocol-stat {
  display: grid;
  grid-template-columns: 8px 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  min-height: 32px;
  font-size: 0.7rem;
}

.protocol-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.protocol-dot.tcp { background: #0d9488; }
.protocol-dot.udp { background: #cbd5e1; }

.protocol-stat strong {
  font-size: 0.7rem;
  font-weight: 600;
}

.protocol-stat small {
  min-width: 30px;
  color: var(--text-muted);
  text-align: right;
  font-size: 0.625rem;
}

@media (max-width: 850px) {
  .exposure-grid { grid-template-columns: 1fr; }
  .exposure-panel + .exposure-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 600px) {
  .exposure-head { flex-direction: column; }
  .exposure-total { width: 100%; text-align: left; }
  .exposure-bar-row {
    grid-template-columns: 40px 70px minmax(50px, 1fr) 35px;
    gap: 0.4rem;
  }
  .protocol-content { min-height: 130px; }
}

/* Open Ports page — dashboard-like color accents */
.ports-page .kpi-icon.ports { background: #ccfbf1; color: #0d9488; }
.ports-page .kpi-icon.assets { background: #dbeafe; color: #2563eb; }
.ports-page .kpi-icon.tcp { background: #d1fae5; color: #059669; }
.ports-page .kpi-icon.udp { background: #ede9fe; color: #7c3aed; }
.ports-page .kpi-icon.unique { background: #ffedd5; color: #ea580c; }

.ports-page .kpi-value.accent { color: #0d9488; }
.ports-page .kpi-value.blue { color: #2563eb; }
.ports-page .kpi-value.teal { color: #059669; }
.ports-page .kpi-value.violet { color: #7c3aed; }
.ports-page .kpi-value.green { color: #ea580c; }

.ports-page .kpi-card {
  border-top: 3px solid transparent;
}

.ports-page .kpi-card:nth-child(1) { border-top-color: #0d9488; }
.ports-page .kpi-card:nth-child(2) { border-top-color: #2563eb; }
.ports-page .kpi-card:nth-child(3) { border-top-color: #059669; }
.ports-page .kpi-card:nth-child(4) { border-top-color: #7c3aed; }
.ports-page .kpi-card:nth-child(5) { border-top-color: #ea580c; }

.ports-page .port-exposure-overview {
  background:
    linear-gradient(180deg, #f0fdfa 0%, #ffffff 42%),
    var(--surface);
  border-color: #99f6e4;
}

.ports-page .exposure-head {
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.06), transparent 55%);
}

.ports-page .exposure-total {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.ports-page .exposure-total strong {
  color: #059669;
}

.ports-page .exposure-fill.rank-1 { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.ports-page .exposure-fill.rank-2 { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.ports-page .exposure-fill.rank-3 { background: linear-gradient(90deg, #7c3aed, #8b5cf6); }
.ports-page .exposure-fill.rank-4 { background: linear-gradient(90deg, #ea580c, #f97316); }
.ports-page .exposure-fill.rank-5 { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.ports-page .exposure-fill.rank-6 { background: linear-gradient(90deg, #4f46e5, #6366f1); }

.ports-page .protocol-donut {
  background: conic-gradient(#0d9488 0deg var(--tcp-angle), #8b5cf6 var(--tcp-angle) 360deg);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.ports-page .protocol-dot.udp { background: #8b5cf6; }

.ports-page .protocol-stat:first-child strong { color: #0d9488; }
.ports-page .protocol-stat:last-child strong { color: #7c3aed; }

.ports-page .port-chip {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.ports-page .port-chip.is-udp {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.ports-page .asset-group-count {
  background: #ecfdf5;
  color: #0f766e;
  border-color: #99f6e4;
}

.ports-page .asset-group-row.is-expanded {
  background: #f0fdfa;
}

.ports-page .view-toggle-btn.is-active {
  background: #ccfbf1;
  color: #0f766e;
  box-shadow: none;
}

.ports-page .table-meta {
  background: #ecfdf5;
  color: #0f766e;
}

/* ─── Dashboard Lumin Index ─── */
.lumin-recast-scroll {
  max-height: calc(100vh - 320px);
  min-height: 280px;
  overflow: auto;
}

.lumin-recast-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.lumin-page .recast-plugin-row.is-expanded {
  background: #f0fdfa;
}

.lumin-page .recast-asset-row td:first-child {
  padding-left: 2.25rem;
}

.lumin-section-title {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lumin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lumin-legend {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.lumin-legend .lg {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 2px;
  margin-right: 0.125rem;
}

.lg-start { background: #64748b; }
.lg-new { background: #f97316; }
.lg-res { background: #eab308; }
.lg-fixed { background: #22c55e; }
.lg-end { background: #0d9488; }
.lg-line { background: #1d4ed8; height: 2px !important; width: 0.875rem !important; }

.chart-canvas-tall { height: 340px; }

.lumin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.lumin-badge.method-frozen { background: #dcfce7; color: #166534; }
.lumin-badge.method-reconstructed { background: #fef3c7; color: #92400e; }
.lumin-badge.method-live { background: #e0e7ff; color: #3730a3; }
.lumin-badge-provisional { background: #fee2e2; color: #991b1b; }
.lumin-badge-good { background: #dcfce7; color: #166534; }
.lumin-badge-bad { background: #fee2e2; color: #991b1b; }

.lumin-mtd-card { border-left: 4px solid #f59e0b; }

.lumin-mtd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
  padding: 0.75rem 1.25rem 0.5rem;
}

@media (min-width: 768px) { .lumin-mtd-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .lumin-mtd-grid { grid-template-columns: repeat(8, 1fr); } }

.lumin-mtd-value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lumin-mtd-value.good { color: #059669; }
.lumin-mtd-value.accent { color: var(--accent); }

.lumin-fix-median-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.5rem;
  padding: 0.75rem 1.25rem 1.125rem;
  align-items: center;
}

@media (min-width: 800px) {
  .lumin-fix-median-row {
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr);
  }
}

.lumin-fix-median-hero {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.lumin-fix-median-row-compact {
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 0.75rem;
}

.lumin-fix-median-value {
  margin: 0.15rem 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.lumin-fix-sla-chart-wrap {
  min-width: 0;
}

.lumin-fix-sla-chart {
  height: 150px;
  min-height: 130px;
  padding: 0.25rem 0 0;
}

.lumin-fix-list-scroll,
.lumin-fix-plugin-scroll {
  max-height: 360px;
  overflow: auto;
  margin: 0;
}

.lumin-fix-extremes-grid {
  align-items: stretch;
}

.lumin-mtd-new-block {
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.lumin-mtd-new-header {
  padding: 0.55rem 1.25rem 0.45rem;
}

.lumin-mtd-new-scroll {
  max-height: min(480px, calc(100vh - 380px));
  min-height: 160px;
  overflow: auto;
  margin: 0;
  border-top: 1px solid var(--border);
}

.lumin-mtd-new-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.lumin-mtd-new-table {
  table-layout: fixed;
  width: 100%;
}

.lumin-mtd-new-table .col-host { width: 16%; }
.lumin-mtd-new-table .col-ip { width: 10%; }
.lumin-mtd-new-table .col-plugin-id { width: 8%; }
.lumin-mtd-new-table .col-plugin-name { width: 28%; }
.lumin-mtd-new-table .col-vpr { width: 6%; }
.lumin-mtd-new-table .col-tier { width: 8%; }
.lumin-mtd-new-table .col-state { width: 8%; }
.lumin-mtd-new-table .col-seen { width: 16%; }

.lumin-mtd-new-table th,
.lumin-mtd-new-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lumin-mtd-new-table .th-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  min-width: 0;
}

.lumin-mtd-new-table .th-inner > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lumin-mtd-new-table td:nth-child(4) .cell-name {
  max-width: 100%;
}

.lumin-mtd-new-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mtd-groupby {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mtd-groupby-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.mtd-groupby-label-icon {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.75;
}

.mtd-groupby-seg {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.15rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.mtd-groupby-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.mtd-groupby-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.mtd-groupby-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.65);
}

.mtd-groupby-btn.is-active {
  background: #fff;
  color: #c2410c;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.mtd-groupby-btn.is-active svg {
  color: #ea580c;
}

@media (max-width: 640px) {
  .mtd-groupby-btn span {
    display: none;
  }

  .mtd-groupby-btn {
    padding: 0.45rem 0.55rem;
  }
}

.lumin-mtd-new-table .mtd-child-row td:first-child {
  padding-left: 2.25rem;
}

.lumin-mtd-new-table .asset-group-row.is-expanded {
  background: #fff7ed;
}

.lumin-net-up { color: #dc2626; font-weight: 600; }
.lumin-net-down { color: #059669; font-weight: 600; }

.lumin-footnote {
  margin: 0;
  padding: 0.75rem 1.25rem 1rem;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.lumin-footnote:empty { display: none; }

.lumin-lineage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.lumin-lineage p { margin: 0; }

.lumin-definitions { margin-top: 0.75rem; }
.lumin-definitions summary { cursor: pointer; font-weight: 600; color: var(--text); }
.lumin-definitions dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 0.75rem 0 0;
}
.lumin-definitions dt { font-weight: 600; color: var(--text); font-family: ui-monospace, monospace; font-size: 0.6875rem; }
.lumin-definitions dd { margin: 0; }

/* ── SSL Certificate Health ─────────────────────────────────────── */
.ssl-page .kpi-meta {
  margin: 0.2rem 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.ssl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 900px) {
  .ssl-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .ssl-kpi-grid { grid-template-columns: repeat(6, 1fr); }
}

.ssl-page .kpi-card {
  border-top: 3px solid transparent;
  align-items: flex-start;
}

.ssl-page .kpi-card:nth-child(1) { border-top-color: #0d9488; }
.ssl-page .kpi-card:nth-child(2) { border-top-color: #059669; }
.ssl-page .kpi-card:nth-child(3) { border-top-color: #d97706; }
.ssl-page .kpi-card:nth-child(4) { border-top-color: #b45309; }
.ssl-page .kpi-card:nth-child(5) { border-top-color: #dc2626; }
.ssl-page .kpi-card:nth-child(6) { border-top-color: #2563eb; }

.ssl-page .kpi-icon.ssl-total { background: #ccfbf1; color: #0d9488; }
.ssl-page .kpi-icon.ssl-valid { background: #d1fae5; color: #059669; }
.ssl-page .kpi-icon.ssl-exp30 { background: #fff7ed; color: #d97706; }
.ssl-page .kpi-icon.ssl-exp7 { background: #ffedd5; color: #b45309; }
.ssl-page .kpi-icon.ssl-expired { background: #fef2f2; color: #dc2626; }
.ssl-page .kpi-icon.ssl-internet { background: #dbeafe; color: #2563eb; }

.ssl-page .kpi-value.accent { color: #0d9488; }
.ssl-page .kpi-value.teal { color: #059669; }
.ssl-page .kpi-value.amber { color: #d97706; }
.ssl-page .kpi-value.red { color: #dc2626; }
.ssl-page .kpi-value.blue { color: #2563eb; }

.ssl-grid2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .ssl-grid2 { grid-template-columns: 1fr; }
}

.ssl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.ssl-timeline-card,
.ssl-action-card { margin-bottom: 1.25rem; }

.ssl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.05rem 1.15rem 0.85rem;
  flex-wrap: wrap;
}

.ssl-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.ssl-card-sub {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ssl-card-body {
  padding: 0.35rem 1.15rem 1.15rem;
}

.ssl-legend {
  display: flex;
  gap: 0.85rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.ssl-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ssl-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ssl-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 56px;
  gap: 0.75rem;
  align-items: center;
  margin: 0.35rem 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.4rem 0.35rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.ssl-bar-row:hover {
  background: #f8fafc;
}

.ssl-bar-row.is-selected {
  background: #f0fdfa;
  box-shadow: inset 3px 0 0 #0d9488;
}

.ssl-bar-row.is-selected[data-health-filter="expiring"] {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #d97706;
}

.ssl-bar-row.is-selected[data-health-filter="expired"] {
  background: #fef2f2;
  box-shadow: inset 3px 0 0 #dc2626;
}

.ssl-bar-row.is-dimmed {
  opacity: 0.42;
}

.ssl-bar-row.is-dimmed:hover {
  opacity: 0.72;
}

.ssl-bar-label {
  font-size: 0.8125rem;
  font-weight: 650;
}

.ssl-track {
  height: 11px;
  border-radius: 999px;
  background: #edf0f3;
  overflow: hidden;
}

.ssl-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.ssl-bar.valid { background: #0d9488; }
.ssl-bar.expiring { background: #d97706; }
.ssl-bar.expired { background: #dc2626; }

.ssl-bar-count {
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 700;
}

.ssl-exposure {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: center;
}

@media (max-width: 700px) {
  .ssl-exposure { grid-template-columns: 1fr; }
}

.ssl-donut-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}

.ssl-donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(#e2e8f0 0 100%);
  position: relative;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.ssl-donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  background: #fff;
  border-radius: 50%;
}

.ssl-donut-center {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ssl-donut-number {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.ssl-donut-label {
  font-size: 0.625rem;
  color: var(--text-muted);
}

.ssl-exposure-list {
  display: grid;
  gap: 0.65rem;
}

.ssl-exposure-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfc;
}

.ssl-exposure-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 650;
}

.ssl-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ssl-exposure-num {
  font-size: 0.875rem;
  font-weight: 750;
}

.ssl-timeline-scale {
  display: flex;
  justify-content: space-between;
  color: #87909b;
  font-size: 0.625rem;
  margin-bottom: 0.4rem;
}

.ssl-timeline-line {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #dc2626 0 6%,
    #d97706 6% 14%,
    #b45309 14% 24%,
    #0d9488 24% 100%
  );
  margin: 0.5rem 0 0.9rem;
}

.ssl-timeline-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

@media (max-width: 700px) {
  .ssl-timeline-items { grid-template-columns: repeat(2, 1fr); }
}

.ssl-time-box {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.7rem 0.8rem;
  background: #fafbfc;
}

.ssl-time-title {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.ssl-time-num {
  font-size: 1.15rem;
  font-weight: 750;
  margin-top: 0.2rem;
}

.ssl-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ssl-filter {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  padding: 0.4rem 0.65rem;
  font-size: 0.6875rem;
  color: #68717d;
  cursor: pointer;
}

.ssl-filter:hover { background: #f8fafc; }

.ssl-filter.active {
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
  border-color: #99f6e4;
}

.ssl-table th {
  text-align: left;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.1rem;
  font-size: 0.625rem;
  color: #7a8490;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ssl-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #edf0f3;
  font-size: 0.8125rem;
  vertical-align: middle;
}

.ssl-row {
  cursor: pointer;
}

.ssl-row:hover td {
  background: #f0fdfa;
}

.ssl-asset-name {
  font-weight: 700;
  color: var(--text);
}

.ssl-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 700;
}

.ssl-pill.red { color: #dc2626; background: #fef2f2; }
.ssl-pill.amber { color: #b45309; background: #fff7ed; }
.ssl-pill.green { color: #047857; background: #ecfdf5; }
.ssl-pill.blue { color: #1d4ed8; background: #eff6ff; }

.ssl-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 60;
}

.ssl-drawer {
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  width: min(430px, 92vw);
  background: #fff;
  box-shadow: -15px 0 40px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s;
  z-index: 70;
  overflow: auto;
}

.ssl-drawer.open { transform: translateX(0); }
.ssl-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.ssl-drawer-head {
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.ssl-drawer-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8491;
  margin-bottom: 0.35rem;
}

.ssl-drawer-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.ssl-drawer-close {
  border: 0;
  background: #f3f5f7;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.ssl-drawer-body { padding: 1.15rem 1.35rem; }

.ssl-detail-section { margin-bottom: 1.35rem; }

.ssl-detail-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #89919b;
  font-weight: 750;
  margin-bottom: 0.5rem;
}

.ssl-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f0f1f3;
  font-size: 0.8125rem;
}

.ssl-detail-row span:first-child { color: var(--text-muted); }
.ssl-detail-row span:last-child {
  text-align: right;
  font-weight: 650;
  word-break: break-word;
}

.btn-icon.spin,
#refresh-icon.spin {
  animation: spin 0.7s linear infinite;
}


/* --- Server Health --- */
.server-health-page {
  --sh-healthy: #3aa595;
  --sh-attention: #e0a526;
  --sh-warning: #ea7a2a;
  --sh-critical: #d63c3c;
  --sh-healthy-bg: #e6f4f1;
  --sh-attention-bg: #fbf1d9;
  --sh-warning-bg: #fcebdc;
  --sh-critical-bg: #fadfdf;
}

.sh-main { max-width: 1320px; }

.sh-pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

.sh-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sh-sub {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.sh-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem 1rem;
  box-shadow: var(--shadow);
}

.sh-os-section {
  margin: 1rem 0 0;
}

.sh-os-panel .lumin-badge {
  background: #f1f5f9;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.sh-os-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.125rem 1.125rem;
}

@media (min-width: 720px) {
  .sh-os-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .sh-os-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .sh-os-tiles {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.sh-os-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.875rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 96px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sh-os-tile:hover,
.sh-os-tile:focus-visible {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  outline: none;
}

.sh-os-tile.on {
  border-color: var(--accent);
  background: #f8fbff;
  box-shadow: 0 0 0 1px var(--accent);
}

.sh-os-tile[data-family="linux"] {
  border-top: 3px solid #0d9488;
}

.sh-os-tile[data-family="windows"] {
  border-top: 3px solid #2563eb;
}

.sh-os-tile-fam {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sh-os-tile[data-family="linux"] .sh-os-tile-fam { color: #0f766e; }
.sh-os-tile[data-family="windows"] .sh-os-tile-fam { color: #1d4ed8; }

.sh-os-tile-name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  width: 100%;
}

.sh-os-tile-count {
  margin-top: auto;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sh-os-tile-pct {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sh-os-empty {
  grid-column: 1 / -1;
  padding: 1.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.sh-sumrow {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
}

.sh-metric {
  padding: 0.125rem 1.375rem 0.125rem 0;
  margin-right: 1.375rem;
  border-right: 1px solid var(--border);
  min-width: 5.5rem;
}

.sh-metric:last-child { border: 0; margin-right: 0; }

.sh-metric button {
  all: unset;
  cursor: pointer;
  display: block;
  border-radius: 4px;
}

.sh-metric button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.sh-metric .n {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.sh-metric .l {
  font-size: 0.78125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sh-metric .l b {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.sh-metric .pct {
  color: #89919b;
  font-size: 0.75rem;
}

.sh-metric.on .l {
  color: var(--text);
  font-weight: 600;
}

.sh-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.875rem;
  gap: 2px;
  background: #eef0f4;
}

.sh-bar span { display: block; transition: flex-basis 0.3s; }

.sh-controls {
  display: flex;
  gap: 0.625rem;
  margin: 0.875rem 0;
  flex-wrap: wrap;
  align-items: center;
}

.sh-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.sh-search input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 0.625rem 0 2rem;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.8125rem;
}

.sh-search svg {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 14px;
  height: 14px;
  stroke: #89919b;
  fill: none;
  stroke-width: 2;
}

.sh-field {
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding-left: 0.625rem;
  gap: 0.5rem;
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.sh-field select {
  border: 0;
  background: transparent;
  height: 100%;
  padding: 0 0.5rem 0 0;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
}

.sh-count {
  margin-left: auto;
  font-size: 0.78125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sh-reset {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.78125rem;
  padding: 0.25rem;
  font-family: inherit;
}

.sh-matrix {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sh-mhead {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}

.sh-mhead h2 {
  font-size: 0.8125rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sh-mhead p {
  margin: 0.1rem 0 0;
  color: #89919b;
  font-size: 0.78125rem;
}

.sh-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.sh-legend span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sh-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: block;
}

.sh-legend em {
  font-style: normal;
  color: #89919b;
}

.sh-mbody {
  display: flex;
  gap: 2.75rem;
  padding: 1.125rem;
  overflow-x: auto;
  align-items: flex-start;
}

.sh-group { flex: none; }

.sh-ghead {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eef0f4;
}

.sh-ghead h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.sh-ghead > span {
  color: #89919b;
  font-size: 0.78125rem;
}

.sh-mini {
  margin-left: auto;
  display: flex;
  gap: 0.625rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sh-mini b { font-weight: 600; }

.sh-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 20px);
  gap: 4px;
}

.sh-sq {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  background: var(--c);
  transition: opacity 0.18s, transform 0.12s, box-shadow 0.12s;
  position: relative;
}

.sh-sq[data-s=healthy] { --c: var(--sh-healthy); opacity: 0.72; }
.sh-sq[data-s=attention] { --c: var(--sh-attention); }
.sh-sq[data-s=warning] { --c: var(--sh-warning); }
.sh-sq[data-s=critical] { --c: var(--sh-critical); }
.sh-sq[data-s=unknown] { --c: #94a3b8; opacity: 0.55; }

.sh-sq:hover {
  transform: scale(1.18);
  z-index: 2;
  opacity: 1;
  box-shadow: 0 2px 6px rgba(20, 26, 38, 0.3);
}

.sh-sq.dim { opacity: 0.13; filter: saturate(0.5); }
.sh-sq.dim:hover { opacity: 0.5; }
.sh-sq.match { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #161b26; }
.sh-sq.sel { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); z-index: 3; }

.sh-empty {
  padding: 2.5rem;
  color: #89919b;
  text-align: center;
  width: 100%;
}

.sh-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.125rem 0.5625rem 0.125rem 0.4375rem;
  background: var(--pb);
  color: var(--pc);
}

.sh-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pc);
}

.sh-pill[data-s=healthy] { --pb: var(--sh-healthy-bg); --pc: #21766a; }
.sh-pill[data-s=attention] { --pb: var(--sh-attention-bg); --pc: #8d6508; }
.sh-pill[data-s=warning] { --pb: var(--sh-warning-bg); --pc: #a54c0c; }
.sh-pill[data-s=critical] { --pb: var(--sh-critical-bg); --pc: #a02323; }
.sh-pill[data-s=unknown] { --pb: #f1f5f9; --pc: #64748b; }

.sh-tip {
  position: fixed;
  z-index: 55;
  pointer-events: none;
  background: #161b26;
  color: #e8ebf2;
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  min-width: 200px;
  font-size: 0.78125rem;
  box-shadow: 0 8px 24px rgba(10, 14, 24, 0.35);
  opacity: 0;
  transition: opacity 0.1s;
}

.sh-tip.show { opacity: 1; }

.sh-tip .h {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.4375rem;
}

.sh-tip .h b {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.8125rem;
  color: #fff;
  font-weight: 600;
}

.sh-tip dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
}

.sh-tip dt { color: #8c96ab; }
.sh-tip dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sh-tip .sh-pill { --pb: rgba(255, 255, 255, 0.1); }
.sh-tip .sh-pill[data-s=healthy] { --pc: #6fd3c3; }
.sh-tip .sh-pill[data-s=attention] { --pc: #f2c85a; }
.sh-tip .sh-pill[data-s=warning] { --pc: #f5a164; }
.sh-tip .sh-pill[data-s=critical] { --pc: #ff8585; }

.sh-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 38, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  z-index: 60;
}

.sh-scrim.open { opacity: 1; pointer-events: auto; }

.sh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100%;
  background: var(--surface);
  z-index: 70;
  box-shadow: -8px 0 30px rgba(20, 26, 38, 0.16);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sh-drawer.open { transform: none; }

.sh-dtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sh-x {
  all: unset;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
}

.sh-x:hover { background: #eef0f4; }

.sh-dbody {
  padding: 1.25rem;
  overflow: auto;
  flex: 1;
}

.sh-dname {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 1.1875rem;
  font-weight: 600;
  margin: 0 0 0.625rem;
  word-break: break-all;
}

.sh-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.sh-chip {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.5rem;
}

.sh-chip.m {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

.sh-sec {
  margin-top: 1.375rem;
  padding-top: 1rem;
  border-top: 1px solid #eef0f4;
}

.sh-sec h4 {
  margin: 0 0 0.375rem;
  font-size: 0.71875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #89919b;
}

.sh-big {
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sh-v { font-size: 0.875rem; }

.sh-v2 {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.sh-age {
  height: 6px;
  border-radius: 3px;
  margin-top: 0.75rem;
  position: relative;
  background: linear-gradient(90deg, var(--sh-healthy) 0 3%, var(--sh-attention) 3% 70%, var(--sh-warning) 70% 100%);
  opacity: 0.9;
}

.sh-age .mk {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 14px;
  background: #161b26;
  border-radius: 2px;
  transform: translateX(-1px);
}

.sh-agel {
  display: flex;
  justify-content: space-between;
  font-size: 0.71875rem;
  color: #89919b;
  margin-top: 0.375rem;
}

.sh-tablecard {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sh-table-scroll {
  max-height: min(560px, 60vh);
}

.sh-table td,
.sh-table th {
  white-space: nowrap;
}

.sh-table .sh-os {
  white-space: normal;
  max-width: 220px;
  line-height: 1.35;
  font-size: 0.8125rem;
}

.sh-table .sh-muted {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sh-table tbody tr {
  cursor: pointer;
}

.sh-table tbody tr.sel {
  background: #eef4ff;
}

.sh-table tbody tr.sel:hover {
  background: #e8f0fe;
}

.sh-pre {
  margin: 0;
  padding: 0.75rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.6875rem;
  line-height: 1.45;
  overflow: auto;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 760px) {
  .app-header { padding: 0 0.75rem; }
  .nav-tab { padding: 0.625rem 0.75rem; }
  .header-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .sh-mbody {
    flex-direction: column;
    gap: 1.5rem;
    overflow-x: hidden;
  }
  .sh-group { width: 100%; max-width: 100%; min-width: 0; }
  .sh-ghead { flex-wrap: wrap; }
  .sh-mini { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .sh-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }
  .sh-metric { padding-right: 0.875rem; margin-right: 0.875rem; }
  .sh-metric .n { font-size: 1.25rem; }
  .sh-count { margin-left: 0; width: 100%; }
  .sh-drawer {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 12px 12px 0 0;
    transform: translateY(102%);
  }
  .sh-drawer.open { transform: none; }
}

