/* Spectra — Azure Cloud / Microsoft Fluent UI design system */
:root {
  --bg: #faf9f8;
  --card: #ffffff;
  --text: #323130;
  --text-secondary: #605e5c;
  --text-tertiary: #a19f9d;
  --primary: #0078d4;
  --primary-hover: #106ebe;
  --primary-active: #005a9e;
  --neutral-10: #faf9f8;
  --neutral-20: #f3f2f1;
  --neutral-40: #edebe9;
  --neutral-60: #c8c6c4;
  --neutral-80: #8a8886;
  --success: #107c10;
  --danger: #d13438;
  --danger-bg: #fde7e9;
  --warn: #ca5010;
  --warn-bg: #ffd3b0;
  --warn-yellow-bg: #fff4ce;
  --warn-yellow: #986f0b;
  --info: #0078d4;
  --info-bg: #deecf9;
  --radius: 2px;
  --shadow-card: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132),
                 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Segoe UI Web (West European)",
          system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  /* Motion Tokens (features-0003) */
  --duration-enter: 220ms;
  --duration-exit: 180ms;
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-cubic: cubic-bezier(0.32, 0, 0.67, 0);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 20px 24px 64px; }
@media (max-width: 680px) { .container { padding: 16px 12px 40px; } }
.hidden { display: none !important; }

/* ---- header ----------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #e3e6e8;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; }
.brand-name {
  display: flex;
  flex-direction: column;
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
  line-height: 0.95;
  user-select: none;
}
.brand-line {
  white-space: nowrap;
}
.brand-line-top {
  margin-bottom: 1px;
}
.brand-spacer {
  visibility: hidden;
  display: inline;
}
.brand-beta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--info-bg);
  border: 1px solid var(--neutral-40);
  border-radius: 999px;
  padding: 2px 8px;
  align-self: center;
}

/* ---- cards ------------------------------------------------------------ */
.card {
  background: var(--card);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}
.card-title .hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* ---- dropzone ---------------------------------------------------------- */
.dropzone {
  border: 1px dashed var(--neutral-80);
  border-radius: var(--radius);
  background: var(--neutral-10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.1s ease;
  color: var(--text-secondary);
}
.dropzone:hover, .dropzone.dragover {
  background: #eff6fc;
  border-color: var(--primary);
}
/* File-selected state: solid blue border + light-blue bg (instructions9 §2) */
.dropzone.file-selected {
  background: #eff6fc;
  border-style: solid;
  border-color: var(--primary);
}
.dropzone.file-selected .dz-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}
.dropzone .dz-icon { color: var(--primary); }
.dropzone .dz-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 10px 0 2px;
}
.dropzone a { color: var(--primary); font-weight: 600; cursor: pointer; }
.dropzone a:hover { text-decoration: underline; }
.dropzone:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.dropzone.uploading, .dropzone.error { cursor: default; }
.dropzone.uploading:hover, .dropzone.error:hover {
  background: var(--neutral-10);
  border-color: var(--neutral-80);
}
.dropzone.error {
  border-style: dashed;
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* ---- dropzone auto-upload progress (features-0001) ---------------------- */
.dz-progress {
  width: 100%;
  margin-top: 4px;
  text-align: left;
}
.dz-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.dz-file-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.dz-cancel {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: var(--radius);
}
.dz-cancel:hover { background: var(--neutral-20); text-decoration: underline; }
.dz-status {
  font-size: 12px;
  color: var(--text-secondary);
}
.dz-pct { font-size: 12px; }
.dz-error-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 6px;
  text-align: left;
}
.dz-error-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.dz-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: var(--radius);
}
.dz-action:hover { text-decoration: underline; }
.dz-error-sep { color: var(--text-secondary); }

/* ---- module selection cards (grid) ------------------------------------- */
.module-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.module-group {
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.module-group:hover {
  border-color: var(--neutral-60);
}
.module-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s ease;
}
.module-group-header:hover {
  background: var(--neutral-20);
}
.module-group-header[aria-expanded="true"] {
  background: #f8f9fa;
  border-bottom: 1px solid var(--neutral-40);
}
.module-group-header .chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.module-group-header[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}
.module-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.module-count-badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
  background: var(--neutral-20);
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease;
}
.module-count-badge.badge-all {
  background: var(--info-bg);
  color: var(--primary);
}
.module-count-badge.badge-none {
  background: #f3f2f1;
  color: var(--neutral-60);
}
.module-link { color: var(--primary); cursor: pointer; user-select: none; }
.module-link:hover { text-decoration: underline; }

.module-box {
  margin-top: 16px;
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.module-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--neutral-20);
  border-bottom: 1px solid var(--neutral-40);
}
.module-box-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.module-box-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.module-box-actions .module-link.disabled {
  color: var(--text-tertiary);
  pointer-events: none;
}
.v-divider {
  width: 1px;
  height: 14px;
  background: var(--neutral-40);
}

/* ── 6-Profile Collapsible Accordion ───────────────────────── */
.module-accordion {
  background: var(--card);
}

.accordion-item {
  border-bottom: 1px solid var(--neutral-40);
}
.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: background-color 0.15s ease;
  user-select: none;
}
.accordion-header:hover {
  background-color: #f3f2f1;
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex: none;
}
.accordion-item.open .accordion-chevron {
  transform: rotate(90deg);
}

.accordion-profile-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex: none;
}

.accordion-title {
  font-size: 14px;
  font-weight: 600;
  color: #323130;
}

.accordion-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  background: #eff6fc;
  color: #0078d4;
  transition: background 0.2s ease, color 0.2s ease;
}
.accordion-badge.badge-none {
  background: #f3f2f1;
  color: #605e5c;
}

.accordion-content {
  background: #faf9f8;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 16px;
}
.accordion-item.open .accordion-content {
  max-height: 3000px;
  padding: 16px;
}

.accordion-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}


.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) { .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .module-grid { grid-template-columns: 1fr; } }

.module-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.module-card:hover { border-color: var(--primary); background: var(--neutral-20); }
.module-card.selected,
.module-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--info-bg);
}
.module-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.mc-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex: none;
}
.module-card:hover .mc-icon,
.module-card.selected .mc-icon,
.module-card:has(input:checked) .mc-icon { color: var(--primary); }

.mc-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mc-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mc-box {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--neutral-80);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mc-box::after {
  content: "";
  display: none;
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.module-card.selected .mc-box,
.module-card:has(input:checked) .mc-box {
  background: var(--primary);
  border-color: var(--primary);
}
.module-card.selected .mc-box::after,
.module-card:has(input:checked) .mc-box::after { display: block; }

/* ---- upload ------------------------------------------------------------ */
.upload-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
/* Analyze & Preview buttons: spec height 32px, 13px 600, 2px radius */
.btn-analyze,
.btn-preview {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
/* Upload spinner animation */
.btn-spinner { animation: btn-spin 0.75s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---- file chip (instructions9 §3) --------------------------------------- */
.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
}
.file-chip-icon { flex: none; }
.file-chip-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chip-size {
  flex: none;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-left: 8px;
}
.file-chip-remove {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 4px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: auto;
}
.file-chip-remove:hover { background: var(--neutral-20); }

.progress { margin-top: 20px; }
.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.progress-bar { height: 6px; background: var(--neutral-20); border-radius: var(--radius); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--primary); transition: width 0.2s ease; }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  padding: 5px 20px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-active); }
.btn-primary:disabled { background: var(--neutral-60); cursor: not-allowed; }
.btn-secondary { background: var(--card); border-color: var(--neutral-80); color: var(--text); }
.btn-secondary:hover { background: var(--neutral-20); }
.btn-danger { background: var(--card); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 3px 12px; font-size: 13px; }

/* ---- analyses table ---------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.jobs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jobs-table th {
  background: var(--neutral-10);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
}
.jobs-table td { padding: 10px 12px; border-top: 1px solid var(--neutral-40); vertical-align: middle; }
.jobs-table tbody tr { cursor: pointer; }
.jobs-table tbody tr:hover { background: var(--neutral-20); }
.jobs-table tbody tr.selected { background: #edf5fd !important; }
.jobs-table .mono { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.jobs-table .file { font-weight: 600; }
.jobs-table .muted { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.jobs-table .empty { text-align: center; color: var(--text-tertiary); padding: 36px 12px; }

/* ---- status dots ------------------------------------------------------- */
.status { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-success .status-dot { background: var(--success); }
.status-running .status-dot { background: var(--info); }
.status-failed .status-dot { background: var(--danger); }
.status-queued .status-dot { background: var(--neutral-80); }

/* ---- row action icons -------------------------------------------------- */
.row-actions { display: flex; gap: 2px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { background: var(--neutral-20); color: var(--primary); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---- selected job: unified card head ----------------------------------- */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head .card-title { margin: 0; }
.detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex: none;
}
.detail-close:hover { background: var(--neutral-20); }
.detail-close svg { width: 14px; height: 14px; }

/* ---- selected job panel ------------------------------------------------- */
#detail { min-height: 148px; min-width: 0; max-width: 100%; }
.panel { min-width: 0; max-width: 100%; }
.panel-file { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.panel-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 16px;
}
.panel-sub b { color: var(--text); font-weight: 600; }
.panel-msg {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  font-size: 14px;
  color: var(--text);
}
.panel-msg .mono { color: var(--text-secondary); }

.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.panel-actions .btn {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
}
.panel-actions .btn svg { width: 14px; height: 14px; }

/* ---- stats cards -------------------------------------------------------- */
.stats { display: flex; gap: 16px; margin-bottom: 14px; }
.stat {
  flex: 1;
  background: var(--neutral-10);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.stat.high .num { color: #d13438; }
.stat.mid .num { color: #ff8c00; }
.stat.ok .num { color: #0078d4; }
@media (max-width: 640px) { .stats { flex-direction: column; } }

.layer-risk { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-secondary); font-size: 13px; margin-top: 14px; }
.layer-risk b { color: var(--text); }

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  margin: 20px 0 10px;
}
.section-title .hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ---- findings header & search box --------------------------------------- */
.findings-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.findings-header-bar .section-title {
  margin: 0;
}
.findings-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.findings-search-wrap .search-icon {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.findings-search-wrap input[type="search"] {
  width: 220px;
  padding: 5px 10px 5px 28px;
  border: 1px solid var(--neutral-60);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, width 0.2s ease;
}
.findings-search-wrap input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  width: 260px;
}
.findings-search-wrap input[type="search"]::placeholder {
  color: var(--text-tertiary);
}
.findings-count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--neutral-20);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.agg-no-results {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  margin-top: 8px;
}

/* ---- aggregated findings (dashboard) ------------------------------------ */
.agg-list { border: 1px solid var(--neutral-40); border-radius: var(--radius); overflow: hidden; }
.agg-group { background: #fff; border-bottom: 1px solid var(--neutral-40); }
.agg-group:last-child { border-bottom: 0; }
.agg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px 11px 16px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  color: var(--text);
}
.agg-header:hover { background: var(--neutral-20); }
.agg-header .chevron {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.agg-group.expanded .agg-header .chevron { transform: rotate(90deg); }
.agg-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: #323130; }
.count-badge {
  flex: none;
  background: #323130;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
}
.sev-badge {
  flex: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
}
.sev-badge.sev-critical { background: #d13438; }
.sev-badge.sev-high { background: #ff8c00; }
.sev-badge.sev-medium { background: #ffb900; }
.sev-badge.sev-low { background: #0078d4; }
.sev-badge.sev-observation { background: #8a8886; }

.agg-details { display: none; padding: 0 16px 14px; }
.agg-group.expanded .agg-details { display: block; }
.agg-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 8px; }
.agg-module { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.agg-conf, .agg-hosts { font-size: 12px; color: var(--text-secondary); }
.agg-stats { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.agg-stats b { color: var(--text); }
.agg-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.agg-table-wrap { overflow-x: auto; border: 1px solid var(--neutral-40); border-radius: var(--radius); }
.agg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.agg-table th {
  background: var(--neutral-10);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 8px 10px;
  white-space: nowrap;
}
.agg-table td { padding: 8px 10px; border-top: 1px solid var(--neutral-40); vertical-align: middle; }
.agg-table tr:hover td { background: var(--neutral-20); }
.agg-table .mono { font-family: var(--mono); font-size: 12px; }
.agg-table .icon-btn { width: 26px; height: 26px; }
.show-all {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}
.show-all:hover { text-decoration: underline; }

.no-findings { color: var(--text-tertiary); font-size: 13px; }

/* ---- running / failed states ------------------------------------------- */
.failed-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--danger);
}
.failed-box h2 { margin: 0 0 6px; font-size: 16px; }
.failed-box p { margin: 0; font-size: 13px; }

.placeholder { color: var(--text-tertiary); font-size: 14px; }

/* ---- toast (copy-to-clipboard feedback) --------------------------------- */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  background: #323130;
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 2px;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---- in-app confirmation dialog --------------------------------------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-box {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.22), 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.13);
  padding: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  animation: confirm-in 0.12s ease;
}
@keyframes confirm-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1);    }
}
.confirm-dialog-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.confirm-dialog-body {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- GeoIP flag & tooltip --------------------------- */
.geo-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: pointer;
  vertical-align: middle;
}
.geo-container .fi {
  flex: none;
  width: 16px;
  height: 12px;
  border-radius: 1px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}
.geo-container[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #323130;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 2px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  box-shadow: 0 3.2px 7.2px rgba(0, 0, 0, 0.18);
  z-index: 100;
  pointer-events: none;
}
.geo-container[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}
.geo-container .fi.fi-xx,
.geo-container .fi.fi-unknown {
  background-color: #e1dfdd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  overflow: hidden;
}
.geo-container .fi.fi-xx::before,
.geo-container .fi.fi-unknown::before {
  content: "🌐";
  font-size: 9px;
}

/* ==================================================================
   Timeline Preview
   ================================================================== */

.preview-card {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #0078d4, #00b7c3, #50e6ff) 1;
  animation: previewReveal 0.3s ease-out;
}

@keyframes previewReveal {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.preview-header { margin-bottom: 12px; }

.preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.preview-meta b { color: var(--text); font-weight: 600; }

/* Loading state */
.preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.preview-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Chart container */
.preview-chart-wrap {
  position: relative;
  height: 200px;
  margin-bottom: 16px;
  padding: 8px 0;
}

.preview-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Range slider */
.preview-slider-wrap {
  margin-bottom: 16px;
  padding: 0 9px;
  box-sizing: border-box;
  overflow: visible;
}

.preview-time-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-family: var(--mono);
}

.preview-time-labels span:nth-child(2) {
  color: var(--primary);
  font-weight: 600;
}

/* noUiSlider Fluent UI overrides */
#timeline-slider {
  height: 6px;
  border: none;
  background: var(--neutral-20);
  box-shadow: none;
  border-radius: 3px;
  margin: 0 -9px;
  overflow: visible;
}

#timeline-slider .noUi-base,
#timeline-slider .noUi-connects,
#timeline-slider .noUi-origin {
  overflow: visible;
}

#timeline-slider .noUi-connect {
  background: var(--primary);
  border-radius: 3px;
}

#timeline-slider .noUi-handle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: grab;
  top: -7px;
  right: -9px;
}

#timeline-slider .noUi-handle:active {
  cursor: grabbing;
  border-color: var(--primary-active);
  box-shadow: 0 0 0 3px rgba(0,120,212,0.2);
}

#timeline-slider .noUi-handle::before,
#timeline-slider .noUi-handle::after {
  display: none; /* remove default noUiSlider lines */
}

/* Actions row */
.preview-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--neutral-40);
}

.btn-icon {
  margin-right: 4px;
  vertical-align: -2px;
}

/* Smooth Panel Collapse & Expand Wrapper (features-0003) */
.panel-anim-wrap {
  display: grid;
  grid-template-rows: 0fr;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  opacity: 0;
  transform: translateY(-8px);
  transition: grid-template-rows var(--duration-enter) var(--ease-out-cubic),
              opacity var(--duration-enter) var(--ease-out-cubic),
              transform var(--duration-enter) var(--ease-out-cubic),
              margin var(--duration-enter) var(--ease-out-cubic),
              padding var(--duration-enter) var(--ease-out-cubic);
}

.panel-anim-wrap > .panel-anim-content {
  overflow: visible;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}

.panel-anim-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.panel-anim-wrap.is-leaving {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px);
  transition: grid-template-rows var(--duration-exit) var(--ease-in-cubic),
              opacity var(--duration-exit) var(--ease-in-cubic),
              transform var(--duration-exit) var(--ease-in-cubic),
              margin var(--duration-exit) var(--ease-in-cubic),
              padding var(--duration-exit) var(--ease-in-cubic);
}

/* Table Row Highlight Fade */
.row-fade-in {
  animation: rowHighlightFade 800ms var(--ease-out-cubic) forwards;
}

@keyframes rowHighlightFade {
  0% {
    background-color: var(--info-bg);
  }
  100% {
    background-color: transparent;
  }
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .panel-anim-wrap,
  .panel-anim-wrap.is-open,
  .panel-anim-wrap.is-leaving,
  .row-fade-in,
  .expand-chevron,
  .user-menu-chevron,
  .user-menu-dropdown,
  .device-row {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  html {
    scroll-behavior: auto !important;
  }
}

/* Preview panel styling */
.preview-panel {
  background: var(--card);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.preview-panel h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text);
}

.btn-secondary.btn-preview {
  background: #ffffff;
  border: 1px solid var(--primary);
  color: var(--primary);
  gap: 4px;
}

.btn-secondary.btn-preview:hover {
  background: var(--neutral-20);
  border-color: var(--primary-hover);
  color: var(--primary-hover);
}

.btn-secondary.btn-preview.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-secondary.btn-preview.active:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.btn-secondary.btn-preview:disabled {
  background: #ffffff;
  border-color: var(--neutral-60);
  color: var(--neutral-60);
  cursor: not-allowed;
}

/* Time-range badge on job panel */
.panel-time-range {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 8px 0;
  background: var(--info-bg);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
}

.panel-time-range b {
  color: var(--primary);
  font-weight: 600;
}

/* Timeline loading progress bar */
.timeline-loading {
  padding: 24px;
  text-align: center;
}

.loading-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #edebe9;
  border-top-color: #0078d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.loading-percentage {
  font-family: var(--font);
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  min-width: 40px;
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 4px;
  background: #edebe9;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 12px;
}

.progress-bar-container .progress-bar {
  height: 100%;
  background: #0078d4;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.loading-subtext {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
}



/* ---- auth (Phase 2) ------------------------------------------------------ */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--info-bg);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---- user menu dropdown (feature-01) ----------------------------------- */
.user-menu { position: relative; }
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.user-menu-trigger:hover { background: var(--neutral-20); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex: none;
}
.user-menu-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-menu-chevron { color: var(--text-secondary); transition: transform 0.2s ease; }
.user-menu[aria-expanded="true"] .user-menu-chevron { transform: rotate(180deg); }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  z-index: 1000;
  padding: 4px 0;
  animation: menuSlideIn var(--duration-enter) var(--ease-out-cubic);
}
@keyframes menuSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--neutral-40);
}
.user-menu-username { font-weight: 600; font-size: 14px; }
.user-menu-separator { height: 1px; background: var(--neutral-40); margin: 4px 0; }
.user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s ease;
}
.user-menu-item:hover { background: var(--neutral-20); }
.user-menu-item.active { color: var(--primary); font-weight: 600; }
.user-menu-danger { color: var(--danger); }
.user-menu-danger:hover { background: var(--danger-bg); }

/* Auth entry point: login / forced password change, centered standalone view */
.auth-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-brand .brand-logo { width: 42px; height: 42px; flex-shrink: 0; }
.auth-brand .brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.4px;
  line-height: 0.95;
}
.auth-view .login-card { max-width: 380px; width: 100%; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 13px; color: var(--text-secondary); }
.login-form input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--neutral-60);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
}
.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.login-form .btn { align-self: flex-start; margin-top: 4px; }
.login-error {
  margin-top: 4px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.pw-warning {
  font-size: 13px;
  color: var(--warn-yellow);
  background: var(--warn-yellow-bg);
  border: 1px solid var(--warn-bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* ==================================================================
   Admin Dashboard & Navigation (features-0002)
   ================================================================== */

/* Admin Dashboard Sub-tabs */
.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--neutral-30);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: -6px;
  transition: all 0.15s ease;
}

.admin-tab:hover {
  color: var(--text);
  border-bottom-color: var(--neutral-40);
}

.admin-tab.active {
  color: #0078d4;
  border-bottom-color: #0078d4;
}

.admin-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.04);
}

.metric-val {
  font-size: 26px;
  font-weight: 700;
  color: #0078d4;
  font-family: var(--mono);
}

.metric-lbl {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Health & Badges */
.health-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: #dff6dd; color: #107c10; }
.badge-warning { background: #fff4ce; color: #ca5010; }
.badge-danger  { background: #fde7e9; color: #d13438; }
.badge-info    { background: #deecf9; color: #0078d4; }
.badge-secondary { background: #f3f2f1; color: #605e5c; }

/* Service Health Widget (features-0004) */
.health-widget-card {
  margin-top: 0;
}

.health-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.health-card-header .card-subtitle {
  margin: 0;
}

.health-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-last-checked {
  font-size: 12px;
  color: var(--text-tertiary);
}

.health-service-card {
  background: var(--card);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 16px;
  gap: 12px;
}

.health-service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.health-service-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.service-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.service-name-wrap {
  display: flex;
  flex-direction: column;
}

.service-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.service-role {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.health-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.admin-actions-bar {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.card-subtitle {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.card-inner {
  margin: 0;
}

.form-select, .form-input {
  padding: 6px 10px;
  border: 1px solid var(--neutral-50, #8a8886);
  border-radius: 2px;
  font-size: 13px;
  background: #ffffff;
}

.form-select:focus, .form-input:focus {
  border-color: #0078d4;
  outline: none;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--neutral-10);
  border-radius: 2px;
  font-size: 13px;
}

.config-key { font-weight: 600; color: var(--text); }
.config-val { color: var(--text-secondary); font-family: var(--mono); }

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
}

.form-help {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- System Config: Rail Layout & Content Pane ----------------------- */
.config-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}

.config-rail {
  width: 208px;
  flex: 0 0 208px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-card);
}

.config-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.config-rail-item:hover {
  background: var(--neutral-20);
  color: var(--text);
}

.config-rail-item.active {
  background: var(--info-bg);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.config-rail-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.config-rail-icon {
  flex-shrink: 0;
  color: currentColor;
}

.config-rail-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-rail-dirty.dirty-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--warn);
  margin-left: auto;
}

.config-content-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.config-panel {
  width: 100%;
  animation: fadeInPane var(--duration-enter) var(--ease-out-cubic);
}

.config-panel:focus {
  outline: none;
}

@keyframes fadeInPane {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .config-panel {
    animation: none;
    transition: none;
  }
}

@media (max-width: 899px) {
  .config-layout {
    flex-direction: column;
    gap: 16px;
  }

  .config-rail {
    width: 100%;
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--neutral-40);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .config-rail-item {
    width: auto;
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    margin-bottom: 0;
  }

  .config-rail-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }
}

.config-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0;
}

.config-card .admin-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.config-card-header {
  border-bottom: 1px solid var(--neutral-30, #e1dfdd);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.config-title-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.config-card-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.config-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.config-title-wrap .card-subtitle {
  margin: 0;
}

.card-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  line-height: 1.4;
}

.dirty-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-yellow-bg, #fff4ce);
  border: 1px solid var(--warn-bg, #ffd3b0);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.2px;
}

.dirty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--warn);
}

.input-group {
  display: flex;
  align-items: stretch;
  max-width: 240px;
  width: 100%;
}

.input-group .form-input.input-number {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
  text-align: left;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 13px;
  min-width: 80px;
}

.input-adornment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 6px 10px;
  background: var(--neutral-20, #f3f2f1);
  border: 1px solid var(--neutral-60, #8a8886);
  border-left: none;
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--mono);
  white-space: nowrap;
  user-select: none;
}

.config-select {
  max-width: 320px;
  width: 100%;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--neutral-30, #e1dfdd);
  padding-top: 16px;
  margin-top: auto;
}

.card-footer .btn {
  margin: 0;
}

.save-btn:disabled {
  background: var(--neutral-20);
  border-color: var(--neutral-40);
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* ==========================================================================
   Live Capture & Devices Subsystem (features-0006)
   ========================================================================== */

.source-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--neutral-40);
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.source-tabs {
  display: flex;
  gap: 8px;
}

.source-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: -6px;
  transition: all 0.15s ease;
}

.source-tab:hover {
  color: var(--text);
  border-bottom-color: var(--neutral-60);
}

.source-tab.active {
  color: #0078d4;
  border-bottom-color: #0078d4;
}

.connections-header-actions {
  display: flex;
  align-items: center;
}

.source-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Empty State */
.connections-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--neutral-10);
  border: 1px dashed var(--neutral-60);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.connections-empty-icon {
  margin-bottom: 12px;
}

.connections-empty-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.connections-empty-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 0 20px;
  line-height: 1.4;
}

/* ---- devices table (feature-01) ---------------------------------------- */
.conn-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.conn-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.conn-toolbar-right {
  display: flex;
  align-items: center;
}
.conn-search {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--neutral-60);
  border-radius: var(--radius);
  min-width: 200px;
  background: var(--card);
  color: var(--text);
}
.conn-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.conn-status-filter {
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--neutral-60);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
}
.conn-count {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.devices-table {
  display: grid;
  grid-template-columns: 40px minmax(180px, 1.2fr) 110px minmax(180px, 1.4fr) 90px 110px 80px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.devices-table > tbody {
  display: contents;
}
.devices-table > tbody > tr.device-row {
  display: contents;
}
.devices-table > tbody > tr.group-header-row,
.devices-table > tbody > tr.detail-row {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
}
.devices-table > tbody > tr.device-row > td {
  padding: 10px 12px;
  border-top: 1px solid var(--neutral-40);
  vertical-align: middle;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-width: 0;
}
.devices-table > tbody > tr.device-row:hover > td {
  background: var(--neutral-20);
}
.devices-table > tbody > tr.device-row.highlight-new > td {
  animation: deviceHighlight 3s ease-out;
}
.devices-table .cell-expand {
  width: 40px;
  justify-content: center;
  padding: 10px 4px;
}
.devices-table .cell-actions {
  justify-content: flex-end;
}
.devices-table .mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.devices-table .muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.expand-chevron {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}
.expand-chevron:hover {
  color: var(--text);
  background: var(--neutral-20);
}
.device-row.expanded .expand-chevron {
  transform: rotate(180deg);
}
.expand-chevron.is-loading {
  pointer-events: none;
  transform: none !important;
}
.expand-chevron.is-loading svg {
  display: none;
}
.expand-chevron.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--neutral-40);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.device-row .cell-interfaces {
  cursor: pointer;
}
.device-row .cell-interfaces:hover {
  color: var(--primary);
  text-decoration: underline;
}
.device-row.is-loading-interfaces .cell-interfaces {
  color: var(--primary);
  font-weight: 600;
}

.detail-row {
  grid-column: 1 / -1;
  width: 100%;
}
.detail-row > td {
  padding: 0 !important;
  border-top: none !important;
  background: var(--neutral-10);
  display: block !important;
  width: 100%;
}
.interfaces-panel {
  padding: 12px 16px;
}

.device-cell-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.cell-device {
  text-align: left;
}
.cell-device .device-name {
  font-weight: 600;
  margin-left: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-capture .rec-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  margin-right: 4px;
  animation: recPulse 1.2s infinite;
}
.cell-actions {
  white-space: nowrap;
}
.cell-actions .icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--text-secondary);
  display: inline-flex;
  border-radius: var(--radius);
  transition: color 0.1s ease, background 0.1s ease;
}
.cell-actions .icon-btn:hover {
  color: var(--text);
  background: var(--neutral-20);
}

/* Vendor icon chip (reused in table) */
.vendor-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--neutral-20);
  color: #0078d4;
  flex-shrink: 0;
  line-height: 1.2;
}

/* Group header rows */
.group-header-row {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 12px;
}
.group-header-row:first-child {
  margin-top: 0;
}
.group-header-row > td {
  padding: 0 !important;
  border: none !important;
  display: block !important;
  width: 100%;
}
.group-header-cell {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--neutral-10);
  border: 1px solid var(--neutral-40);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 100%;
  box-sizing: border-box;
}
.group-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--text-secondary);
  display: inline-flex;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.group-header-row.group-collapsed .group-collapse-btn {
  transform: rotate(-90deg);
}
.group-header-name {
  flex: 1;
}
.group-device-count {
  font-weight: 400;
  font-size: 11px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive: devices table */
@media (max-width: 768px) {
  .devices-table {
    grid-template-columns: 40px minmax(140px, 1.5fr) 100px 100px 70px;
  }
  .devices-table > tbody > tr > .col-host,
  .devices-table > tbody > tr > .col-interfaces {
    display: none !important;
  }
}
@media (max-width: 560px) {
  .devices-table {
    grid-template-columns: 36px minmax(120px, 1fr) 90px 60px;
  }
  .devices-table > tbody > tr > .col-host,
  .devices-table > tbody > tr > .col-interfaces,
  .devices-table > tbody > tr > .cell-capture {
    display: none !important;
  }
  .devices-table > tbody > tr.device-row > td {
    padding: 6px 8px;
    font-size: 12px;
  }
}

/* Feature-02: Manage Groups dialog */
.groups-dialog-box {
  max-width: 520px;
}
.groups-dialog-body {
  padding: 16px;
}
.groups-create-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.groups-create-row .form-input {
  flex: 1;
  min-width: 0;
}
.groups-parent-select {
  max-width: 180px;
}
.groups-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}
.groups-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: background 0.1s ease;
}
.groups-list-item:hover {
  background: var(--neutral-10);
}
.group-item-name {
  flex: 1;
  font-size: 13px;
}
.group-item-count {
  font-size: 11px;
}
.groups-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 20px 0;
}

/* Device name (reused in table) */
.device-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

/* Status dot (reused in table) */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.interfaces-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  min-height: 72px;
}

.interfaces-loading-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.interfaces-loading-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.interfaces-loading-status {
  font-size: 13px;
  color: var(--text);
}

.interfaces-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.interfaces-head-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.interfaces-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  display: table;
}

.interfaces-table thead {
  display: table-header-group;
}

.interfaces-table tbody {
  display: table-row-group;
}

.interfaces-table tr {
  display: table-row;
}

.interfaces-table th {
  display: table-cell;
  text-align: left;
  padding: 6px 10px;
  background: var(--neutral-10);
  color: var(--text-secondary);
  font-weight: 600;
  border-top: none;
  border-bottom: 1px solid var(--neutral-40);
}

.interfaces-table td {
  display: table-cell;
  padding: 8px 10px;
  border-top: none;
  border-bottom: 1px solid var(--neutral-20);
  vertical-align: middle;
}

.interfaces-table td.bold {
  font-weight: 600;
}

.interfaces-table tr:hover td {
  background: var(--neutral-10);
}

.oper-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

.oper-badge.up {
  background: #dff6dd;
  color: #107c10;
}

.oper-badge.down {
  background: #f3f2f1;
  color: #8a8886;
}

.btn-capture {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-capture:hover:not(:disabled) {
  background: #106ebe;
}

.btn-capture:disabled {
  background: var(--neutral-40);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* Active Live Capture Row / Banner */
.live-capture-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #fff4ce;
  border: 1px solid #ffd3b0;
  border-radius: var(--radius);
  gap: 12px;
}

.live-rec-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: #d13438;
}

.rec-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d13438;
  animation: recPulse 1.2s infinite ease-in-out;
}

@keyframes recPulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

.live-capture-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.btn-stop-rec {
  background: #d13438;
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-stop-rec:hover {
  background: #a80000;
}

/* Provenance & Toast */
.preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-provenance {
  font-size: 12px;
  font-weight: 600;
  color: #0078d4;
  background: #deecf9;
  padding: 2px 8px;
  border-radius: 4px;
}

.preview-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #deecf9;
  border: 1px solid #c7e0f4;
  border-radius: var(--radius);
  color: #004578;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  animation: toastFadeIn 0.3s ease;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modals */
.device-modal-box, .capture-modal-box {
  background: var(--card);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.device-modal-head, .capture-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--neutral-40);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.device-modal-title, .capture-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row > .form-group {
  min-width: 0;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

.form-input, .form-select {
  border: 1px solid var(--neutral-60);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #0078d4;
}

.form-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.form-checkbox-group {
  margin: 8px 0 14px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

/* Prerequisites */
.prereqs-box {
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius);
  background: var(--neutral-10);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.prereqs-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.prereqs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prereq-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.prereq-code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--neutral-20);
  border: 1px solid var(--neutral-40);
  padding: 1px 6px;
  border-radius: 2px;
  color: #004578;
  white-space: nowrap;
}

.device-test-feedback {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.device-test-feedback.success {
  background: #dff6dd;
  border: 1px solid #107c10;
  color: #107c10;
}

.device-test-feedback.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.device-modal-actions, .capture-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--neutral-40);
  padding-top: 16px;
  margin-top: 8px;
}

.action-spacer {
  flex: 1;
}

.capture-target-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--neutral-10);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.target-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.target-val {
  font-weight: 600;
  color: #0078d4;
}

.cpu-impact-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  color: #7a2b00;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 16px;
}

/* Analyses Header & Scope Chips */
.analyses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.analyses-header .card-title {
  margin-bottom: 0;
}

.scope-chips {
  display: inline-flex;
  background: var(--neutral-20, #f3f2f1);
  padding: 3px;
  border-radius: var(--radius, 4px);
  gap: 2px;
  border: 1px solid var(--neutral-40, #e1dfdd);
}

.scope-chip {
  background: transparent;
  border: none;
  border-radius: calc(var(--radius, 4px) - 1px);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #605e5c);
  cursor: pointer;
  transition: all 0.15s ease;
}

.scope-chip:hover {
  color: var(--text, #323130);
  background: rgba(0, 0, 0, 0.04);
}

.scope-chip.active {
  background: var(--card-bg, #ffffff);
  color: #0078d4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Owner Column & Badge */
.owner-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.owner-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--neutral-30, #edebe9);
  color: var(--text, #323130);
  min-width: 28px;
  text-align: center;
}

.owner-chip.owner-you {
  background: #deecf9;
  color: #0078d4;
}

.badge-shared {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f3f2f1;
  color: #605e5c;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--neutral-40, #e1dfdd);
}

/* Share Analysis Modal */
.share-modal-box {
  width: 100%;
  max-width: 720px;
}

.modal-subhead {
  font-size: 12px;
  color: var(--text-secondary, #605e5c);
  font-weight: 400;
  margin-top: 2px;
  font-family: var(--mono);
}

.share-modal-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .share-modal-body {
    grid-template-columns: 1fr;
  }
}

.share-col-left {
  border-right: 1px solid var(--neutral-40, #e1dfdd);
  padding-right: 20px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .share-col-left {
    border-right: none;
    border-bottom: 1px solid var(--neutral-40, #e1dfdd);
    padding-right: 0;
    padding-bottom: 20px;
  }
}

.share-col-right {
  display: flex;
  flex-direction: column;
}

.share-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #323130);
  margin-bottom: 12px;
}

.share-grants-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.share-grant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--neutral-10, #faf9f8);
  border: 1px solid var(--neutral-30, #edebe9);
  border-radius: var(--radius, 4px);
  gap: 8px;
}

.share-grant-principal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #323130);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-principal-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--neutral-30, #edebe9);
  color: var(--text-secondary, #605e5c);
}

.share-grant-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-level-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.share-level-badge.view {
  background: #deecf9;
  color: #0078d4;
}

.share-level-badge.manage {
  background: #dff6dd;
  color: #107c10;
}

.share-grant-remove {
  background: transparent;
  border: none;
  color: var(--text-secondary, #605e5c);
  cursor: pointer;
  padding: 2px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-grant-remove:hover {
  color: var(--danger, #d13438);
  background: var(--danger-bg, #fde7e9);
}

.share-grants-empty {
  font-size: 13px;
  color: var(--text-secondary, #605e5c);
  font-style: italic;
  padding: 16px 0;
}

.share-add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-add-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 4px;
}

/* Transfer Ownership Dialog */
.transfer-box {
  max-width: 440px;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light, #edebe9);
  background: var(--bg-card, #ffffff);
  font-size: 13px;
  color: var(--text-secondary, #605e5c);
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary, #605e5c);
}

.pagination-info b {
  color: var(--text-primary, #323130);
  font-weight: 600;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.pagination-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.pagination-label {
  color: var(--text-secondary, #605e5c);
  font-size: 12px;
}

.pagination-size-select {
  padding: 3px 8px;
  border: 1px solid var(--border, #8a8886);
  border-radius: 2px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #323130);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.pagination-size-select:focus {
  border-color: var(--primary, #0078d4);
  box-shadow: 0 0 0 1px var(--primary, #0078d4);
}

.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border, #8a8886);
  border-radius: 2px;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #323130);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover, #f3f2f1);
  border-color: var(--primary, #0078d4);
  color: var(--primary, #0078d4);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-light, #edebe9);
  color: var(--text-secondary, #605e5c);
}

.pagination-page-num {
  font-size: 12px;
  color: var(--text-secondary, #605e5c);
  min-width: 80px;
  text-align: center;
}

.pagination-page-num b {
  color: var(--text-primary, #323130);
  font-weight: 600;
}





