/* ====================================================
   MÓDULO DEDICADO: ABERTURA DE CHAMADOS - VENDEDOR
   Prefixos exclusivos .cv- para isolamento total
   ==================================================== */

/* Overlay de Fundo (Mobile e Desktop) */
.cv-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  animation: cvFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cvFadeIn {
  to { opacity: 1; }
}

@keyframes cvFadeOut {
  to { opacity: 0; }
}

/* ====================================================
   1. MODAL MOBILE PADRÃO (ESTILO NUBANK / NOVA VISITA)
   ==================================================== */
.cv-modal-mobile {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 20px)) 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  animation: cvSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

@keyframes cvSlideUp {
  to { transform: translateY(0); }
}

/* Barra de Puxar Superior (Drag Pill) */
.cv-drag-indicator {
  width: 44px;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  margin: 0 auto 16px auto;
}

/* Cabeçalho do Modal */
.cv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cv-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cv-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2546ED 0%, #4F46E5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 70, 237, 0.25);
  flex-shrink: 0;
}

.cv-header-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.cv-header-sub {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.cv-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cv-close-btn:active {
  transform: scale(0.92);
  background: #e2e8f0;
}

/* Seletores de Categoria em Grade Bento */
.cv-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  margin-bottom: 8px;
  display: block;
}

.cv-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.cv-category-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.cv-category-card i {
  color: #64748b;
  transition: color 0.2s ease;
}

.cv-category-card span {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.cv-category-card.active {
  background: rgba(37, 70, 237, 0.08);
  border-color: #2546ED;
  box-shadow: 0 4px 12px rgba(37, 70, 237, 0.15);
}

.cv-category-card.active i,
.cv-category-card.active span {
  color: #2546ED;
  font-weight: 800;
}

/* Seletores de Prioridade */
.cv-priority-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.cv-priority-pill {
  padding: 9px 8px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cv-priority-pill.active-normal {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.1);
  color: #1D4ED8;
}

.cv-priority-pill.active-alta {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  color: #B45309;
}

.cv-priority-pill.active-critica {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
  color: #B91C1C;
}

/* Campos de Formulário */
.cv-input-group {
  margin-bottom: 14px;
}

.cv-textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cv-textarea:focus,
.cv-input:focus {
  outline: none;
  border-color: #2546ED;
  box-shadow: 0 0 0 3px rgba(37, 70, 237, 0.12);
}

.cv-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Botão de Submissão */
.cv-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2546ED 0%, #4F46E5 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 70, 237, 0.3);
  transition: all 0.2s ease;
}

.cv-submit-btn:active {
  transform: scale(0.98);
}

.cv-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ====================================================
   2. JANELA FLUTUANTE MODERNA (DESKTOP)
   ==================================================== */
.cv-floating-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 10001;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cvPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}

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

.cv-window-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  cursor: grab;
  user-select: none;
}

.cv-window-header:active {
  cursor: grabbing;
}

.cv-window-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.cv-window-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cv-window-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cv-window-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.cv-window-btn.close:hover {
  background: #EF4444;
  color: #ffffff;
}

.cv-window-body {
  padding: 20px;
  max-height: 480px;
  overflow-y: auto;
}

/* Modo Minimizado Desktop */
.cv-floating-window.minimized {
  width: 260px;
}

.cv-floating-window.minimized .cv-window-body {
  display: none;
}

/* Feedback de Sucesso */
.cv-success-box {
  text-align: center;
  padding: 20px 10px;
}

.cv-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.cv-protocol-badge {
  display: inline-block;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin: 12px 0 16px 0;
  letter-spacing: 0.5px;
}
