/* Clairvo AI Dialer Premium Styling Stylesheet */

:root {
  /* HSL curated harmonious palette */
  --bg-app: hsl(240, 10%, 4%);
  --bg-card: rgba(22, 22, 28, 0.55);
  --bg-card-hover: rgba(30, 30, 38, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(34, 197, 94, 0.15);
  
  --fg-primary: hsl(0, 0%, 98%);
  --fg-secondary: hsl(240, 5%, 65%);
  --fg-muted: hsl(240, 5%, 45%);

  --green-500: hsl(142, 76%, 45%);
  --green-600: hsl(142, 72%, 35%);
  --green-950: hsl(142, 80%, 6%);
  
  --blue-500: hsl(217, 91%, 60%);
  --blue-600: hsl(217, 85%, 50%);
  --blue-950: hsl(217, 80%, 6%);
  
  --amber-500: hsl(38, 92%, 50%);
  --amber-600: hsl(38, 85%, 40%);
  
  --red-500: hsl(346, 80%, 55%);
  --red-600: hsl(346, 75%, 45%);

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Suppress login overlay and main workspace during initial JWT validation */
html.app-loading #login-screen,
html.app-loading #main-app,
html.app-loading .app-container {
  display: none !important;
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.settings-active {
  overflow: hidden;
}

/* ── Custom Select Component ─────────────────────────────────────────────────*/
.cs-wrapper {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0; /* allow shrinking inside flex rows so long values truncate */
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
  box-sizing: border-box;
}

.cs-trigger .cs-label {
  flex: 1;
  min-width: 0; /* required for text-overflow:ellipsis to work inside flex */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.cs-trigger .cs-arrow {
  flex-shrink: 0;
  color: var(--fg-muted);
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1);
}

.cs-trigger.open .cs-arrow { transform: rotate(180deg); }

.cs-trigger:hover {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
}

.cs-trigger:focus, .cs-trigger.open {
  border-color: hsl(217,91%,60%);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.cs-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 9990;
  background: #16161c;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  max-height: 220px;
  overflow-y: auto;
  display: none;
  backdrop-filter: blur(16px);
}

.cs-dropdown.drop-down { top: calc(100% + 4px); }
.cs-dropdown.drop-up   { bottom: calc(100% + 4px); }

.cs-option {
  padding: 9px 14px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--fg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-option:hover { background: rgba(255,255,255,0.07); }

.cs-option.cs-selected {
  background: rgba(59,130,246,0.15);
  color: hsl(217,91%,70%);
}

.cs-option.cs-selected::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: hsl(217,91%,60%);
  flex-shrink: 0;
}

/* Small variant for compact selects */
.cs-sm .cs-trigger { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.cs-sm .cs-option  { padding: 6px 10px; font-size: 11px; }

.cs-dropdown::-webkit-scrollbar { width: 4px; }
.cs-dropdown::-webkit-scrollbar-track { background: transparent; }
.cs-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* Light theme */
body.light-theme .cs-trigger {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
  color: var(--fg-primary);
}
body.light-theme .cs-trigger:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.15); }
body.light-theme .cs-dropdown { background: #ffffff; border-color: rgba(0,0,0,0.1); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
body.light-theme .cs-option { color: var(--fg-primary); }
body.light-theme .cs-option:hover { background: rgba(0,0,0,0.04); }
body.light-theme .cs-option.cs-selected { background: rgba(59,130,246,0.08); color: hsl(217,91%,50%); }

/* Header Design */
.app-header {
  height: 70px;
  background: rgba(10, 10, 12, 0.4);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-orb {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, var(--green-500) 0%, transparent 80%);
  border: 2px solid var(--green-500);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green-500);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-sub {
  color: var(--green-500);
}

/* Nav Tabs */
.header-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  color: var(--fg-primary);
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-primary);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

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

/* App Containers */
.app-container {
  padding: 20px;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  max-height: calc(100vh - 110px);
  overflow: hidden;
  box-sizing: border-box;
}

.tab-panel {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#tab-analytics.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 6px 0 0;
}

#tab-analytics .full-table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#tab-analytics .table-wrapper {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  max-height: 480px;
}

#tab-leads.active {
  overflow: hidden;
  position: relative;
}

/* Drag-and-drop CSV import overlay */
.csv-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.78);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.csv-drop-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}
.csv-drop-inner {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 64px;
  border: 2px dashed hsl(217, 91%, 60%);
  border-radius: 18px;
  background: rgba(22, 22, 28, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.csv-drop-icon {
  font-size: 38px;
  line-height: 1;
  color: hsl(217, 91%, 60%);
  animation: csvDropBob 1.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.csv-drop-title {
  font-size: 18px;
  font-weight: 700;
  color: #f5f5f7;
}
.csv-drop-sub {
  font-size: 13px;
  color: rgba(245, 245, 247, 0.55);
}
@keyframes csvDropBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

#leads-lists-view,
#leads-detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

#tab-leads .full-table-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 14px;
  padding-bottom: 0;
}

#tab-leads .table-wrapper {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 20px;
  min-height: 0;
}

#leads-lists-grid {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 20px;
  min-height: 0;
}

#tab-leads .table-wrapper::-webkit-scrollbar,
#leads-lists-grid::-webkit-scrollbar,
#an-panel-0::-webkit-scrollbar,
.conv-list::-webkit-scrollbar {
  width: 6px;
}
#tab-leads .table-wrapper::-webkit-scrollbar-track,
#leads-lists-grid::-webkit-scrollbar-track,
#an-panel-0::-webkit-scrollbar-track,
.conv-list::-webkit-scrollbar-track {
  background: transparent;
}
#tab-leads .table-wrapper::-webkit-scrollbar-thumb,
#leads-lists-grid::-webkit-scrollbar-thumb,
#an-panel-0::-webkit-scrollbar-thumb,
.conv-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
#tab-leads .table-wrapper::-webkit-scrollbar-thumb:hover,
#leads-lists-grid::-webkit-scrollbar-thumb:hover,
#an-panel-0::-webkit-scrollbar-thumb:hover,
.conv-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

body.light-theme #tab-leads .table-wrapper::-webkit-scrollbar-thumb,
body.light-theme #leads-lists-grid::-webkit-scrollbar-thumb,
body.light-theme #an-panel-0::-webkit-scrollbar-thumb,
body.light-theme .conv-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
}
body.light-theme #tab-leads .table-wrapper::-webkit-scrollbar-thumb:hover,
body.light-theme #leads-lists-grid::-webkit-scrollbar-thumb:hover,
body.light-theme #an-panel-0::-webkit-scrollbar-thumb:hover,
body.light-theme .conv-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Tab 1: Agent Workspace Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 450px 1fr 450px;
  grid-template-rows: 100%;
  gap: 24px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  flex: 1;
}

.lead-sidebar {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  padding: 0 !important;
}

/* Tabs row — always pinned at the top, never scrolls away */
.lead-sidebar .dial-mode-tabs {
  flex-shrink: 0;
}

/* Old panel scroll rules — replaced by #dialer-panel-body above */

.middle-workspace-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* Lead Sidebar */
.lead-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 30px;
  text-transform: uppercase;
}

.lead-badge.high-intent {
  background: var(--blue-950);
  color: var(--blue-500);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.lead-profile {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--green-500) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: var(--bg-app);
}

.profile-details h4 {
  font-size: 16px;
  font-weight: 600;
}

.profile-details .sub {
  font-size: 12px;
  color: var(--fg-secondary);
}

.campaign-lbl {
  font-size: 11px;
  color: var(--amber-500);
  background: rgba(245, 158, 11, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.lead-metadata {
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  margin-bottom: 24px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}

.meta-row .lbl {
  color: var(--fg-muted);
}

.meta-row .val {
  font-weight: 500;
}

.phone-input-field {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--green-400);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  text-align: right;
  width: 150px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input-field:focus {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}


.label-certified {
  background: rgba(34, 197, 94, 0.08);
  color: var(--green-500);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

/* Active Dialer Component */
.phone-dialer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.dialer-status {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

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

.status-indicator.icon-idle {
  background-color: var(--fg-muted);
}

.status-indicator.icon-dialing {
  background-color: var(--amber-500);
  box-shadow: 0 0 8px var(--amber-500);
  animation: pulse-glow 1.5s infinite;
}

.status-indicator.icon-connected {
  background-color: var(--green-500);
  box-shadow: 0 0 8px var(--green-500);
  animation: pulse-glow 1.5s infinite;
}

.status-text {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
  flex: 1;
  margin-left: 10px;
}

.call-timer {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-secondary);
}

.dialer-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dial-btn {
  width: 100%;
  border: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.dial-btn.start-call {
  background: var(--green-500);
  color: var(--bg-app);
}

.dial-btn.start-call:hover:not(.disabled) {
  background: var(--green-600);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}

.dial-btn.stop-call {
  background: var(--red-500);
  color: var(--fg-primary);
}

.dial-btn.stop-call:hover:not(.disabled) {
  background: var(--red-600);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

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

.dial-btn.mute-call {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-primary);
  border: 1px solid var(--border-color);
}

.dial-btn.mute-call:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.dial-btn.mute-call.muted-active {
  background: var(--amber-500) !important;
  color: #000000 !important;
  border-color: var(--amber-500) !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35) !important;
}

/* Column 2: Dialogue & Transcript */
.main-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
}

.audio-waveform-container {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.wf-bar {
  width: 3px;
  height: 3px;
  background: var(--fg-muted);
  border-radius: 30px;
  transition: height 0.08s ease;
}

.wf-bar.agent-bar {
  background: var(--green-500);
}

.wf-bar.prospect-bar {
  background: var(--blue-500);
}

.transcript-wrapper {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 16px;
}

.transcript-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  color: var(--fg-muted);
}

.pulse-radar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  animation: rotate-radar 12s linear infinite;
}

.empty-state p {
  font-size: 13px;
  max-width: 320px;
  line-height: 1.5;
}

/* Speech bubbles styling */
.speech-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
  position: relative;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.speech-bubble.agent {
  align-self: flex-end;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.12);
  color: var(--fg-primary);
  border-bottom-right-radius: 2px;
}

.speech-bubble.prospect {
  align-self: flex-start;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.12);
  color: var(--fg-primary);
  border-bottom-left-radius: 2px;
}

.speech-bubble .speaker-meta {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.speech-bubble.agent .speaker-meta {
  color: var(--green-500);
}

.speech-bubble.prospect .speaker-meta {
  color: var(--blue-500);
}

.speech-bubble.system-log {
  align-self: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  padding: 8px 16px;
  border-radius: 30px;
}

/* Wrap up panel styling */
.wrap-up-panel {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 12px;
  animation: slideUp 0.4s ease;
}

.wrap-up-panel h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.disposition-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.disp-opt {
  padding: 10px 4px;
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.disp-opt.btn-neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-secondary);
}

.disp-opt.btn-neutral:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg-primary);
}

.disp-opt.btn-warn {
  background: rgba(239, 68, 68, 0.08);
  color: var(--red-500);
}

.disp-opt.btn-warn:hover {
  background: var(--red-500);
  color: var(--bg-app);
}

.disp-opt.btn-success {
  background: rgba(34, 197, 94, 0.08);
  color: var(--green-500);
}

.disp-opt.btn-success:hover {
  background: var(--green-500);
  color: var(--bg-app);
}

/* Column 3: Live Coaching Desk */
.ai-coaching-sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.coaching-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.coaching-mode-badge {
  font-size: 11px;
  color: var(--green-500);
  background: var(--green-950);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.coaching-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
}

.coaching-idle-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--fg-muted);
  max-width: 300px;
  margin: 24px auto 0;
  padding: 18px 22px;
  background: rgba(22, 22, 28, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.ai-orb-icon {
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.15);
  animation: float-slow 4s ease-in-out infinite;
}

.coaching-idle-state h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-primary);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.coaching-idle-state p {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 0;
}

/* Live Coaching Alert Card */
.ai-coaching-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.15);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.04);
  border-radius: 12px;
  padding: 16px;
  align-self: stretch;
  animation: slideLeft var(--transition-normal) forwards;
}

.ai-coaching-card.battlecard-theme {
  border-color: rgba(245, 158, 11, 0.2);
}

.ai-coaching-card.coaching-theme {
  border-color: rgba(59, 130, 246, 0.2);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.alert-type-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-500);
}

.ai-coaching-card.coaching-theme .alert-type-pill {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-500);
}

.card-time {
  font-size: 10px;
  color: var(--fg-muted);
}

.coaching-theme {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 12px;
}

.coaching-bullet-points {
  list-style: none;
  margin-bottom: 16px;
}

.coaching-bullet-points li {
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
  padding-left: 14px;
  position: relative;
}

.coaching-bullet-points li::before {
  content: "→";
  color: var(--amber-500);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.ai-coaching-card.coaching-theme .coaching-bullet-points li::before {
  color: var(--blue-500);
}

.coaching-action-block {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--amber-500);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
}

.ai-coaching-card.coaching-theme .coaching-action-block {
  border-left-color: var(--blue-500);
}

.action-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 4px;
}

.coaching-action-block p {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-primary);
  line-height: 1.4;
}

/* Tab 2: Analytics Performance Layout */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-lbl {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-val {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-delta {
  font-size: 11px;
  color: var(--fg-secondary);
}

.text-green { color: var(--green-500); }
.text-blue { color: var(--blue-500); }
.text-amber { color: var(--amber-500); }
.text-red { color: var(--red-500); }

/* Charts Area */
.analytics-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  margin-bottom: 24px;
}

.chart-container {
  min-height: 300px;
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--fg-secondary);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sw-green::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-500);
}

.sw-gray::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neutral-500);
}

.chart-content {
  margin-top: 10px;
}

.analytics-svg {
  width: 100%;
  height: 220px;
}

.chart-txt {
  fill: var(--fg-muted);
  font-size: 8px;
  font-family: var(--font-mono);
}

/* Heatmap OBJECTION PANEL */
.heatmap-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.hm-row {
  display: flex;
  align-items: center;
  font-size: 13px;
}

.hm-lbl {
  width: 130px;
  color: var(--fg-secondary);
}

.hm-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 30px;
  margin: 0 15px;
  overflow: hidden;
}

.hm-fill {
  height: 100%;
  display: block;
  border-radius: 30px;
  width: 0; /* Animated dynamically or custom setting */
}

.hm-fill.green { background: var(--green-500); }
.hm-fill.blue { background: var(--blue-500); }
.hm-fill.amber { background: var(--amber-500); }
.hm-fill.red { background: var(--red-500); }

.hm-val {
  font-family: var(--font-mono);
  font-weight: 600;
  width: 35px;
  text-align: right;
}

/* Table styling */
.full-table-card {
  padding: 0;
  overflow: hidden;
}

.full-table-card .card-header {
  padding: 20px;
  margin-bottom: 0;
}

.table-wrapper {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.analytics-table th, .analytics-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.analytics-table th {
  color: var(--fg-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.01);
}

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

.outcome-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  white-space: nowrap;
}

.outcome-badge.demo {
  background: var(--green-950);
  color: var(--green-500);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.outcome-badge.connected {
  background: var(--blue-950);
  color: var(--blue-500);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.outcome-badge.voicemail,
.outcome-badge.badge-voicemail {
  background: rgba(234,179,8,0.10);
  color: hsl(38,92%,50%);
  border: 1px solid rgba(234,179,8,0.22);
}

.outcome-badge.badge-no-answer {
  background: rgba(255,255,255,0.05);
  color: var(--fg-muted);
  border: 1px solid var(--border-color);
}

body.light-theme .outcome-badge.voicemail,
body.light-theme .outcome-badge.badge-voicemail {
  background: rgba(234,179,8,0.08);
  color: hsl(38,80%,38%);
  border-color: rgba(234,179,8,0.22);
}
body.light-theme .outcome-badge.badge-no-answer {
  background: rgba(0,0,0,0.04);
  color: var(--fg-muted);
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .outcome-badge.demo {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.20);
}
body.light-theme .outcome-badge.connected {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.20);
}

/* ── Analytics Center redesign ───────────────────────────────────────────── */

/* KPI row */
.an-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.an-kpi-card {
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
}
/* Subtle accent glow bleeding from the top-left */
.an-kpi-card::before {
  content: '';
  position: absolute;
  top: -40%; left: -10%;
  width: 160px; height: 160px;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.16;
  pointer-events: none;
}
.an-kpi-card--green::before { background: hsl(142, 76%, 45%); }
.an-kpi-card--blue::before  { background: hsl(217, 91%, 60%); }

.an-kpi-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.an-kpi-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.an-kpi-icon--green { background: hsla(142,76%,45%,0.14); color: hsl(142,76%,50%); }
.an-kpi-icon--blue  { background: hsla(217,91%,60%,0.14); color: hsl(217,91%,62%); }

.an-kpi-pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 4px;
}
.an-kpi-pill--up    { background: hsla(142,76%,45%,0.12); color: hsl(142,76%,50%); }
.an-kpi-pill--down  { background: hsla(346,80%,55%,0.12); color: hsl(346,80%,60%); }
.an-kpi-pill--clean { background: hsla(142,76%,45%,0.10); color: hsl(142,76%,50%); }

.an-kpi-val {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--fg-primary);
  position: relative; z-index: 1;
}
.an-kpi-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-secondary);
  position: relative; z-index: 1;
}
.an-kpi-sub {
  font-size: 11.5px;
  color: var(--fg-muted);
  margin-top: 2px;
  position: relative; z-index: 1;
}

/* Big window */
.an-window {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0;
}
.an-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.an-tabs {
  display: flex;
  gap: 4px;
}
.an-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16,1,0.3,1);
  font-family: var(--font-sans);
}
.an-tab:hover { background: rgba(255,255,255,0.04); color: var(--fg-primary); }
.an-tab.active {
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.25);
  color: hsl(217,91%,60%);
}
.an-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.an-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  min-width: 32px;
  text-align: center;
}

/* Panels */
.an-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* Overview: left col (chart + themes) | right col (heatmap) */
#an-panel-0 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* Left column */
.an-left-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 0;
}

/* Chart block — grows to fill left column */
.an-chart-block {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border-color);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.an-chart-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}
.an-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.an-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--fg-muted);
}
.an-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
#an-connect-chart {
  width: 100% !important;
  height: 100% !important;
}

/* Qualitative themes — sits below chart at natural height */
.an-themes-block {
  padding: 14px 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.an-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.an-theme-list { display: flex; flex-direction: column; gap: 13px; }
.an-theme-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-primary);
}
.an-theme-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.an-theme-label { font-weight: 500; color: var(--fg-secondary); }
.an-theme-pct { font-weight: 700; color: var(--fg-primary); font-size: 13px; }
.an-theme-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.an-theme-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Heatmap — right column, cells stretch to fill height */
.an-heatmap-block {
  padding: 14px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.an-hm-grid { display: flex; gap: 8px; flex: 1; min-height: 0; }
.an-hm-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: var(--fg-muted);
  flex-shrink: 0;
  width: 28px;
  min-height: 0;
}
.an-hm-labels span { flex: 1; display: flex; align-items: center; min-height: 0; }
.an-hm-cells { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; }
.an-hm-row {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  min-height: 0;
}
.an-hm-cell {
  border-radius: 5px;
  background: hsl(142, 60%, 42%);
  opacity: calc(var(--i) * 0.9 + 0.06);
  min-height: 12px;
  transition: transform 0.18s cubic-bezier(0.16,1,0.3,1), box-shadow 0.18s;
  cursor: default;
}
.an-hm-cell:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 1.5px hsla(142,76%,55%,0.6), 0 4px 12px rgba(0,0,0,0.4);
  opacity: calc(var(--i) * 0.9 + 0.2);
}

/* Heatmap intensity legend */
.an-hm-legend {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--fg-muted);
}
.an-hm-swatch {
  width: 13px; height: 13px; border-radius: 3px;
  background: hsl(142, 60%, 42%);
  opacity: calc(var(--i) * 0.9 + 0.06);
}
.an-hm-hours {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-top: 5px;
  padding-left: 36px; /* 28px labels + 8px gap */
}
.an-hm-hours span {
  font-size: 9px;
  color: var(--fg-muted);
  text-align: center;
}

/* Light mode overrides */
body.light-theme .an-tab:hover { background: rgba(0,0,0,0.04); }
body.light-theme .an-tab.active {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.20);
  color: hsl(217,91%,45%);
}
body.light-theme .an-hm-cell {
  opacity: calc(var(--i) * 0.85 + 0.08);
}
body.light-theme .an-theme-bar { background: rgba(0,0,0,0.06); }

/* ── Recent Conversations List ───────────────────────────────────────────── */
.conv-col-labels {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255,255,255,0.01);
  flex-shrink: 0;
}

.conv-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.conv-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s cubic-bezier(0.16,1,0.3,1);
}
.conv-row:last-child { border-bottom: none; }
.conv-row:hover { background: rgba(255,255,255,0.025); }

.conv-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.conv-name {
  font-size: 13px;
  font-weight: 600;
  color: hsl(217,91%,60%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.conv-row:hover .conv-name { color: hsl(142,76%,45%); }

.conv-company {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Light-mode overrides */
body.light-theme .conv-col-labels { background: rgba(0,0,0,0.015); }
body.light-theme .conv-row { border-bottom-color: rgba(0,0,0,0.05); }
body.light-theme .conv-row:hover { background: rgba(59,130,246,0.03); }
body.light-theme .outcome-badge.voicemail {
  background: rgba(0,0,0,0.05);
  color: var(--fg-secondary);
}

/* Tab 3: Workflow Designer & Editor */
.workflow-builder-layout {
  display: block; /* We manage via sub-views now */
}

#workflows-list-view, #workflows-editor-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#workflows-list-view .full-table-card, #workflows-editor-view .full-table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin-bottom: 0 !important;
}

.workflow-builder-editor-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  padding: 20px;
  min-height: 0;
}

.workflow-left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* Thin custom scrollbar for the workflow panels (left panel + builder/history panes) */
.workflow-left-panel,
#wf-pane-builder,
#wf-pane-history {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.workflow-left-panel::-webkit-scrollbar,
#wf-pane-builder::-webkit-scrollbar,
#wf-pane-history::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.workflow-left-panel::-webkit-scrollbar-track,
#wf-pane-builder::-webkit-scrollbar-track,
#wf-pane-history::-webkit-scrollbar-track {
  background: transparent;
}
.workflow-left-panel::-webkit-scrollbar-thumb,
#wf-pane-builder::-webkit-scrollbar-thumb,
#wf-pane-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.workflow-left-panel::-webkit-scrollbar-thumb:hover,
#wf-pane-builder::-webkit-scrollbar-thumb:hover,
#wf-pane-history::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
  background-clip: content-box;
}

.visual-canvas {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Directory Cards View */
.workflows-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.workflow-card {
  background: rgba(22, 22, 28, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(16px);
  transition: all var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.workflow-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-500), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.workflow-card:hover {
  background: rgba(30, 30, 38, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.workflow-card:hover::before {
  opacity: 1;
}

.workflow-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  width: 100%;
}

.workflow-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-primary);
  margin-right: 12px;
}

.workflow-card-trigger {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.workflow-card-trigger-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.workflow-card-trigger-indicator.voicemail {
  background: var(--amber-500);
  box-shadow: 0 0 6px var(--amber-500);
}
.workflow-card-trigger-indicator.declined {
  background: var(--red-500);
  box-shadow: 0 0 6px var(--red-500);
}

.workflow-card-steps-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.workflow-card-step-badge {
  font-size: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.workflow-card-step-arrow {
  color: var(--fg-muted);
  font-size: 10px;
}

.workflow-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
  margin-top: auto;
  width: 100%;
}

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

.workflow-delete-btn {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.workflow-delete-btn:hover {
  color: var(--red-500);
  background: rgba(239, 68, 68, 0.05);
}

/* Beautiful Custom Switch Toggles */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--fg-muted);
  transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--green-950);
  border-color: var(--green-500);
}

input:checked + .slider:before {
  transform: translateX(16px);
  background-color: var(--green-500);
}

/* Editor UI Grid & Left sidebar */
.workflow-radio-label input[type="radio"] {
  accent-color: var(--blue-500);
}

.workflow-radio-label:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.workflow-radio-label:has(input:checked) {
  border-color: var(--blue-500) !important;
  background: rgba(59, 130, 246, 0.04) !important;
}

.workflow-add-btn {
  transition: all var(--transition-fast) !important;
}

.workflow-add-btn:hover {
  border-color: var(--blue-500) !important;
  background: rgba(59, 130, 246, 0.04) !important;
  transform: translateY(-1px);
}

/* Canvas Nodes */
.canvas-node {
  background: rgba(22, 22, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 20px;
  border-radius: 10px;
  min-width: 280px;
  max-width: 320px;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.canvas-node:hover {
  background: rgba(30, 30, 38, 0.85);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.canvas-node.selected {
  border-color: var(--blue-500) !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

.canvas-node.start {
  border-color: var(--green-500);
  background: rgba(34, 197, 94, 0.03);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.08);
  cursor: default;
}

.canvas-node.start:hover {
  transform: none;
  background: rgba(34, 197, 94, 0.03);
  border-color: var(--green-500);
}

.canvas-node.action-node {
  border-left: 4px solid var(--border-color);
}

.canvas-node.action-node.sms-type { border-left-color: rgb(168, 85, 247); }
.canvas-node.action-node.email-type { border-left-color: var(--green-500); }
.canvas-node.action-node.retry-type { border-left-color: var(--blue-500); }
.canvas-node.action-node.wait-type { border-left-color: var(--amber-500); }
.canvas-node.action-node.if-type { border-left-color: var(--red-500); }

.canvas-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.canvas-node-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-primary);
}

.canvas-node-summary {
  font-size: 10px;
  color: var(--fg-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.canvas-node-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.canvas-node-btn {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.canvas-node-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-primary);
}

.canvas-node-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-500);
  font-size: 12px;
}

.canvas-arrow {
  width: 2px;
  height: 32px;
  background: linear-gradient(180deg, var(--border-color), rgba(255, 255, 255, 0.04));
  position: relative;
  margin: 4px 0;
}

.canvas-arrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -3px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.1);
}

.canvas-end-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  margin-top: 4px;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.04);
}

.badge {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge.sms { background: rgba(168, 85, 247, 0.1); color: rgb(168, 85, 247); }
.badge.crm { background: rgba(59, 130, 246, 0.1); color: var(--blue-500); }
.badge.email { background: rgba(34, 197, 94, 0.1); color: var(--green-500); }
.badge.delay { background: rgba(245, 158, 11, 0.1); color: var(--amber-500); }
.badge.task { background: rgba(239, 68, 68, 0.1); color: var(--red-500); }

/* Toast Signal speed-to-lead notification */
.inbound-webhook-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--amber-500);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  animation: slideLeft var(--transition-normal) forwards;
  max-width: 480px;
}

.inbound-webhook-toast.hidden {
  display: none !important;
}

.toast-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber-500);
}

.toast-indicator.pulse {
  box-shadow: 0 0 10px var(--amber-500);
  animation: pulse-glow 1s infinite;
}

.toast-body h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber-500);
  margin-bottom: 4px;
}

.toast-body p {
  font-size: 11px;
  color: var(--fg-secondary);
  margin-bottom: 6px;
}

.toast-lead-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-primary);
}

.toast-action {
  background: var(--amber-500);
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--bg-app);
  transition: var(--transition-fast);
}

.toast-action:hover {
  background: var(--amber-600);
}

/* General Layout Footer */
.app-footer {
  height: 40px;
  background: rgba(10, 10, 12, 0.3);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  font-size: 11px;
  color: var(--fg-muted);
}

.app-footer strong {
  color: var(--fg-secondary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rotate-radar {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float-slow {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

/* Hide helper class */
.hidden {
  display: none !important;
}

/* Pacing Dialer Modes Switcher */
.dialer-mode-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 12px;
}

.mode-lbl {
  font-size: 11px;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
  font-weight: 600;
}

.mode-switch-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border-color);
}

.mode-switch-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.mode-switch-btn:hover {
  color: var(--fg-primary);
}

.mode-switch-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-primary);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Predictive parallel dialing layout */
.predictive-grid {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 15px;
  animation: fadeIn var(--transition-normal);
}

.pacing-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  padding-bottom: 6px;
}

.pacing-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  transition: border-color var(--transition-fast);
}

.pacing-line:hover {
  border-color: rgba(255,255,255,0.08);
}

.line-info {
  display: flex;
  flex-direction: column;
}

.line-num {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--fg-muted);
}

.line-name {
  font-weight: 600;
  color: var(--fg-primary);
}

.line-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.line-status.status-ringing {
  background: rgba(245, 158, 11, 0.08);
  color: var(--amber-500);
}

.line-status.status-voicemail {
  background: rgba(239, 68, 68, 0.08);
  color: var(--red-500);
}

.line-status.status-connected {
  background: rgba(34, 197, 94, 0.08);
  color: var(--green-500);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
  animation: pulse-glow 1.5s infinite;
}

/* Pacing Telemetry */
.pacing-telemetry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
  margin-top: 12px;
}

.tel-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tel-cell .lbl {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  text-transform: uppercase;
}

.tel-cell .val {
  font-size: 13px;
  font-weight: 700;
}

.font-sm {
  font-size: 12px !important;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: rgba(22, 22, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

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

.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--fg-primary); }

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.form-row input,
.form-row select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--blue-500);
}

.form-row select option { background: #1a1a22; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Lead Details Modal (LDM) ────────────────────────────────────────────── */
.ldm-card {
  position: relative; width: 97vw; max-width: 1240px;
  background: rgba(18, 18, 24, 0.97); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; backdrop-filter: blur(24px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden; animation: fadeScaleIn 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes fadeScaleIn { from { opacity:0; transform: scale(0.97) translateY(6px); } to { opacity:1; transform: scale(1) translateY(0); } }

.ldm-close {
  position: absolute; top: 14px; right: 16px; z-index: 10;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted); transition: all 0.15s;
}
.ldm-close:hover { background: rgba(255,255,255,0.1); color: var(--fg-primary); }

/* Hero */
.ldm-hero {
  display: flex; align-items: center; gap: 20px;
  padding: 26px 28px 22px; border-bottom: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, rgba(34,197,94,0.03) 100%);
}
.ldm-avatar {
  width: 68px; height: 68px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, hsl(217,91%,50%) 0%, hsl(142,76%,38%) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; overflow: hidden;
  box-shadow: 0 6px 20px rgba(59,130,246,0.3);
}
.ldm-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.ldm-hero-info { flex: 1; min-width: 0; }
.ldm-hero-name { font-size: 22px; font-weight: 800; color: var(--fg-primary); line-height: 1.15; }
.ldm-hero-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ldm-dot { color: rgba(255,255,255,0.2); font-size: 14px; }
.ldm-status-badge {
  flex-shrink: 0; padding: 5px 13px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(59,130,246,0.12); color: hsl(217,91%,60%); border: 1px solid rgba(59,130,246,0.2);
}

/* Body */
.ldm-body {
  display: grid; grid-template-columns: 300px 1fr;
  height: 68vh; overflow: hidden;
}
.ldm-left {
  padding: 14px 16px; border-right: 1px solid rgba(255,255,255,0.05);
  overflow-y: auto; display: flex; flex-direction: column; gap: 0;
}
.ldm-right {
  display: flex; flex-direction: column; overflow: hidden;
}

/* Section labels */
.ldm-section-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--fg-muted); margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ldm-section-label + .ldm-section-label,
.ldm-field-grid + .ldm-section-label { margin-top: 14px; }

/* Field grid */
.ldm-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 0; }
.ldm-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: hidden; }
.ldm-field label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--fg-muted);
}
.ldm-input {
  height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04); color: var(--fg-primary);
  padding: 0 10px; font-size: 12.5px; font-family: inherit; outline: none;
  transition: border-color 0.15s, background 0.15s; width: 100%; box-sizing: border-box;
}
.ldm-input:focus { border-color: rgba(59,130,246,0.4); background: rgba(59,130,246,0.04); }
.ldm-mono { font-family: var(--font-mono); }
.ldm-select { cursor: pointer; appearance: none; }
.ldm-select option { background: #16161c; }

.ldm-save-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 38px; margin-top: 18px; border-radius: 9px; border: none;
  background: hsl(217,91%,60%); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.ldm-save-btn:hover { background: hsl(217,91%,68%); transform: translateY(-1px); }

/* Tab bar */
.ldm-tabs {
  display: flex; gap: 2px; padding: 14px 18px 0; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.ldm-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 8px 8px 0 0; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s;
  background: transparent; color: var(--fg-muted); position: relative; bottom: -1px;
  border-bottom: 2px solid transparent;
}
.ldm-tab:hover { color: var(--fg-primary); }
.ldm-tab.active { color: hsl(217,91%,60%); border-bottom-color: hsl(217,91%,60%); }
.ldm-tab-badge {
  background: rgba(59,130,246,0.2); color: hsl(217,91%,70%);
  border-radius: 20px; padding: 0 5px; font-size: 9px; font-weight: 700;
  display: none;
}
.ldm-tab-badge:not(:empty) { display: inline; }

/* Tab panels */
.ldm-tab-panel { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.ldm-tab-panel.active { display: flex; }

.ldm-scroll-list {
  flex: 1; overflow-y: auto; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.ldm-input-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 18px 14px; border-top: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.ldm-bar-input {
  flex: 1; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04); color: var(--fg-primary);
  padding: 0 11px; font-size: 12.5px; outline: none; transition: border-color 0.15s;
  font-family: inherit;
}
.ldm-bar-input:focus { border-color: rgba(59,130,246,0.35); }
.ldm-bar-input::placeholder { color: var(--fg-muted); }
.ldm-bar-btn {
  height: 34px; padding: 0 14px; border-radius: 8px; border: none;
  background: hsl(217,91%,60%); color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background 0.15s; flex-shrink: 0;
}
.ldm-bar-btn:hover { background: hsl(217,91%,68%); }

/* ── Activity Timeline ───────────────────────────────────── */
.ldm-act-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.ldm-act-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--fg-muted);
}
.ldm-act-filters { display: flex; gap: 4px; }
.ldm-act-filter {
  padding: 3px 10px; border-radius: 20px; border: 1px solid transparent;
  font-size: 10.5px; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,0.04); color: var(--fg-muted);
  transition: all 0.15s cubic-bezier(0.16,1,0.3,1);
}
.ldm-act-filter.active {
  background: rgba(59,130,246,0.15); color: hsl(217,91%,60%);
  border-color: rgba(59,130,246,0.25);
}
.ldm-act-filter:not(.active):hover { background: rgba(255,255,255,0.07); color: var(--fg-secondary); }

/* Feed items */
.act-item {
  display: flex; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  border-left: 3px solid transparent;
  animation: fadeIn 0.15s ease; transition: background 0.1s;
}
.act-item:hover { background: rgba(255,255,255,0.02); }
.act-item.act-task  { border-left-color: rgba(249,115,22,0.3); }
.act-item.act-call-pos { border-left-color: rgba(34,197,94,0.3); }
.act-item.act-call-neg { border-left-color: rgba(239,68,68,0.25); }

/* Notes use chat-message layout — tighter spacing, no separator */
.act-item.act-note {
  padding: 5px 14px; border-bottom: none; border-left: none;
  align-items: flex-start;
}
.act-item.act-note:first-child { padding-top: 10px; }
.act-item.act-note + .act-item:not(.act-note),
.act-item:not(.act-note) + .act-item.act-note { padding-top: 10px; }
.act-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.act-icon-note  { background: rgba(59,130,246,0.12);  color: hsl(217,91%,60%); }
.act-icon-call-pos { background: rgba(34,197,94,0.12);  color: hsl(142,76%,45%); }
.act-icon-call-neg { background: rgba(239,68,68,0.10);  color: hsl(346,80%,55%); }
.act-icon-call-neu { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.act-icon-task     { background: rgba(249,115,22,0.10); color: hsl(38,92%,50%); }
.act-icon-task-done { background: rgba(34,197,94,0.08); color: hsl(142,76%,42%); }
.act-body { flex: 1; min-width: 0; }
.act-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; margin-bottom: 3px; flex-wrap: wrap;
}
.act-author { font-weight: 700; color: var(--fg-primary); }
.act-type-badge {
  padding: 2px 7px; border-radius: 10px; font-size: 9.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 3px;
}
.act-badge-note      { background: rgba(59,130,246,0.12); color: hsl(217,91%,60%); }
.act-badge-call      { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.act-badge-task      { background: rgba(249,115,22,0.12); color: hsl(38,92%,50%); }
.act-badge-task-call { background: rgba(34,197,94,0.10);  color: hsl(142,76%,45%); }
.act-time { color: var(--fg-muted); font-size: 10px; margin-left: auto; white-space: nowrap; }
.act-edit-btn, .act-del-btn {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  font-size: 11px; opacity: 0; transition: opacity 0.15s; flex-shrink: 0;
  border-radius: 4px;
}
.act-item:hover .act-edit-btn { opacity: 1; color: var(--fg-muted); }
.act-item:hover .act-del-btn  { opacity: 1; color: var(--fg-muted); }
.act-edit-btn:hover { color: hsl(217,91%,60%) !important; background: rgba(59,130,246,0.08); }
.act-del-btn:hover  { color: hsl(346,80%,55%) !important; background: rgba(239,68,68,0.08); }
.act-content { font-size: 12.5px; color: var(--fg-primary); line-height: 1.45; word-break: break-word; }
.act-content.done { text-decoration: line-through; color: var(--fg-muted); opacity: 0.6; }
.act-sub {
  font-size: 11px; color: var(--fg-muted); margin-top: 4px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.act-check-btn {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,0.18);
  background: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.act-check-btn:hover { border-color: rgba(255,255,255,0.35); }
.act-check-btn.checked { background: hsl(142,76%,45%); border-color: hsl(142,76%,45%); }
.act-check-btn.checked::after { content: '✓'; font-size: 9px; color: #000; font-weight: 800; }

/* Note bubble — chat message style matching the workspace notes panel */
.act-note-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, hsl(217,91%,50%) 0%, hsl(142,76%,38%) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff; overflow: hidden;
  box-shadow: 0 2px 8px rgba(59,130,246,0.2); margin-top: 2px;
}
.act-note-bubble {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8px 12px;
  border-radius: 3px 10px 10px 10px;
  font-size: 13px; color: var(--fg-primary);
  line-height: 1.5; word-break: break-word;
  margin-top: 2px;
}

/* Dial button on call-type tasks */
.act-dial-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px; border: 1px solid rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.08); color: hsl(142,76%,45%);
  font-size: 10.5px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; flex-shrink: 0; font-family: inherit;
}
.act-dial-btn:hover { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); }

/* Compose area — fixed height so switching note↔task never resizes the modal */
.ldm-compose {
  height: auto; flex-shrink: 0;
  max-height: 55%;
  border-top: 1px solid rgba(255,255,255,0.06);
  overflow: visible;
}
.ldm-compose.compose-hidden { display: none; }
.ldm-compose-panel {
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px;
}
.ldm-compose-panel.hidden { display: none; }
.ldm-compose-hint {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--fg-muted);
}
.ldm-compose-row { display: flex; gap: 6px; align-items: center; }

/* Task compose layout */
.ldm-task-title-input {
  flex: none !important; /* prevent ldm-bar-input flex:1 from eating the container */
  width: 100%; box-sizing: border-box;
}
/* Grid layout so nothing can overflow — columns: date | time | type | assignee | btn */
.ldm-task-meta-row {
  display: grid !important;
  grid-template-columns: 130px 108px 130px 1fr auto;
  gap: 6px; align-items: center;
}

/* Date field: hidden real input + styled display button */
.ldm-date-field {
  position: relative;
  min-width: 0;
}
.ldm-date-hidden {
  /* Kept in DOM so showPicker() works, but invisible */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  overflow: hidden;
  top: 0; left: 0;
}
.ldm-date-btn {
  height: 34px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg-muted);
  padding: 0 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s;
  box-sizing: border-box;
}
.ldm-date-btn:hover {
  border-color: rgba(59,130,246,0.4);
  color: var(--fg-primary);
}
.ldm-date-btn.has-date {
  color: var(--fg-primary);
  border-color: rgba(59,130,246,0.3);
}

.ldm-task-type-sel, .ldm-task-time-sel {
  height: 34px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg-primary); padding: 0 8px;
  font-size: 12px; font-family: inherit; outline: none;
  width: 100%; box-sizing: border-box;
  cursor: pointer;
}
.ldm-task-type-sel:focus, .ldm-task-time-sel:focus { border-color: rgba(59,130,246,0.4); }
.ldm-task-type-sel option, .ldm-task-time-sel option { background: #16161c; }
.ldm-task-type-sel option { background: #16161c; }
.ldm-task-assignee {
  height: 34px; min-width: 0; /* grid child, no overflow possible */
}
.ldm-add-task-btn { flex-shrink: 0; white-space: nowrap; }

.ldm-compose-cancel-btn {
  background: none; border: none; color: var(--fg-muted); cursor: pointer;
  font-size: 14px; padding: 0 4px; transition: color 0.15s; flex-shrink: 0;
}
.ldm-compose-cancel-btn:hover { color: hsl(346,80%,55%); }
.ldm-task-compose-row { display: flex; gap: 6px; align-items: center; }
.ldm-task-compose-row.hidden { display: none; }

/* ── Lead Queue Table action button ─────────────────────── */
.cta-btn.primary {
  background: var(--blue-500);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.cta-btn.primary:hover { opacity: 0.85; }

.cta-btn.secondary {
  background: rgba(255,255,255,0.06);
  color: var(--fg-primary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.cta-btn.secondary:hover { background: rgba(255,255,255,0.1); }

.text-muted { color: var(--fg-muted); }

code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ── Login Screen ────────────────────────────────────────── */
/* ── Login Page ──────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #0a0b0d;
  z-index: 2000;
  overflow: auto;
}
.login-overlay.hidden { display: none; }

/* Two-column auth layout: form on the left, branded panel on the right. */
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #0a0b0d;
}
.auth-form-inner { width: 100%; max-width: 380px; }

.login-card {
  position: relative;
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.auth-field { margin-bottom: 16px; }
.auth-field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 7px;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.auth-field input:focus {
  border-color: hsl(142, 76%, 45%);
  background: rgba(255, 255, 255, 0.05);
}
.auth-field input::placeholder { color: rgba(255, 255, 255, 0.3); }

.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-pw { position: relative; }
.auth-pw input { padding-right: 42px; }
.auth-pw-toggle {
  position: absolute;
  right: 4px;
  top: 0;
  height: 44px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: color 0.15s;
}
.auth-pw-toggle:hover { color: #fff; }

.auth-visual-side {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 25% 15%, rgba(34, 197, 94, 0.18), transparent 50%),
    linear-gradient(150deg, #0c2117 0%, #0a0b0d 65%);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}
.auth-visual-inner { text-align: left; padding: 0 64px; max-width: 540px; }
.auth-visual-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: hsl(142, 76%, 55%);
  margin-bottom: 22px;
}
.auth-visual-headline {
  font-size: 40px;
  line-height: 1.18;
  font-weight: 800;
  color: #fff;
  margin: 0 0 22px;
  min-height: 96px;
}
.auth-visual-sub {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  max-width: 440px;
}
.auth-cursor { color: hsl(142, 76%, 55%); animation: authBlink 1s step-end infinite; }
@keyframes authBlink { 50% { opacity: 0; } }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual-side { display: none; }
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.login-heading {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin: 0 0 6px;
}

.login-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin: 0 0 28px;
}

/* Floating label fields */
.fl-field {
  position: relative;
  margin-bottom: 28px;
}
.fl-field input {
  display: block;
  width: 100%;
  padding: 11px 0;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.fl-field input:focus {
  border-bottom-color: hsl(142, 76%, 50%);
}
.fl-field label {
  position: absolute;
  top: 11px;
  left: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.fl-field input:focus ~ label,
.fl-field input:not(:placeholder-shown) ~ label {
  top: -14px;
  font-size: 10px;
  color: hsl(142, 76%, 55%);
  letter-spacing: 0.03em;
}

.login-forgot {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  text-align: right;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.login-forgot:hover { color: rgba(255,255,255,0.75); }

.login-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  background: hsl(142, 76%, 38%);
  border: none;
  border-radius: 11px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-bottom: 18px;
  box-shadow: 0 4px 24px rgba(34, 197, 94, 0.25);
}
.login-submit-btn:hover {
  background: hsl(142, 76%, 44%);
  transform: translateY(-1px);
}
.login-submit-btn:active { transform: translateY(0); }
.login-arrow { transition: transform 0.2s; }
.login-submit-btn:hover .login-arrow { transform: translateX(4px); }

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: hsl(346, 80%, 65%);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-register-link {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-top: 20px;
}
.login-register-link a {
  color: hsl(142, 76%, 55%);
  text-decoration: none;
  font-weight: 600;
}
.login-register-link a:hover { text-decoration: underline; }

.login-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
}
.login-or-divider::before,
.login-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* ══ Sidebar Redesign ══════════════════════════════════════ */

/* Mode tabs */
.sb-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 14px 14px 10px;
  flex-shrink: 0;
}
.sb-tabs--3 { grid-template-columns: 1fr 1fr 1fr; }

.sb-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
}
.sb-tab.active {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.35);
  color: hsl(217,91%,70%);
}

/* Mode description badge under tabs */
.sb-mode-badge {
  flex-shrink: 0;
  margin: 0 14px 2px;
  padding: 7px 10px;
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.14);
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--fg-muted);
}

/* Scrollable dialer body */
#dialer-panel-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 8px;
}
#dialer-panel-body::-webkit-scrollbar { width: 4px; }
#dialer-panel-body::-webkit-scrollbar-track { background: transparent; }
#dialer-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* Queue strategy description text */
.sb-strategy-desc {
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 4px 0 0;
}

/* Scrollable section blocks */
.sb-section {
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sb-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

/* Pacing toggle */
.sb-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.sb-toggle {
  padding: 7px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
}
.sb-toggle.active {
  background: rgba(59,130,246,0.18);
  color: hsl(217,91%,70%);
}

/* Search field */
.sb-search-wrap { position: relative; }
.sb-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
  color: var(--fg-primary);
}
.sb-search-input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 32px !important;
  height: 38px;
  border-radius: 9px;
  font-size: 13px;
}

/* ── Active Lead Card ── */
.alc {
  margin: 10px 14px 0;
  background: rgba(22, 22, 28, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  backdrop-filter: blur(16px);
  overflow: hidden;
}
/* Preview mode: card is the hero, slightly elevated */
.alc--preview {
  margin: 12px 14px 0;
  border-color: rgba(59,130,246,0.25);
  background: rgba(15, 20, 35, 0.7);
}

/* Preview search + nav stacked together */
.preview-search-wrap {
  position: relative;
  margin-bottom: 8px;
}
.preview-search-input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 32px !important;
  height: 36px;
  border-radius: 9px;
  font-size: 13px;
}

/* Preview mode nav row */
.preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 6px 10px;
}
.preview-nav-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
  letter-spacing: 0.05em;
}
.preview-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.preview-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}
.preview-nav-btn--disabled,
.preview-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
/* ── Clickable area: header + meta ── */
.alc-clickable {
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16,1,0.3,1);
  border-radius: 16px 16px 0 0;
}
.alc-clickable:hover {
  background: rgba(59,130,246,0.06);
}
.alc-clickable:active {
  background: rgba(59,130,246,0.1);
}

/* ── View-profile hint icon (top-right corner, fades in on hover) ── */
.alc-view-hint {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(59,130,246,0);
  color: rgba(255,255,255,0);
  transition: background 0.18s, color 0.18s;
  align-self: flex-start;
}
.alc-clickable:hover .alc-view-hint {
  background: rgba(59,130,246,0.15);
  color: hsl(217,91%,60%);
}

/* ── Avatar (larger, rounded square like modal) ── */
.alc-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  flex-shrink: 0;
}

.alc-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
}
.alc-identity { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.alc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}
.alc-company {
  font-size: 11.5px;
  font-weight: 600;
  color: hsl(217,91%,60%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.alc-email {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--fg-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 11px 0 2px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.alc-meta-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.alc-meta-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-muted);
}
.alc-meta-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alc-status-val {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: hsl(217,91%,60%);
}
.alc-signal-label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(142,76%,45%);
  white-space: nowrap;
}
.alc-signal-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Phone row — not part of clickable area ── */
.alc-phone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 13px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.alc-phone-input {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
  padding: 5px 8px !important;
  height: 34px !important;
}

/* Pacing panel inner */
.pacing-inner {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px 14px;
}

/* Cold calling */
.cold-algo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ── Pinned Footer ── */
.sb-footer {
  flex-shrink: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(16,16,20,0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sb-status-bar {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Three-button control row: [mute] [launch — grows] [end] */
.sb-controls {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 8px;
}

.sb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 11px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  height: 46px;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
}
.sb-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Mute — neutral square */
.sb-btn--mute {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--fg-primary);
  flex-direction: column;
  font-size: 10px;
  gap: 3px;
}
.sb-btn--mute:hover:not(.disabled) {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.16);
}
.sb-btn--mute.muted-active {
  background: hsl(38,92%,50%) !important;
  border-color: hsl(38,92%,50%) !important;
  color: #000 !important;
  box-shadow: 0 4px 14px rgba(245,158,11,0.35) !important;
}

/* Launch — green primary */
.sb-btn--launch {
  background: hsl(142,76%,45%);
  color: #000;
}
.sb-btn--launch:hover:not(.disabled) {
  background: hsl(142,76%,38%);
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}

/* End — red danger */
.sb-btn--end {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: hsl(346,80%,65%);
  flex-direction: column;
  font-size: 10px;
  gap: 3px;
}
.sb-btn--end:hover:not(.disabled) {
  background: hsl(346,80%,55%);
  border-color: hsl(346,80%,55%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}

/* Keep old panel-section/section-label alive for other tabs that still use them */
.panel-section {
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.lead-select-dropdown {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 9px 36px 9px 12px;
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.lead-select-dropdown:focus { border-color: var(--blue-500); }
.lead-select-dropdown option { background: #1a1a22; }

/* CSV Mapping Dropdowns & Sample Lines */
.csv-mapping-select {
  padding: 8px 12px;
  background: rgba(0,0,0,0.3) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px;
  color: var(--fg-primary) !important;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}
.csv-mapping-select:focus {
  border-color: var(--blue-500) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.csv-mapping-select option {
  background: #121218;
  color: var(--fg-primary);
  padding: 8px;
}
.csv-mapping-select:hover {
  background: rgba(255,255,255,0.02) !important;
  border-color: rgba(255,255,255,0.15) !important;
}
body.light-theme .csv-mapping-select {
  background: rgba(255,255,255,0.8) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  color: var(--fg-primary) !important;
}
body.light-theme .csv-mapping-select option {
  background: #ffffff;
  color: #000000;
}
body.light-theme .csv-mapping-select:hover {
  background: rgba(0,0,0,0.02) !important;
}

.csv-row-sample {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  opacity: 0.8;
  padding: 2px 0;
  display: block;
}

/* ── Active Lead Card ────────────────────────────────────── */
.active-lead-card {
  margin: 10px 14px 0;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-profile-row .profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(217,91%,50%), hsl(142,76%,35%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.lead-profile-row .profile-details h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--fg-primary);
}

.lead-profile-row .profile-details .sub {
  font-size: 11px;
  color: var(--fg-muted);
  margin: 0 0 4px;
}

.crm-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(59,130,246,0.12);
  color: hsl(217,91%,65%);
  border: 1px solid rgba(59,130,246,0.2);
}

.lead-phone-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-phone-row .phone-input-field {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--fg-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.lead-phone-row .phone-input-field:focus { border-color: var(--blue-500); }

/* ── Call Intelligence ───────────────────────────────────── */
.call-intel-block {
  margin: 10px 16px 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
}

.ci-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ci-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.ci-lbl {
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}

.ci-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-primary);
  text-align: right;
}

.signal-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 6px;
}

.signal-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green-500);
  transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
}

/* ── Cold Calling Panel ──────────────────────────────────── */
.cold-algo-card {
  margin: 12px 14px 0;
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
}

.strategy-btn {
  background: none;
  border: none;
  color: var(--fg-muted) !important;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.strategy-btn:hover {
  color: var(--fg-primary) !important;
  background: rgba(255, 255, 255, 0.04);
}
.strategy-btn.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--blue-500) !important;
}
body.light-theme .strategy-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}
body.light-theme .strategy-btn.active {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--blue-600) !important;
}

.priority-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: hsl(38, 92%, 50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.priority-tag:hover {
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}
body.light-theme .priority-tag {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(239, 68, 68, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.cold-algo-desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin: 0 0 12px;
}

.cold-queue-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 10px;
}

.cold-queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.cold-queue-row:hover { background: rgba(255,255,255,0.07); }

.cq-rank {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  flex-shrink: 0;
}

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

.cq-info strong { font-size: 12px; color: var(--fg-primary); }
.cq-info span   { font-size: 10px; color: var(--fg-muted); }

.cq-prob {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Dialer Bottom ───────────────────────────────────────── */
/* .dialer-bottom legacy — replaced by .sb-footer */

/* ── Settings Layout ─────────────────────────────────────── */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  /* Bound the single row to the panel height so content scrolls INSIDE its
     column instead of overflowing and being clipped by the tab panel. */
  grid-template-rows: minmax(0, 1fr);
  gap: 32px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 1920px;
  /* Center within the flex-column tab panel WITHOUT auto margins, which would
     otherwise shrink-wrap the grid to its content and shift the sidebar. */
  align-self: center;
}

.settings-sidebar {
  background: rgba(22,22,28,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.settings-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.settings-nav-group:last-child { border-bottom: none; padding-bottom: 0; }

.settings-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 6px 10px 4px;
}

.settings-nav-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 13px;
  font-family: var(--font-sans);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-nav-item:hover  { background: rgba(255,255,255,0.05); color: var(--fg-primary); }
.settings-nav-item.active { background: rgba(59,130,246,0.12); color: hsl(217,91%,65%); font-weight: 600; }

/* ── Settings Content ────────────────────────────────────── */
.settings-content {
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  align-self: stretch;
  /* Framed container so each section is visually confined and scrolls within
     its own bounds rather than running off the screen. */
  background: rgba(22, 22, 28, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 28px 30px;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}
.settings-content::-webkit-scrollbar-track {
  background: transparent;
}
.settings-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.settings-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.settings-section { display: none; }
.settings-section.active { display: block; }

.settings-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.settings-subtitle {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.settings-section-header {
  margin-bottom: 24px;
}

.settings-card {
  background: rgba(22,22,28,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.settings-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--fg-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-input:focus {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}


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

.settings-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.settings-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.settings-save-btn {
  background: hsl(217,91%,60%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.settings-save-btn:hover { opacity: 0.85; }

.settings-link-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: hsl(217,91%,60%);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.profile-upload-zone {
  width: 100%;
  border: 1.5px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--fg-primary);
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.profile-upload-zone:hover {
  border-color: hsl(217,91%,60%);
  background: rgba(96,165,250,0.06);
}
body.light-theme .profile-upload-zone {
  border-color: rgba(0,0,0,0.18);
}
body.light-theme .profile-upload-zone:hover {
  border-color: hsl(217,91%,60%);
  background: rgba(96,165,250,0.06);
}

.settings-delete-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: hsl(346,80%,60%);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-delete-btn:hover { background: rgba(239,68,68,0.2); }

/* ── Members List ────────────────────────────────────────── */
.members-list { display: flex; flex-direction: column; gap: 10px; }

.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

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

.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(217,91%,50%), hsl(142,76%,35%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.member-info strong { font-size: 14px; display: block; }
.member-info span   { font-size: 12px; color: var(--fg-muted); }

.member-role-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.member-role-badge.admin   { background: rgba(59,130,246,0.12); color: hsl(217,91%,65%); border: 1px solid rgba(59,130,246,0.2); }
.member-role-badge.manager { background: rgba(168,85,247,0.12); color: hsl(270,80%,72%);  border: 1px solid rgba(168,85,247,0.2); }
.member-role-badge.agent   { background: rgba(255,255,255,0.05); color: var(--fg-muted);  border: 1px solid rgba(255,255,255,0.08); }

/* ── Email Connection Wizard ─────────────────────────────── */
.email-wizard-card {
  background: rgba(14, 14, 20, 0.97);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  position: relative;
}
.ewiz-step { padding: 28px 32px 24px; }
.ewiz-step.hidden { display: none !important; }

.ewiz-close-btn {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--fg-muted);
  font-size: 16px; cursor: pointer; padding: 4px 8px; line-height: 1;
  border-radius: 6px; transition: background .15s;
}
.ewiz-close-btn:hover { background: rgba(255,255,255,0.07); color: var(--fg-primary); }

.ewiz-title { font-size: 20px; font-weight: 700; color: var(--fg-primary); margin: 0 0 16px; }
.ewiz-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 14px 0; }
.ewiz-feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ewiz-feature-list li { font-size: 13px; color: var(--fg-secondary); display: flex; align-items: center; gap: 8px; }
.ewiz-check { color: hsl(142,76%,45%); font-size: 15px; }

.ewiz-provider-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.ewiz-provider-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  width: 100%; text-align: left;
}
.ewiz-provider-row:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); }
.ewiz-provider-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(66,133,244,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ewiz-provider-info { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.ewiz-provider-sub  { font-size: 11px; color: var(--fg-muted); }
.ewiz-provider-name { font-size: 14px; font-weight: 700; color: var(--fg-primary); }
.ewiz-arrow { color: var(--fg-muted); flex-shrink: 0; }

.ewiz-nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.ewiz-back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--fg-muted);
  font-size: 12px; cursor: pointer; padding: 4px 0;
  transition: color .15s;
}
.ewiz-back-btn:hover { color: var(--fg-primary); }

.ewiz-provider-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.ewiz-ph-name { font-size: 17px; font-weight: 700; color: var(--fg-primary); margin: 0; }
.ewiz-ph-sub  { font-size: 12px; color: var(--fg-muted); margin: 2px 0 0; }

.ewiz-method-label {
  font-size: 13px; font-weight: 600; color: hsl(217,91%,60%);
  text-align: center; margin: 0 0 14px;
}
.ewiz-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ewiz-method-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 18px 16px;
  cursor: pointer; text-align: left;
  transition: border-color .18s, background .18s;
  position: relative;
}
.ewiz-method-card:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }
.ewiz-method-card h4 { font-size: 14px; font-weight: 700; color: hsl(217,91%,65%); margin: 0 0 12px; }
.ewiz-method-recommended {
  background: hsl(217,80%,42%);
  border-color: hsl(217,80%,50%);
}
.ewiz-method-recommended:hover { background: hsl(217,80%,46%); }
.ewiz-method-recommended h4 { color: #fff; }
.ewiz-method-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.ewiz-method-features li { font-size: 12px; color: rgba(255,255,255,0.75); display: flex; align-items: flex-start; gap: 7px; line-height: 1.4; }
.ewiz-feat-ok   { color: hsl(142,76%,55%); flex-shrink: 0; }
.ewiz-feat-warn { color: hsl(38,92%,55%); flex-shrink: 0; }
.ewiz-recommended-badge {
  display: inline-block; margin-top: 14px;
  background: hsl(142,60%,28%); color: hsl(142,76%,65%);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}

.ewiz-oauth-info {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 16px; margin-bottom: 24px;
}

.ewiz-smtp-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.ewiz-field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ewiz-field label { font-size: 11px; font-weight: 600; color: var(--fg-secondary); text-transform: uppercase; letter-spacing: .06em; }
.ewiz-field .settings-input { width: 100%; box-sizing: border-box; }
.ewiz-field-row { display: flex; gap: 10px; }
.ewiz-info-tip {
  background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.15);
  border-radius: 8px; padding: 12px 14px;
  font-size: 12px; color: var(--fg-secondary); line-height: 1.6;
}
.ewiz-info-tip strong { color: var(--fg-primary); }
.ewiz-ssl-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-secondary); cursor: pointer; }

.ewiz-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06);
}

/* Light theme overrides for wizard */
body.light-theme .email-wizard-card { background: rgba(255,255,255,0.98); border-color: rgba(0,0,0,0.1); }
body.light-theme .ewiz-provider-row { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
body.light-theme .ewiz-provider-row:hover { background: rgba(0,0,0,0.04); }
body.light-theme .ewiz-method-card { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
body.light-theme .ewiz-info-tip { background: rgba(59,130,246,0.05); }
body.light-theme .ewiz-provider-name, body.light-theme .ewiz-ph-name { color: #1a1a2e; }
body.light-theme .ewiz-method-features li { color: rgba(0,0,0,0.65); }

/* ── Allocation Matrix Select ────────────────────────────── */
.alloc-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 9px 32px 9px 12px;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--fg-primary);
  background-color: rgba(22, 22, 28, 0.65);
  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='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}
.alloc-select:hover  { border-color: rgba(255,255,255,0.2); }
.alloc-select:focus  { border-color: hsl(217,91%,60%); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.alloc-select option { background: #1a1a22; color: var(--fg-primary); }

body.light-theme .alloc-select {
  background-color: rgba(255,255,255,0.85);
  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='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  border-color: rgba(0,0,0,0.12);
  color: #1a1a2e;
}
body.light-theme .alloc-select option { background: #ffffff; color: #1a1a2e; }

/* ── Labels & Items ──────────────────────────────────────── */
.settings-items-list { display: flex; flex-direction: column; gap: 10px; }

.settings-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(22,22,28,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.settings-item-row > div strong { font-size: 14px; display: block; margin-bottom: 2px; }
.settings-item-row > div span   { font-size: 12px; color: var(--fg-muted); }

.sentiment-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: capitalize;
  flex-shrink: 0;
}
.sentiment-badge.positive { background: rgba(34,197,94,0.1); color: hsl(142,76%,45%); border: 1px solid rgba(34,197,94,0.2); }
.sentiment-badge.negative { background: rgba(239,68,68,0.1); color: hsl(346,80%,55%); border: 1px solid rgba(239,68,68,0.2); }
.sentiment-badge.neutral  { background: rgba(255,255,255,0.05); color: var(--fg-muted); border: 1px solid rgba(255,255,255,0.08); }

.ai-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg-muted);
  flex-shrink: 0;
}
.ai-badge.on { background: rgba(59,130,246,0.1); color: hsl(217,91%,65%); border-color: rgba(59,130,246,0.2); }

/* ── Textarea for AI training ────────────────────────────── */
.form-row textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px;
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.form-row textarea:focus { border-color: var(--blue-500); }

/* ── Settings — Missing base classes ────────────────────── */
.settings-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 16px;
}

.settings-hint {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 6px;
}

.settings-msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 12px;
}
.settings-msg.success { background: rgba(34,197,94,0.1); color: hsl(142,76%,45%); }
.settings-msg.error   { background: rgba(239,68,68,0.1);  color: hsl(346,80%,55%); }

.settings-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--fg-muted);
}

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

.settings-toolbar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-section-header {
  margin-bottom: 24px;
}
.settings-section-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}
.settings-section-header p {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  max-width: 640px;
  line-height: 1.55;
}

/* ── Member Invite Row — stacked properly ────────────────── */
.member-invite-row {
  display: grid;
  grid-template-columns: 1fr 140px 1fr auto;
  gap: 10px;
  align-items: center;
}

.member-invite-row input,
.member-invite-row select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 9px 36px 9px 12px;
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.member-invite-row input:focus,
.member-invite-row select:focus { border-color: var(--blue-500); }
.member-invite-row select option { background: #1a1a22; }

/* ── Settings Items List ─────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(22,22,28,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.settings-list-item .item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-list-item .item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
}

.settings-list-item .item-desc {
  font-size: 12px;
  color: var(--fg-muted);
}

.settings-list-item .item-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: hsl(142,76%,40%); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }

/* ── Member Invite Grid ──────────────────────────────────── */
.member-invite-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Member Tag Pills ────────────────────────────────────── */
.member-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.member-tag-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(59,130,246,0.1);
  color: hsl(217,91%,65%);
  border: 1px solid rgba(59,130,246,0.2);
}

/* ── Profile Menu & Dropdown Pop-up ─────────────────────────────────────── */
.profile-menu-container {
  position: relative;
  display: inline-block;
}

.header-profile-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--green-500) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--bg-app);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.header-profile-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.profile-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 240px;
  background: hsl(240, 10%, 8%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  animation: slideDown var(--transition-fast) forwards;
}

.profile-dropdown.hidden {
  display: none !important;
}

.dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropdown-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
  font-weight: 600;
}

.theme-switch-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.theme-btn {
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.theme-btn:hover {
  color: var(--fg-primary);
  background: rgba(255, 255, 255, 0.05);
}

.theme-btn.active {
  background: hsl(217, 91%, 60%);
  color: #ffffff;
  font-weight: 600;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.dropdown-item {
  background: transparent;
  border: none;
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg-primary);
}

.dropdown-item.logout {
  background: rgba(239, 68, 68, 0.04);
  color: var(--red-500);
  margin-top: 4px;
}

.dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-500);
}

.dropdown-icon {
  opacity: 0.7;
}

.dropdown-item:hover .dropdown-icon {
  opacity: 1;
}

/* ── Fullscreen Settings view ───────────────────────────────────────────── */
body.settings-active .app-header {
  display: none !important;
}

body.settings-active .app-container {
  padding: 0;
  max-width: 100vw;
  margin: 0;
  height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

body.settings-active #tab-settings {
  height: 100%;
  border-radius: 0;
  margin: 0;
  padding: 44px 40px 32px;
  background: var(--bg-app);
  box-sizing: border-box;
}

body.settings-active .settings-layout {
  height: 100%;
}

/* Remove clunky native spinner arrow buttons from default opportunity value field */
#pref-opportunity-value::-webkit-inner-spin-button,
#pref-opportunity-value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#pref-opportunity-value {
  -moz-appearance: textfield;
}

/* ── Carousel Swiper & Shared Calendar Styles ────────────────────── */
.agent-notes-panel {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
  overflow: hidden;
}

/* Notes/Tasks tab bar */
.notes-tab-bar {
  display: inline-flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 3px;
}
.notes-tab-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 7px; border: none;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  background: none; color: var(--fg-muted);
}
.notes-tab-btn:hover:not(.active) { background: rgba(255,255,255,0.05); color: var(--fg-primary); }
.notes-tab-btn.active { background: rgba(255,255,255,0.10); color: var(--fg-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }

/* ── Task composer (compact chip layout) ───────────────────────────────────── */
.task-create-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(22, 22, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  margin-top: 4px;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-create-card:focus-within { border-color: hsla(217, 91%, 60%, 0.28); }

/* Title row — borderless inline input, the card itself is the field */
.task-compose-title-row {
  display: flex; align-items: center; gap: 9px;
}
.task-compose-title-icon { flex-shrink: 0; color: var(--fg-muted); opacity: 0.5; }
.task-compose-title-row:focus-within .task-compose-title-icon {
  color: hsl(217, 91%, 60%); opacity: 0.9;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-create-input {
  flex: 1; min-width: 0; height: 26px;
  background: transparent; border: none; outline: none;
  color: var(--fg-primary); font-size: 13px; font-family: inherit;
  padding: 0;
}
.task-create-input::placeholder { color: var(--fg-muted); }

.task-compose-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 -14px;
}

/* Chip row — wraps to fit narrow columns */
.task-chip-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.task-chip-spacer { flex: 1; min-width: 4px; }

.task-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0; overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-chip:hover,
.task-chip:focus-within {
  background: hsla(217, 91%, 60%, 0.08);
  border-color: hsla(217, 91%, 60%, 0.3);
}
.task-chip:hover .task-chip-icon,
.task-chip:focus-within .task-chip-icon { color: hsl(217, 91%, 60%); opacity: 1; }

.task-chip--assignee { max-width: 150px; }

.task-chip-icon {
  flex-shrink: 0; color: var(--fg-muted); opacity: 0.55;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-chip-caret { flex-shrink: 0; color: var(--fg-muted); opacity: 0.45; pointer-events: none; }

.task-chip-select {
  min-width: 0; max-width: 110px;
  background: transparent; border: none; outline: none;
  color: var(--fg-secondary); font-size: 11.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; appearance: none; padding: 0;
  text-overflow: ellipsis;
}
.task-chip-select option { background: #16161c; color: var(--fg-secondary); }

/* Hidden native date input + chip display button */
.task-date-hidden {
  position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0;
}
.task-date-btn {
  min-width: 0; background: transparent; border: none; outline: none;
  color: var(--fg-secondary); font-size: 11.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-align: left; padding: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 90px;
}

/* Chips that hold a value glow blue */
.task-chip.has-value {
  background: hsla(217, 91%, 60%, 0.1);
  border-color: hsla(217, 91%, 60%, 0.28);
}
.task-chip.has-value .task-chip-icon,
.task-chip.has-value .task-date-btn,
.task-chip.has-value .task-chip-select,
.task-chip.has-value #task-time-display,
.task-chip.has-value #task-agent-display { color: hsl(217, 91%, 60%); opacity: 1; }

/* Custom chip dropdowns (time + agent) — fixed so they escape overflow:hidden ancestors */
.ws-chip-dropdown {
  display: none;
  position: fixed;
  z-index: 9999;
  min-width: 150px;
  background: rgba(22, 22, 28, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: wsDropIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.ws-chip-dropdown.open { display: block; }

@keyframes wsDropIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Time dropdown — fixed height with custom scrollbar */
.ws-chip-dropdown--time {
  min-width: 140px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ws-chip-dropdown--time::-webkit-scrollbar { width: 4px; }
.ws-chip-dropdown--time::-webkit-scrollbar-track { background: transparent; }
.ws-chip-dropdown--time::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15); border-radius: 2px;
}

/* Agent dropdown */
.ws-chip-dropdown--agent {
  min-width: 200px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ws-chip-dropdown--agent::-webkit-scrollbar { width: 4px; }
.ws-chip-dropdown--agent::-webkit-scrollbar-track { background: transparent; }
.ws-chip-dropdown--agent::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15); border-radius: 2px;
}

/* Shared item style */
.ws-chip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: background 0.14s cubic-bezier(0.16, 1, 0.3, 1), color 0.14s;
  white-space: nowrap;
  user-select: none;
}
.ws-chip-item:hover { background: rgba(255,255,255,0.06); color: var(--fg-primary); }
.ws-chip-item.selected { color: hsl(217, 91%, 60%); }
.ws-chip-item.selected:hover { background: hsla(217, 91%, 60%, 0.08); }

/* Time items — centered text */
.ws-chip-dropdown--time .ws-chip-item {
  justify-content: center;
  padding: 9px 24px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Agent avatar circle */
.ws-agent-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}
.ws-agent-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.ws-agent-avatar--clear {
  background: rgba(255,255,255,0.08);
  color: var(--fg-muted);
  font-size: 15px; font-weight: 400;
}

.ws-chip-item .ws-check-icon {
  margin-left: auto;
  color: hsl(217, 91%, 60%);
  flex-shrink: 0;
}
.ws-chip-item em { font-style: normal; color: var(--fg-muted); font-size: 11px; }

/* ── Date dropdown — custom calendar ─────────────────────────────────── */
.ws-chip-dropdown--date {
  width: 268px;
  padding: 12px;
}
.ws-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ws-cal-title {
  font-size: 13.5px; font-weight: 700; color: var(--fg-primary);
  letter-spacing: 0.01em;
}
.ws-cal-nav {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.05); color: var(--fg-secondary);
  transition: background 0.16s cubic-bezier(0.16,1,0.3,1), color 0.16s;
}
.ws-cal-nav:hover { background: hsla(217,91%,60%,0.14); color: hsl(217,91%,60%); }
.ws-cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.ws-cal-dow span {
  text-align: center; font-size: 10.5px; font-weight: 600;
  color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 0;
}
.ws-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.ws-cal-cell {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; color: var(--fg-secondary);
  border-radius: 8px; cursor: pointer;
  transition: background 0.14s cubic-bezier(0.16,1,0.3,1), color 0.14s;
}
.ws-cal-cell:hover:not(.ws-cal-empty) { background: rgba(255,255,255,0.07); color: var(--fg-primary); }
.ws-cal-empty { cursor: default; }
.ws-cal-cell.today {
  color: hsl(217,91%,60%); font-weight: 700;
  box-shadow: inset 0 0 0 1px hsla(217,91%,60%,0.4);
}
.ws-cal-cell.selected {
  background: hsl(217,91%,55%); color: #fff; font-weight: 700;
  box-shadow: none;
}
.ws-cal-cell.selected:hover { background: hsl(217,91%,55%); color: #fff; }
.ws-cal-foot {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; justify-content: flex-end;
}
.ws-cal-clear {
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg-secondary); font-size: 11.5px; font-weight: 600; font-family: inherit;
  transition: background 0.16s cubic-bezier(0.16,1,0.3,1), color 0.16s;
}
.ws-cal-clear:hover { background: hsla(346,80%,55%,0.14); color: hsl(346,80%,60%); border-color: hsla(346,80%,55%,0.3); }

/* Segmented type toggle — one capsule, two halves */
.task-type-group {
  display: flex; flex-shrink: 0;
  height: 28px; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
.task-type-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 7px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); color: var(--fg-muted);
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Inside the segmented capsule, halves are borderless */
.task-type-group .task-type-btn { border: none; border-radius: 0; padding: 0 10px; background: transparent; }
.task-type-btn:hover { color: var(--fg-primary); }
.task-type-btn.active { background: hsla(217, 91%, 60%, 0.16); color: hsl(217, 91%, 60%); border-color: hsla(217, 91%, 60%, 0.25); }
.task-type-btn.active-call { background: hsla(142, 76%, 45%, 0.14); color: hsl(142, 76%, 45%); border-color: hsla(142, 76%, 45%, 0.25); }

/* Inline edit fields (task-item edit mode, rendered from app.js) */
.task-field-wrap {
  display: flex; align-items: center; gap: 7px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px; padding: 0 11px; height: 32px; min-width: 0; overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-field-wrap:focus-within { border-color: hsla(217, 91%, 60%, 0.4); }
.task-field-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--fg-secondary); font-size: 12px; font-family: inherit;
}
.task-field-select { cursor: pointer; appearance: none; }
.task-field-select option { background: #16161c; }

/* Edit-mode title input keeps a visible field box (composer title is borderless) */
.task-item .task-create-input {
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px; padding: 0 12px;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-item .task-create-input:focus { border-color: hsla(217, 91%, 60%, 0.4); }

/* Submit */
.task-add-btn {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: 28px; padding: 0 13px; border-radius: 14px; border: none;
  background: hsl(217, 91%, 60%); color: #fff;
  font-size: 11.5px; font-weight: 700; cursor: pointer;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.task-add-btn:hover {
  background: hsl(217, 91%, 68%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px hsla(217, 91%, 60%, 0.35);
}
.task-add-btn:active { transform: translateY(0); box-shadow: none; }

/* ── Task list items ──────────────────────────────────────────────────────── */
.task-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-left: 3px solid rgba(59,130,246,0.3);
  transition: all 0.15s ease; position: relative;
}
.task-item:hover { background: rgba(255,255,255,0.04); border-left-color: rgba(59,130,246,0.6); }
.task-item.type-call { border-left-color: rgba(34,197,94,0.35); }
.task-item.type-call:hover { border-left-color: rgba(34,197,94,0.7); }
.task-item.overdue { border-left-color: hsl(38,92%,50%); background: rgba(249,115,22,0.03); }
.task-item.done { opacity: 0.4; border-left-color: rgba(255,255,255,0.1) !important; }
.task-item.done .task-item-title { text-decoration: line-through; color: var(--fg-muted); }

.task-check {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,0.18);
  background: transparent; cursor: pointer; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s cubic-bezier(0.16,1,0.3,1);
}
.task-check:hover { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.08); }
.task-check.checked { background: hsl(142,76%,45%); border-color: hsl(142,76%,45%); }

.task-item-body { flex: 1; min-width: 0; }
.task-item-title {
  font-size: 12.5px; font-weight: 600; color: var(--fg-primary);
  line-height: 1.35; margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.task-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 6px; border-radius: 20px; display: flex; align-items: center; gap: 3px;
}
.task-badge.call { background: rgba(34,197,94,0.10); color: hsl(142,76%,45%); border: 1px solid rgba(34,197,94,0.2); }
.task-badge.task { background: rgba(59,130,246,0.10); color: hsl(217,91%,60%); border: 1px solid rgba(59,130,246,0.2); }

.task-due-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--fg-muted);
}
.task-due-label.overdue { color: hsl(38,92%,50%); }
.task-due-label.today { color: hsl(142,76%,45%); }

.task-assignee { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--fg-muted); }
.task-assignee-pic {
  width: 16px; height: 16px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--green-500) 100%);
  display: flex; align-items: center; justify-content: center; font-size: 7px; font-weight: 700; color: #fff;
}

.task-edit-btn, .task-del-btn {
  background: none; border: none; cursor: pointer; padding: 3px 5px;
  font-size: 11px; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; border-radius: 4px;
  color: var(--fg-muted);
}
.task-item:hover .task-edit-btn,
.task-item:hover .task-del-btn { opacity: 0.45; }
.task-edit-btn:hover { opacity: 1 !important; color: hsl(217,91%,60%); background: rgba(59,130,246,0.1); }
.task-del-btn:hover  { opacity: 1 !important; color: hsl(346,80%,55%); background: rgba(239,68,68,0.1); }

.task-save-btn {
  padding: 3px 10px; border-radius: 6px; border: none;
  background: hsl(217,91%,60%); color: #fff; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.task-save-btn:hover { background: hsl(217,91%,68%); }
.task-cancel-btn {
  padding: 3px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); color: var(--fg-muted); font-size: 11px;
  cursor: pointer; transition: all 0.15s;
}
.task-cancel-btn:hover { background: rgba(255,255,255,0.09); color: var(--fg-primary); }

/* Right-panel tab nav */
.rp-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  background: none;
  color: var(--fg-muted);
}

.rp-tab-btn.rp-tab-active {
  background: rgba(255, 255, 255, 0.10);
  color: var(--fg-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.rp-tab-btn:hover:not(.rp-tab-active) {
  color: var(--fg-primary);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .rp-tab-nav {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .rp-tab-btn {
  color: var(--fg-muted);
}

body.light-theme .rp-tab-btn.rp-tab-active {
  background: hsl(217, 91%, 60%);
  color: #ffffff;
  box-shadow: 0 1px 6px rgba(59, 130, 246, 0.35);
}

body.light-theme .rp-tab-btn:hover:not(.rp-tab-active) {
  background: rgba(0, 0, 0, 0.05);
  color: var(--fg-primary);
}

/* ── Outreach composer (SMS / Email) ───────────────────────────────────── */

/* Segmented SMS/Email switcher */
.outreach-seg {
  display: flex; gap: 4px; flex-shrink: 0;
  margin-bottom: 14px; padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.outreach-seg-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 4px; border: none; border-radius: 8px;
  background: transparent; color: var(--fg-muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.outreach-seg-btn:hover:not(.active) { background: rgba(255,255,255,0.05); color: var(--fg-primary); }
.outreach-seg-btn.active {
  background: hsla(217, 91%, 60%, 0.16);
  color: hsl(217, 91%, 60%);
}

/* Panel column */
.outreach-panel {
  flex: 1; min-height: 0; min-width: 0;
  flex-direction: column; gap: 12px;
  overflow-y: auto; overflow-x: hidden;
}

/* Routing card — To / From / Subject share one glass card with row dividers */
.outreach-route-card {
  flex-shrink: 0;
  width: 100%; max-width: 100%; box-sizing: border-box;
  display: flex; flex-direction: column;
  background: rgba(22, 22, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.outreach-route-card:focus-within { border-color: hsla(217, 91%, 60%, 0.28); }

.outreach-route-row {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 13px; min-width: 0;
  overflow: hidden;
}
.outreach-route-lbl {
  flex-shrink: 0; width: 46px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.outreach-route-div {
  height: 1px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 13px;
}
.outreach-route-input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: none; outline: none;
  color: var(--fg-primary); font-size: 12.5px; font-family: inherit;
  padding: 0;
}
.outreach-route-input::placeholder { color: var(--fg-muted); opacity: 0.7; }
.outreach-route-input--mono { font-family: 'SF Mono', ui-monospace, monospace; font-size: 12px; }
.outreach-route-select {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--fg-primary); font-size: 12.5px; font-family: inherit;
  cursor: pointer; appearance: none; padding: 0 6px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.outreach-route-select option { background: #16161c; color: var(--fg-secondary); }
.outreach-route-caret { flex-shrink: 0; color: var(--fg-muted); opacity: 0.5; pointer-events: none; }
/* When the select is enhanced into a custom dropdown (which has its own arrow),
   hide the original row chevron so there aren't two carets. */
.outreach-route-row .cs-wrapper ~ .outreach-route-caret { display: none; }

/* Message card — textarea + footer with hint and counter */
.outreach-msg-card {
  flex: 1; min-height: 120px;
  display: flex; flex-direction: column;
  background: rgba(22, 22, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.outreach-msg-card:focus-within { border-color: hsla(217, 91%, 60%, 0.28); }
.outreach-msg-input {
  flex: 1; min-height: 80px;
  padding: 12px 13px;
  background: transparent; border: none; outline: none;
  color: var(--fg-primary); font-size: 12.5px; line-height: 1.55;
  font-family: inherit; resize: none;
}
.outreach-msg-input::placeholder { color: var(--fg-muted); opacity: 0.7; }
.outreach-msg-foot {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.outreach-msg-hint {
  font-size: 10px; color: var(--fg-muted); opacity: 0.65;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.outreach-char-count {
  flex-shrink: 0; margin-left: auto;
  font-size: 10.5px; font-weight: 600; color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.outreach-char-count.over { color: hsl(38, 92%, 55%); }

/* Send button */
.outreach-send-btn {
  flex-shrink: 0; width: 100%; height: 38px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 10px;
  background: hsl(217, 91%, 60%); color: #fff;
  font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.outreach-send-btn:hover {
  background: hsl(217, 91%, 66%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px hsla(217, 91%, 60%, 0.35);
}
.outreach-send-btn:active { transform: translateY(0); box-shadow: none; }

.agent-swipe-viewport {
  width: 100% !important;
  overflow: hidden !important;
  position: relative !important;
  display: block !important;
  flex: 1;
  min-height: 0;
}

.agent-swipe-wrapper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  flex-shrink: 0 !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.swipe-slide {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
  height: 100% !important;
  display: flex;
  flex-direction: column;
}

.nav-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-arrow-btn:hover:not(.disabled) {
  background: rgba(255,255,255,0.08);
  color: var(--fg-primary);
  transform: scale(1.05);
}
.nav-arrow-btn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.calendar-days-strip::-webkit-scrollbar {
  display: none;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.calendar-grid-header-day {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 4px 0;
}

.calendar-grid-day-card {
  aspect-ratio: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.calendar-grid-day-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--fg-primary);
}

.calendar-grid-day-card.active {
  background: var(--blue-500) !important;
  color: #ffffff !important;
  border-color: var(--blue-500) !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.calendar-grid-day-card.other-month {
  opacity: 0.25;
}

.calendar-grid-day-card.today {
  border-color: var(--green-500) !important;
  color: var(--green-400);
}

.calendar-day-dot {
  width: 4px;
  height: 4px;
  background-color: var(--green-500);
  border-radius: 50%;
  position: absolute;
  bottom: 4px;
}
.calendar-grid-day-card.active .calendar-day-dot {
  background-color: hsl(142, 76%, 55%);
  box-shadow: 0 0 5px hsl(142, 76%, 45%);
}

.event-timeline-card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--blue-500);
  border-radius: 8px;
  position: relative;
  gap: 4px;
  transition: all 0.2s ease;
}
.event-timeline-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.event-timeline-card.other-agent-event {
  border-left-color: var(--green-500);
}
.event-timeline-card .event-time-badge {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--blue-500);
  background: rgba(59, 130, 246, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}
.event-timeline-card.other-agent-event .event-time-badge {
  color: var(--green-500);
  background: rgba(34, 197, 94, 0.08);
}
.event-timeline-card .event-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-top: 2px;
}
.event-timeline-card .event-desc {
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.3;
}
.event-timeline-card .event-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--fg-muted);
  margin-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.03);
  padding-top: 4px;
}
.event-timeline-card .event-creator-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--fg-muted);
}
.event-timeline-card .event-creator-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(217,91%,50%), hsl(142,76%,35%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  color: #fff;
}
.event-timeline-card .delete-event-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--red-500);
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.15s;
  font-size: 14px;
  line-height: 1;
}
.event-timeline-card:hover .delete-event-btn {
  opacity: 0.8;
}

/* Light Theme Overrides */
body.light-theme .nav-arrow-btn {
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.08);
}
body.light-theme .nav-arrow-btn:hover:not(.disabled) {
  background: rgba(0,0,0,0.05);
}
body.light-theme .calendar-day-card {
  background: rgba(0, 0, 0, 0.015);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--fg-secondary);
}
body.light-theme .calendar-day-card:hover {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .event-timeline-card {
  background: rgba(0, 0, 0, 0.015);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--blue-500);
}
body.light-theme .event-timeline-card:hover {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .event-timeline-card.other-agent-event {
  border-left-color: var(--green-500);
}
body.light-theme .event-timeline-card .event-meta {
  border-top-color: rgba(0, 0, 0, 0.04);
}

/* ── Light / White Theme Styles & Color Palette ─────────────────────────── */
body.light-theme {
  --bg-app: hsl(240, 20%, 96%);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(34, 197, 94, 0.08);
  
  --fg-primary: hsl(240, 10%, 10%);
  --fg-secondary: hsl(240, 6%, 28%);
  --fg-muted: hsl(240, 5%, 48%);
}

/* Specific light-mode component overrides for high-contrast legibility */
body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .glass-card {
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.07) !important;
  border: 1px solid rgba(0,0,0,0.09) !important;
}
body.light-theme .glass-card:hover {
  border-color: rgba(0,0,0,0.13) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 8px 28px rgba(0,0,0,0.09) !important;
}

body.light-theme .phone-input-field,
body.light-theme .form-row input,
body.light-theme .form-row select,
body.light-theme .settings-input,
body.light-theme .settings-select,
body.light-theme textarea,
body.light-theme select {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: var(--fg-primary) !important;
}

body.light-theme .phone-input-field:focus,
body.light-theme .form-row input:focus,
body.light-theme .form-row select:focus,
body.light-theme .settings-input:focus,
body.light-theme .settings-select:focus,
body.light-theme textarea:focus {
  border-color: var(--blue-500) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

body.light-theme .modal-card {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.12) !important;
}

body.light-theme .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme #modal-notes-list,
body.light-theme #modal-calls-list,
body.light-theme #notes-canvas {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 12px !important;
}

body.light-theme #modal-notes-list > div > div:last-child > div:last-child,
body.light-theme #notes-canvas > div > div:last-child > div:last-child {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 4px 12px 12px 12px !important;
}

body.light-theme .clickable-lead,
body.light-theme .clickable-lead-name {
  color: var(--blue-600) !important;
}

body.light-theme .clickable-lead:hover,
body.light-theme .clickable-lead-name:hover {
  color: var(--green-600) !important;
}

body.light-theme .nav-btn {
  color: var(--fg-secondary) !important;
}

body.light-theme .nav-btn:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .nav-btn.active {
  background: var(--blue-500) !important;
  color: #ffffff !important;
}

body.light-theme .table-wrapper th,
body.light-theme .analytics-table th {
  background: rgba(0, 0, 0, 0.02) !important;
  color: var(--fg-secondary) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .table-wrapper td,
body.light-theme .analytics-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .settings-sidebar {
  background: rgba(0, 0, 0, 0.015) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .settings-nav-item {
  color: var(--fg-secondary) !important;
}

body.light-theme .settings-nav-item:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .settings-nav-item.active {
  background: var(--blue-500) !important;
  color: #ffffff !important;
}

body.light-theme .hud-box {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .dialer-line-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
}

body.light-theme .dialer-line-card.ringing {
  border-color: var(--blue-500) !important;
}

body.light-theme .dialer-line-card.connected {
  border-color: var(--green-500) !important;
}

body.light-theme .badge.label-certified {
  background: rgba(34, 197, 94, 0.08) !important;
  color: var(--green-600) !important;
  border: 1px solid rgba(34, 197, 94, 0.15) !important;
}

body.light-theme .badge.label-inbound {
  background: rgba(59, 130, 246, 0.08) !important;
  color: var(--blue-600) !important;
  border: 1px solid rgba(59, 130, 246, 0.15) !important;
}

body.light-theme #profile-dropdown-menu {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .theme-btn {
  background: rgba(0, 0, 0, 0.03) !important;
  color: var(--fg-secondary) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .theme-btn.active {
  background: var(--blue-500) !important;
  color: #ffffff !important;
}

body.light-theme .settings-hint {
  color: var(--fg-muted) !important;
}

body.light-theme .app-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

body.light-theme .active-lead-avatar {
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.15) !important;
}

body.light-theme .lead-stat-card {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

/* Settings Panels & Cards in Light Theme */
body.light-theme .settings-card {
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.09) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.07) !important;
}

body.light-theme .settings-item-row {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
}

body.light-theme .settings-list-item {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
}

body.light-theme .member-row {
  background: rgba(0, 0, 0, 0.015) !important;
  border: 1px solid var(--border-color) !important;
}

body.light-theme .settings-nav-group {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Cold Calling List Overrides in Light Theme */
body.light-theme .cold-queue-preview {
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .cold-queue-row {
  background: rgba(0, 0, 0, 0.025) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01) !important;
}

body.light-theme .cold-queue-row:hover {
  background: rgba(0, 0, 0, 0.055) !important;
  border-color: rgba(0, 0, 0, 0.09) !important;
}

body.light-theme .cq-rank {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--fg-secondary) !important;
}

body.light-theme .dial-btn.mute-call {
  background: rgba(0, 0, 0, 0.03) !important;
  color: var(--fg-primary) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .dial-btn.mute-call:hover:not(.disabled) {
  background: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .dial-btn.mute-call.muted-active {
  background: var(--amber-500) !important;
  color: #ffffff !important;
}

/* Custom Scrollable Time Picker Styles */
.custom-time-picker-item {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.custom-time-picker-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-primary);
}

.custom-time-picker-item.selected {
  background: var(--blue-500) !important;
  color: #ffffff !important;
}

body.light-theme .custom-dropdown-menu {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .custom-time-picker-item {
  color: var(--fg-secondary) !important;
}

body.light-theme .custom-time-picker-item:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: var(--fg-primary) !important;
}

body.light-theme .custom-time-picker-item.selected {
  background: var(--blue-500) !important;
  color: #ffffff !important;
}

/* Standalone My Calendar View Styles */
.my-calendar-large-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 30px repeat(6, 1fr);
  gap: 12px;
  height: 100%;
}

.my-calendar-grid-header-day {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  padding-bottom: 8px;
}

.my-calendar-grid-day-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-secondary);
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  padding: 10px;
  height: 100%;
  min-height: 0;
}

.my-calendar-grid-day-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--fg-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.my-calendar-grid-day-card.active {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--blue-400) !important;
  border-color: var(--blue-500) !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.25);
}

.my-calendar-grid-day-card.today {
  border-color: var(--green-500) !important;
  background: rgba(34, 197, 94, 0.05);
  color: var(--green-400);
}

.my-calendar-grid-day-card.other-month {
  opacity: 0.2;
}

.my-calendar-day-dot {
  width: 6px;
  height: 6px;
  background-color: var(--green-500);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green-500);
  align-self: flex-end;
}

.my-calendar-grid-day-card.active .my-calendar-day-dot {
  background-color: hsl(142, 76%, 55%);
  box-shadow: 0 0 6px hsl(142, 76%, 45%);
}

/* Light theme overrides for My Calendar */
body.light-theme .my-calendar-grid-day-card {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  color: var(--fg-secondary) !important;
}

body.light-theme .my-calendar-grid-day-card:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--fg-primary) !important;
}

body.light-theme .my-calendar-grid-day-card.active {
  background: rgba(59, 130, 246, 0.08) !important;
  color: var(--blue-600) !important;
  border-color: var(--blue-500) !important;
}

body.light-theme .my-calendar-grid-day-card.today {
  background: rgba(34, 197, 94, 0.04) !important;
  border-color: var(--green-500) !important;
  color: var(--green-600) !important;
}

/* Theme-dependent logos */
.logo-light { display: none !important; }
body.light-theme .logo-dark { display: none !important; }
body.light-theme .logo-light { display: inline-block !important; }

/* Light theme overrides for Workflow Builder and Active components */
body.light-theme .workflow-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
}
body.light-theme .workflow-card:hover {
  background: var(--bg-card-hover) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05) !important;
}
body.light-theme .workflow-card-step-arrow {
  color: var(--fg-muted) !important;
}
body.light-theme .canvas-node {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
  color: var(--fg-primary) !important;
}
body.light-theme .canvas-node:hover {
  background: var(--bg-card-hover) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
body.light-theme .canvas-node.selected {
  background: var(--bg-card-hover) !important;
  border-color: var(--blue-500) !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(0, 0, 0, 0.02) !important;
}
body.light-theme .canvas-node-summary {
  color: var(--fg-secondary) !important;
}
body.light-theme .canvas-arrow {
  background: linear-gradient(180deg, var(--border-color), rgba(0, 0, 0, 0.04)) !important;
}
body.light-theme .canvas-arrow::after {
  border-top-color: rgba(0, 0, 0, 0.15) !important;
}
body.light-theme .canvas-end-dot {
  background: rgba(0, 0, 0, 0.08) !important;
  box-shadow: none !important;
}
body.light-theme .dialer-status {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: var(--border-color) !important;
}
body.light-theme .dialer-status .status-text {
  color: var(--fg-primary) !important;
}
body.light-theme .dialer-status .call-duration {
  color: var(--fg-secondary) !important;
}
body.light-theme .calendar-month-nav {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: var(--border-color) !important;
}
body.light-theme .outcome-badge.demo {
  background: rgba(34, 197, 94, 0.08) !important;
  color: var(--green-600) !important;
  border: 1px solid rgba(34, 197, 94, 0.15) !important;
}
body.light-theme .outcome-badge.connected {
  background: rgba(59, 130, 246, 0.08) !important;
  color: var(--blue-600) !important;
  border: 1px solid rgba(59, 130, 246, 0.15) !important;
}
body.light-theme .outcome-badge.voicemail {
  background: rgba(0, 0, 0, 0.04) !important;
  color: var(--fg-secondary) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}
body.light-theme input:checked + .slider {
  background-color: rgba(34, 197, 94, 0.15) !important;
  border-color: var(--green-500) !important;
}
body.light-theme .workflow-add-btn {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: var(--border-color) !important;
  color: var(--fg-primary) !important;
}
body.light-theme .workflow-add-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

/* ── Sidebar Dialer — light mode ─────────────────────────────────────────── */
body.light-theme .sb-tab {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.10);
  color: var(--fg-muted);
}
body.light-theme .sb-tab.active {
  background: rgba(59,130,246,0.10);
  border-color: rgba(59,130,246,0.30);
  color: hsl(217,91%,45%);
}
body.light-theme .sb-mode-badge {
  background: rgba(59,130,246,0.06);
  border-color: rgba(59,130,246,0.15);
  color: hsl(217,91%,40%);
}
body.light-theme .sb-status-bar {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .sb-status-bar .status-text {
  color: var(--fg-primary);
}
body.light-theme .sb-status-bar .call-duration {
  color: var(--fg-muted);
}
body.light-theme .sb-footer {
  background: rgba(0,0,0,0.03);
  border-top-color: rgba(0,0,0,0.08);
}
body.light-theme .sb-btn--mute {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.10);
  color: var(--fg-primary);
}
body.light-theme .sb-btn--mute:hover:not(.disabled) {
  background: rgba(0,0,0,0.09);
}
body.light-theme .sb-btn--mute.muted-active {
  background: rgba(38,92%,50%,0.12);
  border-color: hsl(38,92%,50%);
  color: hsl(38,92%,40%);
}
body.light-theme .sb-btn--end {
  background: rgba(220,38,38,0.08);
  border-color: rgba(220,38,38,0.20);
  color: hsl(346,80%,45%);
}
body.light-theme .sb-btn--end:hover:not(.disabled) {
  background: rgba(220,38,38,0.14);
}
body.light-theme .sb-search-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
  color: var(--fg-primary);
}
body.light-theme .sb-search-input::placeholder { color: var(--fg-muted); }
body.light-theme .sb-label { color: var(--fg-muted); }

/* ── Light mode: card-header divider ───────────────────────────────────── */
body.light-theme .card-header {
  border-bottom-color: rgba(0,0,0,0.07) !important;
}
body.light-theme .card-header h3 { color: var(--fg-primary); }

/* ── Light mode: queue rows (lead list in sidebar) ──────────────────────── */
body.light-theme .cold-queue-row {
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.07);
}
body.light-theme .cold-queue-row:hover {
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.18);
}
body.light-theme .cq-rank {
  background: rgba(0,0,0,0.07);
  color: var(--fg-secondary);
}

/* ── Light mode: analytics heatmap bar track ────────────────────────────── */
body.light-theme .hm-bar {
  background: rgba(0,0,0,0.07);
}

/* ── Light mode: settings sidebar stronger separation ──────────────────── */
body.light-theme .settings-sidebar {
  background: #f7f8fa !important;
  border: 1px solid rgba(0,0,0,0.09) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
}
body.light-theme .settings-nav-group {
  border-bottom-color: rgba(0,0,0,0.07) !important;
}

/* ── Light mode: full-table card header row ─────────────────────────────── */
body.light-theme .full-table-card .card-header {
  border-bottom-color: rgba(0,0,0,0.07) !important;
}
body.light-theme .analytics-table th {
  background: rgba(0,0,0,0.03) !important;
  border-bottom: 1px solid rgba(0,0,0,0.07) !important;
  color: var(--fg-muted) !important;
}
body.light-theme .analytics-table td {
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}
body.light-theme .analytics-table tr:hover td {
  background: rgba(59,130,246,0.04) !important;
}

/* ── Light mode: dialer line cards (predictive) ─────────────────────────── */
body.light-theme .dialer-line-card {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.10) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
}

/* ── Team Console — phone line rows & roster header ────────────────────── */
.tc-line-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.tc-line-row:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.tc-line-row:hover { background: rgba(255,255,255,0.06); }

.tc-roster-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px;
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.tc-roster-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.15s, border-color 0.15s;
}
.tc-roster-row:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.11);
}

body.light-theme .tc-line-row {
  background: rgba(0,0,0,0.025);
  border-color: rgba(0,0,0,0.08);
}
body.light-theme .tc-line-row:hover {
  background: rgba(59,130,246,0.04);
  border-color: rgba(59,130,246,0.15);
}

body.light-theme .tc-roster-row {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}
body.light-theme .tc-roster-row:hover {
  background: rgba(59,130,246,0.04);
  border-color: rgba(59,130,246,0.15);
}

/* ── Team Console — phone number chips ───────────────────────────────────── */
.tc-phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: hsl(142,76%,50%);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.tc-phone-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
}
.tc-phone-chip-remove:hover {
  background: rgba(239,68,68,0.25);
  color: hsl(346,80%,65%);
}
.tc-add-phone-select {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font-sans);
  color: var(--fg-muted);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.tc-add-phone-select:hover { border-color: rgba(255,255,255,0.3); color: var(--fg-primary); }

/* ── Agent Profile Modal ─────────────────────────────────────────────────── */
.ap-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: apFadeIn 0.18s ease;
}
@keyframes apFadeIn { from { opacity:0 } to { opacity:1 } }

.ap-modal {
  position: relative;
  display: flex;
  width: min(900px, 92vw);
  height: min(600px, 86vh);
  background: rgba(18, 18, 24, 0.97);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: apSlideIn 0.22s cubic-bezier(0.16,1,0.3,1);
}
@keyframes apSlideIn { from { transform: translateY(16px); opacity:0 } to { transform: translateY(0); opacity:1 } }

.ap-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted); cursor: pointer;
  transition: all 0.15s;
}
.ap-close:hover { background: rgba(255,255,255,0.12); color: var(--fg-primary); }

/* Left panel */
.ap-left {
  width: 240px; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.07);
  padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto;
}
.ap-avatar-wrap { margin-bottom: 14px; }
.ap-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, hsl(217,91%,60%) 0%, hsl(142,76%,45%) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}
.ap-name {
  font-size: 16px; font-weight: 700; color: var(--fg-primary);
  text-align: center; margin: 0 0 8px;
}
.ap-role-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 18px;
  background: rgba(59,130,246,0.12); color: hsl(217,91%,60%);
  border: 1px solid rgba(59,130,246,0.2);
}
.ap-role-badge.admin {
  background: rgba(234,179,8,0.12); color: hsl(38,92%,50%);
  border-color: rgba(234,179,8,0.2);
}
.ap-meta { width: 100%; margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.ap-meta-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--fg-muted);
}
.ap-meta-row svg { flex-shrink: 0; opacity: 0.6; }
.ap-phones-section { width: 100%; }
.ap-phones-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--fg-muted); margin-bottom: 8px;
}
.ap-phones-list { display: flex; flex-direction: column; gap: 5px; }
.ap-phone-chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2);
  border-radius: 20px; color: hsl(142,76%,45%);
}
.ap-integration-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 7px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
}
.ap-integration-icon { font-size: 13px; flex-shrink: 0; }
.ap-integration-name { flex: 1; color: var(--fg-secondary); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-integration-status { font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 6px; border-radius: 20px; flex-shrink: 0; }
.ap-integration-status.connected { color: hsl(142,76%,45%); background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.2); }
.ap-integration-status.disconnected { color: var(--fg-muted); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.ap-stats-grid {
  width: 100%; display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 18px;
}
.ap-stat-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 10px; text-align: center;
}
.ap-stat-val { font-size: 18px; font-weight: 700; color: var(--fg-primary); }
.ap-stat-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--fg-muted); margin-top: 2px; }

/* Right panel */
.ap-right {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ap-right-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.ap-right-title { font-size: 14px; font-weight: 700; color: var(--fg-primary); }
.ap-call-count {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.18);
  border-radius: 20px; color: hsl(217,91%,60%);
}
.ap-calls-list {
  flex: 1; overflow-y: auto; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.ap-calls-loading { text-align: center; padding: 40px; color: var(--fg-muted); font-size: 13px; }
.ap-call-row {
  display: grid;
  grid-template-columns: 36px 1fr 90px 60px 70px;
  align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  transition: background 0.12s;
  font-size: 12px;
}
.ap-call-row:hover { background: rgba(255,255,255,0.05); }
.ap-call-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ap-call-icon.connected   { background: rgba(34,197,94,0.12); color: hsl(142,76%,45%); }
.ap-call-icon.voicemail   { background: rgba(59,130,246,0.12); color: hsl(217,91%,60%); }
.ap-call-icon.no_answer   { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.ap-call-icon.busy        { background: rgba(234,179,8,0.12); color: hsl(38,92%,50%); }
.ap-call-contact { font-weight: 600; color: var(--fg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-call-phone   { font-size: 11px; color: var(--fg-muted); white-space: nowrap; }
.ap-call-dur     { color: var(--fg-secondary); text-align: right; }
.ap-call-disp    { font-size: 10px; font-weight: 600; text-transform: capitalize;
                   padding: 2px 7px; border-radius: 20px; text-align: center; }
.ap-call-disp.connected { background: rgba(34,197,94,0.1); color: hsl(142,76%,45%); }
.ap-call-disp.voicemail { background: rgba(59,130,246,0.1); color: hsl(217,91%,60%); }
.ap-call-disp.no_answer, .ap-call-disp.missed { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.ap-call-disp.busy       { background: rgba(234,179,8,0.1); color: hsl(38,92%,50%); }
.ap-call-time { font-size: 10px; color: var(--fg-muted); text-align: right; }

/* Light mode */
body.light-theme .ap-modal {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
}
body.light-theme .ap-close {
  background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #666;
}
body.light-theme .ap-close:hover { background: rgba(0,0,0,0.08); }
body.light-theme .ap-left { border-right-color: rgba(0,0,0,0.07); }
body.light-theme .ap-right-header { border-bottom-color: rgba(0,0,0,0.07); }
body.light-theme .ap-call-row {
  background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06);
}
body.light-theme .ap-call-row:hover { background: rgba(0,0,0,0.04); }
body.light-theme .ap-stat-card { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.07); }
body.light-theme .ap-backdrop { background: rgba(0,0,0,0.35); }


/* ══════════════════════════════════════════════════════════════════════
   MY TASKS BOARD
   ══════════════════════════════════════════════════════════════════════ */

/* Section wrapper — scroll only, no display override (tab-panel controls display) */
.tasks-section {
  overflow-y: auto;
  padding: 40px 24px 60px;
  box-sizing: border-box;
}

/* Content column — centred, 860px wide */
.tasks-page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}

/* ── Header ── */
.tasks-page-hd { display: flex; flex-direction: column; gap: 2px; }

.tasks-page-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(217,91%,60%);
  margin: 0;
}

.tasks-page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--fg-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

/* Inline icon-only refresh button next to the title */
.tasks-icon-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.4s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
  margin-bottom: 2px;
}
.tasks-icon-refresh:hover {
  background: rgba(255,255,255,0.08);
  color: var(--fg-primary);
  transform: rotate(180deg);
}

/* ── Stat cards row ── */
.tasks-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tasks-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 24px;
  background: rgba(22,22,28,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16,1,0.3,1),
              border-color 0.18s cubic-bezier(0.16,1,0.3,1),
              transform 0.18s cubic-bezier(0.16,1,0.3,1);
  text-align: left;
}
.tasks-stat-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}
.tasks-stat-card--amber {
  border-color: rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.05);
}
.tasks-stat-card--amber:hover { background: rgba(245,158,11,0.09); }
.tasks-stat-card--red {
  border-color: hsl(346,80%,55%, 0.25);
  border-color: rgba(225,44,80,0.25);
  background: rgba(225,44,80,0.05);
}
.tasks-stat-card--red:hover { background: rgba(225,44,80,0.09); }

.tasks-stat-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--fg-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tasks-stat-card--amber .tasks-stat-num { color: hsl(38,92%,55%); }
.tasks-stat-card--red   .tasks-stat-num { color: hsl(346,80%,60%); }
.tasks-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Filter chips ── */
.tasks-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--fg-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
}
.task-filter-chip:hover {
  background: rgba(255,255,255,0.07);
  color: var(--fg-primary);
}
.task-filter-chip.active {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.35);
  color: hsl(217,91%,65%);
}

/* Colored dots */
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chip-dot--red   { background: hsl(346,80%,55%); }
.chip-dot--amber { background: hsl(38,92%,50%); }
.chip-dot--blue  { background: hsl(217,91%,60%); }
.chip-dot--muted { background: var(--fg-muted); opacity: 0.5; }

/* ── Group sections ── */
.tasks-list { display: flex; flex-direction: column; gap: 20px; }
.tasks-group { display: flex; flex-direction: column; gap: 4px; }
.tasks-group-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 0 2px 8px;
}
.tasks-group-hd--red   { color: hsl(346,80%,60%); }
.tasks-group-hd--amber { color: hsl(38,92%,55%); }
.tasks-group-hd--blue  { color: hsl(217,91%,65%); }
.tasks-group-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1px 7px;
  color: var(--fg-muted);
}

/* ── Task card ── */
.my-task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(22,22,28,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  transition: background 0.15s cubic-bezier(0.16,1,0.3,1),
              border-color 0.15s cubic-bezier(0.16,1,0.3,1);
}
.my-task-card:hover {
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.11);
}
.my-task-card.is-done { opacity: 0.4; }

/* ── Completion toggle ── */
.my-task-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.15s cubic-bezier(0.16,1,0.3,1);
  align-self: center;
}
.my-task-check:hover {
  border-color: hsl(142,76%,45%);
  background: rgba(34,197,94,0.1);
}
.my-task-check.is-checked {
  border-color: hsl(142,76%,45%);
  background: rgba(34,197,94,0.18);
  color: hsl(142,76%,45%);
}

/* ── Card body ── */
.my-task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Title row: title left, badge + due right — never wraps */
.my-task-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.my-task-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-task-card.is-done .my-task-title {
  text-decoration: line-through;
  color: var(--fg-muted);
}
.my-task-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* Type badge */
.my-task-type-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.badge-task {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: hsl(217,91%,65%);
}
.badge-call {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
  color: hsl(142,76%,50%);
}

/* Due label */
.my-task-due {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-muted);
  white-space: nowrap;
}
.my-task-due.overdue { color: hsl(346,80%,60%); }
.my-task-due.today   { color: hsl(38,92%,55%); }

/* Sub-row: lead · company · assignee */
.my-task-sub-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.my-task-lead-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-secondary);
  cursor: pointer;
  text-align: left;
  transition: color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
button.my-task-lead-link:hover { color: hsl(217,91%,65%); }
.my-task-dot {
  color: rgba(255,255,255,0.2);
  font-size: 11px;
  flex-shrink: 0;
}
.my-task-assignee {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Loading / empty states ── */
.tasks-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--fg-muted);
  font-size: 13px;
  justify-content: center;
}
.tasks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 60px 0;
  color: var(--fg-muted);
}
.tasks-empty p { font-size: 14px; font-weight: 600; margin: 8px 0 0; color: var(--fg-secondary); }
.tasks-empty span { font-size: 12px; }

/* Spin animation for refresh/loading icons */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ── Task completion animations ── */
@keyframes checkPop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.45); }
  55%  { transform: scale(0.82); }
  75%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes checkRipple {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  100% { box-shadow: 0 0 0 16px rgba(34,197,94,0); }
}
.task-check-pop {
  animation: checkPop 0.42s cubic-bezier(0.16,1,0.3,1) forwards,
             checkRipple 0.55s ease-out forwards;
}

@keyframes taskOut {
  0%   { opacity: 1;   transform: scaleY(1)    translateY(0);   max-height: 120px; margin-bottom: 4px; }
  35%  { opacity: 0.6; transform: scaleY(0.97) translateY(-3px); }
  100% { opacity: 0;   transform: scaleY(0.9)  translateY(-10px); max-height: 0;   margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}
.task-card-out {
  animation: taskOut 0.38s cubic-bezier(0.4,0,0.6,1) 0.18s forwards;
  pointer-events: none;
  overflow: hidden;
  transform-origin: top center;
}

/* "You" badge on assignee */
.tasks-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.25);
  color: hsl(217,91%,60%);
  font-size: 11px;
  font-weight: 700;
}
.me-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(59,130,246,0.15);
  color: hsl(217,91%,65%);
  vertical-align: middle;
  margin-left: 3px;
}

/* ══════════════════════════════════════════════════════════════════════
   INCOMING CALL BANNER
   ══════════════════════════════════════════════════════════════════════ */
.incoming-call-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 380px;
  max-width: 520px;
  padding: 16px 20px;
  background: rgba(22, 22, 28, 0.85);
  border: 1px solid hsla(142, 76%, 45%, 0.35);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 0 24px hsla(142, 76%, 45%, 0.12);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.incoming-call-banner.visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Pulsing phone icon */
.ic-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(142, 76%, 45%, 0.14);
  color: hsl(142, 76%, 45%);
}
.ic-ring-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid hsl(142, 76%, 45%);
  animation: icPulse 1.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes icPulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* Caller info */
.ic-body { flex: 1; min-width: 0; }
.ic-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(142, 76%, 45%);
  margin: 0 0 2px;
}
.ic-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ic-meta {
  font-size: 11.5px;
  color: var(--fg-muted);
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Accept / Decline */
.ic-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ic-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ic-btn:hover { transform: translateY(-1px); }
.ic-btn:active { transform: translateY(0); }
.ic-btn--accept {
  background: hsl(142, 76%, 38%);
  color: #fff;
}
.ic-btn--accept:hover { background: hsl(142, 76%, 45%); }
.ic-btn--decline {
  background: hsla(346, 80%, 55%, 0.15);
  border: 1px solid hsla(346, 80%, 55%, 0.3);
  color: hsl(346, 80%, 60%);
}
.ic-btn--decline:hover { background: hsla(346, 80%, 55%, 0.25); }

/* ── SMS Inbox ───────────────────────────────────────────────────────────── */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  font-size: 10px; font-weight: 800; line-height: 1;
  border-radius: 8px; background: hsl(346, 80%, 55%); color: #fff;
}
#tab-inbox { padding: 0; }
.inbox-shell {
  display: grid; grid-template-columns: 320px 1fr;
  height: 100%; min-height: 0;
  border: 1px solid var(--border-color); border-radius: 14px; overflow: hidden;
  background: rgba(22, 22, 28, 0.4);
}
.inbox-list-col {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border-color);
}
.inbox-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.inbox-list-title { font-size: 15px; font-weight: 700; color: var(--fg-primary); }
.inbox-refresh {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg-secondary); transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
}
.inbox-refresh:hover { color: hsl(217,91%,60%); border-color: hsla(217,91%,60%,0.3); }
.inbox-threads { flex: 1; min-height: 0; overflow-y: auto; }
.inbox-empty { padding: 30px 20px; text-align: center; color: var(--fg-muted); font-size: 13px; }

.inbox-thread-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 16px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.inbox-thread-item:hover { background: rgba(255,255,255,0.03); }
.inbox-thread-item.active { background: hsla(217,91%,60%,0.1); }
.inbox-thread-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.inbox-ti-body { flex: 1; min-width: 0; }
.inbox-ti-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.inbox-ti-name { font-size: 13.5px; font-weight: 600; color: var(--fg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-ti-time { font-size: 10.5px; color: var(--fg-muted); flex-shrink: 0; }
.inbox-ti-preview { font-size: 12px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.inbox-ti-preview.unread { color: var(--fg-secondary); font-weight: 600; }
.inbox-ti-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(346,80%,55%); flex-shrink: 0; margin-top: 6px; }

.inbox-thread-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.inbox-thread-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--fg-muted); font-size: 13px;
}
.inbox-thread-active { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.inbox-thread-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.inbox-thread-name { font-size: 15px; font-weight: 700; color: var(--fg-primary); }
.inbox-thread-sub { font-size: 11.5px; color: var(--fg-muted); margin-top: 1px; }
.inbox-head-btn {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--fg-muted);
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1);
}
.inbox-head-btn:hover { color: hsl(346,80%,60%); background: hsla(346,80%,55%,0.1); border-color: hsla(346,80%,55%,0.25); }
.inbox-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 3px;
}
/* Message bubble — sized to content; only the text wraps (no stray template whitespace). */
.inbox-bubble {
  max-width: 68%; padding: 8px 12px 6px; border-radius: 16px;
  display: inline-flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.inbox-bubble-text {
  font-size: 13.5px; line-height: 1.4; white-space: pre-wrap;
  word-break: break-word; overflow-wrap: anywhere;
}
.inbox-bubble-time { font-size: 10px; opacity: 0.65; margin-top: 3px; align-self: flex-end; }
.inbox-bubble--in {
  align-self: flex-start; background: rgba(255,255,255,0.07);
  color: var(--fg-primary); border-bottom-left-radius: 5px;
  margin-top: 7px;
}
.inbox-bubble--out {
  align-self: flex-end; background: hsl(217,91%,55%);
  color: #fff; border-bottom-right-radius: 5px;
  margin-top: 7px;
}
/* Consecutive bubbles from the same side hug closer together */
.inbox-bubble--in + .inbox-bubble--in,
.inbox-bubble--out + .inbox-bubble--out { margin-top: 2px; }
.inbox-day-sep {
  align-self: center; font-size: 10.5px; font-weight: 600; color: var(--fg-muted);
  background: rgba(255,255,255,0.04); padding: 3px 12px; border-radius: 10px; margin: 14px 0 8px;
}

/* Search */
.inbox-search {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 14px 6px; padding: 0 12px; height: 36px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px; color: var(--fg-muted); flex-shrink: 0;
  transition: border-color 0.2s;
}
.inbox-search:focus-within { border-color: hsla(217,91%,60%,0.4); color: hsl(217,91%,60%); }
.inbox-search input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--fg-primary); font-size: 13px; font-family: inherit;
}
.inbox-search input::placeholder { color: var(--fg-muted); }

/* Per-thread delete button (revealed on hover) */
.inbox-ti-del {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--fg-muted);
  transition: color 0.15s, background 0.15s;
}
.inbox-thread-item:hover .inbox-ti-del { display: flex; }
.inbox-ti-del:hover { color: hsl(346,80%,60%); background: hsla(346,80%,55%,0.12); }

.inbox-reply {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 18px; border-top: 1px solid var(--border-color); flex-shrink: 0;
}
.inbox-reply-input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; color: var(--fg-primary); font-size: 13px; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.inbox-reply-input:focus { border-color: hsla(217,91%,60%,0.4); }
.inbox-send-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: hsl(217,91%,55%); border: none; color: #fff;
  transition: background 0.2s, transform 0.15s cubic-bezier(0.16,1,0.3,1);
}
.inbox-send-btn:hover { background: hsl(217,91%,60%); }
.inbox-send-btn:active { transform: scale(0.92); }

/* ── Lead card SMS / Email composers ─────────────────────────────────────── */
.ldm-to-hint { font-size: 11px; color: hsl(217,91%,62%); font-weight: 600; margin-left: 4px; }
.ldm-msg-route {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; padding: 0 2px;
}
.ldm-route-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-muted); flex-shrink: 0; width: 36px;
}
.ldm-msg-select {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: var(--fg-primary); font-size: 12px; font-family: inherit;
  outline: none; cursor: pointer;
}
.ldm-msg-select:focus { border-color: hsla(217,91%,60%,0.4); }
.ldm-send-msg-btn { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* SMS thread bubbles rendered inside the activity feed */
.ldm-sms-feed { display: flex; flex-direction: column; gap: 3px; padding: 4px 2px; }
.ldm-sms-empty { text-align: center; color: var(--fg-muted); font-size: 12px; padding: 30px 12px; }

/* Email history cards in the lead card Email tab */
.ldm-email-feed { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.ldm-email-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 12px 14px;
}
.ldm-email-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.ldm-email-card-subj { font-size: 13px; font-weight: 700; color: var(--fg-primary); }
.ldm-email-card-when { font-size: 10.5px; color: var(--fg-muted); flex-shrink: 0; }
.ldm-email-card-meta { font-size: 10.5px; color: hsl(217,91%,62%); margin: 3px 0 8px; word-break: break-all; }
.ldm-email-card-body { font-size: 12.5px; color: var(--fg-secondary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ════════════════════════════════════════════════════════════════════════════
   MOTION SYSTEM — smooth transitions (inspired by transitions.dev)
   Standard easing already used app-wide: cubic-bezier(0.16, 1, 0.3, 1)
   ════════════════════════════════════════════════════════════════════════════ */
:root { --mtn-ease: cubic-bezier(0.16, 1, 0.3, 1); --mtn-spring: cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes mtnModalIn  { from { opacity:0; transform: scale(0.94) translateY(10px); } to { opacity:1; transform: scale(1) translateY(0); } }
@keyframes mtnOverlayIn{ from { opacity:0; } to { opacity:1; } }
@keyframes mtnDropIn   { from { opacity:0; transform: scale(0.96) translateY(-6px); } to { opacity:1; transform: scale(1) translateY(0); } }
@keyframes mtnFadeUp   { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }
@keyframes mtnBadgePop { 0% { opacity:0; transform: scale(0) translate(5px,-5px); } 60% { opacity:1; transform: scale(1.25) translate(0,0); } 100% { transform: scale(1); } }
@keyframes mtnPopIn    { 0% { transform: scale(0.4); opacity:0; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity:1; } }
@keyframes mtnShake    { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-5px)} 40%,60%{transform:translateX(5px)} }
@keyframes mtnSuccessCheck { 0%{opacity:0;transform:scale(0.4) rotate(-25deg);filter:blur(3px)} 100%{opacity:1;transform:scale(1) rotate(0);filter:blur(0)} }
@keyframes mtnShimmer  { 0%{background-position:-200% 0} 100%{background-position:200% 0} }

/* Modal open — overlay fade + card scale-in */
.modal-overlay:not(.hidden) { animation: mtnOverlayIn 0.22s ease; }
.modal-card { animation: mtnModalIn 0.36s var(--mtn-ease); }

/* Origin-aware dropdown open (custom selects) */
.cs-dropdown { transform-origin: top center; animation: mtnDropIn 0.18s var(--mtn-ease); }

/* Notification badge — spring pop-in */
.nav-badge { animation: mtnBadgePop 0.45s var(--mtn-spring); }

/* Tab panel content rises in */
.tab-panel.active { animation: mtnFadeUp 0.4s var(--mtn-ease); }

/* Button press feedback */
.cta-btn:active, .nav-btn:active, .ldm-bar-btn:active, .task-add-btn:active,
.inbox-send-btn:active, .ldm-send-msg-btn:active, .task-type-btn:active,
.inbox-refresh:active, .inbox-head-btn:active, .ic-btn:active { transform: scale(0.95); }

/* Nav buttons lift slightly on hover */
.nav-btn:hover { transform: translateY(-1px); }

/* Card hover lift — only small/interactive cards (not full-height panels) */
.an-kpi-card { transition: border-color var(--transition-normal), transform 0.25s var(--mtn-ease), box-shadow 0.25s var(--mtn-ease); }
.an-kpi-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.28); }

/* Row hover micro-lift (smooth, includes transform) */
.conv-row, .tc-line-row, .tc-roster-row, .inbox-thread-item, .my-task-card {
  transition: background 0.2s var(--mtn-ease), border-color 0.2s var(--mtn-ease),
              transform 0.2s var(--mtn-ease), box-shadow 0.2s var(--mtn-ease);
}
.conv-row:hover, .tc-line-row:hover, .tc-roster-row:hover { transform: translateY(-1px); }

/* Avatar group / roster avatars lift on hover */
.inbox-thread-avatar, .ws-agent-avatar, .conv-avatar { transition: transform 0.2s var(--mtn-spring); }
.inbox-thread-item:hover .inbox-thread-avatar { transform: scale(1.08) translateY(-1px); }

/* Error shake (JS toggles .mtn-shake) */
.mtn-shake { animation: mtnShake 0.4s var(--mtn-ease); }

/* Number / element pop-in (JS toggles .mtn-pop) */
.mtn-pop { animation: mtnPopIn 0.4s var(--mtn-spring); }

/* Skeleton shimmer loaders */
.mtn-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%; animation: mtnShimmer 1.3s ease-in-out infinite; border-radius: 8px;
}
.mtn-skel-row { display: flex; align-items: center; gap: 11px; padding: 13px 16px; }
.mtn-skel-circle { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.mtn-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.mtn-skel-line { height: 10px; }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .modal-card, .cs-dropdown, .nav-badge, .tab-panel.active, .mtn-shake, .mtn-pop, .mtn-skeleton { animation: none !important; }
  .glass-card:hover, .nav-btn:hover, .conv-row:hover, .tc-line-row:hover, .tc-roster-row:hover { transform: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Transitions.dev — Skeleton loader and reveal
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  --pulse-dur: 1000ms;
  --pulse-count: 1;
  --pulse-min: 0.5;
  --reveal-dur: 400ms;
  --reveal-blur: 2px;
  --reveal-ease: ease-in-out;
}

.t-skel { position: relative; }
.t-skel-skeleton,
.t-skel-content {
  position: absolute;
  inset: 0;
}

.t-skel-skeleton {
  z-index: 1;
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--reveal-dur) var(--reveal-ease),
    filter  var(--reveal-dur) var(--reveal-ease);
}
.t-skel-content {
  z-index: 2;
  opacity: 0;
  filter: blur(var(--reveal-blur));
  transition:
    opacity var(--reveal-dur) var(--reveal-ease),
    filter  var(--reveal-dur) var(--reveal-ease);
}
.t-skel.is-revealed .t-skel-skeleton {
  opacity: 0;
  filter: blur(var(--reveal-blur));
}
.t-skel.is-revealed .t-skel-content {
  opacity: 1;
  filter: blur(0);
}
.t-skel.is-resetting .t-skel-skeleton,
.t-skel.is-resetting .t-skel-content {
  transition: none !important;
}

.t-skel-skeleton.is-pulsing > * {
  animation: t-skel-pulse var(--pulse-dur) ease-in-out var(--pulse-count);
}
@keyframes t-skel-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: var(--pulse-min); }
}

@media (prefers-reduced-motion: reduce) {
  .t-skel-skeleton, .t-skel-content {
    transition: none !important;
  }
  .t-skel-skeleton.is-pulsing > * { animation: none !important; }
}

/* Shared skeleton bar look for the list/card loaders below */
.skel-bar {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%; animation: mtnShimmer 1.3s ease-in-out infinite; border-radius: 7px;
}
.skel-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.skel-circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skel-sq { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.skel-ln { height: 10px; }
@media (prefers-reduced-motion: reduce) { .skel-bar { animation: none; } }

/* Call recordings in the lead card Calls tab */
.ldm-rec-section {
  background: rgba(34,197,94,0.04); border: 1px solid rgba(34,197,94,0.18);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
.ldm-rec-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: hsl(142,76%,45%); margin-bottom: 10px;
}
.ldm-rec-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.05); }
.ldm-rec-item:first-of-type { border-top: none; }
.ldm-rec-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ldm-rec-dir {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px; padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.ldm-rec-dir.out { color: hsl(217,91%,62%); background: rgba(59,130,246,0.12); }
.ldm-rec-dir.in  { color: hsl(142,76%,48%); background: rgba(34,197,94,0.12); }
.ldm-rec-when { font-size: 11px; color: var(--fg-muted); }
.ldm-rec-audio { width: 100%; height: 34px; border-radius: 8px; }
.ldm-rec-audio::-webkit-media-controls-panel { background: rgba(255,255,255,0.06); }

/* AI call summary inside call activity entries */
.act-call-summary {
  margin-top: 8px; padding: 9px 11px;
  background: rgba(139,92,246,0.07); border: 1px solid rgba(139,92,246,0.2);
  border-radius: 9px;
}
.act-call-summary-hd {
  display: flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: hsl(258,80%,68%); margin-bottom: 5px;
}
.act-call-summary-body {
  font-size: 12px; line-height: 1.5; color: var(--fg-secondary);
  white-space: pre-wrap; word-break: break-word;
}

/* Inline recording player on a call activity card */
.act-call-audio { width: 100%; height: 32px; margin-top: 8px; border-radius: 8px; }
.act-call-audio::-webkit-media-controls-panel { background: rgba(255,255,255,0.06); }

/* ════════════════════════════════════════════════════════════════════════════
   AI Coaching — animated green orb + card environment
   ════════════════════════════════════════════════════════════════════════════ */
.ai-orb-wrap {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; margin: 0 0 4px;
}
/* Siri-style conic-gradient orb (green) */
@property --siri-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.siri-orb {
  --siri-duration: 18s;
  --siri-blur: 11px;
  --siri-contrast: 2;
  --c1: oklch(80% 0.18 150);
  --c2: oklch(85% 0.15 168);
  --c3: oklch(70% 0.17 142);
  width: 132px; max-width: 64%; aspect-ratio: 1 / 1;
  display: grid; grid-template-areas: "stack"; overflow: hidden; border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 30%, transparent 70%);
  box-shadow: 0 0 30px hsla(142,82%,45%,0.32);
  transition: box-shadow 0.6s cubic-bezier(0.16,1,0.3,1);
}
.siri-orb::before {
  content: ""; grid-area: stack; width: 100%; height: 100%; border-radius: 50%;
  background:
    conic-gradient(from calc(var(--siri-angle) * 1.2) at 30% 65%, var(--c3) 0deg, transparent 45deg 315deg, var(--c3) 360deg),
    conic-gradient(from calc(var(--siri-angle) * 0.8) at 70% 35%, var(--c2) 0deg, transparent 60deg 300deg, var(--c2) 360deg),
    conic-gradient(from calc(var(--siri-angle) * -1.5) at 65% 75%, var(--c1) 0deg, transparent 90deg 270deg, var(--c1) 360deg),
    conic-gradient(from calc(var(--siri-angle) * 2.1) at 25% 25%, var(--c2) 0deg, transparent 30deg 330deg, var(--c2) 360deg),
    conic-gradient(from calc(var(--siri-angle) * -0.7) at 80% 80%, var(--c1) 0deg, transparent 45deg 315deg, var(--c1) 360deg),
    radial-gradient(ellipse 120% 80% at 40% 60%, var(--c3) 0%, transparent 50%);
  filter: blur(var(--siri-blur)) contrast(var(--siri-contrast)) saturate(1.5);
  animation: siriRotate var(--siri-duration) linear infinite;
  transform: translateZ(0); will-change: transform;
}
.siri-orb::after {
  content: ""; grid-area: stack; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 45% 55%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 30%, transparent 60%);
  mix-blend-mode: overlay;
}
@keyframes siriRotate { to { --siri-angle: 360deg; } }

/* Battlecard active — orb spins faster, brighter, stronger glow */
.ai-orb-wrap.active .siri-orb {
  --siri-duration: 5s; --siri-contrast: 2.3;
  box-shadow: 0 0 40px hsla(142,90%,50%,0.6);
}
.ai-orb-wrap.active .siri-orb::before { filter: blur(var(--siri-blur)) contrast(var(--siri-contrast)) saturate(1.8); }
.ai-orb-status {
  margin-top: 18px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: hsl(142,65%,60%); display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px;
  background: hsla(142,60%,45%,0.10); border: 1px solid hsla(142,60%,50%,0.22);
  backdrop-filter: blur(8px);
  transition: color 0.4s, background 0.4s, border-color 0.4s;
}
.ai-orb-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: hsl(142,76%,50%);
  box-shadow: 0 0 8px hsl(142,76%,50%); animation: orbDot 2.2s ease-in-out infinite;
}
.ai-orb-wrap.active .ai-orb-status {
  color: hsl(142,85%,66%); background: hsla(142,70%,48%,0.16); border-color: hsla(142,70%,55%,0.4);
}
@keyframes orbDot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* Smooth card entrance + tidy environment */
.coaching-idle-state { animation: orbCardIn 0.5s cubic-bezier(0.16,1,0.3,1); }
#coaching-card { animation: orbCardIn 0.4s cubic-bezier(0.16,1,0.3,1); }
@keyframes orbCardIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .siri-orb::before, .ai-orb-status::before, #coaching-card { animation: none !important; }
}

/* Team Console — thin scrollbars for the internally-scrolling lists */
#tc-phone-lines-list, #tc-agent-roster { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
#tc-phone-lines-list::-webkit-scrollbar, #tc-agent-roster::-webkit-scrollbar { width: 7px; }
#tc-phone-lines-list::-webkit-scrollbar-track, #tc-agent-roster::-webkit-scrollbar-track { background: transparent; }
#tc-phone-lines-list::-webkit-scrollbar-thumb, #tc-agent-roster::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
#tc-phone-lines-list::-webkit-scrollbar-thumb:hover, #tc-agent-roster::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.26); background-clip: content-box; }

/* Lead-table selection checkboxes — themed to match the dark UI */
#lead-select-all,
.lead-row-check {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
  transition: background 0.15s cubic-bezier(0.16,1,0.3,1), border-color 0.15s cubic-bezier(0.16,1,0.3,1);
}
#lead-select-all:hover,
.lead-row-check:hover {
  border-color: hsl(217, 91%, 60%);
  background: rgba(59, 130, 246, 0.12);
}
#lead-select-all:checked,
.lead-row-check:checked {
  background: hsl(217, 91%, 60%);
  border-color: hsl(217, 91%, 60%);
}
#lead-select-all:checked::after,
.lead-row-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
