/* ===================================================================
   Service Bus Ops — Professional SaaS Operations Dashboard
   Inter font, refined blue palette, clean spacing, subtle depth
   =================================================================== */

:root {
  --blue-900: #0f172a;
  --blue-800: #1e293b;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-300: #93c5fd;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --red-500: #ef4444;
  --red-400: #f87171;
  --red-100: #fee2e2;
  --red-50:  #fef2f2;

  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-100: #fef3c7;

  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-100: #ccfbf1;

  --green-500: #22c55e;
  --green-100: #dcfce7;

  --purple-500: #8b5cf6;
  --purple-100: #ede9fe;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --shadow-glow: 0 0 0 3px rgba(59,130,246,.2);

  --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
  --transition-base: 200ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 300ms cubic-bezier(.4,0,.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ---- Footer ---- */
.app-footer {
  height: 28px;
  background: var(--slate-900);
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
  flex-shrink: 0;
}

/* ---- Top bar ---- */
.topbar {
  height: 56px;
  background: var(--slate-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 8px rgba(59,130,246,.4));
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: -.02em;
}

.logo-accent {
  color: var(--blue-400);
  font-weight: 700;
}

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

.auth-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
  background: rgba(255,255,255,.06);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  letter-spacing: .01em;
}

.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 7px 16px;
  transition: all var(--transition-fast);
  letter-spacing: -.01em;
  line-height: 1.4;
}

.btn-login {
  background: var(--blue-500);
  color: #fff;
}
.btn-login:hover {
  background: var(--blue-400);
  box-shadow: 0 0 20px rgba(59,130,246,.25);
}

.btn-logout {
  background: rgba(255,255,255,.08);
  color: var(--slate-300);
  border: 1px solid rgba(255,255,255,.1);
}
.btn-logout:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}

.btn-dlq-dashboard,
.btn-alerts,
.btn-flow-diagram,
.btn-remediation,
.btn-webhooks,
.btn-settings,
.btn-docs {
  background: rgba(255,255,255,.07);
  color: var(--slate-300);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  padding: 5px 12px;
}

.btn-dlq-dashboard:hover,
.btn-alerts:hover,
.btn-flow-diagram:hover,
.btn-remediation:hover,
.btn-webhooks:hover,
.btn-settings:hover,
.btn-docs:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  border-color: rgba(255,255,255,.18);
}

/* ---- Workspace ---- */
.workspace {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: #fff;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 1px 0 3px rgba(0,0,0,.03);
}

/* Sidebar resize handle */
.sidebar-resize-handle {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  transition: background var(--transition-fast);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
  background: var(--blue-400);
}

/* Sidebar filter */
.sidebar-filter {
  padding: 8px 12px;
  border-bottom: 1px solid var(--slate-100);
}

.tree-filter-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  color: var(--slate-700);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tree-filter-input::placeholder {
  color: var(--slate-400);
}

.tree-filter-input:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
  background: #fff;
}

.sidebar-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-400);
}

.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  color: var(--slate-500);
  cursor: pointer;
  transition: all .15s ease;
  font-size: 14px;
  line-height: 1;
}

.sidebar-refresh-btn:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--blue-500);
}

.refresh-icon {
  display: inline-block;
  transition: none;
}

.refresh-icon.spinning {
  animation: spin .7s linear infinite;
}

.auto-refresh-select {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate-600);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease;
  height: 24px;
}

.auto-refresh-select:hover {
  border-color: var(--blue-300);
}

.auto-refresh-select:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

.tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}

.tree::-webkit-scrollbar { width: 5px; }
.tree::-webkit-scrollbar-track { background: transparent; }
.tree::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 10px; }
.tree::-webkit-scrollbar-thumb:hover { background: var(--slate-300); }

.tree-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--slate-400);
  font-size: 12px;
}

.tree-empty-icon { color: var(--slate-300); }

/* Tree items */
.namespace-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--slate-600);
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
}

.namespace-item:hover {
  background: var(--blue-50);
  color: var(--slate-800);
}

.namespace-item.selected {
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 500;
}

.namespace-item.expanded {
  color: var(--blue-600);
  font-weight: 500;
}

.namespace-item .expand-icon {
  font-size: 9px;
  width: 14px;
  text-align: center;
  color: var(--slate-400);
  flex-shrink: 0;
  transition: transform .15s ease;
}

.namespace-item.expanded .expand-icon {
  color: var(--blue-500);
}

.namespace-item .item-icon {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1.4;
}

.namespace-item.namespace .item-icon {
  background: var(--blue-100);
  color: var(--blue-600);
}

.namespace-item.topic .item-icon {
  background: var(--teal-100);
  color: var(--teal-500);
}

.namespace-item.queue .item-icon {
  background: var(--amber-100);
  color: var(--amber-500);
}

.namespace-item.subscription .item-icon {
  background: var(--slate-100);
  color: var(--slate-500);
}

.namespace-item .item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Indentation via parent relationships */
.namespace-item.topic,
.namespace-item.queue {
  padding-left: 26px;
}

.namespace-item.subscription {
  padding-left: 44px;
}

/* Message sub-items (Active Messages / Dead Letter Queue) */
.namespace-item.message-sub {
  padding-left: 62px;
  font-size: 12px;
}

.namespace-item.active-sub .item-icon {
  background: var(--blue-100);
  color: var(--blue-600);
}

.namespace-item.dlq-sub .item-icon {
  background: var(--red-100);
  color: var(--red-500);
}

/* Message count badges in tree */
.tree-counts {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.tree-count-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 10px;
  line-height: 18px;
}

.tree-count-badge.active-count {
  background: var(--blue-100);
  color: var(--blue-600);
}

.tree-count-badge.dlq-count {
  background: var(--red-100);
  color: var(--red-500);
}

/* ---- Content ---- */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--slate-50);
}

.content-head {
  padding: 16px 28px 14px;
  border-bottom: 1px solid var(--slate-200);
  background: #fff;
}

.content-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
  letter-spacing: -.01em;
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.content-body::-webkit-scrollbar { width: 6px; }
.content-body::-webkit-scrollbar-track { background: transparent; }
.content-body::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 10px; }

/* ---- Empty state ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
}

.empty-state-graphic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-400);
}

.empty-state-text {
  font-size: 13px;
  color: var(--slate-400);
  max-width: 280px;
  text-align: center;
  line-height: 1.6;
}

/* ---- Message filter bar ---- */
.message-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.message-filter-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.message-filter-input::placeholder {
  color: var(--slate-400);
}

.message-filter-input:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

.message-filter-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.page-size-select {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--slate-600);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  background: var(--slate-50);
  cursor: pointer;
  flex-shrink: 0;
  min-width: 64px;
  height: 32px;
  outline: none;
}

.page-size-select:hover {
  border-color: var(--blue-400);
}

.page-size-select:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

/* ---- Export dropdown ---- */
.export-dropdown {
  position: relative;
  flex-shrink: 0;
}

.btn-export {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 14px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
  letter-spacing: .01em;
  white-space: nowrap;
}

.btn-export:hover {
  background: var(--slate-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.export-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
}

.export-dropdown-menu.open {
  display: block;
}

.export-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
}

.export-dropdown-item:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

.export-dropdown-item + .export-dropdown-item {
  border-top: 1px solid var(--slate-100);
}

/* ---- Message sections ---- */
.message-list {
  margin-bottom: 28px;
}

.message-list h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-200);
}

.message-list p {
  font-size: 13px;
  color: var(--slate-400);
  padding: 12px 0;
}

/* ---- Message card ---- */
.message-item {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .12s ease;
  position: relative;
}

.message-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.message-item:hover {
  border-color: var(--slate-300);
  box-shadow: var(--shadow-md);
}

.message-item.active::before {
  background: var(--blue-500);
}

.message-item.deadlettered::before {
  background: var(--red-500);
}

.message-item.deadlettered {
  background: var(--red-50);
  border-color: rgba(239,68,68,.15);
}

.message-item.deadlettered.selected {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}

.message-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.message-item-header .message-checkbox {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--blue-500);
  cursor: pointer;
}

.message-item-header span:first-of-type {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-800);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-item-header span:last-child {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}

.message-item.active .message-item-header span:last-child {
  background: var(--blue-100);
  color: var(--blue-600);
}

.message-item.deadlettered .message-item-header span:last-child {
  background: var(--red-100);
  color: var(--red-500);
}

/* ---- Dead-letter reason block (on DLQ cards) ---- */
.dlq-reason-block {
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.15);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.5;
}

.dlq-reason-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.dlq-reason-row + .dlq-reason-row {
  margin-top: 2px;
}

.dlq-reason-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--red-500);
  flex-shrink: 0;
  white-space: nowrap;
}

.dlq-reason-text {
  color: var(--slate-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.dlq-reason-text.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.dlq-reason-none {
  color: var(--slate-400);
  font-style: italic;
  font-size: 11px;
}

.message-item-body {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--slate-600);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--slate-50);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-100);
  max-height: 120px;
  overflow: auto;
}

/* ---- JSON syntax highlighting ---- */
.json-highlighted {
  background: var(--slate-50);
}

.json-key {
  color: #6f42c1; /* purple */
}

.json-string {
  color: #22863a; /* green */
}

.json-number {
  color: #d97706; /* orange */
}

.json-boolean {
  color: #e5484d; /* red */
}

.json-null {
  color: #cf5d94; /* pink */
}

.json-brace {
  color: var(--slate-500);
}

/* ---- Raw / Formatted toggle ---- */
.message-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--blue-500);
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all .12s ease;
}

.message-view-toggle:hover {
  background: var(--blue-100);
  color: var(--blue-700);
}

/* ---- Copy buttons ---- */
.copy-btn {
  font-size: 13px;
  line-height: 1;
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--slate-400);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity .15s ease, color .15s ease, border-color .15s ease;
  flex-shrink: 0;
}

.copy-btn:hover {
  opacity: 1;
  color: var(--blue-500);
  border-color: var(--slate-200);
}

.copy-btn-success {
  opacity: 1 !important;
  color: var(--teal-500) !important;
  border-color: var(--teal-500) !important;
}

.message-item:hover .copy-btn {
  opacity: 0.7;
}

/* Body wrapper for positioning the body copy button */
.message-item-body-wrap {
  position: relative;
}

.message-item-body-wrap .copy-body-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
}

.message-item-body-wrap:hover .copy-body-btn {
  opacity: 0.7;
}

.message-item-body-wrap .copy-body-btn:hover {
  opacity: 1;
}

/* Copy full message button inside details */
.copy-full-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  opacity: 0.7;
}

.copy-full-btn:hover {
  opacity: 1;
}

.detail-copy-full-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* ---- Message detail toggle ---- */
.message-detail-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 0;
  font-size: 11px;
  color: var(--slate-400);
  cursor: pointer;
  user-select: none;
  transition: color .1s ease;
}

.message-detail-toggle:hover {
  color: var(--blue-500);
}

.detail-toggle-icon {
  font-size: 12px;
  width: 12px;
  text-align: center;
}

/* ---- Message details panel ---- */
.message-details {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--slate-100);
  animation: details-in .15s ease;
}

@keyframes details-in {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 2000px; }
}

.detail-section {
  margin-bottom: 10px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--slate-200);
}

.detail-empty {
  font-size: 12px;
  color: var(--slate-400);
  padding: 4px 0;
}

.property-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 2px 0;
  font-size: 12px;
}

.property-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
  min-width: 160px;
  flex-shrink: 0;
}

.property-value {
  color: var(--slate-700);
  word-break: break-word;
}

/* ---- Topic overview ---- */
.topic-overview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overview-section {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.overview-section-header {
  padding: 14px 20px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-100);
}

.overview-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.overview-empty {
  font-size: 13px;
  color: var(--slate-400);
  padding: 16px 20px;
}

/* Settings cards — grid of individual mini-cards */
.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0;
}

.setting-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border-right: 1px solid var(--slate-100);
  border-bottom: 1px solid var(--slate-100);
  transition: background var(--transition-fast);
}

.setting-card:hover {
  background: var(--slate-50);
}

.setting-card-bar {
  display: none; /* removed — using top accent instead */
}

.setting-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--slate-400);
  white-space: nowrap;
  letter-spacing: .02em;
}

.setting-card-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-800);
  white-space: nowrap;
  letter-spacing: -.02em;
  line-height: 1.2;
}

/* Subscriptions table */
.subs-filter-bar {
  margin-bottom: 12px;
}

.subs-table-wrap {
  overflow-x: auto;
}

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

.subs-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 8px 12px;
  border-bottom: 2px solid var(--slate-200);
  white-space: nowrap;
}

.subs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  white-space: nowrap;
}

.subs-table tbody tr:hover {
  background: var(--blue-50);
}

.sub-name-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--blue-600) !important;
  cursor: pointer;
}

.sub-name-cell:hover {
  text-decoration: underline;
}

.sub-status-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}

.sub-status-badge.status-active {
  background: var(--teal-100);
  color: var(--teal-500);
}

.sub-status-badge.status-other {
  background: var(--slate-100);
  color: var(--slate-500);
}

.dlq-highlight {
  color: var(--red-500);
  font-weight: 600;
}

/* ---- Load more ---- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 0 20px;
}

.pagination-info {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--slate-500);
  min-width: 100px;
  text-align: center;
}

.btn-pagination {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 20px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
}

.btn-pagination:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

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

/* ---- Replay toolbar ---- */
.replay-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.replay-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-600);
  cursor: pointer;
  user-select: none;
}

.replay-select-all input {
  accent-color: var(--blue-500);
  cursor: pointer;
}

.replay-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.replay-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-600);
  cursor: pointer;
  user-select: none;
}

.replay-option input {
  accent-color: var(--blue-500);
  cursor: pointer;
}

.btn-replay {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 16px;
  background: var(--blue-500);
  color: #fff;
  transition: all .15s ease;
}

.btn-replay:hover:not(:disabled) {
  background: var(--blue-400);
  box-shadow: 0 0 16px rgba(37,99,235,.3);
}

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

.btn-replay-all {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 16px;
  background: var(--teal-500);
  color: #fff;
  transition: all .15s ease;
}

.btn-replay-all:hover:not(:disabled) {
  background: #0f766e;
  box-shadow: 0 0 16px rgba(13,148,136,.3);
}

.btn-replay-all:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-purge {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 16px;
  background: var(--red-500);
  color: #fff;
  transition: all .15s ease;
}

.btn-purge:hover {
  background: #dc2626;
  box-shadow: 0 0 16px rgba(239,68,68,.3);
}

/* ---- Toast notification ---- */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}

.toast-success {
  background: var(--teal-500);
  color: #fff;
}

.toast-error {
  background: var(--red-500);
  color: #fff;
}

/* ---- Loading ---- */
.loading {
  text-align: center;
  padding: 32px;
  color: var(--slate-400);
  font-size: 13px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,24,40,.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255,255,255,.2);
  border-top-color: var(--blue-400);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ---- Toast / Error ---- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}

.toast-error {
  background: var(--red-500);
  color: #fff;
}

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

/* ---- DLQ Dashboard ---- */
.dlq-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dlq-hero-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.dlq-hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: 8px;
}

.dlq-hero-number {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--red-500);
  line-height: 1.1;
  margin-bottom: 8px;
}

.dlq-hero-sub {
  font-size: 13px;
  color: var(--slate-500);
}

.dlq-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.dlq-controls-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dlq-filter-select {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--slate-700);
}

.dlq-filter-input {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--slate-700);
  width: 120px;
}

.dlq-filter-input::placeholder {
  color: var(--slate-400);
}

.dlq-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dlq-export-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--slate-600);
  cursor: pointer;
  transition: all .15s ease;
}

.dlq-export-btn:hover {
  background: var(--slate-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.dlq-hero-row {
  display: flex;
  gap: 16px;
}

.dlq-hero-card-secondary .dlq-hero-number {
  color: var(--blue-500);
}

.dlq-hero-number-filtered {
  font-size: 36px;
}

.dlq-sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.dlq-sortable-th:hover {
  color: var(--blue-600);
}

.dlq-sort-icon {
  display: inline-block;
  margin-left: 4px;
  color: var(--slate-300);
  font-size: 12px;
}

.dlq-sort-icon.dlq-sort-active {
  color: var(--blue-500);
}

.dlq-sparkline-cell {
  padding: 4px 8px !important;
  vertical-align: middle;
}

.dlq-sparkline {
  display: block;
}

.dlq-no-trend {
  font-size: 11px;
  color: var(--slate-300);
  font-family: var(--font-mono);
}

/* ---- Import Messages button ---- */
.btn-import-messages {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 16px;
  background: #fff;
  color: var(--slate-600);
  transition: all var(--transition-fast);
}

.btn-import-messages:hover {
  background: var(--slate-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

/* ---- Send Message button ---- */
.btn-send-message {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 16px;
  background: var(--blue-500);
  color: #fff;
  transition: all .15s ease;
}

.btn-send-message:hover {
  background: var(--blue-400);
  box-shadow: 0 0 16px rgba(37,99,235,.3);
}

/* ---- Send Message Modal ---- */
.send-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15,24,40,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.send-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 580px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-slide-in .2s ease;
}

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.send-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
}

.send-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-800);
}

.send-modal-entity {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-400);
  background: var(--slate-100);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.send-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.send-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.send-form-group {
  margin-bottom: 14px;
}

.send-form-row {
  display: flex;
  gap: 14px;
}

.send-form-half {
  flex: 1;
}

.send-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 5px;
}

.send-required {
  color: var(--red-500);
}

.send-form-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.send-form-textarea:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

.send-form-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.send-form-input:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

.send-form-select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-800);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.dlq-filter-select:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

.send-form-select:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-glow);
}

.dlq-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-600);
  cursor: pointer;
  user-select: none;
}

.dlq-toggle-label input {
  accent-color: var(--blue-500);
  cursor: pointer;
}

.dlq-result-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
  white-space: nowrap;
  flex-shrink: 0;
}

/* DLQ table row severity */
.dlq-table tbody tr.dlq-row-high {
  background: var(--red-50);
}

.dlq-table tbody tr.dlq-row-high:hover {
  background: var(--red-100);
}

.dlq-table tbody tr.dlq-row-medium {
  background: var(--amber-100);
}

.dlq-table tbody tr.dlq-row-medium:hover {
  background: #fef0c7;
}

.dlq-clickable-row {
  cursor: pointer;
  transition: background .1s ease;
}

.dlq-empty-row {
  text-align: center;
  color: var(--slate-400);
  padding: 24px 12px !important;
  font-size: 13px;
}

.dlq-queue-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--amber-500);
  background: var(--amber-100);
  padding: 2px 8px;
  border-radius: 20px;
}

/* DLQ Dashboard button in topbar */
.btn-dlq-dashboard {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.25);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  margin-left: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s ease;
  letter-spacing: .01em;
}

.btn-dlq-dashboard:hover {
  background: rgba(239,68,68,.25);
  color: #fff;
  border-color: rgba(239,68,68,.4);
}

.send-form-error {
  font-size: 12px;
  color: var(--red-500);
  margin-top: 4px;
  min-height: 16px;
}

/* Application property rows */
.send-prop-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}

.send-prop-key {
  flex: 1;
}

.send-prop-value {
  flex: 1;
}

.btn-remove-prop {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 10px;
  background: #fff;
  color: var(--red-500);
  transition: all .15s ease;
  flex-shrink: 0;
}

.btn-remove-prop:hover {
  background: var(--red-50);
  border-color: var(--red-500);
}

.btn-add-prop {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 5px 14px;
  background: transparent;
  color: var(--slate-500);
  transition: all .15s ease;
  margin-top: 4px;
}

.btn-add-prop:hover {
  border-color: var(--blue-400);
  color: var(--blue-500);
  background: var(--blue-50);
}

.btn-cancel-send {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 7px 18px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
}

.btn-cancel-send:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

.btn-confirm-send {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 7px 22px;
  background: var(--blue-500);
  color: #fff;
  transition: all .15s ease;
}

.btn-confirm-send:hover:not(:disabled) {
  background: var(--blue-400);
  box-shadow: 0 0 16px rgba(37,99,235,.3);
}

.btn-confirm-send:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---- Edit & Resubmit ---- */
.message-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.btn-edit-resubmit {
  font-family: var(--font-sans);
  font-size: 11px;
/* ---- Session badge in tree ---- */
}

.tree-session-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 0 4px;
  border-radius: 3px;
  background: #ede9fe;
  color: #7c3aed;
  line-height: 16px;
  flex-shrink: 0;
}

/* Session sub-item in tree */
.namespace-item.session-sub .item-icon {
  background: #ede9fe;
  color: #7c3aed;
}

/* ---- Session list ---- */
.session-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.session-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-list-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
  margin: 0;
}

.session-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
}

.session-table tbody tr {
  cursor: pointer;
  transition: background .1s ease;
}

.session-table tbody tr:hover {
  background: var(--blue-50);
}

.session-id-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--blue-600) !important;
}

.session-state-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-600);
}

.session-state-none {
  font-size: 11px;
  color: var(--slate-400);
  font-style: italic;
}

/* ---- Session messages header ---- */
.session-messages-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.session-messages-title {
  font-size: 13px;
  color: var(--slate-600);
}

.session-messages-title strong {
  font-family: var(--font-mono);
  color: var(--slate-800);
}

.btn-session-back {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 4px 10px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-edit-resubmit:hover {
  padding: 6px 14px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
  flex-shrink: 0;
}

.btn-session-back:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.edit-resubmit-delete-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--slate-600);
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}

.edit-resubmit-delete-option input {
  accent-color: var(--blue-500);
  cursor: pointer;
}

/* ---- Edit & Replay — wider modal and diff view ---- */

.send-modal--wide {
  width: 720px;
}

.edit-replay-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.edit-replay-label-row .send-form-label {
  margin-bottom: 0;
}

.btn-diff-toggle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 3px 10px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
}

.btn-diff-toggle:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.edit-replay-diff-area {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

.diff-container {
  padding: 0;
}

.diff-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-100);
}

.diff-content {
  margin: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-line {
  display: block;
}

.diff-unchanged {
  color: var(--slate-600);
}

.diff-line-removed {
  background: var(--red-50);
  color: var(--red-500);
}

.diff-line-added {
  background: var(--green-100);
  color: #16a34a;
}

.diff-no-changes {
  font-size: 12px;
  color: var(--slate-400);
  padding: 12px;
  margin: 0;
  font-style: italic;
}

.diff-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 8px 12px;
  border-top: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-100);
}

.diff-prop-change {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  color: var(--slate-700);
}

.diff-prop-key {
  font-weight: 600;
  color: var(--slate-600);
}

.diff-removed {
  background: var(--red-50);
  color: var(--red-500);
  padding: 1px 4px;
  border-radius: 2px;
  text-decoration: line-through;
}

.diff-added {
  background: var(--green-100);
  color: #16a34a;
  padding: 1px 4px;
  border-radius: 2px;
}

/* ---- Add Filter Form ---- */

.add-filter-form {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  animation: details-in .15s ease;
/* ---- Scheduled tab bar ---- */
}

.scheduled-tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.scheduled-tab {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border: none;
  background: #fff;
  color: var(--slate-500);
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  letter-spacing: .01em;
}

.scheduled-tab + .scheduled-tab {
  border-left: 1px solid var(--slate-200);
}

.scheduled-tab:hover {
  background: var(--slate-50);
  color: var(--slate-700);
}

.scheduled-tab.active {
  background: var(--blue-500);
  color: #fff;
}

/* ---- Scheduled message items ---- */
.message-item.scheduled::before {
  background: var(--amber-500);
}

.message-item.scheduled .message-item-header span:last-child {
  background: var(--amber-100);
  color: var(--amber-500);
}

.message-item.scheduled.selected {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}

.scheduled-enqueue-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 4px 10px;
  background: var(--amber-100);
  border: 1px solid rgba(217,119,6,.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.scheduled-enqueue-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--amber-500);
  flex-shrink: 0;
}

.scheduled-enqueue-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-700);
  font-weight: 500;
}

.scheduled-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 4px;
}

.btn-cancel-single {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--red-500);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 4px 12px;
  background: #fff;
  color: var(--red-500);
  transition: all .15s ease;
}

.btn-cancel-single:hover {
  background: var(--red-500);
  color: #fff;
}

.btn-cancel-scheduled {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 6px 16px;
  background: var(--red-500);
  color: #fff;
  transition: all .15s ease;
}

.btn-cancel-scheduled:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 0 16px rgba(239,68,68,.3);
}

.btn-cancel-scheduled:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.scheduled-checkbox {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--blue-500);
  cursor: pointer;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 52px);
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--slate-200);
  }

  .content-body { padding: 16px; }

  .namespace-item.topic,
  .namespace-item.queue { padding-left: 20px; }
  .namespace-item.subscription { padding-left: 36px; }
  .namespace-item.message-sub { padding-left: 50px; }

  .topbar { padding: 0 12px; }

  .auth-chip { display: none; }

  .dlq-hero-number { font-size: 36px; }
  .dlq-hero-card { padding: 20px 16px; }
  .dlq-hero-row { flex-direction: column; }
  .dlq-controls { flex-direction: column; align-items: flex-start; }
  .dlq-controls-left { flex-direction: column; gap: 10px; }
  .dlq-controls-right { flex-wrap: wrap; }
  .btn-dlq-dashboard { margin-left: 8px; padding: 4px 10px; font-size: 10px; }
  .btn-alerts { margin-left: 4px; padding: 4px 10px; font-size: 10px; }
  .btn-remediation { margin-left: 4px; padding: 4px 10px; font-size: 10px; }
  .btn-webhooks { margin-left: 4px; padding: 4px 10px; font-size: 10px; }
  .btn-settings { margin-left: 4px; padding: 4px 10px; font-size: 10px; }
}

/* ---- Alerts page ---- */
.btn-alerts {
  background: rgba(37,99,235,.15);
  color: #93bbfc;

  .flow-diagram-scroll { padding: 12px; }
  .flow-node { font-size: 11px; }
  .flow-node-topic, .flow-node-sub, .flow-node-queue { min-width: 150px; }
}

/* ---- Flow Diagram ---- */
.flow-diagram-scroll {
  padding: 20px 24px;
  overflow: auto;
  flex: 1;
}

.flow-diagram-container {
  position: relative;
  min-width: max-content;
}

.flow-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.flow-connection {
  fill: none;
  stroke: var(--slate-300);
  stroke-width: 1.5;
  transition: stroke .15s ease, stroke-width .15s ease;
}

.flow-connection.highlighted {
  stroke: var(--blue-500);
  stroke-width: 2.5;
}

/* Filter rule labels on connection lines */
.flow-rule-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--slate-500);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: all var(--transition-fast);
}

/* Throughput bar inside subscription nodes */
.flow-throughput-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--slate-100);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}

.flow-throughput-fill {
  height: 100%;
  border-radius: 0 0 0 6px;
  transition: width .3s ease;
}

.flow-rule-label:hover {
  max-width: 400px;
  white-space: normal;
  background: #fff;
  border-color: var(--blue-300);
  color: var(--slate-700);
  z-index: 20;
  box-shadow: var(--shadow-md);
}

/* Flow nodes */
.flow-node {
  position: absolute;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1.5px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  overflow: hidden;
}

.flow-node:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  z-index: 10;
}

.flow-node-namespace {
  background: var(--blue-900);
  border-color: var(--blue-700);
  color: var(--slate-200);
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: default;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
}

.flow-node-namespace:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* Health border colors */
.flow-node.health-green { border-color: var(--teal-500); }
.flow-node.health-orange { border-color: var(--amber-500); }
.flow-node.health-red { border-color: var(--red-500); border-width: 2px; }

/* Type-specific accents */
.flow-node-topic { border-left-width: 4px; border-left-color: var(--blue-500); }
.flow-node-sub { border-left-width: 4px; border-left-color: var(--teal-500); }
.flow-node-queue { border-left-width: 4px; }
.flow-node-queue.health-green { border-left-color: #8b5cf6; }
.flow-node-queue.health-orange { border-left-color: #8b5cf6; }
.flow-node-queue.health-red { border-left-color: #8b5cf6; }

.flow-node-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.flow-node-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1.4;
}

.flow-badge-ns {
  background: var(--blue-500);
  color: #fff;
}

.flow-badge-topic {
  background: var(--blue-100);
  color: var(--blue-600);
}

.flow-badge-sub {
  background: var(--teal-100);
  color: var(--teal-500);
}

.flow-badge-queue {
  background: #ede9fe;
  color: #7c3aed;
}

.flow-node-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-node-namespace .flow-node-name {
  color: var(--slate-200);
}

.flow-node-counts {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.flow-count-active {
  color: var(--blue-600);
}

.flow-count-dlq {
  color: var(--slate-400);
}

.flow-count-dlq.has-dlq {
  color: var(--red-500);
  font-weight: 600;
}

.flow-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--slate-400);
  font-size: 13px;
}

/* Flow button in topbar */
.btn-flow-diagram {
  background: rgba(37,99,235,.15);
  color: var(--blue-300);
  border: 1px solid rgba(37,99,235,.25);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  margin-left: 8px;
  margin-left: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s ease;
  letter-spacing: .01em;
}

.btn-alerts:hover {
.btn-flow-diagram:hover {
  background: rgba(37,99,235,.25);
  color: #fff;
  border-color: rgba(37,99,235,.4);
}

.alerts-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.alert-form {
  display: flex;
  flex-direction: column;
}

.alert-channel-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}

.alert-channel-slack {
  background: #e8f5e9;
  color: #2e7d32;
}

.alert-channel-teams {
  background: #e3f2fd;
  color: #1565c0;
}

.alert-channel-email {
  background: var(--amber-100);
  color: var(--amber-500);
}

.alert-actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-alert-action {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 3px 10px;
  background: #fff;
  color: var(--slate-600);
  transition: all .15s ease;
}

.btn-alert-action:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--blue-600);
}

.alert-delete-btn:hover,
.webhook-delete-btn:hover {
  background: var(--red-50);
  border-color: var(--red-500);
  color: var(--red-500);
}

.flow-node-highlighted {
  box-shadow: var(--shadow-md), 0 0 0 2px var(--blue-400);
  z-index: 10;
}
}

/* ---- Timeline ---- */

.btn-timeline {
  background: transparent;
  color: var(--slate-600);
  border: 1px solid var(--slate-300);
  padding: 5px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-timeline:hover {
  background: var(--slate-100);
  color: var(--slate-800);
  border-color: var(--slate-400);
}

.timeline-page {
  padding: 20px;
}

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

.timeline-controls-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timeline-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-range-group {
  display: flex;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.timeline-range-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: var(--slate-50);
  color: var(--slate-600);
  cursor: pointer;
  transition: var(--transition-fast);
  border-right: 1px solid var(--slate-300);
}

.timeline-range-btn:last-child {
  border-right: none;
}

.timeline-range-btn:hover {
  background: var(--slate-100);
}

.timeline-range-active {
  background: var(--blue-600);
  color: white;
}

.timeline-range-active:hover {
  background: var(--blue-700);
}

.timeline-entity-select {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--slate-700);
  font-family: var(--font-sans);
  min-width: 180px;
}

.timeline-chart-container {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.timeline-chart {
  width: 100%;
  min-height: 320px;
}

.timeline-svg {
  width: 100%;
  height: auto;
}

.timeline-marker:hover {
  filter: brightness(0.85);
  transform-origin: center;
}

.timeline-detail {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.timeline-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--slate-200);
}

.timeline-detail-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--slate-900);
  flex: 1;
}

.timeline-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--slate-400);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.timeline-close-btn:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}

.timeline-detail-body {
  font-size: 13px;
  color: var(--slate-700);
  line-height: 1.6;
}

.timeline-detail-row {
  margin-bottom: 4px;
}

.timeline-detail-row strong {
  color: var(--slate-900);
  margin-right: 6px;
}

.timeline-detail-meta {
  margin-top: 10px;
}

.timeline-detail-json {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-700);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-event-list {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.timeline-event-list .overview-section-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-200);
}

.timeline-events-table {
  max-height: 400px;
  overflow-y: auto;
}

.timeline-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 13px;
}

.timeline-event-row:hover {
  background: var(--slate-50);
}

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

.timeline-event-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.timeline-cat-alert { background: var(--red-100); color: var(--red-500); }
.timeline-cat-redrive { background: var(--teal-100); color: var(--teal-500); }
.timeline-cat-purge { background: var(--amber-100); color: var(--amber-500); }
.timeline-cat-deployment { background: var(--purple-100); color: var(--purple-500); }
.timeline-cat-annotation { background: var(--green-100); color: var(--green-500); }
.timeline-cat-incident { background: var(--red-50); color: var(--red-400); }
.timeline-cat-change { background: var(--blue-100); color: var(--blue-600); }
.timeline-cat-operation { background: var(--slate-100); color: var(--slate-600); }
.timeline-cat-send { background: var(--blue-50); color: var(--blue-500); }
.timeline-cat-cancel { background: var(--amber-100); color: var(--amber-400); }
.timeline-cat-audit { background: var(--slate-100); color: var(--slate-600); }
.timeline-cat-event { background: var(--purple-100); color: var(--purple-500); }

.timeline-event-title {
  flex: 1;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-event-entity {
  color: var(--slate-500);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.timeline-event-actor {
  color: var(--slate-500);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-event-time {
  color: var(--slate-400);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-delete-annotation {
  background: none;
  border: none;
  color: var(--slate-400);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: var(--radius-sm);
}

.timeline-delete-annotation:hover {
  background: var(--red-50);
  color: var(--red-500);
}

.timeline-empty {
  padding: 32px;
  text-align: center;
  color: var(--slate-500);
  font-size: 14px;
}

/* ---- Remediation ---- */

.remediation-page {
  padding: 0;
}

.remediation-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 20px;
}

.remediation-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  transition: all 0.15s ease;
}

.remediation-tab:hover {
  color: var(--blue-600);
}

.remediation-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
}

.remediation-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.remediation-action-replay_source {
  background: var(--blue-100);
  color: var(--blue-700);
}

.remediation-action-replay_target {
  background: var(--purple-100);
  color: var(--purple-500);
}

.remediation-action-move_parking {
  background: var(--amber-100);
  color: var(--amber-500);
}

.remediation-action-discard_backup {
  background: var(--red-100);
  color: var(--red-500);
}

/* ---- Webhooks ---- */

.webhook-events-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.webhook-event-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--slate-600);
  cursor: pointer;
}

.webhook-event-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--blue-50);
  color: var(--blue-600);
  white-space: nowrap;
}

.webhook-url-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===================================================================
   Settings page — Service Principal management
   =================================================================== */

.btn-settings {
  background: rgba(139,92,246,.15);
  color: var(--purple-500);
  border: 1px solid rgba(139,92,246,.25);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .01em;
}

.btn-settings:hover {
  background: rgba(139,92,246,.25);
  color: #fff;
  border-color: rgba(139,92,246,.4);
}

.settings-page {
  padding: 24px;
  max-width: 1100px;
}

.settings-section {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.settings-section-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-900);
  margin: 0;
}

.settings-section-desc {
  font-size: 13px;
  color: var(--slate-500);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Setup instructions */
.sp-setup-instructions {
  margin-bottom: 20px;
}

.sp-instructions-toggle {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-600);
  cursor: pointer;
  padding: 8px 0;
}

.sp-instructions-toggle:hover {
  color: var(--blue-700);
}

.sp-instructions-body {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--slate-700);
  line-height: 1.6;
}

.sp-instructions-body ol {
  margin: 0;
  padding-left: 20px;
}

.sp-instructions-body li {
  margin-bottom: 6px;
}

.sp-instructions-note {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,.6);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--slate-600);
}

.sp-instructions-note code {
  background: var(--blue-100);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* SP table */
.sp-table-wrap {
  overflow-x: auto;
}

.sp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sp-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--slate-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 12px;
  border-bottom: 2px solid var(--slate-200);
}

.sp-row {
  border-bottom: 1px solid var(--slate-100);
}

.sp-row:hover {
  background: var(--slate-50);
}

.sp-row-revoked {
  opacity: 0.6;
}

.sp-cell {
  padding: 10px 12px;
  color: var(--slate-700);
}

.sp-cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.sp-cell-actions {
  white-space: nowrap;
}

.sp-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.sp-status-active {
  background: var(--green-100);
  color: var(--green-500);
}

.sp-status-revoked {
  background: var(--red-100);
  color: var(--red-500);
}

.sp-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--slate-400);
  font-size: 14px;
}

/* SP form overlay */
.sp-form-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.sp-form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 500px;
  max-width: 95vw;
  box-shadow: var(--shadow-md);
}

.sp-form-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-900);
  margin: 0 0 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  margin-bottom: 4px;
}

.form-label .required {
  color: var(--red-500);
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--slate-800);
  background: #fff;
  transition: border-color .15s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.sp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-primary:hover {
  background: var(--blue-700);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
  border: 1px solid var(--slate-300);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-ghost:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

.btn-danger:hover {
  background: var(--red-50);
  color: var(--red-500);
  border-color: var(--red-500);
}

.sp-test-success {
  color: var(--green-500) !important;
  border-color: var(--green-500) !important;
}

/* ---- Documentation page ---- */
.docs-page {
  display: flex;
  gap: 24px;
  max-width: 1100px;
}

.docs-nav {
  position: sticky;
  top: 0;
  flex-shrink: 0;
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  align-self: flex-start;
}

.docs-nav-link {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--slate-500);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all .15s ease;
}

.docs-nav-link:hover {
  color: var(--slate-700);
  background: var(--slate-50);
}

.docs-nav-link.active {
  color: var(--blue-600);
  background: rgba(59,130,246,.08);
  font-weight: 500;
}

.docs-content {
  flex: 1;
  min-width: 0;
}

.docs-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--slate-200);
}

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

.docs-section h3 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 12px;
}

.docs-section h4 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  margin-top: 20px;
  margin-bottom: 8px;
}

.docs-section p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.7;
  margin-bottom: 10px;
}

.docs-section ul,
.docs-section ol {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.8;
  padding-left: 20px;
  margin-bottom: 12px;
}

.docs-section li {
  margin-bottom: 4px;
}

.docs-section code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--slate-100);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--slate-700);
}

.docs-section em {
  font-style: italic;
  color: var(--slate-500);
}

.docs-code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  white-space: pre;
  color: var(--slate-700);
  line-height: 1.6;
  margin: 10px 0 16px;
}

.docs-table {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 12px;
  border-collapse: collapse;
  margin: 10px 0 16px;
}

.docs-table th {
  text-align: left;
  font-weight: 600;
  color: var(--slate-600);
  background: var(--slate-50);
  padding: 8px 12px;
  border-bottom: 2px solid var(--slate-200);
}

.docs-table td {
  padding: 7px 12px;
  color: var(--slate-600);
  border-bottom: 1px solid var(--slate-100);
}

.docs-table tr:hover td {
  background: var(--slate-50);
}

@media (max-width: 768px) {
  .docs-page { flex-direction: column; }
  .docs-nav { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; }
}
