/* MillOS Platform — Dark Theme (v2 — Linear/Vercel-clean) */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a24;
  --bg-deep: #08080d;
  --bg-card: #111118;
  --bg-card-hover: #1a1a28;
  --bg-elevated: #1c1c2a;
  --bg-input: #0d0d14;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  --accent-glow: rgba(99, 102, 241, 0.12);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  --muted: #64748b;
  --build: #a855f7;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
  --transition: 150ms ease;
  --sidebar-width: 260px;
}

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

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Sora', 'Manrope', sans-serif;
}

.accent { color: #6366f1; }
.accent-secondary { color: #818cf8; }

.screen { height: 100vh; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

::selection {
  background: var(--accent);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== LOGIN ========== */
#login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
}

.login-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-logo h1 {
  font-family: 'Sora', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-logo p {
  font-family: 'Manrope', sans-serif;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

#login-form {
  margin-top: 32px;
}

#login-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#login-form input::placeholder { color: var(--text-muted); }

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

#login-form button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

#login-form button:hover { background: var(--accent-hover); }
#login-form button:disabled { opacity: 0.4; cursor: not-allowed; }

.login-message {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 20px;
}

.login-message.error { color: var(--danger); }
.login-message.success { color: var(--success); }

/* ========== APP LAYOUT ========== */
#app-screen {
  display: flex;
  height: 100vh;
}

/* ========== SIDEBAR ========== */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.user-badge {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
  font-weight: 500;
}

/* TAB BAR */
.tab-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.08);
  border-left-color: var(--accent);
  color: var(--text-primary);
  font-weight: 600;
}

.tab-btn .tab-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.tab-btn .tab-icon svg {
  width: 16px;
  height: 16px;
}

/* SIDEBAR AGENT LIST */
#agent-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.agent-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.agent-btn:hover { background: rgba(255, 255, 255, 0.04); }

.agent-btn.active {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.agent-btn .agent-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  letter-spacing: -0.02em;
  color: var(--accent);
  flex-shrink: 0;
}

.agent-btn .agent-info { min-width: 0; }

.agent-btn .agent-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-btn .agent-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-btn.active .agent-desc { color: var(--text-secondary); }
.agent-btn.active .agent-icon { background: rgba(99, 102, 241, 0.2); color: var(--accent-hover); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.role-select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2364748b' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color var(--transition);
}

.role-select:focus { border-color: var(--accent); }

.role-banner {
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 11px;
  text-align: center;
  margin-bottom: 8px;
}

/* ========== MAIN CONTENT ========== */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
}

.tab-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tab-panel.active {
  display: flex;
}

/* ========== CHAT TAB ========== */
#chat-panel {
  flex-direction: column;
}

#chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

#chat-header h3 { font-size: 15px; font-weight: 700; }
#chat-header p { font-size: 11px; color: var(--text-muted); }

#chat-agent-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  font-size: 10px;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  color: var(--accent);
}

.btn-icon {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.btn-icon:hover { color: var(--text-primary); }

.btn-clear {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

.btn-clear:hover { color: var(--text-primary); }

/* MESSAGES */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
}

.welcome-message h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 600;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.msg.error {
  align-self: center;
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.15);
  font-size: 13px;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* INPUT */
#input-area {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

#message-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#message-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
#message-input:disabled { opacity: 0.4; }
#message-input::placeholder { color: var(--text-muted); }

#send-btn {
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#send-btn:hover { background: var(--accent-hover); }
#send-btn:disabled { opacity: 0.2; cursor: not-allowed; }

/* ========== IDEAS BOARD TAB ========== */
#ideas-panel.active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ideas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.ideas-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ideas-toolbar-left h2 {
  font-size: 18px;
  font-weight: 700;
}

.ideas-item-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.ideas-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ideas-tab-toggle {
  padding: 6px 14px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.ideas-tab-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.ideas-tab-toggle.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-secondary-ideas {
  padding: 6px 14px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary-ideas:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-add-idea {
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-idea:hover {
  background: var(--accent-hover);
}

.ideas-info-bar {
  text-align: center;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ideas-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.ideas-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-muted);
}

.ideas-empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.ideas-empty-state .empty-icon {
  color: var(--accent);
  opacity: 0.3;
  margin-bottom: 16px;
}

.ideas-empty-state h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Spinner */
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== SWIMLANE DOT ICONS ========== */
.swimlane-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-new { background: var(--muted); }
.dot-validated { background: #3b82f6; }
.dot-build { background: #a855f7; }
.dot-live { background: #22c55e; }
.dot-park { background: #fb923c; }
.dot-kill { background: #ef4444; }

/* ========== SWIMLANES ========== */
.swimlanes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.swimlane {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
}

.swimlane-validated { border-left-color: #3b82f6; }
.swimlane-build { border-left-color: #a855f7; }
.swimlane-live { border-left-color: #22c55e; }
.swimlane-park { border-left-color: #fb923c; }
.swimlane-kill { border-left-color: #ef4444; }

.swimlane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
}

.swimlane-toggle { cursor: pointer; }
.swimlane-toggle:hover { background: rgba(255, 255, 255, 0.03); }

.swimlane-icon { font-size: 1.1rem; display: none; }

.swimlane-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.swimlane-count {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
}

.swimlane-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  font-style: italic;
}

.swimlane-chevron {
  margin-left: auto;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.swimlane.collapsed .swimlane-chevron { transform: rotate(0deg); }
.swimlane:not(.collapsed) .swimlane-chevron { transform: rotate(90deg); }

.swimlane-list {
  padding: 6px 8px;
  min-height: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swimlane.collapsed .swimlane-list { display: none; }

.swimlane-list:empty::after {
  content: 'Przeciagnij karte tutaj';
  display: block;
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  opacity: 0.4;
}

/* Sortable drag */
.sortable-ghost { opacity: 0.3; }
.sortable-chosen { box-shadow: 0 0 0 2px var(--accent); }

/* ========== PIPELINE CARD (Ideas Board) ========== */
.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  overflow: hidden;
}

.pipeline-card:hover {
  border-color: var(--border-hover);
}

.pipeline-card.sortable-ghost {
  opacity: 0.3;
  border-color: var(--accent);
}

.pipeline-card.sortable-chosen {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--accent);
}

/* Hide priority outside validated */
.swimlane-live .card-priority,
.swimlane-build .card-priority,
.swimlane-park .card-priority,
.swimlane-kill .card-priority {
  display: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 36px;
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.drag-handle:active { cursor: grabbing; }
.pipeline-card:hover .drag-handle { opacity: 0.5; }
.pipeline-card:hover .drag-handle:hover { opacity: 1; }

.card-priority {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-oneliner {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mais-score {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 800;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.mais-score.score-high { color: var(--success); }
.mais-score.score-mid { color: var(--warning); }
.mais-score.score-low { color: var(--danger); }
.mais-score.score-zero { color: var(--text-muted); }

.card-expand {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.pipeline-card.expanded .card-expand {
  transform: rotate(180deg);
}

/* ========== STATUS BADGE ========== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 80px;
  cursor: pointer;
}

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

.badge-new { background: rgba(100, 116, 139, 0.1); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.15); }
.badge-new .badge-dot { background: #94a3b8; }

.badge-validated { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.15); }
.badge-validated .badge-dot { background: #3b82f6; }

.badge-build { background: rgba(168, 85, 247, 0.1); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.15); }
.badge-build .badge-dot { background: #a855f7; }

.badge-live { background: rgba(34, 197, 94, 0.1); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.15); }
.badge-live .badge-dot { background: #22c55e; }

.badge-park { background: rgba(245, 158, 11, 0.1); color: #fb923c; border: 1px solid rgba(245, 158, 11, 0.15); }
.badge-park .badge-dot { background: #fb923c; }

.badge-kill { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.15); }
.badge-kill .badge-dot { background: #ef4444; }

/* ========== EXPANDED CARD BODY ========== */
.card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.pipeline-card.expanded .card-body {
  display: block;
}

/* MAIS Breakdown */
.mais-breakdown {
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mais-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mais-label {
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.mais-label-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
}

.mais-label-desc {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
}

.mais-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}

.mais-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.mais-bar-fill.bar-ice { background: linear-gradient(90deg, #6366f1, #818cf8); }
.mais-bar-fill.bar-market { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.mais-bar-fill.bar-simplicity { background: linear-gradient(90deg, #22c55e, #4ade80); }
.mais-bar-fill.bar-automation { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mais-bar-fill.bar-moat { background: linear-gradient(90deg, #a855f7, #c084fc); }

.mais-value {
  width: 36px;
  text-align: right;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.mais-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.mais-total-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.mais-total-value {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

/* Details grid */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: border-color var(--transition);
}

.detail-item:hover { border-left-color: var(--accent); }

.detail-item.full-width { grid-column: 1 / -1; }

.detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
}

.detail-value {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.detail-value:empty::after {
  content: '\2014';
  color: var(--text-muted);
  opacity: 0.3;
}

/* Card actions */
.card-actions {
  display: flex;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ========== APPROVALS ========== */
.approvals-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.approvals-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.approvals-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
}

.approvals-ready { font-size: 11px; color: var(--success); font-weight: 600; }
.approvals-pending { font-size: 11px; color: var(--text-muted); }
.approvals-rejected { font-size: 11px; color: var(--danger); font-weight: 600; }

.approvals-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approval-person-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.approval-person-label {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 60px;
}

.approval-choices {
  display: flex;
  gap: 6px;
}

.approval-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text-muted);
}

.approval-choice:hover {
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.choice-ghost { opacity: 0.3; }
.choice-ghost:hover { opacity: 0.7; }

.choice-active-yes {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  opacity: 1;
}

.choice-active-neutral {
  border-color: var(--border-hover);
  background: var(--bg-deep);
  color: var(--text-secondary);
  opacity: 1;
}

.choice-active-no {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  opacity: 1;
}

/* Mini approval chips */
.approval-mini {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.approval-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
}

.chip-no {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.chip-yes {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.chip-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.chip-clickable {
  cursor: pointer;
  transition: transform var(--transition);
}

.chip-clickable:hover {
  transform: scale(1.15);
}

/* ========== NOTES ========== */
.notes-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.notes-header { margin-bottom: 10px; }

.notes-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
}

.note-group { margin-bottom: 10px; }
.note-group:last-child { margin-bottom: 0; }

.note-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.note-textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.note-textarea::placeholder { color: var(--text-muted); opacity: 0.5; }

.note-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.note-readonly {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  min-height: 36px;
}

.note-empty {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.4;
}

/* ========== STATUS DROPDOWN ========== */
.status-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-dropdown-option {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.status-dropdown-option:hover { background: rgba(255, 255, 255, 0.04); }
.status-dropdown-option.active { background: var(--accent-glow); }
.status-dropdown-option .badge { pointer-events: none; }

/* GM Badge */
.gm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.approval-locked { opacity: 0.4; }
.approval-locked .approval-choice { cursor: not-allowed; pointer-events: none; }

/* ========== QUEUE BANNER ========== */
.queue-banner { margin-bottom: 8px; }

.queue-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.queue-icon { font-size: 1rem; display: none; }

.queue-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.queue-items {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.queue-item:last-child { border-bottom: none; }

.queue-item-name {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.queue-item-liner {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== CIO BANNER ========== */
.cio-banner {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--text-muted);
}

.cio-banner-kill { background: rgba(239, 68, 68, 0.04); border-left-color: var(--danger); }
.cio-banner-park { background: rgba(245, 158, 11, 0.04); border-left-color: var(--warning); }
.cio-banner-validated { background: rgba(59, 130, 246, 0.04); border-left-color: var(--info); }

.cio-banner-label { font-weight: 700; color: var(--text-secondary); margin-right: 6px; }
.cio-banner-text { color: var(--text-primary); }

/* ========== VALIDATION ========== */
.validation-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.validation-header { margin-bottom: 10px; }

.validation-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
}

.validation-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.validation-row:last-child { border-bottom: none; }

.validation-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 130px;
  flex-shrink: 0;
}

.validation-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.val-go { color: var(--success); }
.val-nogo { color: var(--danger); }
.val-pending { color: var(--text-muted); }

.val-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

/* Validation mini chips */
.validation-mini {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 2px;
}

.validation-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
}

/* ========== MODALS ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.ideas-modal-wide { max-width: 720px; }
.ideas-modal-edit { max-width: 640px; }
.ideas-modal-small { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Modal tabs */
.modal-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.modal-tab {
  flex: 1;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-tab:hover { color: var(--text-secondary); }
.modal-tab.active { background: var(--accent); color: #fff; }

.htab-content { display: none; }
.htab-content.active { display: block; }

/* Legend table */
.legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.legend-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.legend-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.legend-table tr:last-child td { border-bottom: none; }

.legend-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Agent icon in help table */
.agent-icon-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  letter-spacing: -0.02em;
}

/* Agents table */
.agents-table td:first-child {
  text-align: center;
  width: 44px;
}

/* ========== PIPELINE HELP ========== */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.flow-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.flow-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.flow-content h4 {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}

.flow-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.flow-arrow {
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px 0;
  text-align: center;
  opacity: 0.3;
}

/* CIO section */
.cio-section h3 {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cio-section > p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.expert-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.expert-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.expert-name {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.expert-card p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cio-section h4 {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.filter-list {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

.filter-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.filter-list li:last-child { border-bottom: none; }

.scoring-thresholds {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.threshold {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.threshold-build { background: rgba(34, 197, 94, 0.1); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.2); }
.threshold-park { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.threshold-kill { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.ideas-modal-help { max-width: 920px; }

/* Pipeline legend chips */
.pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pipeline-legend .pl-sep {
  color: var(--text-muted);
  font-size: 11px;
  margin: 0 2px;
}

/* Pipeline chips */
.pl-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pl-integrated { background: rgba(34, 197, 94, 0.1); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.2); }
.pl-manual { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.pl-missing { background: rgba(100, 116, 139, 0.1); color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.15); }
.pl-auto { background: rgba(34, 197, 94, 0.06); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.12); }
.pl-human { background: rgba(245, 158, 11, 0.06); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.12); }
.pl-maciek { background: rgba(239, 68, 68, 0.06); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.12); }

.pipeline-scroll {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Pipeline table */
.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pipeline-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.pipeline-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}
.pipeline-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.pipeline-table tr:last-child td { border-bottom: none; }

.pipeline-phase td {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.04);
  padding: 8px 10px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.pipeline-gate td {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.03);
  padding: 5px 10px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.08);
}

.pipeline-checkpoint td {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.03);
  padding: 5px 10px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.08);
}

/* ========== IDEAS EDIT FORM ========== */
.form-group-ideas {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.form-group-ideas label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.form-group-ideas input,
.form-group-ideas select,
.form-group-ideas textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: max(16px, 13px);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group-ideas input:focus,
.form-group-ideas select:focus,
.form-group-ideas textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group-ideas input::placeholder,
.form-group-ideas textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.form-group-ideas select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2364748b' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group-ideas select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-group-ideas textarea {
  resize: vertical;
  min-height: 56px;
}

.form-row-ideas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-5-ideas {
  grid-template-columns: repeat(5, 1fr);
}

.form-group-wide-ideas { flex: 2; }

.form-section-title-ideas {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.form-actions-ideas {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.btn-ghost-ideas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-ghost-ideas:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-sm-ideas {
  padding: 4px 10px;
  min-height: 28px;
  font-size: 11px;
}

.btn-primary-ideas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary-ideas:hover {
  background: var(--accent-hover);
}

.btn-danger-ideas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger-ideas:hover { background: #dc2626; }

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.toast {
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease;
  max-width: 340px;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-info { border-left: 3px solid var(--accent); }

.toast.removing {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* ========== PIPELINE TAB ========== */
.pipeline-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.pipeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.pipeline-toolbar h2 {
  font-size: 18px;
  font-weight: 700;
}

/* Pipeline section titles */
.pipeline-section-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 16px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Pipeline queue */
.pipeline-queue { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.pipeline-queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.pq-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pq-info strong { font-size: 14px; }
.pq-mais { font-size: 11px; color: var(--accent); font-weight: 600; }
.pq-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-start-queue {
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
  transition: background var(--transition);
}

.btn-start-queue:hover { background: var(--accent-hover); }

.empty-state-sm { color: var(--text-muted); font-size: 12px; padding: 14px 0; text-align: center; }

/* Pipeline card (Pipeline tab) */
.pipeline-card-pl {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.pipeline-card-pl.completed { border-left-color: var(--success); }
.pipeline-card-pl.killed { border-left-color: var(--danger); }
.pipeline-card-pl.blocked { border-left-color: var(--warning); }
.pipeline-card-pl.running { border-left-color: var(--accent); animation: pulse-border 2s infinite; }

@keyframes pulse-border {
  0%, 100% { border-left-color: var(--accent); }
  50% { border-left-color: #764ba2; }
}

.pipeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pipeline-card-header h3 { font-size: 15px; }

.status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.running { background: rgba(102, 126, 234, 0.15); color: #667eea; }
.status-badge.completed { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-badge.killed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-badge.blocked { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-badge.awaiting_human { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* Phase progress */
.phase-bar { display: flex; gap: 3px; margin-bottom: 6px; }

.phase-dot { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); transition: background var(--transition); }
.phase-dot.done { background: var(--success); }
.phase-dot.active { background: var(--accent); animation: pulse-bg 1.5s infinite; }
.phase-dot.blocked { background: var(--warning); }

@keyframes pulse-bg {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.phase-labels { display: flex; gap: 3px; margin-bottom: 10px; }
.phase-label { flex: 1; font-size: 9px; color: var(--text-muted); text-align: center; }

/* Pipeline log */
.log-entry-detail { border-top: 1px solid var(--border); }
.log-entry-detail:first-child { border-top: none; }

.log-entry {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}

.log-entry::-webkit-details-marker { display: none; }
.log-entry:hover { background: rgba(99, 102, 241, 0.03); }

.log-phase { color: var(--accent); font-weight: 600; min-width: 20px; }
.log-agent { color: var(--text-secondary); min-width: 80px; }
.log-action { color: var(--text-primary); min-width: 100px; font-weight: 500; }
.log-summary { color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-time { color: var(--text-muted); font-size: 10px; }

/* Approval box */
.approval-box {
  margin-top: 12px;
  padding: 14px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius);
}

.approval-box h4 { color: var(--accent); margin-bottom: 6px; font-size: 14px; }
.approval-box p { color: var(--text-secondary); font-size: 13px; margin-bottom: 10px; white-space: pre-wrap; }

.approval-box textarea {
  width: 100%;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  resize: none;
  margin-bottom: 10px;
  outline: none;
  transition: border-color var(--transition);
}

.approval-box textarea:focus { border-color: var(--accent); }

.approval-actions { display: flex; gap: 8px; }

.btn-approve {
  padding: 6px 16px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-reject {
  padding: 6px 16px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-approve:hover, .btn-reject:hover { opacity: 0.85; }

/* Review items */
.review-items { margin-bottom: 14px; }

.review-item {
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.review-item summary {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}

.review-item summary:hover { background: rgba(255, 255, 255, 0.04); }
.review-agent { color: var(--accent); margin-right: 8px; }

.review-content {
  padding: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Deep Research */
.dr-section {
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius);
}

.dr-section h5 { color: var(--warning); margin-bottom: 6px; font-size: 13px; }
.dr-instructions { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.dr-prompt { margin-bottom: 8px; }
.dr-prompt label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 3px; }

.dr-prompt-text {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-primary);
  user-select: all;
  cursor: text;
}

.dr-section textarea {
  width: 100%;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
  resize: vertical;
  outline: none;
  margin-top: 6px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 13px;
}

/* Start form (legacy) */
.start-form {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.start-form h3 { margin-bottom: 10px; font-size: 14px; }

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.form-row input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

.form-row input:focus { border-color: var(--accent); }

.form-row textarea {
  flex: 2;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  outline: none;
  resize: none;
}

.btn-start {
  padding: 8px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-start:hover { background: var(--accent-hover); }
.btn-start:disabled { opacity: 0.3; cursor: not-allowed; }

/* ========== SETTINGS TAB ========== */
.settings-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-width: 800px;
}

.settings-toolbar {
  flex-shrink: 0;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.settings-toolbar h2 {
  font-size: 18px;
  font-weight: 700;
}

.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

/* User table */
.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.user-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.user-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.user-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.user-table tr:last-child td { border-bottom: none; }

.role-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-tag.owner { background: rgba(99, 102, 241, 0.12); color: var(--accent); }
.role-tag.partner { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.role-tag.gm { background: rgba(34, 197, 94, 0.12); color: var(--success); }

/* Add GM form — modern card layout */
.settings-add-card {
  border: 1px dashed rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.02);
}

.add-user-form-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-field input {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

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

.form-field-full {
  grid-column: 1 / -1;
}

/* Company pill tags */
.company-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.company-pill {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.company-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.company-pill.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.company-empty-msg {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Add GM button */
.btn-add-gm {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-add-gm:hover { background: var(--accent-hover); }

/* Legacy add-user-form (hidden, selectors still in JS) */
.add-user-form {
  display: none;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 100;
    width: 280px;
    transition: left 0.3s;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  #sidebar.open { left: 0; }
  .btn-icon { display: flex; }

  .msg { max-width: 95%; }
  .login-box { margin: 20px; padding: 32px 24px; }

  .form-row { flex-direction: column; }
  .add-user-form-modern { grid-template-columns: 1fr; }

  .modal { max-height: 95vh; margin: 10px; border-radius: var(--radius-lg); }

  .ideas-toolbar {
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
  }

  .ideas-toolbar-left { width: 100%; }
  .ideas-toolbar-right { width: 100%; justify-content: flex-end; }

  .card-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .card-oneliner { display: none; }
  .card-meta { gap: 6px; }
  .mais-score { font-size: 13px; }
  .card-body { padding: 0 12px 14px; }
  .details-grid { grid-template-columns: 1fr; }

  .form-row-ideas { grid-template-columns: 1fr; }
  .form-row-5-ideas { grid-template-columns: repeat(3, 1fr); }
  .expert-cards { grid-template-columns: 1fr; }
  .scoring-thresholds { flex-direction: column; }
  .flow-step { padding: 10px; }
  .ideas-modal-help { max-width: 100%; }
  .pipeline-table { font-size: 11px; }
  .pipeline-table th, .pipeline-table td { padding: 4px 6px; }
  .pipeline-legend { gap: 4px; padding: 6px 8px; }

  .toast-container { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: 100%; }
}

@media (max-width: 420px) {
  .ideas-item-count { display: none; }
  .form-row-5-ideas { grid-template-columns: repeat(2, 1fr); }
  .modal-tabs { flex-direction: column; }
}
