:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #181817;
  background: #f5f3ee;
  font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(390px, 100%);
  background: #fff;
  border: 1px solid #d8d4ca;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 18px 45px rgba(30, 28, 22, .08);
}
.brand { font-size: 30px; font-weight: 800; margin-bottom: 28px; }
.brand span { color: #be3b2f; }
.login-panel h1 { margin: 0 0 6px; font-size: 25px; }
.login-panel p { color: #6b675f; margin: 0 0 26px; }
label { display: grid; gap: 7px; margin: 16px 0; font-weight: 600; }
input, textarea {
  width: 100%;
  border: 1px solid #c9c5bc;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: #181817;
}
input:focus, textarea:focus { outline: 2px solid #be3b2f; outline-offset: 1px; }
button {
  border: 0;
  border-radius: 6px;
  background: #be3b2f;
  color: #fff;
  padding: 11px 18px;
  font-weight: 700;
}
.login-panel button { width: 100%; margin-top: 10px; }
.error { color: #a32118; min-height: 22px; margin-top: 12px; }

.inbox-view { height: 100vh; display: grid; grid-template-rows: 58px 1fr; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #151514;
  color: #fff;
}
.topbar div { display: flex; align-items: center; gap: 16px; }
.topbar span { color: #a9d5b4; font-size: 13px; }
.secondary { background: transparent; border: 1px solid #5f5d58; padding: 7px 13px; }
.workspace { min-height: 0; display: grid; grid-template-columns: 350px 1fr; }
.conversation-pane { min-height: 0; display: grid; grid-template-rows: auto auto 1fr; border-right: 1px solid #d8d4ca; background: #fff; }
.pane-header, .chat-header { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid #e4e1da; }
h2 { margin: 0; font-size: 18px; }
.icon-button { width: 36px; height: 36px; padding: 0; font-size: 22px; }
.search { width: auto; margin: 12px 16px; background: #f7f6f2; }
.conversation-list { overflow-y: auto; }
.conversation {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 14px 16px;
  color: #181817;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid #efede8;
  text-align: left;
}
.conversation:hover, .conversation.selected { background: #f1eee7; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #dde9df; color: #245b32; font-weight: 800; }
.conversation strong, .conversation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation small { color: #777269; margin-top: 4px; }
.conversation time { color: #8c877d; font-size: 11px; }
.chat-pane { min-width: 0; min-height: 0; background: #f3f1ec; }
.empty-chat { height: 100%; display: grid; place-content: center; text-align: center; color: #6f6b63; }
.empty-chat p { margin: 8px 0; }
.active-chat { height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; }
.chat-header { background: #fff; }
.chat-header span { color: #6d6961; font-size: 13px; }
.status { padding: 5px 9px; border: 1px solid #c8c4ba; border-radius: 999px; }
.messages { overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.message { max-width: min(680px, 78%); padding: 11px 13px; border-radius: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.message.inbound { align-self: flex-start; background: #fff; }
.message.outbound { align-self: flex-end; background: #dff0df; }
.message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message footer { display: flex; gap: 8px; justify-content: flex-end; color: #777269; font-size: 10px; margin-top: 5px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 18px; background: #fff; border-top: 1px solid #ddd9d0; }
.composer textarea { resize: none; }
.window-note { margin: 0; padding: 0 18px 12px; background: #fff; color: #777269; font-size: 12px; }

@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .conversation-pane { border-right: 0; }
  .chat-pane { display: none; }
  .workspace.chat-open .conversation-pane { display: none; }
  .workspace.chat-open .chat-pane { display: block; }
  .message { max-width: 88%; }
}
