/* Estilo compartido del SaaS (paneles /super y /admin). */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #0f1115; color: #e6e6e6; }
body.app { height: 100vh; display: flex; flex-direction: column; } /* layout del panel /admin */
a { color: #7aa7ff; }
h1, h2, h3 { margin: .3em 0; }

input, select, button, textarea {
  font: inherit; background: #14161c; color: #e6e6e6;
  border: 1px solid #2a2f3a; border-radius: 8px; padding: 8px;
}
input, textarea { width: 100%; }
button { background: #2b5bd7; border: 0; cursor: pointer; }
button.sec { background: #2a2f3a; }
button.danger { background: #7a2b2b; }
.muted { color: #888; font-size: 13px; }
code { background: #0b0d11; padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }

/* Barra superior */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; height: 52px; border-bottom: 1px solid #222; background: #14161c; }
.tabs button { padding: 5px 12px; margin-left: 6px; border-radius: 16px; }
.tabs button.on { background: #2b5bd7; }
.tabs button.off { background: #2a2f3a; }

/* Login */
#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #0f1115; z-index: 9; }
.box { width: 340px; background: #14161c; border: 1px solid #222; border-radius: 14px; padding: 24px; }
.box input { margin-top: 10px; }
.box button { width: 100%; margin-top: 14px; }
#err { color: #ff8080; font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

/* Tarjetas */
.card { background: #14161c; border: 1px solid #222; border-radius: 10px; padding: 12px; margin-bottom: 14px; }

/* ---- Panel superadmin ---- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #1d1f27; vertical-align: top; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.pill.on { background: #1c3a24; color: #8fe0a6; }
.pill.off { background: #3a1c1c; color: #e08f8f; }

/* ---- Panel del cliente (/admin) ---- */
.body { flex: 1; display: flex; min-height: 0; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.main { border-right: 1px solid #222; }
.manage { overflow: auto; padding: 12px; background: #0d0f13; border-right: 1px solid #222; }
.play { background: #101218; }
#chat, #results, #listbody, #pgchat { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; line-height: 1.4; }
.me { align-self: flex-end; background: #2b5bd7; }
.bot { align-self: flex-start; background: #1b1e26; border: 1px solid #2a2f3a; }
.src { font-size: 12px; color: #9aa; background: #14161c; border: 1px solid #222; border-radius: 8px; padding: 6px 8px; }
form.row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #222; }
.bar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #222; align-items: center; }
.litem { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #1d1f27; padding: 10px 12px; }
.litem .txt { flex: 1; min-width: 0; overflow: hidden; }
.litem .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.litem small { display: block; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.litem input[type=checkbox] { flex: none; margin: 0; }
.litem button { flex: none; }
