/* WhatsApp Server – estilos compartidos */
:root {
  --green: #25D366;
  --green-d: #128C7E;
  --teal: #075E54;
  --bg: #ECE5DD;
  --text: #222;
  --muted: #666;
  --border: #e3e3e3;
  --danger: #C0392B;
  --warn: #F39C12;
  --ok: #27AE60;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Auth */
.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card { max-width: 380px; width: 100%; }
.brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; color: var(--teal); font-weight: 700; font-size: 18px;
}
h1 { font-size: 20px; margin: 0 0 18px; color: var(--teal); text-align: center; }

.card {
  background: #fff; border-radius: 10px; padding: 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

label { display:block; font-size: 12px; font-weight: 600; margin: 12px 0 4px; color: #444; }
input, textarea, select {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
button {
  background: var(--green); color: #fff; border: 0; padding: 11px 16px;
  border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s;
}
button:hover:not(:disabled) { background: var(--green-d); }
button:disabled { background: #999; cursor: not-allowed; }
button.secondary { background: #555; }
button.secondary:hover:not(:disabled) { background: #333; }
button.danger { background: var(--danger); }
button.full { width: 100%; }

/* Layout panel */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--teal); color: #fff; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { color: #fff; margin: 0; font-size: 17px; }
.topbar .user { font-size: 13px; opacity: .9; }
.topbar button { background: rgba(255,255,255,.15); }
.topbar button:hover { background: rgba(255,255,255,.3); }

main {
  max-width: 1100px; width: 100%; margin: 0 auto;
  padding: 22px; display: grid; gap: 22px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.section h2 { margin: 0 0 14px; font-size: 16px; color: var(--teal); }
.section .desc { color: var(--muted); font-size: 13px; margin: -8px 0 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #fafafa; font-weight: 600; color: #555; }
tr:hover td { background: #fafafa; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
}
.pill.connected { background: #D4EDDA; color: #155724; }
.pill.qr, .pill.connecting { background: #FFF3CD; color: #856404; }
.pill.disconnected, .pill.logged_out { background: #F8D7DA; color: #721C24; }
.pill.sent { background: #D4EDDA; color: #155724; }
.pill.error { background: #F8D7DA; color: #721C24; }

.alert { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-top: 10px; }
.alert.ok { background: #D4EDDA; color: #155724; }
.alert.err { background: #F8D7DA; color: #721C24; }
.alert.warn { background: #FFF3CD; color: #856404; }

.qr-box {
  background: #f6f6f6; border-radius: 10px; padding: 14px; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.qr-box img { max-width: 100%; height: auto; }

.kv { display: flex; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.kv b { min-width: 110px; color: #555; }
.mono {
  font-family: Consolas, monospace; background: #f3f3f3; padding: 4px 8px;
  border-radius: 4px; font-size: 12px; user-select: all; word-break: break-all;
}
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.spinner { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

/* Password con ojito */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye {
  position: absolute; right: 4px; bottom: 4px;
  width: 32px; height: 32px; padding: 0;
  background: transparent; color: #555; border: 0;
  font-size: 16px; cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.pw-eye:hover:not(:disabled) { background: #eee; color: var(--teal); }
