/* ===== AI Voice Training Module — SupportDDS ===== */
/* Design system inherited from BPO Training Demo */

:root {
  --primary: #1B3A5C;
  --primary-light: #2a5580;
  --secondary: #0D9488;
  --secondary-light: #14b8a6;
  --accent: #D4A843;
  --accent-light: #e0be6a;
  --bg: #F8F9FA;
  --bg-dark: #0F172A;
  --text: #1E293B;
  --text-light: #64748B;
  --text-on-dark: #E2E8F0;
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #DC2626;
  --border: #E2E8F0;
  --card-bg: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--bg-dark) 100%);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header .badge {
  background: var(--secondary);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Layout ===== */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  gap: 1.5rem;
}

/* ===== Setup Panel (API key + scenario selection) ===== */
.setup-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.setup-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.setup-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.setup-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ===== Form Elements ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

input[type="password"],
input[type="text"],
select {
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.selector-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

.btn-primary {
  background: var(--secondary);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--secondary-light);
  box-shadow: var(--shadow);
}

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--text-light);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.start-btn-wrapper {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

/* ===== Call Interface ===== */
.call-interface {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
}

.call-interface.active {
  display: flex;
}

/* Call Status Bar */
.call-status-bar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.call-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.call-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.call-details h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.call-details .call-scenario {
  font-size: 0.8rem;
  color: var(--text-light);
}

.call-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

.call-controls {
  display: flex;
  gap: 0.75rem;
}

/* ===== Voice Visualization ===== */
.voice-area {
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.voice-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 80px;
}

.voice-bar {
  width: 4px;
  background: var(--secondary);
  border-radius: 2px;
  transition: height 0.1s ease;
  min-height: 4px;
}

.voice-bar.ai-speaking {
  background: var(--accent);
}

.voice-status {
  color: var(--text-on-dark);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.voice-status .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s ease-in-out infinite;
}

.voice-status .pulse.listening {
  background: var(--secondary);
}

.voice-status .pulse.ai-speaking {
  background: var(--accent);
}

.voice-status .pulse.idle {
  background: var(--text-light);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* Push-to-talk button */
.ptt-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--secondary);
  background: rgba(13, 148, 136, 0.1);
  color: var(--secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptt-btn:hover {
  background: rgba(13, 148, 136, 0.2);
  transform: scale(1.05);
}

.ptt-btn.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary-light);
  box-shadow: 0 0 0 8px rgba(13, 148, 136, 0.2);
  transform: scale(1.1);
}

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

/* ===== Transcript + Coach Layout ===== */
.call-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  flex: 1;
}

/* ===== Transcript ===== */
.transcript-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.transcript-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transcript-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.transcript-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transcript-msg {
  display: flex;
  gap: 0.75rem;
  animation: fadeInUp 0.3s ease;
}

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

.transcript-msg .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.transcript-msg.ai .avatar {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--bg-dark);
}

.transcript-msg.user .avatar {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  color: white;
}

.transcript-msg .text {
  background: var(--bg);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 80%;
}

.transcript-msg.ai .text {
  background: #FEF9EF;
  border: 1px solid rgba(212, 168, 67, 0.2);
}

.transcript-msg.system .text {
  background: transparent;
  color: var(--text-light);
  font-style: italic;
  font-size: 0.8rem;
  padding: 0.25rem 0;
  text-align: center;
  width: 100%;
  max-width: 100%;
}

.transcript-msg.system {
  justify-content: center;
}

/* ===== Evaluation Panel ===== */
.evaluation-panel {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.evaluation-panel.active {
  display: block;
}

.eval-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--bg-dark);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eval-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.eval-body {
  padding: 1.5rem;
}

.eval-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.eval-star {
  color: var(--accent);
  font-size: 1.5rem;
}

.eval-star.empty {
  color: var(--border);
}

.eval-section {
  margin-bottom: 1rem;
}

.eval-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eval-section p, .eval-section ul {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
}

.eval-section ul {
  padding-left: 1.25rem;
}

.eval-section li {
  margin-bottom: 0.25rem;
}

.eval-score-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-left: 0.5rem;
}

.eval-summary {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.eval-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-style: italic;
}

.eval-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

/* ===== Connection Status ===== */
.connection-indicator {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-on-dark);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-light);
}

.connection-dot.connected { background: var(--success); }
.connection-dot.connecting { background: var(--warning); animation: pulse 1s ease-in-out infinite; }
.connection-dot.error { background: var(--error); }

/* ===== API Key Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--bg-dark) 100%);
  color: white;
  padding: 1.25rem 1.5rem;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header p {
  font-size: 0.8rem;
  color: var(--text-on-dark);
  margin-top: 0.25rem;
  opacity: 0.8;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===== Footer ===== */
.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

.app-footer a {
  color: var(--secondary);
  text-decoration: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .selector-row {
    grid-template-columns: 1fr;
  }

  .call-status-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .call-controls {
    width: 100%;
    justify-content: center;
  }

  .voice-area {
    min-height: 160px;
    padding: 1.5rem;
  }

  .ptt-btn {
    width: 64px;
    height: 64px;
  }

  .transcript-panel,
  .coach-panel {
    max-height: 300px;
  }

  .app-container {
    padding: 1rem;
  }
}

/* ===== Scrollbar ===== */
.transcript-body::-webkit-scrollbar {
  width: 6px;
}
.transcript-body::-webkit-scrollbar-track {
  background: transparent;
}
.transcript-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.transcript-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ===== Loading spinner ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Difficulty badges ===== */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.difficulty-badge.easy {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.difficulty-badge.medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.difficulty-badge.hard {
  background: rgba(220, 38, 38, 0.1);
  color: var(--error);
}

/* ===== Transcript caller/trainee styles ===== */
.transcript-msg.caller .text {
  background: #FEF9EF;
  border: 1px solid rgba(212, 168, 67, 0.2);
}

.transcript-msg.trainee .text {
  background: #EFF6FF;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.transcript-msg strong {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.125rem;
}

/* ===== Coach Panel ===== */
.coach-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: 400px;
  border: 2px solid rgba(212, 168, 67, 0.25);
}

.coach-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.06) 0%, transparent 100%);
}

.coach-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

.coach-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.12);
  color: var(--accent);
}

.coach-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.coach-body::-webkit-scrollbar { width: 6px; }
.coach-body::-webkit-scrollbar-track { background: transparent; }
.coach-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.coach-tip {
  animation: fadeInUp 0.3s ease;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
}

.coach-tip.intro {
  background: transparent;
  padding: 0;
}

.coach-tip.intro .coach-explanation {
  color: var(--text-light);
  font-style: italic;
  font-size: 0.8rem;
}

.coach-tip.tip {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.08) 0%, rgba(212, 168, 67, 0.03) 100%);
  border-left: 3px solid var(--accent);
}

.coach-suggestion {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.375rem;
  font-style: italic;
}

.coach-explanation {
  color: var(--text);
  font-size: 0.825rem;
}

.coach-thinking-dots {
  display: flex;
  gap: 4px;
  padding: 0.25rem 0;
}

.coach-thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: coachDot 1.2s ease-in-out infinite;
}

.coach-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.coach-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes coachDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ===== Scenario Briefing Overlay ===== */
.briefing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 12, 20, .85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .3s ease;
}
.briefing-overlay.active {
  display: flex;
}
.briefing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp .4s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.briefing-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.briefing-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(13, 148, 136, .12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.briefing-icon svg { width: 22px; height: 22px; }
.briefing-scenario-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.briefing-character {
  font-size: .82rem;
  color: var(--text-light);
  margin-top: 2px;
}
.briefing-section {
  margin-bottom: 16px;
}
.briefing-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.briefing-text {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.6;
}
.briefing-steps {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  margin: 0;
}
.briefing-steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.5;
}
.briefing-steps li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(13, 148, 136, .12);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.briefing-start {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ===== Desk Reference Panel ===== */
.desk-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: 400px;
  border: 1px solid rgba(212, 168, 67, .15);
}
.desk-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.desk-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}
.desk-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.desk-tab {
  flex: 1;
  padding: 0.5rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition);
  white-space: nowrap;
}
.desk-tab:hover { color: var(--text); background: rgba(0,0,0,.02); }
.desk-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.desk-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}
.desk-body::-webkit-scrollbar { width: 6px; }
.desk-body::-webkit-scrollbar-track { background: transparent; }
.desk-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.desk-pane { display: none; }
.desk-pane.active { display: block; }
.desk-empty {
  color: var(--text-light);
  font-size: 0.82rem;
  text-align: center;
  padding: 2rem 1rem;
}

/* Desk section elements */
.desk-section-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary);
  margin: 0.75rem 0 0.4rem;
}
.desk-section-header:first-child { margin-top: 0; }
.desk-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.25rem 0;
  font-size: 0.82rem;
  gap: 0.5rem;
}
.desk-field-label {
  color: var(--text-light);
  flex-shrink: 0;
}
.desk-field-value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.desk-divider {
  height: 1px;
  background: var(--border);
  margin: 0.6rem 0;
}
.desk-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-light);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  margin: 0.4rem 0;
}
.desk-note.warning {
  background: #fefce8;
  border-color: #fde68a;
  color: #92400e;
}

/* Checkboxes */
.desk-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  cursor: pointer;
}
.desk-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--secondary);
  flex-shrink: 0;
}
.desk-check-label {
  color: var(--text);
  flex: 1;
}
.desk-check-value {
  color: var(--text-light);
  font-size: 0.76rem;
  font-style: italic;
}
.desk-check.checked .desk-check-label {
  color: var(--text-light);
  text-decoration: line-through;
}

/* Text inputs */
.desk-input {
  margin: 0.3rem 0;
}
.desk-input label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
  display: block;
  margin-bottom: 0.15rem;
}
.desk-input input {
  width: 100%;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

/* Status badges */
.desk-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  padding: 0.4rem;
  border-radius: 6px;
  margin: 0.5rem 0;
}
.desk-status-denied { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.desk-status-due { background: #fefce8; color: #92400e; border: 1px solid #fde68a; }
.desk-status-approved { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Coverage bars */
.desk-coverage {
  margin: 0.35rem 0;
}
.desk-coverage-bar {
  display: flex;
  align-items: center;
  height: 22px;
  background: #f1f5f9;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.desk-coverage-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--secondary);
  opacity: 0.15;
  border-radius: 4px;
}
.desk-coverage-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  margin-left: 8px;
  z-index: 1;
}
.desk-coverage-pct {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--secondary);
  margin-left: auto;
  margin-right: 8px;
  z-index: 1;
}
.desk-coverage-ex {
  font-size: 0.74rem;
  color: var(--text-light);
  padding-left: 8px;
}

/* Billing table */
.desk-billing {
  margin: 0.3rem 0;
}
.desk-billing-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.8rem;
  color: var(--text);
  border-bottom: 1px solid #f1f5f9;
}
.desk-billing-row.credit span:last-child {
  color: var(--success);
}
.desk-billing-row:last-child { border-bottom: none; }

/* Schedule */
.desk-schedule-day {
  margin: 0.4rem 0;
}
.desk-schedule-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.desk-schedule-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.desk-slot {
  font-size: 0.76rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--secondary);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.desk-slot:hover {
  background: var(--secondary);
  color: #fff;
}

/* Insurance card mockup */
.desk-insurance-card {
  background: linear-gradient(135deg, #1e3a5f, #2a5580);
  border-radius: 10px;
  color: #fff;
  overflow: hidden;
  margin: 0.4rem 0;
  font-size: 0.76rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.dic-header {
  padding: 0.6rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.dic-carrier {
  font-weight: 700;
  font-size: 0.85rem;
}
.dic-plan {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255,255,255,.2);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.dic-body {
  padding: 0.5rem 0.75rem;
}
.dic-row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}
.dic-label {
  color: rgba(255,255,255,.75);
  font-size: 0.74rem;
}
.dic-value {
  font-weight: 600;
  font-size: 0.74rem;
}
.dic-footer {
  padding: 0.4rem 0.75rem;
  background: rgba(0,0,0,.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: rgba(255,255,255,.5);
}
.dic-phone {
  color: #fff;
  font-weight: 600;
}

/* ===== Script Steps ===== */
.desk-script-step {
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--secondary);
  padding-left: 0.65rem;
}
.desk-script-step:last-child { margin-bottom: 0; }
.desk-script-step-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.desk-script-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.desk-script-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}
.desk-script-lines {
  padding-left: 28px;
}
.desk-script-line {
  font-size: 0.82rem;
  color: var(--primary);
  line-height: 1.55;
  padding: 0.15rem 0;
}
.desk-script-line em {
  color: var(--text-light);
  font-style: italic;
}

/* ===== Pause Overlay ===== */
.pause-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 12, 20, .88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .3s ease;
}
.pause-overlay.active {
  display: flex;
}
.pause-card {
  background: #162032;
  border: 1px solid rgba(212, 168, 67, .25);
  border-radius: 16px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: slideUp .4s cubic-bezier(.16,1,.3,1);
}
.pause-icon {
  color: var(--accent);
  margin-bottom: 16px;
}
.pause-icon svg {
  width: 48px;
  height: 48px;
}
.pause-card h3 {
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 8px;
}
.pause-card > p {
  font-size: .92rem;
  color: #b0bec5;
  line-height: 1.6;
  margin-bottom: 20px;
}
.pause-briefing {
  text-align: left;
  background: rgba(13, 148, 136, .1);
  border: 1px solid rgba(13, 148, 136, .25);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  max-height: 280px;
  overflow-y: auto;
}
.pause-briefing:empty {
  display: none;
}
.pause-briefing .pb-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.pause-briefing .pb-text {
  font-size: .88rem;
  color: #e0e6ed;
  line-height: 1.6;
  margin-bottom: 14px;
}
.pause-briefing .pb-text:last-child {
  margin-bottom: 0;
}
#pause-btn.paused {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Responsive — panels stack on smaller screens ===== */
@media (max-width: 1300px) {
  .call-panels {
    grid-template-columns: 1fr 1fr;
  }
  .desk-panel { grid-column: 1 / -1; max-height: 300px; }
}
@media (max-width: 768px) {
  .call-panels {
    grid-template-columns: 1fr;
  }
  .desk-panel { order: 0; max-height: 280px; }
}
