/* 지엔에이 사내 챗봇 */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --sidebar: #1e2430;
  --border: #e3e6ea;
  --text: #1c2028;
  --muted: #6b7280;
  --accent: #2f6fed;
  --user-bubble: #2f6fed;
  --bot-bubble: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 340px;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}

.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.login-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.login-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.login-card button {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  font-size: 15px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: 13px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 8px;
}


.layout { display: flex; height: 100vh; }

.sidebar {
  display: flex;
  flex-direction: column;
  width: 260px;
  padding: 16px;
  color: #cfd6e4;
  background: var(--sidebar);
  flex-shrink: 0;
}

.brand { margin-bottom: 16px; font-size: 16px; font-weight: 600; color: #fff; }

.btn-new {
  padding: 9px;
  color: #fff;
  background: transparent;
  border: 1px solid #3b4454;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.btn-new:hover { background: #2a3140; }

.session-list { flex: 1; margin-top: 16px; overflow-y: auto; }

.session-item {
  display: block;
  padding: 8px 10px;
  margin-bottom: 4px;
  color: #cfd6e4;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
}
.session-item:hover { background: #2a3140; }
.session-item.active { background: #333c4d; color: #fff; }

.session-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { display: block; margin-top: 2px; font-size: 11px; color: #8b94a5; }

.user-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #333c4d;
  font-size: 13px;
}
.user-name { color: #fff; }
.logout { color: #8b94a5; text-decoration: none; }
.logout:hover { color: #fff; }

/* ---------------- 대화 영역 ---------------- */

.main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.topbar code { padding: 2px 6px; background: #eef1f5; border-radius: 4px; }
.deep-toggle { cursor: pointer; user-select: none; }

.messages { flex: 1; padding: 24px 20px; overflow-y: auto; }

.empty { margin-top: 80px; text-align: center; color: var(--muted); }

.msg { display: flex; margin: 0 auto 14px; max-width: 820px; }
.msg.user { justify-content: flex-end; }

.bubble {
  max-width: 78%;
  padding: 11px 14px;
  line-height: 1.6;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user .bubble { color: #fff; background: var(--user-bubble); }
.msg.assistant .bubble { background: var(--bot-bubble); border: 1px solid var(--border); }
.msg.pending .bubble { color: var(--muted); font-style: italic; }
.msg.error .bubble { color: #b42318; background: #fef3f2; border-color: #fecdca; }

.composer {
  display: flex;
  gap: 8px;
  padding: 14px 20px 6px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.composer textarea {
  flex: 1;
  max-height: 200px;
  padding: 11px 14px;
  font: inherit;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: none;
}
.composer textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

.composer button {
  padding: 0 20px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}
.composer button:disabled { background: #9db4e8; cursor: not-allowed; }

.status {
  padding: 4px 20px 12px;
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  min-height: 26px;
}
