@charset "UTF-8";

/* ================= VARIABLES & RESET ================= */
:root {
  --primary: #2A9D8F;
  --primary-dark: #21867a;
  --secondary: #264653;
  --accent: #E9C46A;
  --bg-body: #F4F6F8;
  --bg-panel: #FFFFFF;

  --msg-company-bg: #E1FFC7;
  --msg-company-text: #111b21;
  --msg-client-bg: #FFFFFF;
  --msg-client-text: #111b21;
  --chat-bg: #EFE7DD;

  --text-main: #333333;
  --text-muted: #666666;
  --text-light: #FFFFFF;

  --border-radius: 12px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* ================= LOGIN (CORREGIDO) ================= */
/* El ID #login-container ahora es el wrapper de fondo para que el JS lo borre entero */
#login-container {
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
}

/* Nueva clase para la caja blanca interior */
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.login-header h2 {
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

.login-header p {
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.input-group {
  position: relative;
  margin-bottom: 1rem;
}

.input-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
}

.input-group input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  padding: 12px;
  width: 100%;
  font-size: 1rem;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-danger {
  background-color: #E76F51;
  color: white;
  padding: 8px 15px;
  font-size: 0.9rem;
}

.btn-danger:hover {
  background-color: #d65a3b;
}

/* Header: botones en fila (Pedir ayuda + Cerrar sesión juntos) */
#header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#pedir-ayuda-btn {
  width: auto;
  padding: 8px 15px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.error {
  color: #e63946;
  margin-top: 10px;
  font-size: 0.9rem;
}

/* ================= MAIN LAYOUT ================= */
#main-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  background-color: var(--bg-panel);
  height: 70px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

#logo {
  height: 45px;
  object-fit: contain;
}

#content {
  display: flex;
  overflow: hidden;
  /* CAMBIO CLAVE: Forzamos la altura exacta restando el header (70px) */
  height: calc(100vh - 70px);
  position: relative;
  width: 100%;
}

/* ================= CHAT LIST ================= */
#chat-list {
  width: 320px;
  background-color: var(--bg-panel);
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  /* CAMBIOS CLAVE PARA EL SCROLL: */
  height: 100%;
  /* Ocupa todo el alto del #content */
  overflow: hidden;
  /* Evita que se estire más de la cuenta */
  min-height: 0;
  /* Truco vital para Firefox/Chrome en flexbox anidados */
}

.chat-list-header {
  padding: 15px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.chat-list-header h3 {
  margin: 0;
  color: var(--secondary);
  font-size: 1.1rem;
}

#users-list {
  list-style: none;
  padding: 0;
  margin: 0;
  /* ESTOS 3 SON VITALES: */
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

#users-list li {
  padding: 15px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
  position: relative;
  font-weight: 500;
}

#users-list li:hover {
  background-color: #f8f9fa;
}

#users-list li.active-chat {
  background-color: #e8f5f3;
  border-left: 4px solid var(--primary);
}

#users-list li.unread {
  font-weight: 700;
  color: #000;
}

.unread-indicator {
  background-color: var(--primary);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 5px var(--primary);
}

/* Intervention indicator on user list */
#users-list li.intervening-user {
  border-left: 4px solid #e74c3c;
  background-color: #fdf2f2;
}

.intervention-indicator {
  background-color: #e74c3c;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 6px #e74c3c;
  animation: pulse-intervention 1.5s ease-in-out infinite;
}

@keyframes pulse-intervention {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 6px #e74c3c;
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 12px #e74c3c;
  }
}

/* ================= CHAT WINDOW ================= */
#chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--chat-bg);
  background-image: radial-gradient(#ddd 1px, transparent 1px);
  background-size: 20px 20px;
  position: relative;
  /* CAMBIOS CLAVE: */
  height: 100%;
  /* Ocupa todo el alto del #content */
  overflow: hidden;
  /* Obligatorio para que aparezca el scroll interno */
  min-height: 0;
}

#chat-header {
  background-color: #f0f2f5;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
}

#chat-header h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.1rem;
}

#messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  /* CRUCIAL */

  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ================= INTERVENTION BAR ================= */
.intervention-bar {
  flex-shrink: 0;
  border-top: 2px solid #e74c3c;
  background-color: #fff5f5;
}

.intervention-banner {
  background-color: #e74c3c;
  color: #fff;
  padding: 8px 15px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.intervention-input-row {
  display: flex;
  padding: 10px;
  gap: 8px;
  background: #fff;
}

.intervention-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.intervention-input-row input:focus {
  border-color: #e74c3c;
}

.btn-send-intervention {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-send-intervention:hover {
  background-color: #c0392b;
}

/* Intervention buttons in chat header */
.intervention-controls {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn-intervene {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-intervene:hover {
  background-color: #c0392b;
}

.btn-stop-intervene {
  background-color: #27ae60;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-stop-intervene:hover {
  background-color: #219a52;
}

#chat-header.intervening {
  background-color: #fdf2f2;
  border-bottom-color: #e74c3c;
}

#messages p {
  max-width: 65%;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  margin: 0;
}

.timestamp {
  display: block;
  font-size: 0.7rem;
  margin-top: 4px;
  text-align: right;
  opacity: 0.7;
}

.company-message {
  background-color: var(--msg-company-bg);
  color: var(--msg-company-text);
  align-self: flex-end;
  border-top-right-radius: 0 !important;
}

.client-message {
  background-color: var(--msg-client-bg);
  color: var(--msg-client-text);
  align-self: flex-start;
  border-top-left-radius: 0 !important;
}

.empty-state {
  text-align: center;
  color: #999;
  margin-top: 20%;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ================= ADMIN PANEL ================= */
#admin-panel {
  width: 300px;
  background-color: var(--bg-panel);
  border-left: 1px solid #ddd;
  overflow-y: auto;
  padding: 20px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.02);
}

#admin-panel h3 {
  margin-top: 0;
  color: var(--secondary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.admin-grid {
  display: grid;
  gap: 10px;
}

#admin-panel button {
  width: 100%;
  padding: 10px;
  background-color: #fff;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

#admin-panel button:hover {
  background-color: var(--primary);
  color: white;
}

#admin-panel button.btn-warning {
  border-color: #E76F51;
  color: #E76F51;
}

#admin-panel button.btn-warning:hover {
  background-color: #E76F51;
  color: white;
}

/* ================= MODALS ================= */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop 0.3s ease-out;
}

.wide-modal .modal-content {
  max-width: 800px;
}

@keyframes modalPop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal h2,
.modal h3 {
  margin-top: 0;
  color: var(--secondary);
  margin-bottom: 20px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
}

.modal textarea {
  resize: vertical;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.close-btn {
  background-color: #e0e0e0;
  color: #333;
  padding: 10px 20px;
}

.close-btn:hover {
  background-color: #d0d0d0;
}

.file-input {
  margin-top: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 6px;
  width: 100%;
}

.scrollable-list,
.button-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 10px;
}

.empresa-item,
.usuario-item {
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.category-button {
  width: 100%;
  padding: 10px;
  margin-bottom: 5px;
  background: white;
  border: 1px solid #ddd;
  text-align: left;
  border-radius: 4px;
}

.category-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ================= GOD MODE ================= */
#dios-panel {
  background-color: #121212;
  color: #00FF9D;
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Courier New', monospace;
}

.dios-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #333;
}

.dios-title {
  margin: 0;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 10px #00FF9D;
}

.logout-dios-btn {
  background: transparent;
  border: 1px solid #ff4444;
  color: #ff4444;
}

.logout-dios-btn:hover {
  background: #ff4444;
  color: white;
}

.dios-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.dios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1000px;
  width: 100%;
}

.dios-grid button {
  background: #1e1e1e;
  border: 1px solid #00FF9D;
  color: #00FF9D;
  padding: 20px;
  font-size: 1.1rem;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.2s;
}

.dios-grid button:hover {
  background: #00FF9D;
  color: #000;
  box-shadow: 0 0 15px #00FF9D;
  transform: translateY(-2px);
}

.dios-grid button:disabled {
  border-color: #555;
  color: #555;
  cursor: not-allowed;
  box-shadow: none;
}

/* ================= MOBILE-ONLY ELEMENTS (hidden on desktop) ================= */
.mobile-menu-btn,
.mobile-back-btn,
.mobile-menu-overlay,
.mobile-drawer {
  display: none;
}

/* ================= RESPONSIVE (≤768px) ================= */
@media (max-width: 768px) {

  /* ——— Header tweaks ——— */
  #header {
    padding: 0 12px;
  }

  #header .header-actions #logout-btn {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
  }

  .mobile-menu-btn:hover {
    background-color: #f0f0f0;
  }

  /* ——— Content area ——— */
  #content {
    position: relative;
    height: calc(100vh - 70px);
    overflow: hidden;
  }

  /* ——— Chat List: fills the screen ——— */
  #chat-list {
    width: 100%;
    height: 100%;
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  /* ——— Chat Window: overlays the list ——— */
  #chat-window {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    /* Hidden by default on mobile */
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  /* Show chat window when a chat is open */
  body.mobile-chat-open #chat-window {
    transform: translateX(0);
  }

  /* ——— Mobile Back Button ——— */
  .mobile-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.2s;
  }

  .mobile-back-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }

  /* ——— Admin Panel: hidden on mobile (content goes into drawer) ——— */
  #admin-panel {
    display: none !important;
  }

  /* ——— Mobile Overlay ——— */
  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    transition: opacity 0.3s;
    opacity: 0;
  }

  body.mobile-menu-open .mobile-menu-overlay {
    display: block;
    opacity: 1;
  }

  /* ——— Mobile Drawer ——— */
  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-panel);
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  body.mobile-menu-open .mobile-drawer {
    transform: translateX(0);
  }

  .mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
  }

  .mobile-drawer-header h3 {
    margin: 0;
    color: var(--secondary);
    font-size: 1.1rem;
  }

  .mobile-drawer-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  .mobile-drawer-close:hover {
    background-color: #eee;
  }

  .mobile-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  .mobile-drawer-content h3 {
    margin-top: 0;
    color: var(--secondary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 16px;
    font-size: 1.1rem;
  }

  .mobile-drawer-content .admin-grid {
    display: grid;
    gap: 10px;
  }

  .mobile-drawer-content button {
    width: 100%;
    padding: 12px;
    background-color: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
  }

  .mobile-drawer-content button:hover {
    background-color: var(--primary);
    color: white;
  }

  .mobile-drawer-content button.btn-warning {
    border-color: #E76F51;
    color: #E76F51;
  }

  .mobile-drawer-content button.btn-warning:hover {
    background-color: #E76F51;
    color: white;
  }

  .mobile-drawer-footer {
    padding: 16px;
    border-top: 1px solid #eee;
  }

  /* ——— Messages bubble width ——— */
  #messages p {
    max-width: 85%;
  }

  /* ——— Intervention controls wrap ——— */
  .intervention-controls {
    gap: 4px;
  }

  .btn-intervene,
  .btn-stop-intervene {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
}


/* ================= TABS MODAL DIOS ================= */
.nav-tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  border-bottom: 2px solid #ddd;
}

.nav-tabs li {
  margin-right: 5px;
}

.nav-tabs li a {
  text-decoration: none;
  padding: 10px 20px;
  display: block;
  background: #f1f1f1;
  color: #333;
  border-radius: 5px 5px 0 0;
  font-weight: 600;
  transition: all 0.3s;
}

.nav-tabs li.active a {
  background: var(--primary);
  color: white;
}

.nav-tabs li a:hover {
  background: #ddd;
}

/* Tablas dentro del modal */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background-color: #f9f9f9;
  color: var(--secondary);
}

.btn-icon {
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: #eee;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  margin-right: 5px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

/* ================= INTERVENTION ================= */
#chat-header {
  justify-content: space-between;
}

#chat-header.intervening {
  background-color: #fff3cd;
  border-bottom: 2px solid #e6a817;
}

.intervention-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.btn-intervene {
  background-color: #e6a817;
  color: #fff;
  padding: 6px 14px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.btn-intervene:hover {
  background-color: #d49b0e;
}

.btn-stop-intervene {
  background-color: #E76F51;
  color: #fff;
  padding: 6px 14px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.btn-stop-intervene:hover {
  background-color: #d65a3b;
}

.intervention-bar {
  border-top: 1px solid #ddd;
  background-color: #fff;
}

.intervention-banner {
  background-color: #fff3cd;
  color: #856404;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #ffc107;
}

.intervention-input-row {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  align-items: center;
  background: #f0f2f5;
}

.intervention-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.intervention-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.15);
}

.btn-send-intervention {
  background-color: var(--primary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0;
}

.btn-send-intervention:hover {
  background-color: var(--primary-dark);
}

.btn-send-intervention:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ——— Intervention: Attach button ——— */
.btn-attach-intervention {
  background: none;
  color: #888;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  padding: 0;
  transition: color 0.2s, background 0.2s;
}

.btn-attach-intervention:hover {
  color: var(--primary);
  background: rgba(42, 157, 143, 0.1);
}

.btn-attach-intervention:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ——— Intervention: Image preview ——— */
.intervention-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f2f5;
  border-bottom: 1px solid #ddd;
}

.intervention-preview img {
  max-height: 120px;
  max-width: 200px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.btn-cancel-image {
  background: #e74c3c;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-cancel-image:hover {
  background: #c0392b;
}

/* ——— Chat: Image in messages ——— */
.msg-image {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  display: block;
  object-fit: contain;
}

.msg-image:hover {
  opacity: 0.9;
}

/* ——— Image Gallery Panel (Dios Prompt Editor) ——— */
.wide-modal {
  max-width: 900px !important;
  width: 90vw !important;
}

.prompt-images-panel {
  width: 280px;
  min-width: 240px;
  flex-direction: column;
  background: #1a1a2e;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #333;
  max-height: 450px;
}

.imagen-card {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #333;
  align-items: flex-start;
}

.imagen-card:last-child {
  border-bottom: none;
}

.imagen-card-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.imagen-card-thumb:hover {
  opacity: 0.85;
}

.imagen-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.imagen-card-info strong {
  font-size: 0.85em;
  color: #eee;
}

.imagen-card-info small {
  font-size: 0.75em;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imagen-card-tag {
  font-size: 0.8em;
  color: #2196F3;
  cursor: pointer;
  background: rgba(33, 150, 243, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.imagen-card-tag:hover {
  color: #42A5F5;
  background: rgba(33, 150, 243, 0.2);
}