/* ==========================================================================
   WORKLY — SISTEMA COMPLETO: CHAT INTERNO, LOGIN REAL & SUBMENUS
   ========================================================================== */

/* MODAL DE CHAT INTERNO COMPLETO */
.workly-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 22, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: worklyFadeIn 0.2s ease;
}

.workly-chat-window {
  width: 100%;
  max-width: 900px;
  height: 82vh;
  max-height: 750px;
  background: #08142e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 40px rgba(15, 111, 255, 0.25);
}

@media (max-width: 768px) {
  .workly-chat-window {
    flex-direction: column;
    height: 92vh;
    border-radius: 20px;
  }
}

/* LISTA LATERAL DE CONVERSAS */
.workly-chat-sidebar {
  width: 320px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 22, 51, 0.95);
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .workly-chat-sidebar {
    width: 100%;
    height: 180px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.workly-chat-sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workly-chat-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.workly-conv-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 4px;
  background: transparent;
  border: 1px solid transparent;
}

.workly-conv-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.workly-conv-card.active {
  background: linear-gradient(135deg, rgba(15, 111, 255, 0.18), rgba(138, 63, 252, 0.18));
  border-color: rgba(15, 111, 255, 0.35);
}

/* ÁREA PRINCIPAL DA CONVERSA */
.workly-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #08142e;
}

.workly-chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 22, 51, 0.6);
}

.workly-chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* BALÕES DE MENSAGEM */
.workly-msg-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.workly-msg-sent {
  align-self: flex-end;
  background: linear-gradient(135deg, #0F6FFF 0%, #3B8BFF 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(15, 111, 255, 0.3);
}

.workly-msg-received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}

.workly-msg-system {
  align-self: center;
  max-width: 90%;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  border-radius: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 20px;
}

.workly-msg-proposal-card {
  align-self: flex-start;
  max-width: 85%;
  background: linear-gradient(135deg, rgba(138, 63, 252, 0.2), rgba(15, 111, 255, 0.15));
  border: 1px solid rgba(138, 63, 252, 0.4);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.workly-chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 22, 51, 0.9);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* MODAL DE SUBMENUS (PROPOSTAS, EXTRATO, SCORE, WEX AI, CONFIG) */
.workly-sub-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 22, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99996;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.workly-sub-card {
  background: #08142e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  color: #fff;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(15, 111, 255, 0.25);
}

/* ANIMAÇÃO */
@keyframes worklyFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
