/* ==========================================================================
   Next AI Enterprises - Core Theme & Stylesheet
   Modern Glassmorphism & Cyber-Corporate RTL Interface
   ========================================================================== */

:root {
  --bg-main: #0a0f1d;
  --bg-sidebar: #0e1526;
  --bg-card: rgba(20, 29, 48, 0.7);
  --bg-card-hover: rgba(28, 40, 66, 0.85);
  --bg-modal: #111a2e;
  --bg-terminal: #070a12;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --secondary: #6366f1;
  --accent: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --sidebar-width: 280px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Glowing Ambient Orbs */
.ambient-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.glow-1 { top: -100px; right: -100px; background: #3b82f6; }
.glow-2 { bottom: -100px; left: -100px; background: #8b5cf6; }

/* Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.brand-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(to left, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.05));
  border-color: rgba(59, 130, 246, 0.3);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.deploy-status-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulseGlow 2s infinite;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-bar-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

.main-content {
  padding: 36px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.content-section.hidden {
  display: none;
}

/* --------------------------------------------------------------------------
   Hero & Overview Section
   -------------------------------------------------------------------------- */
.hero-banner {
  background: linear-gradient(135deg, rgba(30, 41, 69, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.pillar-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.pillar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.pillar-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Agent Cards & Org Chart
   -------------------------------------------------------------------------- */
.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.dept-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dept-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.dept-filter-btn:hover,
.dept-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.agent-card.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  position: relative;
}

.agent-card.profile-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Compact Side-by-Side Header */
.agent-card-top-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.agent-photo-wrapper-compact {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: radial-gradient(circle at center, #1e293b 0%, #0b0f19 100%);
  flex-shrink: 0;
  border: 2px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.2);
}

.agent-portrait-img-compact {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.agent-card:hover .agent-portrait-img-compact {
  transform: scale(1.08);
}

.pulse-dot-corner {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 11px;
  height: 11px;
  background-color: var(--success);
  border-radius: 50%;
  border: 2px solid #0a0f1d;
  box-shadow: 0 0 8px var(--success);
}

.agent-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-full-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-dept-pill-inline {
  font-size: 0.7rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.agent-role-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.agent-role-subtitle code {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.agent-specialty-compact {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-specialty-compact .spec-label {
  color: #93c5fd;
  font-weight: 700;
  margin-left: 4px;
}

.agent-summary-compact {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agent-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.agent-tools-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.agent-badge-tag {
  font-size: 0.72rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.agent-specialty-line {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.spec-label {
  color: #93c5fd;
  font-weight: 700;
  margin-left: 6px;
}

.spec-value {
  color: #e2e8f0;
}

.agent-role-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.agent-role-subtitle code {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.agent-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.agent-info-table {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-k {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.info-v {
  font-size: 0.82rem;
  color: #f1f5f9;
}

.modal-portrait-wrapper {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--primary);
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--primary-glow);
}

.modal-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.select-agent-photo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Interactive Workflow Simulator
   -------------------------------------------------------------------------- */
.simulator-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.sim-control-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sim-select-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-select {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.sim-select:focus {
  border-color: var(--primary);
}

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

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.pipeline-node {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
  position: relative;
}

.pipeline-node.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 20px var(--primary-glow);
}

.pipeline-node.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.pipeline-node.waiting {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
  animation: pulseWarning 1.5s infinite;
}

.node-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.pipeline-node.active .node-indicator {
  background: var(--primary);
  color: #fff;
}

.pipeline-node.completed .node-indicator {
  background: var(--success);
  color: #fff;
}

.pipeline-node .node-check {
  display: none;
}

.pipeline-node.completed .node-num {
  display: none;
}

.pipeline-node.completed .node-check {
  display: inline;
}

.node-agent {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.node-action {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Terminal Console View */
.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.terminal-header {
  background: #0f172a;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.t-dot.red { background: #ef4444; }
.t-dot.yellow { background: #f59e0b; }
.t-dot.green { background: #10b981; }

.terminal-title {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.6;
}

.terminal-line.type-info { color: #93c5fd; }
.terminal-line.type-agent-action { color: #67e8f9; font-weight: 600; }
.terminal-line.type-log-detail { color: #cbd5e1; padding-right: 12px; }
.terminal-line.type-output-item { color: #a7f3d0; padding-right: 12px; }
.terminal-line.type-warning { color: #fde047; font-weight: 600; }
.terminal-line.type-success { color: #86efac; font-weight: 600; }

.human-approval-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.human-approval-banner.hidden {
  display: none;
}

/* --------------------------------------------------------------------------
   Framework Matrix
   -------------------------------------------------------------------------- */
.frameworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

.framework-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.fw-category {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

.fw-title {
  font-size: 1.4rem;
  font-weight: 800;
}

.fw-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.fw-tagline {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.fw-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.fw-point-group strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.fw-point-group ul {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fw-point-group li::before {
  content: "•";
  margin-left: 6px;
  color: var(--text-dim);
}

.fw-best-for {
  font-size: 0.85rem;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.08);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.code-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.code-block {
  background: #080c16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #e2e8f0;
  overflow-x: auto;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Roadmap & Checklist Section
   -------------------------------------------------------------------------- */
.roadmap-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
}

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

.progress-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.phases-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.roadmap-phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
}

.phase-header {
  margin-bottom: 20px;
}

.phase-badge {
  display: inline-block;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.phase-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.phase-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.phase-mini-progress {
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: 6px;
  font-weight: 600;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.checklist-item.checked {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
}

.checklist-item input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.checklist-item.checked .custom-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.checklist-item.checked .custom-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.item-text {
  font-size: 0.92rem;
}

.checklist-item.checked .item-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Modal Window
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header-top {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-content-body {
  padding: 10px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-agent-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.modal-avatar {
  font-size: 3rem;
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

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

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.custom-list {
  list-style: none;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-list li::before {
  content: "▹";
  color: var(--primary);
  margin-left: 8px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fef08a;
}

.alert-warning ul {
  padding-right: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sample-task-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   UI Elements & Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-copy.copied {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}
/* --------------------------------------------------------------------------
   AI Workforce Command Center & Interactive Task Dispatcher
   -------------------------------------------------------------------------- */
.command-center-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.agent-selector-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.agent-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.agent-select-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.agent-select-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.agent-select-card.selected {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.agent-select-card.selected::after {
  content: "✓ انتخاب شده";
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.agent-select-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-select-avatar {
  font-size: 1.8rem;
}

.agent-select-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.agent-select-role {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.agent-select-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Command Console Form */
.cmd-console-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cmd-input-area {
  width: 100%;
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 16px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.8;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: var(--transition);
}

.cmd-input-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
}

.cmd-options-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.cmd-options-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Live Monitor Deck */
.live-monitor-deck {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.live-monitor-deck.hidden {
  display: none;
}

.monitor-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.monitor-agent-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: var(--transition);
}

.monitor-agent-card.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 14px var(--primary-glow);
}

.monitor-agent-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.monitor-agent-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Output Deck */
.output-deck {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.output-deck.hidden {
  display: none;
}

.output-deck-header {
  background: rgba(10, 15, 29, 0.8);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

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

.output-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.output-tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.output-deck-actions {
  display: flex;
  gap: 10px;
}

.output-deck-body {
  padding: 28px;
}

.output-pane {
  display: none;
}

.output-pane.active {
  display: block;
}

.rendered-article-container {
  line-height: 1.9;
  font-size: 1rem;
}

.rendered-article-container h1 {
  font-size: 1.7rem;
  margin-bottom: 16px;
  color: #fff;
}

.rendered-article-container h2 {
  font-size: 1.3rem;
  margin: 24px 0 12px;
  color: #93c5fd;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.rendered-article-container h3 {
  font-size: 1.1rem;
  margin: 18px 0 10px;
}

.rendered-article-container blockquote {
  background: rgba(59, 130, 246, 0.08);
  border-right: 4px solid var(--primary);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  color: #cbd5e1;
}

.rendered-article-container hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 24px 0;
}

.seo-card-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 16px;
}

.seo-card-box h4 {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.seo-value-line {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 6px;
}

/* History */
.history-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.history-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.history-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.history-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.hist-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.hist-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.hist-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   UI Elements & Buttons
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-right: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .main-content {
    padding: 20px;
  }
  .hero-banner {
    padding: 24px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .fw-points, .modal-grid-2 {
    grid-template-columns: 1fr;
  }
}
