/*
File: public/app.css
Project: magify-twilio
Version: v1.0.0
Updated: 2026-01-28 America/Jamaica
Signature: Nova, Senior Developer
*/

:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121a;
  --border:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.62);
  --chip:rgba(255,255,255,.10);
  --btn:rgba(255,255,255,.14);
  --btn2:rgba(255,255,255,.08);
  --danger:#ff6b6b;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}

.brand-title{font-weight:700; letter-spacing:.2px}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}

.actions{display:flex; gap:10px}

.layout{
  display:grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 58px);
}

.threads{
  border-right:1px solid var(--border);
  background:var(--panel2);
  padding:12px;
}

.panel-title{
  font-size:12px;
  color:var(--muted);
  margin:4px 0 10px;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.thread-list{display:flex; flex-direction:column; gap:8px}

.thread{
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  border-radius:12px;
  padding:10px 10px;
  cursor:pointer;
}
.thread:hover{background:rgba(255,255,255,.05)}
.thread.active{outline:2px solid rgba(255,255,255,.18)}

.thread-top{display:flex; align-items:center; justify-content:space-between; gap:10px}
.thread-contact{font-weight:650; font-size:13px}
.thread-time{color:var(--muted); font-size:12px}
.thread-preview{color:var(--muted); font-size:12px; margin-top:6px}
.thread-unread{
  background:var(--chip);
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
}

.chat{display:flex; flex-direction:column; min-width:0}
.chat-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:var(--panel);
}
.chat-contact{font-weight:700}
.chat-meta{color:var(--muted); font-size:12px; margin-top:4px}
.badge{
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  background:var(--chip);
  color:var(--text);
}

.messages{
  padding:14px;
  overflow:auto;
  flex:1;
}

.msg{
  max-width: 720px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 10px;
  margin: 0 0 10px;
  background: rgba(255,255,255,.03);
}
.msg.outbound{margin-left:auto; background: rgba(255,255,255,.06)}
.msg-meta{
  display:flex;
  gap:10px;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
  margin-bottom:6px;
}
.msg-body{white-space:pre-wrap; font-size:14px; line-height:1.35}

.composer{
  border-top:1px solid var(--border);
  background:var(--panel);
  padding:12px;
}
.composer-row{
  display:flex;
  gap:10px;
  margin-bottom:10px;
}
.input, .textarea{
  width:100%;
  background:rgba(255,255,255,.05);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 10px;
  color:var(--text);
  outline:none;
}
.textarea{min-height:90px; resize:vertical}

.template-vars{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin-bottom:10px;
}

.btn{
  background:var(--btn);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.18)}
.btn-ghost{background:var(--btn2)}
.btn-primary{
  background:rgba(255,255,255,.20);
  font-weight:700;
}
.btn:disabled{opacity:.5; cursor:not-allowed}

.composer-actions{display:flex; justify-content:flex-end}

.error{
  color:var(--danger);
  font-size:12px;
  margin-top:8px;
  min-height:16px;
}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr}
  .threads{border-right:none; border-bottom:1px solid var(--border)}
}
