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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #F5F7FA;
  min-height: 100vh;
  color: #333;
  transform: none !important; /* Disable body transform to fix modal positioning */
}

#app-scale-wrapper {
  transform: scale(var(--global-scale));
  transform-origin: top center;
  min-height: 100vh;
}

/* Login Screen */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  margin: 0 auto; /* Ensure horizontal centering */
}

.login-container h2 {
  margin-bottom: 30px;
  text-align: center;
  color: #0077B8;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #0077B8;
  color: white;
}

.btn-primary:hover {
  background: #005f8f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Messages */
.error-message {
  display: none; /* Hidden by default */
  color: #dc3545;
  background: #f8d7da;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  font-size: 14px;
}

.success-message {
  color: #155724;
  background: #d4edda;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  font-size: 14px;
}

.status-message {
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
  font-size: 14px;
}

/* Analytics Screen */
.analytics-screen {
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
.dashboard-header {
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
  color: #0077B8;
  font-size: 28px;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-left: 15px;
  border-left: 2px solid #e0e0e0;
}

.user-info span {
  font-size: 14px;
  color: #666;
}

/* Conversion Dashboard */
.conversion-dashboard {
  background: linear-gradient(135deg, #0077B8 0%, #1EADEF 100%);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.conversion-dashboard h2 {
  color: white;
  margin-bottom: 5px;
}

.conversion-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.metric-card.positive {
  border-left: 4px solid #28a745;
}

.metric-card.negative {
  border-left: 4px solid #dc3545;
}

.metric-card.neutral {
  border-left: 4px solid #6c757d;
}

.metric-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 600;
}

.metric-value {
  font-size: 32px;
  font-weight: bold;
  color: #333;
}

/* Filters Section */
.filters-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filters-section h3 {
  margin-bottom: 20px;
  color: #0077B8;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.filter-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-start;
}

/* Calls Section */
.calls-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.section-header h3 {
  color: #0077B8;
}

.call-count {
  font-size: 14px;
  color: #666;
}

.calls-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: none !important;
  overflow-y: visible !important;
}

/* Call Items */
.graded-call-item {
  padding: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
}

.graded-call-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.graded-call-item.positive-call-bg {
  background: #e8f5e9;
  border-left: 4px solid #28a745;
}

.graded-call-item.negative-call-bg {
  background: #ffebee;
  border-left: 4px solid #dc3545;
}

.graded-call-item.neutral-call-bg {
  background: #f5f5f5;
  border-left: 4px solid #6c757d;
}

/* Short call grey background - calls without recording */
.graded-call-item.short-call-bg {
  background: linear-gradient(135deg, #d0d0d0 0%, #b8b8b8 100%) !important;
  border-left: 4px solid #6c757d !important;
  opacity: 0.9;
}

.graded-call-item.short-call-bg h4 {
  color: #495057 !important;
}

.graded-call-item.short-call-bg .graded-call-meta {
  color: #5a5a5a !important;
}

.graded-call-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.graded-call-info h4 {
  margin-bottom: 8px;
}

.graded-call-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #666;
}

.graded-call-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.outcome-badge,
.intent-badge,
.score-badge,
.conflict-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.outcome-badge.opportunity_booked {
  background: #d4edda;
  color: #155724;
}

.outcome-badge.opportunity_not_booked,
.outcome-badge.opportunity_missed {
  background: #f8d7da;
  color: #721c24;
}

.outcome-badge.neutral {
  background: #e2e3e5;
  color: #383d41;
}

.intent-badge {
  background: #d1ecf1;
  color: #0c5460;
}

.score-badge {
  background: #f8f9fa;
  color: #495057;
}

.score-badge.high {
  background: #d4edda;
  color: #155724;
}

.score-badge.medium {
  background: #fff3cd;
  color: #856404;
}

.score-badge.low {
  background: #f8d7da;
  color: #721c24;
}

.conflict-badge {
  background: #fff3cd;
  color: #856404;
}

.graded-call-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.graded-call-detail {
  font-size: 14px;
}

.graded-call-detail strong {
  display: block;
  margin-bottom: 4px;
  color: #0077B8;
}

/* Loading & No Data */
.loading,
.no-data {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: white;
  margin: auto; /* Centers vertically and horizontally in flex container */
  padding: 0;
  border-radius: 12px;
  width: 95%;
  max-width: 1400px; /* Wider container */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-height: none !important; /* Allow content to grow beyond viewport */
  overflow: visible !important; /* Show overflow */
  display: flex;
  flex-direction: column;
}

.modal-content.grading-rules-modal-content {
  max-width: 1400px;
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #0077B8 0%, #1EADEF 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  margin: 0;
}

.close-modal,
.close-grading-rules-modal,
.close-rating-modal {
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  color: white;
  line-height: 1;
  transition: transform 0.2s;
}

.close-modal:hover,
.close-grading-rules-modal:hover,
.close-rating-modal:hover {
  transform: scale(1.2);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
  padding: 0 30px;
  overflow-x: auto;
}

.tab-btn {
  padding: 15px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.tab-btn.active {
  color: #0077B8;
  border-bottom-color: #0077B8;
  background: white;
}

.tab-content {
  display: none;
  padding: 30px;
  /* Removed overflow and max-height to eliminate inner scrollbar */
}

.tab-content.active {
  display: block;
}

/* Sections */
.section {
  margin-bottom: 30px;
}

.section h4 {
  color: #0077B8;
  margin-bottom: 15px;
  font-size: 18px;
}

.section h5 {
  color: #F1511B;
  margin-bottom: 10px;
  font-size: 16px;
}

/* Info Grid & Boxes */
.call-info-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.info-box {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid #0077B8;
}

.info-box.high-value {
  background: #fff3cd;
  border-left-color: #dc3545;
}

.info-label {
  font-size: 12px;
  color: #666;
  font-weight: 600;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.info-value {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

/* Quick Metrics */
.quick-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Conflict Warning */
.conflict-warning {
  background: #fff3cd;
  border: 2px solid #ffc107;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.conflict-warning h4 {
  color: #856404;
  margin-bottom: 10px;
}

.conflict-warning p {
  color: #856404;
  margin: 0;
}

/* Summary Text */
.summary-text,
.reasoning-text {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  line-height: 1.6;
  color: #333;
}

.coaching-note {
  margin-top: 15px;
  padding: 12px;
  background: #e7f3ff;
  border-left: 3px solid #007bff;
  border-radius: 4px;
  font-size: 14px;
  color: #004085;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

/* Script Adherence Display */
.adherence-overview {
  text-align: center;
  margin-bottom: 30px;
}

.score-display-container {
  display: inline-block;
}

.score-display {
  font-size: 48px;
  font-weight: bold;
  padding: 20px 40px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
}

.score-display.platinum {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #2c3e50;
}

.score-display.pass {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

.score-display.needs-coaching {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
}

.score-display.non-compliant {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
}

.grade-label {
  font-size: 18px;
  font-weight: 600;
  color: #666;
  margin-top: 10px;
}

/* Category Item */
.category-item {
  margin-bottom: 20px;
}

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

.category-name {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.category-score {
  font-weight: 700;
  font-size: 16px;
}

.category-score.high {
  color: #28a745;
}

.category-score.medium {
  color: #ffc107;
}

.category-score.low {
  color: #dc3545;
}

.progress-bar-container {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s;
  border-radius: 4px;
}

.progress-bar.high {
  background: #28a745;
}

.progress-bar.medium {
  background: #ffc107;
}

.progress-bar.low {
  background: #dc3545;
}

/* Checklist Item */
.checklist-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid transparent;
}

.checklist-item.pass {
  background: #e8f5e9;
  border-left-color: #28a745;
}

.checklist-item.fail {
  background: #ffebee;
  border-left-color: #ffc107;
}

.checklist-item.critical-fail {
  background: #ffcdd2;
  border-left-color: #dc3545;
}

.checklist-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.checklist-content {
  flex: 1;
}

.checklist-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.checklist-evidence {
  font-size: 14px;
  color: #666;
  font-style: italic;
  margin-top: 5px;
}

/* Coaching Suggestions */
.coaching-priority-section {
  margin-bottom: 30px;
}

.coaching-priority-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

.priority-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.priority-badge.high {
  background: #ffebee;
  color: #c62828;
}

.priority-badge.medium {
  background: #fff3e0;
  color: #ef6c00;
}

.priority-badge.low {
  background: #e3f2fd;
  color: #1565c0;
}

.priority-badge.positive {
  background: #e8f5e9;
  color: #2e7d32;
}

.coaching-priority-title {
  font-size: 14px;
  color: #666;
  flex: 1;
}

.coaching-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coaching-suggestion {
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.coaching-suggestion.high {
  background: #ffebee;
  border-left-color: #c62828;
}

.coaching-suggestion.medium {
  background: #fff3e0;
  border-left-color: #ef6c00;
}

.coaching-suggestion.low {
  background: #e3f2fd;
  border-left-color: #1565c0;
}

.coaching-suggestion.positive {
  background: #e8f5e9;
  border-left-color: #2e7d32;
}

.suggestion-text {
  color: #333;
  line-height: 1.6;
  font-size: 14px;
}

/* Skill Item */
.skill-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-name {
  font-weight: 600;
  color: #333;
}

.skill-score {
  font-size: 18px;
  font-weight: 700;
  color: #0077B8;
}

/* Quality Flags */
.quality-flag {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-right: 10px;
  margin-bottom: 10px;
}

.quality-flag.management-review {
  background: #fff3cd;
  color: #856404;
}

.quality-flag.positive-example {
  background: #d4edda;
  color: #155724;
}

/* Transcript - Speech Bubble Style */
.transcript-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.transcript-utterance {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeInUp 0.3s ease-out;
}

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

.transcript-utterance.agent {
  align-self: flex-start;
}

.transcript-utterance.customer {
  align-self: flex-end;
}

.transcript-speaker {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 12px;
  padding: 0 12px;
}

.transcript-utterance.agent .transcript-speaker {
  color: #0056b3;
}

.transcript-utterance.customer .transcript-speaker {
  color: #1e7e34;
  text-align: right;
}

.transcript-timestamp {
  font-size: 11px;
  color: #888;
  margin-left: 8px;
  font-weight: 400;
}

.speech-bubble {
  position: relative;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.transcript-utterance.agent .speech-bubble {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1a237e;
  border-bottom-left-radius: 4px;
  margin-left: 8px;
}

.transcript-utterance.agent .speech-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-right-color: #bbdefb;
  border-left: 0;
  border-bottom: 0;
}

.transcript-utterance.customer .speech-bubble {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #1b5e20;
  border-bottom-right-radius: 4px;
  margin-right: 8px;
}

.transcript-utterance.customer .speech-bubble::before {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-left-color: #c8e6c9;
  border-right: 0;
  border-bottom: 0;
}

.transcript-text {
  margin: 0;
  line-height: 1.6;
  color: inherit;
  font-size: 14px;
}

/* Notes */
#notesList {
  margin-bottom: 20px;
}

.add-note-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 2px dashed #e0e0e0;
}

.add-note-section textarea {
  width: 100%;
  margin-bottom: 15px;
}

.note-hint {
  font-size: 12px;
  color: #666;
  margin-top: 10px;
  font-style: italic;
}

/* Grading Rules Editor */
.grading-rules-info {
  background: #e7f3ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.grading-rules-info ul {
  margin: 10px 0 10px 20px;
}

.grading-rules-info li {
  margin: 5px 0;
}

.grading-rules-editor-container {
  margin-bottom: 20px;
}

.editor-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #666;
}

.grading-rules-editor {
  width: 100%;
  min-height: 500px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  resize: vertical;
}

.grading-rules-editor:focus {
  outline: none;
  border-color: #0077B8;
}

/* Rating Change Modal */
.rating-change-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

/* Graded At Banner - Coaching Tab */
.graded-at-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #1976d2;
}

.graded-at-icon {
  font-size: 20px;
}

.graded-at-text {
  font-size: 14px;
  color: #1565c0;
}

.graded-at-text strong {
  color: #0d47a1;
}

/* Call ID Overflow Fix */
#modalCallId {
  word-break: break-all;
  overflow-wrap: break-word;
  font-size: 14px;
  max-width: 100%;
}

.call-info-grid .info-box:first-child .info-value {
  word-break: break-all;
  overflow-wrap: break-word;
  font-size: 13px;
  line-height: 1.4;
}

/* Audio Waveform Player */
.waveform-player-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.waveform-container {
  position: relative;
  width: 100%;
  height: 80px;
  background: linear-gradient(180deg, #f0f4f8 0%, #e8ecf0 100%);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
}

.waveform-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(102, 126, 234, 0.3);
  pointer-events: none;
  transition: width 0.1s linear;
}

.waveform-cursor {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #667eea;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.5);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.play-pause-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077B8 0%, #1EADEF 100%);
  border: none;
  cursor: pointer;
  color: white;
  font-size: 20px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.play-pause-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.play-pause-btn:active {
  transform: scale(0.98);
}

.time-display {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  color: #333;
  min-width: 100px;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-control label {
  font-size: 12px;
  color: #666;
}

.speed-control select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: white;
  cursor: pointer;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-control input[type="range"] {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  border-radius: 2px;
  cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #0077B8;
  border-radius: 50%;
  cursor: pointer;
}

.download-btn {
  margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .header-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  
  .user-info {
    flex-direction: column;
    border-left: none;
    border-top: 2px solid #e0e0e0;
    padding-left: 0;
    padding-top: 15px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .call-info-grid {
    grid-template-columns: 1fr;
  }
  
  .graded-call-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .tabs {
    overflow-x: auto;
  }
  
  .modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
  
  .tab-content {
    max-height: calc(100vh - 250px);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* ======================================
   ANALYTICS UI FIXES - NOV 19 2025
   ====================================== */

/* Company Conversion Cards */
.conversion-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.company-conversion-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.company-conversion-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.company-conversion-card h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  font-weight: 600;
  opacity: 0.9;
  color: white;
}

.conversion-rate-large {
  font-size: 56px;
  font-weight: bold;
  margin: 15px 0;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.conversion-details {
  font-size: 16px;
  opacity: 0.8;
  margin-top: 10px;
  color: white;
}

/* Agent Leaderboard */
.agent-leaderboard-section {
  background: linear-gradient(135deg, #0077B8 0%, #1EADEF 100%);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  color: white;
}

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

.agent-card {
  display: flex;
  align-items: center;
  padding: 20px 25px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-left: 5px solid transparent;
}

.agent-card:hover {
  transform: translateX(8px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.agent-card.green {
  background: rgba(76, 175, 80, 0.25);
  border-left-color: #4caf50;
}

.agent-card.yellow {
  background: rgba(255, 193, 7, 0.25);
  border-left-color: #ffc107;
}

.agent-card.red {
  background: rgba(244, 67, 54, 0.25);
  border-left-color: #f44336;
}

.agent-rank {
  font-size: 32px;
  font-weight: bold;
  margin-right: 25px;
  min-width: 60px;
  text-align: center;
  opacity: 0.7;
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 5px;
}

.agent-stats {
  font-size: 14px;
  opacity: 0.85;
}

.agent-rate {
  font-size: 40px;
  font-weight: bold;
  margin-left: 20px;
  min-width: 120px;
  text-align: right;
}

.no-data {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  opacity: 0.7;
}

/* Call Status Indicators */
.call-card {
  position: relative;
}

.call-status-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
}

.status-graded {
  color: #4caf50;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-pending {
  color: #ff9800;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .agent-card {
    flex-direction: column;
    text-align: center;
  }
  
  .agent-rank {
    margin: 0 0 10px 0;
  }
  
  .agent-rate {
    margin: 10px 0 0 0;
    text-align: center;
  }
  
  .conversion-rate-large {
    font-size: 42px;
  }
}

/* Compact Mode & Toggles - Dec 8 Fix */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.compact-section {
  padding: 15px 20px !important;
  margin-bottom: 20px !important;
  min-height: 60px;
}

.compact-section h2 {
  font-size: 18px !important;
  margin: 0 !important;
}

/* Compact Conversion Cards */
.compact-section .company-conversion-card {
  padding: 15px !important;
}

.compact-section .conversion-rate-large {
  font-size: 32px !important;
  margin: 5px 0 !important;
}

.compact-section .company-conversion-card h3 {
  font-size: 15px !important;
  margin-bottom: 5px !important;
}

.compact-section .conversion-details {
  font-size: 13px !important;
  margin-top: 5px !important;
}

.compact-section .conversion-metrics-grid {
  margin-top: 10px !important;
  gap: 15px !important;
}

/* Compact Leaderboard */
.compact-section .agent-card {
  padding: 10px 15px !important;
  min-height: auto !important;
}

.compact-section .agent-rank {
  font-size: 20px !important;
  margin-right: 15px !important;
  min-width: 30px !important;
}

.compact-section .agent-name {
  font-size: 16px !important;
  margin-bottom: 2px !important;
}

.compact-section .agent-stats {
  font-size: 12px !important;
}

.compact-section .agent-rate {
  font-size: 24px !important;
  min-width: 80px !important;
}
