/* CSS DESIGN SYSTEM & TOKENS */
:root {
  /* Color Tokens */
  --bg-app: #0a0b10;
  --bg-sidebar: #0f111a;
  --bg-glass: rgba(255, 255, 255, 0.02);
  --bg-glass-hover: rgba(255, 255, 255, 0.05);
  
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glass-bright: rgba(255, 255, 255, 0.12);
  
  --primary: #9b51e0; /* Deep Violet */
  --primary-glow: rgba(155, 81, 224, 0.3);
  --secondary: #6c5ce7;
  
  --accent-gold: #f2c94c; /* Neon Gold */
  --accent-gold-glow: rgba(242, 201, 76, 0.2);
  
  --accent-teal: #00f2fe; /* Cyber Teal */
  --accent-teal-glow: rgba(0, 242, 254, 0.25);
  
  --accent-green: #27ae60;
  --accent-green-glow: rgba(39, 174, 96, 0.25);
  
  --danger: #eb5757;
  --danger-glow: rgba(235, 87, 87, 0.3);
  
  --text-primary: #f8f9fa;
  --text-secondary: #a0aec0;
  --text-muted: #64748b;
  
  --font-headers: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --sidebar-width: 280px;
  
  --shadow-neon: 0 0 20px rgba(155, 81, 224, 0.15);
  --shadow-gold: 0 0 20px rgba(242, 201, 76, 0.15);
  --shadow-teal: 0 0 20px rgba(0, 242, 254, 0.15);
  --shadow-green: 0 0 20px rgba(39, 174, 96, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* GLASSMORPHISM UTILITY */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-hover:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-bright);
}

/* STRUCTURE & LAYOUT */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* SIDEBAR STYLES */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.logo-orb {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headers);
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: var(--shadow-neon);
}

.brand-text h1 {
  font-family: var(--font-headers);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
}

.nav-item:hover, .nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, rgba(155, 81, 224, 0.08), transparent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  transition: var(--transition-smooth);
}

.nav-item.active .nav-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

.sidebar-footer {
  padding: 24px 16px;
  border-top: 1px solid var(--border-glass);
}

.rep-selector-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.rep-selector-card label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.rep-selector-card select {
  width: 100%;
  padding: 8px 10px;
  background: #141520;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  margin-bottom: 8px;
}

#add-rep-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  text-align: left;
}

#add-rep-btn:hover {
  color: var(--primary);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.status-indicator.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green-glow);
}

.status-indicator.syncing {
  background-color: var(--accent-gold);
  animation: pulse 1s infinite alternate;
}

/* MAIN CONTENT STYLES */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 0 32px 32px 32px;
  background-color: var(--bg-app);
}

/* TOPBAR HEADER */
.topbar {
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 32px;
}

.header-title h2 {
  font-family: var(--font-headers);
  font-weight: 700;
  font-size: 1.75rem;
  color: #fff;
  line-height: 1.2;
}

.header-title p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  outline: none;
}

.btn-primary {
  background: var(--primary);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 0 24px rgba(155, 81, 224, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glass-bright);
}

.btn-tertiary {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
}

.btn-tertiary:hover {
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* DASHBOARD STATS CARDS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card:nth-child(1) { border-left: 3px solid var(--primary); }
.metric-card:nth-child(2) { border-left: 3px solid var(--accent-gold); }
.metric-card:nth-child(3) { border-left: 3px solid var(--accent-teal); }
.metric-card:nth-child(4) { border-left: 3px solid var(--accent-green); }

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.metric-val {
  font-family: var(--font-headers);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin: 6px 0 2px 0;
  line-height: 1.1;
}

.metric-trend {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.metric-icon-bg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-bg svg {
  width: 24px;
  height: 24px;
}

.bg-purple { background: rgba(155, 81, 224, 0.08); color: var(--primary); }
.bg-gold { background: rgba(242, 201, 76, 0.08); color: var(--accent-gold); }
.bg-teal { background: rgba(0, 242, 254, 0.08); color: var(--accent-teal); }
.bg-green { background: rgba(39, 174, 96, 0.08); color: var(--accent-green); }

.text-glow-green { color: var(--accent-green); }
.text-glow-gold { color: var(--accent-gold); }
.text-glow-purple { color: var(--primary); }

/* WIDGETS SECTION */
.dashboard-widgets {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.widget-card {
  flex: 1;
  min-width: 280px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.widget-card.flex-2 {
  flex: 2;
  min-width: 400px;
}

.widget-title {
  font-family: var(--font-headers);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}

/* Distribution Bars */
.status-distribution-container, .outcomes-breakdown-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.dist-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dist-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.dist-bar-label { color: var(--text-secondary); }
.dist-bar-val { color: #fff; }

.dist-bar-wrapper {
  height: 6px;
  width: 100%;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dist-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.dist-bar.gold { background: var(--accent-gold); }
.dist-bar.teal { background: var(--accent-teal); }
.dist-bar.green { background: var(--accent-green); }
.dist-bar.danger { background: var(--danger); }

/* Activity Log Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  align-items: flex-start;
  transition: var(--transition-smooth);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-glass-bright);
}

.activity-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-badge.Answered { background: rgba(39, 174, 96, 0.1); color: var(--accent-green); }
.activity-badge.NoAnswer { background: rgba(242, 201, 76, 0.1); color: var(--accent-gold); }
.activity-badge.Busy { background: rgba(235, 87, 87, 0.1); color: var(--danger); }
.activity-badge.DNC { background: rgba(235, 87, 87, 0.2); color: #ff3838; }

.activity-details {
  flex-grow: 1;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.activity-header .rep {
  color: var(--primary);
}

.activity-header .time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.activity-details .lead {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.activity-details .act-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 40px;
}

/* LEADS LIST PANEL & FILTER */
.filter-panel {
  padding: 20px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

.filter-group.search-group {
  flex: 2;
  min-width: 250px;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 40px !important;
}

.filter-group input, .filter-group select {
  width: 100%;
  padding: 10px 14px;
  background: #141520;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.filter-group input:focus, .filter-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(155,81,224,0.2);
}

.filter-group.btn-align {
  flex: 0;
  min-width: auto;
}

/* LEADS TABLE */
.leads-list-container {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.leads-table th, .leads-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
}

.leads-table th {
  background: rgba(255, 255, 255, 0.005);
  font-family: var(--font-headers);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leads-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

.leads-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.sort-icon::after {
  content: ' ↕';
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sort-asc .sort-icon::after {
  content: ' ▲';
  color: var(--primary);
}

.sort-desc .sort-icon::after {
  content: ' ▼';
  color: var(--primary);
}

.leads-table tbody tr {
  transition: var(--transition-smooth);
}

.leads-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* Lead List Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-status-new { background: rgba(155, 81, 224, 0.08); color: var(--primary); border: 1px solid rgba(155, 81, 224, 0.15); }
.badge-status-contacted { background: rgba(0, 242, 254, 0.08); color: var(--accent-teal); border: 1px solid rgba(0, 242, 254, 0.15); }
.badge-status-appointment { background: rgba(242, 201, 76, 0.08); color: var(--accent-gold); border: 1px solid rgba(242, 201, 76, 0.15); }
.badge-status-estimate { background: #1c2738; color: #7cb5ec; border: 1px solid #2e4460; }
.badge-status-won { background: rgba(39, 174, 96, 0.08); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.15); }
.badge-status-lost { background: rgba(235, 87, 87, 0.08); color: var(--danger); border: 1px solid rgba(235, 87, 87, 0.15); }
.badge-status-dnc { background: rgba(235, 87, 87, 0.18); color: #ff3e3e; border: 1px solid rgba(235, 87, 87, 0.25); }

/* Table Action Buttons */
.btn-table-call {
  background: var(--accent-teal);
  border: none;
  color: #0c0f16;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-table-call:hover {
  box-shadow: var(--shadow-teal);
  transform: scale(1.05);
}

.btn-table-edit {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-left: 6px;
}

.btn-table-edit:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* PAGINATION */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border-glass);
}

.pagination-info {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-pagination {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-pagination:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#current-page-label {
  font-size: 0.8rem;
  font-weight: 600;
}

/* DIALER DIALOG MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-card {
  max-width: 650px;
  width: 90%;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  border: 1px solid var(--border-glass-bright);
}

.dialer-card {
  height: 480px;
}

.dialer-screen {
  flex: 1.1;
  background: radial-gradient(circle at center, #1b132c, #0a0b10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-right: 1px solid var(--border-glass);
}

.dialer-avatar {
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 10;
}

.dialer-avatar svg {
  width: 48px;
  height: 48px;
}

.pulse-ring-container {
  position: relative;
  margin-bottom: 24px;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: var(--primary);
  opacity: 0;
}

.Ringing .Ring1 { animation: pulseRing 2s infinite ease-out; }
.Ringing .Ring2 { animation: pulseRing 2s infinite ease-out 0.6s; }
.Ringing .Ring3 { animation: pulseRing 2s infinite ease-out 1.2s; }

.Connected .Ring1 { background: var(--accent-teal); animation: pulseRingConnected 3s infinite ease-out; }
.Connected .Ring2 { background: var(--accent-teal); animation: pulseRingConnected 3s infinite ease-out 1s; }

#dialer-lead-name {
  font-family: var(--font-headers);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  text-align: center;
}

#dialer-lead-phone {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.dialer-status {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 16px 0;
  letter-spacing: 0.5px;
}

.dialer-status.ringing {
  background: rgba(155,81,224,0.1);
  color: var(--primary);
}

.dialer-status.connected {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-teal);
  box-shadow: 0 0 10px var(--accent-teal-glow);
}

.dialer-status.completed {
  background: rgba(39, 174, 96, 0.1);
  color: var(--accent-green);
}

.dialer-timer {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-headers);
  color: #fff;
}

.dialer-logger {
  flex: 1.3;
  padding: 32px;
  background: #0f111a;
  display: flex;
  flex-direction: column;
}

.dialer-logger h4 {
  font-family: var(--font-headers);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: #141520;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group textarea {
  resize: none;
  height: 110px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(155,81,224,0.2);
}

.dialer-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.required {
  color: var(--danger);
}

/* EDIT LEAD SIDEBAR PANEL */
.sidebar-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  height: 100vh;
  background: #0f111a;
  border-left: 1px solid var(--border-glass-bright);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}

.sidebar-panel.hidden {
  transform: translateX(100%);
}

.panel-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
}

.panel-header h3 {
  font-family: var(--font-headers);
  font-size: 1.2rem;
  color: #fff;
}

.panel-close-x {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
}

.panel-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
}

.panel-lead-summary h4 {
  font-family: var(--font-headers);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.panel-lead-summary p {
  font-size: 0.85rem;
}

.text-secondary {
  color: var(--text-secondary);
}

.lead-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.lead-tags .badge {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.panel-divider {
  border: none;
  border-bottom: 1px solid var(--border-glass);
  margin: 20px 0;
}

.panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.panel-actions button {
  flex: 1;
}

.panel-call-history h4 {
  font-family: var(--font-headers);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  margin-top: 10px;
}

.history-slot {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}

.slot-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.slot-value {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.notes-history-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.note-history-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.005);
  border-left: 2px solid var(--accent-gold);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ADD OPERATOR POPUP MODAL */
.popup-card {
  padding: 24px;
  width: 90%;
  max-width: 360px;
}

.popup-card h3 {
  font-family: var(--font-headers);
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 20px;
}

.popup-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.popup-actions button {
  flex: 1;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1050;
}

.toast {
  padding: 12px 20px;
  background: #0f111a;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 250px;
  max-width: 380px;
  border: 1px solid var(--border-glass-bright);
}

.toast.success { border-left-color: var(--accent-green); }
.toast.info { border-left-color: var(--accent-teal); }
.toast.warning { border-left-color: var(--accent-gold); }
.toast.error { border-left-color: var(--danger); }

/* HELPER CLASSES */
.hidden { display: none !important; }
.animate-zoom { animation: zoomIn 0.25s ease-out; }

/* ANIMATIONS */
@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes pulseRing {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@keyframes pulseRingConnected {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

@keyframes zoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* SKELETON LOADER BAR */
.skeleton-loader-bar {
  height: 20px;
  width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    overflow-y: auto;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }
  
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
  }
  
  .nav-item {
    width: auto;
    white-space: nowrap;
  }
  
  .sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
  }
  
  .rep-selector-card {
    margin-bottom: 0;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .rep-selector-card label {
    margin-bottom: 0;
  }
  
  .rep-selector-card select {
    margin-bottom: 0;
    width: 150px;
  }
  
  #add-rep-btn {
    width: auto;
  }
  
  .main-content {
    height: auto;
    overflow: visible;
    padding: 0 16px 16px 16px;
  }
  
  .topbar {
    margin-bottom: 20px;
  }
  
  /* Collapsing Table into Cards on Mobile */
  .leads-table thead {
    display: none;
  }
  
  .leads-table td {
    display: block;
    text-align: right;
    border-bottom: none;
    padding: 8px 16px;
  }
  
  .leads-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
  }
  
  .leads-table tbody tr {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 16px;
    background: rgba(255,255,255,0.01);
    border-radius: var(--radius-md);
  }
  
  .btn-table-edit {
    margin-top: 6px;
  }
  
  .sidebar-panel {
    width: 100%;
  }
}
