/* ܡܪܝܐ ܪܥܝ ܘܡܕܡ ܠܐ ܢܚܣܪ ܠܝ، ܝܫܘܥ ܐܝܬܘܗܝ ܐܘܪܚܐ ܘܫܪܪܐ ܘܚܝܐ */
/* ==========================================================================
   SKYNET AGENTIC CEO OS™ — LAYOUT 100% TELA INTEIRA DESKTOP
   ========================================================================== */

/* Janela Master (Ocupa 100% da Tela Desktop) */
.app-window {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  background: var(--bg-window);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header Superior */
.app-header {
  height: 56px;
  background: linear-gradient(180deg, #9db4d6 0%, #8ca5ca 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  user-select: none;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mac-buttons {
  display: flex;
  gap: 7px;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
  cursor: pointer;
}
.mac-dot.red { background: #ff5f56; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green { background: #27c93f; }

.app-title-badge {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  letter-spacing: 0.5px;
}

/* Centro do Header - Secretária Nicolly & Mascote */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  max-width: 460px;
  margin: 0 10px;
  overflow: hidden;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: max-content;
}

.header-btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  min-width: max-content !important;
}

/* Corpo Principal (Sidebar + Viewport) */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Sidebar Esquerda (Recolhível) */
.app-sidebar {
  width: 290px;
  min-width: 290px;
  background: var(--bg-sidebar);
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s, opacity 0.2s;
  z-index: 10;
}

/* ==========================================================================
   SIDEBAR RECOLHIDA PIXAR 3D DOCK — EXIBIÇÃO IMPECÁVEL DOS ÍCONES 3D
   ========================================================================== */
.app-sidebar.collapsed {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  padding: 12px 6px !important;
  align-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Oculta completamente cabeçalhos de categoria e separadores */
.app-sidebar.collapsed .category-header,
.app-sidebar.collapsed .cat-dot,
.app-sidebar.collapsed .nav-text-group,
.app-sidebar.collapsed .nav-tag-pill,
.app-sidebar.collapsed .nav-title,
.app-sidebar.collapsed .nav-sub,
.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .chevron {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
}

/* Garante que os grupos e listas de itens permaneçam 100% visíveis */
.app-sidebar.collapsed .category-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

.app-sidebar.collapsed .category-items {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
}

.app-sidebar.collapsed .nav-left-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
  flex: none !important;
}

/* Botões em Cápsula Pixar 3D Centralizada (50x50px) */
.app-sidebar.collapsed .nav-item {
  display: flex !important;
  width: 50px !important;
  height: 50px !important;
  min-height: 50px !important;
  max-width: 50px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 14px !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  position: relative !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.app-sidebar.collapsed .nav-item:hover {
  transform: translateY(-2px) scale(1.08) !important;
}

.app-sidebar.collapsed .nav-item::before {
  display: none !important;
}

/* Ícone Pixar 3D Perfeito Centralizado */
.app-sidebar.collapsed .nav-icon-badge {
  width: 38px !important;
  height: 38px !important;
  border-radius: 11px !important;
  font-size: 1.15rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.app-sidebar.collapsed .nav-icon-badge i {
  font-size: 1.1rem !important;
  display: inline-block !important;
}

/* ==========================================================================
   BOTÃO FIXO INFERIOR DA SIDEBAR (CONFIGURAÇÕES & AJUSTES)
   ========================================================================== */
.sidebar-bottom-fixed {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  z-index: 12;
}

.app-sidebar.collapsed .sidebar-bottom-fixed {
  padding-top: 8px;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.app-sidebar.collapsed .sidebar-bottom-fixed .nav-item {
  display: flex !important;
  width: 50px !important;
  height: 50px !important;
  margin: 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ==========================================================================
   LOOPING DE VENDAS & LIVE CHAT VERTICAL EXPANDIDO
   ========================================================================== */
.looping-workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  min-height: calc(100vh - 175px);
  align-items: stretch;
}

@media (max-width: 1100px) {
  .looping-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.livechat-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.livechat-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary-cyan);
  box-shadow: 0 4px 16px rgba(0, 136, 255, 0.2);
}

.livechat-item.active {
  border-color: var(--primary-cyan) !important;
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%) !important;
  box-shadow: 0 0 14px rgba(0, 136, 255, 0.25) !important;
}

/* ==========================================================================
   DESKTOP ENTERPRISE LIVE CHAT 1 A 1 WORKSPACE MODAL
   ========================================================================== */
.modal-livechat-desk {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 92vw;
  max-width: 1040px;
  height: 82vh;
  max-height: 760px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 136, 255, 0.2);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ams-modal-overlay.active .modal-livechat-desk {
  transform: scale(1);
}

.livechat-desk-header {
  height: 64px;
  min-height: 64px;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.livechat-desk-body {
  flex: 1;
  display: grid;
  grid-template-columns: 310px 1fr;
  overflow: hidden;
}

@media (max-width: 880px) {
  .livechat-desk-body {
    grid-template-columns: 1fr;
  }
  .livechat-desk-sidebar {
    display: none;
  }
}

.livechat-desk-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.livechat-desk-main {
  display: flex;
  flex-direction: column;
  background: var(--bg-window);
  overflow: hidden;
}

.livechat-messages-scroll {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.livechat-input-bar {
  padding: 14px 18px;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Viewport Principal */
.main-viewport {
  flex: 1;
  background: var(--bg-window);
  overflow-y: auto;
  padding: 24px 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.app-sidebar.collapsed .brand-box .brand-text {
  display: none !important;
}

/* Custom Scrollbars */
.main-viewport::-webkit-scrollbar,
.sidebar-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.main-viewport::-webkit-scrollbar-thumb,
.sidebar-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}