
/* Logo login estilo captura (compacto, letra + diablita) */
.logo-login {
  display: block;
  width: min(340px, 90vw);
  height: auto;
  max-height: 100px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 14px rgba(196, 59, 94, 0.55));
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 10px;
  width: 100%;
}

:root {
  --bg: #12060a;
  --accent: #8b1530;
  --accent-soft: #c43b5e;
  --text: #f3e8ee;
  --muted: #b09aaa;
  --bubble-user: #4a1228;
  --border: rgba(180, 40, 70, 0.42);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  font-family: "Cormorant Garamond", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 17px;
}
.hidden { display: none !important; }

/* ===== fondo login: foto clara y nítida (overlay más suave) ===== */
.login-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(10,5,8,0.10) 0%, rgba(10,5,8,0.06) 28%, rgba(10,5,8,0.28) 62%, rgba(10,5,8,0.62) 100%),
    url("fondo.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
.login-card {
  position: relative; z-index: 2;
  width: 100%;
  max-width: 380px;
  background: rgba(12, 6, 10, 0.28);
  border: 1px solid rgba(196, 59, 94, 0.30);
  border-radius: 22px;
  padding: 36px 26px 28px;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.40);
}
.login-avatar { margin-bottom: 6px; display: flex; justify-content: center; }
/* login-brand handled below */


.chibi-logo {
  flex-shrink: 0;
  width: 92px;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(196, 59, 94, 0.85));
  pointer-events: none;
}
.header-chibi {
  width: 36px;
  max-height: 32px;
  margin-left: auto;
}
.sidebar-chibi {
  width: 72px;
  max-height: 64px;
  margin: 6px auto;
  display: block;
}
.sidebar-perfil {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 10px 4px 18px;
}
.header-brand {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}
.header-textos {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.icono-mika {
  width: 56px; height: 56px;
  color: var(--accent-soft);
  filter: drop-shadow(0 0 10px rgba(196, 59, 94, 0.65));
}
.gothic-title {
  font-family: "UnifrakturMaguntia", "Pirata One", "Cinzel Decorative", serif;
  font-weight: 400;
  font-variant: normal;
  font-size: 2.5rem;
  letter-spacing: 0.02em;
  color: #4a0e14;
  text-shadow:
    0 0 4px #1a0203,
    0 0 14px rgba(90, 10, 20, 0.85),
    0 0 26px rgba(60, 5, 12, 0.6),
    0 2px 2px rgba(0, 0, 0, 0.95);
  margin-bottom: 0;
  display: block;
  line-height: 1.15;
}
.gothic-title.small {
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: #6b1020;
  text-shadow:
    0 0 3px #1a0203,
    0 0 10px rgba(110, 12, 32, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.95);
  font-variant: normal;
}
.escribiendo-efecto {
  border-left: none;
  padding-left: 10px;
  animation: pulse-borde 1.4s ease-in-out infinite;
}
@keyframes pulse-borde {
  0%, 100% { border-left-color: rgba(196, 59, 94, 0.35); }
  50% { border-left-color: rgba(196, 59, 94, 0.9); }
}
.login-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 22px; font-family: "Cormorant Garamond", serif; }

#inputUser, #inputPass, #nuevoUser, #nuevoPass, #nuevoTema, #nuevoProyTitulo, #nuevoProyContenido {
  width: 100%;
  background: #14090f;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
}
textarea#nuevoProyContenido { resize: vertical; }
#inputUser:focus, #inputPass:focus, #nuevoUser:focus, #nuevoPass:focus, #nuevoTema:focus { border-color: var(--accent-soft); }
.login-error { color: #f87171; font-size: 0.85rem; margin-bottom: 10px; }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #6b1028);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: "Cormorant Garamond", serif;
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  font-family: "Cormorant Garamond", serif;
}

/* ===================== APP ===================== */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(40,8,16,0.48) 0%, rgba(18,6,10,0.62) 50%, rgba(12,4,8,0.78) 100%),
    url("fondo.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}
.contenido {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: visible;
}
.header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(10, 5, 8, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.header-info { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.estado { font-size: 0.72rem; color: #7ee787; }
.icon-btn {
  background: transparent; border: none; color: var(--text); font-size: 1.2rem;
  cursor: pointer; opacity: 0.85; padding: 6px;
}

/* ===== chat ===== */
.chat-wrap { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.logo-vacio {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  opacity: 0.22; pointer-events: none;
}
.logo-vacio .icono-mika { width: 90px; height: 90px; filter: drop-shadow(0 0 30px rgba(196,59,94,0.5)); }
.chat {
  flex: 1; overflow-y: auto; padding: 16px 14px 20px;
  display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch;
  position: relative; z-index: 1;
}
.burbuja {
  max-width: 88%; padding: 12px 14px; border-radius: 16px;
  border: none !important; outline: none !important; box-shadow: none !important;
  line-height: 1.45; font-size: 1rem;
  white-space: pre-wrap; word-break: break-word;
}
.burbuja.usuario {
  align-self: flex-end; background: var(--bubble-user);
  border: none;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.burbuja.asistente {
  align-self: flex-start; background: rgba(26, 14, 20, 0.88);
  border: none;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.28);
}
.burbuja.sistema {
  align-self: center; background: rgba(30, 20, 24, 0.85);
  color: var(--muted); font-size: 0.85rem; max-width: 95%; text-align: center;
  border: none;
}
.burbuja.escribiendo {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  background: rgba(28, 10, 16, 0.92);
  border: none;
  box-shadow: 0 0 18px rgba(155, 27, 58, 0.22);
}
.burbuja.escribiendo .punto {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-soft);
  animation: rebote 1.1s infinite ease-in-out;
  display: inline-block;
}
.burbuja.escribiendo .punto:nth-child(2) { animation-delay: 0.15s; }
.burbuja.escribiendo .punto:nth-child(3) { animation-delay: 0.3s; }
@keyframes rebote { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* Avatar gótico mientras piensa (foto del login) */
.pensando-avatar-wrap {
  position: relative; flex-shrink: 0;
  width: 44px; height: 44px;
}
.pensando-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 2px solid rgba(196, 59, 94, 0.7);
  box-shadow: 0 0 12px rgba(155, 27, 58, 0.5);
  display: block;
}
.pensando-anillo {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #c43b5e;
  border-right-color: rgba(196, 59, 94, 0.35);
  animation: anillo-giro 1s linear infinite;
  pointer-events: none;
}
@keyframes anillo-giro {
  to { transform: rotate(360deg); }
}
.pensando-texto {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.pensando-titulo {
  font-family: "Cinzel Decorative", serif;
  font-size: 0.78rem; letter-spacing: 0.04em;
  color: #c43b5e;
  text-shadow: 0 0 8px rgba(155, 27, 58, 0.5);
}
.pensando-estado {
  font-size: 0.88rem; color: var(--muted);
  font-style: italic;
}
.pensando-puntos { display: flex; gap: 4px; margin-top: 4px; }

/* Cursor parpadeante mientras escribe el texto */
.burbuja.escribiendo-efecto::after {
  content: "▋";
  color: var(--accent-soft);
  animation: parpadeo 0.8s step-end infinite;
  margin-left: 1px;
  font-size: 0.85em;
}
@keyframes parpadeo { 50% { opacity: 0; } }

.chat img.adjunto { max-width: 100%; border-radius: 12px; margin-top: 8px; display: block; }
.chat::-webkit-scrollbar { width: 4px; }
.chat::-webkit-scrollbar-thumb { background: rgba(155, 27, 58, 0.5); border-radius: 4px; }

/* ===== toast ===== */
.toast {
  position: fixed; top: 14px; left: 50%; transform: translate(-50%, -20px);
  background: rgba(18, 10, 14, 0.95); border: 1px solid var(--border);
  color: var(--text); padding: 10px 16px; border-radius: 12px;
  font-size: 0.85rem; z-index: 200; opacity: 0; transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast.mostrar { opacity: 1; transform: translate(-50%, 0); }

/* ===== sidebar estilo Grok ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 30; backdrop-filter: blur(2px);
}
.sidebar {
  position: fixed; top: 0; left: -300px; width: 280px; height: 100%;
  background: rgba(12, 6, 10, 0.98); border-right: 1px solid var(--border);
  z-index: 31; transition: left 0.25s ease;
  display: flex; flex-direction: column; padding: 14px;
  overflow-y: auto;
}
.sidebar.abierto { left: 0; }
.sidebar-top { display: flex; justify-content: flex-end; }
.sidebar-perfil {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 10px 4px 18px;
}
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(155,27,58,0.25);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  border: 1px solid var(--border);
}
.sidebar-nombre { font-family: "Cinzel Decorative", serif; font-size: 0.95rem; }
.sidebar-sub { font-size: 0.75rem; color: var(--muted); }
.sidebar-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); padding: 11px 8px; border-radius: 10px; font-size: 0.95rem;
  cursor: pointer; font-family: "Cormorant Garamond", serif;
}
.sidebar-item:hover { background: rgba(155,27,58,0.15); }
.sidebar-sep { height: 1px; background: var(--border); margin: 10px 0; }
.sidebar-conv-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.mini-btn {
  background: rgba(155,27,58,0.25); border: 1px solid var(--border); color: var(--text);
  width: 24px; height: 24px; border-radius: 8px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.lista-conversaciones { flex-shrink: 0; max-height: 40vh; overflow-y: auto; }
.conv-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 8px; border-radius: 10px; cursor: pointer; font-size: 0.88rem;
  color: var(--muted); gap: 6px;
}
.conv-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item:hover { background: rgba(155,27,58,0.12); }
.conv-item.activa { background: rgba(155,27,58,0.22); color: var(--text); }
.conv-borrar { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; }
.sidebar-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }

/* ===== paneles flotantes (admin / biblioteca / automatizaciones / proyectos) ===== */
.panel-flotante {
  position: absolute; inset: 60px 12px 80px;
  background: rgba(12, 6, 10, 0.97);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; z-index: 20; overflow-y: auto;
}
.panel-flotante h3 { margin-bottom: 10px; font-family: "Cinzel Decorative", serif; font-size: 1.05rem; }
.admin-hint { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.lista-usuarios, .lib-item, .lista-proyectos { font-size: 0.9rem; }
.lista-usuarios div, .lib-item {
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.lista-usuarios button, .lib-borrar, .proy-borrar, .tema-borrar {
  background: transparent; border: none; color: #f87171; cursor: pointer; font-size: 0.85rem;
}
.admin-form input, .admin-form textarea { width: 100%; }
.admin-form-row { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-form-row input { flex: 1; margin-bottom: 0; }

.switch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.switch-row input { width: auto; accent-color: var(--accent); }

.lista-temas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tema-chip {
  background: rgba(155,27,58,0.18); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 10px; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 4px;
}

.proy-item { border-bottom: 1px solid rgba(255,255,255,0.06); padding: 10px 0; }
.proy-item p { color: var(--muted); font-size: 0.88rem; margin: 4px 0 6px; }
.lista-bitacora { max-height: 180px; overflow-y: auto; margin-bottom: 14px; }
.bitacora-item {
  font-size: 0.82rem; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
}
.bitacora-item .hora { color: var(--muted); font-size: 0.72rem; display: block; }
.tarea-item {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06); padding: 9px 0; font-size: 0.92rem;
}
.tarea-item input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; flex-shrink: 0; }
.tarea-item span { flex: 1; }
.tarea-item.hecha span { text-decoration: line-through; color: var(--muted); }
.tarea-borrar { background: transparent; border: none; color: #f87171; cursor: pointer; font-size: 0.82rem; }

/* ===================== FOOTER / INPUT (estilo Grok + gótico) ===================== */
.footer {
  flex-shrink: 0;
  background: transparent;
  border-top: none;
  padding: 12px 16px 18px;
  position: relative;
  overflow: visible;
  z-index: 20;
}
.previa-imagen-wrap {
  position: relative;
  display: block;
  margin-bottom: 8px;
  max-width: 100%;
}
.previa-imagen-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}
.previa-imagen-grid img {
  max-height: 64px;
  max-width: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.previa-imagen { max-height: 70px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.previa-quitar {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: white; border: none; font-size: 0.7rem; cursor: pointer;
}

/* Una sola pastilla como Grok */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(22, 12, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 8px 10px 8px 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: visible;
}
.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.composer-plus {
  position: relative;
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(155, 27, 58, 0.2);
  border: 1px solid rgba(196, 59, 94, 0.35);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 300; cursor: pointer;
  line-height: 1; user-select: none;
}
.composer-plus:hover { background: rgba(155, 27, 58, 0.4); }
.composer-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  min-width: 180px;
  background: #1a0c10;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 6px;
  z-index: 999;
  box-shadow: 0 12px 30px rgba(0,0,0,0.65);
}
.composer-menu.hidden { display: none !important; }
.composer-menu-item {
  display: block;
  position: relative;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
}
.composer-menu-item:hover { background: rgba(155, 27, 58, 0.25); }
.composer-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.input-file-hidden {
  /* fuera de vista pero clickeable por JS — NO usar pointer-events:none */
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 0.1px !important;
  height: 0.1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.composer-menu-item.tool-file > span { pointer-events: none; }
.file-input-overlay {
  position: absolute !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100% !important; height: 100% !important;
  opacity: 0.01 !important; margin: 0 !important; padding: 0 !important;
  border: 0 !important; cursor: pointer !important;
  font-size: 32px !important; z-index: 5 !important;
}
#mensaje {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 6px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  resize: none;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.4;
  min-height: 36px;
  box-sizing: border-box;
}
#mensaje:focus { border: none; box-shadow: none; }
#mensaje::placeholder { color: var(--muted); opacity: 0.85; }
.composer-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.9;
}
.composer-icon:hover { background: rgba(155, 27, 58, 0.25); }
.composer-icon.activo,
.mic-btn.activo {
  background: var(--accent) !important;
  color: #fff;
  animation: pulsoMicro 1.1s ease-in-out infinite;
}
@keyframes pulsoMicro {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 59, 94, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(196, 59, 94, 0); }
}
.composer-send {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.composer-send:hover { filter: brightness(1.08); }
.composer-send:disabled { opacity: 0.45; cursor: not-allowed; }

/* compat ids viejos por si algún script busca .tool-btn */
.tool-btn { display: none; }
.input-tools, .input-row { display: contents; }
.btn-enviar { /* alias */ }

/* ===== pantallas anchas (PC): que no se vea vacío ===== */
@media (min-width: 760px) and (max-width: 899px) {
  .app { max-width: 620px; box-shadow: 0 0 80px rgba(0,0,0,0.6); }
  .login-screen { background-position: center 12%; }
}

/* ===== escritorio ancho: sidebar fijo siempre visible, como Grok ===== */
@media (min-width: 900px) {
  .login-screen { background-position: center 12%; }
  .app {
    max-width: 1100px;
    flex-direction: row;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
  }
  .overlay { display: none !important; }
  .sidebar {
    position: static;
    width: 260px;
    flex-shrink: 0;
    height: 100%;
    transition: none;
    border-right: 1px solid var(--border);
  }
  #btnMenu, #btnCerrarSidebar { display: none; }
  .contenido { flex: 1; min-width: 0; }
}

/* Libreta de pendientes de Mika */
.lista-vigilancia {
  max-height: 160px;
  overflow-y: auto;
  margin: 6px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vig-item {
  background: rgba(196, 59, 94, 0.12);
  border: 1px solid rgba(196, 59, 94, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.92rem;
  line-height: 1.35;
}
.vig-item.resuelta {
  opacity: 0.55;
  text-decoration: line-through;
}
.vig-item .vig-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}
.vig-item .vig-acciones {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.vig-item button {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(196,59,94,0.4);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  cursor: pointer;
}

.panel-limites {
  margin: 8px 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(196, 59, 94, 0.28);
  border-radius: 10px;
  background: rgba(196, 59, 94, 0.08);
}
.panel-limites .admin-form-row {
  margin-top: 6px;
  gap: 6px;
  flex-wrap: wrap;
}


/* ---------- banner bienvenida login (gótico, sin azul) ---------- */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(120, 24, 48, 0.55);
  border: 1px solid rgba(196, 59, 94, 0.45);
  box-shadow: 0 0 18px rgba(196, 59, 94, 0.22), inset 0 1px 0 rgba(255, 180, 200, 0.08);
  color: #f0d4dc;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}
.welcome-banner.show {
  opacity: 1;
  transform: translateY(0);
}
.welcome-banner.hide {
  opacity: 0;
  transform: translateY(-8px);
}
.welcome-icon {
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(196, 59, 94, 0.5));
}
.welcome-text {
  line-height: 1.25;
}

.sidebar-nombre { color: #6b1020 !important; font-family: "UnifrakturMaguntia", "Pirata One", serif !important; }

.select-modo {
  display: block;
  margin-top: 4px;
  max-width: 160px;
  font-size: 11px;
  background: rgba(20,8,12,0.85);
  color: #f3e8ee;
  border: 1px solid rgba(196,59,94,0.45);
  border-radius: 8px;
  padding: 3px 6px;
}

/* ===== kanban pendientes (biblioteca) ===== */
.kanban {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  align-items: flex-start;
}
.kanban-col {
  flex: 1;
  min-width: 0;
  background: rgba(18, 8, 12, 0.55);
  border-radius: 12px;
  padding: 8px;
}
.kanban-tit {
  font-size: 0.78rem;
  color: var(--accent-soft);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kanban-card {
  background: rgba(40, 16, 24, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.kanban-card.hecha {
  opacity: 0.65;
  text-decoration: line-through;
  color: var(--muted);
}

/* =====================================================================
   v32 — VISUAL: login transparente, fondo del chat visible, barra tipo Grok
   (este bloque va al final a propósito: gana sobre las reglas anteriores)
   ===================================================================== */

/* ---- LOGIN: sin desenfoque, la foto de Mika se ve completa ---- */
.login-screen {
  align-items: flex-end;
  padding: 24px 24px calc(7vh + env(safe-area-inset-bottom, 0px));
  background-image:
    linear-gradient(180deg, rgba(10,5,8,0) 0%, rgba(10,5,8,0) 45%, rgba(10,5,8,0.55) 100%),
    url("fondo.jpg");
}
.login-card {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 8px 6px 4px;
}
.login-card .welcome-banner {
  background: rgba(10, 4, 8, 0.45);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.login-card .logo-login { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.75)); }
.login-card .login-sub { text-shadow: 0 1px 6px rgba(0,0,0,0.9); color: #f3e8ee; }
.login-card input {
  background: rgba(10, 4, 8, 0.55);
  border-color: rgba(196, 59, 94, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.login-card .btn-primary { box-shadow: 0 6px 18px rgba(0,0,0,0.45); }

/* ---- CHAT: el fondo de Mika se ve a través de todo ---- */
.app {
  background-image:
    linear-gradient(180deg, rgba(40,8,16,0.16) 0%, rgba(18,6,10,0.26) 55%, rgba(12,4,8,0.55) 100%),
    url("fondo.jpg");
}
.header {
  background: linear-gradient(180deg, rgba(8,3,6,0.72) 0%, rgba(8,3,6,0.25) 100%);
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.burbuja.asistente { background: rgba(22, 9, 15, 0.62); }
.burbuja.usuario   { background: rgba(74, 18, 40, 0.72); }
.burbuja.sistema   { background: rgba(26, 14, 20, 0.55); }
.burbuja.escribiendo { background: rgba(28, 10, 16, 0.65); }
.logo-vacio { opacity: 0.35; }

/* ---- BARRA DE ESCRIBIR estilo Grok: texto arriba, controles abajo ---- */
.footer { padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
.composer {
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 10px 12px 8px;
  border-radius: 24px;
  background: rgba(14, 7, 11, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.30);
}
#mensaje { order: 0; flex: 1 1 100%; min-height: 40px; padding: 4px 4px 6px; }
.composer-plus { order: 1; }
.composer .select-modo {
  order: 2;
  margin: 0;
  max-width: 150px;
  height: 32px;
  font-size: 13px;
  padding: 0 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text);
}
#btnMicro { order: 3; margin-left: auto; }
#btnVoz   { order: 4; }
#enviar   { order: 5; }
.composer-plus, .composer-icon, .composer-send { width: 34px; height: 34px; }
.composer-menu { background: rgba(26, 12, 18, 0.96); }
