:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --user: #2563eb;
  --assistant: #2a2f3a;
  --text: #e6e8ec;
  --muted: #8b93a1;
  --accent: #3b82f6;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.screen { height: 100vh; }

/* Login */
#login-screen {
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--panel); padding: 40px; border-radius: 16px;
  width: 360px; text-align: center;
}
.login-card h1 { margin-bottom: 8px; }
.login-card p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-card input {
  display: block; width: 100%; margin-bottom: 12px;
  padding: 12px; border-radius: 8px; border: 1px solid #2a2f3a;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.login-card button {
  width: 100%; padding: 12px; border: none; border-radius: 8px;
  background: var(--accent); color: white; font-size: 15px; cursor: pointer;
}
.login-card button:hover { filter: brightness(1.1); }
.error { color: #ff6b6b; margin-top: 12px; font-size: 13px; }

/* Chat */
#chat-screen {
  max-width: 860px; margin: 0 auto;
  display: flex; flex-direction: column; padding: 16px;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #2a2f3a; padding-bottom: 12px;
}
header h1 { font-size: 18px; }
.controls { display: flex; align-items: center; gap: 8px; }
.controls label { color: var(--muted); font-size: 13px; }
select, .controls button {
  background: var(--panel); color: var(--text);
  border: 1px solid #2a2f3a; border-radius: 8px; padding: 6px 12px;
  font-size: 13px; cursor: pointer;
}
#logout-btn { color: var(--muted); }

.pdf-status {
  padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-top: 8px;
  background: #1e293b;
}
.pdf-status.success { background: #1a2e1a; color: #6ee76e; }
.pdf-status.error { background: #2e1a1a; color: #ff6b6b; }

.log {
  flex: 1; overflow-y: auto; padding: 16px 0;
  display: flex; flex-direction: column; gap: 14px;
}
.msg { display: flex; flex-direction: column; max-width: 80%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant, .msg.system { align-self: flex-start; }
.bubble {
  padding: 10px 14px; border-radius: 14px;
  white-space: pre-wrap; line-height: 1.5;
}
.msg.user .bubble { background: var(--user); color: white; }
.msg.assistant .bubble { background: var(--assistant); }
.msg.system .bubble { background: #1e293b; color: #93c5fd; font-size: 13px; }
.metrics { color: var(--muted); font-size: 12px; margin-top: 4px; }
.metrics span { white-space: nowrap; }

.composer {
  display: flex; gap: 8px; border-top: 1px solid #2a2f3a; padding-top: 12px;
}
textarea {
  flex: 1; resize: none; background: var(--panel); color: var(--text);
  border: 1px solid #2a2f3a; border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 14px;
}
#send {
  background: var(--accent); color: white; border: none;
  border-radius: 10px; padding: 0 20px; font-size: 14px; cursor: pointer;
}
#send:hover { filter: brightness(1.1); }
