/* ============================================
   NEXUS CRM - DESIGN SYSTEM
   ============================================ */
:root {
  --bg: #0a0f1e;
  --bg2: #111827;
  --bg3: #1a2235;
  --card: #151d2e;
  --border: #1e2d45;
  --primary: #4f8ef7;
  --primary-dark: #2563eb;
  --accent: #00e5b0;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --text: #e8edf8;
  --text2: #94a3b8;
  --text3: #4b5e7a;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --glow: 0 0 40px rgba(79,142,247,.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  cursor: pointer; border: none; transition: all .2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 4px 15px rgba(79,142,247,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(79,142,247,.4); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #00c896);
  color: #0a0f1e; font-weight: 700;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,229,176,.3); }
.btn-ghost {
  background: transparent; color: var(--text2); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: .9rem;
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}
.form-group textarea { min-height: 90px; resize: vertical; }

/* ---- CARDS ---- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-success { background: rgba(16,185,129,.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger);  }
.badge-info    { background: rgba(79,142,247,.15);  color: var(--primary); }

/* ---- LOADER ---- */
.loader {
  display: flex; align-items: center; justify-content: center;
  height: 200px;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TOAST ---- */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 500;
  animation: slideIn .3s ease; max-width: 320px;
  box-shadow: var(--shadow);
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--primary);  color: #fff; }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; width: 90%; max-width: 520px;
  max-height: 85vh; overflow-y: auto;
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-family: var(--font-head); }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---- SIDEBAR + LAYOUT ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  font-family: var(--font-head); font-size: 1.3rem; font-weight: 800;
  color: var(--primary); letter-spacing: -.5px;
}
.sidebar-logo span { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 8px 12px; }
.nav-section { margin-bottom: 24px; }
.nav-section-title {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3); padding: 0 8px; margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border-radius: var(--radius-sm);
  color: var(--text2); cursor: pointer;
  transition: all .15s; text-decoration: none;
  font-size: .88rem; font-weight: 500; border: none; background: none;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(79,142,247,.12); color: var(--primary); }
.nav-item svg { flex-shrink: 0; }

.sidebar-user {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .75rem; color: var(--text2); }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.page-body { padding: 28px; flex: 1; }

/* ---- DASHBOARD ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-color, var(--primary));
}
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text2); margin-top: 4px; }

.dashboard-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.stage-bars { display: flex; flex-direction: column; gap: 12px; }
.stage-bar-row { display: flex; flex-direction: column; gap: 4px; }
.stage-bar-info { display: flex; justify-content: space-between; font-size: .82rem; }
.stage-bar-track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.stage-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border);
}
.activity-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-weight: 500; font-size: .85rem; }
.activity-meta { font-size: .75rem; color: var(--text2); }

/* ---- KANBAN ---- */
.kanban-board {
  display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px;
  min-height: calc(100vh - 160px);
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: var(--bg3); border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.kanban-column {
  flex-shrink: 0; width: 280px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: calc(100vh - 160px);
}
.column-header {
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.column-title-row { display: flex; align-items: center; gap: 8px; }
.column-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.column-name { font-family: var(--font-head); font-weight: 700; font-size: .9rem; }
.column-meta { font-size: .75rem; color: var(--text2); }
.column-count {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 8px; font-size: .75rem; font-weight: 600;
}

.column-cards {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.column-cards::-webkit-scrollbar { width: 4px; }
.column-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.deal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  cursor: grab; transition: all .2s; position: relative;
  border-left: 3px solid transparent;
}
.deal-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.deal-card.dragging { opacity: .4; transform: rotate(2deg); cursor: grabbing; }
.deal-card.drag-over { border-color: var(--accent); background: rgba(0,229,176,.05); }
.deal-title { font-weight: 600; font-size: .88rem; margin-bottom: 8px; }
.deal-value { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--accent); }
.deal-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.deal-contact { font-size: .75rem; color: var(--text2); display: flex; align-items: center; gap: 4px; }
.deal-date { font-size: .72rem; color: var(--text3); }
.deal-actions {
  position: absolute; top: 8px; right: 8px;
  display: none; gap: 4px;
}
.deal-card:hover .deal-actions { display: flex; }
.deal-action-btn {
  width: 24px; height: 24px; border-radius: 4px; border: none;
  background: var(--bg3); color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .7rem;
  transition: all .15s;
}
.deal-action-btn:hover { background: var(--border); color: var(--text); }

.column-add-btn {
  padding: 8px; border-radius: 0 0 var(--radius) var(--radius);
  border: none; background: transparent; color: var(--text3);
  cursor: pointer; font-size: .8rem; width: 100%; text-align: left;
  transition: all .15s; border-top: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; gap: 6px; padding: 10px 16px;
}
.column-add-btn:hover { background: var(--bg3); color: var(--primary); }

/* ---- CONTACTS TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  padding: 10px 14px; text-align: left; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .5px; color: var(--text2);
  border-bottom: 1px solid var(--border); font-weight: 600;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--bg3); }
tbody tr:last-child td { border-bottom: none; }

/* ---- LANDING PAGE ---- */
.landing { min-height: 100vh; }
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 5%; position: sticky; top: 0; z-index: 100;
  background: rgba(10,15,30,.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 8px; align-items: center; }

.hero {
  min-height: 90vh; display: flex; align-items: center;
  padding: 80px 5%;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(79,142,247,.15) 0%, transparent 70%);
}
.hero-content { max-width: 600px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,229,176,.1); border: 1px solid rgba(0,229,176,.3);
  color: var(--accent); padding: 6px 14px; border-radius: 20px;
  font-size: .8rem; font-weight: 600; margin-bottom: 24px;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { font-size: 1.1rem; color: var(--text2); margin-bottom: 36px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

.section { padding: 80px 5%; }
.section-title { text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--text2); margin-bottom: 48px; }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
}
.feature-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-4px); }
.feature-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1rem; }
.feature-card p { font-size: .87rem; color: var(--text2); }

.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; max-width: 900px; margin: 0 auto;
}
.plan-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column;
  transition: all .2s; position: relative; overflow: hidden;
}
.plan-card.popular {
  border-color: var(--primary);
  box-shadow: var(--glow);
}
.plan-card.popular::before {
  content: 'MAIS POPULAR'; position: absolute; top: 16px; right: -28px;
  background: var(--primary); color: #fff; font-size: .65rem;
  font-weight: 700; padding: 4px 36px; transform: rotate(45deg);
  letter-spacing: 1px;
}
.plan-name { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.plan-price { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; margin: 16px 0 4px; }
.plan-price sup { font-size: .9rem; font-weight: 400; }
.plan-price-sub { font-size: .8rem; color: var(--text2); margin-bottom: 24px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; margin-bottom: 24px; }
.plan-features li { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.plan-features li.no { color: var(--text3); }
.plan-features li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.plan-features li.no::before { content: '✗'; color: var(--text3); }

/* ---- AUTH PAGES ---- */
.auth-layout {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, rgba(79,142,247,.1) 0%, transparent 60%);
  padding: 40px 20px;
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-logo { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: 8px; }
.auth-logo span { color: var(--accent); }
.auth-subtitle { text-align: center; color: var(--text2); font-size: .9rem; margin-bottom: 32px; }
.auth-divider { text-align: center; color: var(--text3); font-size: .8rem; margin: 16px 0; }
.auth-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

/* ---- CHECKOUT ---- */
.checkout-layout {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.checkout-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px; width: 100%; max-width: 900px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
@media (max-width: 700px) { .checkout-card { grid-template-columns: 1fr; } }
.checkout-summary h3 { font-family: var(--font-head); margin-bottom: 20px; }
.summary-plan {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px; margin-bottom: 16px;
}
.summary-plan-name { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; color: var(--primary); }
.summary-price { font-family: var(--font-head); font-size: 2rem; font-weight: 800; margin: 12px 0 4px; }
.payment-methods { display: flex; gap: 8px; margin-bottom: 20px; }
.pay-method-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--bg3);
  color: var(--text2); cursor: pointer; text-align: center;
  font-size: .82rem; font-weight: 500; transition: all .15s;
}
.pay-method-btn.active { border-color: var(--primary); color: var(--primary); background: rgba(79,142,247,.1); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar-logo, .nav-section-title, .user-info, .nav-item span { display: none; }
  .nav-item { justify-content: center; }
  .page-body { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

/* ---- UTILITIES ---- */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: .85rem; }
.text-muted { color: var(--text2); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============================================
   KANBAN MELHORADO
   ============================================ */
.topbar-select {
  padding: 7px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body);
  font-size: .875rem; cursor: pointer;
}
.topbar-search {
  padding: 7px 12px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body);
  font-size: .875rem; width: 200px;
}
.topbar-search:focus { outline: none; border-color: var(--primary); }

.kanban-summary {
  display: flex; gap: 20px; align-items: center;
  padding: 8px 0 14px; font-size: .85rem; color: var(--text2);
}

.kanban-board {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 20px;
  min-height: calc(100vh - 180px); align-items: flex-start;
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: var(--bg3); border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.kanban-column {
  flex-shrink: 0; width: 272px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: calc(100vh - 180px);
}
.column-header {
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.column-name { font-weight: 700; font-size: .88rem; }
.column-meta { font-size: .73rem; color: var(--text2); margin-top: 2px; }
.column-count {
  border-radius: 20px; padding: 2px 9px; font-size: .73rem; font-weight: 700;
}
.column-cards {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.column-cards::-webkit-scrollbar { width: 3px; }
.column-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.column-cards.drag-over { background: rgba(99,102,241,.06); border-radius: 8px; }
.column-add-btn {
  margin: 8px; padding: 8px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); background: transparent; color: var(--text3);
  cursor: pointer; font-size: .8rem; transition: all .2s; flex-shrink: 0;
}
.column-add-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.05); }

/* Deal Card */
.deal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 12px;
  cursor: grab; transition: all .18s; position: relative;
}
.deal-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(0,0,0,.18); transform: translateY(-1px); }
.deal-card.dragging { opacity: .35; cursor: grabbing; transform: rotate(1.5deg) scale(1.02); }
.deal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.deal-title { font-weight: 600; font-size: .85rem; line-height: 1.3; flex: 1; }
.deal-card-actions { display: none; gap: 3px; flex-shrink: 0; }
.deal-card:hover .deal-card-actions { display: flex; }
.deal-icon-btn {
  width: 22px; height: 22px; border-radius: 4px; border: none;
  background: var(--bg3); color: var(--text2); cursor: pointer; font-size: .72rem;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
  padding: 0;
}
.deal-icon-btn:hover { background: var(--border); color: var(--text); }
.deal-value { font-weight: 800; font-size: .95rem; color: var(--accent); margin-bottom: 8px; }
.deal-contact-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.deal-contact { font-size: .75rem; color: var(--text2); }
.whatsapp-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px; font-size: .72rem; font-weight: 600;
  background: #25D36622; color: #25D366; text-decoration: none;
  border: 1px solid #25D36640; transition: all .15s; flex-shrink: 0;
}
.whatsapp-btn:hover { background: #25D366; color: #fff; }
.deal-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.deal-owner { font-size: .72rem; color: var(--text3); }
.deal-notes {
  font-size: .75rem; color: var(--text3); margin-top: 8px;
  border-top: 1px solid var(--border); padding-top: 7px;
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* form-row para modais */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { margin-bottom: 0; }

/* ============================================
   DASHBOARD CORRIGIDO
   ============================================ */

/* KPI Grid - 4 cards em linha */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dash-kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-blue   { background: linear-gradient(135deg, #1e2d4d 0%, var(--card) 100%); }
.kpi-blue::before   { background: var(--primary); }
.kpi-green  { background: linear-gradient(135deg, #0d2b22 0%, var(--card) 100%); }
.kpi-green::before  { background: var(--accent); }
.kpi-gold   { background: linear-gradient(135deg, #2d200a 0%, var(--card) 100%); }
.kpi-gold::before   { background: #f59e0b; }
.kpi-purple { background: linear-gradient(135deg, #1e1535 0%, var(--card) 100%); }
.kpi-purple::before { background: #8b5cf6; }

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-label { font-size: .78rem; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-icon  { font-size: 1.4rem; opacity: .8; }
.kpi-value { font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.kpi-sub   { font-size: .75rem; color: var(--text2); }

/* Main grid - funil + atividades */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .dash-main-grid { grid-template-columns: 1fr; } }

/* card-header com título + ação lado a lado */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h3 {
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 700;
  margin: 0;
}

/* Atividade atrasada */
.activity-late {
  border-left: 3px solid var(--danger) !important;
  background: rgba(239,68,68,.04) !important;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.activity-icon  { font-size: 1.1rem; flex-shrink: 0; }
.activity-body  { flex: 1; min-width: 0; }
.activity-title { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta  { font-size: .74rem; color: var(--text3); margin-top: 2px; }

/* Atalhos rápidos */
.dash-shortcuts { }
.shortcut-title {
  font-size: .75rem; color: var(--text2); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px;
}
.shortcuts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .shortcuts-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .shortcuts-row { grid-template-columns: 1fr 1fr; } }

.shortcut-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all .18s;
}
.shortcut-card:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.shortcut-icon  { font-size: 1.5rem; flex-shrink: 0; }
.shortcut-name  { font-weight: 700; font-size: .85rem; }
.shortcut-desc  { font-size: .74rem; color: var(--text2); margin-top: 2px; }

/* btn-full */
.btn-full { width: 100%; justify-content: center; }
