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

:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --border: #23272e;
  --text: #e6e9ef;
  --muted: #7d8590;
  --accent: #5eead4;
  --accent-dim: #2a4a45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 1.6s infinite ease-in-out;
}
.brand-dot.found { background: var(--accent); animation: none; }

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

.tabs {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.tab {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-dim); color: var(--accent); }

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px;
}

.panel { display: none; }
.panel.active { display: block; }

.panel h2 {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  margin: 24px 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}
.panel h2:first-child { margin-top: 0; }

/* CHAT */
.chat-window {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  min-height: 50vh;
  max-height: 60vh;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.msg-user {
  align-self: flex-end;
  background: var(--accent-dim);
  color: var(--text);
  border-bottom-right-radius: 3px;
}
.msg-assistant {
  align-self: flex-start;
  background: #1a1e24;
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
}
.chat-input-row input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
}
.chat-input-row input:focus { outline: 1px solid var(--accent); }
.chat-input-row button {
  background: var(--accent);
  color: #0b0d10;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* TACHES */
.tache-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.tache-form textarea, .tache-form select {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
}
.tache-form button {
  background: var(--accent);
  color: #0b0d10;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  align-self: flex-start;
  padding-left: 20px;
  padding-right: 20px;
}

/* CARDS (taches + historique) */
.liste { display: flex; flex-direction: column; gap: 10px; }
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.badge {
  align-self: flex-start;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 100px;
}
.timestamp {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}
.empty-state { color: var(--muted); font-size: 0.88rem; }

/* GRABBER */
.hero { margin-bottom: 24px; }
.hero h1 { font-size: clamp(1.2rem, 3.5vw, 1.6rem); font-weight: 700; margin: 0 0 8px 0; }
.hero p { color: var(--muted); font-size: 0.9rem; margin: 0; max-width: 60ch; }

.terminal-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #0e1013;
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 50%; background: #2a2f37; }
.terminal-label { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--muted); }
.terminal {
  margin: 0;
  padding: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 40vh;
  overflow-y: auto;
}

footer {
  text-align: center;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; flex-direction: column; align-items: flex-start; }
  .tabs { width: 100%; overflow-x: auto; }
  main { padding: 20px 16px; }
  .msg { max-width: 90%; }
}
