/**
 * Nexo — Tema base zona clientes
 * Variables que formUi.css y el layout esperan. Tema claro.
 */

:root {
  --background: #f5f6fa;
  --border-color: #dee2e6;
  --color-text-main: #1a1d24;
  --form-ui-text: #1a1d24;
  --shadow: rgba(0, 0, 0, 0.06);
  --label-text-color: #2e7cf6;
  --color-primary: #2e7cf6;
  --color-primary-soft: #e8f0fe;
}

* {
  box-sizing: border-box;
}

body.nexo-clients {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-main);
  background: var(--background);
  min-height: 100vh;
}

/* Sidebar izquierdo */
.nexo-clients .nexo-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  background: #1a1d24;
  color: #e2e4e8;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.nexo-clients .nexo-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nexo-clients .nexo-sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.nexo-clients .nexo-sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}
.nexo-clients .nexo-sidebar-tagline {
  margin: 0 1rem 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}
.nexo-clients .nexo-sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 0.5rem 0;
}
.nexo-clients .nexo-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.nexo-clients .nexo-sidebar-link i {
  font-size: 1.2rem;
  opacity: 0.9;
}
.nexo-clients .nexo-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nexo-clients .nexo-sidebar-link.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
}
.nexo-clients .nexo-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nexo-clients .nexo-sidebar-user,
.nexo-clients .nexo-sidebar-workspace {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
}
.nexo-clients .nexo-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1025;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nexo-clients .nexo-sidebar-backdrop.is-open {
  display: block;
  opacity: 1;
}
@media (max-width: 767.98px) {
  .nexo-clients .nexo-sidebar {
    transform: translateX(-100%);
  }
  .nexo-clients .nexo-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  }
}
@media (min-width: 768px) {
  .nexo-clients .nexo-sidebar-toggle { display: none !important; }
}

/* Contenedor principal (al lado del sidebar) */
.nexo-clients .nexo-app-wrap {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (max-width: 767.98px) {
  .nexo-clients .nexo-app-wrap { margin-left: 0; }
}

/* Header superior (barra fina: hamburguesa en móvil, usuario a la derecha) */
.nexo-clients .nexo-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1100;
}
.nexo-clients .nexo-header .nexo-header-spacer { flex: 1; }
.nexo-clients .nexo-header .nexo-sidebar-toggle {
  font-size: 1.4rem;
  padding: 0.25rem;
  color: var(--color-text-main);
}
.nexo-clients .nexo-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.nexo-clients .nexo-header-user .nexo-workspace-badge {
  font-size: 0.8rem;
  color: #6c757d;
  background: var(--background);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Contenedor principal */
.nexo-clients .nexo-main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* Card contenedor de secciones */
.nexo-clients .nexo-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.nexo-clients .nexo-card h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.nexo-clients .nexo-card .nexo-card-desc {
  margin: 0 0 1.25rem 0;
  font-size: 0.9rem;
  color: #6c757d;
}

/* Scrollbar personalizada (colores :root); se ensancha al pasar el cursor */
.nexo-clients,
.nexo-clients .nexo-modal-drawer,
.nexo-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--background);
}
.nexo-clients::-webkit-scrollbar,
.nexo-clients .nexo-modal-drawer::-webkit-scrollbar,
.nexo-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.nexo-clients::-webkit-scrollbar-track,
.nexo-clients .nexo-modal-drawer::-webkit-scrollbar-track,
.nexo-scrollbar::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 4px;
}
.nexo-clients::-webkit-scrollbar-thumb,
.nexo-clients .nexo-modal-drawer::-webkit-scrollbar-thumb,
.nexo-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
  min-height: 40px;
}
.nexo-clients::-webkit-scrollbar-thumb:hover,
.nexo-clients .nexo-modal-drawer::-webkit-scrollbar-thumb:hover,
.nexo-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--label-text-color);
}
.nexo-clients:hover::-webkit-scrollbar,
.nexo-clients .nexo-modal-drawer:hover::-webkit-scrollbar,
.nexo-scrollbar:hover::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

/* Modal centrado para ver contenido (descripción / concepto) */
.nexo-modal.nexo-modal-viewer {
  position: fixed;
  inset: 0;
  z-index: 1060;
  pointer-events: none;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.nexo-modal.nexo-modal-viewer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.nexo-modal-viewer .nexo-modal-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nexo-modal-viewer.is-open .nexo-modal-viewer-backdrop {
  opacity: 1;
}
.nexo-modal-viewer .nexo-modal-viewer-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nexo-modal-viewer.is-open .nexo-modal-viewer-content {
  opacity: 1;
  transform: scale(1);
}
.nexo-modal-viewer .nexo-modal-viewer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.nexo-modal-viewer .nexo-modal-viewer-body {
  padding: 1rem 1.25rem;
  overflow: auto;
  font-size: 0.9rem;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}
.nexo-modal-viewer-body.nexo-modal-viewer-body-html {
  white-space: normal;
}
.nexo-modal-viewer-body.nexo-modal-viewer-body-html img {
  max-width: 100%;
  height: auto;
}

/* Toast / notificaciones genéricas */
.nexo-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.nexo-toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: #1a1d24;
  color: #fff;
  font-size: 0.9rem;
  max-width: 360px;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.nexo-toast--visible {
  opacity: 1;
  transform: translateX(0);
}
.nexo-toast--success { background: #0d6e2f; }
.nexo-toast--error { background: #b02a37; }
.nexo-toast--info { background: #0d6efd; }
.nexo-toast-icon { flex-shrink: 0; }
.nexo-toast-message { flex: 1; }
