@charset "UTF-8";

/*
 * Estabilizacion visual Fase 8.
 * Capa global y segura: no reemplaza Bootstrap CDN, respeta variables de tema
 * y corrige desbordes/capas sin reescribir las paginas.
 */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body.siavce-redesign-total,
body.siavce-bootstrap-glass {
  font-family: var(--siavce-font, Futura, "Avenir Next", "Segoe UI", Arial, sans-serif) !important;
}

.siavce-app-main,
.siavce-page,
.siavce-page-shell,
.container,
.container-fluid {
  min-width: 0;
}

.siavce-app-main {
  isolation: isolate;
}

.glass-card,
.conn-card,
.mod-card,
.doc-card,
.chat-shell,
.assistant-shell,
.conversations-panel,
.chat-main-panel,
.marketing-side-card {
  color: var(--siavce-text, #f4f8fb);
  border-color: var(--siavce-border, rgba(255,255,255,.16));
}

.glass-card *,
.conn-card *,
.mod-card *,
.doc-card *,
.chat-shell *,
.assistant-shell * {
  min-width: 0;
}

.form-control,
.form-select,
.btn,
.dropdown-menu,
.modal-content {
  font-family: var(--siavce-font, Futura, "Avenir Next", "Segoe UI", Arial, sans-serif);
}

.form-control,
.form-select {
  max-width: 100%;
}

textarea.form-control {
  resize: vertical;
}

.table-responsive,
.siavce-table-scroll,
.mod-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  max-width: 100%;
}

td,
th,
.card,
.alert,
.badge,
.btn,
.form-label,
.siavce-chip,
.preview-title,
.preview-subtitle {
  overflow-wrap: anywhere;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

video,
iframe {
  border-radius: 16px;
}

.btn,
button,
a,
[role="button"],
.tool-btn,
.ribbon-tab {
  position: relative;
}

.btn:not(:disabled),
button:not(:disabled),
a[href],
[role="button"] {
  pointer-events: auto;
}

.notif-bubble {
  right: 6.25rem;
  bottom: 1.35rem;
  z-index: 1048;
}

.siavce-chat-widget {
  z-index: 1052;
}

.notif-panel,
.siavce-chat-widget__panel {
  max-width: calc(100vw - 2rem);
}

body.siavce-view-marketing .preview-avatar[data-role="avatar"] {
  width: 64px;
  min-width: 64px;
}

body.siavce-view-marketing .marketing-preview-panel,
body.siavce-view-marketing .preview-layout,
body.siavce-view-marketing .preview-panel {
  min-width: 0;
}

body.siavce-view-marketing .preview-grid,
body.siavce-view-marketing .marketing-bottom-layout,
body.siavce-view-marketing .marketing-composer-layout {
  overflow: visible;
}

body.siavce-view-marketing .social-preview-media,
body.siavce-view-marketing .preview-media-stage {
  max-height: min(58vh, 460px);
}

body.siavce-view-marketing .social-preview-media img,
body.siavce-view-marketing .social-preview-media video {
  object-fit: contain;
}

body.siavce-view-marketing_chats .chat-app-shell,
body.siavce-view-marketing-chats .chat-app-shell {
  width: min(1580px, calc(100vw - 20px));
}

body.siavce-view-marketing_chats .chat-two-columns,
body.siavce-view-marketing-chats .chat-two-columns,
body.siavce-view-marketing_chats .chat-main-panel,
body.siavce-view-marketing-chats .chat-main-panel,
body.siavce-view-marketing_chats .conversations-panel,
body.siavce-view-marketing-chats .conversations-panel {
  min-width: 0;
}

body.siavce-view-marketing_chats .chat-messages-panel,
body.siavce-view-marketing-chats .chat-messages-panel {
  overflow-x: hidden;
}

body.siavce-view-marketing_chats .chat-message-bubble,
body.siavce-view-marketing-chats .chat-message-bubble,
body.siavce-view-marketing_chats .chat-message-stack,
body.siavce-view-marketing-chats .chat-message-stack {
  max-width: min(760px, 92%);
  overflow-wrap: anywhere;
}

body.siavce-view-documento_formulario .partida-row,
body.siavce-view-documento-formulario .partida-row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(200px, 1.5fr) minmax(90px, .6fr) minmax(110px, .7fr) minmax(110px, .7fr) minmax(42px, auto);
}

body.siavce-view-ventas,
body.siavce-view-compras,
body.siavce-view-proveedores,
body.siavce-view-documento_formulario,
body.siavce-view-documento-formulario,
body.siavce-view-facturas,
body.siavce-view-pedidos,
body.siavce-view-reportes {
  font-family: var(--siavce-font, Futura, "Avenir Next", "Segoe UI", Arial, sans-serif) !important;
  color: var(--siavce-text, #f4f8fb) !important;
}

body.siavce-view-ventas .mod-card,
body.siavce-view-compras .mod-card,
body.siavce-view-proveedores .mod-card,
body.siavce-view-documento_formulario .doc-card,
body.siavce-view-documento-formulario .doc-card {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  border: 1px solid var(--siavce-border, rgba(255,255,255,.16));
  box-shadow: var(--siavce-shadow-soft, 0 18px 44px rgba(0,0,0,.28));
}

body.siavce-view-ventas .mod-table,
body.siavce-view-compras .mod-table,
body.siavce-view-proveedores .mod-table {
  min-width: 760px;
}

body.siavce-view-clientes .siavce-entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
}

body.siavce-view-clientes .siavce-client-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.siavce-view-dashboard_cliente .cliente-dashboard-page,
body.siavce-view-dashboard-cliente .cliente-dashboard-page {
  width: min(1480px, calc(100vw - 20px));
}

body.siavce-view-ajustes .settings-shell,
body.siavce-view-ajustesuser .settings-shell,
body.siavce-view-ajustes_conexiones .conn-shell,
body.siavce-view-ajustes-conexiones .conn-shell,
body.siavce-view-seg_usuarios .usuarios-shell,
body.siavce-view-seg-usuarios .usuarios-shell {
  width: min(1440px, calc(100vw - 20px));
  margin-inline: auto;
}

body.siavce-view-ajustes .settings-header,
body.siavce-view-ajustesuser .settings-header,
body.siavce-view-ajustes_conexiones .conn-grid,
body.siavce-view-ajustes-conexiones .conn-grid {
  min-width: 0;
}

body.siavce-view-chat_interno .chat-shell,
body.siavce-view-chat-interno .chat-shell,
body.siavce-view-asistente .assistant-shell {
  max-height: none;
}

body.siavce-view-chat_interno .chat-messages,
body.siavce-view-chat-interno .chat-messages,
body.siavce-view-asistente .assistant-messages {
  min-height: 280px;
  scrollbar-gutter: stable;
}

body.siavce-view-chat_interno .chat-compose input,
body.siavce-view-chat-interno .chat-compose input,
body.siavce-view-asistente .assistant-compose input {
  min-height: 44px;
}

@media (max-width: 1100px) {
  .notif-bubble {
    right: 5.6rem;
  }

  body.siavce-view-documento_formulario .partida-row,
  body.siavce-view-documento-formulario .partida-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .siavce-app-main {
    padding-inline: 10px;
  }

  .notif-bubble {
    right: 5.2rem;
    bottom: .95rem;
  }

  .notif-toggle,
  .siavce-chat-widget__toggle {
    width: 3.55rem;
    height: 3.55rem;
  }

  body.siavce-view-marketing .social-preview-media,
  body.siavce-view-marketing .preview-media-stage {
    max-height: none;
  }

  body.siavce-view-marketing_chats .chat-message-bubble,
  body.siavce-view-marketing-chats .chat-message-bubble,
  body.siavce-view-marketing_chats .chat-message-stack,
  body.siavce-view-marketing-chats .chat-message-stack,
  body.siavce-view-chat_interno .chat-message,
  body.siavce-view-chat-interno .chat-message,
  body.siavce-view-asistente .assistant-message {
    max-width: 100%;
  }

  body.siavce-view-clientes .siavce-client-card {
    padding: 14px;
  }
}
