:root {
  --bg: #f0f2f7;
  --surface: #ffffff;
  --sidebar: #1a2744;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --accent: #3b82f6;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --warn: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --r: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

#app { display: flex; height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--sidebar);
  display: flex; flex-direction: column;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-mark {
  width: 34px; height: 34px;
  background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { color: white; font-size: 14px; font-weight: 400; }
.logo-text strong { font-weight: 700; color: #60a5fa; }

.sidebar-nav { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,.55); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: all .15s; position: relative; cursor: pointer;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { color: white; background: rgba(255,255,255,.07); }
.nav-item.active { color: white; background: var(--primary); }
.nav-badge { margin-left: auto; background: #ef4444; color: white; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 20px; }
.nav-badge.hidden { display: none; }

.sidebar-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px; color: rgba(255,255,255,.35);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4b5563; flex-shrink: 0; transition: background .3s; }
.status-dot.online { background: var(--success); }
.status-dot.warn { background: var(--warn); }

/* ── Main ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.topbar h1 { font-size: 19px; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border: none; background: transparent; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: background .15s; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 13px; cursor: pointer; }

.content { flex: 1; overflow-y: auto; padding: 22px 28px; }
.page { display: none; }
.page.active { display: block; }

/* ── Stats ── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--border); cursor: pointer; transition: transform .15s; }
.stat-card:hover { transform: translateY(-1px); }
.stat-card.warn { border-left: 3px solid var(--warn); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.stat-value { font-size: 34px; font-weight: 800; line-height: 1; margin-bottom: 5px; font-family: 'DM Mono', monospace; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-sub.positive { color: var(--success); font-weight: 600; }
.stat-sub.link { color: var(--primary); font-weight: 600; cursor: pointer; }
.stat-sub.warn-text { color: var(--warn); font-weight: 600; }

/* ── Grid ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; margin-bottom: 14px; }
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Card ── */
.card { background: var(--surface); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-header h3 { font-size: 14px; font-weight: 700; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 0 6px 8px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 9px 6px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table.full { font-size: 14px; }
.fw { font-weight: 600; }
.mono { font-family: 'DM Mono', monospace; font-size: 12px; }
.empty-row { text-align: center; color: var(--muted); padding: 20px; font-size: 13px; }

/* ── Source badges ── */
.source-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #eff6ff; color: var(--primary); }
.source-badge.google { background: #fef3c7; color: #d97706; }
.source-badge.facebook { background: #ede9fe; color: #7c3aed; }
.source-badge.call { background: #d1fae5; color: #047857; }

/* ── Status select ── */
.status-select { border: 1.5px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 12px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; background: white; }
.status-select.status-new { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.status-select.status-contacted { color: #047857; border-color: #a7f3d0; background: #d1fae5; }
.status-select.status-booked { color: #6d28d9; border-color: #ddd6fe; background: #ede9fe; }
.status-select.status-lost { color: #b91c1c; border-color: #fecaca; background: #fee2e2; }

/* ── Conversations ── */
.conv-card { display: flex; flex-direction: column; }
.conv-list { flex: 1; overflow-y: auto; max-height: 220px; margin-bottom: 10px; }
.conv-item { display: flex; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.conv-item:hover, .conv-item.active-conv { background: #f0f9ff; }
.conv-av { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: white; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.conv-info { flex: 1; overflow: hidden; }
.conv-name { font-weight: 600; font-size: 13px; }
.conv-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; position: relative; }
.bubble.in  { background: #f3f4f6; border-radius: 12px 12px 12px 2px; }
.bubble.out { background: var(--primary); color: white; border-radius: 12px 12px 2px 12px; align-self: flex-end; }
.bubble-time { display: block; font-size: 10px; opacity: .6; margin-top: 2px; }
.conv-compose { display: flex; gap: 8px; margin-top: auto; }
.conv-compose input { flex: 1; border: 1px solid var(--border); border-radius: 22px; padding: 9px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; }
.conv-compose input:focus { border-color: var(--primary); }

/* ── Appointments ── */
.cal-date-label { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.appt-list { display: flex; flex-direction: column; }
.appt-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.appt-row:last-child { border-bottom: none; }
.appt-time { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--muted); min-width: 62px; }
.link-text { color: var(--primary); font-weight: 600; cursor: pointer; }
.link-text:hover { text-decoration: underline; }
.ml-auto { margin-left: auto; }

/* ── Missed calls ── */
.missed-box { background: #fff7ed; border-radius: 8px; padding: 12px 14px; border: 1px solid #fed7aa; }
.missed-inner { display: flex; align-items: center; gap: 8px; }
.missed-badge { width: 22px; height: 22px; background: #ef4444; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.missed-sub { font-size: 12px; color: #92400e; margin-top: 6px; }

/* ── Review list ── */
.review-list { display: flex; flex-direction: column; }
.review-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.review-row:last-child { border-bottom: none; }
.rev-av { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--muted); border: 1px solid var(--border); }
.rev-name { font-weight: 600; flex: 1; }
.rev-status { font-size: 11px; color: var(--muted); }

/* ── Buttons ── */
.btn-primary { background: var(--primary); color: white; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: background .15s; white-space: nowrap; }
.btn-primary:hover { background: var(--primary-h); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); border-radius: 8px; padding: 7px 15px; font-size: 13px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { background: #eff6ff; color: var(--primary); border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: background .15s; }
.btn-sm:hover { background: var(--primary); color: white; }
.action-link { background: none; border: none; color: var(--primary); font-weight: 600; font-size: 12px; cursor: pointer; padding: 3px 7px; border-radius: 5px; transition: background .12s; text-decoration: none; }
.action-link:hover { background: #eff6ff; }
.action-link.danger { color: var(--danger); }
.action-link.danger:hover { background: #fee2e2; }

/* ── Page toolbar ── */
.page-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.page-toolbar input, .page-toolbar select { border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; background: var(--surface); transition: border-color .15s; }
.page-toolbar input:focus, .page-toolbar select:focus { border-color: var(--primary); }
.page-toolbar input[type="search"] { min-width: 200px; }

/* ── Calendar ── */
.cal-grid-header { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day { min-height: 78px; padding: 5px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: background .12s; }
.cal-day:hover { background: var(--bg); }
.cal-day.other-month { color: #d1d5db; }
.cal-day.today { background: #eff6ff; }
.cal-day.today .day-num { color: var(--primary); font-weight: 700; }
.day-num { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.cal-event { background: var(--primary); color: white; border-radius: 3px; padding: 1px 4px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }

/* ── Messages ── */
.messages-layout { display: grid; grid-template-columns: 270px 1fr; gap: 14px; height: calc(100vh - 120px); }
.conv-sidebar { background: var(--surface); border-radius: var(--r); border: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.conv-search input { width: 100%; border: none; border-bottom: 1px solid var(--border); padding: 12px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; }
#conv-sidebar-list { flex: 1; overflow-y: auto; }
.conv-sidebar-item { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.conv-sidebar-item:hover, .conv-sidebar-item.active { background: #eff6ff; }
.conv-main { background: var(--surface); border-radius: var(--r); border: 1px solid var(--border); display: flex; flex-direction: column; }
.conv-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; }
.conv-main-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.conv-main-header strong { font-size: 15px; }
.text-muted { color: var(--muted); font-size: 12px; }
.conv-main-msgs { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.conv-main-compose { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.conv-main-compose input { flex: 1; border: 1px solid var(--border); border-radius: 22px; padding: 9px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; }
.conv-main-compose input:focus { border-color: var(--primary); }

/* ── Automations ── */
.automations-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.auto-card { background: var(--surface); border-radius: var(--r); padding: 20px; border: 1px solid var(--border); }
.auto-icon { font-size: 24px; margin-bottom: 8px; }
.auto-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.auto-card p { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.auto-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; }

/* ── Settings ── */
.settings-wrap { max-width: 1100px; }
.settings-wrap h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.settings-desc { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.settings-desc code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-family: 'DM Mono', monospace; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.settings-card { background: var(--surface); border-radius: var(--r); padding: 18px; border: 1px solid var(--border); }
.settings-card h3 { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; }
.settings-hint { font-size: 11px; color: var(--muted); margin: 6px 0; line-height: 1.6; }
.settings-hint code { background: #f3f4f6; padding: 1px 4px; border-radius: 3px; font-family: 'DM Mono', monospace; }
.test-result { display: block; font-size: 12px; margin-top: 6px; font-weight: 600; }
.test-result.ok { color: var(--success); }
.test-result.err { color: var(--danger); }
.test-result.warn { color: var(--warn); }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; width: 460px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: modal-in .2s ease; }
@keyframes modal-in { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { background: var(--bg); border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--border); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 22px; right: 22px; background: #111827; color: white; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(10px); transition: all .28s ease; z-index: 2000; pointer-events: none; max-width: 340px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { background: #991b1b; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: repeat(2,1fr); }
  .automations-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .sidebar { width: 56px; min-width: 56px; }
  .logo-text, .nav-item span:not(.nav-badge), #api-label { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .messages-layout { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   CALENDAR — Full Featured Scheduling
   ══════════════════════════════════════════════ */

/* Toolbar */
.cal-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:10px; }
.cal-nav { display:flex; align-items:center; gap:8px; }
.cal-nav-btn { background:var(--surface); border:1.5px solid var(--border); border-radius:8px; width:34px; height:34px; font-size:20px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text); transition:all .15s; }
.cal-nav-btn:hover { background:#f3f4f6; }
.cal-month-title { font-size:20px; font-weight:800; min-width:180px; text-align:center; }
.cal-today-btn { background:none; border:1.5px solid var(--border); border-radius:8px; padding:6px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:'DM Sans',sans-serif; transition:all .15s; }
.cal-today-btn:hover { background:#f3f4f6; }
.cal-view-switcher { display:flex; background:#f3f4f6; border-radius:10px; padding:3px; gap:2px; }
.cal-view-btn { background:none; border:none; padding:6px 14px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; font-family:'DM Sans',sans-serif; color:var(--muted); transition:all .15s; }
.cal-view-btn.active { background:white; color:var(--primary); box-shadow:0 1px 4px rgba(0,0,0,.1); }

/* Stats Bar */
.cal-stats-bar { display:flex; gap:12px; margin-bottom:16px; }
.cal-stat { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:12px 20px; display:flex; flex-direction:column; align-items:center; min-width:90px; }
.cal-stat-num { font-size:24px; font-weight:800; color:var(--primary); font-family:'DM Mono',monospace; }
.cal-stat-label { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.4px; margin-top:2px; }

/* Views */
.cal-view { display:none; }
.cal-view.active { display:block; }

/* Month Grid */
.cal-grid-header { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; margin-bottom:4px; }
.cal-grid-header span { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; padding:6px 0; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; background:var(--border); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.cal-day { background:var(--surface); min-height:100px; padding:6px; cursor:pointer; transition:background .1s; position:relative; }
.cal-day:hover { background:#f8f9ff; }
.cal-day.other-month { background:#fafafa; opacity:.5; }
.cal-day.today { background:#eff6ff; }
.cal-day.today .day-num { background:var(--primary); color:white; border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; font-weight:700; }
.day-num { font-size:13px; font-weight:600; color:var(--text); margin-bottom:4px; width:24px; height:24px; display:flex; align-items:center; justify-content:center; }
.cal-event { font-size:11px; padding:2px 6px; border-radius:4px; margin-bottom:2px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:500; }
.cal-event.status-scheduled  { background:#dbeafe; color:#1e40af; }
.cal-event.status-confirmed  { background:#d1fae5; color:#065f46; }
.cal-event.status-completed  { background:#f3f4f6; color:#6b7280; }
.cal-event.status-cancelled  { background:#fee2e2; color:#991b1b; text-decoration:line-through; }
.cal-more { font-size:11px; color:var(--primary); font-weight:600; padding:2px 4px; cursor:pointer; }

/* Week View */
.week-grid { background:var(--surface); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.week-header { display:grid; grid-template-columns:60px repeat(7,1fr); border-bottom:1px solid var(--border); }
.week-header-cell { padding:10px 6px; text-align:center; font-size:12px; font-weight:700; color:var(--muted); }
.week-header-cell.today-col { color:var(--primary); }
.week-header-day { font-size:20px; font-weight:800; color:var(--text); display:block; }
.week-body { display:grid; grid-template-columns:60px repeat(7,1fr); }
.week-time-col { }
.week-time-slot { height:50px; display:flex; align-items:flex-start; justify-content:flex-end; padding:4px 8px 0 0; font-size:11px; color:var(--muted); border-right:1px solid var(--border); }
.week-col { border-right:1px solid #f3f4f6; position:relative; }
.week-col:last-child { border-right:none; }
.week-cell { height:50px; border-bottom:1px solid #f9fafb; cursor:pointer; }
.week-cell:hover { background:#f8f9ff; }
.week-event { position:absolute; left:2px; right:2px; border-radius:4px; padding:2px 4px; font-size:11px; font-weight:600; cursor:pointer; overflow:hidden; z-index:1; }

/* Day View */
.day-view-header { padding:16px 0 12px; font-size:18px; font-weight:800; text-align:center; color:var(--primary); }
.day-timeline { background:var(--surface); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.day-time-row { display:grid; grid-template-columns:60px 1fr; min-height:50px; border-bottom:1px solid #f3f4f6; }
.day-time-row:last-child { border-bottom:none; }
.day-time-label { padding:6px 12px 0; font-size:11px; color:var(--muted); font-weight:600; border-right:1px solid var(--border); }
.day-time-slot { padding:4px 8px; position:relative; cursor:pointer; }
.day-time-slot:hover { background:#f8f9ff; }
.day-appt-block { background:#dbeafe; border-left:3px solid var(--primary); border-radius:4px; padding:4px 8px; margin-bottom:3px; cursor:pointer; }
.day-appt-block.status-confirmed { background:#d1fae5; border-color:#10b981; }
.day-appt-block.status-completed { background:#f3f4f6; border-color:#9ca3af; }
.day-appt-block.status-cancelled { background:#fee2e2; border-color:#ef4444; }

/* List View */
.filter-select { border:1.5px solid var(--border); border-radius:8px; padding:6px 10px; font-size:13px; font-family:'DM Sans',sans-serif; outline:none; }

/* Appointment Popup */
.appt-popup { position:fixed; top:0; right:0; bottom:0; width:340px; background:white; box-shadow:-4px 0 24px rgba(0,0,0,.12); z-index:500; display:flex; flex-direction:column; animation:slideInRight .2s ease; }
@keyframes slideInRight { from { transform:translateX(100%); } to { transform:translateX(0); } }
.appt-popup-inner { padding:24px; flex:1; overflow-y:auto; }
.appt-popup-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.appt-popup-close { background:none; border:none; font-size:18px; cursor:pointer; color:var(--muted); padding:4px; }
.appt-popup-close:hover { color:var(--text); }
.appt-popup-service { font-size:20px; font-weight:800; margin-bottom:6px; }
.appt-popup-client { font-size:15px; color:var(--muted); margin-bottom:8px; }
.appt-popup-meta { font-size:13px; color:var(--muted); margin-bottom:12px; }
.appt-popup-notes { font-size:13px; color:var(--text); background:#f9fafb; border-radius:8px; padding:10px; margin-bottom:16px; min-height:40px; }
.appt-popup-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.appt-status-select { flex:1; border:1.5px solid var(--border); border-radius:8px; padding:7px 10px; font-size:13px; font-family:'DM Sans',sans-serif; outline:none; }
.appt-status-badge { padding:3px 10px; border-radius:20px; font-size:12px; font-weight:700; }
.appt-status-badge.status-scheduled { background:#dbeafe; color:#1e40af; }
.appt-status-badge.status-confirmed { background:#d1fae5; color:#065f46; }
.appt-status-badge.status-completed { background:#f3f4f6; color:#6b7280; }
.appt-status-badge.status-cancelled { background:#fee2e2; color:#991b1b; }

/* Form helpers */
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:500px) { .form-row { grid-template-columns:1fr; } }

/* ══════════════════════════════════════════════
   SETTINGS TABS
   ══════════════════════════════════════════════ */
.settings-tabs { display:flex; gap:4px; margin-bottom:20px; background:#f3f4f6; padding:4px; border-radius:12px; width:fit-content; }
.settings-tab  { background:none; border:none; padding:8px 18px; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; font-family:'DM Sans',sans-serif; color:var(--muted); transition:all .15s; white-space:nowrap; }
.settings-tab.active { background:white; color:var(--primary); box-shadow:0 1px 4px rgba(0,0,0,.1); }
.stab-panel { display:none; }
.stab-panel.active { display:block; }

/* ══════════════════════════════════════════════
   WEBHOOK HUB
   ══════════════════════════════════════════════ */
.webhook-hub { max-width:800px; }
.webhook-hero { text-align:center; padding:32px 0 24px; }
.webhook-hero-icon { font-size:48px; margin-bottom:12px; }
.webhook-hero h2 { font-size:24px; font-weight:800; margin:0 0 8px; }
.webhook-hero p  { color:var(--muted); font-size:14px; }

.webhook-key-card { background:linear-gradient(135deg,#1e40af,#3b82f6); border-radius:16px; padding:24px; color:white; margin-bottom:24px; }
.wk-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; opacity:.7; margin-bottom:8px; }
.wk-row   { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.wk-value { background:rgba(255,255,255,.15); border-radius:8px; padding:10px 14px; font-size:13px; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:'DM Mono',monospace; color:white; }
.wk-actions { display:flex; gap:10px; flex-wrap:wrap; }
.wk-actions .btn-primary { background:white; color:var(--primary); }
.wk-actions .btn-outline  { border-color:rgba(255,255,255,.4); color:white; }
.wk-actions .btn-outline:hover { background:rgba(255,255,255,.1); }

.webhook-endpoints h3 { font-size:16px; font-weight:700; margin:0 0 6px; }
.endpoint-card { display:flex; align-items:flex-start; gap:14px; background:var(--surface); border:1.5px solid var(--border); border-radius:12px; padding:16px; margin-bottom:10px; }
.ep-badge { font-size:10px; font-weight:800; padding:4px 8px; border-radius:6px; white-space:nowrap; letter-spacing:.5px; margin-top:2px; }
.ep-zapier   { background:#FF4A00; color:white; }
.ep-facebook { background:#1877F2; color:white; }
.ep-google   { background:#34A853; color:white; }
.ep-widget   { background:#7c3aed; color:white; }
.ep-info     { flex:1; min-width:0; }
.ep-title    { font-weight:700; font-size:14px; margin-bottom:4px; }
.ep-url      { display:block; font-size:12px; color:var(--primary); background:#eff6ff; border-radius:6px; padding:6px 10px; margin-bottom:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:'DM Mono',monospace; }
.ep-desc     { font-size:12px; color:var(--muted); line-height:1.5; }
.ep-desc code { background:#f3f4f6; border-radius:4px; padding:1px 5px; font-size:11px; }

.webhook-embed { margin-top:24px; }
.webhook-embed h3 { font-size:16px; font-weight:700; margin:0 0 6px; }
.embed-code-wrap { position:relative; }
.embed-code { background:#1e293b; color:#7dd3fc; border-radius:12px; padding:16px; font-size:12px; overflow-x:auto; white-space:pre-wrap; word-break:break-all; margin:0 0 8px; font-family:'DM Mono',monospace; }
#btn-copy-embed { margin-left:auto; display:block; }

.webhook-logs { margin-top:24px; }
.webhook-logs h3 { font-size:16px; font-weight:700; margin:0; }

/* ══════════════════════════════════════════════
   CAMPAIGN AUTOMATION
   ══════════════════════════════════════════════ */

/* View switcher */
.auto-view-tabs { display:flex; background:#f3f4f6; border-radius:10px; padding:3px; gap:2px; }
.auto-view-btn  { background:none; border:none; padding:7px 16px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; font-family:'DM Sans',sans-serif; color:var(--muted); transition:all .15s; }
.auto-view-btn.active { background:white; color:var(--primary); box-shadow:0 1px 4px rgba(0,0,0,.1); }
.auto-view { display:none; }
.auto-view.active { display:block; }

/* Sequence stats */
.seq-stats-row { display:flex; gap:12px; margin-bottom:16px; }
.seq-stat { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px 24px; text-align:center; min-width:100px; }
.seq-stat-num { font-size:26px; font-weight:800; color:var(--primary); font-family:'DM Mono',monospace; }
.seq-stat-label { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.4px; }

/* Sequence cards */
.seq-card { background:var(--surface); border:1.5px solid var(--border); border-radius:14px; padding:18px 20px; margin-bottom:10px; display:flex; align-items:center; gap:16px; transition:box-shadow .15s; }
.seq-card:hover { box-shadow:0 2px 12px rgba(0,0,0,.08); }
.seq-card-icon { font-size:28px; width:48px; height:48px; background:#eff6ff; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.seq-card-info { flex:1; }
.seq-card-name { font-size:15px; font-weight:700; margin-bottom:4px; }
.seq-card-meta { font-size:12px; color:var(--muted); display:flex; gap:12px; flex-wrap:wrap; }
.seq-card-meta span { display:flex; align-items:center; gap:4px; }
.seq-toggle { position:relative; width:44px; height:24px; flex-shrink:0; }
.seq-toggle input { opacity:0; width:0; height:0; }
.seq-toggle-track { position:absolute; inset:0; background:#e5e7eb; border-radius:12px; cursor:pointer; transition:background .2s; }
.seq-toggle input:checked + .seq-toggle-track { background:var(--primary); }
.seq-toggle-track::after { content:''; position:absolute; left:3px; top:3px; width:18px; height:18px; background:white; border-radius:50%; transition:transform .2s; }
.seq-toggle input:checked + .seq-toggle-track::after { transform:translateX(20px); }
.seq-card-actions { display:flex; gap:8px; }

/* Playbooks */
.playbooks-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.playbook-card { background:var(--surface); border:1.5px solid var(--border); border-radius:14px; padding:20px; cursor:pointer; transition:all .15s; }
.playbook-card:hover { border-color:var(--primary); box-shadow:0 4px 16px rgba(37,99,235,.1); transform:translateY(-2px); }
.playbook-icon { font-size:32px; margin-bottom:12px; }
.playbook-name { font-size:15px; font-weight:700; margin-bottom:6px; }
.playbook-desc { font-size:13px; color:var(--muted); line-height:1.5; margin-bottom:12px; }
.playbook-steps { display:flex; flex-direction:column; gap:4px; }
.playbook-step { font-size:12px; color:var(--muted); display:flex; align-items:center; gap:6px; }
.playbook-step::before { content:'→'; color:var(--primary); font-weight:700; }
.playbook-badge { display:inline-block; background:#eff6ff; color:var(--primary); font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; margin-top:10px; }

/* ── Sequence Builder Panel ── */
.seq-builder-panel { position:fixed; top:0; right:0; bottom:0; width:480px; background:var(--surface); box-shadow:-4px 0 32px rgba(0,0,0,.12); z-index:600; transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column; }
.seq-builder-panel.open { transform:translateX(0); }

.sbp-header { padding:20px 24px; border-bottom:1px solid var(--border); display:flex; align-items:flex-start; justify-content:space-between; gap:12px; background:var(--surface); }
.sbp-title { font-size:18px; font-weight:800; margin-bottom:4px; }
.sbp-meta  { font-size:12px; color:var(--muted); }
.sbp-header-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }
.sbp-trigger-select { border:1.5px solid var(--border); border-radius:8px; padding:6px 10px; font-size:12px; font-family:'DM Sans',sans-serif; outline:none; }

.sbp-body { flex:1; overflow-y:auto; padding:20px 24px; }
.sbp-steps { display:flex; flex-direction:column; gap:0; }

/* Step cards */
.step-card { border:1.5px solid var(--border); border-radius:12px; margin-bottom:8px; background:white; overflow:hidden; }
.step-card-header { display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer; background:#fafafa; border-bottom:1px solid var(--border); }
.step-num { width:24px; height:24px; border-radius:50%; background:var(--primary); color:white; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.step-summary { flex:1; font-size:13px; font-weight:600; }
.step-delay-badge { font-size:11px; background:#eff6ff; color:var(--primary); padding:2px 8px; border-radius:20px; font-weight:600; }
.step-body { padding:14px; display:flex; flex-direction:column; gap:10px; }
.step-body label { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; }
.step-body input, .step-body select, .step-body textarea { width:100%; border:1.5px solid var(--border); border-radius:8px; padding:8px 10px; font-size:13px; font-family:'DM Sans',sans-serif; outline:none; }
.step-body input:focus, .step-body select:focus, .step-body textarea:focus { border-color:var(--primary); }
.step-body textarea { resize:vertical; min-height:80px; }
.step-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.step-footer { display:flex; gap:8px; justify-content:flex-end; padding-top:6px; }

.sbp-add-step { width:100%; margin-top:8px; padding:12px; border:2px dashed var(--border); background:none; border-radius:10px; font-size:13px; font-weight:600; cursor:pointer; color:var(--muted); font-family:'DM Sans',sans-serif; transition:all .15s; }
.sbp-add-step:hover { border-color:var(--primary); color:var(--primary); background:#eff6ff; }

/* Connector line between steps */
.step-connector { width:2px; height:16px; background:var(--border); margin:0 auto; }

/* Trigger badge */
.trigger-badge { display:inline-flex; align-items:center; gap:6px; background:#eff6ff; color:var(--primary); border-radius:20px; padding:4px 12px; font-size:12px; font-weight:700; }

@media (max-width:900px) {
  .playbooks-grid { grid-template-columns:1fr 1fr; }
  .seq-builder-panel { width:100%; }
}

/* ══════════════════════════════════════════════
   LEADS PAGE UPGRADE
   ══════════════════════════════════════════════ */

/* Stats bar */
.lead-stats-bar { display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.lead-stat { background:var(--surface); border:1.5px solid var(--border); border-radius:12px; padding:12px 20px; display:flex; flex-direction:column; align-items:center; min-width:90px; cursor:pointer; transition:all .15s; }
.lead-stat:hover { border-color:var(--primary); }
.lead-stat.active-filter { border-color:var(--primary); background:#eff6ff; }
.lead-stat-rev { min-width:130px; }
.lead-stat-num { font-size:22px; font-weight:800; color:var(--primary); font-family:'DM Mono',monospace; }
.lead-stat-label { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.4px; margin-top:2px; }

/* Lead cards */
.leads-list { display:flex; flex-direction:column; gap:8px; }
.lead-card { background:var(--surface); border:1.5px solid var(--border); border-radius:12px; padding:14px 18px; display:flex; align-items:center; gap:14px; transition:all .15s; cursor:pointer; }
.lead-card:hover { border-color:var(--primary); box-shadow:0 2px 10px rgba(37,99,235,.08); }
.lead-card.status-converted { border-left:4px solid var(--success); }
.lead-card.status-lost { opacity:.6; }
.lead-card.status-new { border-left:4px solid var(--primary); }

.lc-avatar { width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,var(--primary),#7c3aed); color:white; font-size:16px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.lc-info { flex:1; min-width:0; }
.lc-name { font-size:15px; font-weight:700; margin-bottom:3px; }
.lc-sub { font-size:12px; color:var(--muted); display:flex; gap:10px; flex-wrap:wrap; }
.lc-sub span { display:flex; align-items:center; gap:3px; }
.lc-right { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.lc-sale { font-size:14px; font-weight:800; color:var(--success); font-family:'DM Mono',monospace; }
.lc-date { font-size:11px; color:var(--muted); }
.lc-actions { display:flex; gap:6px; }

/* Lead Drawer */
.lead-drawer { position:fixed; top:0; right:0; bottom:0; width:420px; background:var(--surface); box-shadow:-4px 0 32px rgba(0,0,0,.12); z-index:600; transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column; }
.lead-drawer.open { transform:translateX(0); }

.ld-header { padding:20px 24px; border-bottom:1px solid var(--border); display:flex; align-items:flex-start; justify-content:space-between; background:linear-gradient(135deg,#1e40af,#7c3aed); color:white; }
.ld-name { font-size:20px; font-weight:800; margin-bottom:4px; }
.ld-meta { font-size:12px; opacity:.8; }
.ld-close { background:rgba(255,255,255,.15); border:none; color:white; width:32px; height:32px; border-radius:50%; font-size:16px; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ld-close:hover { background:rgba(255,255,255,.3); }

.ld-body { flex:1; overflow-y:auto; padding:0; }
.ld-section { padding:16px 24px; border-bottom:1px solid var(--border); }
.ld-section:last-child { border-bottom:none; }
.ld-section-title { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:12px; }

.ld-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ld-info-item { display:flex; flex-direction:column; gap:2px; }
.ld-info-label { font-size:10px; font-weight:700; color:var(--muted); text-transform:uppercase; }
.ld-info-value { font-size:14px; font-weight:600; }
.ld-info-value a { color:var(--primary); text-decoration:none; }
.ld-info-value a:hover { text-decoration:underline; }

.ld-status-row { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.ld-status-select { border:1.5px solid var(--border); border-radius:8px; padding:8px 10px; font-size:13px; font-family:'DM Sans',sans-serif; outline:none; flex:1; }
.ld-convert-btn { background:var(--success); color:white; border:none; border-radius:8px; padding:8px 14px; font-size:13px; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; white-space:nowrap; }
.ld-convert-btn:hover { background:#059669; }

.ld-convert-form { background:#f0fdf4; border:1.5px solid #bbf7d0; border-radius:10px; padding:12px; }
.ld-convert-form label { font-size:12px; font-weight:600; color:var(--muted); display:block; margin-bottom:8px; }
.ld-convert-input-row { display:flex; gap:8px; align-items:center; }
.ld-dollar { font-size:16px; font-weight:700; color:var(--success); }
.ld-convert-input-row input { border:1.5px solid var(--border); border-radius:8px; padding:8px 10px; font-size:15px; font-family:'DM Mono',monospace; width:120px; outline:none; }

.ld-converted-badge { background:#dcfce7; border:1.5px solid #bbf7d0; border-radius:10px; padding:10px 14px; font-size:13px; font-weight:700; color:#166534; }

.ld-sms-body { width:100%; border:1.5px solid var(--border); border-radius:10px; padding:10px 12px; font-size:14px; font-family:'DM Sans',sans-serif; outline:none; resize:vertical; transition:border-color .15s; }
.ld-sms-body:focus { border-color:var(--primary); }
.ld-sms-footer { display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.ld-char-count { font-size:11px; color:var(--muted); font-family:'DM Mono',monospace; }

.ld-notes { width:100%; border:1.5px solid var(--border); border-radius:10px; padding:10px 12px; font-size:14px; font-family:'DM Sans',sans-serif; outline:none; resize:vertical; }
.ld-notes:focus { border-color:var(--primary); }

/* Pipeline status colors on select */
.status-select.status-new       { color:#5b21b6; background:#ede9fe; }
.status-select.status-contacted { color:#1e40af; background:#dbeafe; }
.status-select.status-booked    { color:#065f46; background:#d1fae5; }
.status-select.status-converted { color:#166534; background:#dcfce7; }
.status-select.status-lost      { color:#991b1b; background:#fee2e2; }

@media (max-width: 768px) {
  .lead-drawer { width: 100%; }
  .ld-info-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   AUTOMATION PERFORMANCE DASHBOARD
   ══════════════════════════════════════════════ */
.perf-stats-row { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:16px; }
.perf-stat { background:var(--surface); border:1.5px solid var(--border); border-radius:14px; padding:18px 16px; text-align:center; }
.perf-stat-primary { border-color:var(--primary); background:#eff6ff; }
.perf-stat-green   { border-color:var(--success); background:#f0fdf4; }
.perf-stat-icon    { font-size:22px; margin-bottom:6px; }
.perf-stat-num     { font-size:26px; font-weight:800; color:var(--text); font-family:'DM Mono',monospace; }
.perf-stat-label   { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.4px; margin-top:3px; }

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

/* Funnel */
.funnel-wrap { display:flex; flex-direction:column; gap:8px; }
.funnel-row  { display:flex; align-items:center; gap:12px; }
.funnel-label { width:90px; font-size:13px; font-weight:600; text-transform:capitalize; color:var(--muted); }
.funnel-bar-wrap { flex:1; background:#f1f5f9; border-radius:6px; height:28px; overflow:hidden; position:relative; }
.funnel-bar  { height:100%; border-radius:6px; transition:width .6s ease; display:flex; align-items:center; padding-left:10px; }
.funnel-bar span { font-size:12px; font-weight:700; color:white; white-space:nowrap; }
.funnel-count { width:32px; text-align:right; font-size:13px; font-weight:800; font-family:'DM Mono',monospace; color:var(--text); }
.funnel-pct   { width:36px; text-align:right; font-size:11px; color:var(--muted); font-family:'DM Mono',monospace; }

.funnel-bar.status-new       { background:linear-gradient(90deg,#6366f1,#818cf8); }
.funnel-bar.status-contacted { background:linear-gradient(90deg,#3b82f6,#60a5fa); }
.funnel-bar.status-booked    { background:linear-gradient(90deg,#10b981,#34d399); }
.funnel-bar.status-converted { background:linear-gradient(90deg,#059669,#10b981); }
.funnel-bar.status-lost      { background:linear-gradient(90deg,#9ca3af,#d1d5db); }

/* Sequence performance cards */
.seq-perf-card { border:1.5px solid var(--border); border-radius:12px; padding:14px 16px; margin-bottom:8px; }
.seq-perf-card:last-child { margin-bottom:0; }
.seq-perf-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.seq-perf-name   { font-size:14px; font-weight:700; }
.seq-perf-trigger { font-size:11px; background:#eff6ff; color:var(--primary); padding:2px 8px; border-radius:20px; font-weight:600; }
.seq-perf-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.seq-perf-metric  { text-align:center; }
.seq-perf-metric-num   { font-size:18px; font-weight:800; font-family:'DM Mono',monospace; color:var(--text); }
.seq-perf-metric-label { font-size:10px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.3px; }
.seq-perf-metric-num.green { color:var(--success); }
.seq-perf-bar-wrap { margin-top:10px; background:#f1f5f9; border-radius:4px; height:6px; overflow:hidden; }
.seq-perf-bar      { height:100%; background:linear-gradient(90deg,var(--primary),#7c3aed); border-radius:4px; transition:width .5s ease; }

/* Empty performance state */
.perf-empty { text-align:center; padding:40px 20px; color:var(--muted); }
.perf-empty .icon { font-size:40px; margin-bottom:10px; }

@media (max-width:900px) {
  .perf-stats-row { grid-template-columns:repeat(3,1fr); }
  .perf-grid { grid-template-columns:1fr; }
}

/* ══════════════════════════════════════════════
   LANGUAGE SWITCHER
   ══════════════════════════════════════════════ */
.lang-switcher { display:flex; align-items:center; background:#f1f5f9; border:1.5px solid var(--border); border-radius:10px; padding:3px; gap:2px; }
.lang-btn { background:none; border:none; color:#64748b; font-size:12px; font-weight:700; padding:5px 12px; border-radius:7px; cursor:pointer; font-family:'DM Sans',sans-serif; transition:all .15s; letter-spacing:.5px; white-space:nowrap; }
.lang-btn:hover { color:var(--text); background:white; }
.lang-btn.active { background:var(--primary); color:white; box-shadow:0 1px 4px rgba(79,70,229,.25); }

/* ══════════════════════════════════════════════
   AI FEATURES
   ══════════════════════════════════════════════ */

/* AI Draft button in lead drawer */
.ld-section-title { display:flex; align-items:center; justify-content:space-between; }
.ai-draft-btn { background:linear-gradient(135deg,#6366f1,#8b5cf6); color:white; border:none; border-radius:20px; padding:3px 12px; font-size:11px; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; transition:all .2s; letter-spacing:.3px; white-space:nowrap; }
.ai-draft-btn:hover { transform:scale(1.04); box-shadow:0 2px 8px rgba(99,102,241,.4); }
.ai-draft-btn:disabled { opacity:.6; cursor:not-allowed; transform:none; }

/* AI loading state */
.ai-draft-loading { display:flex; align-items:center; gap:8px; padding:8px 12px; background:#f5f3ff; border-radius:8px; font-size:12px; color:#6d28d9; font-weight:600; margin-bottom:8px; }
.ai-spinner { width:14px; height:14px; border:2px solid #ddd8fe; border-top-color:#6366f1; border-radius:50%; animation:spin .7s linear infinite; flex-shrink:0; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Conversation AI suggestions */
.ai-suggestions { background:linear-gradient(135deg,#f5f3ff,#eff6ff); border:1.5px solid #ddd8fe; border-radius:12px; padding:12px 14px; margin:0 0 8px; }
.ai-suggestions-label { font-size:11px; font-weight:700; color:#6d28d9; text-transform:uppercase; letter-spacing:.5px; margin-bottom:8px; }
.ai-chips { display:flex; flex-wrap:wrap; gap:6px; }
.ai-chip { background:white; border:1.5px solid #c4b5fd; color:#4c1d95; font-size:12px; font-weight:500; padding:6px 12px; border-radius:20px; cursor:pointer; font-family:'DM Sans',sans-serif; transition:all .15s; max-width:100%; text-align:left; line-height:1.4; }
.ai-chip:hover { background:#ede9fe; border-color:#7c3aed; color:#3b0764; }
.ai-chip.selected { background:#6366f1; border-color:#6366f1; color:white; }

/* Conversation compose row */
.compose-row { display:flex; gap:8px; }
.compose-row input { flex:1; }

/* AI suggest button in conversations */
.ai-suggest-btn { background:none; border:none; color:#6366f1; font-size:12px; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; padding:4px 0; letter-spacing:.3px; transition:color .15s; display:flex; align-items:center; gap:4px; margin-top:6px; }
.ai-suggest-btn:hover { color:#4f46e5; }
.ai-suggest-btn:disabled { opacity:.5; cursor:not-allowed; }
