/* ============================================================
   LEADFLOW CRM — Design System
   Premium SaaS UI · Light + Dark · Bootstrap 5 override layer
   ============================================================ */

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

:root {
  --primary: #7C3AED;
  --primary-600: #6D28D9;
  --primary-700: #5B21B6;
  --primary-soft: rgba(124, 58, 237, 0.10);
  --primary-glow: rgba(124, 58, 237, 0.35);

  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info: #3B82F6;
  --info-soft: rgba(59, 130, 246, 0.12);

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E9EEF5;
  --sidebar: #FFFFFF;
  --border: #E7ECF3;
  --border-strong: #D8E0EA;
  --text: #0F172A;
  --text-soft: #334155;
  --text-muted: #64748B;
  --text-faint: #94A3B8;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.12);
  --shadow-primary: 0 10px 24px rgba(124, 58, 237, 0.28);

  --r-xs: 8px; --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --sidebar-w: 264px; --navbar-h: 68px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

html[data-theme="dark"] {
  --bg: #0B1020; --surface: #141B2D; --surface-2: #1B2337; --surface-3: #232C42; --sidebar: #0F1526;
  --border: rgba(255,255,255,0.07); --border-strong: rgba(255,255,255,0.12);
  --text: #E8ECF4; --text-soft: #C4CCDB; --text-muted: #8B95AB; --text-faint: #5E6982;
  --primary-soft: rgba(124,58,237,0.18);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3); --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45); --shadow-lg: 0 18px 48px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-size: 14px; transition: background .35s var(--ease), color .35s var(--ease); }
h1,h2,h3,h4,h5,.display-font { font-family: var(--font-display); letter-spacing: -0.02em; }
a { text-decoration: none; color: inherit; }
::selection { background: var(--primary-glow); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.text-muted-2 { color: var(--text-muted) !important; }
.text-faint { color: var(--text-faint) !important; }
.fw-800 { font-weight: 800 !important; }

.app { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); background: var(--sidebar); border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .3s var(--ease), background .35s var(--ease); }
.sidebar__brand { height: var(--navbar-h); display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #A855F7); display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: var(--shadow-primary); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-name span { color: var(--primary); }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 16px 14px 24px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); padding: 16px 12px 8px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; margin: 2px 0; border-radius: var(--r-sm); color: var(--text-muted); font-weight: 500; cursor: pointer; position: relative; transition: all .2s var(--ease); }
.nav-item i { width: 20px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav-item .nav-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: var(--primary); color: #fff; line-height: 1.4; }
.nav-item .nav-badge.soft { background: var(--danger); }
.sidebar__foot { padding: 14px; border-top: 1px solid var(--border); }
.upgrade-card { background: linear-gradient(140deg, var(--primary), #9333EA); border-radius: var(--r-md); padding: 16px; color: #fff; position: relative; overflow: hidden; }
.upgrade-card h6 { font-weight: 800; margin: 0 0 4px; }
.upgrade-card p { font-size: 12px; opacity: .85; margin: 0 0 12px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.navbar-top { height: var(--navbar-h); position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 26px; }
.searchbar { flex: 1; max-width: 460px; position: relative; }
.searchbar input { width: 100%; height: 42px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-pill); padding: 0 16px 0 44px; color: var(--text); font-size: 13.5px; transition: all .2s var(--ease); }
.searchbar input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--primary-soft); }
.searchbar i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.searchbar kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; background: var(--surface); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; color: var(--text-faint); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); display: grid; place-items: center; cursor: pointer; position: relative; transition: all .2s var(--ease); font-size: 15px; }
.icon-btn:hover { background: var(--surface-2); color: var(--primary); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all .2s var(--ease); }
.profile-chip:hover { background: var(--surface-2); }
.profile-chip .meta { line-height: 1.15; }
.profile-chip .meta b { font-size: 13px; font-weight: 700; }
.profile-chip .meta small { font-size: 11px; color: var(--text-muted); }
.avatar { border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }

.page { padding: 26px 30px 60px; max-width: 1440px; animation: fadeUp .45s var(--ease); }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 800; margin: 0; }
.page-sub { color: var(--text-muted); margin: 4px 0 0; font-size: 13.5px; }
.page-head .spacer { flex: 1; }

.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.card-x.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-x .card-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-x .card-head h6 { margin: 0; font-weight: 700; font-size: 15px; }
.card-x .card-body-x { padding: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
/* base shape — applies anywhere (mini stats, card heads, modals), not only inside .stat-card */
.stat-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.stat-card .stat-ico { margin-bottom: 16px; }
.stat-card .stat-val { font-size: 28px; font-weight: 800; font-family: var(--font-display); line-height: 1; }
.stat-card .stat-lbl { color: var(--text-muted); font-size: 13px; margin-top: 6px; font-weight: 500; }
.stat-card .stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); margin-top: 12px; }
.trend-up { background: var(--success-soft); color: var(--success); }
.trend-down { background: var(--danger-soft); color: var(--danger); }
.tint-primary { background: var(--primary-soft); color: var(--primary); }
.tint-success { background: var(--success-soft); color: var(--success); }
.tint-warning { background: var(--warning-soft); color: var(--warning); }
.tint-danger { background: var(--danger-soft); color: var(--danger); }
.tint-info { background: var(--info-soft); color: var(--info); }
.badge-x { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); line-height: 1.4; }
.badge-x i { font-size: 8px; }
.b-success { background: var(--success-soft); color: var(--success); }
.b-warning { background: var(--warning-soft); color: #B45309; }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-primary { background: var(--primary-soft); color: var(--primary); }
.b-muted { background: var(--surface-3); color: var(--text-muted); }
html[data-theme="dark"] .b-warning { color: var(--warning); }
.btn-x { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; transition: all .2s var(--ease); white-space: nowrap; }
.btn-primary-x { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary-x:hover { background: var(--primary-600); transform: translateY(-1px); box-shadow: 0 12px 28px var(--primary-glow); }
.btn-ghost-x { background: var(--surface); color: var(--text-soft); border-color: var(--border); }
.btn-ghost-x:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-soft-x { background: var(--primary-soft); color: var(--primary); }
.btn-soft-x:hover { background: var(--primary); color: #fff; }
.btn-success-x { background: var(--success); color: #fff; }
.btn-sm-x { padding: 7px 13px; font-size: 12.5px; }
.btn-icon-only { padding: 9px 11px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 13px; padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer; transition: all .2s var(--ease); }
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.table-x { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-x thead th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table-x tbody td { padding: 15px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.table-x tbody tr { transition: background .18s var(--ease); }
.table-x tbody tr:hover { background: var(--surface-2); }
.table-x tbody tr:last-child td { border-bottom: 0; }
.lead-cell { display: flex; align-items: center; gap: 12px; }
.lead-cell b { font-weight: 700; font-size: 13.5px; }
.lead-cell small { color: var(--text-muted); font-size: 12px; }
.channel-dots i { font-size: 14px; margin-right: 8px; }
.score-ring { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.kanban { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { flex: 0 0 300px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); }
.kanban-col__head { display: flex; align-items: center; gap: 10px; padding: 15px 16px; }
.kanban-col__head .dot-lg { width: 10px; height: 10px; border-radius: 50%; }
.kanban-col__head h6 { margin: 0; font-weight: 700; font-size: 13.5px; flex: 1; }
.kanban-col__head .count { font-size: 12px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); padding: 2px 9px; border-radius: var(--r-pill); color: var(--text-muted); }
.kanban-col__body { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 12px; max-height: 68vh; overflow-y: auto; }
.kboard-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-xs); cursor: pointer; transition: all .2s var(--ease); }
.kboard-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.kboard-card .kb-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kboard-card b { font-size: 13.5px; font-weight: 700; }
.kboard-card p { font-size: 12px; color: var(--text-muted); margin: 6px 0 12px; }
.kboard-card .kb-foot { display: flex; align-items: center; justify-content: space-between; }
.task-group { margin-bottom: 26px; }
.task-group__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.task-group__head .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; }
.task-group__head h5 { margin: 0; font-weight: 800; font-size: 16px; }
.task-group__head .count-pill { background: var(--surface-2); border: 1px solid var(--border); padding: 3px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; color: var(--text-muted); }
.task-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 15px 18px; margin-bottom: 12px; box-shadow: var(--shadow-xs); transition: all .22s var(--ease); position: relative; overflow: hidden; }
.task-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); opacity: 0; transition: opacity .2s; }
.task-card:hover { box-shadow: var(--shadow-md); transform: translateX(3px); }
.task-card:hover::before { opacity: 1; }
.task-check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .2s var(--ease); flex-shrink: 0; }
.task-check:hover { border-color: var(--success); }
.task-card.done { opacity: .5; }
.task-card.done .task-title { text-decoration: line-through; }
.task-card.done .task-check { background: var(--success); border-color: var(--success); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 14px; }
.task-meta { display: flex; align-items: center; gap: 14px; margin-top: 5px; color: var(--text-muted); font-size: 12px; flex-wrap: wrap; }
.task-meta span { display: inline-flex; align-items: center; gap: 5px; }
.prio-bar { width: 4px; height: 40px; border-radius: 4px; flex-shrink: 0; }
.timeline { position: relative; padding-left: 8px; }
.timeline::before { content: ''; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { display: flex; gap: 18px; padding-bottom: 26px; position: relative; }
.tl-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; z-index: 1; border: 3px solid var(--bg); }
.tl-body { flex: 1; padding-top: 2px; }
.tl-body .tl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-body b { font-weight: 700; font-size: 13.5px; }
.tl-body .tl-time { color: var(--text-faint); font-size: 12px; margin-left: auto; }
.tl-body p { color: var(--text-muted); font-size: 13px; margin: 5px 0 0; }
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin-top: 10px; font-size: 13px; }
.activity { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity:last-child { border-bottom: 0; }
.activity .act-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.activity .act-body { flex: 1; font-size: 13px; }
.activity .act-body b { font-weight: 700; }
.activity .act-time { color: var(--text-faint); font-size: 11.5px; margin-top: 3px; }
.form-x label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; display: block; }
.form-x .inp, .form-x select, .form-x textarea { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-sm); padding: 11px 14px; color: var(--text); font-size: 13.5px; font-family: var(--font); transition: all .2s var(--ease); }
.form-x .inp:focus, .form-x select:focus, .form-x textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--primary-soft); }
.form-x .field { margin-bottom: 18px; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; display:inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--r-pill); cursor: pointer; transition: .25s; }
.switch .track::before { content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(20px); }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav a { padding: 11px 14px; border-radius: var(--r-sm); color: var(--text-muted); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 11px; cursor: pointer; transition: all .2s; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); }
.progress-x { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress-x > span { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--primary), #A855F7); transition: width .6s var(--ease); }
.progress-x.success > span { background: linear-gradient(90deg, var(--success), #4ADE80); }
.progress-x.warning > span { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.empty { text-align: center; padding: 60px 20px; }
.empty .empty-ico { width: 90px; height: 90px; border-radius: 26px; background: var(--surface-2); display: grid; place-items: center; font-size: 36px; color: var(--text-faint); margin: 0 auto 20px; }
.empty h5 { font-weight: 800; margin: 0 0 8px; }
.empty p { color: var(--text-muted); max-width: 340px; margin: 0 auto 20px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
.skel-line { height: 12px; margin-bottom: 10px; }
.skel-card { height: 120px; border-radius: var(--r-lg); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.fab { position: fixed; right: 30px; bottom: 30px; width: 58px; height: 58px; border-radius: 18px; background: var(--primary); color: #fff; border: 0; display: grid; place-items: center; font-size: 22px; cursor: pointer; box-shadow: var(--shadow-primary); z-index: 45; transition: all .25s var(--ease); }
.fab:hover { transform: translateY(-3px) rotate(90deg); box-shadow: 0 16px 34px var(--primary-glow); }
.toast-wrap { position: fixed; top: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 12px; }
.toast-x { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 18px; box-shadow: var(--shadow-lg); min-width: 300px; animation: slideIn .35s var(--ease); }
.toast-x .t-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.toast-x b { font-size: 13.5px; font-weight: 700; display: block; }
.toast-x small { color: var(--text-muted); font-size: 12px; }
.toast-x.out { animation: slideOut .3s var(--ease) forwards; }
.dd-menu { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px; min-width: 220px; z-index: 100; animation: fadeUp .18s var(--ease); }
.dd-menu a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-soft); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .15s; }
.dd-menu a:hover { background: var(--surface-2); color: var(--primary); }
.dd-menu a i { width: 16px; }
.dd-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-menu a.danger { color: var(--danger); }
.dd-menu a.danger:hover { background: var(--danger-soft); }
.notif-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-sm); cursor: pointer; transition: background .15s; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .n-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.notif-item.unread { background: var(--primary-soft); }
.modal-x-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s var(--ease); }
.modal-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); animation: modalPop .3s var(--ease); max-height: 90vh; overflow-y: auto; }
.modal-x.wide { max-width: 720px; }
.modal-x__head { display: flex; align-items: center; gap: 12px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.modal-x__head h5 { margin: 0; font-weight: 800; font-size: 17px; flex: 1; }
.modal-x__body { padding: 24px; }
.modal-x__foot { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

/* ---------- Side drawer (lead quick-view) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 140; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 150; transform: translateX(100%); transition: transform .3s var(--ease); overflow-y: auto; }
.drawer.open { transform: none; }
.drawer__head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 20px; display: flex; align-items: center; gap: 12px; z-index: 2; }
.drawer__body { padding: 18px 20px 40px; }
.drawer-sec { margin-bottom: 18px; }
.drawer-sec h6 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 0 0 10px; }
.drawer-link { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.drawer-link i { width: 18px; text-align: center; }
.drawer-link a { color: var(--primary); font-weight: 600; }
/* side-by-side: no dimming, content shifts left to make room */
.main { transition: padding-right .3s var(--ease); }
@media (min-width: 1200px) { body.drawer-open .main { padding-right: 476px; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes modalPop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: fadeUp .5s var(--ease) backwards; }
.welcome { background: linear-gradient(120deg, var(--primary) 0%, #9333EA 55%, #A855F7 100%); border-radius: var(--r-xl); padding: 30px 34px; color: #fff; position: relative; overflow: hidden; margin-bottom: 26px; }
.welcome::before { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.12); }
.welcome h2 { font-weight: 800; margin: 0 0 6px; font-size: 26px; position: relative; }
.welcome p { opacity: .9; margin: 0; position: relative; max-width: 520px; }
.welcome .welcome-stats { display: flex; gap: 30px; margin-top: 22px; position: relative; flex-wrap: wrap; }
.welcome .welcome-stats .ws b { font-size: 24px; font-weight: 800; font-family: var(--font-display); }
.welcome .welcome-stats .ws small { opacity: .85; display: block; font-size: 12.5px; }
.auth { display: flex; min-height: 100vh; }
.auth__visual { flex: 1; background: linear-gradient(150deg, #4C1D95 0%, var(--primary) 50%, #A855F7 100%); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 50px; color: #fff; }
.auth__visual::before { content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%; background: rgba(255,255,255,.08); top: -140px; right: -120px; }
.auth__form { width: 480px; max-width: 100%; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.glass-stat { background: rgba(255,255,255,.12); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-lg); padding: 18px 20px; }
.auth-blob { position: absolute; border-radius: 40% 60% 55% 45%/55% 45% 55% 45%; background: rgba(255,255,255,.07); filter: blur(2px); animation: float 9s ease-in-out infinite; }
.input-group-x { position: relative; }
.input-group-x i.lead-i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.input-group-x input { width: 100%; height: 48px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 0 44px; color: var(--text); font-size: 14px; transition: all .2s; }
.input-group-x input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input-group-x .toggle-eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); cursor: pointer; }
.divider-or { display: flex; align-items: center; gap: 14px; color: var(--text-faint); font-size: 12px; margin: 22px 0; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google { width: 100%; height: 48px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; gap: 11px; font-weight: 600; cursor: pointer; transition: all .2s; color: var(--text); }
.btn-google:hover { background: var(--surface-2); border-color: var(--border-strong); }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-24px) rotate(8deg); } }
.menu-toggle { display: none; }
.backdrop-mobile { display: none; }
@media (max-width: 1100px) { .searchbar { max-width: 300px; } }
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .backdrop-mobile.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }
  .auth__visual { display: none; }
  .auth__form { width: 100%; }
}
@media (max-width: 768px) {
  .page { padding: 18px 16px 60px; }
  .navbar-top { padding: 0 16px; }
  .searchbar { display: none; }
  .welcome { padding: 22px; }
  .profile-chip .meta { display: none; }
  .hide-sm { display: none !important; }
}
