/* ==========================================
   DETAILS WRAPPER
========================================== */

.details-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.details-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--text-muted);
}

/* Bubble container */
.details-bubble {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    padding: 14px 16px;
}

/* Placeholder (when nothing selected) */
.details-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}

.details-placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.details-placeholder-hint {
  font-size: 0.75rem;
  opacity: 0.8;
}

.details-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  min-width: 0;
  position: relative;
}

.details-header-right > #detailsStatus {
  margin-right: calc(20mm - 12px);
}

.details-pill.update-health {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    margin-right: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

/* Colour mapping (backend authoritative) */
.details-pill.update-health.green {
    background-color: #0f766e;
    color: #99f6e4;
}

.details-pill.update-health.red,
.details-pill.update-health.amber {
    background-color: #b45309;
    color: #ffedd5;
}

.priority-pill {
  background: #c62828;
  color: #ffffff;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.priority-text {
  font-size: 13px;
  color: #c62828;
  white-space: nowrap;
}

.btn-edit-primary {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-edit-primary:hover {
    background: #1d4ed8;
}

.details-actions-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Header block inside panel */
.details-header-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.details-name {
  font-size: 1rem;
  font-weight: 600;
}

.details-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.details-status {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  
}

/* Grid summary (optional top area) */
/* Grid summary (top metadata strip) */
.details-grid-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.details-grid-top > div {
  flex: 1 1 150px;
  min-width: min(190px, 100%);
}

.details-field-value {
  font-size: 0.82rem;
  display: grid;
  grid-template-columns: auto;
  align-items: start;
  column-gap: 0px;
  min-height: 24px;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.details-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
}

.capability-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.16);
}

.capability-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.capability-summary-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.capability-shell-admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-main);
}

.capability-shell-admin-copy {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.1;
}

.capability-shell-admin-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.capability-shell-admin-state {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
}

.capability-shell-admin-toggle .settings-switch {
    width: 42px;
    height: 22px;
}

.capability-shell-admin-toggle .settings-switch-slider::before {
    width: 16px;
    height: 16px;
}

.capability-shell-admin-toggle .settings-switch input:checked + .settings-switch-slider::before {
    transform: translateX(20px);
}

.capability-platform {
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-main);
}

.capability-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.capability-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.capability-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.capability-pill--available {
    color: #34d399;
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(52, 211, 153, 0.28);
}

.capability-pill--review {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(251, 191, 36, 0.30);
}

.capability-pill--unavailable {
    color: #f87171;
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(248, 113, 113, 0.30);
}

.capability-reasons {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--text-muted);
}

body.theme-light .capability-summary {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .capability-pill--available {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(5, 150, 105, 0.24);
}

body.theme-light .capability-pill--review {
    color: #92400e;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(180, 83, 9, 0.24);
}

body.theme-light .capability-pill--unavailable {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(185, 28, 28, 0.22);
}

#btnRemoteShell:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.details-subscription-pill-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.details-subscription-pill {
    border: none;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;

    /* Match Search / Reports gradient */
    background: linear-gradient(90deg, #22c55e, #3b82f6);
    color: #ffffff;
}

.details-subscription-pill:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


.exclusion-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

/* ==========================================
   SECTIONS
========================================== */

.details-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.85rem;
}

.details-section h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* ============================================================
   DETAILS PANEL TAB STRIP
   ============================================================ */

.details-tabs {
  display: flex;
  gap: 2px;
  padding: 0 0 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.details-tab-btn {
  appearance: none;
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.details-tab-btn:hover {
  color: var(--text-main);
  background: var(--glass-bg-hover);
}

.details-tab-btn.active {
  color: var(--text-main);
  background: var(--glass-bg);
  box-shadow: inset 0 -2px 0 var(--accent);
}

body.theme-light .details-tab-btn {
  color: var(--text-muted);
}

body.theme-light .details-tab-btn.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.details-tab-panel {
  display: none;
}

.details-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  overflow-y: visible;
}

.company-docs-panel,
.company-docs-table,
.company-docs-empty,
.company-docs-input,
.company-docs-add,
.company-docs-row-action {
  font-family: Verdana, Arial, sans-serif;
  font-size: 10pt;
}

.company-docs-panel {
  min-width: 0;
}

.company-docs-table {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

.company-docs-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.company-docs-row:last-child {
  border-bottom: none;
}

.company-docs-cell {
  min-width: 0;
  padding: 5px 8px;
  line-height: 1.25;
}

.company-docs-cell--label {
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.06);
}

.company-docs-cell--value {
  word-break: break-word;
}

.company-docs-cell--value a {
  color: var(--accent);
  text-decoration: none;
}

.company-docs-cell--value a:hover {
  text-decoration: underline;
}

.company-docs-table--editing .company-docs-cell {
  padding: 4px 6px;
}

.company-docs-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-docs-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.24);
  color: inherit;
  padding: 4px 6px;
  line-height: 1.2;
}

.company-docs-row-action,
.company-docs-add {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
  padding: 4px 8px;
  white-space: nowrap;
}

.company-docs-row-action:disabled {
  opacity: 0.4;
  cursor: default;
}

.company-docs-actions {
  margin-top: 8px;
}

.company-docs-empty {
  padding: 8px 10px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: var(--text-muted);
}

body.theme-light .company-docs-cell--label {
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
}

body.theme-light .company-docs-input {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.45);
}

@media (max-width: 900px) {
  .company-docs-row {
    grid-template-columns: 1fr;
  }

  .company-docs-cell--label {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .company-docs-input-wrap {
    flex-wrap: wrap;
  }
}

/* ============================================================
   COLLAPSIBLE SECTION SYSTEM
   ============================================================ */

.details-section h3.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 5px 0;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.details-section h3.section-toggle:hover {
  color: var(--text-main);
  padding-left: 4px;
  padding-right: 4px;
  background: var(--glass-bg-hover);
}

.section-arrow {
  font-size: 0.65rem;
  opacity: 0.55;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.details-section h3.section-toggle:hover .section-arrow {
  opacity: 0.9;
}

.section-body {
  overflow: hidden;
}

.section-body.collapsed {
  display: none;
}

/* ==========================================
   FIELD ROWS
========================================== */

.detail-row {
  display: flex;
  padding: 3px 0;
  border-bottom: 1px solid rgba(150,150,150,0.15);
}

.detail-row:last-child {
  border-bottom: none;
}

.d-label {
  width: 180px;
  font-weight: 600;
  opacity: 0.75;
}

.subsection-title {
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.6;
}

.bad {
  color: #e74c3c;
  font-weight: bold;
}

.btn-danger {
    background: #d9534f;
    color: white;
}

.btn-danger:hover {
    background: #c9302c;
}

/* ================================
   STATUS BADGE + IMPROVED TOOLTIP
================================= */
.details-status { 
    position: relative;
    cursor: default;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 48px;
    max-width: fit-content;
    box-shadow: none;
  }

/* Make UPDATE pill match Status pill size/shape exactly */
.details-pill.update-health {
    position: relative;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    width: auto;
    min-width: 64px;
    max-width: fit-content;
    line-height: 1.3; 
}


/* Color badges */
.details-status.green {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.28);
    color: #22c55e;
}
.details-status.amber {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.34);
    color: #f59e0b;
}
.details-status.red {
    background: rgba(239, 68, 68, 0.13);
    border-color: rgba(239, 68, 68, 0.32);
    color: #ef4444;
}

/* ===========================
   Traffic-light metric dots (TEXT-BASED)
=========================== */

.metric-line {
    font-size: 0.78rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.1rem;
    color: #e5e7eb; /* default neutral */
}
/* ===========================
   Tooltip metric severity FIX
=========================== */

.details-metric-line {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.15rem;
    color: #e5e7eb;
}

/* Dot base */
.details-metric-line .metric-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dot colours */
.details-metric-line.green .metric-dot {
    background-color: #22c55e;
}

.details-metric-line.amber .metric-dot {
    background-color: #f59e0b;
}

.details-metric-line.red .metric-dot {
    background-color: #ef4444;
}

/* Emphasise the triggering metric */
.details-metric-line.amber {
    color: #fbbf24;
    font-weight: 500;
}

.details-metric-line.red {
    color: #f87171;
    font-weight: 500;
}


/* ===========================
   Tooltip container (unchanged)
=========================== */

.swam-tooltip {
    position: fixed !important;
    display: none;
    background: rgba(25, 25, 25, 0.97);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 260px;
    min-width: 180px;
    font-size: 0.82rem;
    line-height: 1.25rem;
    z-index: var(--z-tooltip); /* 600 — always topmost interactive layer */
    pointer-events: none;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}


/* ==== FIXED SCROLL BEHAVIOUR FOR DETAILS PANEL ==== */

/* Allow the bubble to scroll when content is long */
.details-bubble {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Wrapper should not override overflow anymore */
.details-wrapper {
    overflow: visible;     /* No !important */
    position: relative;
}

/* Panel itself inherits scroll rules normally */
#detailsPanel {
    overflow: visible;     /* No !important */
    position: relative;
    max-height: 100%;      /* ensures bubble can scroll internally */
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.network-adapter {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  transition: background 0.15s ease;
}

.network-adapter:hover {
  background: var(--glass-bg-hover);
}

.network-adapter .title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* -----------------------------------------
   General Tab — version badge + uninstall stack
----------------------------------------- */
.general-meta-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.agent-version-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    user-select: none;

    /* LIGHT MODE */
    background: rgba(0, 0, 0, 0.08);
    color: #111;
}

/* DARK MODE — Agent version badge */
body.theme-dark .agent-version-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}


.detail-value.swam-id {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 0.85rem;
}

.copy-icon {
    cursor: pointer;
    opacity: 0.6;
}

.copy-icon:hover {
    opacity: 1;
}

.details-panel {
    position: relative;
}

.tv-link {
    color: #22c55e;
    font-weight: 500;
    text-decoration: none;
}

.tv-link:hover {
    text-decoration: underline;
}

.details-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

/* =====================================================
   UNINSTALL TOGGLE — SHARED BASE
   ===================================================== */

.btn-uninstall-toggle {
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* =====================================================
   UNINSTALL (RED) — LIGHT & DARK MODE
   ===================================================== */

.btn-uninstall-toggle.uninstall {
    background: #dc2626; /* red */
    color: #ffffff;
}

.btn-uninstall-toggle.uninstall:hover {
    background: #e77b7b;
}

/* =====================================================
   CANCEL UNINSTALL (GREY) — LIGHT & DARK MODE
   ===================================================== */

.btn-uninstall-toggle.cancel {
    background: #6b7280; /* neutral grey */
    color: #ffffff;
}

.btn-uninstall-toggle.cancel:hover {
    background: #4b5563;
}

/* =====================================================
   LEGACY SUPPORT (DO NOT REMOVE)
   ===================================================== */

.btn-uninstall {
    background: #dc2626;
    color: white;
}

.btn-cancel-uninstall {
    background: #6b7280;
    color: white;
}

/* -----------------------------------------
   Details header actions (new edit UI)
------------------------------------------ */

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.details-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}


.details-hostname {
  font-weight: 700;
}

.details-header-actions {
  margin-left: auto;   /* critical */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.details-close,
.details-actions-toggle {
  display: none;
}

.details-action-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

/* Buttons */
.d-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.12s ease, border-color 0.12s ease;
  user-select: none;
}

.d-btn:active {
  transform: translateY(1px);
}

.d-btn-ghost {
  background: rgba(255,255,255,0.06);
  color: inherit;
}

.d-btn-ghost:hover {
  border-color: rgba(255,255,255,0.28);
}

.d-btn-primary {
  background: rgba(37, 99, 235, 0.95);
  border-color: rgba(37, 99, 235, 0.95);
  color: #fff;
}

.d-btn-primary:hover {
  opacity: 0.95;
}

.d-btn-secondary {
    background: rgba(148, 163, 184, 0.16);
    color: inherit;
}

.d-btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.34);
}

.d-btn-warning {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.12);
    color: #020617;
}

.d-btn-warning:hover {
    opacity: 0.92;
}

/* Editing inputs */
.detail-edit-input,
.detail-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.20);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.detail-edit-textarea {
  min-height: 90px;
  resize: vertical;
}

.d-btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
}

.d-btn-danger:hover {
    background: #dc2626;
}

.details-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);

    display: flex;
    align-items: center;
    justify-content: space-between; /* ← key change */
    gap: 16px;
}

.footer-swam-id {
    flex-shrink: 0;
}

.details-content-flow {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0; /* critical for zoom + overflow */
}
.details-flex-spacer {
    flex: 1 1 auto;
}

/* =====================================================
   LIGHT MODE — DETAILS PANEL CONTRAST FIX
   ===================================================== */

body.theme-light .details-bubble {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
}

/* Section separators */
body.theme-light .details-section {
    border-top: 1px dashed rgba(15, 23, 42, 0.18);
}

/* Field rows */
body.theme-light .detail-row {
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

/* Labels vs values */
body.theme-light .d-label {
    color: #334155;
    opacity: 0.9;
}

body.theme-light .d-value {
    color: #0f172a;
}


body.theme-light .details-status.amber {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.34);
    box-shadow: none;
}
/* =====================================================
   LIGHT MODE — BUTTON POLISH
   ===================================================== */

body.theme-light .d-btn {
    border: 1px solid rgba(15, 23, 42, 0.18);
}

/* Primary (Edit / Save) */
body.theme-light .d-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

body.theme-light .d-btn-primary:hover {
    background: #1d4ed8;
}

/* Danger (Delete / Uninstall) */
body.theme-light .d-btn-danger,
body.theme-light .btn-uninstall-toggle.uninstall {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

body.theme-light .d-btn-danger:hover,
body.theme-light .btn-uninstall-toggle.uninstall:hover {
    background: #b91c1c;
}
/* Network cards – accent consistency */
.network-adapter {
    border-left: 4px solid var(--accent);
    background: var(--card-bg);
}

.theme-light .network-adapter {
    border-left-color: var(--accent);
    background: #f9fafb;
}

/* =========================================
   NETWORK CARDS — LIGHT MODE (MATCH DARK)
   ========================================= */

body.theme-light .network-adapter {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left-width: 4px;
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}

/* Preserve exact accent logic */
body.theme-light .network-adapter.lan {
    border-left-color: #22c55e; /* green */
}

body.theme-light .network-adapter.wifi {
    border-left-color: #3b82f6; /* blue */
}

body.theme-light .network-adapter .title {
    color: #0f172a;
}

.status-explanation {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
    color: #e5e7eb; /* light text on dark bg */
}

/* Light mode: darker text is readable */
body.theme-light .details-status.red + .status-explanation {
  color: #7f1d1d;
}

body.theme-light .details-status.amber + .status-explanation {
  color: #78350f;
}

/* Dark mode: keep it bright so it's visible */
body:not(.theme-light) .details-status.red + .status-explanation {
  color: #fecaca; /* light red */
}

body:not(.theme-light) .details-status.amber + .status-explanation {
  color: #fde68a; /* light amber */
}



.network-adapter.lan    { border-left: 4px solid #22c55e; }
.network-adapter.wifi   { border-left: 4px solid #3b82f6; }
.network-adapter.virtual{ border-left: 4px solid #a855f7; }

/* ============================================================
   DIAGNOSTICS TAB — LEGEND + CONTROLS
   ============================================================ */

.diag-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.diag-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

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

.diag-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.diag-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

/* ==========================================
   Diagnostic popover
   ========================================== */

.diagnostic-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diagnostic-popover {
  position: absolute;
  top: 42px;
  right: 0;
  width: 240px;
  background: var(--panel-bg, #0f172a);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  z-index: var(--z-toolbar); /* 50 — same layer as search-panel; later DOM position wins */

  display: none;
}

.diagnostic-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: var(--panel-bg, #0f172a);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: rotate(45deg);
}

/* Header */
.diagnostic-popover-header {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Body */
.diagnostic-popover-body {
  padding: 12px;
}

.diagnostic-popover-body label {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.diagnostic-popover-body input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: inherit;
}

.diagnostic-popover-body input:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Help text */
.diagnostic-help {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 6px;
}

/* Actions */
.diagnostic-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.diagnostic-popover.open {
  display: block;
}

/* ==========================================
   Laptop / High-DPI safety net
   ========================================== */

/* ==========================================
   Responsive safety (only when genuinely narrow)
   ========================================== */

@media (max-width: 1200px) {
  .details-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
  }

  .details-header-right {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .details-title {
    text-align: left;
    padding-top: 8px;
  }

  .details-action-menu {
    flex-basis: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .details-header-actions {
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .details-grid-top {
    gap: 10px 14px;
  }
}

@media (max-width: 1100px) {
  .details-header {
    grid-template-columns: auto auto 1fr;
    align-items: center;
  }

  .details-close {
    display: inline-flex;
  }

  .details-header-right {
    justify-content: flex-end;
  }

  .details-actions-toggle {
    display: inline-flex;
  }

  .details-action-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: var(--z-popover);
    display: none;
    width: min(320px, calc(100vw - 48px));
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
  }

  .details-action-menu.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .details-action-menu .d-btn,
  .details-action-menu .diagnostic-action {
    width: 100%;
  }

  .details-action-menu .diagnostic-action {
    flex-direction: column;
    align-items: stretch;
  }

  .diagnostic-popover {
    position: fixed;
    top: 96px;
    right: 24px;
    width: min(280px, calc(100vw - 48px));
  }

  .diagnostic-popover::before {
    display: none;
  }
}

@media (max-width: 760px) {
  .details-header {
    grid-template-columns: 1fr auto;
  }

  .details-header-right {
    grid-column: 1 / -1;
  }

  .details-grid-top {
    display: grid;
    grid-template-columns: 1fr;
  }

  .exclusion-grid {
    align-items: stretch;
    gap: 10px;
  }

  .exclusion-grid label {
    flex: 1 1 150px;
  }
}

/* =====================================================
   STATUS / UPDATE EXPLANATION — CARD BUBBLE (HOVER ONLY)
   ===================================================== */

#statusExplanation[style*="position: absolute"] { /* popover-level: above toolbar, below settings panel */
    background: var(--card-bg);
    color: var(--text-main);

    border-radius: 12px;
    padding: 12px 14px;
    max-width: 320px;

    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);

    font-size: 0.85rem;
    line-height: 1.4;
    white-space: normal;

    z-index: var(--z-popover); /* 100 — above toolbar (50), below settings (200) */
}

/* Inner content should not flatten the card */
#statusExplanation[style*="position: absolute"] .status-explanation {
    margin: 0;
    color: inherit;
}



/* =====================================================
   UPDATE PILL — MATCH STATUS BUBBLE (LIGHT + DARK)
   ===================================================== */

#statusExplanation {
    background: #111827; /* fallback dark */
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow:
        0 6px 18px rgba(0,0,0,0.25),
        0 12px 32px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 1;                 /* override earlier fade */
    white-space: normal;        /* allow wrapping like status bubble */
    max-width: 320px;
}
/* Light mode — Update bubble should look like Status bubble */

body.theme-light #statusExplanation {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08),
        0 12px 28px rgba(0,0,0,0.12);
}
/* Update bubble header polish */

#statusExplanation .details-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
body.theme-light #statusExplanation .details-status.green {
    background: #22c55e;
    color: #ffffff;
}

/* =====================================================
   DIAGNOSTIC POPOVER — LIGHT MODE CONTRAST FIX
   ===================================================== */

body.theme-light .diagnostic-popover {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08),
        0 12px 28px rgba(0,0,0,0.12);
}

body.theme-light .diagnostic-popover::before {
    background: #ffffff;
    border-left: 1px solid rgba(15, 23, 42, 0.18);
    border-top: 1px solid rgba(15, 23, 42, 0.18);
}

/* Header */
body.theme-light .diagnostic-popover-header {
    color: #0f172a;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

/* Labels */
body.theme-light .diagnostic-popover-body label {
    color: #334155;
    opacity: 1;
}

/* Inputs */
body.theme-light .diagnostic-popover-body input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

body.theme-light .diagnostic-popover-body input::placeholder {
    color: #94a3b8;
}

body.theme-light .diagnostic-popover-body input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Help text */
body.theme-light .diagnostic-help {
    color: #64748b;
    opacity: 1;
}

/* Footer divider */
body.theme-light .diagnostic-popover-actions {
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

/* =====================================================
   LIGHT MODE — UPDATE PILL (CLEAN OVERRIDE)
   ===================================================== */

body.theme-light .details-pill.update-health.green {
    background: #d1fae5;          /* soft green */
    color: #065f46;               /* readable green text */
    border: 1px solid #6ee7b7;
}

body.theme-light .details-pill.update-health.amber,
body.theme-light .details-pill.update-health.red {
    background: #ffedd5;          /* soft amber */
    color: #7c2d12;               /* dark amber text */
    border: 1px solid #fdba74;
}

.details-pill.update-health {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.details-pill.update-health:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* =====================================================
   TOUCH FRIENDLY TARGETS (iPad+)
   ===================================================== */

@media (pointer: coarse) {

  .d-btn,
  .btn-uninstall-toggle,
  .diagnostic-popover-actions button {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
  }

}
@media (pointer: coarse) {

  .diagnostic-popover {
    right: auto;
    left: 0;
    transform: translateX(-10%);
  }

}
@media (pointer: coarse) {

  .details-bubble {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

}

@media (pointer: coarse) {

  .details-subtitle,
  .details-field-label,
  .diagnostic-help {
    font-size: 0.85rem;
  }

}

@media (pointer: coarse) {

  .diagnostic-popover-body input {
    min-height: 44px;
    font-size: 15px;
  }
}

/* Keep the status pill aligned with text baseline */
.details-status {
  line-height: 1;
}

.av-label.green {
    color: #22c55e;
    font-weight: 600;
}

.av-label.amber {
    color: #f59e0b;
    font-weight: 600;
}

.av-label.red {
    color: #ef4444;
    font-weight: 700;
}
/* =====================================================
   UPDATES HOVER BUBBLE — MATCH STATUS TOOLTIP
   ===================================================== */

#updateBubble {
    position: absolute;
    background: var(--card-bg);
    color: var(--text-main);

    border-radius: 12px;
    padding: 12px 14px;
    max-width: 320px;

    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);

    font-size: 0.85rem;
    line-height: 1.4;

    z-index: var(--z-popover); /* 100 — above toolbar (50), below settings (200) */
}

/* Inner content consistency */
#updateBubble .status-explanation {
    margin: 0;
    color: inherit;
}
/* =========================================================
   Combined Status + Updates bubble layout
   ========================================================= */

.swam-dual-bubble {
    display: flex;
    flex-direction: column;
    gap: 14px; /* visual separation between sections */
}
/* Extra breathing room after SYSTEM STATUS metrics */
.status-explanation {
    padding-bottom: 4px;
}

.status-explanation + .status-explanation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}
.status-explanation-line {
    margin-top: 4px;
}

.status-explanation-recommendation {
    margin-top: 6px;
    line-height: 1.4;
}
/* =========================================================
   Status + Updates typography alignment
   ========================================================= */

/* Make Updates text match Status metric font */
.status-explanation-line,
.status-explanation-recommendation {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: normal;
}

/* Match label/value emphasis used in status metrics */
.status-explanation-line strong {
    font-weight: 600;
}

/* Reduce visual crowding inside Updates block */
.status-explanation-line + .status-explanation-line {
    margin-top: 3px;
}
/* =========================================================
   Status + Updates text — LIGHT MODE FIX (CORRECT)
   ========================================================= */

/* Base typography (safe for both modes) */
.details-metric-line,
.status-explanation-line,
.status-explanation-recommendation {
    font-size: 13px;
    line-height: 1.4;
}

/* Labels */
.metric-label,
.status-explanation-line strong {
    font-weight: 600;
}

/* LIGHT MODE — match rest of app */
body.theme-light .details-metric-line {
    color: #0f172a;
}

body.theme-light .status-explanation-line {
    color: #0f172a;
}

/* Labels slightly darker */
body.theme-light .metric-label,
body.theme-light .status-explanation-line strong {
    color: #020617;
}

/* Severity emphasis (light mode) */
body.theme-light .details-metric-line.red {
    color: #b91c1c;
}

body.theme-light .details-metric-line.amber {
    color: #b45309;
}

/* ==========================================
   Subscription Popover
========================================== */

.subscription-popover {
    position: absolute;
    top: 40px;
    right: 0;
    width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    z-index: var(--z-popover); /* 100 — above toolbar (50), below settings (200) */
    display: none;
}

.subscription-popover-header {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
}

.subscription-popover-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-popover-actions {
    padding: 10px 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}
.status-group{
    margin-top:8px;
    font-weight:600;
    color:#9ca3af;
}

.status-group-block {
    margin-bottom: 10px;
}

.status-group {
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 2px;
}

.status-group-items {
    margin: 0;
    padding: 0;
}

.status-line {
    margin: 0;
    padding: 0;
    line-height: 1.35;
}
/* ============================================================
   ASSET DETAIL — HEADER
   ============================================================ */
.asset-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    row-gap: 8px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.asset-detail-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asset-detail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Type pill */
.asset-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.asset-type-printers  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.asset-type-networks  { background: rgba(168,85,247,0.15); color: #c084fc; }
.asset-type-mobile    { background: rgba(34,197,94,0.15);  color: #4ade80; }

body.theme-light .asset-type-printers { background: rgba(59,130,246,0.12); color: #2563eb; }
body.theme-light .asset-type-networks { background: rgba(168,85,247,0.12); color: #7c3aed; }
body.theme-light .asset-type-mobile   { background: rgba(34,197,94,0.12);  color: #16a34a; }

/* ============================================================
   ASSET DETAIL — BODY FIELDS
   ============================================================ */
.asset-detail-body {
    padding: 12px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asset-detail-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

.asset-detail-row:last-child {
    border-bottom: none;
}

.asset-detail-label {
    flex: 0 0 160px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.asset-detail-value {
    flex: 1;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 8px;
}

.asset-detail-value a {
    color: var(--accent);
    text-decoration: none;
}
.asset-detail-value a:hover { text-decoration: underline; }

/* Masked credential */
.asset-masked {
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.asset-reveal-btn {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
}

.asset-reveal-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ============================================================
   ASSET FORM
   ============================================================ */
.asset-form {
    padding: 12px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.asset-form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.asset-form-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.asset-form-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.asset-form-label {
    flex: 0 0 160px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 7px;
}

.asset-form-input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    font-size: 0.85rem;
    transition: border-color 0.15s ease;
}

.asset-form-input:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.asset-form-input {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
}

.asset-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    flex-shrink: 0;
}

/* ============================================================
   ASSET DETAIL — HEADER RIGHT (warranty badge + action buttons)
   ============================================================ */
.asset-detail-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   WARRANTY BADGE
   ============================================================ */
.asset-warranty-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.asset-warranty-in {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.25);
}

.asset-warranty-out {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

body.theme-light .asset-warranty-in {
    background: rgba(22, 163, 74, 0.10);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.25);
}

body.theme-light .asset-warranty-out {
    background: rgba(220, 38, 38, 0.10);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.25);
}

/* ============================================================
   ASSET — PAIRED HALF-WIDTH FIELDS (shared grid base)
   ============================================================ */
.asset-field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ---- Detail view context ---- */
.asset-detail-body .asset-field-pair {
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
}

.asset-detail-body .asset-field-pair:last-child {
    border-bottom: none;
}

.asset-detail-cell {
    display: flex;
    flex-direction: row;      /* inline: label beside value on the same row */
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    min-width: 0;             /* allow flex shrink inside grid column */
}

.asset-detail-body .asset-field-pair .asset-detail-cell:first-child {
    padding-right: 16px;
    border-right: 1px solid var(--border-subtle);
}

.asset-detail-body .asset-field-pair .asset-detail-cell:last-child {
    padding-left: 16px;
}

.asset-detail-cell .asset-detail-label {
    flex: 0 0 auto;
    white-space: nowrap;      /* keep label on one line */
    margin-bottom: 0;
}

.asset-detail-cell .asset-detail-value {
    flex: 1;
    min-width: 0;             /* allow long values to break, not overflow */
}

/* ---- Form view context ---- */
.asset-form .asset-field-pair {
    gap: 12px;
    margin-bottom: 0;
}

.asset-form-cell {
    display: flex;
    flex-direction: row;      /* inline: label beside input on the same row */
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.asset-form-cell .asset-form-label {
    flex: 0 0 auto;
    white-space: nowrap;      /* keep label on one line */
    padding-top: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.asset-form-cell .asset-form-input {
    flex: 1;
    min-width: 0;             /* allow input to shrink, not overflow */
    width: auto;              /* override width:100% which fights flex */
}

/* ============================================================
   ASSET DETAIL / FORM — SECTION DIVIDER
   Used to visually group fields (e.g. Networking block within printer detail/form)
   ============================================================ */
.asset-section-divider {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 10px 0 4px;
    margin-top: 6px;
    border-top: 1px solid var(--border-subtle);
    width: 100%;
}

/* Suppress the top border on the very first divider in a section
   (when it directly follows the section heading) */
.asset-form-section > .asset-section-divider:first-child,
.asset-detail-body > .asset-section-divider:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 4px;
}

/* Light mode — ensure readable contrast */
body.theme-light .asset-section-divider {
    color: var(--text-muted);
    border-top-color: var(--border-subtle);
}

/* Collapse to single column on narrow detail pane */
@media (max-width: 540px) {
    .asset-field-pair {
        grid-template-columns: 1fr;
    }
    .asset-detail-body .asset-field-pair .asset-detail-cell:first-child {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-subtle);
    }
    .asset-detail-body .asset-field-pair .asset-detail-cell:last-child {
        padding-left: 0;
    }
}

/* ==========================================
   BITLOCKER
========================================== */

.bl-volume {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm, 6px);
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-alt);
}

.bl-volume-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bl-drive {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.bl-enc-method {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.bl-volume-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.bl-key-row {
    padding: 6px 0;
    border-top: 1px solid var(--border-subtle);
}

.bl-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}

.bl-key-id {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-family: monospace;
}

.bl-key-pw {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.bl-pw-mask {
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.bl-pw-value {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
    user-select: all;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.bl-reveal-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.bl-reveal-btn:hover {
    background: var(--accent);
    color: #fff;
}

.bl-no-keys {
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 4px;
}

/* Light mode */
body.theme-light .bl-volume {
    background: var(--bg-card);
    border-color: var(--border-subtle);
}

body.theme-light .bl-pw-value {
    background: #f8f9fa;
}
