/* =====================================================
   SYNCRUS - App CSS
   Sistema de Gestão de Projetos
   ===================================================== */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --sidebar-bg: #1e1b4b;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(99,102,241,0.3);
  --sidebar-text: rgba(255,255,255,0.85);
  --sidebar-muted: rgba(255,255,255,0.45);
  
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* =====================================================
   LOGIN
   ===================================================== */

.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 50%, #6366f1 100%);
  z-index: 1000;
}

.login-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  max-width: 200px;
  margin-bottom: 24px;
}

.login-box h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

.login-form { text-align: left; }

/* Campo senha com botão olho */
.input-password-row {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-row input {
  flex: 1;
  padding-right: 40px !important;
}

.btn-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 1;
}
.btn-eye:hover { color: var(--primary); }

/* Badge master */
.master-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  letter-spacing: 0.3px;
}
.master-badge i { font-size: 9px; }

.user-card-master {
  border: 1.5px solid #f59e0b44;
  background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.role-badge.role-master {
  background: linear-gradient(135deg, #f59e0b22, #d97706);
  color: #78350f;
  border: 1px solid #f59e0b44;
  font-weight: 700;
}



.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  border: 1px solid #fecaca;
}

.login-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease;
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 64px;
  gap: 8px;
}

.sidebar-logo {
  max-height: 32px;
  max-width: 140px;
  object-fit: contain;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--sidebar-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
  color: white;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  margin-bottom: 2px;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
}

.nav-item.active .nav-icon {
  color: #a5b4fc;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: var(--sidebar-muted);
  transition: var(--transition);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: inherit;
}

.nav-label {
  transition: opacity 0.2s ease;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge { opacity: 0; pointer-events: none; }
.sidebar.collapsed .sidebar-logo { opacity: 0; width: 0; }
.sidebar.collapsed .sidebar-logo-icon { opacity: 1; }
.sidebar.collapsed .sidebar-logo-icon.hidden { display: block !important; opacity: 1; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-footer .btn-icon { opacity: 0; pointer-events: none; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.user-profile:hover { background: var(--sidebar-hover); }

.user-info {
  flex: 1;
  overflow: hidden;
  transition: var(--transition);
}

.user-name {
  display: block;
  color: white;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  color: var(--sidebar-muted);
  font-size: 11px;
  text-transform: capitalize;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  position: relative;
}

.page {
  display: none;
  padding: 24px;
  min-height: 100%;
  animation: fadeIn 0.2s ease;
}

.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   PAGE ACTIONS BAR
   ===================================================== */

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* =====================================================
   FORMS
   ===================================================== */

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

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea { resize: vertical; }

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { margin-bottom: 16px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.form-group-color { flex: 0 0 64px; }
.form-group-color input[type="color"] {
  height: 40px;
  padding: 2px 4px;
  cursor: pointer;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { background: #dc2626; }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

.btn-icon {
  background: transparent;
  border: none;
  padding: 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-icon.active {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-back:hover { background: var(--border); color: var(--text); }

/* =====================================================
   SEARCH
   ===================================================== */

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  flex: 1;
  max-width: 320px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar i { color: var(--text-muted); font-size: 13px; }

.search-bar input {
  border: none;
  outline: none;
  padding: 8px 0;
  font-size: 14px;
  width: 100%;
  background: transparent;
}

.select-sm {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: white;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.select-sm:focus { border-color: var(--primary); }

/* =====================================================
   MODALS
   ===================================================== */

/* ── MODAL SYSTEM ──────────────────────────────────────────────────────── */
/*
  Estrutura padrão (único padrão aceito):
  <div id="modal-x" class="modal hidden">   ← wrapper fixo, tela cheia
    <div class="modal-overlay" onclick="closeModal(...)"></div>  ← fundo escuro
    <div class="modal-content [modal-sm|modal-lg|modal-xl]">    ← caixa branca centralizada
      ...
    </div>
  </div>
*/

/* Wrapper fixo — ocupa a tela toda, centraliza o conteúdo */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.modal.hidden { display: none !important; }

/* Fundo escuro — posicionado absolutamente dentro do wrapper */
.modal > .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  pointer-events: all;
  cursor: default;
}

/* Caixa branca centralizada — acima do overlay */
.modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg, 12px);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  animation: modalIn 0.22s ease;
  pointer-events: all;
}

/* Tamanhos alternativos */
.modal-sm .modal-content,
.modal-content.modal-sm { max-width: 400px; }
.modal-lg .modal-content,
.modal-content.modal-lg { max-width: 720px; }
.modal-xl .modal-content,
.modal-content.modal-xl { max-width: 900px; }

/* Atalhos de tamanho aplicados diretamente no wrapper .modal */
.modal.modal-sm > .modal-content { max-width: 400px; }
.modal.modal-lg > .modal-content { max-width: 720px; }
.modal.modal-xl > .modal-content { max-width: 900px; }

/* Modal secundário (ex: mini-modal de opções) — aparece sobre outros modais */
.modal-top { z-index: 600; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
}

.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body { padding: 0 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 24px;
  margin-top: 8px;
}

/* =====================================================
   CARDS DE PROJETO
   ===================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.project-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius) 0 0 var(--radius);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}

.project-card-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 8px;
}

.project-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.project-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-progress {
  margin-bottom: 12px;
}

.progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* =====================================================
   PROJECT DETAIL
   ===================================================== */

.project-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.project-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.project-detail-title h2 {
  font-size: 20px;
  font-weight: 700;
}

.project-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-color-dot.sm {
  width: 10px;
  height: 10px;
}

/* =====================================================
   PROJECT TABS
   ===================================================== */

.project-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 0;
}

.project-tabs::-webkit-scrollbar { height: 0; }

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-content.active { display: block; }

/* =====================================================
   KANBAN BOARD
   ===================================================== */

.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 400px;
  align-items: flex-start;
}

.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

.kanban-col {
  flex: 0 0 260px;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}

.kanban-col-header.overdue {
  border-bottom-color: var(--danger);
  color: var(--danger);
  background: #fef2f2;
}

.kanban-col-header.today {
  border-bottom-color: var(--warning);
  color: #92400e;
  background: #fffbeb;
}

.kanban-col-header.week {
  border-bottom-color: var(--info);
  color: #1e40af;
  background: #eff6ff;
}

.kanban-col-header.month {
  border-bottom-color: var(--success);
  color: #166534;
  background: #f0fdf4;
}

.kanban-col-header.unscheduled {
  border-bottom-color: var(--secondary);
  color: var(--secondary);
  background: var(--surface-2);
}

.kanban-count {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

.kanban-cards {
  padding: 10px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =====================================================
   TASK CARDS
   ===================================================== */

.task-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.task-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.task-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.task-card-assignee {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.task-card-due {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-card-due.overdue { color: var(--danger); font-weight: 600; }
.task-card-due.today { color: var(--warning); font-weight: 600; }

.task-card-priority {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.task-card-progress {
  flex: 1;
}

.task-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* =====================================================
   PRIORITY COLORS
   ===================================================== */

.priority-low { background-color: var(--success); }
.priority-medium { background-color: var(--warning); }
.priority-high { background-color: var(--danger); }
.priority-urgent { background-color: #7c3aed; }

.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =====================================================
   STATUS BADGES
   ===================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-active, .status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-todo { background: #f1f5f9; color: #475569; }
.status-review { background: #fef3c7; color: #92400e; }
.status-done, .status-completed { background: #dcfce7; color: #15803d; }
.status-paused { background: #fef9c3; color: #854d0e; }
.status-archived { background: #f1f5f9; color: #64748b; }
.status-pending { background: #f1f5f9; color: #64748b; }

/* =====================================================
   GANTT CHART
   ===================================================== */

.gantt-wrapper {
  overflow-x: auto;
  padding-bottom: 10px;
}

.gantt-table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gantt-table th {
  background: var(--surface-2);
  padding: 8px 6px;
  border: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
}

.gantt-table td {
  border: 1px solid var(--border);
  padding: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.gantt-task-name {
  font-weight: 600;
  padding: 6px 12px !important;
  min-width: 200px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-bar-cell { width: 30px; padding: 3px !important; }

.gantt-bar {
  height: 18px;
  border-radius: 3px;
  opacity: 0.85;
}

.gantt-today-marker {
  background: rgba(239, 68, 68, 0.15);
}

/* =====================================================
   TIMELINE
   ===================================================== */

.timeline-wrapper { padding: 8px 0; }

.timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 28px;
  bottom: -20px;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  z-index: 1;
  background: var(--primary);
  color: white;
}

.timeline-content {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.timeline-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.timeline-content p { font-size: 12.5px; color: var(--text-secondary); }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* =====================================================
   TASKS LIST
   ===================================================== */

.task-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.task-list-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.task-list-item.done { opacity: 0.65; }

.task-list-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}

.task-list-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
  font-size: 10px;
}

.task-list-title {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
}

.task-list-due {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-list-compact { display: flex; flex-direction: column; gap: 6px; }

/* =====================================================
   TASK DETAIL MODAL
   ===================================================== */

.task-detail-body {
  display: flex;
  gap: 24px;
}

.task-detail-main { flex: 1; }
.task-detail-sidebar { width: 240px; flex-shrink: 0; }

.task-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.meta-item i { color: var(--text-muted); font-size: 12px; }
.meta-item span { font-weight: 500; color: var(--text); }

.task-detail-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.task-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-section {
  margin-bottom: 20px;
}

.task-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.task-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.task-description {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-bottom: 4px;
}

.checklist-item:hover { background: var(--surface-2); }

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.checklist-item.done span { text-decoration: line-through; color: var(--text-muted); }

.checklist-progress {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Comments */
.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.comment-bubble {
  flex: 1;
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 10px 14px;
}

.comment-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.comment-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

.comment-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.comment-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
}

.comment-input textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: var(--transition);
}

.comment-input textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* History */
.history-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.history-item:last-child { border-bottom: none; }

.history-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.history-text { color: var(--text-secondary); line-height: 1.5; }
.history-time { color: var(--text-muted); font-size: 11px; }

/* Subtasks */
.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.subtask-item:hover { border-color: var(--primary); }

/* =====================================================
   CHAT
   ===================================================== */

.chat-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height) - 48px);
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-sidebar {
  width: 240px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar-header h3 {
  font-size: 14px;
  font-weight: 700;
}

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

.chat-project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
}

.chat-project-item:hover { background: var(--surface-2); }
.chat-project-item.active { background: var(--primary-light); color: var(--primary); }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.chat-header h3 { font-size: 15px; font-weight: 700; }

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

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 2px; }

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

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

.chat-message-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-message.own .chat-message-body { align-items: flex-end; }

.chat-bubble {
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: 12px 12px 12px 4px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 480px;
  word-break: break-word;
}

.chat-message.own .chat-bubble {
  background: var(--primary);
  color: white;
  border-radius: 12px 12px 4px 12px;
}

.chat-reply-bubble {
  background: rgba(0,0,0,0.05);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 400px;
}

.chat-message.own .chat-reply-bubble {
  border-left-color: rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.8);
}

.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.chat-message-name { font-weight: 600; color: var(--text-secondary); }

.chat-message-actions {
  opacity: 0;
  display: flex;
  gap: 4px;
}

.chat-message:hover .chat-message-actions { opacity: 1; }

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: white;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  position: relative;
}

.chat-input-row textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: var(--transition);
  max-height: 120px;
}

.chat-input-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary);
}

.chat-reply-preview button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  margin-left: auto;
  padding: 2px;
  font-size: 12px;
}

.mention-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
}

.chat-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 200px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.mention-option:hover { background: var(--surface-2); }

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}

.chat-empty i { font-size: 40px; }

/* =====================================================
   CALENDAR
   ===================================================== */

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-nav h2 {
  font-size: 16px;
  font-weight: 700;
  min-width: 200px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.cal-header-cell {
  background: var(--surface-2);
  text-align: center;
  padding: 8px 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-day {
  background: white;
  min-height: 90px;
  padding: 6px 8px;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.cal-day:hover { background: var(--surface-2); }
.cal-day.other-month { background: #fafafa; }
.cal-day.today { background: var(--primary-light); }
.cal-day.selected { background: #e0e7ff; }

/* Dia selecionado pelo clique */
.cal-day.cal-day-selected {
  background: #e0e7ff;
  outline: 2px solid #6366f1;
  outline-offset: -2px;
  position: relative;
}
.cal-day.cal-day-selected .cal-day-num {
  color: #6366f1;
  font-weight: 800;
}
.cal-day.cal-day-selected.today .cal-day-num {
  background: #6366f1;
  color: white;
}
/* Indicador de que o dia tem eventos */
.cal-day.has-events .cal-day-num::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: #6366f1;
  border-radius: 50%;
  margin: 2px auto 0;
}
.cal-day.today.has-events .cal-day-num::after {
  background: white;
}

.cal-day-num {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-day.today .cal-day-num {
  color: var(--primary);
  background: var(--primary);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
}

.cal-event-dot {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  color: white;
}

.calendar-events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.event-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border-left: 4px solid var(--primary);
}

.event-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.event-card .event-time { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.event-card .event-project { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* =====================================================
   DOCUMENTS
   ===================================================== */

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.document-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: var(--transition);
}

.document-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.doc-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.doc-name {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.doc-actions {
  display: flex;
  gap: 6px;
}

/* =====================================================
   USERS
   ===================================================== */

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.user-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.user-card:hover { border-color: var(--primary); }

.user-card-info { flex: 1; }
.user-card-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.user-card-email { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }

.role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
}

.role-admin { background: #fae8ff; color: #86198f; }
.role-internal { background: #dbeafe; color: #1d4ed8; }
.role-external { background: #f1f5f9; color: #475569; }

/* =====================================================
   AVATAR
   ===================================================== */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* =====================================================
   FEED
   ===================================================== */

.feed-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.feed-section {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.section-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2 i { color: var(--primary); }

.link-sm {
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.announcement-list { padding: 12px 16px; }

.announcement-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.announcement-item:last-child { border-bottom: none; }

.announcement-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.announcement-body { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.announcement-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.announcement-pinned { border-left: 3px solid var(--warning); padding-left: 10px; }

.event-list { padding: 12px; }

.event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: var(--transition);
}

.event-item:hover { background: var(--surface-2); }

.event-date-badge {
  width: 44px;
  flex-shrink: 0;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  background: var(--primary-light);
}

.event-date-badge .day {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.event-date-badge .month {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
}

.event-title { font-size: 13.5px; font-weight: 600; }
.event-time-text { font-size: 11.5px; color: var(--text-muted); }

.birthday-list { padding: 12px; }

.birthday-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.birthday-item:hover { background: var(--surface-2); }

/* =====================================================
   REPORTS
   ===================================================== */

.reports-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  height: calc(100vh - var(--topbar-height) - 96px);
}

.reports-sidebar {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
}

.reports-sidebar h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.reports-project-list { margin-bottom: 16px; }
.reports-separator { border-top: 1px solid var(--border); margin: 16px 0; }

.report-project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
}

.report-project-item:hover { background: var(--surface-2); }
.report-project-item.active { background: var(--primary-light); color: var(--primary); }

.report-content {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 24px;
}

/* Report HTML */
.report-print-btn {
  position: sticky;
  top: 0;
  background: white;
  padding: 12px 0;
  display: flex;
  gap: 10px;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* =====================================================
   ANNOUNCEMENTS PAGE
   ===================================================== */

.announcement-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.announcement-card.pinned { border-left: 4px solid var(--warning); }
.announcement-card.priority-urgent { border-left: 4px solid var(--danger); }
.announcement-card.priority-high { border-left: 4px solid var(--warning); }

.announcement-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.announcement-card-title {
  font-size: 16px;
  font-weight: 700;
}

/* =====================================================
   MINUTES
   ===================================================== */

.minute-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.minute-card:hover { border-color: var(--primary); }
.minute-card-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.minute-card-meta { font-size: 12px; color: var(--text-muted); }

/* =====================================================
   TOGGLE SWITCH
   ===================================================== */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-dark);
  border-radius: 22px;
  transition: var(--transition);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* =====================================================
   COLOR PICKER ROW
   ===================================================== */

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-row input[type="color"] {
  width: 40px;
  height: 36px;
  padding: 2px 4px;
  cursor: pointer;
}

/* =====================================================
   ATTENDEES LIST
   ===================================================== */

.attendees-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 50px;
}

.attendee-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--transition);
}

.attendee-chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.error i { color: var(--danger); }
.toast.info { border-left: 4px solid var(--info); }
.toast.info i { color: var(--info); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.warning i { color: var(--warning); }

/* =====================================================
   LOADING
   ===================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   UTILITIES
   ===================================================== */

.hidden { display: none !important; }

.empty-state {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-lg i { font-size: 48px; opacity: 0.4; }
.empty-state-lg p { font-size: 15px; font-weight: 500; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }

.text-muted { color: var(--text-muted); font-size: 12.5px; }
.text-bold { font-weight: 700; }

hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
  .sidebar,
  .topbar,
  .report-print-btn,
  .no-print { display: none !important; }
  
  .report-content {
    overflow: visible;
    padding: 0;
    border: none;
  }
  
  body { font-size: 11pt; color: black; overflow: visible; height: auto; }
  .app, .main-content, .page-container, .page { overflow: visible; }
  
  .page { display: block !important; }
  
  .print-report {
    max-width: 100%;
    padding: 20px;
  }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
  .feed-grid { grid-template-columns: 1fr; }
  .task-detail-body { flex-direction: column; }
  .task-detail-sidebar { width: 100%; }
  .reports-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
}

@media (max-width: 700px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .nav-label { display: none; }
  .sidebar .sidebar-logo { display: none; }
  .sidebar .sidebar-logo-icon { display: block !important; opacity: 1; }
  .projects-grid { grid-template-columns: 1fr; }
  .users-grid { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .kanban-board { flex-direction: column; }
  .kanban-col { flex: none; width: 100%; }
  .chat-sidebar { width: 200px; }
}

/* =====================================================
   VIEW TOGGLE
   ===================================================== */

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

/* =====================================================
   PHASE BADGE
   ===================================================== */

.phase-badge {
  font-size: 11.5px;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* =====================================================
   DOCS ACTIONS
   ===================================================== */

.docs-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* Members manage */
.member-manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-bottom: 4px;
}

.member-manage-item:hover { background: var(--surface-2); }

.phases-manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.phases-manage-item .status-label { margin-left: auto; }

/* =====================================================
   PROJECT LIST VIEW
   ===================================================== */

.projects-list-view .project-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
}

/* =====================================================
   TASK CARD - ACTIONS
   ===================================================== */

.task-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 2px;
}

.task-card:hover .task-card-actions { display: flex; }

/* Gantt tooltip */
.gantt-tooltip {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Overdue indicator */
.overdue-indicator {
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
}

/* ── Status dropdown do projeto ───────────────────────────────── */
.project-status-dropdown { display: inline-flex; align-items: center; }

.status-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 175px;
  padding: 6px 0;
  animation: fadeInDown .15s ease;
}

.status-dropdown-menu.hidden { display: none; }

.status-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
  transition: background .15s;
}
.status-dropdown-item:hover { background: var(--bg-hover); }

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Status badges extras */
.status-prospecting { background: #eff6ff; color: #2563eb; }
.status-cancelled   { background: #fef2f2; color: #dc2626; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Google Calendar Panel ─────────────────────────────────────────────── */
.gc-connected-panel,
.gc-connect-panel {
  display: flex;
  flex-direction: column;
}

.gc-connected-panel .btn,
.gc-connect-panel .btn {
  justify-content: center;
}

#google-calendar-panel-wrapper {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Indicador de evento Google no calendário */
.cal-event-dot .fa-google {
  opacity: 0.8;
}

/* Badge de sincronizado */
.synced-badge {
  font-size: 10px;
  background: #22c55e22;
  color: #22c55e;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* ── Document Cards ────────────────────────────────────────────────────── */
.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: box-shadow 0.2s, transform 0.15s;
}
.doc-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.doc-drop-zone:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light, #6366f108) !important;
}

/* =============================================================================
   CRM — Kanban & Leads
============================================================================= */

/* Stats Bar */
.crm-stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.crm-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.crm-stat-num { font-size: 20px; font-weight: 700; color: #1e293b; }
.crm-stat-label { font-size: 11px; color: #94a3b8; font-weight: 500; }

/* Toolbar */
.crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Kanban Board */
.crm-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 280px);
  align-items: flex-start;
}
.crm-board::-webkit-scrollbar { height: 6px; }
.crm-board::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

.crm-column {
  min-width: 260px;
  max-width: 280px;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}
.crm-column-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px 10px 0 0;
  background: #fff;
}
.crm-stage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.crm-column-title { color: #1e293b; }
.crm-column-count {
  background: #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.crm-cards-container {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  transition: background 0.15s;
}
.crm-cards-container.drag-over {
  background: #6366f11a;
  border-radius: 0 0 10px 10px;
}

/* Lead Card */
.crm-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.15s, opacity 0.2s;
  user-select: none;
}
.crm-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.crm-card.dragging { opacity: 0.4; cursor: grabbing; transform: scale(0.97); }
.crm-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.crm-card-title { font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.3; }
.crm-prio-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.crm-card-company { font-size: 11px; color: #64748b; margin-bottom: 4px; }
.crm-card-meta { font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.crm-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.crm-card-value { font-size: 12px; font-weight: 700; color: #10b981; }
.crm-card-due { font-size: 10px; color: #94a3b8; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f1f5f9; }
.crm-card-due.overdue { color: #ef4444; }
.avatar-xs { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; }

.crm-add-card {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  border: 1.5px dashed #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.crm-add-card:hover { color: #6366f1; border-color: #6366f1; background: #6366f108; }

/* Stage Badge */
.crm-stage-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Lead List Table */
.crm-list-table-wrapper { overflow-x: auto; }
.crm-list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crm-list-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; border-bottom: 2px solid var(--border); }
.crm-list-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.crm-list-table tr:hover td { background: #f8fafc; }
.text-danger { color: #ef4444; }

/* Painel Lateral Lead */
.crm-lead-panel {
  position: fixed;
  top: 56px;
  right: -420px;
  width: 400px;
  height: calc(100vh - 56px);
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  z-index: 200;
  overflow: hidden;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.crm-lead-panel.open { right: 0; }
.lead-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  flex-shrink: 0;
}
.lead-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.lead-panel-section { }
.lead-panel-info-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 13px; color: #475569; }

/* Atividades */
.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.activity-item:last-child { border-bottom: none; }
.activity-item.done { opacity: 0.5; }
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Stage Manager */
.stage-manager-item { display: flex; align-items: center; gap: 8px; }

/* CRM Setup */
.crm-setup-screen { display: flex; align-items: center; justify-content: center; height: 100%; }

/* =============================================================================
   WHATSAPP — Interface Web Clone
============================================================================= */

/* Layout principal */
.wa-layout {
  display: flex;
  height: 100%;
  background: #f0f2f5;
}

/* Sidebar WA */
.wa-sidebar {
  width: 360px;
  min-width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e9edef;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wa-sidebar-header {
  background: #fff;
  border-bottom: 1px solid #e9edef;
  flex-shrink: 0;
}
.wa-session-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.wa-session-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: none;
  border-radius: 20px;
  background: #f0f2f5;
  color: #667781;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.wa-session-tab.active { background: #25d366; color: #fff; }
.wa-session-tab:hover:not(.active) { background: #e9edef; }
.wa-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #94a3b8; }
.wa-status-dot.connected { background: #25d366; }
.wa-status-dot.connecting { background: #f59e0b; animation: pulse 1s infinite; }
.wa-status-dot.error { background: #ef4444; }
.wa-session-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }

.wa-session-status-bar {
  padding: 4px 12px;
  display: flex;
  align-items: center;
  font-size: 12px;
  min-height: 28px;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
}
.wa-session-status-bar.connected { background: #22c55e12; }
.wa-session-status-bar.error, .wa-session-status-bar.disconnected { background: #ef444412; }

.wa-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 10px;
  color: #667781;
}
.wa-search-bar input {
  flex: 1;
  border: none;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
  outline: none;
  color: #111;
}
.wa-icon-btn { color: #667781; }
.wa-icon-btn:hover { color: #128c7e; }

/* Lista conversas */
.wa-conversations-list { flex: 1; overflow-y: auto; }
.wa-conv-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.1s;
  align-items: center;
}
.wa-conv-item:hover { background: #f5f6f6; }
.wa-conv-item.active { background: #f0f2f5; }
.wa-conv-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.wa-conv-avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.wa-conv-info { flex: 1; min-width: 0; }
.wa-conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.wa-conv-name { font-size: 15px; font-weight: 500; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-conv-time { font-size: 11px; color: #667781; flex-shrink: 0; }
.wa-conv-bottom { display: flex; justify-content: space-between; align-items: center; }
.wa-conv-last { font-size: 13px; color: #667781; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-unread-badge {
  background: #25d366;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Chat Area */
.wa-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' opacity='0.05'%3E%3Ctext y='50' font-size='40'%3E💬%3C/text%3E%3C/svg%3E");
}
.wa-welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: #667781;
}
.wa-welcome-icon { font-size: 56px; color: #25d36640; }
.wa-welcome-screen h3 { font-size: 22px; font-weight: 300; color: #41525d; }
.wa-welcome-screen p { font-size: 14px; }

.wa-chat-layout { display: flex; flex-direction: column; height: 100%; }
.wa-chat-header {
  padding: 10px 16px;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.wa-chat-contact-info { flex: 1; }
.wa-chat-contact-name { font-size: 15px; font-weight: 600; color: #111; }
.wa-chat-contact-status { font-size: 12px; color: #667781; }

/* Mensagens */
.wa-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wa-date-sep {
  text-align: center;
  margin: 10px 0;
}
.wa-date-sep span {
  background: #d9fdd3;
  color: #667781;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}
.wa-msg-wrapper { display: flex; margin-bottom: 2px; }
.wa-msg-wrapper.from-me { justify-content: flex-end; }
.wa-msg-wrapper.from-them { justify-content: flex-start; }
.wa-msg-bubble {
  max-width: 65%;
  padding: 7px 10px 6px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.wa-msg-bubble.out {
  background: #d9fdd3;
  border-radius: 8px 0 8px 8px;
}
.wa-msg-bubble.in {
  background: #fff;
  border-radius: 0 8px 8px 8px;
}
.wa-msg-text { font-size: 14px; color: #111; line-height: 1.4; word-break: break-word; }
.wa-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: #667781;
}
.wa-doc-msg { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #128c7e; }
.wa-empty-chat { text-align: center; color: #94a3b8; padding: 32px; margin: auto; }

/* Input Area */
.wa-input-area {
  padding: 8px 12px;
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.wa-input-wrapper {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
}
.wa-msg-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  color: #111;
  resize: none;
  font-family: inherit;
  min-height: 24px;
  max-height: 120px;
  background: transparent;
  line-height: 1.5;
}

/* Setup Screen */
.wa-setup-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #f0f2f5;
}
.wa-setup-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.wa-setup-icon {
  width: 72px;
  height: 72px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  margin: 0 auto 16px;
}
.wa-setup-card h2 { font-size: 22px; margin-bottom: 8px; color: #1e293b; }
.wa-setup-card p { color: #64748b; font-size: 14px; margin-bottom: 20px; }
.wa-setup-info { margin-top: 24px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.wa-setup-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #475569;
}
.wa-setup-step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.wa-setup-note {
  margin-top: 20px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 12px;
  color: #64748b;
  text-align: left;
  line-height: 1.5;
}
.wa-setup-note code { background: #e2e8f0; padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* QR Demo */
.wa-qr-demo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wa-demo-qr { padding: 8px; background: #fff; border-radius: 8px; border: 2px solid #e2e8f0; }
.wa-qr-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #128c7e; font-size: 13px; }

/* Input SM */
.input-sm {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.input-sm:focus { border-color: var(--primary); }

/* BTN XS */
.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 4px; }

/* ── WhatsApp: melhorias botões de sessão ── */
.wa-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 14px;
  color: #54656f;
}
.wa-icon-btn:hover { background: #f0f2f5; border-color: #e2e8f0; }

/* Status disconnected na barra */
.wa-session-status-bar.disconnected { background: #fef2f2; border-bottom: 1px solid #fee2e2; }
.wa-session-status-bar.error        { background: #fef2f2; border-bottom: 1px solid #fee2e2; }
.wa-session-status-bar.connecting   { background: #fffbeb; border-bottom: 1px solid #fde68a; }
.wa-session-status-bar.connected    { background: #f0fdf4; border-bottom: 1px solid #bbf7d0; }

/* Welcome screen com aviso de desconectado */
.wa-welcome-screen .btn { margin-top: 12px; }

/* =============================================================================
   PRODUTOS, ORÇAMENTOS & CONFIGURAÇÕES
   ============================================================================= */

/* Product catalog item */
.product-catalog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s;
}
.product-catalog-item:hover { border-color: #6366f1; }

/* Modal XL */
.modal-xl .modal-content {
  max-width: 900px;
  width: 95vw;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #64748b;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e2e8f0;
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.data-table tbody tr:hover td { background: #f8fafc; }

/* Settings Layout */
.settings-layout {
  max-width: 900px;
  margin: 0 auto;
}
.settings-tabs {
  display: flex;
  gap: 4px;
  background: white;
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  flex-wrap: wrap;
}
.settings-tab {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.settings-tab:hover { background: #f1f5f9; color: #1e293b; }
.settings-tab.active { background: #6366f1; color: white; }

.settings-panel {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

/* Form grid 2 cols */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .settings-tabs { flex-direction: column; }
  .settings-tab { min-width: unset; }
}

/* ==========================================================================
   CAMPANHAS EM MASSA
   ========================================================================== */

.campaigns-header {
  margin-bottom: 20px;
}

.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.campaign-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  cursor: pointer;
  transition: all .15s;
  border: 1.5px solid transparent;
}
.campaign-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(99,102,241,.15);
  transform: translateY(-1px);
}

.campaign-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.campaign-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.campaign-card-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
}

.campaign-progress {
  background: #e2e8f0;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.campaign-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .5s;
  min-width: 3px;
}

.campaign-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}

.campaign-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* Painel de detalhe de campanha */
.campaign-detail {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 60px;
}

.campaign-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

/* Estatísticas em grid */
.campaign-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 24px;
}
@media (max-width: 600px) {
  .campaign-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid #e2e8f0;
}
.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 16px;
}
.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}
.stat-card-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Preview de mensagens WhatsApp */
.recipient-preview-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}

.recipient-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.whatsapp-bubble {
  background: #dcf8c6;
  border-radius: 12px 12px 4px 12px;
  padding: 10px 14px;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* Avatar pequeno */
.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* Tab nav para destinatários */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: #6366f1; }
.tab-btn.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }

.cmp-tab-content { padding-top: 8px; }

/* Empty states */
.empty-state-sm {
  text-align: center;
  padding: 32px 20px;
  color: #94a3b8;
}
.empty-state-sm p { margin: 0; font-size: 14px; }

/* Overlay para painel lateral */
.crm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 29;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.crm-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
