/* ═══════════════════════════════════════════════════════════════════════════
   LAYER 2: REUSABLE UI PRIMITIVES (`window.AgentXUI` & Shared Controls)
   Co-located with `ui-primitives.js`
   ═══════════════════════════════════════════════════════════════════════════ */

.agx-svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.agx-brand-emblem {
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e7e9ea;
}

/* ─── LANGUAGE PILL SELECTOR ──────────────────────────────────────────────── */
.agx-lang-container {
  position: relative;
  display: inline-block;
}

.agx-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 9999px;
  background: #000000;
  border: 1px solid #536471;
  color: #e7e9ea;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.agx-lang-md {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 36px;
}

.agx-lang-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  min-height: 32px;
}

.agx-lang-pill:hover {
  background: rgba(231, 233, 234, 0.1);
}

.agx-lang-pill.is-open {
  border-color: #1d9bf0;
  background: rgba(29, 155, 240, 0.1);
}

.agx-lang-flag-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.agx-lang-flag-wrap.lg {
  width: 22px;
  height: 16px;
  border-radius: 3.5px;
}

.agx-lang-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agx-lang-code {
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.agx-lang-chevron {
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.agx-lang-chevron.is-open {
  transform: rotate(180deg);
  color: #1d9bf0;
}

.agx-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  border-radius: 16px;
  background: #000000;
  border: 1px solid #2f3336;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 99999;
}

.agx-lang-menu-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid #2f3336;
  margin-bottom: 4px;
}

.agx-lang-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agx-lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease;
}

.agx-lang-option:hover {
  background: #16181c;
}

.agx-lang-option.is-selected {
  background: rgba(29, 155, 240, 0.12);
}

.agx-lang-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agx-lang-option-names {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.agx-lang-option-primary {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.agx-lang-option-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.agx-lang-check {
  color: #1d9bf0;
  display: inline-flex;
}

.agx-lang-short-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.flag-icon {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ─── SHARED FORMS, BUTTONS, CARDS, BADGES & TABLES ──────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-lead-icon {
  position: absolute;
  left: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  pointer-events: none;
}

.input-icon-wrap:focus-within .input-lead-icon {
  color: #1d9bf0;
}

.input, .select, .textarea {
  width: 100%;
  background: #000000;
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input.has-lead-icon {
  padding-left: 38px;
}

.input::placeholder, .textarea::placeholder {
  color: #71767b;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: #1d9bf0;
  box-shadow: 0 0 0 1px #1d9bf0;
}

.select option {
  background: #000000;
  color: #e7e9ea;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary {
  background: #1d9bf0;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #1a8cd8;
}

.btn-secondary {
  background: transparent;
  border-color: #536471;
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(239, 243, 244, 0.1);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(244, 33, 46, 0.4);
  color: #f4212e;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: rgba(231, 233, 234, 0.1);
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: agxSpin 0.75s linear infinite;
}

.btn-spinner.dark {
  border-color: rgba(15, 20, 25, 0.25);
  border-top-color: #0f1419;
}

.pills-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
  border-bottom: 1px solid #2f3336;
  scrollbar-width: none;
  background: #000000;
}

.pills-bar::-webkit-scrollbar {
  display: none;
}

.pill {
  padding: 7px 14px;
  border-radius: 9999px;
  background: #16181c;
  border: 1px solid #2f3336;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill.active {
  background: #1d9bf0;
  color: #ffffff;
  border-color: #1d9bf0;
}

.news-micro-btn,
.ask-oracle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.news-micro-btn--oracle:hover,
.ask-oracle-btn:hover {
  color: #1d9bf0;
  background: rgba(29, 155, 240, 0.12);
}

.page-section {
  padding: 20px;
  max-width: 1160px;
  margin: 0 auto;
}

.stats-grid,
.agx-stat-grid,
.agx-bento-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card,
.agx-stat-card {
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 16px;
  padding: 16px 18px;
  font-variant-numeric: tabular-nums;
}

.stat-label,
.agx-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.agx-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.agx-stat-icon {
  color: #1d9bf0;
}

.agx-stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stat-value,
.agx-stat-value {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.agx-stat-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-sub,
.agx-stat-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 5px;
}

.panel-card {
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

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

.panel-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title svg {
  color: #1d9bf0;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #2f3336;
  gap: 12px;
}
.toggle-row:last-child {
  border-bottom: none;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  background: #2f3336;
  border: 1px solid #536471;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.18s;
  flex-shrink: 0;
}
.switch.on {
  background: #1d9bf0;
  border-color: #1d9bf0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch.on::after {
  transform: translateX(18px);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #2f3336;
}
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.data-table th {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.badge-green { background: var(--emerald-soft); color: #00ba7c; border: 1px solid rgba(0, 186, 124, 0.3); }
.badge-amber { background: var(--amber-soft); color: #ffd400; border: 1px solid rgba(255, 212, 0, 0.3); }
.badge-red   { background: var(--danger-soft); color: #f4212e; border: 1px solid rgba(244, 33, 46, 0.3); }
.badge-blue  { background: var(--accent-soft); color: #1d9bf0; border: 1px solid rgba(29, 155, 240, 0.3); }

/* ─── TOAST NOTIFICATIONS ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1d9bf0;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  font-size: 13.5px;
  font-weight: 700;
}

/* ─── REUSABLE SEGMENTED TABS, FILTERBAR, TOGGLE CARDS, N8N & STORAGE ────── */
.agx-segmented-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-root);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.agx-seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  min-height: 36px;
}

.agx-seg-tab.active {
  background: var(--accent);
  color: #ffffff;
}

.agx-seg-badge {
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.agx-filterbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 14px;
}

.agx-search-box {
  position: relative;
  flex: 1;
  min-width: 210px;
}

.agx-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.agx-search-input {
  width: 100%;
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 13px;
}

.agx-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agx-pill-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-root);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.agx-pill-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #1d9bf0;
}

.agx-toggles-grid,
.agx-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
}

.agx-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.18s;
}

.agx-toggle-card.is-on {
  border-color: rgba(29, 155, 240, 0.35);
}

.agx-toggle-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.agx-toggle-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.agx-toggle-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.agx-switch-btn {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg-root);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.18s ease;
}

.agx-switch-btn.is-on {
  background: #00ba7c;
  border-color: #00ba7c;
}

.agx-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.agx-switch-btn.is-on .agx-switch-thumb {
  transform: translateX(20px);
}

.agx-badge-mini {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.agx-badge-mini.accent {
  background: rgba(29, 155, 240, 0.18);
  color: #1d9bf0;
}

/* ─── LIVE n8n-STYLE PIPELINE FLOW VISUALIZER ───────────────────────────── */
.agx-n8n-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
}

.agx-n8n-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: #000000;
}

.agx-n8n-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agx-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.agx-btn-pill.is-online {
  background: rgba(0, 186, 124, 0.14);
  border-color: rgba(0, 186, 124, 0.4);
  color: #00ba7c;
}

.agx-btn-pill.is-offline {
  background: rgba(244, 33, 46, 0.14);
  border-color: rgba(244, 33, 46, 0.4);
  color: #f4212e;
}

.agx-btn-primary-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #1d9bf0;
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.agx-n8n-canvas-scroll {
  width: 100%;
  overflow-x: auto;
  background-color: #000000;
  background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 20px 20px;
}

.agx-n8n-canvas {
  position: relative;
  min-width: 980px;
  height: 360px;
}

.agx-n8n-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.agx-flow-edge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 4;
}

.agx-flow-edge-line {
  fill: none;
  stroke: rgba(29, 155, 240, 0.45);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  animation: agxDashFlow 14s linear infinite;
}

.agx-flow-edge-line.active {
  stroke: #1d9bf0;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(29, 155, 240, 0.8));
}

.agx-flow-packet {
  fill: #1d9bf0;
  filter: drop-shadow(0 0 8px #1d9bf0);
}

@keyframes agxDashFlow {
  to { stroke-dashoffset: -120; }
}

.agx-n8n-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 146px;
  background: #16181c;
  border: 1.5px solid #2f3336;
  border-radius: 13px;
  padding: 9px 10px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
  user-select: none;
}

.agx-n8n-node:hover {
  transform: translate(-50%, -53%);
  border-color: #1d9bf0;
}

.agx-n8n-node.selected {
  border-color: #1d9bf0;
  box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.35);
}

.agx-n8n-node.status-running {
  border-color: #1d9bf0;
}

.agx-n8n-node.status-disabled {
  opacity: 0.48;
  border-style: dashed;
}

.agx-n8n-port {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1d9bf0;
  border: 2px solid #000000;
  transform: translateY(-50%);
}
.agx-n8n-port.port-in { left: -5px; }
.agx-n8n-port.port-out { right: -5px; }

.agx-n8n-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.agx-n8n-node-icon { color: #1d9bf0; }
.agx-n8n-node.type-ai .agx-n8n-node-icon { color: #7856ff; }
.agx-n8n-node.type-filter .agx-n8n-node-icon { color: #ffd400; }
.agx-n8n-node.type-sink .agx-n8n-node-icon { color: #00ba7c; }

.agx-n8n-node-type {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.agx-n8n-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #536471;
}
.status-passed .agx-n8n-status-dot { background: #00ba7c; }
.status-running .agx-n8n-status-dot { background: #1d9bf0; }
.status-dropped .agx-n8n-status-dot { background: #ffd400; }
.status-error .agx-n8n-status-dot { background: #f4212e; }

.agx-n8n-node-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agx-n8n-node-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.agx-n8n-node-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid #2f3336;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.agx-n8n-inspector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: #000000;
}

.agx-n8n-insp-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.agx-n8n-insp-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.agx-n8n-insp-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.agx-mini-metric {
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
}
.agx-mini-metric span { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; }
.agx-mini-metric strong { font-size: 13.5px; font-family: var(--font-mono); }

/* ─── STORAGE & SQLITE DATABASE BREAKDOWN ───────────────────────────────── */
.agx-storage-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agx-card-glass {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
}

.agx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agx-section-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin: 0 0 3px 0;
}

.agx-muted-sm {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.agx-storage-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-root);
  margin: 12px 0 16px;
  gap: 2px;
}

.agx-storage-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.agx-storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}

.agx-storage-cat-card {
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 11px 12px;
}

.agx-storage-cat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  margin-bottom: 6px;
}

.agx-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agx-storage-cat-vals {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.agx-big-num {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.agx-ext-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.agx-ext-pill {
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.agx-db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.agx-db-card {
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
}

.agx-db-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.agx-db-path {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  word-break: break-all;
}

.agx-db-tables {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agx-db-table-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 3px 0;
  border-bottom: 1px dashed #2f3336;
  font-variant-numeric: tabular-nums;
}

/* ─── TERMINAL CONTAINER LOG VIEWER & STEROID CHAT ──────────────────────── */
.agx-terminal-box,
.agx-log-terminal {
  background: #000000;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  max-height: 540px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

.agx-term-line,
.agx-log-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.agx-term-line:hover,
.agx-log-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.agx-term-ts,
.agx-log-ts { color: #71767b; flex-shrink: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.agx-term-pipe,
.agx-log-pipe {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(29, 155, 240, 0.14);
  color: #1d9bf0;
  flex-shrink: 0;
}
.agx-log-pipe.pipe-P1_ARGOS { background: rgba(0, 186, 124, 0.14); color: #00ba7c; }
.agx-log-pipe.pipe-P2_SENTINELA { background: rgba(120, 86, 255, 0.16); color: #a78bfa; }
.agx-term-lvl,
.agx-log-lvl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
  min-width: 42px;
}
.agx-term-lvl.error,
.agx-log-row.level-ERROR .agx-log-lvl { color: #f4212e; }
.agx-term-lvl.warn,
.agx-log-row.level-WARN .agx-log-lvl { color: #ffd400; }
.agx-term-lvl.info,
.agx-log-row.level-INFO .agx-log-lvl { color: #00ba7c; }
.agx-term-msg,
.agx-log-msg { color: #e7e9ea; word-break: break-word; flex: 1; }

.agx-steroid-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

.agx-steroid-main {
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: 640px;
  overflow: hidden;
}

.agx-steroid-head {
  padding: 12px 16px;
  border-bottom: 1px solid #2f3336;
  background: #000000;
}

.agx-steroid-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agx-steroid-bubble {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}

.agx-steroid-bubble.user {
  align-self: flex-end;
  background: #1d9bf0;
  color: #ffffff;
}

.agx-steroid-bubble.assistant {
  align-self: flex-start;
  background: #000000;
  border: 1px solid #2f3336;
  color: var(--text-primary);
}

.agx-steroid-input-row {
  padding: 12px 16px;
  border-top: 1px solid #2f3336;
  background: #000000;
  display: flex;
  gap: 8px;
}

.agx-steroid-input-row input {
  flex: 1;
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 13.5px;
}

.agx-steroid-side {
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 640px;
  overflow-y: auto;
}

@media (max-width: 980px) {
  .agx-steroid-layout {
    grid-template-columns: 1fr;
  }
}

/* ─── ATLETIQ & WEBXTEK ACTION CONFIRMATION DIALOG (ConfirmModal) ─────────── */
.agx-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 16, 0.74);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal, 1000);
  padding: 20px;
  animation: agxConfirmFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.agx-confirm-card {
  background: var(--bg-surface-solid, #141926);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: agxConfirmSpringUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.agx-confirm-variant-danger {
  border-color: rgba(244, 63, 94, 0.38);
}

.agx-confirm-variant-warning {
  border-color: rgba(245, 158, 11, 0.38);
}

.agx-confirm-variant-primary {
  border-color: rgba(56, 189, 248, 0.38);
}

.agx-confirm-specular-rim {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  pointer-events: none;
}

.agx-confirm-header {
  padding: 22px 24px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agx-confirm-head-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.agx-confirm-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.agx-confirm-icon-danger {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.agx-confirm-icon-warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.agx-confirm-icon-primary {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.agx-confirm-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.agx-confirm-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.agx-confirm-subtitle {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.45;
}

.agx-confirm-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.agx-confirm-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.agx-confirm-footer {
  padding: 16px 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 13, 20, 0.65);
}

.agx-confirm-btn {
  flex: 1 1 0%;
  min-height: 42px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.agx-confirm-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.agx-confirm-btn-cancel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.agx-confirm-btn-danger {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.3);
}

.agx-confirm-btn-danger:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.agx-confirm-btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #ffffff;
}

.agx-confirm-btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

@keyframes agxConfirmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes agxConfirmSpringUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
