/* ============================================================
   ProspectoFlow CRM — Design System
   ============================================================ */

:root {
  --primary:       #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-ring:  rgba(99,102,241,.25);

  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --border:        #e2e8f0;
  --border-focus:  #6366f1;

  --text:          #0f172a;
  --text-2:        #475569;
  --text-3:        #94a3b8;

  --green:         #10b981;
  --green-light:   #d1fae5;
  --yellow:        #f59e0b;
  --yellow-light:  #fef3c7;
  --red:           #ef4444;
  --red-light:     #fee2e2;
  --blue:          #3b82f6;
  --blue-light:    #dbeafe;
  --purple:        #8b5cf6;
  --purple-light:  #ede9fe;
  --orange:        #f97316;
  --orange-light:  #ffedd5;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.03);

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --sidebar-w:  240px;
  --panel-w:    400px;
  --topbar-h:   60px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ── Splash screen ── */
.splash {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
  background: var(--bg);
}
.splash-logo { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.splash-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout ── */
.app-layout {
  display: flex; height: 100vh; overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); height: 100vh; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  flex-shrink: 0; position: relative; z-index: 20;
  box-shadow: var(--shadow-sm);
}
.sidebar-header {
  padding: 18px 18px 14px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; background: var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 20px; height: 20px; fill: white; }
.sidebar-brand { font-size: .88rem; font-weight: 800; color: var(--text); line-height: 1.2; text-align: center; }
.sidebar-brand span { display: block; font-size: .67rem; font-weight: 400; color: var(--text-3); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section { margin-bottom: 20px; }
.nav-label {
  font-size: .65rem; font-weight: 600; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .08em; padding: 0 8px; margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--text-2); font-size: .85rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer; user-select: none;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--red); color: white;
  border-radius: var(--radius-full); font-size: .65rem; font-weight: 700;
  padding: 1px 7px; line-height: 1.6;
}

.sidebar-footer {
  padding: 12px 10px; border-top: 1px solid var(--border);
}
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition);
}
.user-chip:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; color: var(--text); truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-role { font-size: .7rem; color: var(--text-3); }

/* ── Main content ── */
.main-content {
  flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); flex: 1; }
.topbar-search {
  position: relative; flex: 1; max-width: 320px;
}
.topbar-search input {
  width: 100%; padding: 8px 12px 8px 36px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.topbar-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 500;
  transition: all var(--transition); line-height: 1; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-icon-sm { width: 28px; height: 28px; padding: 0; border-radius: var(--radius-sm); }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; }

/* ── Cards ── */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px 0; display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.card-body { padding: 16px 20px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .82rem; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 13px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--text); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: .75rem; color: var(--text-3); margin-top: 4px; }

/* ── Dashboard ── */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-info { flex: 1; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-3); margin-top: 4px; }
.stat-trend { font-size: .75rem; font-weight: 500; margin-top: 6px; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

.companies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.company-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 0;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden; cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.company-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.company-card-accent { height: 5px; }
.company-card-body { padding: 18px; }
.company-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.company-logo {
  width: 44px; height: 44px; border-radius: var(--radius); overflow: hidden;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.company-logo img { width: 100%; height: 100%; object-fit: cover; }
.company-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.company-desc { font-size: .78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-stats { display: flex; gap: 20px; }
.cstat { text-align: center; }
.cstat-value { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.cstat-label { font-size: .7rem; color: var(--text-3); }
.company-progress { margin-top: 14px; }
.progress-label { display: flex; justify-content: space-between; font-size: .74rem; color: var(--text-3); margin-bottom: 5px; }
.progress-bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }

/* ── Kanban ── */
.kanban-wrapper { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.kanban-scroll { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 16px 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kanban-scroll::-webkit-scrollbar { width: 8px; }
.kanban-scroll::-webkit-scrollbar-track { background: var(--bg); }
.kanban-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.kanban-col {
  width: auto; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface-2); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.kanban-col-ghost { opacity: 0.4; background: var(--primary-light) !important; border: 2px dashed var(--primary) !important; }
.kanban-col-chosen { cursor: grabbing !important; }
.kanban-col-drag { opacity: 0; }
.kanban-col-header {
  padding: 12px 14px 10px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-title { font-size: .85rem; font-weight: 600; color: var(--text); flex: 1; }
.col-count {
  background: var(--bg); color: var(--text-3); border-radius: var(--radius-full);
  font-size: .7rem; font-weight: 600; padding: 2px 8px; border: 1px solid var(--border);
}
.col-add { color: var(--text-3); transition: color var(--transition); }
.col-add:hover { color: var(--primary); }
.col-add svg { width: 18px; height: 18px; }

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

/* ── Lead Card ── */
.lead-card {
  background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  cursor: pointer; transition: box-shadow var(--transition), border-color var(--transition);
  user-select: none;
}
.lead-card:hover { box-shadow: var(--shadow-md); border-color: #d4d8fc; }
.lead-card.sortable-ghost { opacity: .4; background: var(--primary-light); }
.lead-card.sortable-chosen { box-shadow: var(--shadow-lg); }

.lead-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.lead-name { font-size: .85rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.lead-score { flex-shrink: 0; }
.score-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.score-dot.hot   { background: var(--red); box-shadow: 0 0 0 3px var(--red-light); }
.score-dot.warm  { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-light); }
.score-dot.cold  { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }

.lead-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.lead-meta-item { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--text-3); }
.lead-meta-item svg { width: 12px; height: 12px; }

.lead-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.lead-tag {
  font-size: .68rem; font-weight: 500; padding: 2px 8px; border-radius: var(--radius-full);
  color: white;
}

.lead-card-footer { display: flex; align-items: center; justify-content: space-between; }
.lead-status-badge {
  font-size: .68rem; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: .04em;
}
.status-new      { background: var(--blue-light);   color: var(--blue); }
.status-contacted{ background: var(--purple-light);  color: var(--purple); }
.status-replied  { background: var(--yellow-light);  color: #92400e; }
.status-waiting_human { background: var(--orange-light); color: #c2410c; }
.status-meeting  { background: #dcfce7;               color: #166534; }
.status-callback { background: #ffedd5;               color: #9a3412; }
.status-closed   { background: var(--green-light);   color: #065f46; }
.status-lost     { background: var(--red-light);     color: #991b1b; }

.lead-time { font-size: .7rem; color: var(--text-3); }
.lead-seq-badge {
  font-size: .65rem; font-weight: 600; background: var(--primary-light);
  color: var(--primary); padding: 2px 7px; border-radius: var(--radius-full);
}

/* ── Lead Panel ── */
.lead-panel-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.35);
  z-index: 100; backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
  cursor: default;
}
.lead-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--panel-w); background: var(--surface); box-shadow: var(--shadow-xl);
  z-index: 101; display: flex; flex-direction: column;
  animation: slideInRight .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
.lead-panel-leave { animation: slideOutRight .2s ease forwards; }

.panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.panel-title { flex: 1; font-size: .95rem; font-weight: 700; color: var(--text); }
.panel-close { color: var(--text-3); transition: color var(--transition); }
.panel-close:hover { color: var(--text); }
.panel-close svg { width: 20px; height: 20px; }

.panel-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.panel-tab {
  flex: 1; padding: 10px 6px; text-align: center; font-size: .8rem; font-weight: 500;
  color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.panel-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.panel-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.panel-body::-webkit-scrollbar { width: 5px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.panel-section { margin-bottom: 20px; }
.panel-section-title { font-size: .75rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }

.info-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: .78rem; font-weight: 500; color: var(--text-3); width: 90px; flex-shrink: 0; padding-top: 1px; }
.info-value { font-size: .82rem; color: var(--text); flex: 1; word-break: break-word; }
.info-value a { color: var(--primary); }
.info-value a:hover { text-decoration: underline; }

/* Messages history */
.msg-history { display: flex; flex-direction: column; gap: 8px; }
.msg-bubble-wrap { display: flex; }
.msg-bubble-wrap.outgoing { justify-content: flex-end; }
.msg-bubble-wrap.incoming { justify-content: flex-start; }
.msg-bubble {
  max-width: 85%; padding: 9px 12px; border-radius: var(--radius);
  font-size: .82rem; line-height: 1.5;
}
.msg-bubble.outgoing { background: var(--primary); color: white; border-bottom-right-radius: 3px; }
.msg-bubble.incoming { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.msg-meta { font-size: .68rem; margin-top: 4px; opacity: .7; text-align: right; }
.msg-bubble.incoming .msg-meta { text-align: left; }
.msg-auto-badge { font-size: .65rem; background: rgba(255,255,255,.25); padding: 1px 6px; border-radius: 99px; margin-right: 4px; }
.scheduled-badge { font-size: .62rem; font-weight: 700; color: rgba(255,255,255,.9); display: flex; align-items: center; gap: 4px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.msg-bubble-wrap.pending .msg-bubble { background: #64748b !important; }

.msg-send-area { border-top: 1px solid var(--border); padding: 14px 20px; }
.msg-send-row { display: flex; gap: 8px; }
.msg-input {
  flex: 1; padding: 9px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .85rem; resize: none; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 68px;
}
.msg-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

/* Sequence control */
.seq-info { background: var(--primary-light); border: 1px solid #c7d2fe; border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.seq-info-title { font-size: .82rem; font-weight: 600; color: var(--primary); }
.seq-info-step  { font-size: .78rem; color: var(--text-2); margin-top: 4px; }

/* ── Leads Table ── */
.leads-table-wrap { overflow-x: auto; }
.leads-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.leads-table th { padding: 10px 14px; text-align: left; font-size: .75rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--border); background: var(--surface); white-space: nowrap; }
.leads-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.leads-table tr:last-child td { border-bottom: none; }
.leads-table tr:hover td { background: var(--surface-2); }
.leads-table tr { cursor: pointer; }

/* ── Badges / Pills ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-full); }
.badge-indigo { background: var(--primary-light); color: var(--primary); }
.badge-green  { background: var(--green-light); color: #065f46; }
.badge-yellow { background: var(--yellow-light); color: #92400e; }
.badge-red    { background: var(--red-light); color: #991b1b; }
.badge-gray   { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .2s ease;
  cursor: default;
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl);
  animation: scaleIn .2s cubic-bezier(.4,0,.2,1);
}
@keyframes scaleIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; height: 100%; }
.settings-nav { padding: 0; }
.settings-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--text-2); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.settings-nav-item:hover { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); }
.settings-nav-item svg { width: 18px; height: 18px; opacity: .8; }
.settings-content { max-width: 600px; }
.settings-section { margin-bottom: 32px; }
.settings-section-title { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* ── Login ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 50%, #fdf4ff 100%);
  padding: 24px;
}
.login-card { width: 100%; max-width: 420px; }
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.login-logo-icon { width: 52px; height: 52px; background: var(--primary); border-radius: 16px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.login-logo-icon svg { width: 28px; height: 28px; fill: white; }
.login-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.login-subtitle { font-size: .875rem; color: var(--text-3); margin-top: 6px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-btn { padding: 13px; font-size: .95rem; width: 100%; margin-top: 8px; border-radius: var(--radius); }
.login-error { background: var(--red-light); color: #991b1b; border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 10px 14px; font-size: .84rem; text-align: center; }

/* ── Notifications dropdown ── */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; width: 18px; height: 18px;
  background: var(--red); color: white; border-radius: 50%; font-size: .65rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); z-index: 50; overflow: hidden;
  animation: scaleIn .15s ease;
}
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-header-title { font-size: .85rem; font-weight: 600; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #e0e7ff; }
.notif-item-msg { font-size: .82rem; color: var(--text); line-height: 1.4; }
.notif-item-time { font-size: .72rem; color: var(--text-3); margin-top: 4px; }
.notif-empty { padding: 32px; text-align: center; color: var(--text-3); font-size: .85rem; }

/* ── Empty states ── */
.empty-state { padding: 60px 24px; text-align: center; color: var(--text-3); }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; opacity: .3; }
.empty-title { font-size: .95rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: .84rem; }

/* ── Color picker ── */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  transition: transform var(--transition); border: 3px solid transparent;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text); }

/* ── Misc utils ── */
.text-sm    { font-size: .82rem; }
.text-xs    { font-size: .74rem; }
.text-muted { color: var(--text-3); }
.text-primary { color: var(--primary); }
.font-bold  { font-weight: 700; }
.font-medium { font-weight: 500; }
.flex       { display: flex; }
.items-center { align-items: center; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.mt-1       { margin-top: 4px; }
.mt-2       { margin-top: 8px; }
.mt-3       { margin-top: 12px; }
.mb-3       { margin-bottom: 12px; }
.truncate   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider    { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.spinner    { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.dark { border-color: var(--border); border-top-color: var(--primary); }

/* ── Tags input ── */
.tags-input-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 42px; cursor: text; }
.tags-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 10px; border-radius: var(--radius-full); font-size: .76rem; font-weight: 500; color: white; }
.tag-chip-remove { background: rgba(0,0,0,.2); border: none; border-radius: 50%; width: 16px; height: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tag-chip-remove:hover { background: rgba(0,0,0,.4); }
.tag-chip-remove svg { width: 10px; height: 10px; fill: white; }

/* ── Responsive ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --panel-w: 100vw; }
  .sidebar { display: none; }
  .kanban-col { width: 260px; }
}

/* ── Transition helpers for Vue ── */
.fade-enter-active, .fade-leave-active { transition: opacity .2s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.slide-right-enter-active { animation: slideInRight .25s ease; }
.slide-right-leave-active { animation: slideOutRight .2s ease; }

/* ── Agendamento de Mensagens ── */
.msg-schedule-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--text-3);
  cursor: pointer;
  margin-bottom: 8px;
  transition: color .2s;
  padding: 4px 0;
}

.msg-schedule-toggle:hover {
  color: var(--primary);
}

.msg-schedule-toggle.active {
  color: var(--primary);
  font-weight: 600;
}

.msg-schedule-field {
  margin-bottom: 12px;
  animation: slideDown .2s ease-out;
}

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

.scheduled-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.msg-bubble-wrap.outgoing .msg-bubble.is-scheduled {
  border: 1px dashed var(--primary);
  opacity: 0.85;
}

/* ── Bar Chart ── */
.chart-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.chart-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.chart-body {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 20px;
  position: relative;
  overflow-x: auto;
}
.chart-bar-wrap {
  flex: 1;
  min-width: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.6s cubic-bezier(0.17, 0.67, 0.83, 0.67), background 0.2s;
  position: relative;
}
.chart-bar:hover {
  background: var(--primary-hover);
}
.chart-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}
.chart-label {
  font-size: .6rem;
  color: var(--text-3);
  transform: rotate(-45deg);
  white-space: nowrap;
  margin-top: 4px;
  width: 20px;
}
.chart-grid-y {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed var(--border);
  pointer-events: none;
}

/* ── User Cards ── */
.user-card-actions {
  display: flex;
  gap: 8px;
}
.user-info-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

