/* ==============================================
   Sales MindClub CRM — Premium Design System v2
   Managed & Developed by Nitin Kumar Saini
   Powered by AI ✦
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,400&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ============ CSS VARIABLES ============ */
:root {
  --primary:        #7c6fff;       /* Electric Violet */
  --primary-dark:   #5b50e8;       /* Deep Violet */
  --primary-light:  #a99fff;       /* Soft Lavender */
  --secondary:      #c4bbff;       /* Pale Violet */
  --success:        #00d48b;       /* Vivid Emerald */
  --danger:         #ff4f6b;       /* Hot Coral */
  --warning:        #ffb830;       /* Golden Amber */
  --info:           #00c4e8;       /* Cyan Spark */

  /* Deep Space Dark Palette */
  --dark:           #060b14;       /* Void Black */
  --darker:         #020609;       /* Deeper Void */
  --card-bg:        #0d1525;       /* Midnight Blue */
  --card-bg-2:      #111e32;       /* Navy */
  --sidebar-bg:     #040a14;       /* Sidebar navy */
  --input-bg:       #0a1220;       /* Input dark */
  --border-color:   #172035;       /* Subtle border */
  --border-light:   #1e2e4a;       /* Slightly lighter border */

  --text-primary:   #eef2ff;       /* Almost white with blue tint */
  --text-secondary: #8ba3c7;       /* Cool steel blue */
  --text-muted:     #3d5275;       /* Deep muted navy */

  --hover-bg:       rgba(124,111,255,0.07);

  --shadow-sm:  0 2px 12px rgba(0,0,0,0.5);
  --shadow-md:  0 10px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-lg:  0 24px 70px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  --glow-primary: 0 0 40px rgba(124,111,255,0.2);

  --radius-sm:  8px;
  --radius-md:  13px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --sidebar-width:  264px;
  --topbar-height:  62px;
  --transition:     all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Outfit', sans-serif;
  background: var(--dark);
  background-image:
    radial-gradient(ellipse 100% 60% at 0% 0%, rgba(124,111,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(0,212,139,0.04) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(91,80,232,0.03) 0%, transparent 70%);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--darker); }
::-webkit-scrollbar-thumb { background: #1e2a42; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============ LAYOUT ============ */
.crm-wrapper { display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);

  /* Deep space gradient */
  background: linear-gradient(180deg, #050d1a 0%, #030810 60%, #020609 100%);
}

/* Electric glow line on right edge */
.sidebar::after {
  content: '';
  position: absolute;
  top: 15%; right: -1px;
  width: 1px; height: 70%;
  background: linear-gradient(180deg, transparent, rgba(124,111,255,0.5), rgba(0,212,139,0.3), transparent);
  border-radius: 2px;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #7c6fff, #00d48b);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(124,111,255,0.45), 0 0 60px rgba(0,212,139,0.1);
}

.sidebar-brand .brand-text {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.3px;
}
.sidebar-brand .brand-text small {
  display: block;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0;
}

.sidebar-nav { padding: 14px 10px; flex: 1; }

.nav-section-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition);
  margin-bottom: 1px;
  position: relative;
  overflow: hidden;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(99,102,241,0.08), transparent);
  opacity: 0;
  transition: var(--transition);
  border-radius: 9px;
}

.sidebar-link i { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-link:hover {
  color: var(--primary-light);
  background: rgba(99,102,241,0.07);
}
.sidebar-link:hover::before { opacity: 1; }

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(124,111,255,0.18), rgba(124,111,255,0.04));
  color: #a99fff;
  border-left: 2px solid #7c6fff;
  padding-left: 10px;
  font-weight: 600;
}
.sidebar-link.active::before { opacity: 1; }

.sidebar-footer {
  padding: 14px 10px 10px;
  border-top: 1px solid var(--border-color);
}

/* Developer credit in sidebar footer */
.sidebar-dev-credit {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(99,102,241,0.05);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 8px;
  text-align: center;
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.sidebar-dev-credit strong {
  color: var(--primary-light);
  display: block;
  font-weight: 700;
  font-size: 10px;
  margin-bottom: 2px;
}
.sidebar-dev-credit .ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(99,102,241,0.25);
  padding: 1px 6px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  color: #a5b4fc;
  margin-top: 2px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.user-card:hover { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.2); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c6fff, #00d48b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(124,111,255,0.35);
}

.user-info .user-name  { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.user-info .user-role  { font-size: 10.5px; color: var(--text-muted); }

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-height);
  background: rgba(8,13,23,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}
.topbar-subtitle { font-size: 11.5px; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.page-content { padding: 20px 24px; flex: 1; }

/* ============ CARDS ============ */
.crm-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.crm-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
.crm-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.crm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.crm-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Outfit', sans-serif;
}

/* ============ STAT CARDS ============ */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-slow);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient, linear-gradient(90deg, var(--primary), var(--secondary)));
}
/* Subtle glow spot in top-right */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--glow-spot, rgba(99,102,241,0.06));
  filter: blur(16px);
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--glow-primary);
  border-color: rgba(99,102,241,0.2);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.stat-value { font-size: 26px; font-weight: 900; color: var(--text-primary); line-height: 1; font-family: 'Outfit', sans-serif; letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 11.5px; margin-top: 6px; font-weight: 600; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Stat Gradients */
.stat-primary { --gradient: linear-gradient(90deg, #3b46e8, #7c6fff); --glow-spot: rgba(124,111,255,0.1); }
.stat-success  { --gradient: linear-gradient(90deg, #00a86b, #00d48b); --glow-spot: rgba(0,212,139,0.1); }
.stat-warning  { --gradient: linear-gradient(90deg, #e8900a, #ffb830); --glow-spot: rgba(255,184,48,0.1); }
.stat-danger   { --gradient: linear-gradient(90deg, #e8003e, #ff4f6b); --glow-spot: rgba(255,79,107,0.1); }
.stat-info     { --gradient: linear-gradient(90deg, #0096c7, #00c4e8); --glow-spot: rgba(0,196,232,0.1); }
.stat-purple   { --gradient: linear-gradient(90deg, #6d28d9, #9f5cf6); --glow-spot: rgba(159,92,246,0.1); }
.stat-teal     { --gradient: linear-gradient(90deg, #0e8a7a, #14c4ae); --glow-spot: rgba(20,196,174,0.1); }
.stat-orange   { --gradient: linear-gradient(90deg, #d9500a, #ff6f20); --glow-spot: rgba(255,111,32,0.1); }

.stat-primary .stat-icon { background: rgba(124,111,255,0.14); color: #a99fff; }
.stat-success .stat-icon  { background: rgba(0,212,139,0.14);   color: #00e89a; }
.stat-warning .stat-icon  { background: rgba(255,184,48,0.14);  color: #ffc84a; }
.stat-danger .stat-icon   { background: rgba(255,79,107,0.14);  color: #ff6b85; }
.stat-info .stat-icon     { background: rgba(0,196,232,0.14);   color: #22d3ee; }
.stat-purple .stat-icon   { background: rgba(159,92,246,0.14);  color: #b47bff; }
.stat-teal .stat-icon     { background: rgba(20,196,174,0.14);  color: #2de8d0; }
.stat-orange .stat-icon   { background: rgba(255,111,32,0.14);  color: #ff8c44; }

/* ============ BUTTONS ============ */
.btn-primary-crm {
  background: linear-gradient(135deg, #5b50e8, #7c6fff);
  border: none;
  color: white;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(124,111,255,0.35);
  position: relative;
  overflow: hidden;
}
.btn-primary-crm::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}
.btn-primary-crm:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124,111,255,0.55), 0 0 60px rgba(124,111,255,0.2);
  color: white;
}
.btn-primary-crm:hover::before { opacity: 1; }
.btn-primary-crm:active { transform: translateY(0); }

.btn-outline-crm {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-outline-crm:hover {
  border-color: rgba(99,102,241,0.4);
  color: var(--primary-light);
  background: rgba(99,102,241,0.06);
}

/* ============ TABLES ============ */
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table thead th {
  background: rgba(4,8,17,0.7);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.crm-table tbody tr {
  border-bottom: 1px solid rgba(30,42,66,0.7);
  transition: var(--transition);
}
.crm-table tbody tr:hover { background: rgba(99,102,241,0.04); }
.crm-table tbody td { padding: 12px 16px; font-size: 13px; color: var(--text-primary); }
.crm-table tbody tr:last-child { border-bottom: none; }

.table-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
}

/* ============ FORMS ============ */
.form-label-crm {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  display: block;
}

.form-control-crm {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}
.form-control-crm:focus {
  border-color: rgba(99,102,241,0.6);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), 0 0 12px rgba(99,102,241,0.08);
  background: rgba(13,18,32,0.9);
}
.form-control-crm::placeholder { color: var(--text-muted); }
.form-control-crm option { background: var(--input-bg); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.badge.bg-success  { background: rgba(16,185,129,0.12) !important; color: #34d399 !important; border: 1px solid rgba(16,185,129,0.2) !important; }
.badge.bg-danger   { background: rgba(239,68,68,0.12)  !important; color: #f87171 !important; border: 1px solid rgba(239,68,68,0.2) !important; }
.badge.bg-warning  { background: rgba(245,158,11,0.12) !important; color: #fbbf24 !important; border: 1px solid rgba(245,158,11,0.2) !important; }
.badge.bg-info     { background: rgba(6,182,212,0.12)  !important; color: #22d3ee !important; border: 1px solid rgba(6,182,212,0.2) !important; }
.badge.bg-primary  { background: rgba(99,102,241,0.12) !important; color: #818cf8 !important; border: 1px solid rgba(99,102,241,0.2) !important; }
.badge.bg-secondary{ background: rgba(71,85,105,0.15)  !important; color: #94a3b8 !important; border: 1px solid rgba(71,85,105,0.2) !important; }
.badge.bg-dark     { background: rgba(15,23,42,0.7)    !important; color: #64748b !important; }

/* ============ ALERTS ============ */
.crm-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.crm-alert.success { background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.18); color: #4ade80; }
.crm-alert.danger  { background: rgba(239,68,68,0.07);  border: 1px solid rgba(239,68,68,0.18);  color: #f87171; }
.crm-alert.warning { background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.18); color: #fbbf24; }
.crm-alert.info    { background: rgba(6,182,212,0.07);  border: 1px solid rgba(6,182,212,0.18);  color: #22d3ee; }

/* ============ PAGINATION ============ */
.pagination-crm { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: rgba(99,102,241,0.4); color: var(--primary-light); background: rgba(99,102,241,0.06); }
.page-btn.active { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); border-color: var(--primary); color: white; box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.page-btn.disabled { opacity: 0.3; pointer-events: none; }

/* ============ STATUS BUTTONS ============ */
.status-btn-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.status-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}
.status-btn:hover { transform: scale(1.04); }
.status-btn.s-interested     { background: rgba(16,185,129,0.1);  color: #34d399; border-color: rgba(16,185,129,0.25); }
.status-btn.s-not_interested { background: rgba(239,68,68,0.1);   color: #f87171; border-color: rgba(239,68,68,0.25); }
.status-btn.s-switched_off   { background: rgba(245,158,11,0.1);  color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.status-btn.s-not_reachable  { background: rgba(245,158,11,0.1);  color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.status-btn.s-call_later     { background: rgba(59,130,246,0.1);  color: #60a5fa; border-color: rgba(59,130,246,0.25); }
.status-btn.s-wrong_number   { background: rgba(71,85,105,0.2);   color: #94a3b8; border-color: rgba(71,85,105,0.25); }
.status-btn.s-already_joined { background: rgba(16,185,129,0.1);  color: #34d399; border-color: rgba(16,185,129,0.25); }
.status-btn.s-busy           { background: rgba(245,158,11,0.1);  color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.status-btn.active           { box-shadow: 0 0 0 2px rgba(255,255,255,0.4); }

/* ============ DROPZONE ============ */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  transition: var(--transition-slow);
  cursor: pointer;
  background: var(--darker);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.04);
  box-shadow: inset 0 0 30px rgba(99,102,241,0.05);
}
.dropzone .dz-icon    { font-size: 48px; color: var(--text-muted); margin-bottom: 12px; }
.dropzone .dz-title   { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.dropzone .dz-subtitle{ font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============ PROGRESS BAR ============ */
.crm-progress { background: rgba(255,255,255,0.04); border-radius: 100px; height: 7px; overflow: hidden; }
.crm-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #8b5cf6, #a5b4fc);
  border-radius: 100px;
  transition: width 0.5s ease;
  box-shadow: 0 0 6px rgba(99,102,241,0.4);
}

/* ============ MOBILE TOGGLE ============ */
.sidebar-toggle {
  display: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.3); }

/* ============ RESPONSIVE / MOBILE ============ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 56px;
  }

  .crm-wrapper { display: block !important; }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    z-index: 1100;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  .sidebar-toggle { display: flex; }
  .topbar { padding: 0 14px; }
  .page-content { padding: 12px 14px !important; }

  .stat-value { font-size: 22px; }

  .topbar-actions { gap: 6px; }

  /* Hide long text on mobile topbar */
  .punch-text { display: none; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1050;
  }
  .sidebar-overlay.active { display: block; }

  /* Stack table on mobile */
  .crm-table thead { display: none; }
  .crm-table, .crm-table tbody, .crm-table tr, .crm-table td { display: block; width: 100%; }
  .crm-table tr {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 12px;
    background: var(--card-bg);
  }
  .crm-table td { border: none; padding: 4px 0; }

  /* Tables with many columns stay horizontal */
  .crm-table.keep-table, .crm-table.keep-table thead, .crm-table.keep-table tbody, .crm-table.keep-table tr, .crm-table.keep-table td { display: revert; width: auto; }
  .crm-table.keep-table { overflow-x: auto; }

  /* Topbar title smaller */
  .topbar-title { font-size: 13px; }
  .topbar-subtitle { display: none; }

  /* Card padding tighter */
  .crm-card { padding: 14px; border-radius: 10px; }
}

/* ============ TABLET ============ */
@media (max-width: 1024px) and (min-width: 769px) {
  :root { --sidebar-width: 220px; }
  .page-content { padding: 16px 18px; }
}

/* ============ SHOW/HIDE MOBILE vs DESKTOP ============ */
#mobileCards  { display: block; }
#desktopTable { display: none; }

@media (min-width: 769px) {
  #mobileCards  { display: none !important; }
  #desktopTable { display: block !important; }
}

/* ============ TABS ============ */
.tabs-container {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  margin-top: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-container::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(99,102,241,0); }
}
@keyframes spin-kf {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse-punch {
  0%,100% { box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
  50%      { box-shadow: 0 4px 28px rgba(99,102,241,0.6), 0 0 50px rgba(99,102,241,0.2); }
}

.page-content > * {
  animation: fadeInUp 0.3s ease both;
}
.page-content > *:nth-child(2) { animation-delay: 0.04s; }
.page-content > *:nth-child(3) { animation-delay: 0.08s; }
.page-content > *:nth-child(4) { animation-delay: 0.12s; }

/* ============ LOGIN PAGE ============ */
.login-page {
  min-height: 100vh;
  background: var(--darker);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    radial-gradient(ellipse 70% 50% at 20% 40%, rgba(99,102,241,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(139,92,246,0.08) 0%, transparent 60%);
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99,102,241,0.08);
}
.login-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), #8b5cf6);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin: -40px -40px 30px;
}

.login-logo {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
}

.login-title { font-size: 22px; font-weight: 800; text-align: center; color: var(--text-primary); font-family: 'Outfit', sans-serif; }
.login-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 4px; margin-bottom: 28px; }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 44px; opacity: 0.2; margin-bottom: 12px; display: block; }
.empty-state h5 { color: var(--text-secondary); font-weight: 700; font-size: 14px; }
.empty-state p  { font-size: 12.5px; margin-top: 4px; }

/* ============ UTILITIES ============ */
.text-primary-crm   { color: var(--primary-light) !important; }
.text-success-crm   { color: #34d399 !important; }
.text-danger-crm    { color: #f87171 !important; }
.text-warning-crm   { color: #fbbf24 !important; }
.text-muted-crm     { color: var(--text-muted) !important; }
.text-secondary-crm { color: var(--text-secondary) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.fs-14  { font-size: 14px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }

/* ============ CHART CONTAINER ============ */
.chart-container { position: relative; }

/* ============ GLOBAL FOOTER / CREDIT BAR ============ */
.crm-global-footer {
  background: var(--darker);
  border-top: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.footer-brand .footer-logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.footer-brand .footer-brand-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}
.footer-brand .footer-brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 0;
}

.footer-dev {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.footer-dev .dev-name {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 11.5px;
}
.footer-dev .dev-phone {
  color: var(--primary-light);
  font-weight: 600;
}

.footer-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.footer-ai-badge .ai-dot {
  width: 6px; height: 6px;
  background: #818cf8;
  border-radius: 50%;
  animation: pulse-glow 2s infinite;
}

@media (max-width: 768px) {
  .crm-global-footer {
    padding: 12px 14px;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }
  .footer-brand { display: none; }
  .footer-dev { font-size: 10px; }
}
