/* Rhombix Dashboard - Blue Theme */
:root {
  /* Dark base with blue undertones */
  --bg-primary: #0a0a12;
  --bg-secondary: #0f0f1a;
  --bg-card: #151522;
  --bg-card-hover: #1a1a2e;
  --border: #252538;
  --border-light: #32324a;

  /* Neutral text hierarchy */
  --text-primary: #fafafa;
  --text-secondary: #a1a1b8;
  --text-muted: #6b6b8a;

  /* Blue accent colors - primary */
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-muted: rgba(37, 99, 235, 0.15);
  --accent-secondary: #1d4ed8;
  --accent-light: #60a5fa;

  /* Muted status colors */
  --success: #4ade80;
  --success-muted: rgba(74, 222, 128, 0.15);
  --warning: #fbbf24;
  --warning-muted: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-muted: rgba(248, 113, 113, 0.15);
  --info: #38bdf8;
  --info-muted: rgba(56, 189, 248, 0.15);

  /* Blue gradients */
  --gradient-purple: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --gradient-blue: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  --gradient-blue-purple: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  --gradient-green: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --gradient-card: linear-gradient(180deg, rgba(37, 99, 235, 0.03) 0%, transparent 100%);

  /* Shadows with blue glow */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --glow: 0 0 20px rgba(37, 99, 235, 0.2);
  --glow-accent: 0 0 30px rgba(37, 99, 235, 0.25);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-width: 260px;
  --input-bg: rgba(0, 0, 0, 0.3);
  --input-border: rgba(255, 255, 255, 0.12);
}

/* Light Theme Override */
[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f8;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-muted: rgba(37, 99, 235, 0.1);
  --success-muted: rgba(74, 222, 128, 0.12);
  --warning-muted: rgba(251, 191, 36, 0.12);
  --danger-muted: rgba(248, 113, 113, 0.12);
  --info-muted: rgba(56, 189, 248, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
  --glow: 0 0 20px rgba(37, 99, 235, 0.1);
  --gradient-card: linear-gradient(180deg, rgba(37, 99, 235, 0.02) 0%, transparent 100%);
  --input-bg: #f1f5f9;
  --input-border: #cbd5e1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.top-spacer {
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: width 0.3s ease;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed:hover {
  width: var(--sidebar-width);
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed:hover .logo span,
.sidebar.collapsed:hover .nav-item span,
.sidebar.collapsed:hover .nav-label,
.sidebar.collapsed:hover .user-details,
.sidebar.collapsed:hover .logout-btn {
  opacity: 1;
  width: auto;
}

/* Collapsed sidebar icons - centered with active box */
.sidebar.collapsed .nav-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 6px;
}

.sidebar.collapsed .nav-item {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 2px 0;
  gap: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.sidebar.collapsed .nav-item i {
  font-size: 15px;
  width: auto;
}

.sidebar.collapsed:hover .nav-section {
  align-items: stretch;
  padding: 0;
}

.sidebar.collapsed:hover .nav-item {
  width: auto;
  height: auto;
  gap: 12px;
  justify-content: flex-start;
  padding: 10px 12px;
  margin: 0 0 4px 0;
}

.sidebar.collapsed:hover .nav-item i {
  font-size: 15px;
  width: 20px;
}

/* Adjust main content when sidebar collapses */
.app.sidebar-collapsed .main-content {
  margin-left: 72px;
}

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

/* Sidebar toggle button */
.sidebar-toggle {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 20px 12px;
}

.sidebar.collapsed .logo {
  gap: 0;
  justify-content: center;
}

.sidebar.collapsed .logo i {
  margin: 0 auto;
}

.sidebar.collapsed:hover .logo {
  gap: 12px;
  justify-content: flex-start;
}

.sidebar.collapsed:hover .sidebar-header {
  justify-content: space-between;
  padding: 20px 16px;
}

.sidebar.collapsed .sidebar-toggle {
  display: none;
}

.sidebar.collapsed:hover .sidebar-toggle {
  display: flex;
}

/* No-label section */
.nav-section.no-label {
  padding-top: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo i {
  font-size: 28px;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-section {
  padding: 0 16px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.nav-section:last-child {
  border-bottom: none;
}

.nav-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-size: 14px;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

/* Coming soon nav items */
.nav-item.coming-soon {
  cursor: pointer;
  position: relative;
}

.nav-item.coming-soon>i,
.nav-item.coming-soon>span:not(.soon-badge) {
  opacity: 0.5;
}

.nav-item.coming-soon:hover>i,
.nav-item.coming-soon:hover>span:not(.soon-badge) {
  opacity: 0.7;
}

.nav-item.coming-soon .soon-badge {
  margin-left: auto !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 3px 10px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #fff !important;
  border: none !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4) !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  opacity: 1 !important;
  width: auto !important;
  overflow: visible !important;
}

[data-theme="light"] .nav-item.coming-soon .soon-badge {
  background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
  color: #fff !important;
  box-shadow: 0 1px 4px rgba(129, 140, 248, 0.4) !important;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 16px;
  opacity: 0.5;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-size: 14px;
}

.logout-btn:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

.avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Mobile logo - hidden on desktop */
.mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-logo i {
  font-size: 22px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 360px;
}

.search-box i {
  color: var(--text-muted);
}

.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  outline: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
}

.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-sm {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-sm:hover {
  background: var(--bg-card-hover);
}

.period-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.period-btn {
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Pages */
.pages-container {
  padding: 32px;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* =============================================
   DASHBOARD OVERVIEW
   ============================================= */

/* Header with greeting + period selector */
.dashboard-greeting h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-period-selector select {
  padding: 10px 36px 10px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  background: white;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-period-selector select:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.dashboard-period-selector select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Period Pill Buttons */
.period-pills {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.period-pill {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.period-pill:hover {
  color: #475569;
  background: rgba(255, 255, 255, 0.6);
}

.period-pill.active {
  color: white;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Greeting Gradient Backgrounds */
.dashboard-greeting {
  padding: 20px 28px;
  border-radius: 16px;
  transition: background 0.5s ease;
}

.dashboard-greeting.greeting-morning {
  background: linear-gradient(135deg, #fef9c3 0%, #fde68a 30%, #fdba74 100%);
}

.dashboard-greeting.greeting-morning h1 {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-greeting.greeting-afternoon {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 30%, #93c5fd 100%);
}

.dashboard-greeting.greeting-afternoon h1 {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-greeting.greeting-evening {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 30%, #a5b4fc 100%);
}

.dashboard-greeting.greeting-evening h1 {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Stat Cards Grid */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.dash-stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.3s;
}

.dash-stat-card:hover::before {
  opacity: 1;
}

.dash-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-light);
}

/* Stat card icons */
.dash-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.dash-stat-icon.calls-icon {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #7c3aed;
}

.dash-stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.dash-stat-icon.appts-icon {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.dash-stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.dash-stat-icon.success-icon {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
}

.dash-stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.dash-stat-icon.duration-icon {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #ea580c;
}

.dash-stat-card:nth-child(4)::before {
  background: linear-gradient(90deg, #ea580c, #fb923c);
}

.dash-stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dash-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.dash-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

.dash-stat-trend {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.dash-stat-trend.up {
  color: #16a34a;
  background: #f0fdf4;
}

.dash-stat-trend.down {
  color: #dc2626;
  background: #fef2f2;
}

/* Content Grid — two panels side by side */
.dashboard-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dash-panel {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.dash-panel:hover {
  box-shadow: var(--shadow-lg);
}

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

.dash-panel-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-panel-header h3 i {
  font-size: 14px;
  color: #6366f1;
}

.dash-view-all {
  font-size: 13px;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.dash-view-all:hover {
  color: #4f46e5;
  gap: 8px;
}

.dash-panel-body {
  padding: 4px 0;
  min-height: 200px;
}

/* Call row items */
.dash-call-row {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 14px;
  transition: background 0.15s;
  cursor: pointer;
}

.dash-call-row:hover {
  background: var(--bg-card-hover);
}

.dash-call-direction {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.dash-call-direction.inbound {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}

.dash-call-direction.outbound {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
}

.dash-call-info {
  flex: 1;
  min-width: 0;
}

.dash-call-caller {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-call-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.dash-call-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: capitalize;
  flex-shrink: 0;
}

.dash-call-status.completed {
  background: #f0fdf4;
  color: #16a34a;
}

.dash-call-status.in-progress {
  background: #eff6ff;
  color: #2563eb;
}

.dash-call-status.failed,
.dash-call-status.missed {
  background: #fef2f2;
  color: #dc2626;
}

/* Appointment row items */
.dash-appt-row {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 14px;
  transition: background 0.15s;
  cursor: pointer;
}

.dash-appt-row:hover {
  background: var(--bg-card-hover);
}

.dash-appt-date-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
}

.dash-appt-date-badge .appt-month {
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  line-height: 1;
}

.dash-appt-date-badge .appt-day {
  font-size: 18px;
  font-weight: 800;
  color: #4338ca;
  line-height: 1.2;
}

.dash-appt-info {
  flex: 1;
  min-width: 0;
}

.dash-appt-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-appt-time {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Empty states */
.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.dash-empty-state i {
  font-size: 36px;
  margin-bottom: 12px;
}

.dash-empty-state p {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Shimmer loading animation */
@keyframes dashShimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.dash-stat-value.loading {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200px 100%;
  animation: dashShimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  min-width: 60px;
  min-height: 28px;
}

/* Responsive */
@media (max-width: 1200px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  background-image: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.gradient-purple::before {
  background: var(--gradient-purple);
}

.stat-card.gradient-blue::before {
  background: var(--gradient-blue);
}

.stat-card.gradient-green::before {
  background: var(--gradient-green);
}

.stat-card.gradient-orange::before {
  background: var(--gradient-orange);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.gradient-purple .stat-icon {
  background: var(--accent-muted);
  color: var(--accent-hover);
}

.gradient-blue .stat-icon {
  background: var(--info-muted);
  color: var(--info);
}

.gradient-green .stat-icon {
  background: var(--success-muted);
  color: var(--success);
}

.gradient-orange .stat-icon {
  background: var(--warning-muted);
  color: var(--warning);
}

.stat-content {
  flex: 1;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-trend {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up {
  color: var(--success);
}

.stat-trend.down {
  color: var(--danger);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Chart Placeholder */
.chart-placeholder {
  height: 240px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  padding: 20px 0;
}

.bar {
  flex: 1;
  margin: 0 8px;
  background: linear-gradient(to top, var(--accent), transparent);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all 0.3s;
}

.bar:hover {
  background: linear-gradient(to top, var(--accent-hover), transparent);
}

.bar.active {
  background: var(--gradient-purple);
}

.bar span {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-muted);
}

/* Activity */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.activity-icon.success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.activity-icon.info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-secondary);
}

.activity-icon.warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.activity-content {
  flex: 1;
}

.activity-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Agents Grid */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.search-filter {
  display: flex;
  gap: 12px;
}

.search-filter input,
.search-filter select {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.view-toggle button {
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
}

.view-toggle button.active {
  background: var(--accent);
  color: white;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
}

.agent-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.agent-status {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.agent-status.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.agent-status.offline {
  background: var(--text-muted);
}

.agent-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: var(--gradient-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.agent-card h4 {
  font-size: 18px;
  margin-bottom: 4px;
}

.agent-type {
  font-size: 13px;
  color: var(--text-secondary);
}

.agent-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.agent-stats div {
  font-size: 13px;
  color: var(--text-secondary);
}

.agent-stats strong {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
}

.agent-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.agent-card.add-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border-style: dashed;
  color: var(--text-muted);
}

.agent-card.add-new i {
  font-size: 32px;
  margin-bottom: 12px;
}

.agent-card.add-new:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Knowledge */
.knowledge-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active,
.tab:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.knowledge-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.knowledge-icon.manual {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #f87171;
}

.knowledge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.knowledge-icon.website {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.knowledge-icon.doc {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.knowledge-icon.social {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.knowledge-content {
  flex: 1;
}

.knowledge-content h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.knowledge-content span {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--gradient-purple);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.status-badge.success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.knowledge-card.add-new {
  border-style: dashed;
  justify-content: center;
  flex-direction: column;
  min-height: 120px;
  color: var(--text-muted);
  cursor: pointer;
}

.knowledge-card.add-new:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.knowledge-card.add-new i {
  font-size: 24px;
  margin-bottom: 8px;
}

.global-knowledge-section .muted {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.global-preview {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.global-preview p {
  margin-bottom: 4px;
}

/* Campaigns */
.campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaign-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.campaign-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.campaign-status.active {
  background: var(--success);
}

.campaign-status.paused {
  background: var(--warning);
}

.campaign-info {
  flex: 1;
}

.campaign-info h4 {
  margin-bottom: 4px;
}

.campaign-info span {
  font-size: 13px;
  color: var(--text-muted);
}

.campaign-metrics {
  display: flex;
  gap: 32px;
}

.metric {
  text-align: center;
}

.metric strong {
  display: block;
  font-size: 18px;
}

.metric span {
  font-size: 12px;
  color: var(--text-muted);
}

.campaign-actions {
  display: flex;
  gap: 8px;
}

/* Workflow Canvas */
.workflow-canvas {
  display: flex;
  height: calc(100vh - 240px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.workflow-sidebar {
  width: 200px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px;
}

.workflow-sidebar h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.node-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.palette-item {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.palette-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.canvas-area {
  flex: 1;
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 24px 24px;
}

.workflow-node {
  position: absolute;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: move;
  transition: all 0.2s;
}

.workflow-node:hover {
  border-color: var(--accent);
}

.workflow-node.trigger {
  border-color: var(--warning);
}

.workflow-node.condition {
  border-color: var(--accent-secondary);
}

.node-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
}

.trigger .node-icon {
  background: var(--warning);
}

.condition .node-icon {
  background: var(--accent-secondary);
}

.node-connector {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.node-connector.input {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.node-connector.output {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.node-connector.yes {
  right: -6px;
  top: 30%;
  background: var(--success);
}

.node-connector.no {
  right: -6px;
  top: 70%;
  background: var(--danger);
}

.connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Analytics */
.analytics-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.analytics-filters select {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.analytics-card h4 {
  margin-bottom: 20px;
}

.funnel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.funnel-stage {
  background: var(--gradient-purple);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  transition: all 0.3s;
}

.funnel-stage:nth-child(2) {
  background: linear-gradient(135deg, #6b4fd4 0%, #9850d4 100%);
}

.funnel-stage:nth-child(3) {
  background: linear-gradient(135deg, #5a43b0 0%, #8745b0 100%);
}

.funnel-stage:nth-child(4) {
  background: linear-gradient(135deg, #493790 0%, #6a3a90 100%);
}

.agent-ranking {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.rank-item span:first-child {
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.rank-item strong {
  flex: 1;
}

.score {
  color: var(--success);
  font-weight: 600;
}

/* Integrations */
.integrations-section {
  margin-bottom: 40px;
}

.integrations-section .section-header {
  margin-bottom: 20px;
}

.integrations-section .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.integrations-section .section-title i {
  font-size: 20px;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Card - vertical layout */
.integration-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.integration-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  border-color: #c7d2fe;
}

/* Top section with icon */
.integration-card-top {
  padding: 28px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.integration-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.integration-icon.calendly {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 1px solid #93c5fd;
  box-shadow: 0 4px 12px rgba(0, 107, 255, 0.12);
}

.integration-icon.hubspot {
  background: linear-gradient(135deg, #ffe4de, #fecaca);
  border: 1px solid #fca5a5;
  box-shadow: 0 4px 12px rgba(255, 122, 89, 0.12);
}

.integration-icon.gohighlevel {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border: 1px solid #c4b5fd;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
  font-size: 24px;
  color: #7c3aed;
}

.integration-icon.google-calendar {
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  border: 1px solid #aecbfa;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.12);
  font-size: 26px;
  color: #4285F4;
}

.integration-icon.apple-calendar {
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  border: 1px solid #d1d1d1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 28px;
  color: #333;
}

.integration-icon.whatsapp {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 1px solid #86efac;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.12);
  font-size: 28px;
  color: #25d366;
}

.integration-icon.salesforce {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 1px solid #93c5fd;
  box-shadow: 0 4px 12px rgba(0, 112, 210, 0.12);
  font-size: 26px;
  color: #0070d2;
}

.integration-icon.slack {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 12px rgba(74, 21, 75, 0.1);
  font-size: 26px;
  color: #4a154b;
}

.integration-icon.zoom {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 1px solid #93c5fd;
  box-shadow: 0 4px 12px rgba(45, 140, 255, 0.12);
}

.integration-icon.quickbooks {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 1px solid #86efac;
  box-shadow: 0 4px 12px rgba(44, 160, 28, 0.12);
  font-size: 24px;
  color: #2ca01c;
}

.integration-icon.square {
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
  border: 1px solid #a5b4fc;
  box-shadow: 0 4px 12px rgba(0, 106, 255, 0.12);
}

.integration-icon.jobber {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
  font-size: 24px;
  color: #d97706;
}

.integration-icon.housecall-pro {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 1px solid #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  font-size: 24px;
  color: #2563eb;
}

/* Status dot (for connected state) */
.integration-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  display: none;
}

.integration-card.connected .integration-status-dot {
  display: block;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1);
  }
}

/* Body section */
.integration-card-body {
  padding: 0 24px 20px;
  flex: 1;
}

.integration-card-body h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.integration-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 14px 0;
}

/* Tags */
.integration-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.integration-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Footer section */
.integration-card-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Connect button */
.btn-connect {
  padding: 10px 22px;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

.btn-connect:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* Disconnect button */
.btn-disconnect {
  padding: 8px 14px;
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-disconnect:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
}

/* Connected state */
.integration-card.connected {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #f0fdf9 0%, #ffffff 40%);
}

.integration-card.connected:hover {
  border-color: #6ee7b7;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.integration-card.connected .integration-card-footer {
  flex-direction: column;
  gap: 10px;
}

.connected-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #10b981;
}

.connected-label i {
  font-size: 8px;
}

.integration-connected-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Coming soon state */
.integration-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
  background: #fafbfc;
}

.integration-card.coming-soon:hover {
  transform: none;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.coming-soon-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #64748b;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Keep old classes for compat */
.integration-info {
  flex: 1;
  text-align: left;
}

.integration-info h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #1e293b;
}

.integration-services {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.integration-email {
  font-size: 12px;
  color: #94a3b8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.integration-card .status {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.integration-card .status.connected {
  color: #10b981;
}

.integration-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: 16px;
}

.integration-empty-state .empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.integration-empty-state .empty-icon i {
  font-size: 28px;
  color: #6366f1;
}

.integration-empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.integration-empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s;
  z-index: 99999;
}

.toast.success {
  border-color: var(--success);
  color: var(--success);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Data Table */
.data-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.data-table tr:hover {
  background: var(--bg-secondary);
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.customer-cell span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.plan-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.plan-badge.starter {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.plan-badge.pro {
  background: rgba(124, 92, 255, 0.2);
  color: #9175ff;
}

.plan-badge.enterprise {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.active {
  background: var(--success);
}

.status-dot.warning {
  background: var(--warning);
}

/* ===================== Billing Page ===================== */

/* --- Status Row --- */
.billing-status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.billing-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: all 0.3s;
}

.billing-status-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
}

.billing-status-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.billing-status-icon.plan-icon {
  background: rgba(124, 92, 255, 0.15);
  color: #9175ff;
}

.billing-status-icon.credit-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.billing-status-icon.date-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.billing-status-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.billing-status-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.billing-plan-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.billing-plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.billing-plan-status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.billing-plan-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.billing-plan-status .status-dot.active {
  background: #10b981;
}

.billing-plan-status .status-dot.trialing {
  background: #f59e0b;
}

.billing-plan-status .status-dot.past_due {
  background: #ef4444;
}

.btn-billing-portal {
  margin-top: auto;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-billing-portal:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Credit Display */
.billing-credit-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.billing-credit-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.billing-credit-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.billing-credit-bar-wrap {
  margin: 8px 0 4px;
}

.billing-credit-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.billing-credit-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.billing-credit-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.billing-credit-used {
  font-size: 12px;
  color: var(--text-muted);
}

/* Next Billing */
.billing-next-date {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0;
}

.billing-period-info {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Section Headers --- */
.billing-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  margin-top: 8px;
}

.billing-section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.billing-section-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Interval Toggle */
.billing-interval-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border);
}

.billing-interval-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.billing-interval-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.save-badge {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* --- Plan Cards --- */
.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 8px;
}

.billing-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  position: relative;
}

.billing-plan-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.billing-plan-card.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(99, 102, 241, 0.15);
}

.billing-plan-card.current::after {
  content: 'Current Plan';
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.billing-plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.billing-plan-card-price {
  text-align: right;
}

.billing-plan-card-price .price-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.billing-plan-card-price .price-period {
  font-size: 13px;
  color: var(--text-muted);
}

.billing-plan-card-credits {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.billing-plan-card-credits i {
  color: #f59e0b;
  font-size: 12px;
}

.billing-plan-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  flex: 1;
}

.billing-plan-card-features li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.billing-plan-card-features i {
  color: #10b981;
  font-size: 11px;
}

.btn-billing-action {
  padding: 10px 16px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.btn-billing-action:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-billing-action.current-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: default;
}

.btn-billing-action.current-btn:hover {
  transform: none;
  box-shadow: none;
}

/* --- Top-Up Cards --- */
.billing-topup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.billing-topup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.billing-topup-card:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.1);
}

.topup-credits {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topup-credits i {
  color: #10b981;
  font-size: 14px;
}

.topup-credits strong {
  font-size: 20px;
  color: var(--text-primary);
}

.topup-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-topup {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-topup:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.topup-pack-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.topup-per-credit {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

/* --- Transactions Table --- */
.billing-transactions-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.billing-transactions-table table {
  width: 100%;
  border-collapse: collapse;
}

.billing-transactions-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.billing-transactions-table td {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.billing-transactions-table tr:last-child td {
  border-bottom: none;
}

.billing-transactions-table tr:hover td {
  background: var(--bg-secondary);
}

.billing-empty {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

.credit-positive {
  color: #10b981;
  font-weight: 600;
}

.credit-negative {
  color: #ef4444;
  font-weight: 600;
}

.billing-filter-btn {
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.billing-filter-btn:hover {
  border-color: var(--accent);
  color: var(--text-secondary);
}

.billing-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
  .billing-status-row {
    grid-template-columns: 1fr;
  }

  .billing-plans-grid {
    grid-template-columns: 1fr;
  }

  .billing-topup-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .billing-topup-grid {
    grid-template-columns: 1fr;
  }

  .billing-section-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

/* --- Welcome Test Call Modal --- */
.welcome-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.welcome-modal-overlay.show { display: flex; }

.welcome-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px 36px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: welcomeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
@keyframes welcomeSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.welcome-modal-close:hover { color: var(--text-primary); }

.welcome-modal-icon {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: white;
  animation: phonePulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
}
@keyframes phonePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 0 16px rgba(99, 102, 241, 0); transform: scale(1.05); }
}

.welcome-modal h2 {
  font-size: 24px; font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.welcome-modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.welcome-modal-phone {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  margin: 0 auto 16px;
}
.welcome-modal-phone i { color: #6366f1; font-size: 18px; }
.welcome-modal-phone span {
  font-size: 24px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.welcome-modal-cta {
  font-size: 15px; font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.welcome-modal-btn.primary {
  padding: 14px 32px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white; border: none;
  border-radius: 12px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 8px;
}
.welcome-modal-btn.primary:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.welcome-modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 16px 0 0;
}

/* Modal Overlay - for login modal etc */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay .modal {
  display: block;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 680px;
  max-height: 90vh;
  margin: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.form-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

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

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
}

.range-value {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.select-sm {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
}

.search-input {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  min-width: 150px;
}

.date-input {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  width: 130px;
}

.nav-item.logout {
  color: var(--error);
  margin-top: auto;
}

.nav-item.logout:hover {
  background: rgba(255, 87, 87, 0.1);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.link:hover {
  text-decoration: underline;
}

/* =====================================================
   RILEY PAGES STYLES
   ===================================================== */

/* Riley Settings Layout */
.riley-settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.settings-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card {
  padding: 0;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.settings-icon.voice {
  background: #7c3aed20;
  color: #7c3aed;
}

.settings-icon.schedule {
  background: #f59e0b20;
  color: #f59e0b;
}

.settings-icon.persona {
  background: #ec489920;
  color: #ec4899;
}

.settings-icon.greetings {
  background: #10b98120;
  color: #10b981;
}

.settings-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-title span {
  font-size: 13px;
  color: var(--text-muted);
}

.settings-card-body {
  padding: 20px;
}

/* Form Row - Inline form groups */
.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* Radio Group - Inline radio buttons */
.radio-group {
  display: flex;
  gap: 20px;
  padding: 8px 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
}

/* Toggle Group - Toggle with label */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-label span:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle Switch - iOS style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(100, 100, 100, 0.4);
  transition: 0.3s;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked+.toggle-slider {
  background-color: #2563eb;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(22px);
}

/* Voice Selector */
.voice-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.voice-option {
  cursor: pointer;
}

.voice-option input {
  display: none;
}

.voice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.voice-card i {
  font-size: 24px;
  color: var(--text-muted);
}

.voice-card span {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.voice-card small {
  font-size: 11px;
  color: var(--text-muted);
}

.voice-option input:checked+.voice-card,
.voice-option.active .voice-card {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.voice-option input:checked+.voice-card i,
.voice-option.active .voice-card i {
  color: var(--accent);
}

.btn-full {
  width: 100%;
}

/* Preview Voice Button */
.btn-icon-preview {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-icon-preview:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.btn-icon-preview:active {
  transform: scale(0.95);
}

.btn-icon-preview.playing {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  }

  50% {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
  }
}

/* Time Range Selector */
.time-range {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.time-input {
  flex: 1;
}

.time-input label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.time-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}

.time-separator {
  padding-bottom: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Weekday Selector */
.weekday-selector {
  margin-top: 8px;
}

.weekday-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.weekday-grid {
  display: flex;
  gap: 8px;
}

.weekday-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.weekday-btn input {
  display: none;
}

.weekday-btn span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.weekday-btn:has(input:checked),
.weekday-btn.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.weekday-btn:has(input:checked) span,
.weekday-btn.checked span {
  color: white;
}

/* Tools Grid */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tools-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

.tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
  /* Allow flex shrinking */
  width: 100%;
  box-sizing: border-box;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.tool-card.active {
  background: var(--accent-muted);
  border-color: var(--accent);
}

.tool-info {
  flex: 1;
  min-width: 0;
  /* Critical for text truncation */
  overflow: hidden;
}

.tool-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tool-description {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tool-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
}

.tool-card.active .tool-toggle {
  background: var(--accent);
}

.tool-card.active .tool-toggle::after {
  left: 20px;
}

.settings-icon.tools {
  background: #6366f120;
  color: #6366f1;
}

.settings-icon.transfer {
  background: #f59e0b20;
  color: #f59e0b;
}

/* Transfer Department Rows */
.transfer-dept-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.transfer-dept-row .dept-name {
  flex: 1;
  min-width: 100px;
  text-transform: capitalize;
}

.transfer-dept-row .dept-phone {
  flex: 2;
}

.transfer-dept-row .btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.transfer-dept-row .btn-icon:hover:not(:disabled) {
  background: #ef444420;
  color: #ef4444;
  border-color: #ef444440;
}

.transfer-dept-row .btn-icon:disabled {
  cursor: default;
  opacity: 0.4;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 8px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-text:hover {
  opacity: 0.8;
}

.form-hint {
  display: block;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin-top: 4px;
}

/* Greeting Tabs */
.greeting-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.greeting-tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.greeting-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.persona-textarea {
  min-height: 200px;
}

/* Donut Chart */
.donut-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.donut-chart {
  position: relative;
  width: 160px;
  height: 160px;
}

.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.circle {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  animation: progress 1s ease-out forwards;
}

.circle.inbound {
  stroke: var(--success);
}

@keyframes progress {
  0% {
    stroke-dasharray: 0 100;
  }
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-total {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.donut-label {
  font-size: 12px;
  color: var(--text-muted);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.inbound {
  background: var(--success);
}

.legend-dot.outbound {
  background: var(--info);
}

.legend-info {
  display: flex;
  justify-content: space-between;
  flex: 1;
}

.legend-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.legend-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.legend-value small {
  font-weight: 400;
  color: var(--text-muted);
}

/* Calendar Layout */
/* =============================================
   CALENDAR - Dynamic Views
   ============================================= */
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
}

.calendar-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 8px;
}

.cal-today-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-today-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.cal-view-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cal-tab {
  padding: 7px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.cal-tab.active {
  background: var(--accent);
  color: white;
}

/* Month View */
.cal-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.cal-month-weekdays span {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-month-cell {
  min-height: 80px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.cal-month-cell:nth-child(7n) {
  border-right: none;
}

.cal-month-cell:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cal-month-cell.cal-other-month {
  opacity: 0.35;
}

.cal-month-cell.cal-selected {
  background: rgba(99, 102, 241, 0.08);
}

.cal-month-cell.cal-today .cal-day-num {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.cal-day-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.cal-dots {
  display: flex;
  gap: 3px;
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot-more {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Week View */
.cal-week-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.cal-time-gutter {
  /* empty header for time column */
}

.cal-week-day-header {
  text-align: center;
  padding: 10px 4px;
  border-left: 1px solid var(--border);
}

.cal-week-dayname {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.cal-week-daynum {
  display: inline-block;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
}

.cal-today-header .cal-week-daynum,
.cal-week-daynum.cal-today-num {
  background: var(--accent);
  color: white;
}

/* Time Grid (Week + Day) */
.cal-time-grid {
  display: grid;
  position: relative;
  max-height: 600px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.cal-time-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  text-align: right;
  height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.cal-time-cell {
  height: 48px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  position: relative;
}

.cal-time-cell:hover {
  background: rgba(255, 255, 255, 0.015);
}

/* Event blocks */
.cal-event-block {
  transition: opacity 0.15s;
  line-height: 1.3;
}

.cal-event-block:hover {
  opacity: 0.85;
  filter: brightness(1.1);
}

.cal-col-wrap {
  pointer-events: none;
}

/* Day View */
.cal-day-header {
  padding: 10px 0;
}

.cal-day-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.cal-day-event:hover {
  transform: translateX(2px);
  transition: transform 0.15s;
}

/* =============================================
   APPOINTMENTS LIST (Below Calendar)
   ============================================= */
.cal-appointments-section {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.cal-appointments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cal-appointments-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.cal-appointments-count {
  min-width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  padding: 0 4px;
}

.cal-appointments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.cal-empty-state i {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.cal-empty-state p {
  font-size: 14px;
  margin: 0;
}

/* Appointment Card */
.cal-apt-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.cal-apt-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  transform: translateY(-1px);
}

.cal-apt-indicator {
  width: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.cal-apt-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 65px;
  gap: 2px;
}

.cal-apt-start {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-apt-duration {
  font-size: 11px;
  color: var(--text-muted);
}

.cal-apt-info {
  flex: 1;
  min-width: 0;
}

.cal-apt-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-apt-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cal-apt-meta span {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cal-apt-meta i {
  font-size: 10px;
  opacity: 0.6;
}

.cal-apt-tags {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cal-apt-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
}

.cal-apt-ref {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Detail Modal */
.cal-detail-modal {
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

/* Premium Detail Card */
.cal-detail-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.cal-detail-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
}

.cal-detail-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.cal-detail-hero-info {
  flex: 1;
  min-width: 0;
}

.cal-detail-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cal-detail-time {
  font-size: 13px;
  color: var(--text-muted);
}

.cal-detail-dur {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

.cal-detail-divider {
  height: 1px;
  background: var(--border);
}

.cal-detail-fields {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cal-detail-field {
  display: flex;
  gap: 14px;
  align-items: center;
}

.cal-detail-field-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
}

.cal-detail-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.cal-detail-field-value {
  font-size: 14px;
  color: var(--text-primary);
}

.cal-detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}

.cal-detail-ref {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.cal-detail-ref i {
  color: var(--accent);
  margin-right: 4px;
}

/* Audit Log Section */
.cal-audit-section {
  margin-top: 20px;
}

.cal-audit-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-audit-header i {
  color: var(--accent);
  margin-right: 6px;
}

.cal-audit-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.cal-audit-loading i {
  margin-right: 6px;
}

.cal-audit-log {
  padding-left: 4px;
}

.cal-audit-entry {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
  padding-left: 4px;
}

.cal-audit-entry:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.cal-audit-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 3px solid var(--bg-card);
  box-sizing: border-box;
}

.cal-audit-content {
  flex: 1;
  min-width: 0;
}

.cal-audit-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-audit-current .cal-audit-label {
  color: var(--accent);
}

.cal-audit-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cal-audit-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

/* Settings Grid (legacy) */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.settings-grid .card.full-width {
  grid-column: 1 / -1;
}

.page-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.data-table td {
  font-size: 14px;
  color: var(--text-primary);
}

.phone-number {
  font-family: monospace;
  font-weight: 600;
}

.inline-input,
.inline-select {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  max-width: 180px;
}

.btn-sm.danger {
  color: var(--danger);
}

.btn-sm.danger:hover {
  background: var(--danger-muted);
}

/* Call List */
.call-list {
  display: flex;
  flex-direction: column;
}

.call-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.call-item:hover {
  background: var(--bg-card-hover);
}

.call-direction {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.call-direction.inbound {
  background: var(--success-muted);
  color: var(--success);
}

.call-direction.outbound {
  background: var(--info-muted);
  color: var(--info);
}

.call-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.call-number {
  font-weight: 600;
  color: var(--text-primary);
}

.call-agent {
  font-size: 13px;
  color: var(--text-muted);
}

.call-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.call-duration {
  font-weight: 600;
  color: var(--text-primary);
}

.call-time {
  font-size: 12px;
  color: var(--text-muted);
}

.expand-icon {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.call-item.expanded .expand-icon {
  transform: rotate(180deg);
}

.call-transcript {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.call-transcript.hidden {
  display: none;
}

/* Transcript Modal */
.transcript-modal {
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.transcript-modal .modal-header {
  width: 100%;
  box-sizing: border-box;
}

/* Transcript Hero Card */
.transcript-hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.transcript-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
}

.transcript-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.transcript-hero-info {
  flex: 1;
  min-width: 0;
}

.transcript-hero-phones {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.transcript-hero-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.transcript-hero-dur {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

.transcript-hero-dir {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}

/* Transcript Chat Messages */
.transcript-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.transcript-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.transcript-msg.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.transcript-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.transcript-avatar.bot {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: white;
}

.transcript-avatar.user {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}

.transcript-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.transcript-bubble.bot {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 2px 12px 12px 12px;
}

.transcript-bubble.user {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px 2px 12px 12px;
}

.transcript-speaker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  color: var(--text-muted);
}

.transcript-text {
  color: var(--text-primary);
}

.transcript-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 14px;
}

.transcript-loading i {
  margin-right: 6px;
}

.transcript-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.transcript-empty i {
  font-size: 24px;
  margin-bottom: 12px;
  display: block;
}

.transcript-empty p {
  font-size: 14px;
  margin: 0;
}

/* Call Summary Sub-row */
.call-summary-row td {
  padding: 4px 16px 14px 42px !important;
  border-top: none !important;
  border-bottom: none !important;
}

.call-summary-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.03));
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.call-summary-card .summary-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--primary);
  font-size: 10px;
  margin-top: 1px;
}

.call-summary-card .summary-text {
  flex: 1;
  min-width: 0;
}

.call-summary-card .summary-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  display: block;
  margin-bottom: 2px;
}

/* Transcript Modal Summary Card */
.transcript-summary-card {
  margin: 0 16px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 3px solid var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(139, 92, 246, 0.03));
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.transcript-summary-card .summary-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--primary);
  font-size: 11px;
  margin-top: 1px;
}

.transcript-summary-card .summary-text {
  flex: 1;
  min-width: 0;
}

.transcript-summary-card .summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  display: block;
  margin-bottom: 3px;
}

.transcript-summary-card .summary-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Transcript Audio Player */
.transcript-audio-wrapper {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.transcript-audio-wrapper i {
  color: var(--primary);
  font-size: 14px;
}

.transcript-audio-wrapper audio {
  flex: 1;
  height: 32px;
  min-width: 0;
}

.transcript-audio-wrapper audio::-webkit-media-controls-panel {
  background: transparent;
}

/* Direction Stats */
.direction-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.direction-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.direction-icon.inbound {
  background: var(--success-muted);
  color: var(--success);
}

.direction-icon.outbound {
  background: var(--info-muted);
  color: var(--info);
}

.direction-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.direction-label {
  font-weight: 600;
  color: var(--text-primary);
}

.direction-value {
  font-size: 13px;
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  gap: 8px;
}

/* Calendar Filters */
.calendar-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.calendar-filter {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.calendar-filter:hover {
  background: var(--bg-card-hover);
}

.calendar-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Appointments Grid */
.appointments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.appointment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 4px solid var(--accent);
}

.appointment-card.source-voice {
  border-left-color: #7c3aed;
}

.appointment-card.source-gmail {
  border-left-color: #ea4335;
}

.appointment-card.source-outlook {
  border-left-color: #0078d4;
}

.appointment-card.source-calendly {
  border-left-color: #006bff;
}

.appointment-card.source-hubspot {
  border-left-color: #ff7a59;
}

.appointment-card.source-ghl {
  border-left-color: #10b981;
}

.appointment-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.source-voice .appointment-source {
  color: #7c3aed;
}

.source-gmail .appointment-source {
  color: #ea4335;
}

.source-outlook .appointment-source {
  color: #0078d4;
}

.source-calendly .appointment-source {
  color: #006bff;
}

.source-hubspot .appointment-source {
  color: #ff7a59;
}

.source-ghl .appointment-source {
  color: #10b981;
}

.appointment-time {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.appointment-date {
  font-size: 13px;
  color: var(--text-muted);
}

.appointment-hour {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.appointment-details h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.appointment-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.appointment-type {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--accent-muted);
  border-radius: 20px;
  color: var(--accent);
}

.appointment-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* Widget Layout */
.widget-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
}

.widget-config {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget-type-selector {
  display: flex;
  gap: 16px;
}

.widget-type-option {
  flex: 1;
  cursor: pointer;
}

.widget-type-option input {
  display: none;
}

.widget-type-option .option-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.widget-type-option .option-content i {
  font-size: 28px;
  color: var(--text-muted);
}

.widget-type-option .option-content span {
  font-weight: 600;
  color: var(--text-primary);
}

.widget-type-option .option-content small {
  font-size: 12px;
  color: var(--text-muted);
}

.widget-type-option.active .option-content,
.widget-type-option input:checked+.option-content {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.widget-type-option.active .option-content i,
.widget-type-option input:checked+.option-content i {
  color: var(--accent);
}

.color-picker {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-picker input[type="color"] {
  width: 48px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.color-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: monospace;
}

.embed-code {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.embed-code pre {
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.embed-code code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.copy-btn {
  align-self: flex-start;
}

/* Widget Preview */
.preview-container {
  padding: 20px;
}

.preview-website {
  background: #1a1a2e;
  border-radius: var(--radius);
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

.preview-header {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.preview-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-placeholder {
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.preview-placeholder.short {
  width: 60%;
}

.widget-bubble {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 320px;
}

.widget-expanded {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--accent);
  color: white;
}

.widget-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.widget-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.widget-title span {
  font-weight: 600;
}

.widget-title small {
  font-size: 12px;
  opacity: 0.8;
}

.widget-close {
  background: none;
  border: none;
  color: white;
  opacity: 0.8;
  cursor: pointer;
}

.widget-body {
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-message {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  max-width: 85%;
}

.widget-message.bot {
  background: var(--bg-secondary);
  color: var(--text-primary);
  align-self: flex-start;
}

.widget-message.user {
  background: var(--accent);
  color: white;
  align-self: flex-end;
}

.widget-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.widget-input input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14px;
}

.mic-btn,
.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.send-btn {
  background: var(--accent);
  color: white;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .billing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  /* Mobile Hamburger Button */
  .mobile-menu-btn {
    display: flex !important;
  }

  /* Sidebar - Hidden by default, slides in */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Overlay when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  /* Main content full width - override sidebar-collapsed margin */
  .main-content {
    margin-left: 0 !important;
  }

  /* Top bar adjustments for mobile */
  .top-bar {
    padding: 12px 16px;
    justify-content: space-between;
  }

  /* Mobile logo - visible on mobile only */
  .mobile-logo {
    display: flex !important;
  }

  /* Hide search box on mobile */
  .search-box {
    display: none;
  }

  /* Hide elements with hide-mobile class */
  .hide-mobile {
    display: none !important;
  }

  /* Show hamburger in top-actions */
  .mobile-menu-btn {
    display: flex !important;
    order: 10;
  }

  /* Stats grid single column */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Page container */
  .pages-container {
    padding: 20px 16px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  /* Agent cards */
  .agents-grid {
    grid-template-columns: 1fr;
  }

  /* Knowledge grid */
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  /* Toolbar */
  .toolbar {
    flex-direction: column;
    gap: 12px;
  }

  .search-filter {
    width: 100%;
  }

  .search-filter input {
    flex: 1;
  }

  /* Modal */
  .modal-content {
    width: 95%;
    margin: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Reset collapsed sidebar styles for mobile - always show full nav */
  .sidebar.collapsed {
    width: var(--sidebar-width);
  }

  .sidebar.collapsed .nav-section {
    align-items: stretch;
    padding: 0;
  }

  .sidebar.collapsed .nav-item {
    width: auto;
    height: auto;
    gap: 12px;
    justify-content: flex-start;
    padding: 10px 12px;
    margin: 0 0 4px 0;
  }

  .sidebar.collapsed .nav-item i {
    font-size: 15px;
    width: 20px;
  }

  .sidebar.collapsed .logo span,
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .user-details {
    opacity: 1;
    width: auto;
  }

  .sidebar.collapsed .sidebar-toggle {
    display: flex;
  }

  /* Hide sidebar toggle on mobile - use hamburger instead */
  .sidebar-toggle {
    display: none !important;
  }
}

/* Hamburger button - hidden on desktop */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
}

/* =====================================================
   ENHANCED RILEY UI ROUND 2
   ===================================================== */

/* Calendar Integration Options */
.calendar-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calendar-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-option:hover {
  background: var(--bg-card-hover);
}

.calendar-option.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.calendar-option .calendar-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.calendar-icon.google {
  background: #ea433510;
  color: #ea4335;
}

.calendar-icon.outlook {
  background: #0078d410;
  color: #0078d4;
}

.calendar-icon.calendly {
  background: #006bff10;
  color: #006bff;
}

.calendar-icon.hubspot {
  background: #ff7a5910;
  color: #ff7a59;
}

.calendar-option span {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.calendar-option .check {
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.calendar-option.selected .check {
  opacity: 1;
}

.settings-icon.calendar {
  background: #3b82f620;
  color: #3b82f6;
}

/* Duration Options */
.settings-icon.duration {
  background: #8b5cf620;
  color: #8b5cf6;
}

.duration-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.duration-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
}

.duration-option:hover {
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}

.duration-option.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.duration-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.duration-option.selected .duration-value {
  color: var(--accent);
}

.duration-unit {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Custom duration input */
.duration-option.custom {
  flex-direction: row;
  gap: 4px;
}

.duration-option.custom input {
  width: 45px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.duration-option.custom input::-webkit-outer-spin-button,
.duration-option.custom input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.duration-option.custom input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.duration-option.custom input:focus {
  outline: none;
  border-color: var(--accent);
}

.duration-option.custom.selected input {
  border-color: var(--accent);
  color: var(--accent);
}

/* Weekday Buttons - Enhanced */
.weekday-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.weekday-btn span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.weekday-btn.active,
.weekday-btn:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
}

.weekday-btn.active span,
.weekday-btn:has(input:checked) span {
  color: white;
}

/* Calendar View Tabs */
.calendar-view-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.view-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.view-tab:hover {
  color: var(--text-primary);
}

.view-tab.active {
  background: var(--accent);
  color: white;
}

/* Call Tags */
.call-tags {
  display: flex;
  gap: 8px;
  flex: 1;
}

.call-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.call-tag.booked {
  background: var(--success-muted);
  color: var(--success);
}

/* Play Button */
.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.play-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}

/* Appointment Tags */
.appointment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.apt-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

.apt-tag.source {
  background: var(--bg-card);
  color: var(--text-muted);
}

.apt-tag.type {
  background: #3b82f620;
  color: #3b82f6;
}

.apt-tag.priority.high {
  background: #ef444420;
  color: #ef4444;
}

.apt-tag.reschedule {
  background: #f59e0b20;
  color: #f59e0b;
}

/* Voice Orb Widget */
.widget-orb {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.orb-container {
  position: relative;
  width: 70px;
  height: 70px;
  cursor: pointer;
}

.orb-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: orbPulse 2s infinite;
}

.orb-pulse.delay {
  animation-delay: 1s;
}

@keyframes orbPulse {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.orb-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.orb-container:hover .orb-core {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.5);
}

.orb-label {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* Voice Card Selected State */
.voice-card.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.voice-card.selected i {
  color: var(--accent);
}

/* ==================== */
/* Goldmine Styles      */
/* ==================== */

/* Employee Cards Grid */
.goldmine-employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.goldmine-employee-card {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.goldmine-employee-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7, #ec4899);
  opacity: 0;
  transition: opacity 0.3s;
}

.goldmine-employee-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow:
    0 12px 40px rgba(99, 102, 241, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.goldmine-employee-card:hover::before {
  opacity: 1;
}

.goldmine-employee-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(30, 30, 50, 0.98));
}

.goldmine-employee-card.selected::before {
  opacity: 1;
}

.goldmine-employee-card.add-new {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(20, 20, 35, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--text-muted);
  gap: 16px;
  box-shadow: none;
}

.goldmine-employee-card.add-new::before {
  display: none;
}

.goldmine-employee-card.add-new:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-4px);
}

.goldmine-employee-card.add-new i {
  font-size: 40px;
  opacity: 0.8;
}

.goldmine-employee-card.add-new span {
  font-size: 16px;
  font-weight: 500;
}

/* Employee Status Indicator */
.employee-status {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.employee-status.active {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  }

  50% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.9);
  }
}

.employee-status.paused {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.employee-status.scheduled {
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Employee Avatar */
.employee-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.goldmine-employee-card h4 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.goldmine-employee-card .employee-type {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-weight: 500;
}

.goldmine-employee-card .employee-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  font-size: 14px;
}

.goldmine-employee-card .employee-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goldmine-employee-card .employee-stats strong {
  color: white;
  font-size: 20px;
  font-weight: 700;
}

.goldmine-employee-card .employee-stats span {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.goldmine-employee-card .employee-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding: 0 4px;
}

.goldmine-employee-card .employee-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goldmine-employee-card .employee-meta i {
  color: var(--text-muted);
  font-size: 14px;
}

.goldmine-employee-card .employee-actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.goldmine-employee-card .employee-actions .btn-sm {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.goldmine-employee-card .employee-actions .btn-sm:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent);
}

/* ===================== */
/* Configuration Panel   */
/* ===================== */

.goldmine-config-panel {
  background: linear-gradient(180deg, rgba(25, 25, 40, 0.98), rgba(15, 15, 25, 0.99));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  margin-top: 32px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.config-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-panel-header h3 {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
}

.config-panel-header h3 i {
  color: var(--accent);
  font-size: 20px;
}

.btn-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 16px;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.config-panel-body {
  padding: 32px;
  display: grid;
  gap: 32px;
  max-height: 72vh;
  overflow-y: auto;
}

/* Config Sections with Visual Cards */
.config-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.config-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.config-section h4 i {
  color: var(--accent);
  width: 32px;
  height: 32px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 18px;
  background: var(--input-bg, rgba(0, 0, 0, 0.3));
  border: 1px solid var(--input-border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Tools Grid */
.tools-grid {
  display: flex;
  flex-direction: column;
  /* Single column layout */
  gap: 12px;
}

.tool-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.tool-checkbox:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.1);
}

.tool-checkbox:has(input:checked) {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
}

.tool-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Expandable Selector (Customer List) */
.expandable-selector {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.selector-header:hover {
  background: rgba(99, 102, 241, 0.1);
}

.selector-header i {
  color: var(--text-muted);
  transition: transform 0.3s;
}

.expandable-selector.open .selector-header i {
  transform: rotate(180deg);
}

.selector-body {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
}

.selector-search {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.selector-search input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
}

.selector-options {
  padding: 12px;
}

.list-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.list-option:hover {
  background: rgba(99, 102, 241, 0.15);
}

.list-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.list-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
}

.toggle-label input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

/* Schedule Tabs */
.schedule-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 12px;
  width: fit-content;
}

.schedule-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 14px;
}

.schedule-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.schedule-tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Day Selector */
.day-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.day-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.day-check:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.day-check:has(input:checked) {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
  color: white;
}

.day-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Pre-planned Campaigns */
.preplanned-campaigns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.preplanned-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.2s;
}

.preplanned-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.preplanned-date {
  font-size: 14px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.preplanned-label {
  flex: 1;
  font-weight: 600;
  color: white;
}

.btn-sm.danger {
  color: #ef4444;
}

.btn-sm.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-full {
  width: 100%;
}

/* Config Panel Footer */
.config-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .goldmine-employees-grid {
    grid-template-columns: 1fr;
  }

  .config-panel-body {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==================== */
/* Customer Lists Styles */
/* ==================== */

.customer-lists-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  min-height: 600px;
}

/* Labels Sidebar */
.labels-sidebar {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 0;
  height: fit-content;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.labels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
}

.labels-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.labels-header .btn-sm {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent);
  border-radius: 10px;
}

.labels-header .btn-sm:hover {
  background: var(--accent);
  color: white;
}

.labels-list {
  padding: 16px 12px;
}

.label-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--text-secondary);
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.label-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.2);
}

.label-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: white;
}

.label-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.label-item .label-color {
  width: 14px;
  height: 14px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}

.label-item span:not(.label-color):not(.label-count) {
  flex: 1;
  font-weight: 500;
}

.label-item .label-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

/* Customer Table Container */
.customer-table-container {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.customer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toolbar-right {
  display: flex;
  gap: 12px;
}

.select-all-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.select-all-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.bulk-actions {
  display: flex;
  gap: 10px;
}

.bulk-actions .btn-sm {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
}

.customer-search {
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-primary);
  width: 280px;
  font-size: 14px;
  transition: all 0.2s;
}

.customer-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.customer-search::placeholder {
  color: var(--text-muted);
}

/* Customer Table */
.customer-table {
  width: 100%;
  border-collapse: collapse;
}

.customer-table thead {
  background: rgba(0, 0, 0, 0.25);
}

.customer-table th {
  text-align: left;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.customer-table td {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
  color: var(--text-secondary);
}

.customer-table tbody tr {
  transition: all 0.2s;
}

.customer-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

.customer-table tbody tr:hover td {
  color: var(--text-primary);
}

.customer-phone {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 500;
  font-size: 13px;
}

.customer-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Table Action Buttons */
.customer-table .btn-sm {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 8px;
}

.customer-table .btn-sm:last-child {
  margin-right: 0;
}

.customer-table .btn-sm:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent);
}

/* Label Chips */
.label-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  border: 1px solid transparent;
}

.label-chip.hot {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.label-chip.past {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.label-chip.inactive {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.label-chip.vip {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.3);
}

.label-chip.dnc {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
  border-color: rgba(107, 114, 128, 0.3);
}

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

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

.page-indicator {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

.modal-lg {
  max-width: 640px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: var(--accent);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.upload-zone i {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
}

.upload-zone h4 {
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.mapping-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.mapping-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mapping-row label {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: 12px;
}

.color-option {
  cursor: pointer;
}

.color-option input {
  display: none;
}

.color-option span {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.color-option input:checked+span {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* Responsive */
@media (max-width: 900px) {
  .customer-lists-layout {
    grid-template-columns: 1fr;
  }

  .labels-sidebar {
    display: none;
  }
}

/* =================================
   App Modal (Alert/Confirm/Prompt)
   ================================= */
.app-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.app-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 380px;
  max-width: 480px;
  box-shadow: var(--shadow-lg), var(--glow);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.app-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.app-modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.app-modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.app-modal-body {
  padding: 24px;
}

.app-modal-body p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.app-modal-body .form-group {
  margin-top: 16px;
}

.app-modal-body input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.app-modal-body input:focus {
  border-color: var(--accent);
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.app-modal-footer button {
  min-width: 100px;
}

/* Schedule Entries List */
.schedule-entries-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.schedule-entry-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.schedule-entry-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.schedule-entry-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-dates {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

.schedule-dates i {
  color: var(--accent);
  margin-right: 6px;
}

.schedule-days {
  font-size: 12px;
  color: var(--text-muted);
}

.schedule-label {
  font-size: 12px;
  color: var(--accent-light);
  font-style: italic;
}

.schedule-entry-status {
  flex-shrink: 0;
}

.schedule-entry-actions {
  display: flex;
  gap: 6px;
}

.section-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* =============================================================================
   CALL LOG TABLE
   ============================================================================= */

.table-responsive {
  overflow-x: auto;
}

.call-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.call-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.call-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.call-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.call-table tbody td {
  padding: 12px 14px;
  color: var(--text);
  white-space: nowrap;
}

.direction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
}

.direction-badge.inbound {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.direction-badge.outbound {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* Transcript modal content */
/* Legacy transcript-line overrides removed — using transcript-msg/bubble system */

/* Play recording button */
.play-recording-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.2s ease;
}

.play-recording-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.play-recording-btn.playing {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

/* ============================================================================
   CUSTOM MODALS (replaces native alert/confirm/prompt)
   ============================================================================ */

.cm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cmOverlayIn 0.2s ease;
}

@keyframes cmOverlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cmOverlayOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes cmSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cmSlideOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
}

.cm-overlay.closing {
  animation: cmOverlayOut 0.15s ease forwards;
}

.cm-overlay.closing .cm-dialog {
  animation: cmSlideOut 0.15s ease forwards;
}

.cm-dialog {
  background: var(--card-bg, #1a1d23);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  width: 90%;
  max-width: 440px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 40px rgba(99, 102, 241, 0.08);
  animation: cmSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.cm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 0;
}

.cm-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cm-icon.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.cm-icon.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.cm-icon.info {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.cm-icon.success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.cm-icon.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.cm-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.cm-body {
  padding: 12px 24px 0;
}

.cm-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #94a3b8);
}

.cm-body input {
  width: 100%;
  padding: 10px 14px;
  margin-top: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  background: var(--bg, rgba(0, 0, 0, 0.2));
  color: var(--text-primary, #fff);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.cm-body input:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.cm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px;
}

.cm-btn {
  padding: 9px 20px;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.cm-btn:active {
  transform: scale(0.97);
}

.cm-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #94a3b8);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.cm-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #fff);
}

.cm-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.cm-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.cm-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.cm-btn-danger:hover {
  background: linear-gradient(135deg, #e03838, #c72020);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* ======================================== */
/* Collapsed sidebar footer overflow fix    */
/* ======================================== */
.sidebar.collapsed .sidebar-footer {
  overflow: hidden;
}

.sidebar.collapsed:hover .sidebar-footer {
  overflow: visible;
}

/* ======================================== */
/* Comprehensive Light Mode Overrides       */
/* ======================================== */
[data-theme="light"] .goldmine-employee-card {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .goldmine-employee-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12), 0 12px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .goldmine-employee-card.selected {
  background: rgba(37, 99, 235, 0.04);
  border-color: var(--accent);
}

[data-theme="light"] .goldmine-employee-card.add-new {
  background: rgba(37, 99, 235, 0.02);
  border-color: var(--border);
}

[data-theme="light"] .goldmine-employee-card.add-new:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--accent);
}

[data-theme="light"] .goldmine-employee-card::before {
  background: linear-gradient(90deg, var(--accent), #3b82f6, #60a5fa);
}

[data-theme="light"] .config-section {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .config-section h4 {
  color: var(--text-primary);
}

[data-theme="light"] .config-panel {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .config-panel-header {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .tool-checkbox {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .tool-checkbox:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}

[data-theme="light"] .tool-checkbox:has(input:checked) {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--accent);
}

[data-theme="light"] .expandable-selector {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .selector-body {
  background: var(--bg-primary);
  border-color: var(--border);
}

[data-theme="light"] .selector-search {
  border-color: var(--border);
}

[data-theme="light"] .selector-search input {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
  background: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .list-option {
  color: var(--text-primary);
}

[data-theme="light"] .list-option:hover {
  background: rgba(37, 99, 235, 0.06);
}

[data-theme="light"] .dept-row {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .caller-id-section {
  background: var(--bg-secondary);
  border-color: var(--border);
}

/* Customer Database light mode */
[data-theme="light"] .customer-table .btn-sm {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .labels-header .btn-sm {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="light"] .bulk-actions .btn-sm {
  background: var(--bg-secondary);
  border-color: var(--border);
}

/* Phone number table inline controls */
[data-theme="light"] .inline-input,
[data-theme="light"] .inline-select {
  background: var(--input-bg);
  border-color: var(--input-border);
}

/* Riley settings panels light mode */
[data-theme="light"] .riley-card,
[data-theme="light"] .settings-card {
  background: var(--bg-secondary);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Play recording button light mode */
[data-theme="light"] .play-recording-btn {
  background: var(--accent);
  border-color: var(--accent);
}

/* Custom modal light mode - ensure white backgrounds */
[data-theme="light"] .cm-modal {
  background: var(--bg-secondary);
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cm-dialog {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cm-header {
  border-color: var(--border);
}

[data-theme="light"] .cm-title {
  color: var(--text-primary);
}

[data-theme="light"] .cm-message {
  color: var(--text-secondary);
}

[data-theme="light"] .cm-body {
  color: var(--text-primary);
}

[data-theme="light"] .cm-footer {
  background: var(--bg-primary);
  border-color: var(--border);
}

[data-theme="light"] .cm-btn-cancel {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="light"] .cm-btn-cancel:hover {
  background: var(--bg-card-hover);
}

/* Ensure all buttons use blue tones */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #2563eb;
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* ============================================
   DARK MODE — Integration Cards
   ============================================ */
:root .integration-card {
  background: var(--bg-card);
  border-color: var(--border);
}

:root .integration-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

:root .integration-card-body h4 {
  color: var(--text-primary);
}

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

:root .integration-tag {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border-color: var(--border);
}

:root .integration-card-footer {
  border-top-color: var(--border);
}

:root .integration-card.coming-soon {
  background: var(--bg-card);
}

:root .integration-card.coming-soon:hover {
  border-color: var(--border);
}

:root .coming-soon-badge {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border-color: var(--border);
}

:root .integration-card.connected {
  border-color: rgba(167, 243, 208, 0.3);
  background: var(--bg-card);
}

:root .integration-card.connected:hover {
  border-color: rgba(110, 231, 183, 0.4);
}

/* Light mode overrides for integration cards */
[data-theme="light"] .integration-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .integration-card:hover {
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  border-color: #c7d2fe;
}

[data-theme="light"] .integration-card-body h4 {
  color: #1e293b;
}

[data-theme="light"] .integration-desc {
  color: #64748b;
}

[data-theme="light"] .integration-tag {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

[data-theme="light"] .integration-card-footer {
  border-top-color: #f1f5f9;
}

[data-theme="light"] .integration-card.coming-soon {
  background: #fafbfc;
}

[data-theme="light"] .coming-soon-badge {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #64748b;
  border-color: #cbd5e1;
}

[data-theme="light"] .integration-card.connected {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #f0fdf9 0%, #ffffff 40%);
}

/* ============================================
   DARK MODE — Dashboard elements
   ============================================ */
:root .dash-call-row {
  border-bottom-color: var(--border);
}

:root .dash-call-caller {
  color: var(--text-primary);
}

:root .dash-call-meta {
  color: var(--text-muted);
}

:root .dash-empty-state {
  color: var(--text-muted);
}

:root .dash-appt-row {
  border-bottom-color: var(--border);
}

:root .dash-appt-title {
  color: var(--text-primary);
}

/* Light mode dashboard call row overrides */
[data-theme="light"] .dash-stat-trend.up {
  color: #16a34a;
  background: #f0fdf4;
}

[data-theme="light"] .dash-stat-trend.down {
  color: #dc2626;
  background: #fef2f2;
}

/* ============================================
   DARK MODE — Call Logs stat cards
   ============================================ */
:root .stat-card {
  background: var(--bg-card);
  border-color: var(--border);
}

:root .stat-card .stat-value {
  color: var(--text-primary);
}

:root .stat-card .stat-label {
  color: var(--text-secondary);
}

/* ============================================
   Knowledge Cards — Integration-style layout
   ============================================ */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.knowledge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.knowledge-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-light);
}

.knowledge-card-top {
  padding: 28px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knowledge-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.knowledge-icon.website {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 1px solid #93c5fd;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.knowledge-icon.doc {
  background: linear-gradient(135deg, #ffe4de, #fecaca);
  border: 1px solid #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.knowledge-icon.manual {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border: 1px solid #c4b5fd;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.12);
  color: #7c3aed;
}

.knowledge-card-body {
  padding: 0 24px 20px;
  flex: 1;
  text-align: center;
}

.knowledge-card-body h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-card-body .knowledge-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.knowledge-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.knowledge-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.knowledge-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.knowledge-status.synced {
  color: #10b981;
}

.knowledge-status.processing {
  color: var(--warning);
}

.knowledge-status.error {
  color: var(--danger);
}

.knowledge-delete-btn {
  padding: 8px 14px;
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.knowledge-delete-btn:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
}

/* Light mode knowledge cards */
[data-theme="light"] .knowledge-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .knowledge-card:hover {
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  border-color: #c7d2fe;
}

[data-theme="light"] .knowledge-card-body h4 {
  color: #1e293b;
}

[data-theme="light"] .knowledge-tag {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

[data-theme="light"] .knowledge-card-footer {
  border-top-color: #f1f5f9;
}

/* Light mode icon-btn fix */
[data-theme="light"] .icon-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .icon-btn:hover {
  background: #f0f4f8;
}

/* ============================================================================
   PROFILE DRAWER
   ============================================================================ */

.profile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.profile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.profile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.profile-drawer.open {
  transform: translateY(0);
}

.profile-drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 4px;
  margin: 12px auto 0;
  opacity: 0.4;
  cursor: pointer;
}

.profile-drawer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.profile-drawer-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.profile-drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.profile-drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}

.profile-drawer-close:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.profile-drawer-body {
  padding: 16px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-drawer-field {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background 0.2s;
}

.profile-drawer-field:hover {
  background: var(--bg-card-hover);
}

.profile-field-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6366f1;
  font-size: 14px;
}

.profile-field-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.profile-field-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

/* Light mode overrides */
[data-theme="light"] .profile-drawer {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .profile-field-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
}

[data-theme="light"] .profile-drawer-overlay {
  background: rgba(0, 0, 0, 0.25);
}