/* Muse Hub — WhatsApp-style GREEN theme. No external dependencies. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #eef2f1;
  color: #111b21;
}
a { color: #075e54; }

/* ---------- header ---------- */
.topbar {
  background: #075e54;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
}
.brand-name { font-size: 26px; font-weight: 700; }
.brand-sub { font-size: 14px; color: #d9fdd3; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.logout-btn {
  background: transparent; border: 1px solid #fff; color: #fff;
  border-radius: 20px; padding: 8px 16px; cursor: pointer; font-size: 15px;
}

/* bell + dropdown (no JS needed) */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; font-size: 26px; position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.badge {
  position: absolute; top: -8px; right: -10px;
  background: #dc2626; color: #fff; font-size: 13px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.bell-drop {
  position: absolute; right: 0; top: 44px; width: 340px; max-width: 90vw;
  background: #fff; color: #111b21; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 50; overflow: hidden;
}
.bell-title { font-weight: 700; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; }
.bell-item { display: block; padding: 12px 16px; text-decoration: none; color: #111b21; border-bottom: 1px solid #f3f4f6; }
.bell-item span { color: #667781; font-size: 14px; }
.bell-empty { padding: 14px 16px; color: #667781; }

/* ---------- tabs ---------- */
.tabs { display: flex; background: #fff; border-bottom: 1px solid #e5e7eb; }
.tab {
  flex: 1; text-align: center; padding: 14px 0 12px;
  text-decoration: none; color: #667781; font-size: 17px;
}
.tab.active { color: #075e54; font-weight: 700; border-bottom: 3px solid #25d366; }

/* ---------- flash / token ---------- */
.flash {
  background: #fef3c7; border: 1px solid #f59e0b; color: #92400e;
  border-radius: 10px; padding: 12px 16px; margin: 14px 20px;
}
.tokenbox {
  background: #ecfdf5; border: 1px solid #25d366; border-radius: 10px;
  padding: 14px 16px; margin: 14px 20px; word-break: break-all;
}
.tokenbox code { background: #fff; padding: 4px 8px; border-radius: 6px; }

/* ---------- chats layout ---------- */
.layout { display: flex; min-height: calc(100vh - 130px); }
.sidebar { width: 380px; background: #fff; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; }
.searchbox {
  margin: 12px; background: #f0f2f5; border-radius: 20px;
  padding: 10px 16px; color: #8696a0;
}
.chatlist { flex: 1; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  text-decoration: none; color: #111b21; border-bottom: 1px solid #f3f4f6;
}
.row.active { background: #f0f2f5; }
.avatar {
  width: 48px; height: 48px; border-radius: 24px; flex-shrink: 0;
  background: #075e54; color: #fff; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.row-main { flex: 1; min-width: 0; }
.row-top { display: flex; justify-content: space-between; gap: 8px; }
.row-time { color: #25d366; font-size: 13px; white-space: nowrap; }
.row-prev {
  display: block; color: #667781; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unread {
  background: #25d366; color: #fff; font-size: 13px; font-weight: 700;
  min-width: 22px; height: 22px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0;
}
.side-note { padding: 10px 16px; color: #8696a0; font-size: 13px; }

.chatpane { flex: 1; display: flex; flex-direction: column; background: #ece5dd; }
.chathead {
  display: flex; align-items: center; gap: 12px;
  background: #f0f2f5; padding: 10px 16px;
}
.backlink { display: none; text-decoration: none; font-size: 18px; }
.chathead-name { font-weight: 700; font-size: 18px; flex: 1; }
.chathead-sub { display: block; font-weight: 400; font-size: 13px; color: #667781; }
.chathead-live { color: #25d366; font-weight: 700; font-size: 14px; white-space: nowrap; }
.livebanner {
  margin: 12px 16px 0; background: #ecfdf5; border: 1px solid #25d366;
  border-radius: 12px; padding: 10px 14px; color: #166534; font-size: 15px;
  display: flex; align-items: center; gap: 10px;
}
.livedot { width: 12px; height: 12px; border-radius: 6px; background: #25d366; flex-shrink: 0; }
.messages { flex: 1; padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.msg {
  max-width: 75%; padding: 10px 14px; border-radius: 14px;
  background: #fff; align-self: flex-start; font-size: 16px; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.msg.user { background: #d9fdd3; align-self: flex-end; }
.msg small { display: block; color: #667781; font-size: 12px; margin-top: 4px; }
.composer { display: flex; gap: 10px; padding: 12px 16px; background: #f0f2f5; }
.composer input {
  flex: 1; border: none; border-radius: 24px; padding: 12px 18px; font-size: 16px; outline: none;
}
.composer button, .settings button, .login-box button {
  background: #25d366; color: #fff; border: none; border-radius: 24px;
  padding: 12px 26px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.foot-note { text-align: center; color: #667781; font-size: 13px; padding: 6px 12px 12px; background: #f0f2f5; margin: 0; }
.empty-chat { padding: 30px; color: #667781; text-align: center; }

/* ---------- status ---------- */
.status-page { max-width: 820px; margin: 0 auto; padding: 20px; }
.status-page h2, .settings h2 { color: #075e54; }
.status-note { color: #667781; }
.status-list { background: #fff; border-radius: 12px; overflow: hidden; }
.status-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid #f3f4f6;
}
.status-item .avatar { box-shadow: 0 0 0 3px #25d366; }
.status-main { flex: 1; min-width: 0; }
.status-text { display: block; color: #667781; font-size: 15px; margin-top: 2px; }
.status-time { color: #8696a0; font-size: 13px; white-space: nowrap; }

/* ---------- settings ---------- */
.settings { max-width: 820px; margin: 0 auto; padding: 20px; }
.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.card h3 { margin-top: 0; color: #075e54; }
.card label { display: block; margin: 12px 0 4px; font-weight: 600; }
.card input[type="text"], .card input[type="password"], .card select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 10px; font-size: 16px; margin-bottom: 6px;
}
.card button { margin-top: 10px; }
.card-note { color: #667781; font-size: 14px; }
.muse-form { border-top: 1px solid #f3f4f6; padding-top: 6px; }
.token-form { border-top: 1px solid #f3f4f6; padding-top: 6px; }
.token-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.token-table th, .token-table td { text-align: left; padding: 8px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
button.danger { background: #dc2626; padding: 8px 16px; font-size: 14px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 420px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.login-box h1 { color: #075e54; margin: 0 0 6px; }
.login-sub { color: #667781; margin: 0 0 18px; }
.login-box label { display: block; margin: 12px 0 4px; font-weight: 600; }
.login-box input { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 16px; }
.login-box button { width: 100%; margin-top: 18px; }
.login-note { color: #667781; font-size: 14px; text-align: center; }
.login-box .flash { margin: 14px 0; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; }
  .layout.has-thread .sidebar { display: none; }
  .layout:not(.has-thread) .chatpane { display: none; }
  .backlink { display: inline; }
  .bell-drop { width: 300px; }
  .brand-name { font-size: 22px; }
  .msg { max-width: 88%; }
}
