/* AI Power Board — dark executive theme */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0:#070b18; --bg-1:#0c1224; --bg-2:#121a33; --bg-3:#1a2444;
  --line:#1f2b52; --line-2:#2a3869;
  --text:#e6edf3; --text-2:#8b98b8; --text-3:#586182;
  --accent:#7c4dff; --accent-2:#5b8def;
  --gold:#f5c542; --green:#3ddc97; --amber:#ffb74d;
  --red:#ef5350; --cyan:#4fc3f7; --violet:#ba68c8;
  --radius:14px;
}

html, body {
  background: radial-gradient(circle at 20% 0%, #131c3d 0%, #070b18 60%);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════ TOP BAR ═══════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7,11,24,0.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #7c4dff, #4fc3f7);
  display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 0 24px rgba(124,77,255,0.5);
}
.brand-name {
  font-size: 16px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(90deg, #fff, #7c4dff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { color: var(--text-2); font-size: 11px; letter-spacing: 0.5px; }
.topbar-right {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-2); font-size: 12px; letter-spacing: 1px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 10px currentColor;
  transition: background .3s;
}
.status-dot.live { background: var(--green); animation: pulse 1.4s infinite; }
.status-dot.busy { background: var(--amber); animation: pulse 1s infinite; }

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

/* ═══════════ LAYOUT ═══════════ */
.layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 20px;
  padding: 20px; min-height: calc(100vh - 70px);
}

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

/* ═══════════ LEFT PANEL ═══════════ */
.panel-left {
  display: flex; flex-direction: column; gap: 16px;
  background: linear-gradient(180deg, #0c1224, #0a0f1e);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.section { display: flex; flex-direction: column; gap: 8px; }
.section-label {
  font-size: 10px; letter-spacing: 2px; color: var(--text-3);
  font-weight: 600;
}
.spacer { flex: 1; }

/* File drop */
.file-drop {
  border: 1.5px dashed var(--line-2); border-radius: 12px;
  background: #0a0f1e; transition: all .25s; cursor: pointer;
  position: relative; min-height: 130px;
}
.file-drop:hover { border-color: var(--accent); background: #0d1428; }
.file-drop.dragging {
  border-color: var(--accent); background: #131c3d;
  box-shadow: 0 0 20px rgba(124,77,255,0.4) inset;
}
.file-drop-inner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px 16px; gap: 6px; text-align: center;
}
.drop-icon { font-size: 28px; opacity: 0.8; }
.drop-title { font-weight: 600; font-size: 13px; }
.drop-sub { color: var(--text-3); font-size: 11px; }
.file-info {
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
}
.file-info-name { font-weight: 600; font-size: 13px; }
.file-info-meta { color: var(--text-2); font-size: 11px; }
.btn-clear {
  align-self: flex-start; margin-top: 6px;
  background: #1a2444; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 6px;
  padding: 4px 10px; font-size: 11px; cursor: pointer;
}
.btn-clear:hover { color: var(--red); border-color: var(--red); }

/* Task input */
.task-wrap { position: relative; }
#taskInput, #feedbackInput {
  width: 100%; min-height: 120px; resize: vertical;
  background: #0a0f1e; border: 1px solid var(--line);
  border-radius: 10px; color: var(--text);
  padding: 12px 44px 12px 12px; font-family: inherit; font-size: 13px;
  transition: border-color .2s;
}
#taskInput:focus, #feedbackInput:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,0.15);
}
.mic-btn {
  position: absolute; right: 8px; bottom: 8px;
  width: 32px; height: 32px; border-radius: 8px;
  background: #1a2444; color: var(--text-2);
  border: 1px solid var(--line-2); cursor: pointer;
  font-size: 14px; display: grid; place-items: center;
  transition: all .2s;
}
.mic-btn:hover { background: #232f57; color: var(--text); }
.mic-btn.recording {
  background: #7a1e2b; color: #fff; border-color: #7a1e2b;
  animation: pulse 1s infinite;
}
.mic-btn.processing {
  background: #3b2f13; color: var(--amber); border-color: var(--amber);
}

/* Select */
.select {
  background: #0a0f1e; border: 1px solid var(--line);
  border-radius: 10px; color: var(--text);
  padding: 10px 12px; font-size: 13px; cursor: pointer;
}
.select:focus { outline: none; border-color: var(--accent); }

/* Stats */
.stats-line {
  color: var(--text-3); font-size: 11px; text-align: center;
  letter-spacing: 1px;
}

/* Convene button */
.btn-convene {
  padding: 16px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #7c4dff, #4fc3f7);
  color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: 2px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .2s;
  box-shadow: 0 6px 24px rgba(124,77,255,0.35);
}
.btn-convene:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(124,77,255,0.5);
}
.btn-convene:disabled { opacity: .5; cursor: not-allowed; }
.btn-convene-icon { font-size: 16px; }

/* ═══════════ RIGHT PANEL ═══════════ */
.panel-right {
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}

/* Boardroom */
.boardroom {
  background: linear-gradient(180deg, #0c1224, #0a0f1e);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.boardroom-head { display: flex; flex-direction: column; gap: 2px; }
.boardroom-title {
  font-size: 12px; font-weight: 800; letter-spacing: 4px;
  color: var(--text);
}
.boardroom-sub { color: var(--text-3); font-size: 11px; }

/* Agents grid */
.agents-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 900px) {
  .agents-grid { grid-template-columns: repeat(2, 1fr); }
}

.agent-card {
  background: linear-gradient(180deg, #101833, #0a1020);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  min-height: 220px; transition: all .3s; position: relative;
  overflow: hidden;
}
.agent-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 12px; padding: 1px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--agent-color, #4FC3F7) 60%, transparent), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.agent-card[data-agent="analyst"]   { --agent-color: #4FC3F7; }
.agent-card[data-agent="engineer"]  { --agent-color: #81C784; }
.agent-card[data-agent="developer"] { --agent-color: #FFB74D; }
.agent-card[data-agent="qa"]        { --agent-color: #BA68C8; }

.agent-card.active::before { opacity: 1; }
.agent-card.active {
  box-shadow: 0 0 24px color-mix(in srgb,
    var(--agent-color) 25%, transparent);
}
.agent-card.done { border-color: color-mix(in srgb,
    var(--agent-color) 50%, var(--line)); }

.agent-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 20%, #0a1020);
  display: grid; place-items: center; font-size: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.agent-meta { display: flex; flex-direction: column; gap: 1px; }
.agent-name {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: color-mix(in srgb, var(--agent-color) 90%, #fff);
}
.agent-role { font-size: 10px; color: var(--text-3); letter-spacing: .5px; }
.agent-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--text-2);
}
.agent-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3); transition: all .3s;
}
.agent-card.active .agent-status .dot {
  background: var(--amber); animation: pulse 1s infinite;
}
.agent-card.done .agent-status .dot { background: var(--green); }
.agent-body {
  flex: 1; font-size: 11.5px; line-height: 1.5;
  color: var(--text-2); overflow-y: auto; padding-right: 4px;
  white-space: pre-wrap;
}
.agent-body::-webkit-scrollbar { width: 4px; }
.agent-body::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 2px;
}

/* Astra6 */
.astra-card {
  position: relative; margin-top: 6px;
  background: linear-gradient(135deg, #1a1024, #0f0a24);
  border: 1px solid #3a2552; border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: all .3s; overflow: hidden;
}
.astra-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(245,197,66,0.25);
}
.astra-card.done {
  border-color: var(--gold);
  background: linear-gradient(135deg, #1f1530, #120b28);
}
.astra-glow {
  position: absolute; top: -60%; left: -10%;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,197,66,0.15), transparent 70%);
  pointer-events: none; opacity: 0; transition: opacity .4s;
}
.astra-card.active .astra-glow { opacity: 1; }

.astra-head {
  display: flex; align-items: center; gap: 12px;
}
.astra-avatar {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #f5c542, #b8860b);
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 0 20px rgba(245,197,66,0.4);
}
.astra-name {
  font-size: 14px; font-weight: 800; letter-spacing: 3px;
  background: linear-gradient(90deg, #f5c542, #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.astra-role {
  font-size: 10px; color: var(--text-3); letter-spacing: 1.5px;
  margin-top: 1px;
}
.astra-status {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--text-2); letter-spacing: 1px;
}
.astra-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); animation: pulse 1.4s infinite;
  box-shadow: 0 0 8px var(--gold);
}
.astra-body {
  font-size: 12.5px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap;
  max-height: 260px; overflow-y: auto;
}
.astra-body::-webkit-scrollbar { width: 4px; }
.astra-body::-webkit-scrollbar-thumb {
  background: #4a3560; border-radius: 2px;
}

/* Console */
.console-box {
  flex: 1; min-height: 200px; display: flex; flex-direction: column;
  background: #05060d; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.console-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: 3px; color: var(--text-3);
  background: #0a0f1e;
}
.console-copy {
  background: transparent; border: 1px solid var(--line-2);
  color: var(--text-3); font-size: 10px; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 6px; cursor: pointer;
}
.console-copy:hover { color: var(--text); border-color: var(--accent); }
.console-body {
  flex: 1; padding: 12px 16px; overflow-y: auto;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 11.5px; line-height: 1.65; color: #7ee787;
  white-space: pre-wrap;
}
.console-body::-webkit-scrollbar { width: 6px; }
.console-body::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 3px;
}
.console-body .line-warn { color: var(--amber); }
.console-body .line-err  { color: var(--red); }
.console-body .line-info { color: var(--cyan); }

/* ═══════════ MODALS ═══════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3,5,12,0.85); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
.modal {
  background: linear-gradient(180deg, #0c1224, #0a0f1e);
  border: 1px solid var(--line-2); border-radius: 16px;
  max-width: 720px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  animation: slideUp .3s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-head { padding: 22px 24px 12px; }
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.modal-sub { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.modal-body { padding: 8px 24px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #7c4dff, #5b8def);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 20px; font-weight: 600; font-size: 13px;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: all .2s;
}
.btn-primary:hover { transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,77,255,0.4); }
.btn-secondary {
  background: #1a2444; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 20px; font-size: 13px; cursor: pointer;
}
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }
.btn-success {
  background: linear-gradient(135deg, #0e7c4a, #3ddc97);
  color: #fff; border: none; border-radius: 10px;
  padding: 12px 22px; font-weight: 600; cursor: pointer; font-size: 13px;
}
.btn-warn {
  background: linear-gradient(135deg, #8a4a00, #ffb74d);
  color: #fff; border: none; border-radius: 10px;
  padding: 12px 22px; font-weight: 600; cursor: pointer; font-size: 13px;
}

/* Ambiguity item */
.amb-item {
  background: #0a1020; border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.amb-q { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.amb-ctx { color: var(--text-2); font-size: 11.5px; margin-bottom: 12px; line-height: 1.5; }
.amb-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: #0f1530; border: 1px solid var(--line-2);
  border-radius: 8px; cursor: pointer; font-size: 12.5px;
  transition: all .15s;
}
.amb-opt:hover { background: #151c3d; border-color: var(--accent); }
.amb-opt input { accent-color: var(--accent); }
.amb-other {
  width: 100%; margin-top: 8px;
  background: #0a1020; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; color: var(--text);
  font-size: 12.5px; font-family: inherit;
}

/* Review modal */
.review-buttons { margin-bottom: 20px; text-align: center; }
.review-buttons .btn-primary { padding: 14px 28px; font-size: 14px; }
.review-ask {
  text-align: center; color: var(--text-2); font-size: 12px;
  letter-spacing: 1px; margin-bottom: 12px;
}
.review-options {
  display: flex; gap: 10px; justify-content: center; margin-bottom: 16px;
}
.feedback-wrap { display: flex; flex-direction: column; gap: 10px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.feedback-actions {
  display: flex; justify-content: flex-end; gap: 10px; align-items: center;
}
.feedback-actions .mic-btn { position: static; }

.hidden { display: none !important; }