/* RESET BÁSICO */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.4;
}

/* LAYOUT */
.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  background: #0b1222;
  border-bottom: 1px solid #1e293b;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { height: 36px; width: auto; display: block; }
.topbar h1 { font-size: 18px; font-weight: 600; color: #ffffff; }
.nav a { color: #93c5fd; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.nav a:hover { background: rgba(147,197,253,0.12); }

.card {
  background: #0b1222;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.card h2 { font-size: 18px; margin-bottom: 12px; color: #ffffff; }

.grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid.two { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: #a1a1aa; font-size: 13px; }
.field input, .field select, .field textarea {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}
.field input:focus, .field textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

.btn {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all .15s ease;
  font-weight: 600;
}
.btn:hover { transform: translateY(-1px); background: #273244; }
.btn.primary { background: #2563eb; border-color: #1d4ed8; }
.btn.primary:hover { background: #1d4ed8; }
.btn.success { background: #16a34a; border-color: #15803d; }
.btn.success:hover { background: #15803d; }
.btn.warn { background: #d97706; border-color: #b45309; }
.btn.error { background: #dc2626; border-color: #b91c1c; }

.hint { color: #94a3b8; font-size: 13px; margin-top: 8px; }

.hidden { display: none !important; }

.client-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* MENSAGENS */
.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 350px; overflow: auto; background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 10px; }
.msg { max-width: 80%; padding: 10px 12px; border-radius: 10px; background: #0b1222; border: 1px solid #1e293b; }
.msg.left { align-self: flex-start; background: #0b1222; }
.msg.right { align-self: flex-end; background: #133a1f; border-color: #14532d; }
.msg .msg-text { color: #e2e8f0; }
.msg .msg-meta { color: #94a3b8; font-size: 12px; margin-top: 6px; }
.msg.empty { align-self: center; background: transparent; border: none; color: #94a3b8; }

.msg-send { display: flex; gap: 8px; margin-top: 10px; }
.msg-send input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e2e8f0;
}

/* STATS / LOG */
.stat { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 12px; }
.stat-label { color: #94a3b8; font-size: 13px; }
.stat-value { color: #e2e8f0; font-size: 22px; font-weight: 700; margin-top: 6px; }
.log-box {
  background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; white-space: pre-wrap;
}

/* TOAST */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(120%);
  background: #1f2937; color: #e5e7eb; border: 1px solid #374151; padding: 10px 14px; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); transition: transform .2s ease; z-index: 9999;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #14532d; border-color: #15803d; }
.toast.error { background: #7f1d1d; border-color: #991b1b; }
.toast.warn { background: #78350f; border-color: #92400e; }

/* RESPONSIVO */
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .client-info { grid-template-columns: 1fr; }
  .brand h1 { font-size: 16px; }
}