/* ============================================================
   SYSTEMS.CSS — Infrastructure monitoring dashboard
   ============================================================ */

/* ─── Page Header Flex ──────────────────────────────────── */
.page-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.sys-last-refresh {
  white-space: nowrap;
}

/* ─── Service Health Grid ───────────────────────────────── */
.sys-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-md);
}

.health-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: border-color var(--transition), background var(--transition);
}
.health-tile:hover {
  background: var(--bg-hover);
}
.health-tile-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}
.health-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.health-tile-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.health-tile-latency {
  font-size: 11px;
  color: var(--text-faint);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Health status variants */
.health-green  { border-left-color: var(--success); }
.health-yellow { border-left-color: var(--warning); }
.health-red    { border-left-color: var(--danger); }
.health-pending {
  border-left-color: var(--text-faint);
  opacity: 0.55;
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.yellow { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.red    { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }
.status-dot.grey   { background: var(--text-faint); }
.status-dot.blue   { background: var(--info);    box-shadow: 0 0 6px var(--info); }

/* Pulse animation for active checks */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.status-dot.checking {
  background: var(--text-muted);
  animation: pulse-dot 1s infinite;
}

/* ─── Error & Activity Lists ────────────────────────────── */
.sys-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sys-list-item:last-child { border-bottom: none; }

.sys-list-item-body {
  flex: 1;
  min-width: 0;
}
.sys-list-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sys-list-item-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sys-list-item-time {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.sys-empty-state {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-faint);
  font-size: 13px;
}
.sys-empty-icon {
  font-size: 24px;
  margin-bottom: var(--space-sm);
}

/* ─── Timeline Chart ────────────────────────────────────── */
.timeline-wrap {
  padding: var(--space-sm) 0;
}
.timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: var(--space-sm) 0;
}
.timeline-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.4s ease, background 0.15s ease;
  position: relative;
  cursor: default;
}
.timeline-bar:hover {
  background: var(--accent-dim);
}
.timeline-bar-tooltip {
  display: none;
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  z-index: 5;
}
.timeline-bar:hover .timeline-bar-tooltip {
  display: block;
}
.timeline-day-labels {
  display: flex;
  gap: 4px;
}
.timeline-day-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-faint);
}

/* ─── Workflow Breakdown ────────────────────────────────── */
.wf-breakdown-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.wf-breakdown-row:last-child { border-bottom: none; }

.wf-breakdown-name {
  font-size: 12px;
  color: var(--text-primary);
  width: 160px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-breakdown-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.wf-breakdown-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.wf-breakdown-count {
  font-size: 12px;
  color: var(--text-muted);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Toggle label */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-label input { cursor: pointer; }

/* ─── Execution List (scrollable) ───────────────────────── */
.wf-exec-list {
  max-height: 380px;
  overflow-y: auto;
}

/* ─── Pipeline Funnel ───────────────────────────────────── */
.funnel-stages {
  display: flex;
  gap: 2px;
  min-height: 70px;
  align-items: stretch;
}
.funnel-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-xs);
  min-width: 0;
  position: relative;
}
.funnel-stage-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}
.funnel-stage-count {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.funnel-stage-pct {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}
.funnel-arrow {
  display: flex;
  align-items: center;
  color: var(--text-faint);
  font-size: 14px;
  flex-shrink: 0;
  padding: 0 2px;
}

/* ─── Config: Infrastructure Map ────────────────────────── */
.infra-map {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.infra-server-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
}
.infra-block-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.infra-block-detail {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.infra-services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.infra-service-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-primary);
}
.infra-service-port {
  font-size: 10px;
  color: var(--text-faint);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Connection arrow between blocks */
.infra-connection {
  text-align: center;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
}

/* ─── Config Tables ─────────────────────────────────────── */
.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.config-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
  border-bottom: 1px solid var(--border);
}
.config-table td {
  padding: 8px 10px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.config-table tr:last-child td { border-bottom: none; }
.config-table tr:hover td { background: var(--bg-hover); }
.config-table .mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.config-scroll {
  max-height: 400px;
  overflow-y: auto;
}

/* DB Overview category headers */
.db-category-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 600;
  padding: 12px 10px 6px;
  border-bottom: 1px solid var(--border);
}

/* ─── Badges (reuse from main, add processing-specific) ── */
.badge-processing { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-type       { background: var(--bg-hover); color: var(--text-muted); }
.badge-cat        { background: rgba(124, 106, 247, 0.15); color: var(--accent); }
.badge-sub        { background: var(--bg-elevated); color: var(--text-muted); }

/* ─── Prompts Tab ──────────────────────────────────────── */

/* Toolbar */
.prompt-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}
.prompt-search-input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 13px;
  width: 200px;
}
.prompt-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.prompt-cat-select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
}

/* Prompt list items */
.prompt-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.prompt-list-item:last-child { border-bottom: none; }
.prompt-list-item:hover { background: var(--bg-hover); }

.prompt-list-info {
  flex: 1;
  min-width: 0;
}
.prompt-list-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.prompt-list-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompt-list-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.prompt-list-meta {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
  min-width: 80px;
}

/* ─── Prompt Editor Modal ─────────────────────────────── */
.prompt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
}
.prompt-overlay.open { display: block; }

.prompt-modal {
  display: none;
  position: fixed;
  top: 3%;
  left: 5%;
  width: 90%;
  height: 94%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 910;
  flex-direction: column;
  overflow: hidden;
}
.prompt-modal.open { display: flex; }

.prompt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.prompt-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.prompt-modal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.prompt-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.prompt-modal-close:hover { color: var(--text-primary); }

.prompt-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Editor column */
.prompt-editor-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  overflow-y: auto;
  gap: var(--space-md);
}

/* Meta fields */
.prompt-meta-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}
.prompt-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.prompt-field label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.prompt-field input,
.prompt-field select,
.prompt-field textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
.prompt-field input:focus,
.prompt-field select:focus,
.prompt-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.prompt-field-sm { flex: 0 0 auto; min-width: 130px; }
.prompt-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  padding-top: 8px;
}
.prompt-toggle-label input { cursor: pointer; }

/* Variable toolbar */
.prompt-var-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.prompt-var-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.prompt-var-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: 'SF Mono', 'Fira Code', monospace;
  transition: background 0.15s;
}
.prompt-var-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

/* Prompt textarea */
.prompt-textarea-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.prompt-textarea {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: var(--space-md);
  resize: vertical;
  min-height: 300px;
  tab-size: 2;
}
.prompt-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.prompt-textarea-readonly {
  opacity: 0.85;
  cursor: default;
}
.prompt-textarea-footer {
  display: flex;
  gap: var(--space-md);
  padding: 6px 0;
  font-size: 11px;
  color: var(--text-faint);
}

/* Action bar */
.prompt-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.prompt-action-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.prompt-change-note {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
  width: 260px;
}
.prompt-change-note:focus {
  outline: none;
  border-color: var(--accent);
}

/* Test panel */
.prompt-test-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.prompt-test-input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
  font-family: inherit;
}
.prompt-test-input:focus { outline: none; border-color: var(--accent); }
.prompt-test-result {
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}

/* Danger button */
.prompt-danger-btn { color: var(--danger) !important; }
.prompt-danger-btn:hover { background: rgba(248,113,113,0.1) !important; }

/* ─── Version History Column ───────────────────────────── */
.prompt-versions-col {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.prompt-versions-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-md) var(--space-sm);
}
.prompt-versions-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-md);
}
.prompt-version-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.prompt-version-item:hover { background: var(--bg-hover); }
.prompt-version-item:last-child { border-bottom: none; }
.prompt-version-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.prompt-version-time {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 8px;
}
.prompt-version-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.prompt-version-item.active {
  background: var(--bg-elevated);
}

/* Version preview */
.prompt-version-preview {
  border-top: 1px solid var(--border);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 50%;
}
.prompt-version-preview-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.prompt-version-preview-header .btn { margin-left: auto; }
.prompt-version-preview .prompt-textarea {
  min-height: 120px;
  flex: 1;
}

/* ─── Custom Scrollbars (global) ───────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* ─── Style Profile Modal ──────────────────────────────── */

.style-modal {
  display: none;
  position: fixed;
  top: 2%;
  left: 3%;
  width: 94%;
  height: 96%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 910;
  flex-direction: column;
  overflow: hidden;
}
.style-modal.open { display: flex; }

.style-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Form column */
.style-form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  overflow-y: auto;
  gap: var(--space-sm);
}

.style-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.style-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Chip groups (multi-select) */
.style-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.style-chip {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.style-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.style-chip.selected {
  background: rgba(124, 106, 247, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.style-action-bar {
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Preview column */
.style-preview-col {
  width: 420px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.style-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.style-preview-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.style-preview-status {
  font-size: 12px;
  color: var(--accent);
}
.style-preview-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}
.style-preview-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.6;
}
.style-preview-empty-icon {
  font-size: 36px;
  margin-bottom: var(--space-md);
  color: var(--accent);
  opacity: 0.4;
}

/* Preview example cards */
.style-example-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.style-example-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.style-example-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Style directive section */
.style-preview-actions {
  border-top: 1px solid var(--border);
  padding: var(--space-md);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.style-directive-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.style-directive-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  font-weight: 600;
}
.style-directive-section .prompt-textarea {
  min-height: 100px;
  max-height: 160px;
  font-size: 12px;
}
.style-apply-bar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.btn-lg {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
}
.btn-accent {
  background: rgba(124, 106, 247, 0.15);
  color: var(--accent);
  border: 1px solid rgba(124, 106, 247, 0.3);
}
.btn-accent:hover {
  background: rgba(124, 106, 247, 0.25);
  border-color: var(--accent);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-header-flex {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .sys-health-grid {
    grid-template-columns: 1fr;
  }
  .timeline-chart {
    height: 80px;
  }
  .funnel-stages {
    flex-direction: column;
  }
  .funnel-arrow {
    transform: rotate(90deg);
    justify-content: center;
    padding: 4px 0;
  }
  .wf-breakdown-name {
    width: 120px;
  }
  .infra-services {
    flex-direction: column;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .prompt-toolbar { flex-direction: column; align-items: stretch; }
  .prompt-search-input { width: 100%; }
  .prompt-modal { left: 1%; width: 98%; top: 1%; height: 98%; }
  .prompt-modal-body { flex-direction: column; }
  .prompt-versions-col { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 200px; }
  .prompt-meta-row { flex-wrap: wrap; }
  .style-modal { left: 1%; width: 98%; top: 1%; height: 98%; }
  .style-modal-body { flex-direction: column; }
  .style-preview-col { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 50%; }
  .conn-grid { grid-template-columns: 1fr !important; }
}

/* ─── Connections Tab ──────────────────────────────────── */
.conn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-md);
}
.conn-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition);
}
.conn-card:hover { border-color: var(--border-strong); }
.conn-card.conn-connected { border-color: var(--success); border-left: 3px solid var(--success); }
.conn-card.conn-disabled { opacity: 0.5; }
.conn-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}
.conn-platform-info { display: flex; align-items: center; gap: var(--space-sm); }
.conn-icon { font-size: 1.5rem; }
.conn-name { font-weight: 600; font-size: 1rem; }
.conn-status {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.conn-status-connected { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.conn-status-expired { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.conn-status-blocked { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.conn-card-body { display: flex; flex-direction: column; gap: var(--space-sm); }
.conn-meta { font-size: 0.8rem; color: var(--text-muted); }
.conn-btn { align-self: flex-start; }
.conn-manual-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.conn-input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.conn-input:focus { border-color: var(--accent); outline: none; }
.conn-input::placeholder { color: var(--text-faint); }
