/* =====================================================
   CRM RV — Design System
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===================== TOKENS ===================== */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(79, 70, 229, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.1);

  --transition: 0.2s ease;
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===================== LAYOUT ===================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.sidebar-brand .brand-text h2 {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-brand .brand-text p {
  font-size: 11px; color: var(--text-muted);
}

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

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 8px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-link:hover {
  background: rgba(99,102,241,0.12);
  color: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(79,70,229,0.1));
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.25);
}

.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--danger); }

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px;
  min-height: 100vh;
}

/* ===================== HEADER ===================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ===================== CARDS ===================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ===================== BOTÕES ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: rgba(99,102,241,0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(0,0,0,0.05); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-card); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===================== TABELA ===================== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background var(--transition);
}
tbody tr:hover { background: rgba(0,0,0,0.03); }

td { padding: 14px 16px; vertical-align: middle; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-warning .badge-dot { background: #f59e0b; }

.badge-info { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-info .badge-dot { background: #3b82f6; }

.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-success .badge-dot { background: #10b981; }

.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-danger .badge-dot { background: #ef4444; }

.badge-primary { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* ===================== FILTROS ===================== */
.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.filters-bar .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }

/* ===================== PAGINAÇÃO ===================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.page-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.page-link:hover { border-color: var(--primary); color: var(--primary-light); }
.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  padding: 28px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.modal-overlay.open .modal { transform: scale(1); }

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

.modal-title { font-size: 18px; font-weight: 700; }

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-detail-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.modal-detail-item:last-of-type { border-bottom: none; }
.modal-detail-label { font-size: 12px; color: var(--text-muted); font-weight: 500; min-width: 90px; }
.modal-detail-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===================== KANBAN ===================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.kanban-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-column-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.col-count {
  background: rgba(0,0,0,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
}

.kanban-cards {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.kanban-cards.drag-over {
  background: rgba(99,102,241,0.05);
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
}

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.kanban-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

.kanban-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  border-color: rgba(99,102,241,0.3);
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: scale(1.02);
  cursor: grabbing;
}

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

.card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

/* ── Interesse picker ── */
.interesse-picker { position: relative; flex-shrink: 0; }

.interesse-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px 3px 8px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.03em;
  line-height: 1.5;
  transition: filter 0.2s, box-shadow 0.2s;
}
.interesse-trigger:hover { filter: brightness(1.15); }

/* Dot via ::before for colored states */
.interesse-trigger.interesse-muito_interessado::before,
.interesse-trigger.interesse-interessado::before,
.interesse-trigger.interesse-frio::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.interesse-trigger.interesse-muito_interessado::before { background: #16a34a; }
.interesse-trigger.interesse-interessado::before      { background: #2563eb; }
.interesse-trigger.interesse-frio::before             { background: #64748b; }

.interesse-badge { border-radius: 20px; white-space: nowrap; }
.interesse-muito_interessado { background: rgba(22,163,74,0.12);  color: #15803d; box-shadow: 0 0 0 1px rgba(22,163,74,0.3); }
.interesse-interessado       { background: rgba(37,99,235,0.10);  color: #1d4ed8; box-shadow: 0 0 0 1px rgba(37,99,235,0.28); }
.interesse-frio              { background: rgba(100,116,139,0.1); color: #475569; box-shadow: 0 0 0 1px rgba(100,116,139,0.25); }

.interesse-empty {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px dashed rgba(148,163,184,0.28);
  padding: 2px 7px;
  font-weight: 600;
}
.interesse-empty:hover { background: rgba(148,163,184,0.08); border-color: rgba(148,163,184,0.45); color: var(--text-secondary); filter: none; }

.interesse-chevron { opacity: 0.45; flex-shrink: 0; }

.interesse-dropdown {
  display: none;
  position: fixed;
  z-index: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.2);
  padding: 5px;
  min-width: 178px;
}
.interesse-dropdown.open { display: block; animation: dropdownIn 0.12s ease; }
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.interesse-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.interesse-option[data-value="muito_interessado"]:hover { background: rgba(22,163,74,0.1);  color: #15803d; }
.interesse-option[data-value="interessado"]:hover       { background: rgba(37,99,235,0.1);  color: #1d4ed8; }
.interesse-option[data-value="frio"]:hover              { background: rgba(100,116,139,0.1); color: #475569; }
.interesse-remover {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 3px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 5px 5px;
}
.interesse-remover:hover { background: rgba(239,68,68,0.09); color: #f87171; }

.interesse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-muito       { background: #16a34a; }
.dot-interessado { background: #2563eb; }
.dot-frio        { background: #64748b; }

.card-product {
  font-size: 12px;
  color: var(--primary-light);
  margin-bottom: 10px;
  font-weight: 500;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.card-meta-item svg { width: 12px; height: 12px; flex-shrink: 0; }

.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #25D366 0%, #1aad55 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37,211,102,0.22);
  transition: filter 0.2s, box-shadow 0.2s;
  position: relative;
}
.whatsapp-btn::before {
  content: '';
  position: absolute;
  top: -7px; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.whatsapp-btn:hover { filter: brightness(1.1); box-shadow: 0 4px 14px rgba(37,211,102,0.38); }
.whatsapp-btn svg { width: 14px; height: 14px; }

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.2s, box-shadow 0.2s;
}
.card-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.card-action-btn svg { width: 14px; height: 14px; }

/* Separador antes do primeiro botão de ação quando não há WhatsApp */
.btn-iniciar, .btn-encerrar {
  position: relative;
  margin-top: 14px;
}
.btn-iniciar::before, .btn-encerrar::before {
  content: '';
  position: absolute;
  top: -7px; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
/* Quando há WhatsApp antes: remove o separador duplicado */
.whatsapp-btn ~ .btn-iniciar,
.whatsapp-btn ~ .btn-encerrar {
  margin-top: 6px;
}
.whatsapp-btn ~ .btn-iniciar::before,
.whatsapp-btn ~ .btn-encerrar::before { display: none; }

.btn-iniciar {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.28);
}
.btn-iniciar:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 4px 16px rgba(99,102,241,0.45);
}

.btn-encerrar {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,0.28);
}
.btn-encerrar:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 4px 16px rgba(34,197,94,0.45);
}

.btn-perder {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-perder:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,0.35);
}

/* Status column colors */
[data-status="nao_atendido"] .kanban-card::before { background: var(--warning); }
[data-status="negociando"] .kanban-card::before { background: var(--info); }
[data-status="concluido"] .kanban-card::before { background: var(--success); }

/* ===================== TOAST ===================== */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
  font-size: 14px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(100%); }
}

/* ===================== LOGIN ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(79,70,229,0.08) 0%, transparent 60%),
              var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px var(--primary-glow);
}

.login-logo h1 { font-size: 22px; font-weight: 700; }
.login-logo p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}

.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #34d399; }

/* ===================== MISC ===================== */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p { font-size: 14px; }

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

/* ===================== DASHBOARD ===================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ===================== MOBILE FAB ===================== */
.fab-wrap { display: none; }

.fab-panel-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.fab-panel-header .user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fab-panel-header .user-info { min-width: 0; flex: 1; }
.fab-panel-header .user-name {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fab-panel-header .user-role { font-size: 12px; color: var(--text-muted); }

.fab-quick-action { margin-bottom: 12px; }
.fab-quick-action:empty { display: none; }

.fab-nav { display: flex; flex-direction: column; gap: 4px; }
.fab-logout { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; padding-bottom: 96px; }
  .form-row { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header .btn { width: 100%; justify-content: center; }
  .page-title { font-size: 20px; }
  .page-subtitle { font-size: 13px; }

  .filters-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .filters-bar .form-group { width: 100%; flex: 1 1 auto; }
  .filters-bar .btn { width: 100%; }

  .grid-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr !important; }

  /* Tabelas em modo card */
  .table-wrap { overflow-x: visible; }
  .table-wrap table { display: block; }
  .table-wrap table thead { display: none; }
  .table-wrap table tbody { display: block; }
  .table-wrap table tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .table-wrap table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
    gap: 12px;
  }
  .table-wrap table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .table-wrap table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: left;
    flex-shrink: 0;
  }
  .table-wrap table tbody td .actions-row {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  /* FAB */
  .fab-wrap { display: block; }
  .fab-btn {
    position: fixed; right: 20px; bottom: 20px; z-index: 200;
    width: 56px; height: 56px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform var(--transition);
  }
  .fab-btn:active { transform: scale(0.94); }
  .fab-btn .fab-icon-close { display: none; }
  .fab-wrap.open .fab-btn { transform: rotate(90deg); }
  .fab-wrap.open .fab-btn .fab-icon-menu { display: none; }
  .fab-wrap.open .fab-btn .fab-icon-close { display: block; }

  .fab-panel {
    position: fixed; right: 20px; bottom: 88px; z-index: 199;
    width: min(320px, calc(100vw - 40px));
    max-height: calc(100vh - 120px); overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow), 0 0 60px rgba(99,102,241,0.2);
    transform: translateY(16px) scale(0.96); opacity: 0; pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .fab-wrap.open .fab-panel {
    transform: translateY(0) scale(1); opacity: 1; pointer-events: auto;
  }
  .fab-panel .nav-link { padding: 12px; font-size: 15px; }
  .fab-panel .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

  .fab-wrap.open::before {
    content: '';
    position: fixed; inset: 0; z-index: 198;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
  }

  body.fab-open { overflow: hidden; }
}

@media (max-width: 480px) {
  .grid-stats { grid-template-columns: 1fr; }
  .main-content { padding: 12px; padding-bottom: 96px; }
  .card { padding: 14px; }
  .page-title { font-size: 18px; }
  .fab-btn { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .fab-panel { right: 16px; bottom: 80px; }
}

/* ===================== POPUP CONFIRM ===================== */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.popup {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow), 0 0 60px rgba(99,102,241,0.2);
  text-align: center;
}

.popup-icon { font-size: 40px; margin-bottom: 16px; }
.popup-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.popup-body { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; }
.popup-actions { display: flex; gap: 10px; justify-content: center; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }
