@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  /* Colors - Slate & Indigo Palette */
  --bg: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.75);
  --text: #f9fafb;
  --text-muted: #9ca3af;

  /* Accents */
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-alpha: rgba(99, 102, 241, 0.15);

  /* Status Colors */
  --border: #374151;
  --border-light: rgba(255, 255, 255, 0.05);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Chat Bubbles */
  --bubble-user: linear-gradient(135deg, #6366f1, #4f46e5);
  --bubble-agent: #1e293b;

  /* Layout */
  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

[hidden] {
  display: none !important;
}

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

/* Login */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(circle at center, var(--bg-tertiary) 0%, var(--bg) 100%);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  width: 400px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.login-card h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.login-card input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-alpha);
}

.login-card button {
  width: 100%;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.login-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.5);
}

.login-card button:active {
  transform: translateY(0);
}

.error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Dashboard layout */
.dashboard {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--text);
  background: var(--accent-alpha);
  box-shadow: inset 3px 0 0 0 var(--accent);
}

.nav-accordion {
  list-style: none;
}

.nav-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-accordion-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.accordion-arrow {
  transition: transform 0.2s ease;
  font-size: 0.85rem;
}

.nav-accordion.open .accordion-arrow {
  transform: rotate(90deg);
}

.nav-accordion-items {
  list-style: none;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.nav-accordion.open .nav-accordion-items {
  max-height: 200px;
}

.nav-accordion-items .nav-link {
  padding-left: 1.75rem;
  font-size: 0.9rem;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.status-dot.connected {
  background: var(--success);
  color: var(--success);
}

.status-dot.disconnected {
  background: var(--error);
  color: var(--error);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 2.5rem;
  overflow: auto;
  background: var(--bg);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0;
  flex-shrink: 0;
}

.chat-header select {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-header select:hover {
  border-color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.msg {
  max-width: 75%;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.msg.agent {
  background: var(--bubble-agent);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.msg .sender {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.msg .time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-align: right;
}

.typing-indicator {
  padding: 0.5rem 1rem;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator .dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-input {
  display: flex;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.chat-input textarea {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.chat-input textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-alpha);
}

.chat-input button {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.chat-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.5);
}

.chat-input button:active {
  transform: translateY(0);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-tertiary);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

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

/* Logs */
.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.btn-small {
  padding: 0.4rem 0.875rem;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-small:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.btn-small:active {
  transform: translateY(0);
}

.btn-primary {
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.log-viewer {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Running Prompts */
.running-prompts-section {
  margin-bottom: 1.5rem;
}

.running-prompts-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.running-prompts-container {
  display: grid;
  gap: 0.75rem;
}

.running-prompt-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem;
  transition: border-color 0.2s;
}

.running-prompt-card:hover {
  border-color: var(--accent);
}

.running-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

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

.running-prompt-group {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.running-prompt-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.running-prompt-status {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-waiting {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

.status-processing {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  animation: pulse 2s ease-in-out infinite;
}

.status-completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

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

.running-prompt-preview {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.running-prompt-tokens {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.running-prompt-error {
  font-size: 0.75rem;
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 4px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Task form */
.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-grid label,
.page label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-grid select,
.form-grid input,
.page textarea {
  padding: 0.65rem 0.875rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.form-grid select:focus,
.form-grid input:focus,
.page textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-alpha);
}

.page textarea {
  width: 100%;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-primary {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}

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

.btn-danger {
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-action {
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-action:hover {
  background: rgba(99, 102, 241, 0.1);
}

.action-btns {
  display: flex;
  gap: 0.3rem;
}

/* Settings */
.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.settings-card p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.env-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.env-key-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 160px;
}

.env-key-label span {
  font-size: 0.9rem;
}

.env-key-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: none;
  padding: 0;
}

.env-key-input-wrap {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  max-width: 420px;
}

.env-key-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: monospace;
}

.env-key-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Skills & Tools */
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.skill-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.skill-card-header h4 {
  font-size: 0.95rem;
  flex: 1;
}

.skill-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.skill-badge.integration {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

.skill-badge.web-skill {
  background: rgba(16, 185, 129, 0.15);
  /* Emerald with opacity */
  color: #10b981;
  /* Emerald 500 */
}

.skill-badge.skill {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.skill-badge.container {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.skill-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.skill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.skill-meta-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Prompt Library styles */
.prompt-card {
  display: flex;
  flex-direction: column;
}

.prompt-preview {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.prompt-preview::-webkit-scrollbar {
  width: 6px;
}

.prompt-preview::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.prompt-actions {
  margin-top: auto;
}

.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--accent-alpha);
  color: var(--accent);
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.page-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.page-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-alpha);
}

/* Automation Page */
.automation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.automation-header .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.automation-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.automation-status.running {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.automation-status.paused {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.automation-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

.automation-status.paused .status-dot {
  animation: none;
}

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

.goals-display {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.goals-display h1, .goals-display h2, .goals-display h3 {
  color: var(--text);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.goals-display ul, .goals-display ol {
  margin-left: 1.5rem;
}

.automation-controls {
  display: flex;
  gap: 0.5rem;
}

.automation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.automation-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.automation-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.automation-tab:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.automation-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  min-height: 500px;
}

.kanban-column {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.kanban-column-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.kanban-count {
  background: var(--accent-alpha);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.kanban-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100px;
}

.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  cursor: grab;
  transition: all 0.2s;
}

.kanban-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(5deg);
}

.kanban-cards.drag-over {
  background: var(--accent-alpha);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.kanban-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.kanban-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 500;
}

.kanban-badge.priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.kanban-badge.priority-medium {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.kanban-badge.priority-low {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.kanban-badge.domain {
  background: var(--accent-alpha);
  color: var(--accent);
}

.personas-list {
  display: grid;
  gap: 1rem;
}

.persona-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.persona-card h5 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
}

.persona-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.persona-skill {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg-tertiary);
  border-radius: 3px;
  color: var(--text-secondary);
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .automation-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.tool-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.02);
}

.tool-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--accent);
  min-width: 120px;
}

.tool-category {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
}

.tool-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  flex: 1;
}

/* ========================================
   ENHANCEMENTS: Markdown, Search, Textarea
   ======================================== */

/* Markdown content styling */
.msg .content h1,
.msg .content h2,
.msg .content h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}

.msg .content h1 {
  font-size: 1.3rem;
}

.msg .content h2 {
  font-size: 1.1rem;
}

.msg .content h3 {
  font-size: 1rem;
}

.msg .content p {
  margin: 0.3rem 0;
}

.msg .content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.85em;
}

.msg .content pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.msg .content pre code {
  background: none;
  padding: 0;
}

.msg .content ul,
.msg .content ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.msg .content li {
  margin: 0.2rem 0;
}

.msg .content a {
  color: var(--accent-hover);
  text-decoration: underline;
}

.msg .content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 0.75rem;
  margin: 0.5rem 0;
  color: var(--text-muted);
}

/* Search bar */
.chat-search-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-search-bar input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.chat-search-bar input:focus {
  border-color: var(--accent);
}

.chat-search-bar button {
  padding: 0.4rem 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  min-width: 30px;
}

.chat-search-bar button:hover {
  background: var(--bg);
  color: var(--text);
}

.chat-search-bar select {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  outline: none;
}

.msg.search-match {
  border-left: 3px solid var(--accent);
}

.msg.search-hidden {
  display: none !important;
}

/* Textarea chat input */
.chat-input textarea {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.4;
  overflow-y: auto;
}

.chat-input textarea:focus {
  border-color: var(--accent);
}

/* Section headers */
.section-header {
  margin-bottom: 1rem;
}

.section-header h3 {
  margin-bottom: 0.25rem;
}

/* Runner buttons */
.btn-run {
  padding: 0.35rem 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  margin-left: auto;
}

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

.btn-run:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.skill-card .btn-run {
  margin-top: 0.5rem;
  width: 100%;
}

/* Tool runner modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h4 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-body textarea,
.modal-body input {
  width: 100%;
  padding: 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-family: inherit;
}

.modal-body textarea {
  resize: vertical;
  min-height: 100px;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Files Page */
.files-group-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.files-tab-btn {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.files-tab-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

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

.files-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.files-upload-folders,
.files-folders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.files-folder-card {
  background: var(--bg-secondary);
  padding: 1rem;
}

.files-folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.files-folder-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

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

.file-list li:hover {
  background: rgba(255, 255, 255, 0.05);
}

.file-name {
  cursor: pointer;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.file-name:hover {
  color: var(--primary);
  text-decoration: underline;
}

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-date {
  font-size: 0.85rem;
  min-width: 80px;
  text-align: right;
}

.files-show-more-btn,
.files-show-less-btn {
  margin-top: 0.5rem;
  width: 100%;
}

.files-draggable-item {
  cursor: move;
}

/* File Tree Structure */
.file-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-tree-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  transition: background 0.2s;
}

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

.file-tree-folder {
  list-style: none;
}

.file-tree-file {
  list-style: none;
}

.file-tree-children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.folder-toggle {
  display: inline-block;
  width: 16px;
  cursor: pointer;
  user-select: none;
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.folder-name {
  font-weight: 500;
  cursor: default;
}

/* File Upload */
.file-upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.02);
}

.file-upload-drop-zone:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.file-upload-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* File Preview Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: auto;
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.file-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.file-preview-header h4 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-preview-header-actions {
  display: flex;
  gap: 0.5rem;
}

#file-preview-body {
  padding: 1rem;
  max-height: calc(90vh - 100px);
  overflow: auto;
}

.file-preview-mode {
  display: none;
}

#file-preview-text {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

#file-preview-markdown {
  line-height: 1.6;
}

#file-preview-image img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* File Edit Modal */
.upload-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.upload-edit-header h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#file-edit-textarea {
  width: 100%;
  min-height: 500px;
  padding: 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.upload-edit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.page-search {
  margin-bottom: 1rem;
}

.page-search input {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
}

/* Task messages in chat */
.msg.task-msg {
  align-self: center;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  max-width: 90%;
  padding: 0.4rem 0.75rem;
  margin: 0.25rem auto;
}

.msg.task-msg .sender {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.msg.task-msg .content {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Runner badge in tasks table */
.runner-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.runner-badge.runner-claude {
  color: #f59e0b;
  border-color: #f59e0b44;
}

.runner-badge.runner-openai {
  color: #10b981;
  border-color: #10b98144;
}

.runner-badge.runner-gemini {
  color: #6366f1;
  border-color: #6366f144;
}

.runner-badge.runner-deepseek {
  color: #3b82f6;
  border-color: #3b82f644;
}

.runner-badge.runner-groq {
  color: #f97316;
  border-color: #f9731644;
}

.runner-badge.runner-mistral {
  color: #ec4899;
  border-color: #ec489944;
}

/* ========================================
   MOBILE RESPONSIVENESS (max-width: 768px)
   ======================================== */

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: var(--bg-tertiary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
  }

  .sidebar-overlay[hidden] {
    display: none !important;
  }

  .page {
    padding: 1rem;
  }

  .chat-header {
    padding: 0 0 1rem 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    padding: 1rem;
  }

  .chat-input textarea {
    padding: 0.5rem 0.75rem;
  }

  /* Mobile Data Tables (Card View) */
  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding: 0.6rem 0.25rem;
    text-align: right;
  }

  .data-table td[data-label="Actions"] {
    justify-content: flex-end;
  }

  .data-table td[data-label="Actions"]::before {
    display: none;
  }

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

  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    margin-right: 1rem;
  }
}

.runner-badge.runner-together {
  color: #a78bfa;
  border-color: #a78bfa44;
}

.runner-badge.runner-ollama {
  color: #14b8a6;
  border-color: #14b8a644;
}

.runner-badge.runner-cursor {
  color: #c084fc;
  border-color: #c084fc44;
}

.running-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Responsive */
/* ========================================
   PROJECTS PAGE
   ======================================== */

.projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
}

.project-card[data-status="running"] {
  border-left: 3px solid var(--success);
}

.project-card[data-status="error"] {
  border-left: 3px solid var(--error);
}

.project-card[data-status="building"] {
  border-left: 3px solid #eab308;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-card-header h4 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.project-id-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.project-card-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* Stack badges */
.stack-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stack-badge.stack-react {
  background: rgba(97, 218, 251, 0.15);
  color: #61dafb;
}

.stack-badge.stack-python {
  background: rgba(255, 212, 59, 0.15);
  color: #ffd43b;
}

.stack-badge.stack-node {
  background: rgba(104, 159, 56, 0.15);
  color: #689f38;
}

.stack-badge.stack-go {
  background: rgba(0, 173, 216, 0.15);
  color: #00add8;
}

.stack-badge.stack-custom {
  background: rgba(139, 143, 163, 0.15);
  color: var(--text-muted);
}

/* Project status indicators */
.project-status {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-status.status-running {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  animation: runningPulse 2s ease-in-out infinite;
}

.project-status.status-building {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  animation: buildingPulse 1s ease-in-out infinite;
}

.project-status.status-stopped {
  background: rgba(139, 143, 163, 0.15);
  color: var(--text-muted);
}

.project-status.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

@keyframes runningPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes buildingPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.project-error {
  font-size: 0.78rem;
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  word-break: break-word;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.project-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.project-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.project-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* --- MCP Permissions --- */

.mcp-permission-card {
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mcp-permission-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mcp-permission-card input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mcp-permission-card input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mcp-permission-card label {
  margin: 0;
  width: 100%;
}

#mcp-permissions-grid h5 {
  color: var(--text);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

#mcp-group-selector {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

#mcp-group-selector:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#mcp-unrestricted-toggle {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

