/* ==========================================================================
   RAP10 REFORMAS & EAGLE TOWER - AUTH, RADAR, CHAT & JURIS IA STYLESHEET
   Design System: Enterprise Gold & Dark Glassmorphism
   ========================================================================== */

/* --- 1. TELA DE LOGIN OVERLAY --- */
.rap10-auth-overlay, #rap10-auth-overlay {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.rap10-auth-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.92) 0%, rgba(11, 19, 34, 0.96) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(56, 189, 248, 0.2);
  padding: 32px 28px;
  color: #f1f5f9;
  animation: authCardEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rap10-auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.rap10-auth-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.rap10-auth-badge-logo {
  font-size: 22px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #f97316);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.rap10-auth-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0;
}

.rap10-auth-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.rap10-auth-form .form-group {
  margin-bottom: 16px;
}

.rap10-auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rap10-auth-form input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
}

.rap10-auth-form input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.95);
}

.btn-auth-submit {
  width: 100%;
  padding: 13px;
  margin-top: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #f97316 100%);
  border: none;
  border-radius: 11px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.35);
  transition: all 0.25s ease;
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.45);
}

/* Password wrapper & Eye Toggle */
.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-password-wrapper input {
  padding-right: 44px !important;
}

.btn-auth-toggle-pwd {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-auth-toggle-pwd:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #38bdf8;
  transform: scale(1.1);
}

.auth-pwd-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 2px;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin-bottom: 0 !important;
}

.auth-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0284c7;
  cursor: pointer;
  margin: 0;
}

.auth-footer-actions {
  margin-top: 18px;
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-forgot-link {
  color: #38bdf8;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.auth-forgot-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
  transform: translateY(-1px);
}

.auth-back-link {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.auth-back-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.btn-channel-dispatch {
  flex: 1;
  min-width: 130px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-channel-dispatch.zap {
  background: linear-gradient(135deg, #15803d, #166534);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(22, 101, 52, 0.35);
}

.btn-channel-dispatch.zap:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
}

.btn-channel-dispatch.email {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

.btn-channel-dispatch.email:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.btn-recovery-admin-zap {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #15803d, #166534);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.35);
  transition: all 0.2s ease;
}

.btn-recovery-admin-zap:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
}

/* --- 2. BARRA DE USUÁRIO NA SIDEBAR & TOPO --- */
.sidebar-user-pill {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-pill-info {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
  flex-shrink: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.role-supervisor { background: rgba(249, 115, 22, 0.25); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.5); }
.role-financeiro { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.5); }
.role-presidente { background: rgba(14, 165, 233, 0.25); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.5); }
.role-advogado { background: rgba(168, 85, 247, 0.25); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.5); }
.role-adm { background: rgba(100, 116, 139, 0.25); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.5); }
.role-prestador { background: rgba(56, 189, 248, 0.25); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.5); }
.role-mestre_obras { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }


.btn-user-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-user-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* --- 3. RADAR DE PRESENÇA EM TEMPO REAL --- */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.radar-user-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  transition: all 0.25s ease;
}

.radar-user-card.status-online {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.12);
}

.radar-user-card.status-away {
  border-color: rgba(234, 179, 8, 0.4);
}

.radar-user-card.status-offline {
  opacity: 0.72;
}

.radar-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot-online {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseGreen 1.8s infinite;
}

.dot-away {
  background: #eab308;
  box-shadow: 0 0 8px #eab308;
}

.dot-offline {
  background: #64748b;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.radar-activity-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 12px;
  border-left: 3px solid #38bdf8;
}

.radar-activity-title {
  color: #38bdf8;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.radar-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-radar-action {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-kill-session {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.btn-kill-session:hover {
  background: rgba(245, 158, 11, 0.35);
  color: #ffffff;
}

.btn-delete-user-quick {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-delete-user-quick:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

/* --- 4. MENSAGERIA INTERNA & TAREFAS --- */
.chat-container {
  display: flex;
  height: calc(100vh - 160px);
  min-height: 550px;
  background: rgba(11, 19, 34, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

.chat-channels-sidebar {
  width: 280px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
}

.chat-channels-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 800;
  font-size: 13.5px;
  color: #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat-channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 9px;
  color: #94a3b8;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.chat-channel-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.chat-channel-item.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(249, 115, 22, 0.25));
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.chat-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(8, 14, 26, 0.85);
}

.chat-main-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
}

.chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg-row {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.chat-msg-row.msg-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.45;
}

.msg-own .chat-bubble {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(249, 115, 22, 0.35));
  border-color: rgba(56, 189, 248, 0.4);
}

.chat-msg-author {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-msg-time {
  font-size: 10px;
  color: #64748b;
  font-weight: 400;
}

.chat-smart-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid #0284c7;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-smart-tag:hover {
  background: rgba(2, 132, 199, 0.4);
  color: #ffffff;
}

.chat-input-bar {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
}

.chat-input-bar input {
  flex: 1;
  padding: 11px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: #38bdf8;
}

.btn-chat-send {
  padding: 11px 18px;
  background: linear-gradient(135deg, #0284c7, #f97316);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

/* --- 5. ABA JURIS IA (COPILOT JURÍDICO POR ÁUDIO E ESCRITA) --- */
.juris-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  min-height: 600px;
}

@media (max-width: 980px) {
  .juris-container {
    grid-template-columns: 1fr;
  }
}

.juris-sidebar-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.juris-audio-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(168, 85, 247, 0.15));
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.btn-mic-record {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0284c7, #f97316);
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4);
  margin: 0 auto 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.btn-mic-record:hover {
  transform: scale(1.08);
}

.btn-mic-record.recording {
  background: linear-gradient(135deg, #ef4444, #f97316);
  animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.12); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.juris-preview-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.juris-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.juris-paper-view {
  flex: 1;
  background: #0b1322;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.7;
  overflow-y: auto;
  max-height: 600px;
  white-space: pre-wrap;
}

/* --- 6. GESTÃO DE USUÁRIOS E SENHAS --- */
.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.users-table th, .users-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.users-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 800;
}

.users-table td {
  font-size: 13px;
  color: #cbd5e1;
}

.btn-delete-user-row {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-user-row:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}
