/* OBDPortal Cloud Dashboard — matches the marketplace theme */

:root {
  --bg:        #232323;
  --bg-elev:   #2B2B2B;
  --bg-elev-2: #303030;
  --bg-deep:   #1C1C1C;
  --line:      #3A3A3A;
  --line-soft: #2F2F2F;
  --txt:       #FFFFFF;
  --txt-mid:   #BDBDBD;
  --txt-dim:   #9E9E9E;
  --accent:    #E53935;
  --accent-hi: #FF5252;
  --accent-lo: #C62828;
  --ok:        #4CAF50;
  --warn:      #FFB300;
  --danger:    #E53935;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--txt); text-decoration: none; transition: color 120ms ease; }
a:hover { color: var(--accent); }
.muted { color: var(--txt-dim); }
.small { font-size: 12px; }
.center { text-align: center; }
code { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 12px; color: var(--txt-mid); }

/* ============ App shell (sidebar + content) ============ */

body {
  display: flex; min-height: 100vh;
}
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.brand {
  display: block;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.brand-mark { color: var(--accent); }
.brand-sub  {
  display: block;
  margin-top: 2px;
  font-size: 10px; letter-spacing: 2px;
  color: var(--txt-dim);
  text-transform: uppercase;
  font-weight: 600;
}
.side-nav {
  flex: 1 1 auto;
  padding: 12px 8px;
  overflow-y: auto;
}
.side-link {
  display: block;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 6px;
  color: var(--txt-mid);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: background 120ms ease, color 120ms ease, padding 120ms ease;
  border-left: 3px solid transparent;
}
.side-link:hover {
  color: var(--txt);
  background: var(--bg-elev);
  padding-left: 16px;
}
.side-link.active {
  color: var(--txt);
  background: var(--bg-elev);
  border-left-color: var(--accent);
  font-weight: 700;
}
.side-empty {
  padding: 12px;
  color: var(--txt-dim);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  margin: 10px;
}
.side-foot {
  border-top: 1px solid var(--line-soft);
  padding: 12px 16px;
}
.side-user-name {
  font-weight: 700;
}
.side-user-meta {
  font-size: 11px;
  color: var(--txt-dim);
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.side-logout {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--txt-dim);
}
.side-logout:hover { color: var(--accent); }

.content {
  flex: 1 1 auto;
  min-height: 100vh;
  padding: 0 28px 40px;
  overflow-x: auto;
}
.content-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 20px;
}
.content-head h1 {
  font-size: 22px; margin: 0; font-weight: 700;
}
.content-head-right {}

/* ============ Buttons ============ */

.btn, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.6px;
  cursor: pointer; border: 1px solid transparent;
  transition: all 120ms ease;
}
.btn { background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-hi); }
.btn:active { background: var(--accent-lo); }
.btn-outline { background: transparent; color: var(--txt); border-color: var(--line); }
.btn-outline:hover { color: var(--accent); border-color: var(--accent); }

/* ============ Cards & tables ============ */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.data-table th {
  color: var(--txt-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.data-table td { font-size: 13px; }
.data-table tbody tr:hover { background: var(--bg-elev-2); }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: var(--bg-deep);
  color: var(--txt-mid);
  border: 1px solid var(--line);
}
.pill.ok      { background: rgba(76,175,80,0.18); color: var(--ok); border-color: transparent; }
.pill.warn    { background: rgba(255,179,0,0.18); color: var(--warn); border-color: transparent; }
.pill.danger  { background: rgba(229,57,53,0.18); color: var(--danger); border-color: transparent; }
.pill.new     { background: rgba(229,57,53,0.18); color: var(--accent); border-color: transparent; }
.pill.super   { background: var(--accent); color: #fff; border-color: transparent; letter-spacing: 1.6px; }

/* ============ Dashboard summary ============ */

.dash-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: left;
}
.stat-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin-top: 4px;
}

/* ============ Slideshow (Dashboard fallback) ============ */

.slides {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 48px 36px;
  min-height: 280px;
  overflow: hidden;
}
.slide {
  position: absolute; inset: 0;
  padding: 48px 36px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.slide.active { opacity: 1; transform: translateY(0); }
.slide h2 { font-size: 26px; margin: 0 0 12px; color: var(--accent); }
.slide p  { max-width: 640px; color: var(--txt-mid); line-height: 1.7; }
.slide-dots {
  position: absolute; bottom: 18px; left: 0; right: 0;
  display: flex; gap: 6px; justify-content: center;
}
.slide-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); transition: background 200ms ease;
}
.slide-dot.active { background: var(--accent); }

/* ============ Login (split-screen, branded — mirrors the retired
   admin dashboard's layout but with the cloud dashboard's 5-stage
   auth and dark palette intact) ============ */

.login-body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}
.login-left {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  text-decoration: none;
  color: var(--txt);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: filter 200ms ease;
  background:
    radial-gradient(circle at 20% 30%, rgba(229,57,53,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(229,57,53,0.10) 0%, transparent 45%),
    var(--bg);
}
.login-left::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg,  transparent 0 50px, rgba(229,57,53,0.04) 50px 51px),
    repeating-linear-gradient(90deg, transparent 0 50px, rgba(229,57,53,0.04) 50px 51px);
  pointer-events: none;
}
.login-left:hover { filter: brightness(1.1); }
.login-left-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  max-width: 460px;
}
.login-shop-icon {
  width: 86px; height: 86px;
  border: 3px solid rgba(229,57,53,0.55);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 38px; color: var(--accent);
  background: rgba(229,57,53,0.08);
  margin-bottom: 24px;
}
.login-hero-title {
  font-size: 44px; font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
  margin: 0 0 8px;
}
.login-hero-sub {
  font-size: 16px; color: var(--txt-mid);
  margin: 0 0 28px;
  font-weight: 400;
}
.login-shop-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 28px;
  border: 2px solid rgba(229,57,53,0.5);
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  background: rgba(229,57,53,0.08);
  transition: all 200ms ease;
}
.login-left:hover .login-shop-cta {
  background: rgba(229,57,53,0.2);
  border-color: var(--accent);
  transform: translateX(4px);
}

.login-right {
  flex: 1 1 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 30px 20px;
  background: var(--bg-deep);
  border-left: 1px solid var(--line-soft);
}
.login-shell {
  width: 100%; max-width: 460px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: rise 280ms ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-brand {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 18px;
}
.login-brand .brand-sub {
  font-size: 11px; letter-spacing: 2px;
  color: var(--txt-dim);
  margin-top: 4px;
}
.login-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: space-between;
}
.step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  text-align: center;
  font-size: 10px; letter-spacing: 1.2px; color: var(--txt-dim);
  position: relative;
}
.step::after {
  content: "";
  position: absolute; top: 12px; left: 50%;
  width: 100%; height: 2px; background: var(--line-soft);
  z-index: -1;
}
.step:last-child::after { display: none; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-deep); color: var(--txt-dim);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--line);
}
.step.done .step-num { background: var(--ok); color: #fff; border-color: var(--ok); }
.step.active .step-num { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.active .step-label { color: var(--txt); }
.step-label { margin-top: 5px; text-transform: uppercase; }

.login-form { display: grid; gap: 10px; }
.login-form label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--txt-dim);
}
.login-form input {
  background: var(--bg-deep);
  color: var(--txt);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.login-form input:focus { border-color: var(--accent); }
.login-form .btn { margin-top: 6px; padding: 11px; }

.login-error {
  background: rgba(229,57,53,0.12);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}
.login-hint {
  background: rgba(76,175,80,0.12);
  color: var(--ok);
  border-left: 3px solid var(--ok);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}
.login-rejected { text-align: center; }
.login-footer { margin-top: 22px; text-align: center; }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--bg-deep);
  border-top-color: var(--accent);
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Sidebar badge (used by Chat menu) ============ */

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ============ Search box (reusable: chat, tables, dashboard) ============ */

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--txt-dim);
  font-size: 13px;
  pointer-events: none;
  line-height: 1;
}
.search-box input[type="search"],
.search-box input[type="text"] {
  width: 100%;
  background: var(--bg-deep);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px 8px 30px;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease;
}
.search-box input[type="search"]:focus,
.search-box input[type="text"]:focus { border-color: var(--accent); }
.search-box input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  height: 14px; width: 14px;
  background: var(--txt-dim);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z'/></svg>") center / contain no-repeat;
  cursor: pointer;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .search-box { flex: 1 1 280px; max-width: 420px; }
.toolbar-count {
  color: var(--txt-dim);
  font-size: 12px;
  margin-left: auto;
}

/* ============ Action buttons (compact, colored — match Server UI vibe) ============ */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid transparent;
  color: #FFFFFF;
  background: var(--bg-elev-2);
  transition: filter 120ms ease, transform 60ms ease;
  white-space: nowrap;
}
.btn-action:hover { filter: brightness(1.15); }
.btn-action:active { transform: translateY(1px); }
.btn-action:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-action.refresh  { background: #8B0000; }
.btn-action.add      { background: #009933; }
.btn-action.remove   { background: #CC6600; }
.btn-action.ban      { background: #CC0000; }
.btn-action.unban    { background: #006600; }
.btn-action.unblock  { background: #336699; }
.btn-action.delete   { background: #990000; }
.btn-action.details  { background: #666666; }
.btn-action.discount { background: #9933CC; }
.btn-action.copy     { background: #555555; }
.btn-action.diagnose { background: #FF6600; }
.btn-action.logs     { background: #CC6699; }
.btn-action.engineer { background: #CC7700; }
.btn-action.disconnect { background: #CC3333; }
.btn-action.rank     { background: #2E8B57; }

/* ============ Selectable table rows ============ */

.data-table.selectable tbody tr { cursor: pointer; }
.data-table.selectable tbody tr.row-selected {
  background: rgba(229, 57, 53, 0.18);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* ============ Modal dialog ============ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in 160ms ease-out;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  min-width: 320px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: rise 200ms ease-out;
}
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal-row { margin-bottom: 12px; }
.modal-row label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin-bottom: 5px;
}
.modal-row input,
.modal-row select,
.modal-row textarea {
  width: 100%;
  background: var(--bg-deep);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.modal-row input:focus,
.modal-row select:focus,
.modal-row textarea:focus { border-color: var(--accent); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.modal-actions .btn,
.modal-actions .btn-outline { padding: 7px 16px; font-size: 12px; }
.modal-info {
  background: var(--bg-deep);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 6px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  color: var(--txt-mid);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 300;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: rise 200ms ease-out;
  max-width: 360px;
  font-size: 13px;
}
.toast.ok      { border-left-color: var(--ok); }
.toast.warn    { border-left-color: var(--warn); }
.toast.danger  { border-left-color: var(--danger); }

/* ============ Thread count line under chat search ============ */

.chat-thread-count {
  margin-top: 8px;
  letter-spacing: 0.4px;
}

/* ============ Chat section ============ */

.chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
  min-height: 420px;
}

/* threads list */
.chat-threads {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-threads-head {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.chat-filter {
  width: 100%;
  background: var(--bg-deep);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
}
.chat-filter:focus { border-color: var(--accent); }

.chat-thread-list {
  list-style: none;
  margin: 0;
  padding: 6px 6px 6px 6px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.chat-thread {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
}
.chat-thread:hover { background: var(--bg-elev-2); }
.chat-thread-active {
  background: var(--bg-elev-2);
  border-color: var(--accent);
}
.chat-thread-unread .thread-name { font-weight: 700; }
.thread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.thread-dot.online { background: var(--ok); box-shadow: 0 0 0 3px rgba(76,175,80,0.18); }
.thread-name { color: var(--txt); font-size: 13px; }
.thread-sub  { color: var(--txt-dim); margin-top: 1px; }
.thread-preview {
  color: var(--txt-mid);
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.thread-aside { text-align: right; }
.thread-when { white-space: nowrap; }
.thread-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  margin-top: 4px;
}

/* conversation */
.chat-conv {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-conv-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-deep);
}
.chat-conv-head .conv-title { font-size: 15px; font-weight: 700; }
.chat-conv-head .conv-sub   { margin-top: 2px; }
.chat-conv-head .conv-sub code {
  background: transparent;
  color: var(--txt-mid);
  padding: 0;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-deep);
}
.msg {
  max-width: 70%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: msg-in 200ms ease-out;
}
.msg-me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-them {
  align-self: flex-start;
  background: var(--bg-elev);
  color: var(--txt);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 4px;
}
.msg-meta {
  font-size: 10px;
  opacity: 0.75;
  margin-top: 4px;
}
.msg-day {
  align-self: center;
  color: var(--txt-dim);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 6px 0;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* composer */
.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-elev);
}
.chat-composer textarea {
  background: var(--bg-deep);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.chat-composer textarea:focus { border-color: var(--accent); }
.chat-composer .btn { align-self: stretch; padding: 10px 22px; }

/* ============ Responsive ============ */

@media (max-width: 880px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .side-nav { display: flex; overflow-x: auto; padding: 8px; }
  .side-link { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .side-link.active { border-left: none; border-bottom-color: var(--accent); }
  .side-foot { display: none; }
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-threads { max-height: 260px; }
  .chat-conv { min-height: 480px; }

  /* Login: collapse the split into a stacked layout. */
  .login-body { flex-direction: column; }
  .login-left { flex: 0 0 auto; min-height: 220px; padding: 30px 20px; }
  .login-right { flex: 1 1 auto; border-left: none; border-top: 1px solid var(--line-soft); }
  .login-hero-title { font-size: 32px; }
  .login-hero-sub { font-size: 14px; margin-bottom: 20px; }
}
