/* ============================================================
   MarkintAI Platform — interfaz tipo WhatsApp con la identidad
   real de MarkintAI: teal/turquesa sobre fondos oscuros con
   degradados (mismo sistema de diseño que markintai.com).
   ============================================================ */

:root {
  /* — sistema de diseño MarkintAI (idéntico al sitio web) — */
  --bg: #03080D;
  --bg2: #06202E;
  --panel: rgba(255,255,255,.05);
  --panel-2: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.10);
  --text: #EAF6F8;
  --muted: #90A8AE;
  --teal: #009DA4;
  --teal-bright: #00B1B9;
  --teal-deep: #004A74;
  --teal-glow: #00C2CB;      /* acento de texto (el #4FE0E8 del logo queda solo para glows) */
  --grad: linear-gradient(135deg, #00B1B9 0%, #009DA4 52%, #004A74 100%);
  --grad-logo: linear-gradient(140deg, #4FE0E8 0%, #00C2CB 42%, #008A9B 100%);
  --grad-word: linear-gradient(100deg, #6BE7EE 0%, #00C2CB 48%, #009DA4 100%);

  /* — específicos del chat — */
  --bubble-in: rgba(255,255,255,.07);
  --bubble-out: linear-gradient(135deg, rgba(0,177,185,.26) 0%, rgba(0,157,164,.20) 55%, rgba(0,74,116,.28) 100%);
  --bubble-out-solid: #0b3a44;
  --tick-read: #00C2CB;
  --danger: #ff7a7a;
  --ok: #3BD68A;             /* verde de éxito (el mismo del sitio) */
  --warm: #FFC55A;           /* ámbar de avisos (el mismo del sitio) */
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  color: var(--text);
  /* mismo fondo que markintai.com: glows teal radiales + degradado oscuro */
  background:
    radial-gradient(1100px 760px at 85% -10%, rgba(0,157,164,.22), transparent 60%),
    radial-gradient(1000px 720px at -8% 110%, rgba(0,177,185,.14), transparent 60%),
    linear-gradient(160deg, var(--bg2), var(--bg) 72%) fixed;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::placeholder { color: rgba(144,168,174,.7); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(79,224,232,.35); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Estructura de 3 columnas ---------- */

.app {
  display: flex;
  height: 100vh;
  max-width: 1700px;
  margin: 0 auto;
  background: rgba(3,8,13,.55);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* ---------- Columna izquierda ---------- */

.left {
  width: 380px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.left-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,177,185,.12), rgba(0,177,185,.02));
  border-bottom: 1px solid var(--border);
}
.brand-mark { width: 34px; height: auto; filter: drop-shadow(0 0 8px rgba(0,194,203,.35)); }
.brand-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: 1.6px; text-transform: uppercase;
  background: var(--grad-word);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #00C2CB;
}
.brand-name span { font-weight: 400; }
.left-actions { margin-left: auto; display: flex; gap: 6px; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: .2s;
}
.icon-btn:hover { background: var(--panel-2); border-color: rgba(0,194,203,.45); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.send-btn svg { width: 19px; height: 19px; fill: currentColor; }

.hotel-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.hotel-bar select {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #0a1922;
  color: var(--text);
  outline: none;
}
.hotel-bar select:focus { border-color: var(--teal-bright); }
.hotel-unread {
  background: var(--grad); color: #00232E;
  border-radius: 12px; padding: 2px 9px; font-size: 12px; font-weight: 700;
}

.search-bar { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.search-bar input {
  width: 100%;
  border: 1px solid transparent;
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 12px;
  outline: none;
  color: var(--text);
}
.search-bar input:focus { border-color: rgba(79,224,232,.4); }

.chat-list { flex: 1; overflow-y: auto; }
.empty-note { padding: 30px 20px; text-align: center; color: var(--muted); line-height: 1.5; }

.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.chat-item:hover { background: var(--panel); }
.chat-item.active {
  background: linear-gradient(90deg, rgba(0,177,185,.16), rgba(0,177,185,.04));
  box-shadow: inset 3px 0 0 var(--teal-bright);
}

.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #EAF6F8; font-weight: 700; font-size: 17px;
  flex-shrink: 0;
  user-select: none;
}
.avatar svg { width: 52%; height: 52%; fill: currentColor; opacity: .9; }

.chat-item .mid { flex: 1; min-width: 0; }
.chat-item .row1 { display: flex; justify-content: space-between; gap: 8px; }
.chat-item .name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.chat-item .row2 { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; }
.chat-item .preview {
  color: var(--muted); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item .badge {
  background: var(--grad); color: #00232E;
  min-width: 20px; height: 20px; border-radius: 10px;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 6px; flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0,194,203,.35);
}
.chat-item.unread .preview { color: var(--text); font-weight: 600; }
.etapa-chip {
  font-size: 10.5px; font-weight: 600;
  color: var(--teal-glow);
  background: rgba(0,177,185,.12);
  border: 1px solid rgba(0,177,185,.28);
  border-radius: 999px;
  padding: 0 7px;
  max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

.left-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  color: #9FB3BD; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Columna central: chat (clara, estilo WhatsApp) ----------
   El resto de la interfaz mantiene la marca oscura; la conversación se lee
   como WhatsApp: fondo claro, y si el hotel tiene foto, dos capas
   (imagen + velo blanco) como papel tapiz. */

.chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #eef2f3;
  color: #111b21;
  position: relative;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: #667781;
  padding: 40px;
}
.chat-empty img { width: 300px; max-width: 72%; filter: drop-shadow(0 2px 14px rgba(0,157,164,.25)); }
.chat-empty h2 {
  margin: 20px 0 6px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600; letter-spacing: 4px; font-size: 15px;
  color: #1e6a78; text-transform: uppercase;
}
.chat-empty p { line-height: 1.6; }

.chat-view { display: flex; flex-direction: column; height: 100%; position: relative; }

/* Capas del fondo del chat (día): foto del hotel + velo blanco */
.chat-view::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(rgba(0,157,164,.06) 1.2px, transparent 1.2px),
    #e9e2d8;
  background-size: 24px 24px, cover;
  z-index: 0;
}
.chat-view.has-wallpaper::before {
  background-image:
    linear-gradient(rgba(255,255,255,.82), rgba(255,255,255,.82)),
    var(--wallpaper);
  background-size: cover, cover;
  background-position: center, center;
}
/* Marca de agua: el isotipo MarkintAI al centro (teal de día, blanco de noche) */
.chat-view::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: min(280px, 55%); height: 240px;
  background: url(/assets/mark.png) center/contain no-repeat;
  opacity: .16;
  z-index: 0;
  pointer-events: none;
}

/* Encabezado y pie SIEMPRE con la marca MarkintAI (día y noche) */
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px;
  background: linear-gradient(180deg, rgba(4,24,34,.97), rgba(6,32,46,.95));
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  position: relative; z-index: 2;
}
.chat-head .avatar { width: 40px; height: 40px; font-size: 15px; cursor: pointer; }
.chat-title { flex: 1; min-width: 0; cursor: pointer; }
.chat-title .name { font-weight: 600; color: #EAF6F8; }
.chat-title .sub { font-size: 12.5px; color: #90A8AE; }
.back-btn { display: none; background: rgba(255,255,255,.08); border-color: transparent; color: #EAF6F8; }
.info-btn {
  border: 1px solid rgba(255,255,255,.18);
  color: #EAF6F8;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
}
.info-btn:hover { border-color: rgba(0,194,203,.5); background: rgba(0,177,185,.14); }
.info-btn.active { background: var(--grad); color: #00232E; border-color: transparent; }

.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 22px 7% 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1; /* las burbujas van sobre el fondo y la marca de agua */
}

.day-sep {
  align-self: center;
  background: #fff;
  border: none;
  color: #667781;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  margin: 12px 0 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}

.sys-chip {
  align-self: center;
  background: #fdf3d7;
  border: 1px solid #f0e0b0;
  color: #7a6a34;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 10px;
  margin: 6px 0;
  max-width: 80%;
  text-align: center;
}

.msg { display: flex; flex-direction: column; max-width: 68%; }
.msg.in  { align-self: flex-start; align-items: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg + .msg { margin-top: 2px; }
.msg.first { margin-top: 8px; }

.bubble {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 6px 9px 7px;
  min-width: 90px;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.10);
  color: #111b21;
}
.msg.out .bubble { background: #d4f0f3; }
.msg.first.in  .bubble { border-top-left-radius: 3px; }
.msg.first.out .bubble { border-top-right-radius: 3px; }
.bubble.sticker-bubble { background: transparent; box-shadow: none; padding: 0; min-width: 0; }

.sender-tag { font-size: 12px; font-weight: 700; color: #087b8a; margin-bottom: 2px; }
.fwd-tag { font-size: 12px; color: #667781; font-style: italic; margin-bottom: 2px; }
.type-tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  color: #087b8a;
  background: rgba(0,157,164,.12);
  border: 1px solid rgba(0,157,164,.25);
  border-radius: 6px;
  padding: 1px 7px;
  margin-bottom: 3px;
}

.quote {
  border-left: 3px solid var(--teal);
  background: rgba(0,0,0,.06);
  border-radius: 7px;
  padding: 5px 9px;
  margin-bottom: 4px;
  font-size: 13px;
  cursor: default;
}
.quote .q-who { font-weight: 700; color: #087b8a; font-size: 12px; }
.quote .q-text { color: #667781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }

.body-text { white-space: pre-wrap; line-height: 1.45; }
.bubble .body-text a { color: #087b8a; }
.caption { white-space: pre-wrap; margin-top: 4px; line-height: 1.45; }

.meta {
  display: flex; align-items: center; gap: 4px;
  justify-content: flex-end;
  font-size: 11px;
  color: #667781;
  margin-top: 3px;
  user-select: none;
}
.tick { letter-spacing: -2px; font-size: 13px; color: #8696a0; }
.tick.read { color: #009DA4; }
.tick.failed { color: #d84f4f; letter-spacing: 0; }
.err-line { color: #d84f4f; font-size: 12px; margin-top: 3px; }

.media-img, .media-video {
  max-width: 330px; max-height: 340px;
  width: 100%;
  border-radius: 8px;
  display: block;
  cursor: pointer;
}
.media-video { cursor: default; }
.sticker-img { width: 150px; height: auto; display: block; }
.media-audio { width: 280px; max-width: 100%; display: block; margin-top: 2px; }
.voice-row { display: flex; align-items: center; gap: 8px; }
.voice-row .mic { font-size: 20px; }

.media-pending, .media-failed {
  border-radius: 8px;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.08);
  display: inline-flex; align-items: center; gap: 8px;
  color: #667781; font-size: 13px;
  padding: 10px 14px;
  max-width: 280px;
}
.media-failed { color: #8a6d3b; border-color: rgba(240,173,78,.5); }

.doc-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: #111b21;
  max-width: 330px;
  transition: .2s;
}
.doc-card:hover { background: rgba(0,157,164,.10); border-color: rgba(0,157,164,.35); }
.doc-card .ic { font-size: 26px; }
.doc-card .fn { font-weight: 600; word-break: break-all; font-size: 13.5px; }
.doc-card .hint { font-size: 12px; color: #087b8a; }

.loc-card {
  display: block;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: #111b21;
  max-width: 330px;
  transition: .2s;
}
.loc-card:hover { background: rgba(0,157,164,.10); border-color: rgba(0,157,164,.35); }
.loc-card .ln { font-weight: 600; }
.loc-card .la { font-size: 12.5px; color: #667781; }
.loc-card .lc { font-size: 12px; color: #087b8a; margin-top: 3px; }

.data-card {
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 9px 12px;
  max-width: 360px;
  font-size: 13.5px;
}
.data-card .dc-title { font-weight: 700; margin-bottom: 4px; color: #087b8a; }
.data-card .kv { display: flex; gap: 6px; margin: 2px 0; }
.data-card .kv .k { color: #667781; flex-shrink: 0; }
.data-card .kv .v { word-break: break-word; }

.reactions {
  display: flex; gap: 4px;
  margin-top: -7px;
  z-index: 1;
  padding: 0 6px;
}
.reaction-pill {
  background: #fff;
  border: 1px solid #d9dee1;
  border-radius: 12px;
  font-size: 13px;
  padding: 1px 7px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.unsupported { color: #667781; font-style: italic; }

/* ---------- Modo noche del chat 🌙 ----------
   Misma foto del hotel de fondo, pero con velo azul-oscuro de marca
   en lugar del velo blanco; burbujas y controles en oscuro. */

.chat.night { background: linear-gradient(160deg, var(--bg2), var(--bg) 72%); color: var(--text); }
.chat.night .chat-empty { color: var(--muted); }
.chat.night .chat-empty h2 { color: var(--text); }
.chat.night .chat-empty img { filter: brightness(0) invert(1) drop-shadow(0 0 18px rgba(0,194,203,.30)); }
.chat.night .chat-view::before {
  background:
    radial-gradient(rgba(0,194,203,.05) 1.2px, transparent 1.2px),
    linear-gradient(160deg, #04121b, var(--bg) 70%);
  background-size: 24px 24px, cover;
}
.chat.night .chat-view.has-wallpaper::before {
  background-image:
    linear-gradient(rgba(4,17,25,.80), rgba(3,8,13,.88)),
    var(--wallpaper);
  background-size: cover, cover;
  background-position: center, center;
}
/* marca de agua en blanco durante la noche */
.chat.night .chat-view::after {
  filter: brightness(0) invert(1);
  opacity: .10;
}

.chat.night .day-sep { background: var(--panel); border: 1px solid var(--border); color: var(--muted); box-shadow: none; }
.chat.night .sys-chip { background: rgba(255,197,90,.10); border-color: rgba(255,197,90,.28); color: var(--warm); }

.chat.night .bubble { background: rgba(13,30,40,.94); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.chat.night .msg.out .bubble { background: linear-gradient(135deg, #0c4550, #0a3644 60%, #0a3148); }
.chat.night .sender-tag, .chat.night .quote .q-who,
.chat.night .doc-card .hint, .chat.night .loc-card .lc, .chat.night .data-card .dc-title { color: var(--teal-glow); }
.chat.night .type-tag { color: var(--teal-glow); background: rgba(0,177,185,.16); border-color: rgba(0,177,185,.30); }
.chat.night .quote { background: rgba(0,0,0,.35); border-left-color: var(--teal-bright); }
.chat.night .quote .q-text, .chat.night .meta, .chat.night .fwd-tag, .chat.night .unsupported,
.chat.night .data-card .kv .k, .chat.night .loc-card .la { color: #9FB3BD; }
.chat.night .tick { color: rgba(234,246,248,.55); }
.chat.night .tick.read { color: #00C2CB; text-shadow: 0 0 6px rgba(0,194,203,.5); }
.chat.night .bubble .body-text a { color: var(--teal-glow); }
.chat.night .doc-card, .chat.night .loc-card, .chat.night .data-card {
  background: rgba(0,0,0,.30); border-color: rgba(255,255,255,.10); color: var(--text);
}
.chat.night .doc-card:hover, .chat.night .loc-card:hover { background: rgba(0,177,185,.12); border-color: rgba(0,194,203,.4); }
.chat.night .media-pending, .chat.night .media-failed { background: rgba(0,0,0,.30); border-color: rgba(255,255,255,.12); color: #C9DDE2; }
.chat.night .reaction-pill { background: #0d2733; border-color: rgba(0,194,203,.35); color: var(--text); }


/* ---------- Compositor ---------- */

.composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(6,32,46,.95), rgba(4,24,34,.97));
  border-top: 1px solid rgba(255,255,255,.10);
  position: relative; z-index: 2;
}
.composer textarea {
  flex: 1;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  max-height: 130px;
  background: rgba(3,8,13,.55);
  color: #EAF6F8;
  line-height: 1.4;
}
.composer textarea:focus { border-color: rgba(0,194,203,.5); }
.composer ::placeholder { color: rgba(144,168,174,.75); }
.send-btn {
  border: none;
  background: var(--grad);
  color: #00232E;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0,177,185,.25);
  transition: .25s;
}
.send-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,177,185,.35); }
.send-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* ---------- Panel "Más info" ---------- */

.info-panel {
  width: 360px;
  min-width: 300px;
  border-left: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  display: flex;
  flex-direction: column;
}
.info-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,177,185,.14), rgba(0,177,185,.03));
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
}
.info-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }

.info-hero {
  padding: 26px 16px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.info-hero .avatar {
  width: 110px; height: 110px;
  font-size: 40px;
  margin: 0 auto 12px;
  box-shadow: 0 0 26px rgba(0,194,203,.30);
}
.info-hero .in-name { font-size: 19px; font-weight: 600; }
.info-hero .in-num { color: var(--muted); margin-top: 3px; }

.info-section {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 10px;
  padding: 12px 18px;
}
.info-section h4 {
  margin: 0 0 8px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--teal-glow);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.info-row { padding: 6px 0; }
.info-row .k { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 1px; }
.info-row .v { display: block; font-weight: 600; }

.etapa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.etapa-pill {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  transition: .2s;
}
.etapa-pill:hover { border-color: rgba(0,194,203,.45); color: var(--text); }
.etapa-pill.active { background: var(--grad); color: #00232E; border-color: transparent; }

.info-section input, .info-section textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  background: rgba(3,8,13,.6);
  color: var(--text);
}
.info-section textarea { resize: vertical; min-height: 70px; }
.info-section input:focus, .info-section textarea:focus { border-color: rgba(79,224,232,.5); }
.save-btn {
  margin-top: 8px;
  border: none;
  background: var(--grad);
  color: #00232E;
  border-radius: 999px;
  padding: 8px 18px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,177,185,.25);
  transition: .25s;
}
.save-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,177,185,.35); }
.save-ok { color: var(--teal-glow); font-size: 12.5px; margin-left: 10px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-box {
  background: rgba(0,177,185,.10);
  border: 1px solid rgba(0,177,185,.22);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.stat-box .n {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px; font-weight: 700;
  background: var(--grad-word);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #00C2CB;
}
.stat-box .l { font-size: 12px; color: var(--muted); }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(820px 420px at 75% 12%, rgba(0,177,185,.16), transparent 60%),
    radial-gradient(680px 420px at 18% 88%, rgba(0,74,116,.22), transparent 60%),
    linear-gradient(160deg, var(--bg2), var(--bg) 72%);
  padding: 20px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 38px 34px;
  width: 100%;
  max-width: 390px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 0 40px rgba(0,157,164,.10);
  text-align: center;
}
.login-mark { width: 64px; display: block; margin: 0 auto 10px; filter: drop-shadow(0 0 16px rgba(0,194,203,.4)); }
.login-logo { width: 210px; max-width: 88%; filter: drop-shadow(0 0 14px rgba(0,194,203,.3)); }
.login-card h1 {
  margin: 10px 0 4px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--text);
  letter-spacing: 6px; text-transform: uppercase;
}
.login-card .sub { color: var(--muted); margin: 0 0 24px; }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card label { display: block; font-size: 13px; color: #B8C4CC; margin-bottom: 5px; }
.login-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  background: rgba(3,8,13,.6);
  color: var(--text);
}
.login-card input:focus { border-color: rgba(79,224,232,.5); box-shadow: 0 0 10px rgba(0,194,203,.15); }
.btn-primary {
  width: 100%;
  border: none;
  background: var(--grad);
  color: #00232E;
  border-radius: 999px;
  padding: 12px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-top: 6px;
  transition: .25s;
  box-shadow: 0 10px 30px rgba(0,177,185,.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,177,185,.35); }
.error-msg { color: var(--danger); font-size: 13.5px; min-height: 18px; margin: 12px 0 0; }

/* ---------- Modal de administración ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3,8,13,.86);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
  padding: 20px;
}
.modal {
  background: #071824;
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.mhead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0,177,185,.16), rgba(0,177,185,.04));
  border-bottom: 1px solid var(--border);
}
.mhead h3 { margin: 0; font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 16px; }
.mini-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}
.mini-btn:hover { border-color: rgba(79,224,232,.5); }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  border: none; background: none;
  padding: 11px 20px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--teal-glow); border-bottom-color: var(--teal-bright); }
.tab-body { overflow-y: auto; padding: 16px 20px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left; padding: 8px; color: var(--muted);
  border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
}
.admin-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.admin-table .url-cell { font-family: monospace; font-size: 12px; color: var(--teal-glow); }
.url-text {
  display: inline-block; max-width: 165px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: bottom;
}
.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.on { background: rgba(59,214,138,.12); border: 1px solid rgba(59,214,138,.4); color: var(--ok); }
.pill.off { background: rgba(255,122,122,.12); border: 1px solid rgba(255,122,122,.35); color: var(--danger); }
.pill.warn { background: rgba(255,197,90,.12); border: 1px solid rgba(255,197,90,.4); color: var(--warm); }

.admin-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}
.admin-form h4 { margin: 0 0 10px; font-family: 'Space Grotesk', 'Inter', sans-serif; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.admin-form label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.admin-form input, .admin-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  outline: none;
  background: rgba(3,8,13,.6);
  color: var(--text);
}
.admin-form input:focus { border-color: rgba(79,224,232,.5); }
.admin-form input:disabled { opacity: .5; }
.form-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.form-msg { font-size: 13px; }
.form-msg.ok { color: var(--ok); }
.form-msg.bad { color: var(--danger); }

.link-btn { border: none; background: none; color: var(--teal-glow); font-weight: 600; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* ---------- Utilitarios ---------- */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(3,8,13,.93);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 0 60px rgba(0,194,203,.2); }

.conn-banner {
  position: fixed;
  top: 0; left: 50%;
  transform: translate(-50%, -110%);
  background: #06202E;
  border: 1px solid rgba(255,197,90,.45);
  color: #FFD98A;
  padding: 8px 22px;
  border-radius: 0 0 12px 12px;
  font-size: 13.5px;
  z-index: 70;
  transition: transform .3s;
}
.conn-banner.show { transform: translate(-50%, 0); }

.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  background: #0d2733;
  border: 1px solid rgba(79,224,232,.35);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.toast.show { opacity: 1; }

/* ---------- Responsive (móvil) ---------- */

@media (max-width: 1180px) {
  .info-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; background: #071824; box-shadow: -10px 0 30px rgba(0,0,0,.5); }
  .app { position: relative; }
}

@media (max-width: 860px) {
  .left { width: 100%; min-width: 0; }
  .chat { display: none; }
  .app.chat-open .left { display: none; }
  .app.chat-open .chat { display: flex; }
  .back-btn { display: inline-flex; }
  .msgs { padding: 14px 4% 10px; }
  .msg { max-width: 84%; }
  .info-panel { width: 100%; min-width: 0; }
}
