/* ── netmind person web · hyper-modern dark ─────────────────────────── */

:root {
  --bg: #07070c;
  --bg-2: #0c0c14;
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .07);
  --stroke: rgba(255, 255, 255, .09);
  --stroke-2: rgba(255, 255, 255, .16);
  --text: #f2f2f8;
  --text-2: #a2a3b5;
  --text-3: #6d6e82;
  --acc: #8b5cf6;      /* violet */
  --acc-2: #22d3ee;    /* cyan */
  --acc-3: #f472b6;    /* pink */
  --grad: linear-gradient(135deg, var(--acc), var(--acc-2));
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --font: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
img { display: block; }

#app { display: flex; height: 100dvh; }

/* ══ Sidebar ══ */
#sidebar {
  width: 300px;
  min-width: 300px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--stroke);
  z-index: 40;
}
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 18px 12px;
}
.brand {
  font-weight: 800; font-size: 17px; letter-spacing: .4px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: flex; align-items: center; gap: 8px;
}
.brand-glyph { -webkit-text-fill-color: initial; color: var(--acc-2); font-size: 15px; }

.new-persona {
  margin: 4px 14px 10px;
  padding: 13px 16px;
  display: flex; align-items: center; gap: 10px;
  background: var(--grad);
  border-radius: var(--r-md);
  font-weight: 650; font-size: 14.5px; color: #fff;
  box-shadow: 0 8px 24px rgba(139, 92, 246, .35);
  transition: transform .15s ease, box-shadow .2s ease;
}
.new-persona:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(139, 92, 246, .5); }
.new-persona:active { transform: translateY(0); }
.np-plus { font-size: 17px; font-weight: 700; }

.home-item {
  margin: 0 14px 4px;
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--stroke);
  font-weight: 650; font-size: 14px; color: var(--text);
  transition: background .15s, border-color .15s;
}
.home-item:hover { background: var(--panel-2); border-color: var(--stroke-2); }
.side-sep {
  padding: 10px 22px 6px;
  font-size: 10.5px; letter-spacing: 1.4px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
}

.persona-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.persona-list::-webkit-scrollbar { width: 4px; }
.persona-list::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 4px; }

.p-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  transition: background .15s ease;
  text-align: left;
  overflow: hidden;
}
.p-item:hover { background: var(--panel); }
.p-item.active { background: var(--panel-2); outline: 1px solid var(--stroke-2); }
.p-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  object-fit: cover; background: linear-gradient(135deg, #2a2a3a, #1a1a28);
  outline: 1px solid var(--stroke);
  flex-shrink: 0;
}
.p-meta {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 1px;
}
.p-name {
  display: block; min-width: 0;
  font-weight: 650; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.p-tag {
  display: block; min-width: 0;
  font-size: 12px; line-height: 1.35; color: var(--text-3);
  word-break: break-word; overflow-wrap: anywhere;
}

.side-foot {
  padding: 12px 18px;
  font-size: 11.5px; color: var(--text-3);
  border-top: 1px solid var(--stroke);
  display: flex; align-items: center; gap: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }

/* ══ Main panes ══ */
#main { flex: 1; position: relative; min-width: 0; }
.pane { position: absolute; inset: 0; display: none; flex-direction: column; }
.pane.active { display: flex; }

/* ── Home ── */
#home { overflow-y: auto; }
.home-aurora {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(50% 40% at 90% 10%, rgba(34, 211, 238, .1), transparent 60%),
    radial-gradient(40% 40% at 60% 100%, rgba(244, 114, 182, .08), transparent 60%);
}
.home-inner { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) 24px 60px; }
.home-title { font-size: clamp(30px, 5vw, 44px); font-weight: 750; letter-spacing: -.5px; }
.home-title em {
  font-style: normal; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-sub { margin-top: 10px; color: var(--text-2); font-size: 15px; max-width: 480px; line-height: 1.5; }

.home-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.h-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-2);
  outline: 1px solid var(--stroke);
  cursor: pointer;
  transition: transform .2s ease, outline-color .2s ease, box-shadow .25s ease;
  text-align: left;
}
.h-card:hover { transform: translateY(-3px); outline-color: var(--stroke-2); box-shadow: var(--shadow); }
.h-card img {
  width: 100%; aspect-ratio: 4/4.6; object-fit: cover;
  background: linear-gradient(135deg, #221f33, #14121f);
}
.h-card .h-ov {
  position: absolute; inset: auto 0 0 0;
  padding: 34px 14px 13px;
  background: linear-gradient(transparent, rgba(5, 5, 10, .92));
}
.h-card .h-name { display: block; font-weight: 700; font-size: 15.5px; }
.h-card .h-tag {
  display: block; word-break: break-word; overflow-wrap: anywhere;
  font-size: 12px; line-height: 1.35; color: var(--text-2); margin-top: 2px;
}
.h-empty {
  grid-column: 1/-1; padding: 40px; text-align: center;
  color: var(--text-3); border: 1px dashed var(--stroke-2); border-radius: var(--r-lg);
  font-size: 14px;
}

/* ── Chat head ── */
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(12, 12, 20, .75);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--stroke);
  z-index: 5;
}
.chat-avatar-wrap { padding: 0; border-radius: 50%; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  outline: 2px solid var(--stroke-2);
  background: linear-gradient(135deg, #2a2a3a, #1a1a28);
}
.chat-id { flex: 1; min-width: 0; }
.chat-name { font-weight: 700; font-size: 15.5px; }
.chat-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.presence-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* Campanita de push encendida */
.icon-btn.push-on { color: var(--acc-2); }
.icon-btn.push-on::after {
  content: "";
  position: absolute;
  top: 8px; right: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--acc-2);
  box-shadow: 0 0 6px var(--acc-2);
}

/* ── Chat scroll/log ── */
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-log {
  max-width: 780px; margin: 0 auto;
  padding: 22px 16px 10px;
  display: flex; flex-direction: column; gap: 14px;
}

.msg { display: flex; gap: 10px; max-width: 86%; animation: rise .28s cubic-bezier(.2,.8,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  margin-top: auto; flex-shrink: 0;
  outline: 1px solid var(--stroke);
  background: linear-gradient(135deg, #2a2a3a, #1a1a28);
}
.msg-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bubble {
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 14.8px; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}
.msg.user .bubble {
  background: var(--grad);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 20px rgba(139, 92, 246, .25);
}
.msg.persona .bubble {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-bottom-left-radius: 6px;
}

/* media inline */
.media-card {
  border-radius: var(--r-lg); overflow: hidden;
  outline: 1px solid var(--stroke-2);
  background: var(--bg-2);
  max-width: 380px;
  box-shadow: var(--shadow);
}
.msg.user .media-card { align-self: flex-end; }
.media-card img, .media-card video { width: 100%; display: block; max-height: 480px; object-fit: cover; }
.media-card audio { width: 100%; display: block; padding: 10px 12px; margin: 0; }
.media-actions {
  display: flex; gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--stroke);
  background: rgba(10, 10, 18, .55);
}
.m-act {
  font-size: 12px; color: var(--text-2);
  padding: 6px 11px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--stroke);
  text-decoration: none; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.m-act:hover { color: var(--text); border-color: var(--stroke-2); }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; align-items: center; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  animation: pulse 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 70%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
.typing .t-label { margin-left: 6px; font-size: 13px; font-style: italic; color: var(--text-3); white-space: nowrap; }
.msg .bubble.typing .t-label { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Composer ── */
.composer-wrap {
  position: relative;
  padding: 6px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(7, 7, 12, .9) 30%);
}
.chips {
  max-width: 780px; margin: 0 auto 8px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 13px;
  font-size: 12.5px; color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--stroke-2); background: var(--panel-2); }

.composer {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--stroke-2);
  border-radius: 24px;
  padding: 8px;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}
.composer:focus-within { border-color: rgba(139, 92, 246, .6); box-shadow: 0 10px 40px rgba(0, 0, 0, .45), 0 0 0 3px rgba(139, 92, 246, .12); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: none;
  max-height: 140px; min-height: 24px; line-height: 1.5;
  font-size: 15px; padding: 6px 2px;
}
.composer textarea::placeholder { color: var(--text-3); }
.attach, .mic {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 17px;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.attach:hover, .mic:hover { background: var(--panel-2); color: var(--text); }
.mic.recording {
  background: rgba(248, 113, 113, .18); color: #f87171;
  animation: micPulse 1.2s infinite;
}
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .45); } 50% { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); } }

.attach-menu {
  position: absolute; bottom: calc(100% - 92px); left: 14px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 190px;
  background: var(--bg-2); border: 1px solid var(--stroke-2);
  border-radius: 14px; padding: 6px;
  box-shadow: var(--shadow); z-index: 20;
}
.attach-menu[hidden] { display: none; }
.attach-menu button { text-align: left; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.attach-menu button:hover { background: var(--panel-2); }
.attach-preview {
  max-width: 780px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 8px 12px;
  font-size: 13px; color: var(--text-2);
}
.attach-preview[hidden] { display: none; }
.ap-thumb { flex-shrink: 0; display: flex; align-items: center; }
.ap-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; outline: 1px solid var(--stroke-2); }
.ap-thumb audio { height: 34px; max-width: 260px; }
.attach-preview button { color: var(--text-3); font-size: 14px; padding: 2px 6px; }
.attach-preview button:hover { color: #f87171; }

/* lightbox (ver media en grande) */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(4, 4, 8, .9);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  /* iOS: frenar el scroll en cadena para que el toque cierre en vez de scrollear. */
  overscroll-behavior: contain;
  touch-action: manipulation;
  cursor: pointer;
}
.lightbox[hidden] { display: none; }
.lb-body img, .lb-body video {
  max-width: 92vw; max-height: 82dvh;
  border-radius: 14px; outline: 1px solid var(--stroke-2);
  box-shadow: var(--shadow);
}
.lb-body img { cursor: pointer; } /* tap en la foto = cerrar */
.lb-close {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  padding: 12px 18px; border-radius: 999px; /* target táctil ~44px */
  background: rgba(20, 20, 32, .92); border: 1px solid var(--stroke-2);
  color: var(--text); font-size: 13.5px; z-index: 91;
}
.lb-close:hover { background: rgba(30, 30, 46, .95); }
.media-card.zoomable { cursor: zoom-in; }

/* crear: detalle colapsable de lo que ya sabe */
.spec-details { font-size: 13px; color: var(--text-2); }
.spec-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.spec-details .spec-preview { margin-top: 8px; }
.send {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, .4);
  transition: transform .15s, opacity .2s;
}
.send:hover { transform: scale(1.06); }
.send:disabled { opacity: .5; transform: none; cursor: default; }
.send.busy { animation: spinGrad 1s linear infinite; }
@keyframes spinGrad { to { transform: rotate(360deg); } }

/* ══ Modals ══ */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 4, 8, .72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 18px;
}
.modal[hidden] { display: none; }
/* Las confirmaciones de acción van SIEMPRE adelante de todo (admin,
   lightbox, auth): si quedan detrás el usuario no ve el diálogo y la acción
   parece colgada. */
#confirmModal { z-index: 120; }
/* Author display rules (.modal-body, .field…) beat the UA's [hidden] rule —
   this restores hide-ability for every element that toggles the attribute. */
[hidden] { display: none !important; }
.modal-card {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  animation: pop .25s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-card.small { max-width: 380px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0;
}
.modal-head h2 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-hint { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Aceptación 18+ en el registro: checkbox obligatorio con las cláusulas. */
.age-check {
  display: flex; flex-direction: row; align-items: flex-start; gap: 9px;
  font-size: 12px; color: var(--text-2); line-height: 1.45; cursor: pointer;
}
.age-check input[type="checkbox"] {
  width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px;
  accent-color: var(--accent, #7c5cff); cursor: pointer;
}
.age-check b { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field > span { font-weight: 600; color: var(--text-2); font-size: 12.5px; }
.field input, .field textarea {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field textarea:focus {
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}
/* Combos cerrados del wizard — select premium con flecha propia. */
.field select {
  appearance: none; -webkit-appearance: none;
  width: 100%; font: inherit; color: var(--text);
  background-color: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  padding: 11px 38px 11px 13px;
  cursor: pointer; outline: none;
  transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a2a3b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field select:hover { border-color: var(--stroke-2); }
.field select:focus {
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}
.field select option { background: var(--bg-2); color: var(--text); }
.missing-grid .field.is-missing select { border-color: var(--amber, #f5a623); }
.field-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.wide { width: 100%; }

/* Switch del engranaje (notificaciones por persona). */
.switch-row { display: flex; align-items: center; gap: 10px; }
.switch-input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  flex: 0 0 auto;
  width: 42px; height: 24px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--stroke-2);
  position: relative;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform .2s, background .2s;
}
.switch-input:checked + .switch-track { background: var(--acc); border-color: var(--acc); }
.switch-input:checked + .switch-track .switch-knob { transform: translateX(18px); background: #fff; }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--acc-2); outline-offset: 2px; }
.switch-row .field-hint { flex: 1; }

.btn {
  padding: 11px 18px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  font-weight: 600; font-size: 14px;
  transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--stroke-2); background: rgba(255,255,255,.1); }
.btn.primary {
  background: var(--grad); border: 0; color: #fff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, .3);
}
.btn.primary:hover { box-shadow: 0 8px 26px rgba(139, 92, 246, .45); }
.btn.full { width: 100%; }
.btn.danger {
  background: rgba(248, 113, 113, .12);
  border-color: rgba(248, 113, 113, .35); color: #f87171;
}
.btn.danger:hover { background: rgba(248, 113, 113, .22); }
.btn-loader {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spinGrad .7s linear infinite;
  display: inline-block;
}
.btn-loader[hidden] { display: none; }
.form-err { font-size: 13px; color: #f87171; line-height: 1.4; }

.spec-preview {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 12.8px; line-height: 1.55; color: var(--text-2);
  white-space: pre-wrap;
  max-height: 200px; overflow-y: auto;
}

.missing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .missing-grid { grid-template-columns: 1fr; } }
.missing-grid .field.is-missing input { border-color: var(--amber, #f5a623); }
.missing-grid .miss-tag { font-style: normal; font-size: 10px; font-weight: 700; color: var(--amber, #f5a623); text-transform: uppercase; letter-spacing: 0.4px; margin-left: 4px; }

.voice-wrap { display: flex; flex-direction: column; gap: 8px; }
.voice-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-2); }
.voice-list { display: flex; flex-direction: column; gap: 8px; }
.vp-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 12px; cursor: pointer; }
.vp-card:hover { border-color: rgba(255,255,255,0.22); }
.vp-card:has(input:checked) { border-color: var(--accent, #8b5cf6); background: color-mix(in srgb, var(--accent, #8b5cf6) 10%, transparent); }
.vp-card input { accent-color: var(--accent, #8b5cf6); }
.vp-play { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; border: 1px solid var(--line, rgba(255,255,255,0.14)); background: rgba(255,255,255,0.06); color: var(--text-1, #fff); font-size: 12px; cursor: pointer; }
.vp-play:hover { background: rgba(255,255,255,0.14); }
.vp-dot { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, #8b5cf6) 22%, transparent); color: var(--accent-2, #c4b5fd); font-size: 13px; }
.vp-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vp-info b { font-size: 13px; }
.vp-info small { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.knowledge-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.k-item {
  font-size: 12.5px; color: var(--text-2); line-height: 1.45;
  background: var(--panel); border-radius: var(--r-sm); padding: 8px 11px;
}
.k-item b { color: var(--text); font-weight: 650; }
.k-empty { font-size: 12.5px; color: var(--text-3); }

.danger-zone { border-top: 1px solid var(--stroke); padding-top: 14px; margin-top: 4px; }

/* ══ Toast ══ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(20, 20, 32, .95);
  border: 1px solid var(--stroke-2);
  color: var(--text); font-size: 13.5px;
  padding: 11px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: rise .25s ease both;
  max-width: 86vw; text-align: center;
}

/* ── Campanita: badge de no leídas ── */
.notif-badge {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--acc-3);
  color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center;
  box-shadow: 0 0 6px rgba(244, 114, 182, .7);
}

/* ── Banner in-app tipo push (slide arriba → abajo) ── */
.notif-host {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 10px 14px 0;
  z-index: 130; pointer-events: none;
}
.notif-banner {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 440px;
  background: rgba(18, 18, 28, .97);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: notifSlideIn .32s cubic-bezier(.2,.85,.3,1) both;
  transition: transform .3s ease, opacity .3s ease;
}
.notif-banner.dismiss { animation: notifSlideOut .3s ease forwards; }
.notif-banner img.nf-av {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--panel-2);
}
.notif-banner .nf-body { flex: 1; min-width: 0; }
.notif-banner .nf-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-banner .nf-preview { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes notifSlideIn { from { transform: translateY(-120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes notifSlideOut { to { transform: translateY(-120%); opacity: 0; } }

/* ── Bandeja de notificaciones (panel bajo la campanita) ── */
.notif-panel {
  position: fixed; top: 60px; right: 12px;
  width: 340px; max-width: calc(100vw - 24px);
  max-height: 70vh; display: flex; flex-direction: column;
  background: rgba(16, 16, 24, .98);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  z-index: 125;
  overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
}
.notif-panel-head h2 { font-size: 15px; font-weight: 600; }
.notif-toggle-row { padding: 0 16px 10px; }
.notif-toggle-btn {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  transition: background .15s;
}
.notif-toggle-btn:hover { background: var(--stroke-2); }
.notif-toggle-btn.on { color: var(--acc-2); }
.notif-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.notif-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 10px; border-radius: var(--r-sm);
  cursor: pointer; position: relative;
  transition: background .15s;
}
.notif-item:hover { background: var(--panel); }
.notif-item img.nf-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); }
.notif-item .nf-body { flex: 1; min-width: 0; }
.notif-item .nf-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item .nf-preview { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item .nf-time { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.notif-item .nf-del {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--text-3); font-size: 13px; line-height: 24px; text-align: center;
  opacity: 0; transition: opacity .15s, color .15s, background .15s;
}
.notif-item:hover .nf-del { opacity: 1; }
.notif-item .nf-del:hover { background: var(--panel-2); color: var(--text); }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.notif-clear {
  margin: 0 16px 14px; padding: 10px; border-radius: var(--r-sm);
  border: 1px solid var(--stroke); color: var(--text-2); font-size: 12.5px; font-weight: 600;
  transition: background .15s, color .15s;
}
.notif-clear:hover { background: var(--panel-2); color: var(--text); }

/* scrim + responsive */
#scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
.only-mobile { display: none !important; }

@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.2,.8,.3,1);
    box-shadow: var(--shadow);
    padding-top: env(safe-area-inset-top);
  }
  #sidebar.open { transform: none; }
  #scrim.on { opacity: 1; pointer-events: auto; }
  .home-inner { padding-top: 30px; }
  .home-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .msg { max-width: 92%; }
  .media-card { max-width: 100%; }
  .media-card img, .media-card video { max-height: 380px; }
  .chat-head { padding-left: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* ══ Auth (login / registro / recuperar) ══ */
.auth-screen {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 70% -10%, rgba(139,92,246,.16), transparent 60%),
              radial-gradient(900px 600px at 0% 100%, rgba(236,72,153,.12), transparent 55%),
              #07070c;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
.auth-card {
  width: 100%; max-width: 380px;
  padding: 30px 28px 22px;
  border-radius: 22px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: authIn .35s cubic-bezier(.2,.8,.3,1);
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.auth-brand { font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.auth-brand .brand-glyph { color: var(--accent, #8b5cf6); margin-right: 4px; }
.auth-slogan {
  margin: 6px 0 2px; font-size: 16.5px; font-weight: 700; letter-spacing: .2px;
  background: linear-gradient(90deg, #c4b5fd, #67e8f9);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--text-3); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-nav { display: flex; justify-content: space-between; margin-top: 16px; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 12.5px; color: var(--text-3); text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text-1, #fff); }
.auth-msg {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.45;
  background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.35);
  color: #ff8a8d; word-break: break-word;
}
.auth-msg.ok {
  background: rgba(70,167,88,.12); border-color: rgba(70,167,88,.35); color: #7ed992;
}
.whoami { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  font-size: 11.5px; color: var(--text-3);
}
.logout-btn:hover { color: #ff8a8d; }

/* ══ Monetización ══ */
.coin-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .35);
  color: #6ee7a8; font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.coin-chip:hover { background: rgba(52, 211, 153, .2); border-color: rgba(52, 211, 153, .55); }
.coin-chip .coin-sym { letter-spacing: .3px; }
.coin-chip .coin-val { font-variant-numeric: tabular-nums; }
.chat-head .coin-chip { margin-left: auto; }
#settingsBtn { margin-left: 0; }

.plan-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--stroke);
}
/* features ocupan la altura sobrante → los botones quedan alineados entre tarjetas */
.plan-card .plan-feats { flex: 1 0 auto; }
.plan-card .btn { margin-top: auto; }
.plan-grid { align-items: stretch; }
.plan-card.current { border-color: rgba(139, 92, 246, .6); background: rgba(139, 92, 246, .08); }
.plan-card .plan-name { font-weight: 700; font-size: 14px; text-transform: capitalize; }
.plan-cur {
  font-style: normal; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, .5); border-radius: 999px; padding: 2px 7px;
}
.plan-price { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.plan-price small { font-size: 11px; font-weight: 600; color: var(--text-3); }
.plan-feats { list-style: none; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.plan-feats li::before { content: "· "; color: var(--acc-2); font-weight: 800; }

.pack-grid { display: flex; gap: 10px; }
@media (max-width: 420px) { .pack-grid { flex-direction: column; } }
.pack-card {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 10px;
  border-radius: var(--r-md);
  background: rgba(52, 211, 153, .1);
  border: 1px solid rgba(52, 211, 153, .35);
  color: #6ee7a8;
  transition: background .15s, transform .15s;
}
.pack-card:hover { background: rgba(52, 211, 153, .18); transform: translateY(-2px); }
.pack-card b { font-size: 22px; font-weight: 800; }
.pack-card span { font-size: 11px; font-weight: 700; opacity: .85; }
.pack-card small { font-size: 11.5px; color: var(--text-2); }

.gifts-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .gifts-grid { grid-template-columns: repeat(2, 1fr); } }
.gift-card b { font-size: 13px; }
.gift-card .g-emoji { font-size: 26px; line-height: 1.1; }

.admin-card { max-width: 640px; }
.admin-users {
  display: flex; flex-direction: column; gap: 6px;
  max-height: min(340px, 42dvh); overflow-y: auto;
}
.admin-tools { display: flex; gap: 8px; }
.admin-tools input {
  flex: 1; min-width: 0;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--text); font: inherit; outline: none;
}
.admin-tools input:focus { border-color: rgba(139, 92, 246, .55); }
.admin-tools .sel { flex: none; width: 44%; }
.admin-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px;
  padding: 8px 11px;
  background: var(--panel); border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-2);
}
.admin-row b { color: var(--text); font-size: 12.5px; }
.admin-row span:last-child { grid-column: 1 / -1; }
.admin-end { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-section { margin: 10px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.admin-switch {
  border: 1px solid var(--stroke); background: var(--panel); color: var(--text-2);
  border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.admin-switch.on { background: rgba(139, 92, 246, .22); border-color: rgba(139, 92, 246, .6); color: var(--text); }
.admin-switch:hover { border-color: rgba(139, 92, 246, .6); }
.pm-toggle {
  flex: 1; display: flex; align-items: center; gap: 7px; padding: 6px 10px;
  border: 1px solid var(--stroke); border-radius: 10px; background: var(--panel);
  font-size: 12px; color: var(--text-2); cursor: pointer;
}
.pm-toggle input { accent-color: #8b5cf6; }
.pm-toggle:has(input:checked) { border-color: rgba(139, 92, 246, .6); color: var(--text); }
.sel {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--text); font: inherit; outline: none;
  min-width: 0;
}
.sel:focus { border-color: rgba(139, 92, 246, .55); }
.admin-audit {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto;
  font-size: 11.5px; color: var(--text-2);
  background: var(--panel); border-radius: var(--r-sm); padding: 10px;
}
.admin-audit .a-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-audit .a-ts { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ══ PWA: banner de instalación + QR de pago directo ══ */
.app-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 70; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--stroke-2);
  border-radius: var(--r-md); box-shadow: var(--shadow);
}
.ab-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  font-size: 20px; color: #fff;
  background: var(--grad); border-radius: 12px;
}
.ab-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.ab-text span { font-size: 12px; color: var(--text-2); }
.dm-qr { display: flex; justify-content: center; }
.dm-qr img {
  width: 168px; height: 168px; padding: 8px;
  background: #fff; border-radius: 14px;
}

/* ══ Móvil: controles 16px + aire ajustado ══ */
@media (max-width: 860px) {
  /* iOS Safari auto-zooma al enfocar cualquier control con font <16px —
     era el "se agranda y hay que achicar a mano". 16px lo desactiva. */
  input, select, textarea { font-size: 16px !important; }
  .home-inner { padding: calc(26px + env(safe-area-inset-top)) 16px 48px; }
  .home-sub { font-size: 14px; }
  .modal { padding: 10px; }
  .modal-card { max-height: 94dvh; border-radius: 18px; }
  .modal-head { padding: 15px 16px 0; }
  .modal-body { padding: 14px 16px 20px; gap: 12px; }
  .composer-wrap { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .chat-log { padding: 16px 12px 8px; gap: 12px; }
  .bubble { font-size: 15.5px; }
  .admin-tools { flex-direction: column; }
  .admin-tools .sel { width: 100%; }
  .app-banner { left: 10px; right: 10px; }
}
@media (max-width: 480px) {
  .home-title { font-size: 27px; }
  .auth-card { padding: 24px 20px 18px; }
}

/* ── explorador de contenido (admin) ── */
.files-crumb { font-size: 13px; color: var(--dim, #999); overflow-x: auto; white-space: nowrap; flex: 1; }
.files-crumb a { color: var(--accent, #8b5cf6); text-decoration: none; }
.files-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.file-item {
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,.03);
}
.file-item:hover { border-color: rgba(139,92,246,.5); }
.f-thumb { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; }
.f-ico { font-size: 30px; height: 96px; display: flex; align-items: center; justify-content: center; }
.f-name { font-size: 12.5px; margin-top: 6px; word-break: break-all; color: var(--text, #eee); }
.f-size { font-size: 11px; color: var(--dim, #888); }
.f-del {
  position: absolute; top: 6px; right: 6px;
  border: none; border-radius: 8px; padding: 3px 6px;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 13px;
}
.f-dl {
  position: absolute; top: 6px; left: 6px;
  border: none; border-radius: 8px; padding: 3px 7px;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 13px;
  text-decoration: none;
}

/* ── admin 2.0 · pestañas, planes ABM, responsive premium ─────────────── */

.admin-card { width: min(760px, 96vw); }

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 18px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex: 1 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  min-height: 38px;
  transition: color .18s, background .18s, border-color .18s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.on {
  color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(34, 211, 238, .14));
  border-color: rgba(139, 92, 246, .45);
}

.admin-pane { display: flex; flex-direction: column; gap: 12px; }

.admin-tools {
  display: flex;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-2);
  padding: 2px 0 8px;
}
.admin-tools input[type="search"] { flex: 1; }
.admin-plans-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-2);
  padding: 2px 0 8px;
}

.admin-plans { display: flex; flex-direction: column; gap: 14px; }

.abm-plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  padding: 14px 16px 12px;
  scroll-margin-top: 64px;
}
.abm-plan.internal { opacity: .75; }
.abm-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.abm-name {
  flex: 1 1 140px;
  max-width: 260px;
  background: var(--panel-2);
  border: 1px solid var(--stroke-2);
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 15px;
  min-height: 40px;
}
.abm-name[disabled] { opacity: .85; border-style: dashed; }
.abm-head .abm-fld.price { flex: 0 1 150px; min-height: auto; }
.abm-head .abm-fld.price span { margin-top: 0; }
.abm-head .pm-toggle { padding-bottom: 10px; }

.abm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 10px;
}
.abm-fld { display: flex; flex-direction: column; min-height: auto; gap: 0; }
.abm-fld > span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.abm-fld > input, .abm-fld > input[type="number"] {
  background: var(--panel-2);
  border: 1px solid var(--stroke-2);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  min-height: 38px;
  margin-top: 2px;
}
.abm-fld input:focus { outline: none; border-color: rgba(139, 92, 246, .55); }
.abm-fld > em { font-size: 10.5px; color: var(--text-3); font-style: normal; margin-top: 2px; }
.abm-fld.switch input[type="checkbox"] { align-self: flex-start; margin-top: 8px; width: 18px; height: 18px; }

.abm-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn.danger { border-color: rgba(244, 63, 94, .5); color: #fb7185; }
.btn.danger:hover { background: rgba(244, 63, 94, .12); }

.pm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; align-items: center; }
.pm-grid > .pm-hint { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .admin-tabs { position: sticky; top: 0; background: var(--bg-2); z-index: 3; }
  .abm-name { max-width: none; }
  .abm-head { align-items: stretch; }
  .abm-head .pm-toggle { padding-bottom: 4px; }
  .abm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .abm-grid { grid-template-columns: 1fr; }
}

/* usuarios: filas táctiles y envueltas para pantallas chicas */
.admin-users { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}
.admin-row > span:nth-of-type(1) { grid-column: 2; }
.admin-row .admin-end { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
@media (max-width: 560px) {
  .admin-row { grid-template-columns: 1fr auto; }
  .admin-row > span:nth-of-type(1) { grid-column: 1 / -1; color: var(--text-2); font-size: 12px; }
  .admin-row .admin-switch { min-height: 34px; min-width: 64px; }
}

/* home: topbar móvil con menú y salir (visible incluso sin personas) */
.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 0;
}
.home-topbar-brand { font-weight: 800; font-size: 15px; letter-spacing: .4px; color: var(--text-2); }
.home-topbar .icon-btn { width: 40px; height: 40px; border-radius: 12px; }

/* ABM: swatches de color de tarjeta */
.abm-fld > input[type="color"] { padding: 3px; height: 38px; width: 100%; cursor: pointer; background: var(--panel-2); border: 1px solid var(--stroke-2); border-radius: 10px; }
.abm-fld > input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.abm-fld > input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
