/* css/nina.css — Estilos da Nina como Assistente Global do Portal e Cronograma RPA */

/* Trigger no Cabeçalho */
.nina-hdr-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.nina-hdr-trigger:hover {
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.nina-avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

/* Backdrop */
.nina-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
/* Backdrop desativado para janela flutuante estilo assistente */
.nina-backdrop {
  display: none !important;
}

/* --------------------------------------------------------------------------
   BOTAO FLUTUANTE DA NINA (FAB NO CANTO INFERIOR DIREITO)
   -------------------------------------------------------------------------- */
.nina-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.nina-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(6, 182, 212, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
}
.nina-fab:active {
  transform: scale(0.95);
}
.nina-fab.nina-fab-hidden,
.nina-drawer.open ~ .nina-fab {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.5) !important;
}
.nina-fab-badge {
  display: none !important;
}

/* --------------------------------------------------------------------------
   JANELA FLUTUANTE DE CHAT DA NINA (ESTILO NOW ASSIST / COPILOT)
   -------------------------------------------------------------------------- */
.nina-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 48px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  z-index: 99995;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
  font-family: inherit;
}
.nina-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.nina-drawer.maximized {
  width: 580px;
  height: calc(100vh - 110px);
  max-height: 820px;
}
@media (max-width: 480px) {
  .nina-drawer {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    height: calc(100vh - 96px);
  }
  .nina-fab {
    right: 16px;
    bottom: 16px;
  }
}

/* Cabeçalho da Janela Flutuante */
.nina-drawer-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.nina-drawer-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nina-drawer-sparkle {
  color: #14b8a6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nina-drawer-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nina-head-action-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.nina-head-action-btn:hover {
  background: var(--soft);
  color: var(--ink);
}

/* Barra de Subtítulo / Status */
.nina-drawer-subbar {
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--soft);
  font-size: 11px;
  color: var(--muted);
}
.nina-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  display: inline-block;
  margin-right: 4px;
}

/* Corpo do Drawer */
.nina-drawer-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
}

/* Área de Conversa */
.nina-chat-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 10px;
}
.nina-chat-bubble {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.nina-bubble-nina {
  align-self: flex-start;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 2px;
}
.nina-bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}
.nina-bubble-user * {
  color: #ffffff !important;
}

/* Ações Rápidas em Bolhas */
.nina-action-card {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nina-action-card .btn-primary-action {
  background: var(--accent) !important;
  color: #0e1811 !important; /* Alto contraste: preto carvão sobre verde sálvia */
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 7px 12px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100%;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nina-action-card .btn-primary-action:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #000000 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
:root[data-mode="light"] .nina-action-card .btn-primary-action {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.nina-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nina-action-chip {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 16px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
}
.nina-action-chip:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Rodapé de Envio do Chat (Estilo Now Assist) */
.nina-drawer-footer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nina-input-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.nina-input-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}
.nina-chat-textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
  box-sizing: border-box;
}
.nina-input-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}
.nina-icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.nina-icon-btn:hover {
  background: var(--soft);
  color: var(--ink);
}
.nina-send-circle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.nina-send-circle-btn:hover {
  opacity: 0.9;
  transform: scale(1.06);
}
.nina-disclaimer {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.nina-copy-icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.nina-copy-icon-btn:hover {
  background: var(--soft);
  color: var(--ink);
}

/* TABELA DE CRONOGRAMA RPA (IDÊNTICA À DA IMAGEM) */
.nina-crono-table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
  width: 100%;
}
.nina-crono-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 11.5px;
  line-height: 1.35;
}
.nina-crono-table th {
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 8px 6px;
  border-right: 1px solid #334155;
  font-size: 11.5px;
  box-sizing: border-box;
}
[data-mode="light"] .nina-crono-table th {
  background: #1e293b;
  color: #f8fafc;
}
.nina-crono-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
  box-sizing: border-box;
}
/* Definição rigorosa e harmônica das 7 colunas da tabela de cronograma */
.nina-crono-table th:nth-child(1),
.nina-crono-table td:nth-child(1) {
  width: 48px;
  text-align: center;
  white-space: nowrap;
}
.nina-crono-table th:nth-child(2),
.nina-crono-table td:nth-child(2) {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}
.nina-crono-table th:nth-child(3),
.nina-crono-table td:nth-child(3) {
  width: auto;
  min-width: 180px;
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
}
.nina-crono-table th:nth-child(4),
.nina-crono-table td:nth-child(4) {
  width: 50px;
  text-align: center;
  white-space: nowrap;
}
.nina-crono-table th:nth-child(5),
.nina-crono-table td:nth-child(5) {
  width: 84px;
  text-align: center;
  white-space: nowrap;
}
.nina-crono-table th:nth-child(6),
.nina-crono-table td:nth-child(6) {
  width: 60px;
  text-align: center;
  white-space: nowrap;
}
.nina-crono-table th:nth-child(7),
.nina-crono-table td:nth-child(7) {
  width: 78px;
  text-align: center;
  white-space: nowrap;
}
.nina-crono-table tr:last-child td {
  border-bottom: none;
}

/* Células de Status Percentual */
.nina-crono-pct {
  text-align: right;
  font-weight: 700;
  font-family: monospace;
  font-size: 12px;
  padding: 5px 8px !important;
  cursor: pointer;
  border-radius: 2px;
  user-select: none;
}
.nina-crono-pct-100 {
  background: #22c55e !important;
  color: #052e16 !important;
}
.nina-crono-pct-high {
  background: #4ade80 !important;
  color: #052e16 !important;
}
.nina-crono-pct-mid {
  background: #fbbf24 !important;
  color: #451a03 !important;
}
.nina-crono-pct-zero {
  background: #f87171 !important;
  color: #450a0a !important;
}

/* Linha de Total */
.nina-crono-row-total td {
  background: #fef08a;
  color: #713f12;
  font-weight: 800;
  border-top: 2px solid #ca8a04;
}
.nina-crono-row-total .nina-crono-pct-total {
  background: #fde047 !important;
  color: #713f12 !important;
  font-size: 13px;
}

/* Botão de transformar passo em To-Do */
.nina-crono-btn-todo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
  margin-left: 6px;
  opacity: 0.85;
  transition: all 0.15s;
}
.nina-crono-btn-todo:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  opacity: 1;
}

/* Lista de Tarefas da Nina */
.nina-todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.nina-todo-check {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  accent-color: var(--accent);
  cursor: pointer;
}
.nina-todo-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.35;
}
.nina-todo-done {
  text-decoration: line-through;
  opacity: 0.55;
}

/* Badges de Fase RPA (Init, Process, End) */
.nina-fase-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nina-fase-init {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.nina-fase-process {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.nina-fase-end {
  background: rgba(168, 85, 247, 0.15);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Barra de Ferramentas do Cronograma */
.nina-crono-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.nina-crono-ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

/* Modais Dinâmicos da Nina */
.nina-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nina-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.nina-modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.nina-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nina-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.nina-modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nina-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


