:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e7e9ee;
  background: #090b10;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body { min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 16% 12%, rgba(96,165,250,.12), transparent 28%),
    radial-gradient(circle at 84% 86%, rgba(167,139,250,.10), transparent 28%),
    #090b10;
}
.card {
  border: 1px solid #242832;
  border-radius: 20px;
  background: rgba(15,18,25,.96);
  box-shadow: 0 24px 80px rgba(0,0,0,.38);
}
.login-card { width: min(100%, 430px); padding: 34px; }
.logo {
  width: 42px; height: 42px; display: grid; place-items: center;
  margin-bottom: 28px; border-radius: 12px;
  background: #e7e9ee; color: #090b10; font-weight: 900;
}
.eyebrow { margin: 0 0 5px; color: #7f8797; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1, h2 { margin: 0; letter-spacing: -.03em; }
h1 { font-size: clamp(26px,5vw,34px); }
h2 { font-size: 21px; }
.muted { color: #969eae; line-height: 1.55; }
label { display: block; margin: 26px 0 8px; color: #cbd0da; font-size: 14px; font-weight: 650; }
label + input + label { margin-top: 16px; }
input {
  width: 100%; padding: 13px 14px; border: 1px solid #2d323e;
  border-radius: 11px; outline: none; background: #0b0e14; color: #f7f8fa;
}
input:focus { border-color: #68748b; }
input:disabled { opacity: .55; }
button {
  padding: 12px 16px; border: 0; border-radius: 11px;
  background: #f1f5f9; color: #0a0c11; font-weight: 800;
}
button:disabled { cursor: not-allowed; opacity: .45; }
.login-card > button { width: 100%; margin-top: 14px; }
.link-button { background: transparent; color: #aeb6c5; font-weight: 650; }
.link-button:hover { color: #f1f5f9; }
.form-error { margin: 12px 0 0; color: #fca5a5; font-size: 13px; line-height: 1.4; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.workspace {
  width: min(100%,1240px); height: min(780px,calc(100vh - 48px));
  display: grid; grid-template-columns: minmax(0,920px); justify-content: center; gap: 18px;
}
.workspace.admin-enabled { grid-template-columns: minmax(0,1fr) 340px; justify-content: stretch; }
.chat-card {
  width: 100%; height: 100%;
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 22px; border-bottom: 1px solid #242832;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.current-user { color: #d9dde5; font-size: 13px; font-weight: 700; }
.status { display: flex; align-items: center; gap: 7px; color: #969eae; font-size: 13px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; }
.status.ok i { background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.08); }
.ghost { padding: 8px 11px; border: 1px solid #2d323e; background: transparent; color: #b1b8c5; }
.messages {
  min-height: 0; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.empty { margin: auto; display: grid; gap: 6px; text-align: center; color: #8f97a7; }
.empty strong { color: #d9dde5; }
.message-row { display: flex; }
.message-row.mine { justify-content: flex-end; }
.bubble {
  max-width: min(72%,620px); padding: 10px 12px 8px;
  border: 1px solid #282d37; border-radius: 14px 14px 14px 5px;
  background: #1a1e27;
}
.mine .bubble {
  border-color: #e5e7eb; border-radius: 14px 14px 5px 14px;
  background: #e5e7eb; color: #111318;
}
.bubble strong { display: block; margin-bottom: 4px; color: #9ca3af; font-size: 12px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble time { display: block; margin-top: 5px; text-align: right; font-size: 10px; opacity: .55; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px; border-top: 1px solid #242832; }
.composer button { min-width: 82px; }
.admin-card { min-width: 0; align-self: start; overflow: hidden; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px; border-bottom: 1px solid #242832;
}
.user-count {
  padding: 5px 9px; border: 1px solid #303641; border-radius: 999px;
  color: #aeb6c5; font-size: 12px; font-weight: 800;
}
.admin-card > .form-error { margin: 12px 16px 0; }
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th,
.user-table td { padding: 13px 14px; border-bottom: 1px solid #242832; text-align: left; }
.user-table th { color: #7f8797; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.user-table th:last-child,
.user-table td:last-child { text-align: right; }
.user-name { color: #eef1f5; font-weight: 750; }
.admin-badge {
  display: inline-block; margin-left: 6px; padding: 2px 5px; border-radius: 5px;
  background: #2a3140; color: #cdd5e3; font-size: 9px; font-weight: 900;
}
.created-date { color: #8f97a7; white-space: nowrap; }
.danger {
  padding: 6px 8px; border: 1px solid #5f2930; background: transparent;
  color: #fca5a5; font-size: 11px;
}
.danger:hover { background: rgba(248,113,113,.08); }
@media (max-width:620px) {
  .screen { padding: 0; }
  .login-card,.chat-card,.admin-card { border-left: 0; border-right: 0; border-radius: 0; }
  .workspace { height: auto; min-height: 100vh; display: block; }
  .chat-card { height: 100vh; }
  .admin-card { margin-top: 12px; }
  .topbar { padding: 16px; }
  .status span { display: none; }
  .current-user { display: none; }
  .messages { padding: 16px; }
  .bubble { max-width: 86%; }
}
@media (min-width:621px) and (max-width:980px) {
  .workspace { height: auto; grid-template-columns: 1fr; }
  .chat-card { height: min(720px,calc(100vh - 48px)); }
  .admin-card { width: 100%; }
}
