/* ============================================================
   Seven Dwarfs Web App — Design System
   ============================================================ */

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

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  /* Colors */
  --bg-base:       #080810;
  --bg-surface:    #0f0f1a;
  --bg-elevated:   #14141f;
  --bg-overlay:    rgba(255,255,255,0.03);
  --bg-hover:      rgba(255,255,255,0.06);

  --accent-violet: #7c3aed;
  --accent-violet-dim: rgba(124,58,237,0.15);
  --accent-violet-border: rgba(124,58,237,0.35);
  --accent-cyan:   #06b6d4;
  --accent-cyan-dim: rgba(6,182,212,0.12);
  --accent-green:  #10b981;
  --accent-orange: #f59e0b;
  --accent-red:    #ef4444;

  --text-primary:  #f0f0ff;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;
  --text-accent:   #a78bfa;

  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(124,58,237,0.4);
  --glass-bg:      rgba(15,15,26,0.8);
  --glass-border:  rgba(255,255,255,0.08);

  /* Spacing */
  --sidebar-w: 260px;
  --notes-w:   280px;
  --navbar-h:  56px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Ambient background orbs ────────────────────────────── */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
  animation: orb-drift 18s ease-in-out infinite alternate;
}
body::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: -150px; left: -100px;
}
body::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.09) 0%, transparent 70%);
  bottom: -100px; right: -80px;
  animation-delay: -9s;
}
@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, 20px) scale(1.05); }
  100% { transform: translate(-20px, 40px) scale(0.95); }
}

#navbar, #sidebar, #chat-panel, #notes-panel, #page-container,
.modal-overlay, #login-overlay { position: relative; z-index: 1; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

a { color: var(--accent-cyan); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 12px; font-size: 14px; outline: none; transition: border-color var(--t-fast); }
input:focus, textarea:focus, select:focus { border-color: var(--accent-violet); }

/* ── Layout ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Navbar ─────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: rgba(8,8,16,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(124,58,237,0.2);
  box-shadow: 0 1px 0 rgba(124,58,237,0.08), 0 8px 32px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  margin-right: auto;
}

.nav-logo .logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(124,58,237,0.4);
  animation: logo-glow 3s ease-in-out infinite alternate;
}
@keyframes logo-glow {
  from { box-shadow: 0 0 8px rgba(124,58,237,0.3); }
  to   { box-shadow: 0 0 18px rgba(124,58,237,0.6), 0 0 32px rgba(6,182,212,0.2); }
}

.nav-btn {
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--t-fast);
  display: flex; align-items: center; gap: 6px;
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active { background: var(--accent-violet-dim); color: var(--text-accent); border: 1px solid var(--accent-violet-border); }
.nav-btn svg { width: 15px; height: 15px; }

/* ── Main wrapper ────────────────────────────────────────── */
#main {
  display: flex;
  width: 100%;
  margin-top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-new-topic {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-accent);
  background: var(--accent-violet-dim);
  border: 1px solid var(--accent-violet-border);
  transition: all var(--t-fast);
  width: 100%;
  justify-content: center;
}
.btn-new-topic:hover { background: rgba(124,58,237,0.25); }
.btn-new-topic svg { width: 14px; height: 14px; }

#topic-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.topic-item:hover { background: var(--bg-hover); }
.topic-item.active { background: var(--accent-violet-dim); }
.topic-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent-violet);
  border-radius: 0 3px 3px 0;
}

.topic-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.topic-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}
.topic-item.active .topic-name { color: var(--text-primary); }

.topic-delete {
  opacity: 0;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all var(--t-fast);
  font-size: 12px;
}
.topic-item:hover .topic-delete { opacity: 1; }
.topic-delete:hover { color: var(--accent-red); background: rgba(239,68,68,0.1); }

/* ── Chat panel ─────────────────────────────────────────── */
#chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

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

.chat-topic-name {
  font-size: 15px;
  font-weight: 600;
}

.chat-topic-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-violet-dim);
  color: var(--text-accent);
  border: 1px solid var(--accent-violet-border);
}

.chat-toggle-notes {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-muted);
  transition: all var(--t-fast);
  display: flex; align-items: center; gap: 5px;
}
.chat-toggle-notes:hover { background: var(--bg-hover); color: var(--text-primary); }

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Empty state */
.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0.5;
  text-align: center;
}
.empty-chat .empty-icon {
  font-size: 48px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.empty-chat h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); }
.empty-chat p { font-size: 13px; color: var(--text-muted); }

/* Message bubbles */
.message {
  display: flex;
  gap: 10px;
  animation: msg-in 0.2s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.message.user .msg-avatar { background: linear-gradient(135deg, var(--accent-violet), #9f67fa); }
.message.assistant .msg-avatar { background: linear-gradient(135deg, var(--accent-cyan), #38bdf8); }

.msg-content {
  max-width: 72%;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent-violet), #6d28d9);
  color: #fff;
  border-bottom-right-radius: var(--r-sm);
}
.message.assistant .msg-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: var(--r-sm);
}

.msg-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}
.message.user .msg-meta { text-align: right; }

/* Tool badge */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(6,182,212,0.2);
  margin-bottom: 6px;
  animation: msg-in 0.15s ease;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: msg-in 0.2s ease;
}
.typing-dots {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-sm);
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* Code blocks in messages */
.msg-bubble pre {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  overflow-x: auto;
  margin: 6px 0;
}
.msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(124,58,237,0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Input bar ──────────────────────────────────────────── */
#input-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 10px 12px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-wrapper:focus-within {
  border-color: var(--accent-violet-border);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1), 0 4px 20px rgba(0,0,0,0.2);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.input-action-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--t-fast);
  font-size: 14px;
}
.input-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.input-action-btn.recording { color: var(--accent-red); animation: pulse-red 1s infinite; }
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

#message-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 4px 0;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  line-height: 1.5;
}
#message-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: all var(--t-fast);
  flex-shrink: 0;
  font-size: 14px;
  box-shadow: 0 2px 12px rgba(124,58,237,0.35);
}
.send-btn:hover { transform: scale(1.08); box-shadow: 0 0 22px rgba(124,58,237,0.55), 0 0 12px rgba(6,182,212,0.25); }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Identity Verification (Login) ───────────────────────── */
#login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4,4,10,0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 40px;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-icon {
  font-size: 48px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(124,58,237,0.3));
}
.login-input-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 24px;
  letter-spacing: 0.5em;
  text-align: center;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.2s;
}
#login-code:focus {
  outline: none;
  border-color: var(--accent-violet-border);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
#login-btn {
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  border: none;
  border-radius: var(--r-md);
  padding: 14px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}
#login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
}
#login-btn:active {
  transform: translateY(0);
}

/* ── Notes panel ─────────────────────────────────────────── */
#notes-panel {
  width: var(--notes-w);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-base), opacity var(--t-base);
}
#notes-panel.collapsed {
  width: 0;
  opacity: 0;
  border-left: none;
  pointer-events: none;
}

.notes-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.notes-header h3 { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

#notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  animation: msg-in 0.2s ease;
}
.note-card .note-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

.notes-input-area {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.notes-input-area textarea {
  flex: 1;
  border-radius: var(--r-md);
  min-height: 60px;
  resize: none;
  font-size: 13px;
}
.notes-save-btn {
  width: 32px; height: 32px;
  background: var(--accent-violet-dim);
  border: 1px solid var(--accent-violet-border);
  border-radius: var(--r-md);
  color: var(--text-accent);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
  align-self: flex-end;
}
.notes-save-btn:hover { background: rgba(124,58,237,0.25); }

/* ── Full-page views (Reminders / Tasks / Settings) ──────── */
#page-container {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
  min-width: 0;
}
#page-container.visible { display: flex; }

/* Inner page wrappers fill their parent */
#page-reminders, #page-tasks, #page-settings {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.page-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--text-primary), var(--text-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-btn {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  color: #fff;
  transition: all var(--t-fast);
  display: flex; align-items: center; gap: 6px;
}
.page-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--accent-violet-border); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ── Reminder card ───────────────────────────────────────── */
.reminder-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color var(--t-fast);
  animation: msg-in 0.2s ease;
}
.reminder-card:hover { border-color: var(--accent-violet-border); }

.reminder-card.sent { opacity: 0.5; }

.reminder-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.reminder-status-dot.pending { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.reminder-status-dot.sent { background: var(--text-muted); }

.reminder-body { flex: 1; min-width: 0; }
.reminder-title { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 2px; }
.reminder-msg   { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.reminder-time  { font-size: 11px; color: var(--accent-cyan); display: flex; align-items: center; gap: 4px; }
.reminder-notes { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

.reminder-actions { display: flex; gap: 4px; }
.reminder-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--t-fast);
  font-size: 13px;
}
.reminder-action-btn:hover { background: var(--bg-hover); }
.reminder-action-btn.delete:hover { color: var(--accent-red); background: rgba(239,68,68,0.1); }

/* ── Task card ───────────────────────────────────────────── */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color var(--t-fast);
  animation: msg-in 0.2s ease;
}
.task-card:hover { border-color: var(--accent-cyan-dim); }

.task-recurrence-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.task-recurrence-badge.hourly  { background: rgba(245,158,11,0.15); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.25); }
.task-recurrence-badge.daily   { background: var(--accent-cyan-dim); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.25); }
.task-recurrence-badge.weekly  { background: var(--accent-violet-dim); color: var(--text-accent); border: 1px solid var(--accent-violet-border); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.task-instruction { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.task-meta { font-size: 11px; color: var(--text-muted); }

/* ── Settings ────────────────────────────────────────────── */
.settings-section {
  margin-bottom: 28px;
}
.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: 8px;
}
.model-option:hover { border-color: var(--accent-violet-border); background: var(--accent-violet-dim); }
.model-option.selected { border-color: var(--accent-violet); background: var(--accent-violet-dim); }
.model-option .model-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); transition: all var(--t-fast); }
.model-option.selected .model-radio { border-color: var(--accent-violet); background: var(--accent-violet); }
.model-label { font-size: 14px; font-weight: 500; }
.model-desc { font-size: 12px; color: var(--text-muted); }

.mcp-server-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color var(--t-fast);
}
.mcp-server-card:hover { border-color: rgba(16,185,129,0.3); }
.mcp-server-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.mcp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); animation: dot-pulse 2s ease-in-out infinite; }
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--accent-green); }
  50%       { box-shadow: 0 0 10px var(--accent-green), 0 0 20px rgba(16,185,129,0.3); }
}
.mcp-tools { font-size: 11px; color: var(--text-muted); word-break: break-word; line-height: 1.8; }

.access-user-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.access-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.access-user-info { flex: 1; min-width: 0; }
.access-user-name { font-weight: 600; font-size: 14px; }
.access-user-meta { font-size: 11px; color: var(--text-muted); }
.revoke-btn { padding: 5px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; color: var(--accent-red); background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); transition: all var(--t-fast); }
.revoke-btn:hover { background: rgba(239,68,68,0.15); }

/* Pairing badge */
.pairing-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  width: min(480px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: slide-up 0.2s ease;
}
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; }

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--bg-surface);
}
.form-group textarea { min-height: 80px; resize: vertical; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.btn-cancel {
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.btn-cancel:hover { background: var(--bg-hover); }
.btn-primary {
  padding: 8px 20px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
  color: #fff;
  transition: all var(--t-fast);
}
.btn-primary:hover { opacity: 0.9; }

/* ── Toast notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toast-in 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.error   { border-color: rgba(239,68,68,0.3); }
@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Stat pills ──────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-pill strong { color: var(--text-primary); font-size: 14px; }

/* ── Empty state for pages ───────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  text-align: center;
  opacity: 0.6;
}
.empty-state .empty-state-icon { font-size: 40px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.empty-state p { font-size: 13px; color: var(--text-muted); max-width: 300px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #notes-panel { display: none; }
  :root { --sidebar-w: 0px; --notes-w: 0px; }
}

/* ── Section dividers ────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
}
.section-divider-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.section-divider-line { flex: 1; height: 1px; background: var(--border); }

/* Image drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  transition: all var(--t-fast);
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-violet-border);
  background: var(--accent-violet-dim);
  color: var(--text-accent);
}

/* Approve pairing form */
.pairing-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.pairing-form input { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em; }

.mobile-menu-btn { display: none; margin-right: 12px; color: var(--text-secondary); }
@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
}

/* ── Responsive Mobile Styling ─────────────────────────── */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --notes-w: 0px;
  }

  body { font-size: 13px; }

  /* Navbar moves to bottom */
  #navbar {
    top: auto;
    bottom: 0;
    height: 64px;
    padding: 0 10px;
    justify-content: space-around;
    border-bottom: none;
    border-top: 1px solid rgba(124,58,237,0.2);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
  }

  .nav-logo { display: none; }
  
  .nav-btn {
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    padding: 8px 4px;
    min-width: 60px;
  }
  .nav-btn svg { width: 22px; height: 22px; }

  /* Main container spacing for bottom navbar */
  #main {
    padding-top: 0;
    padding-bottom: 64px;
  }

  /* Sidebars hidden by default on mobile */
  #sidebar {
    display: none;
  }
  #notes-panel {
    position: fixed;
    top: 0; right: 0; bottom: 64px;
    z-index: 1000;
    width: 85%;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex; /* Override display:none if set */
  }
  #notes-panel.mobile-visible {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  }

  /* Chat Panel adjustment */
  #chat-panel {
    padding-bottom: 70px; /* Space for input */
  }

  .chat-header {
    padding: 12px 16px;
  }

  /* Messages full width */
  .message {
    max-width: 92%;
    margin-bottom: 12px;
  }
  .msg-bubble {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Input Bar adjustment */
  #input-bar {
    padding: 10px;
    bottom: 0; /* Align with bottom navbar overlap or just above */
    margin-bottom: 64px;
    background: transparent;
  }
  .input-wrapper {
    padding: 6px;
    border-radius: var(--r-lg);
  }

  /* Page containers */
  .page-header {
    padding: 20px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-title { font-size: 20px; }
  .page-btn { width: 100%; justify-content: center; }

  /* Login Card */
  .login-card {
    padding: 30px 20px;
    margin: 10px;
  }
}

/* ============================================================
   Agent Personalities, Idea Bakery, & Roadmap Styles
   ============================================================ */

/* Agent personalities */
.agent-card {
  transition: all var(--t-base) !important;
}
.agent-card.active-agent {
  border-color: var(--accent-violet) !important;
  background: var(--accent-violet-dim) !important;
  box-shadow: 0 0 16px rgba(124,58,237,0.2);
}
.agent-avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.btn-danger {
  background: rgba(239,68,68,0.15) !important;
  border: 1px solid rgba(239,68,68,0.3) !important;
  color: var(--accent-red) !important;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.25) !important;
}

/* Idea Bakery */
.idea-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent-violet);
  transition: border-color var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: msg-in 0.2s ease;
}
.idea-card:hover {
  border-color: var(--accent-violet-border);
}
.idea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.idea-title-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 8px;
}
.idea-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 10px;
}
.idea-status-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.idea-status-badge.raw { background: rgba(107,114,128,0.2); color: var(--text-secondary); }
.idea-status-badge.bakery { background: rgba(245,158,11,0.2); color: var(--accent-orange); }
.idea-status-badge.researching { background: rgba(6,182,212,0.2); color: var(--accent-cyan); }
.idea-status-badge.pitching { background: rgba(124,58,237,0.2); color: var(--text-accent); }
.idea-status-badge.building { background: rgba(16,185,129,0.2); color: var(--accent-green); }

.idea-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 600px) {
  .idea-grid { grid-template-columns: 1fr; }
}
.idea-section {
  font-size: 13px;
  line-height: 1.5;
}
.idea-section strong {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.idea-section p {
  color: var(--text-secondary);
}

.idea-scores-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.idea-score-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.idea-score-pill.excellent { background: rgba(6,182,212,0.12); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.3); }
.idea-score-pill.good { background: rgba(16,185,129,0.12); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); }
.idea-score-pill.average { background: rgba(245,158,11,0.12); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.3); }
.idea-score-pill.low { background: rgba(239,68,68,0.12); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.3); }

/* Goal Roadmap / Kanban */
.goals-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  height: 100%;
}
.goals-column {
  width: 290px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}
.goals-column-header {
  padding: 14px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.column-count {
  font-size: 11px;
  background: var(--bg-elevated);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  color: var(--text-muted);
}
.goals-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.column-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 30px 10px;
  font-style: italic;
}

.goal-kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--t-fast);
}
.goal-kanban-card:hover {
  border-color: var(--accent-violet-border);
}
.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.goal-card-header strong {
  font-size: 14px;
  color: var(--text-primary);
}
.goal-delete-btn {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px;
}
.goal-delete-btn:hover {
  color: var(--accent-red);
}
.goal-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.goal-card-date {
  font-size: 11px;
  color: var(--accent-cyan);
}

.goal-milestones-section {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.milestones-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.add-m-btn {
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 600;
}
.add-m-btn:hover {
  text-decoration: underline;
}
.goal-milestones-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.goal-milestones-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
}
.goal-milestones-list input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  padding: 0;
  cursor: pointer;
}
.goal-milestones-list span {
  color: var(--text-secondary);
}
.goal-milestones-list span.completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

.goal-stage-move {
  margin-top: 6px;
}

