/* ═══════════════════════════════════════════════════════════════════════
 * LFT CRM v2.6 — style_patch.css
 * ═══════════════════════════════════════════════════════════════════════
 * Adicione a referência DEPOIS do style.css no index.html:
 *   <link rel="stylesheet" href="style.css">
 *   <link rel="stylesheet" href="style_patch.css">  <-- nova linha
 * ═══════════════════════════════════════════════════════════════════════
 */

/* ── SIDEBAR FIX: sem sobreposição, z-index estável, responsiva ──────── */
#sidebar {
  /* garante que a sidebar fique sempre ACIMA do conteúdo em telas menores
     mas NUNCA sobreponha o grid principal em desktop */
  position: relative;
  z-index: 50;                    /* ↓ era 100 (conflitava com modais/dropdowns) */
  flex-shrink: 0;                 /* nunca encolhe abaixo da largura definida */
  box-sizing: border-box;
}

/* Garante que o main content nunca seja sobreposto */
#main {
  min-width: 0;                   /* permite que o conteúdo se ajuste sem estourar */
  position: relative;
  z-index: 1;
}

/* Toggle permanece acima da borda mas abaixo de modais */
.sidebar-toggle { z-index: 55; }

/* ── Responsividade em tablet/mobile ─────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar {
    position: fixed;              /* flutua em mobile */
    top: 0; bottom: 0; left: 0;
    z-index: 900;                 /* acima do conteúdo mas abaixo de modais (1000+) */
    transform: translateX(-100%);
    transition: transform 0.25s ease, width 0.25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.3);
  }
  #sidebar.mobile-visible { transform: translateX(0); }
  #sidebar.open { width: 240px; min-width: 240px; }

  /* backdrop quando sidebar mobile está aberta */
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 890;
  }
  body.sidebar-mobile-open .sidebar-backdrop { display: block; }
}

/* ── OLHO DE SENHA (input com toggle de visibilidade) ────────────────── */
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input[type="password"],
.password-wrap input[type="text"] {
  padding-right: 40px !important;  /* espaço pra o botão */
}
.password-eye {
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  cursor: pointer; padding: 0;
  color: var(--text2);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.password-eye:hover { background: var(--bg3); color: var(--text); }
.password-eye svg { width: 18px; height: 18px; pointer-events: none; }

/* ── OBSERVAÇÃO NO CARD DO PIPELINE (quadro kanban) ──────────────────── */
.pipeline-card-observation {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(249, 115, 22, 0.12);      /* laranja sutil */
  border-left: 3px solid #f97316;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 120px;
  overflow-y: auto;
}
.pipeline-card-observation::before {
  content: "📌 Observação";
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #f97316;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ── INDICAÇÃO: DATA DE RECEBIMENTO ──────────────────────────────────── */
.indicacao-received-date {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--bg3);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.indicacao-received-date::before {
  content: "📅";
  font-size: 10px;
}

/* ── CHECKBOX "SELECIONAR TODOS" (destaque acima da lista) ──────────── */
.select-all-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.select-all-row:hover { background: var(--bg4); }
.select-all-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.select-all-row label {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  flex: 1;
}
.select-all-counter {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
}

/* ── LIXEIRA / TRASH ─────────────────────────────────────────────────── */
.trash-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.trash-toolbar .trash-count {
  font-size: 13px; color: var(--text2);
  margin-right: auto;
}
.trash-toolbar .trash-count strong { color: var(--text); }

.trash-filter-chip {
  padding: 4px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.trash-filter-chip:hover { background: var(--bg4); color: var(--text); }
.trash-filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.trash-list {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 16px;
}
.trash-item {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s;
}
.trash-item:hover { background: var(--bg3); }
.trash-item.selected { background: rgba(26,86,219,0.10); border-color: var(--primary); }
.trash-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.trash-item-body { min-width: 0; }
.trash-item-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trash-item-meta {
  font-size: 11px; color: var(--text3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.trash-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.trash-type-badge[data-type="lead"]           { background: rgba(59,130,246,0.2); color: #3b82f6; }
.trash-type-badge[data-type="client"]         { background: rgba(16,185,129,0.2); color: #10b981; }
.trash-type-badge[data-type="task"]           { background: rgba(139,92,246,0.2); color: #8b5cf6; }
.trash-type-badge[data-type="indicacao"]      { background: rgba(249,115,22,0.2); color: #f97316; }
.trash-type-badge[data-type="appointment"]    { background: rgba(236,72,153,0.2); color: #ec4899; }
.trash-type-badge[data-type="library_file"],
.trash-type-badge[data-type="library_folder"] { background: rgba(168,85,247,0.2); color: #a855f7; }

.trash-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--bg3);
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}
.trash-btn:hover { background: var(--bg4); }
.trash-btn.restore { color: #10b981; border-color: rgba(16,185,129,0.3); }
.trash-btn.restore:hover { background: rgba(16,185,129,0.1); }
.trash-btn.purge { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.trash-btn.purge:hover { background: rgba(239,68,68,0.1); }

/* Empty state */
.trash-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text3);
}
.trash-empty .emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.trash-empty .title { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
.trash-empty .sub { font-size: 13px; }

/* ── GOOGLE CALENDAR STATUS (agenda) ─────────────────────────────────── */
.gcal-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.gcal-status-badge.connected    { background: rgba(16,185,129,0.15); color: #10b981; }
.gcal-status-badge.disconnected { background: rgba(107,114,128,0.15); color: var(--text3); }
.gcal-status-badge.no-creds     { background: rgba(239,68,68,0.15); color: var(--danger); }
.gcal-status-badge::before {
  content: "●";
  font-size: 10px;
}

/* Tenta tornar o botão "Conectar Google" destacado */
.gcal-connect-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.gcal-connect-btn:hover {
  background: #f9fafb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.gcal-connect-btn img { width: 18px; height: 18px; }

/* ── NAV ITEM "LIXEIRA" no menu (só aparece para admin) ────────────── */
.nav-item[data-nav="trash"] {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
}
.nav-item[data-nav="trash"] .nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

/* ── PIPELINE SELECT no modal de novo lead ─────────────────────────── */
.lead-pipeline-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.lead-pipeline-select .form-group { margin-bottom: 0; }

/* ── OBSERVAÇÃO — TEXTAREA grande no modal ─────────────────────────── */
.observation-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}
.observation-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,86,219,0.2);
}
.observation-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  font-style: italic;
}
