/* =========================================
   SISTEMA P2 - ESTILO FINAL COMPILADO
   ========================================= */

/* --- RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #ffffff;
  color: #333333;
  font-family: "Gantari", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- TYPOGRAPHY --- */
.heading-gradient {
  background: linear-gradient(135deg, #7D59C8 0%, #0371CE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* --- COMPONENTS: BUTTONS --- */
.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 3.5vw;
  background: linear-gradient(135deg, #7D59C8 0%, #0371CE 100%);
  border: none;
  border-radius: 1.5vw;
  color: white;
  font-family: "Gantari", sans-serif;
  font-size: 4vw;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  text-align: center;
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-0.1vw);
}

/* --- COMPONENTS: FORMS --- */
.input-group {
  margin-bottom: 4vw;
  display: grid;
  gap: 1.5vw;
}

.input-group label {
  font-size: 3.5vw;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.5vw;
  display: block;
}

/* Unifica estilo de Input e Select */
.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 3vw;
  background-color: #ffffff; /* Força fundo branco */
  border: 1px solid #ddd;
  border-radius: 1.5vw;
  font-family: "Gantari", sans-serif;
  font-size: 4vw;
  color: #333333;
  transition: border-color 0.3s, box-shadow 0.3s;
  
  /* Remove estilo nativo feio do browser para Selects */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Adiciona a setinha customizada no Select */
  /*background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  /*background-repeat: no-repeat;
  /*background-position: right 3vw center;
  background-size: 4vw;*/
}

/* Ajuste específico para Desktop */
@media (min-width: 64em) {
  .input-group input,
  .input-group select,
  .input-group textarea {
    padding: clamp(10px, 0.8vw, 16px) clamp(12px, 1vw, 20px);
    border-radius: clamp(5px, 0.4vw, 8px);
    font-size: clamp(14px, 1vw, 20px);
    border-width: clamp(1px, 0.1vw, 2px);
    background-position: right clamp(10px, 0.8vw, 16px) center;
    background-size: clamp(14px, 1vw, 20px);
  }
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: #7D59C8;
  box-shadow: 0 0 0 3px rgba(125, 89, 200, 0.1); /* Glow suave */
}

/* --- COMPONENTS: ALERTS --- */
.alert-error {
  background: #f8d7da;
  color: #dc3545;
  padding: 3vw;
  border-radius: 1vw;
  margin-bottom: 4vw;
  font-size: 3.5vw;
  text-align: center;
  font-weight: 600;
  border: 1px solid #f5c6cb;
}



/* --- DESKTOP BREAKPOINT (min-width: 1024px) --- */
@media (min-width: 64em) {
  
  /* Buttons Desktop */
.btn-primary {
    width: auto;
    padding: clamp(10px, 0.8vw, 16px) clamp(20px, 2vw, 40px);
    border-radius: clamp(5px, 0.4vw, 8px);
    font-size: clamp(14px, 1vw, 20px);
}

  /* Forms Desktop */
  .input-group {
    margin-bottom: 1.5vw;
    gap: 0.4vw;
  }
  .input-group label {
    font-size: 0.9vw;
  }
.input-group input,
.input-group select,
.input-group textarea {
    padding: clamp(10px, 0.8vw, 16px) clamp(12px, 1vw, 20px);
    border-radius: clamp(5px, 0.4vw, 8px);
    font-size: clamp(14px, 1vw, 20px);
    border-width: clamp(1px, 0.1vw, 2px);
}

  /* Alerts Desktop */
.alert-error {
    font-size: clamp(13px, 0.9vw, 18px);
    padding: clamp(10px, 0.8vw, 16px);
    border-radius: clamp(4px, 0.3vw, 6px);
    margin-bottom: clamp(16px, 1.5vw, 30px);
}
}

/* --- PAGE: AUTH (LOGIN/REGISTER) --- */
.auth-container {
  display: grid;
  min-height: 100vh;
  width: 100vw;
  grid-template-columns: 1fr; /* Mobile */
}

/* Lado Esquerdo: Branding */
.auth-brand {
  background: linear-gradient(135deg, #7D59C8 0%, #0371CE 100%);
  display: grid;
  place-items: center;
  padding: 5vw;
  position: relative;
}

.auth-brand::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.brand-content {
  z-index: 2;
  color: white;
  text-align: center;
}

.brand-content h1 {
  font-size: 8vw;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1vw;
}

.brand-content p {
  font-size: 4vw;
  opacity: 0.9;
}

/* Lado Direito: Formulário */
.auth-form-wrapper {
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 5vw;
}

.login-box {
  width: 100%;
  max-width: 90vw;
}

.login-box header {
  margin-bottom: 3vw;
  text-align: center;
}

.login-box header h2 {
  font-size: 6vw;
  margin-bottom: 0.5vw;
}

.login-box header p {
  font-size: 3.5vw;
  color: #666666;
}

.form-footer {
  margin-top: 4vw;
  text-align: center;
}

.form-footer a {
  color: #0371CE;
  font-size: 3.5vw;
  font-weight: 600;
}

/* AUTH DESKTOP */
@media (min-width: 64em) {
  .auth-container {
    grid-template-columns: 45vw 55vw; /* Split Screen */
  }

  .brand-content h1 { font-size: 3.5vw; }
  .brand-content p { font-size: 1.2vw; }

  .login-box { max-width: 28vw; }
  .login-box header h2 { font-size: 2.2vw; }
  .login-box header p { font-size: 1vw; }
  
  .form-footer { margin-top: 1.5vw; }
  .form-footer a { font-size: 0.9vw; }
  
  /* Botão full width no login desktop */
  .login-box .btn-primary { width: 100%; }
}

/* --- PAGE: DASHBOARD (APP SHELL) --- */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: #1a1a2e;
  color: white;
  display: none; /* Mobile Hidden */
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 2vw 1.5vw;
  display: flex;
  align-items: center;
  gap: 1vw;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
  font-weight: 700;
  background: linear-gradient(135deg, #7D59C8 0%, #0371CE 100%);
  padding: 0.5vw;
  border-radius: 0.3vw;
  font-size: 1vw;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5vw 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.8vw;
  padding: 1vw 1.5vw;
  color: rgba(255,255,255,0.7);
  font-size: 1vw;
  transition: 0.3s;
  border-left: 0.3vw solid transparent;
}

.sidebar-nav li a:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.sidebar-nav li.active a {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: #7D59C8;
}

.sidebar-footer {
  padding: 1vw;
  text-align: center;
  opacity: 0.3;
  font-size: 0.8vw;
}

/* Conteúdo Principal */
.app-content {
  background: #f4f6f9;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.topbar {
  background: white;
  padding: 3vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 0.2vw 1vw rgba(0,0,0,0.03);
}

.topbar .page-title {
  font-size: 5vw;
  color: #333;
}

.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  font-size: 1vw;
}

.topbar .user-name { display: none; }

/* Dashboard Widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
  gap: 4vw;
}

.stat-card {
  background: white;
  padding: 4vw;
  border-radius: 2vw;
  box-shadow: 0 0.5vw 1.5vw rgba(0,0,0,0.05);
}

.stat-card h3 {
  font-size: 3.5vw;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 2vw;
}

.stat-card .value {
  font-size: 8vw;
  font-weight: 700;
  color: #0371CE;
}

.content-wrapper {
  padding: 5vw;
}

/* DASHBOARD DESKTOP */
@media (min-width: 64em) {
  .app-grid {
    grid-template-columns: 18vw 1fr; /* Sidebar Fixa */
  }

  .sidebar { display: flex; }

  .topbar { padding: 1.5vw 3vw; }
  .topbar .page-title { font-size: 1.5vw; }
  .topbar .user-name { display: inline; }

  .content-wrapper { padding: 3vw; }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(20vw, 1fr));
    gap: 2vw;
  }

  .stat-card {
    padding: 2vw;
    border-radius: 0.5vw;
  }
  .stat-card:hover { transform: translateY(-0.3vw); }
  
  .stat-card h3 { font-size: 0.75vw; margin-bottom: 0.5vw; }
  .stat-card .value { font-size: 2vw; }
}


/* Botão Editar - Personalidade V3.3 */
.btn-icon-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;             /* Um pouco maior */
    height: 38px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;      /* Bordas arredondadas */
    color: #7C3AED;          /* ÍCONE JÁ NASCE ROXO (Sua Marca) */
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Sombra suave */
}

.btn-icon-edit:hover {
    background: #7C3AED;     /* Fundo Roxo no Hover */
    color: #ffffff;          /* Ícone Branco no Hover */
    border-color: #7C3AED;
    transform: translateY(-2px); /* Efeito de levitação */
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3); /* Glow Roxo */
}



/* =========================================
   LEADS DASHBOARD - ESTILO UI V2.0
   ========================================= */

/* --- 1. KPI CARDS (Dashboard Top) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.kpi-card .icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

/* Cores Semânticas dos Ícones */
.bg-purple-light { background: #f3e8ff; }
.text-purple { color: #7C3AED; }

.bg-green-light { background: #dcfce7; }
.text-green { color: #16a34a; }

.bg-blue-light { background: #e0f2fe; }
.text-blue { color: #0284c7; }

.text-orange { color: #ea580c; }

.kpi-card .label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.kpi-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.kpi-card .subtext {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* --- 2. HEADER & LAYOUT GERAL --- */
.leads-dashboard {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.heading-gradient {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #7C3AED 0%, #4c1d95 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-header p {
    color: #64748b;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

/* --- 3. FILTROS (Formulário) --- */
.filters-container {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: end;
}

.span-2 {
    grid-column: span 2;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Inputs & Selects Modernos */
.form-input, 
.form-select {
    width: 100%;
    height: auto; /* Altura fixa consistente */
    min-height: 30px;
    max-height: 60px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: #fff;
    color: #334155;
    transition: all 0.2s ease;
}

.form-input:focus, 
.form-select:focus {
    border-color: #7C3AED;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-input::placeholder { color: #cbd5e1; }

/* Grupo de Data Customizado */
.date-range-group {
    display: flex;
    gap: 10px;
}
.date-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.date-label {
    position: absolute;
    top: -18px;
    left: 0;
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Botões */
.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    height: 40px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.icon-left { margin-right: 8px; font-size: 1.1em; }

.btn-primary { background: #7C3AED; color: white; border-color: #7C3AED; }
.btn-primary:hover { background: #6d28d9; border-color: #6d28d9; }

.btn-outline-secondary { background: transparent; border-color: #cbd5e1; color: #475569; }
.btn-outline-secondary:hover { background: #f8fafc; border-color: #94a3b8; color: #1e293b; }

.btn-ghost { background: transparent; color: #64748b; }
.btn-ghost:hover { background: #f1f5f9; color: #334155; }

/* --- 4. TABELA DE DADOS --- */
.table-responsive {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow-x: auto; /* Scroll horizontal no mobile */
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px; /* Força largura mínima para não quebrar */
}

.leads-table thead th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.leads-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}
.leads-table tbody tr:last-child { border-bottom: none; }
.leads-table tbody tr:hover { background-color: #fafafa; }

.leads-table td {
    padding: 14px 16px;
    vertical-align: top;
    font-size: 0.875rem;
    color: #334155;
}

/* Colunas Específicas */
.td-date { white-space: nowrap; }
.date-main { display: block; font-weight: 500; color: #334155; }
.date-time { display: block; font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }

.lead-name { font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.lead-email { font-size: 0.8rem; color: #94a3b8; margin-top: 4px; }

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #16a34a;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}
.whatsapp-link:hover { text-decoration: underline; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-paid { background: #dcfce7; color: #15803d; }
.badge-organic { background: #ffedd5; color: #c2410c; }

.traffic-wrapper { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.traffic-source { font-size: 0.8rem; color: #64748b; }

.potential-value {
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 700;
    margin-top: 4px;
}

/* --- 5. STATUS SELECT (MODERNO) --- */
.status-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding: 6px 30px 6px 10px; /* Espaço para a seta */
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #334155;
    background-color: white;
    cursor: pointer;
    max-width: 100%;
    min-width: 130px;
    font-weight: 500;
}
.status-select:hover { border-color: #94a3b8; }
.status-select:focus, .status-select:focus-visible { border-color: #7C3AED; outline: none; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 8px;
    border-radius: 6px;
    font-size: 1.25rem;
    transition: all 0.2s;
}
.btn-icon:hover { color: #7C3AED; background: #f3e8ff; }

/* --- 6. PAGINAÇÃO --- */
.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}
.pagination-group {
    display: inline-flex;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.page-link, .page-info {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    background: white;
    display: flex;
    align-items: center;
    border-right: 1px solid #e2e8f0;
}
.page-link:last-child, .page-info:last-child { border-right: none; }
.page-link:hover { background: #f8fafc; color: #1e293b; }
.page-info { font-weight: 600; color: #1e293b; }

/* --- 7. MODAL (OVERLAY) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Animação */
    pointer-events: none; /* Animação */
    transition: opacity 0.2s ease;
}
/* Quando ativo (JS muda display, mas opacidade ajuda na transição se quiser) */
.modal-overlay[style*="display: flex"] { opacity: 1; pointer-events: auto; }

.modal-content {
    background: white;
    width: 90%;
    max-width: 900px;
    height: 85vh; /* Ocupa 85% da altura */
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}
.modal-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: #1e293b; }
.close-btn {
    background: none; border: none; font-size: 1.5rem; color: #94a3b8; cursor: pointer; line-height: 1;
}
.close-btn:hover { color: #ef4444; }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fcfcfc;
}

.modal-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: 100%;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.info-row {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #334155;
}
.info-row strong { color: #64748b; font-weight: 500; display: inline-block; width: 80px; }
.url-text { word-break: break-all; color: #2563eb; font-size: 0.8rem; }

.custom-data-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
}

/* --- 8. TIMELINE & NOTAS --- */
.timeline-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    margin-bottom: 1rem;
    padding-right: 8px;
}

.note-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}
.note-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 15px;
    width: 8px;
    height: 8px;
    background: #cbd5e1; /* Linha do tempo visual */
    border-radius: 50%;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}
.note-header strong { color: #7C3AED; }
.note-header span { color: #94a3b8; }
.note-body { font-size: 0.9rem; color: #334155; line-height: 1.5; white-space: pre-wrap; }

.add-note-box {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}
.note-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}
.note-input:focus { border-color: #7C3AED; outline: none; }

/* --- 9. RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .span-2 { grid-column: span 1; }
    
    .modal-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .modal-content { height: 95vh; width: 95%; }
    
    .kpi-grid { grid-template-columns: 1fr; }
    
    .filter-actions { justify-content: stretch; }
    .filter-actions .btn { flex: 1; }
}


/* --- BOTÕES GERAIS --- */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #7C3AED;
    color: white;
}
.btn-primary:hover { background-color: #6D28D9; }

.btn-outline-secondary {
    background-color: transparent;
    border-color: #cbd5e1;
    color: #475569;
}
.btn-outline-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.btn-ghost {
    background-color: transparent;
    color: #64748b;
}
.btn-ghost:hover {
    background-color: #f1f5f9;
    color: #334155;
}


/* --- BOTÕES DE AÇÃO (CONFIGURAÇÕES) --- */

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;       /* Largura fixa igual para ambos */
    height: 36px;      /* Altura fixa igual para ambos */
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* Botão Salvar: Fundo Roxo Claro, Ícone Roxo (Marca) */
.btn-save {
    background-color: #f3e8ff; /* Roxo bem claro */
    color: #7C3AED;            /* Roxo da marca */
}
.btn-save:hover {
    background-color: #7C3AED; /* Fica roxo sólido ao passar o mouse */
    color: #ffffff;
}

/* Botão Excluir: Fundo Transparente, Ícone Vermelho (Padrão de Perigo) */
/* Mantemos vermelho por semântica de erro, mas alinhado no tamanho */
.btn-delete {
    background-color: transparent;
    color: #ef4444;
}
.btn-delete:hover {
    background-color: #fee2e2; /* Vermelho bem claro */
    color: #dc2626;
}/* --- TABELA DE CONFIGURAÇÕES (STATUS) --- */

/* Células Específicas */
.td-edit {
    padding: 10px 5px 10px 15px; /* Reduzi o padding direito para aproximar */
    vertical-align: middle;
}

.td-actions {
    padding: 10px 15px 10px 0; /* Padding esquerdo zerado para colar no anterior */
    text-align: left;          /* Alinha à esquerda, junto do grupo de edição */
    vertical-align: middle;
    width: 1%;                 /* Truque: força a coluna a ter a largura mínima do conteúdo */
    white-space: nowrap;       /* Impede quebra de linha */
}

/* Grupo de Inputs na edição */
.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Ajuste dos Inputs Pequenos na Tabela */
.input-sm {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Wrapper do Color Picker (Mais discreto) */
.color-picker-wrapper {
    width: 28px;  /* Reduzido de 36px para 28px (menos exagerado) */
    height: 28px; /* Reduzido de 36px para 28px */
    overflow: hidden;
    border-radius: 4px;
    border: 0px solid #cbd5e1;
    cursor: pointer;
    position: relative;
    flex-shrink: 0; /* Garante que não encolha */
}

.input-color {
    width: 150%;  /* Hack para esconder a borda nativa do input color */
    height: 150%;
    transform: translate(-25%, -25%);
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

/* --- BOTÕES PADRONIZADOS (36x36) --- */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

/* Botão Salvar (Tema AZUL - Mais profissional/Menos Roxo) */
.btn-save {
    background-color: #eff6ff; /* Azul muito claro */
    color: #2563eb;            /* Azul Royal */
}
.btn-save:hover {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Botão Excluir (Vermelho Alerta) */
.btn-delete {
    color: #ef4444;
    margin-left: 5px; /* Pequeno respiro entre os botões */
}
.btn-delete:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* --- PAGE: SETTINGS (PROFILE) --- */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Reuso do estilo de Card que você já usa no Dashboard/Leads */
.settings-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 0.8vw; /* Alinhado com seu padrão desktop */
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5vw;
}

.settings-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.2vw;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.settings-card h3 svg {
    width: 20px;
    height: 20px;
    color: #7D59C8; /* Cor da sua marca */
}

/* Badge de Sessão Segura */
.badge-status-secure {
    background: #ecfdf5;
    color: #065f46;
    padding: 0.4vw 1vw;
    border-radius: 2vw;
    font-size: 0.75vw;
    font-weight: 700;
    border: 1px solid #a7f3d0;
}

/* Grid de Inputs (Reusando seu .input-group) */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5vw;
}

@media (max-width: 64em) {
    .settings-grid { grid-template-columns: 1fr; }
    .badge-status-secure { font-size: 3vw; padding: 1vw 3vw; }
}


.alert-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: none; /* Escondido por padrão */
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}



/* paginação */

/* PAGINAÇÃO PROFISSIONAL V3.8 */
.pagination-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled) {
    background: #f1f5f9;
    color: #7C3AED;
    border-color: #e2e8f0;
}

.page-btn.active {
    background: #7C3AED;
    color: #fff;
    border-color: #7C3AED;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn i {
    font-size: 18px;
}

.pagination-dots {
    color: #cbd5e1;
    padding: 0 10px;
    font-weight: bold;
    user-select: none;
}

/* Ajuste fino na tabela para acompanhar o nível */
.leads-table th { background: #f8fafc; color: #475569; font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }


/* GESTÃO DE CAMPANHAS V3.9 */
.campaign-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active { background: #dcfce7; color: #166534; }
.status-paused { background: #fee2e2; color: #991b1b; }

.pipeline-value {
    color: #10b981;
    font-weight: 700;
    font-size: 0.95rem;
}

.leads-count-group {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
}

.leads-pill {
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

.campaign-slug {
    font-family: 'Courier New', Courier, monospace;
    background: #f8fafc;
    padding: 2px 6px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    font-size: 0.85em;
    color: #64748b;
}


/* --- COMPONENTES DE EDIÇÃO DE CAMPANHA --- */

/* Títulos de Seção Internos */
.section-divider {
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

/* Container de Notas e Arquivos (Grid 50/50) */
.campaign-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2vw;
    margin-top: 2vw;
}

/* Box Interno das Notas/Arquivos */
.details-box {
    background: #fcfcfc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

/* Área de Upload (Dropzone) */
.upload-dropzone {
    padding: 2rem;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    background: white;
    transition: border-color 0.2s;
}
.upload-dropzone:hover {
    border-color: #7C3AED;
}
.upload-dropzone i {
    font-size: 2.5rem;
    color: #7C3AED;
    opacity: 0.5;
}

/* Timeline e Itens de Nota */
.notes-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.note-entry {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
}
.note-author { color: #7C3AED; }
.note-date { color: #94a3b8; }

.note-content {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.4;
}

/* Animação para Novas Notas AJAX */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
.new-note-anim {
    animation: slideIn 0.4s ease-out;
}



/* --- GRID DE DETALHES DA CAMPANHA --- */
.campaign-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .campaign-details-grid { grid-template-columns: 1fr; }
}

.details-box {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.details-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
}

/* --- LISTAGEM DE NOTAS E ARQUIVOS --- */
.note-row, .file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.note-row:hover, .file-item:hover {
    background: #f8fafc;
}

.note-info { cursor: pointer; flex: 1; }
.note-title { color: #1e293b; display: block; font-size: 1rem; }

/* Cards de Notas */
.notes-grid { display: grid; gap: 10px; margin-top: 15px; }
.note-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}
.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8rem;
}
.note-meta { color: #64748b; }
.note-actions { display: flex; gap: 5px; }

/* Editor Rich Text */
.note-editor {
    width: 100%;
    /* Altura fixa para evitar que o modal estique demais */
    height: 300px; 
    overflow-y: auto; /* Ativa o scroll interno */
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    line-height: 1.6;
    color: #334155;
    outline: none;
}

    #modalNoteEditor h2 {
        display: block !important;
        font-size: 1.5rem !important;
        font-weight: bold !important;
        margin: 10px 0 !important;
        color: #1e293b !important;
        border-width: 0px;
    }


#noteForm {
    display: flex;
    flex-direction: column;
    overflow: unset; /* Evita scroll duplo no modal */
}

.note-editor:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.note-editor b, .note-editor strong { font-weight: bold; }

.file-info { display: flex; align-items: center; gap: 12px; }
.file-name-text { font-weight: 500; color: #1e293b; }
.file-actions { display: flex; gap: 8px; }

/* --- MODAL SYSTEM --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7); /* Slate 900 com opacidade */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    max-height: 90vh;
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    width: 95%;
    max-width: 650px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0px;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* --- EDITOR TOOLBAR --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.btn-bold {
    padding: 4px 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-bold:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* Estilização do H2 dentro do editor e dos cards de visualização */
.note-editor h2, 
.note-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

/* --- UTILS --- */
.upload-icon {
    font-size: 2.5rem;
    color: #6366f1;
    margin-bottom: 0.5rem;
}

.text-danger { color: #ef4444 !important; }
.text-primary { color: #6366f1 !important; }

.note-input {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}

.note-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}



/* Container do Input */
.custom-datepicker { position: relative; }
.custom-datepicker .input-icon {
    position: absolute; right: 10px; bottom: 12px;
    color: #7C3AED; cursor: pointer; pointer-events: none;
}

/* O Calendário Manual */
.p2-calendar-picker {
    position: absolute; top: 100%; left: 0; z-index: 999;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); padding: 15px;
    width: 250px; display: none; /* Inicia escondido */
}
.p2-calendar-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.p2-calendar-days {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center;
}
.p2-day {
    padding: 5px; cursor: pointer; border-radius: 4px; font-size: 12px;
}
.p2-day:hover { background: #f3e8ff; color: #7C3AED; }
.p2-day.selected { background: #7C3AED; color: #fff; }
.p2-calendar-weekday { font-weight: bold; color: #64748b; font-size: 11px; }
    
.custom-datepicker { position: relative; }
.p2-calendar-box {
    position: absolute; top: 100%; left: 0; z-index: 1000;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); padding: 15px; width: 280px;
    margin-top: 5px; display: none; font-family: sans-serif;
}
.p2-calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.p2-calendar-header button { background: none; border: none; cursor: pointer; color: #7C3AED; font-weight: bold; }
.p2-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.p2-calendar-grid span { font-size: 11px; font-weight: bold; color: #64748b; padding-bottom: 5px; }
.p2-day { padding: 8px; cursor: pointer; border-radius: 6px; font-size: 13px; transition: 0.2s; }
.p2-day:hover { background: #f3e8ff; color: #7C3AED; }
.p2-day.today { color: #7C3AED; font-weight: bold; }
.p2-day.selected { background: #7C3AED; color: #fff; }



/* Adicione estas linhas dentro da tag <style> da sua view show.php */
/* 1. EDITOR RICO (Garante que as listas apareçam) */
.note-editor ul, .note-content ul { list-style-type: disc !important; padding-left: 25px !important; margin-bottom: 10px !important; }
.note-editor ol, .note-content ol { list-style-type: decimal !important; padding-left: 25px !important; margin-bottom: 10px !important; }
.note-editor li, .note-content li { display: list-item !important; }
.note-editor { border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; background: #fff; outline: none; min-height: 200px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; background: #f8fafc; padding: 8px; border: 1px solid #e2e8f0; border-bottom: none; border-radius: 8px 8px 0 0; }
.btn-bold { background: #fff; border: 1px solid #e2e8f0; padding: 4px 10px; border-radius: 4px; cursor: pointer; }

/* 2. ESTRUTURA DAS TAREFAS (ESTILO NOTION) */
.task-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; border-radius: 6px; transition: all 0.2s; border-bottom: 1px solid #f1f5f9; margin-bottom: 10px}
.task-item:hover { background: #f8fafc; }
.task-main { display: flex; align-items: center; gap: 12px; flex: 1; }
.task-check { background: none; border: none; font-size: 18px; color: #7C3AED; cursor: pointer; padding: 0; }

.task-info { display: flex; flex-direction: column; }
.task-title { font-size: 14px; font-weight: 500; color: #1e293b; margin-bottom: 2px; }
.task-done { opacity: 0.5; background: #fcfcfc; }
.task-done .task-title { text-decoration: line-through; color: #94a3b8; }

/* 3. METADADOS E CRONÔMETRO */
.task-metadata { font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.task-metadata i { font-size: 12px; opacity: 0.8; }
.task-metadata .sep { color: #e2e8f0; }
.task-timer-wrapper { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: #475569; }

/* 4. ESTADOS DINÂMICOS (PLAY/PAUSE) */
/* Status Iniciado com a Cor da Marca (#7C3AED) */
[data-status="iniciado"] { 
    border-left: 4px solid #7C3AED !important; 
    background: rgba(124, 58, 237, 0.05) !important; /* Roxo ultra suave no fundo */
}

[data-status="iniciado"] .task-timer-wrapper { 
    background: #7C3AED; 
    color: #ffffff; 
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

/* Animação de Pulsação com a Cor da Marca */
[data-status="iniciado"] .fa-play,
[data-status="iniciado"] .timer-run { 
    animation: pulse-brand 2s infinite; 
    color: #fff;
}

@keyframes pulse-brand { 
    0% { opacity: 1; } 
    50% { opacity: 0.85; } 
    100% { opacity: 1; } 
}

[data-status="pausado"] { border-left: 4px solid #f59e0b !important; background: #fffbeb !important; }

@keyframes pulse-green { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* 5. AÇÕES (BOTÕES QUE APARECEM NO HOVER) */
.task-actions { display: none; gap: 8px; }
.task-item:hover .task-actions { display: flex; }
.btn-task-action { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 13px; padding: 4px; transition: color 0.2s; }
.btn-task-action:hover { color: #7C3AED; }

/* 6. MODAIS E INPUTS */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 9999; }
.modal-content { background: #fff; padding: 2rem; border-radius: 12px; width: 100%; max-width: 600px; }
.task-input-wrapper .form-input { border: 1px dashed #cbd5e1; background: transparent; transition: all 0.3s; }
.task-input-wrapper .form-input:focus { border-style: solid; border-color: #7C3AED; background: #fff; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }


.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon i { position: absolute; left: 12px; color: #94a3b8; font-size: 14px; }
.input-with-icon .form-input { padding-left: 35px !important; }

/* Destaque ao focar no campo */
.input-with-icon .form-input:focus + i { color: #7C3AED; }

.btn-primary.btn-sm { padding: 6px 12px; font-size: 13px; }


.identity-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.identity-grid .filter-group {
    flex: 1 1 calc(50% - 15px); /* Divide em 2 colunas */
    min-width: 200px;
}

.identity-grid .full-width {
    flex: 1 1 100% !important; /* Ocupa a linha toda */
}

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon i { position: absolute; left: 12px; color: #94a3b8; font-size: 14px; transition: color 0.3s; }
.input-with-icon .form-input { padding-left: 35px !important; border: 1px solid #e2e8f0; border-radius: 8px; height: 42px; width: 100%; }

/* Feedback visual ao focar */
.input-with-icon .form-input:focus { border-color: #7C3AED; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }
.input-with-icon .form-input:focus + i { color: #7C3AED; }

/* Ajuste para o select com ícone */
select.form-input {
    appearance: none; /* Remove a seta padrão em alguns navegadores */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}


/* Estilo para tarefas finalizadas */
.task-done {
    background: #f1f5f9 !important; /* Cinza bem claro */
    border-left: 4px solid #94a3b8 !important; /* Borda neutra */
    opacity: 0.7;
}

.task-done .task-title {
    text-decoration: line-through;
    color: #64748b;
}

.task-done .task-timer-wrapper {
    background: #e2e8f0;
    color: #475569;
    box-shadow: none;
}

/* Esconde botões de ação em tarefas concluídas (exceto o de excluir) */
.task-done .btn-task-action:not(.text-danger) {
    display: none !important;
}


.timeline { position: relative; padding-left: 30px; border-left: 2px solid #e2e8f0; margin-left: 10px; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { 
    content: ""; position: absolute; left: -37px; top: 5px; 
    width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; 
}

/* Cores por Ação */
.log-iniciar::before, .log-retomar::before { background: #16a34a; }
.log-pausar::before { background: #f59e0b; }
.log-concluir::before { background: #7C3AED; }

.log-date { font-size: 11px; color: #94a3b8; display: block; }
.log-action { font-size: 13px; font-weight: 600; color: #1e293b; text-transform: capitalize; }
.log-timer { font-size: 12px; color: #7C3AED; font-family: monospace; }


.link-item-mini {
    display: flex;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 13px;
}
.link-item-mini a { text-decoration: none; color: #475569; font-weight: 500; }
.link-item-mini button { background: none; border: none; color: #94a3b8; cursor: pointer; }
.link-item-mini button:hover { color: #ef4444; }


/* Container para alinhar input e botão */
.input-row-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Espaço entre o input e o botão de abrir */
}

.flex-grow {
    flex-grow: 1;
}

/* Botão de abrir link */
.btn-action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background-color: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-action-link:hover {
    background-color: #7C3AED;
    color: #ffffff;
    border-color: #7C3AED;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.2);
}


.btn-action-link {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}


/* Animação de brilho verde ao salvar */
.link-success-flash {
    animation: flashSuccess 2s ease-out;
}

@keyframes flashSuccess {
    0% { background-color: transparent; }
    20% { background-color: #dcfce7; border-color: #22c55e; transform: scale(1.02); }
    100% { background-color: #f1f5f9; border-color: transparent; transform: scale(1); }
}

/* Garante que o item tenha uma borda para a animação aparecer melhor */
.link-item-mini {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}


.proposal-result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-top: 10px;
}
.result-label { display: block; font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: 1px; }
.result-value { display: block; font-size: 28px; font-weight: 800; color: #1e293b; }



/* =========================================
   TRAVA VISUAL PARA LEADS CONVERTIDOS
========================================= */
.lead-locked input, 
.lead-locked select, 
.lead-locked textarea {
    pointer-events: none !important;
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
}

.lead-locked .hide-on-locked {
    display: none !important;
}



/* =========================================
   MÓDULO DE CLIENTES (Listagem e Raio-X)
   ========================================= */
.clients-module .border-left-primary { border-left: 4px solid #7C3AED !important; } /* Roxo da sua marca */
.clients-module .border-left-success { border-left: 4px solid #16a34a !important; } /* Verde sucesso */
.clients-module .bg-info-light { background-color: #e0f2fe; color: #0284c7; }
.clients-module .table-hover tbody tr:hover { background-color: #f8fafc; }
.clients-module .badge-light.border { border-color: #e2e8f0 !important; background: #f8fafc; }