/* ═══════════════════════════════════════════════════════
   SalesCRM — site.css
   Design System: Inter font, Indigo accent, clean cards
═══════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────── */
:root {
  --primary:       #4F46E5;
  --primary-dark:  #3730A3;
  --primary-light: #EEF2FF;
  --success:       #10B981;
  --success-light: #ECFDF5;
  --warning:       #F59E0B;
  --warning-light: #FFFBEB;
  --danger:        #EF4444;
  --danger-light:  #FEF2F2;
  --info:          #3B82F6;
  --info-light:    #EFF6FF;
  --purple:        #8B5CF6;
  --purple-light:  #F5F3FF;

  --bg:            #F1F5F9;
  --surface:       #FFFFFF;
  --surface2:      #F8FAFC;
  --border:        #E2E8F0;
  --border-light:  #F1F5F9;

  --text:          #0F172A;
  --text-muted:    #64748B;
  --text-light:    #94A3B8;

  --sidebar-w:     240px;
  --header-h:      60px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-md:     0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     14px;

  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:    0.18s ease;
}

/* ─── RESET & BASE ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ─── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info-sm { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.3px; }
.sidebar-toggle { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 18px; padding: 4px; border-radius: 6px; }
.sidebar-toggle:hover { color: var(--primary); background: var(--primary-light); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-section { margin-bottom: 4px; }
.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: .8px;
  padding: 10px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  margin: 1px 8px;
  transition: all var(--transition);
}
.nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item i { font-size: 16px; flex-shrink: 0; width: 18px; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
.nav-badge.ai { background: linear-gradient(135deg, #7C3AED, var(--primary)); color: white; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  flex-shrink: 0;
}
.user-mini { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-initials-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: white; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name-sm { font-weight: 600; font-size: 13px; }
.user-role-sm { font-size: 11px; color: var(--text-muted); }

/* ─── MAIN WRAPPER ───────────────────────────────────── */
.main-wrapper { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left var(--transition); }
.sidebar.collapsed ~ .main-wrapper { margin-left: 64px; }

/* ─── TOP HEADER ─────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 8px; }

/* Global Search */
.global-search { position: relative; flex: 1; max-width: 420px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 14px; }
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition);
}
.search-input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  max-height: 360px; overflow-y: auto; z-index: 200;
}
.search-result-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light); }
.search-result-item:hover { background: var(--surface2); }
.search-result-item:last-child { border-bottom: none; }

/* Notification Bell */
.btn-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 18px; cursor: pointer;
  position: relative; transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface2); color: var(--text); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: white; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

/* Notification Dropdown */
.notif-dropdown {
  width: 380px; padding: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.btn-link-sm { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); display: flex; gap: 12px; cursor: pointer; transition: background var(--transition); }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #E0E7FF; }
.notif-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.notif-footer { padding: 10px 16px; text-align: center; font-size: 13px; border-top: 1px solid var(--border); }

/* User Menu */
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 8px;
  transition: background var(--transition);
}
.user-menu-btn:hover { background: var(--surface2); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-initials {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: white; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.role-badge { font-size: 11px; font-weight: 500; }
.role-headofsales { color: var(--purple); }
.role-salesmanager { color: var(--info); }
.role-salesexecutive { color: var(--success); }

/* ─── PAGE CONTENT ───────────────────────────────────── */
.page-content { flex: 1; padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

/* ─── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface2); border-radius: 0 0 var(--radius) var(--radius); }

/* ─── KPI CARDS ──────────────────────────────────────── */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 8px; }
.kpi-trend { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.kpi-icon.indigo { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green  { background: var(--success-light); color: var(--success); }
.kpi-icon.amber  { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red    { background: var(--danger-light); color: var(--danger); }
.kpi-icon.blue   { background: var(--info-light); color: var(--info); }
.kpi-icon.purple { background: var(--purple-light); color: var(--purple); }

/* ─── TABLES ─────────────────────────────────────────── */
.table-crm { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-crm th { padding: 10px 14px; background: var(--surface2); border-bottom: 2px solid var(--border); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); white-space: nowrap; }
.table-crm td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.table-crm tbody tr:hover { background: #FAFBFF; }
.table-crm tbody tr.overdue td { border-left: 3px solid var(--danger); }
.table-crm tbody tr.expiring td { border-left: 3px solid var(--warning); }
.table-crm tbody tr.won td { border-left: 3px solid var(--success); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
th.sortable .sort-icon { opacity: .4; font-size: 11px; }
th.sortable.asc .sort-icon, th.sortable.desc .sort-icon { opacity: 1; color: var(--primary); }

/* ─── STATUS BADGES ──────────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-healthy    { background: var(--success-light); color: var(--success); }
.badge-atrisk     { background: var(--warning-light); color: #92400E; }
.badge-critical   { background: var(--danger-light); color: var(--danger); }
.badge-hot        { background: #FEF2F2; color: #B91C1C; }
.badge-warm       { background: #FFFBEB; color: #92400E; }
.badge-cold       { background: #EFF6FF; color: #1D4ED8; }
.badge-medium     { background: var(--surface2); color: var(--text-muted); }
.badge-won        { background: var(--success-light); color: var(--success); }
.badge-lost       { background: #F1F5F9; color: var(--text-muted); }
.badge-sent       { background: #EFF6FF; color: #2563EB; }
.badge-accepted   { background: var(--success-light); color: var(--success); }
.badge-rejected   { background: var(--danger-light); color: var(--danger); }
.badge-draft      { background: #F1F5F9; color: var(--text-muted); }
.badge-viewed     { background: var(--purple-light); color: var(--purple); }
.badge-expired    { background: #F1F5F9; color: #94A3B8; }
.badge-overdue    { background: var(--danger-light); color: var(--danger); }
.badge-open       { background: var(--info-light); color: var(--info); }
.badge-completed  { background: var(--success-light); color: var(--success); }
.badge-inprogress { background: var(--warning-light); color: #92400E; }

/* Health Dot */
.health-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.health-dot.healthy  { background: var(--success); }
.health-dot.atrisk   { background: var(--warning); }
.health-dot.critical { background: var(--danger); }

/* ─── DEAL PULSE SCORE RING ──────────────────────────── */
.score-ring { position: relative; display: inline-block; }
.score-ring-label {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px; font-weight: 700; color: var(--text);
}

/* ─── KANBAN BOARD ───────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding: 4px 0 16px; align-items: flex-start; min-height: 600px; }
.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.kanban-col { width: 280px; flex-shrink: 0; }
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.kanban-col-header .col-stats { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.kanban-col-count { padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.3); font-size: 12px; font-weight: 700; }
.kanban-col-body { min-height: 200px; background: var(--surface2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 8px; }
.kanban-drop-hint { padding: 20px; text-align: center; color: var(--text-light); font-size: 12px; border: 2px dashed var(--border); border-radius: var(--radius-sm); margin: 4px; }

/* Lead Cards */
.lead-card {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  margin-bottom: 8px; cursor: grab; transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.lead-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.lead-card.sortable-chosen { opacity: .8; box-shadow: var(--shadow-md); cursor: grabbing; }
.lead-card.sortable-ghost { opacity: .4; }
.lead-card-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card-company { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.lead-card-footer { display: flex; align-items: center; justify-content: space-between; }
.lead-card-value { font-weight: 700; font-size: 13px; color: var(--primary); }
.lead-card-avatar { width: 24px; height: 24px; border-radius: 50%; font-size: 10px; font-weight: 700; color: white; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.lead-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.lead-card:hover .lead-card-actions { opacity: 1; }
.lead-card-action-btn { width: 24px; height: 24px; border-radius: 4px; border: none; background: var(--surface2); color: var(--text-muted); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lead-card-action-btn:hover { background: var(--primary); color: white; }
.lead-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lead-card-meta-item { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); }
.lead-card-meta-item.overdue { color: var(--danger); }

/* ─── FILTER BAR ─────────────────────────────────────── */
.filter-bar {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.filter-control { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface2); outline: none; transition: all var(--transition); min-width: 130px; }
.filter-control:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 2px rgba(79,70,229,.08); }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* ─── ACTIVITY TIMELINE ──────────────────────────────── */
.activity-timeline { position: relative; padding-left: 32px; }
.activity-timeline::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.activity-item { position: relative; margin-bottom: 20px; }
.activity-icon {
  position: absolute; left: -32px; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: white; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; z-index: 1;
}
.activity-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.activity-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.activity-type { font-weight: 600; font-size: 13px; }
.activity-time { font-size: 12px; color: var(--text-light); }
.activity-desc { font-size: 13px; color: var(--text-muted); }
.activity-outcome { margin-top: 6px; padding: 6px 10px; background: var(--surface2); border-radius: var(--radius-sm); font-size: 12px; }

/* Activity type colors */
.activity-icon.phonecall    { border-color: var(--success); color: var(--success); background: var(--success-light); }
.activity-icon.email        { border-color: var(--info); color: var(--info); background: var(--info-light); }
.activity-icon.meeting      { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.activity-icon.proposal     { border-color: var(--warning); color: var(--warning); background: var(--warning-light); }
.activity-icon.task         { border-color: var(--purple); color: var(--purple); background: var(--purple-light); }

/* ─── PROGRESS BARS ──────────────────────────────────── */
.progress-crm { height: 8px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-bar-crm { height: 100%; border-radius: 10px; transition: width .5s ease; }
.progress-bar-crm.success { background: var(--success); }
.progress-bar-crm.warning { background: var(--warning); }
.progress-bar-crm.danger  { background: var(--danger); }
.progress-bar-crm.primary { background: var(--primary); }

/* ─── FORMS ──────────────────────────────────────────── */
.form-crm .form-label { font-weight: 500; font-size: 13px; margin-bottom: 5px; }
.form-crm .form-control, .form-crm .form-select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; padding: 8px 12px;
  transition: all var(--transition);
}
.form-crm .form-control:focus, .form-crm .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn-primary-crm {
  background: var(--primary); color: white; border: none;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary-crm:hover { background: var(--primary-dark); color: white; text-decoration: none; }
.btn-secondary-crm {
  background: white; color: var(--text); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 13.5px; cursor: pointer;
  transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary-crm:hover { background: var(--surface2); border-color: var(--text-muted); text-decoration: none; }
.btn-danger-crm { background: var(--danger); color: white; border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.btn-icon-sm { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: white; color: var(--text-muted); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all var(--transition); }
.btn-icon-sm:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ─── MODALS ─────────────────────────────────────────── */
.modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.modal-header { border-bottom: 1px solid var(--border); padding: 16px 20px; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }

/* Side Drawer */
.side-drawer {
  position: fixed; top: 0; right: -480px; width: 480px; height: 100vh;
  background: white; box-shadow: var(--shadow-md);
  z-index: 1050; transition: right .3s ease;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
}
.side-drawer.open { right: 0; }
.side-drawer-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.side-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1049; }
.drawer-overlay.active { display: block; }

/* ─── PAGINATION ─────────────────────────────────────── */
.pagination-crm { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  background: white; color: var(--text-muted); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .3; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* ─── SKELETON LOADING ───────────────────────────────── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-row { height: 48px; margin-bottom: 8px; border-radius: var(--radius-sm); }

/* ─── ALERTS ─────────────────────────────────────────── */
.alert-toast { border-radius: var(--radius); border: none; box-shadow: var(--shadow); font-size: 14px; font-weight: 500; }

/* ─── TABS ───────────────────────────────────────────── */
.tabs-crm { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-item { padding: 10px 18px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all var(--transition); display: flex; align-items: center; gap: 6px; }
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-badge { padding: 1px 6px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tab-badge.primary { background: var(--primary-light); color: var(--primary); }
.tab-badge.danger { background: var(--danger-light); color: var(--danger); }

/* ─── DEAL PULSE GAUGE ───────────────────────────────── */
.dp-gauge-container { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.dp-score-big { font-size: 48px; font-weight: 800; line-height: 1; }
.dp-health-label { font-size: 13px; font-weight: 600; padding: 4px 16px; border-radius: 20px; margin-top: 8px; }
.dp-health-healthy  { background: var(--success-light); color: var(--success); }
.dp-health-atrisk   { background: var(--warning-light); color: #92400E; }
.dp-health-critical { background: var(--danger-light); color: var(--danger); }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .kanban-board { padding-bottom: 20px; }
}
@media (max-width: 576px) {
  .kpi-value { font-size: 20px; }
  .filter-bar { padding: 12px; }
  .filter-control { min-width: 100%; }
}

/* ─── LOGIN PAGE ─────────────────────────────────────── */
.login-page { min-height: 100vh; background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 25px 50px rgba(0,0,0,.15); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon-lg { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), #7C3AED); border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; color: white; margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

/* ─── TEAM PERFORMANCE TABLE ────────────────────────── */
.perf-cell-above { background: #F0FDF4; color: #16A34A; font-weight: 600; }
.perf-cell-below { background: #FEF2F2; color: #DC2626; font-weight: 600; }
.leaderboard-rank { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.rank-1 { background: #FEF3C7; color: #D97706; }
.rank-2 { background: #F1F5F9; color: #64748B; }
.rank-3 { background: #FEF2F2; color: #B45309; }

/* ─── SCROLLBAR ──────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── UTILITIES ──────────────────────────────────────── */
.text-primary-crm { color: var(--primary); }
.text-muted-crm { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.gap-6 { gap: 6px; }
.min-w-0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
