/* =====================================================
   dashboard.css — dashboard & onboarding app styles
   Uses design tokens from theme.css (must be loaded first)
   ===================================================== */

/* ===== SHARED LAYOUT ===== */

.dash-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

/* ===== NAV ===== */

.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.dash-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  letter-spacing: -0.3px;
}

.dash-brand-hex {
  color: var(--accent);
  font-size: 1.3rem;
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.dash-company-name {
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 600;
}

.dash-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

.dash-status-label { color: var(--success); }

/* ===== CENTRAL BRAIN HERO ===== */

.brain-hero {
  padding: 64px 24px 48px;
  background:
    radial-gradient(ellipse 50% 60% at 50% 30%, rgba(108, 92, 231, 0.1) 0%, transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.brain-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 80px;
  align-items: center;
}

/* Brain hub diagram */
.brain-hub {
  position: relative;
  width: 360px;
  height: 300px;
  margin: 0 auto;
}

.brain-hub-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(108, 92, 231, 0.12);
}

.brain-ring-outer {
  width: 280px;
  height: 280px;
  animation: spin-slow 30s linear infinite;
  border-style: dashed;
}

.brain-ring-mid {
  width: 180px;
  height: 180px;
  animation: spin-slow 20s linear infinite reverse;
}

.brain-hub-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 0 48px var(--accent-glow), 0 0 80px rgba(108, 92, 231, 0.15);
  z-index: 2;
}

.brain-hub-icon {
  font-size: 28px;
  color: #fff;
  line-height: 1;
}

.brain-hub-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Satellites */
.brain-satellite {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  animation: sat-float 4s ease-in-out infinite;
  z-index: 2;
}

.brain-satellite span {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.brain-sat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--sat-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--sat-color);
  box-shadow: 0 0 20px color-mix(in srgb, var(--sat-color) 30%, transparent);
}

.brain-sat-tl { left: 5%;  top: 4%; }
.brain-sat-tr { right: 5%; top: 4%; }
.brain-sat-bl { left: 5%;  bottom: 4%; }
.brain-sat-br { right: 5%; bottom: 4%; }

.brain-connections-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Text side */
.brain-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.dash-accent {
  background: linear-gradient(135deg, var(--accent-bright), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brain-hero-sub {
  font-size: 1.05rem;
  color: var(--fg-muted);
  line-height: 1.7;
  max-width: 440px;
}

/* ===== DASH SECTIONS ===== */

.dash-section {
  padding: 64px 24px;
}

.dash-section:nth-child(even) {
  background: var(--bg-subtle);
}

.dash-container {
  max-width: 1120px;
  margin: 0 auto;
}

.dash-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 28px;
  color: var(--fg);
}

/* ===== AGENT STATUS CARDS ===== */

.agent-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.agent-status-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.agent-status-card.agent-active {
  border-color: rgba(108, 92, 231, 0.3);
}

.agent-status-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.agent-status-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.agent-status-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(var(--agent-color), 0.1);
  border: 1.5px solid var(--agent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--agent-color);
  flex-shrink: 0;
  box-shadow: 0 0 16px color-mix(in srgb, var(--agent-color) 20%, transparent);
}

.agent-status-info {
  flex: 1;
}

.agent-status-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 3px;
}

.agent-status-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.agent-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-active  { background: rgba(0, 206, 201, 0.12); color: var(--success); border: 1px solid rgba(0, 206, 201, 0.25); }
.badge-warning { background: rgba(253, 203, 110, 0.12); color: #fdcb6e; border: 1px solid rgba(253, 203, 110, 0.25); }
.badge-idle    { background: rgba(136, 136, 160, 0.12); color: var(--fg-muted); border: 1px solid rgba(136, 136, 160, 0.15); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

.agent-status-last {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-status-last-action {
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.5;
  flex: 1;
}

.agent-status-time {
  font-size: 0.75rem;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== LIVE ACTIVITY FEED ===== */

.feed-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.feed-header .dash-section-title { margin-bottom: 0; }

.feed-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.2);
  color: var(--success);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feed-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--fg-muted);
  font-size: 0.95rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 8px;
  transition: background 0.15s;
}

.feed-item:hover { background: var(--bg-card); }

.feed-item-new {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s;
}

.feed-item-visible {
  opacity: 1;
  transform: translateY(0);
}

.feed-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--feed-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--feed-color) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--feed-color);
  flex-shrink: 0;
}

.feed-item-body {
  flex: 1;
  min-width: 0;
}

.feed-item-agent {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}

.feed-item-action {
  font-size: 0.88rem;
  color: var(--fg);
  line-height: 1.5;
}

.feed-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.feed-item-status {
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 100px;
}

.feed-status-success { background: rgba(0,206,201,0.1); color: var(--success); }
.feed-status-warning { background: rgba(253,203,110,0.1); color: #fdcb6e; }
.feed-status-error   { background: rgba(255,100,100,0.1); color: #ff7675; }

.feed-item-time {
  font-size: 0.75rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* ===== ONBOARDING ===== */

.onboarding-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.onboarding-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 24px;
  align-items: start;
  width: 100%;
}

.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 44px;
}

.onboarding-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid var(--accent);
  color: var(--accent-bright);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
}

.onboarding-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.65;
  margin-bottom: 36px;
}

.onboarding-error {
  padding: 12px 16px;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  border-radius: 8px;
  color: #ff7675;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row { display: flex; gap: 16px; }
.form-row-2 > * { flex: 1; }

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

.form-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.1px;
}

.form-required { color: var(--accent-bright); }
.form-hint { color: var(--fg-muted); font-weight: 400; }

.form-input {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input::placeholder { color: var(--fg-muted); }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238888a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--fg);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 0 24px var(--accent-glow);
  margin-top: 4px;
}

.form-submit:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 32px rgba(162, 155, 254, 0.4);
}

.form-submit:active { transform: scale(0.98); }

.form-submit-icon { font-size: 18px; }

.form-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: -4px;
}

/* Preview sidebar */
.onboarding-preview {
  position: sticky;
  top: 84px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
}

.preview-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.preview-agents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.preview-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-align: center;
  transition: border-color 0.2s;
}

.preview-agent:hover { border-color: var(--pa-color); }

.preview-icon {
  font-size: 22px;
  color: var(--pa-color);
}

.preview-desc {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ===== ANIMATIONS ===== */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes spin-slow {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes sat-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
  .brain-hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .brain-hub { margin: 0 auto; }
  .brain-hero-sub { margin: 0 auto; }

  .agent-status-grid { grid-template-columns: 1fr; }

  .onboarding-main {
    grid-template-columns: 1fr;
  }

  .onboarding-preview { position: static; }

  .form-row { flex-direction: column; }
}

@media (max-width: 600px) {
  .onboarding-card { padding: 32px 24px; }
  .brain-hero { padding: 40px 20px 32px; }
  .dash-section { padding: 48px 20px; }
}
