/* Session Status Component */
.session-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Logout Button in Topbar */
#topbar #logoutBtn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
  background: rgba(244, 67, 54, 0.1);
  color: #c62828;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

#topbar #logoutBtn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
  transform: translateY(-1px);
}

.session-status:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.session-indicator {
  font-size: 12px;
  transition: color 0.3s ease;
}

.session-indicator.connected {
  color: #4caf50;
  animation: pulse 2s infinite;
}

.session-indicator.disconnected {
  color: #f44336;
}

.session-indicator.checking {
  color: #ff9800;
  animation: spin 1s linear infinite;
}

.session-status.connected {
  background: rgba(76, 175, 80, 0.1);
  color: #2e7d32;
}

.session-status.disconnected {
  background: rgba(244, 67, 54, 0.1);
  color: #c62828;
}

.session-status.checking {
  background: rgba(255, 152, 0, 0.1);
  color: #ef6c00;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* Card Component */
.card {
  background: var(--bs-white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(30,60,90,0.07);
  padding: 28px 24px 24px 24px;
  margin-bottom: 28px;
  border: 1px solid var(--bs-gray);
}

/* Call Type Badge Component */
.call-type-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
  text-align: center;
  min-width: 120px;
}

.report-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card h2 {
  margin-top: 0;
}

/* Analysis Progress Components */
.analysis-progress {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
}

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

.progress-header h3 {
  margin: 0;
  color: var(--bs-primary);
  font-size: 1.2em;
}

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

.progress-stats span {
  font-size: 0.9em;
  color: #666;
}

.progress-bar-container {
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-success));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.batch-progress {
  margin-bottom: 16px;
}

.batch-info {
  font-weight: 600;
  color: var(--bs-primary);
  margin-bottom: 12px;
}

.intermediate-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  background: white;
}

.intermediate-result {
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
}

.intermediate-result:last-child {
  border-bottom: none;
}

.intermediate-result.latest {
  background: #e8f5e8;
  margin: 0 -12px;
  padding: 8px 12px;
  border-radius: 4px;
}

.result-header {
  font-weight: 600;
  color: var(--bs-primary);
  font-size: 0.9em;
  margin-bottom: 4px;
}

.result-preview {
  font-size: 0.85em;
  color: #666;
  line-height: 1.4;
}

.cancel-button-container {
  text-align: center;
}

.cancel-btn {
  background: var(--bs-error);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.cancel-btn:hover {
  background: #c82333;
}

/* Analysis Results */
.analysis-results {
  margin-top: 20px;
}

.analysis-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bs-primary);
}

.analysis-header h3 {
  margin: 0 0 8px 0;
  color: var(--bs-primary);
}

.analysis-period {
  margin: 0;
  color: #666;
  font-style: italic;
}

.structured-analysis {
  line-height: 1.6;
}

.analysis-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--bs-primary);
}

.analysis-section h4 {
  margin: 0 0 12px 0;
  color: var(--bs-primary);
  font-size: 1.1em;
}

.findings-list,
.patterns-list,
.recommendations-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.findings-list li,
.patterns-list li,
.recommendations-list li {
  margin-bottom: 12px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
  margin-left: 8px;
}

.severity-badge.high {
  background: #f8d7da;
  color: #721c24;
}

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

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

.evidence,
.benefit {
  margin-top: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.9em;
  color: #666;
}

.target-area {
  color: var(--bs-primary);
  font-weight: 600;
  margin-left: 8px;
}

.custom-prompt-response {
  background: white;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.custom-prompt-response .prompt,
.custom-prompt-response .response {
  margin-bottom: 12px;
}

.custom-prompt-response .prompt strong,
.custom-prompt-response .response strong {
  color: var(--bs-primary);
}

.plain-analysis {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.plain-analysis pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  line-height: 1.5;
}

/* Saved Results Dialog */
.saved-results-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.dialog-content h3 {
  margin: 0 0 12px 0;
  color: var(--bs-primary);
}

.dialog-content p {
  margin: 0 0 20px 0;
  color: #666;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.dialog-actions .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.dialog-actions .btn-primary {
  background: var(--bs-primary);
  color: white;
}

.dialog-actions .btn-primary:hover {
  background: #0056b3;
}

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

.dialog-actions .btn-secondary:hover {
  background: #545b62;
}

/* File Upload Components */
.metadata-section {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 0;
}

.file-upload-section {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 0;
}

.file-item {
  border: 1px solid var(--bs-gray);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  background: #f9fbfd;
}

.file-name {
  font-weight: bold;
  margin-bottom: 10px;
}

.remove-file {
  background: var(--bs-error);
  color: white;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 3px;
  float: right;
  font-size: 0.95em;
}

.remove-file:hover {
  background: #c0392b;
}

.drag-area {
  border: 2px dashed var(--bs-primary);
  border-radius: 5px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
  transition: background-color 0.3s;
  background: #f0f8ff;
}

.drag-area.active {
  background-color: #e6f3ff;
}

#filesList {
  margin-top: 20px;
}

.metadata-display {
  background: #e6e6e6;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

.edit-metadata {
  background: #6c757d;
  float: right;
  padding: 3px 8px;
  margin-top: -3px;
}

/* Search Results Styles */
.search-results-header {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bs-bg);
  border-radius: 8px;
  border: 1px solid var(--bs-gray);
}

.search-results-header h3 {
  margin: 0;
  color: var(--bs-heading);
  font-size: 1.2em;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Enhanced Search Result Cards */
.search-result-card {
  background: var(--bs-white);
  border: 1px solid var(--bs-gray);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-result-card:hover {
  box-shadow: 0 4px 12px rgba(30, 60, 90, 0.15);
  border-color: var(--bs-primary);
  transform: translateY(-2px);
}

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

.search-result-card .agent-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-card .agent-name {
  margin: 0;
  font-size: 1.2em;
  color: var(--bs-heading);
  font-weight: 600;
}

.search-result-card .team-badge {
  background: #e6f3ff;
  color: var(--bs-primary);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
  display: inline-block;
  width: fit-content;
}

.search-result-card .score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.search-result-card .score-value {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--bs-primary);
}

.search-result-card .score-bar {
  width: 60px;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.search-result-card .score-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--score);
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-success));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.search-result-card .card-body {
  margin-bottom: 16px;
}

.search-result-card .call-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.search-result-card .call-type {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-card .call-type.badge-life {
  background: #d4edda;
  color: #155724;
}

.search-result-card .call-type.badge-home {
  background: #d1ecf1;
  color: #0c5460;
}

.search-result-card .call-type.badge-retentions {
  background: #fff3cd;
  color: #856404;
}

.search-result-card .call-type.badge-wills {
  background: #e2e3e5;
  color: #383d41;
}

.search-result-card .call-type.badge-general {
  background: #f8d7da;
  color: #721c24;
}

.search-result-card .duration,
.search-result-card .date {
  color: #6c757d;
  font-size: 0.9em;
  font-weight: 500;
}

.search-result-card .qa-status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-card .qa-status.status-passed {
  background: #d4edda;
  color: #155724;
}

.search-result-card .qa-status.status-warning {
  background: #fff3cd;
  color: #856404;
}

.search-result-card .qa-status.status-failed {
  background: #f8d7da;
  color: #721c24;
}

.search-result-card .qa-status.status-pending {
  background: #d1ecf1;
  color: #0c5460;
}

.search-result-card .call-preview {
  color: #6c757d;
  font-size: 0.95em;
  line-height: 1.4;
  margin: 0;
  font-style: italic;
}

.search-result-card .card-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.search-result-card .btn {
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.search-result-card .btn-primary {
  background: var(--bs-primary);
  color: var(--bs-white);
}

.search-result-card .btn-primary:hover {
  background: var(--bs-accent);
  transform: translateY(-1px);
}

.search-result-card .btn-secondary {
  background: #f8f9fa;
  color: var(--bs-heading);
  border: 1px solid #dee2e6;
}

.search-result-card .btn-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* Legacy search result item styles (for backward compatibility) */
.search-result-item {
  background: var(--bs-white);
  border: 1px solid var(--bs-gray);
  border-radius: 8px;
  padding: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-result-item:hover {
  box-shadow: 0 2px 8px rgba(30, 60, 90, 0.1);
  border-color: var(--bs-primary);
}

.search-result-item .result-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.search-result-item .result-info {
  flex: 1;
}

.search-result-item .result-info > div {
  margin-bottom: 4px;
  color: var(--bs-heading);
  font-size: 0.95em;
}

.search-result-item .result-info > div:last-child {
  margin-bottom: 0;
}

.search-result-item .result-actions {
  display: flex;
  gap: 8px;
}

.search-result-item .btn {
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.search-result-item .btn-primary {
  background: var(--bs-primary);
  color: var(--bs-white);
}

.search-result-item .btn-primary:hover {
  background: var(--bs-accent);
  box-shadow: 0 2px 8px rgba(30, 60, 90, 0.1);
}

.search-result-item .btn-secondary {
  background: var(--bs-gray);
  color: var(--bs-heading);
}

.search-result-item .btn-secondary:hover {
  background: #d4d9df;
}

/* Enhanced Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px dashed #dee2e6;
  margin: 20px 0;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.7;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #495057;
  margin: 0 0 12px 0;
}

.empty-message {
  font-size: 1.1rem;
  color: #6c757d;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.empty-suggestions {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.suggestions-title {
  font-weight: 600;
  color: #495057;
  margin: 0 0 12px 0;
  font-size: 1rem;
}

.suggestions-list {
  margin: 0;
  padding-left: 20px;
  color: #6c757d;
}

.suggestions-list li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.empty-action-btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: white;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.empty-action-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  transform: translateY(-1px);
}

/* Legacy search no results (for backward compatibility) */
.search-no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

.search-no-results p {
  margin: 0;
  font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .search-result-item .result-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .search-result-item .result-actions {
    width: 100%;
  }
  
  .search-result-item .btn {
    flex: 1;
  }
}

/* Agent Transcript Analysis Styles */
.analysis-results {
  background: var(--bs-white);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
  border: 1px solid var(--bs-gray);
}

.analysis-header h4 {
  color: var(--bs-heading);
  margin-bottom: 16px;
  font-size: 1.2em;
}

.analysis-content {
  line-height: 1.6;
}

.analysis-section {
  margin-bottom: 24px;
}

.analysis-section:last-child {
  margin-bottom: 0;
}

.analysis-section h5 {
  color: var(--bs-primary);
  margin-bottom: 12px;
  font-size: 1.1em;
  font-weight: 600;
}

.analysis-section ul {
  margin: 0;
  padding-left: 20px;
}

.analysis-section li {
  margin-bottom: 8px;
}

.analysis-section li:last-child {
  margin-bottom: 0;
}

.severity {
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.severity.high {
  background: #fee;
  color: #c53030;
}

.severity.medium {
  background: #fff8dc;
  color: #d69e2e;
}

.severity.low {
  background: #f0fff4;
  color: #38a169;
}

.evidence {
  color: #666;
  font-size: 0.95em;
  font-style: italic;
}

.supporting-examples {
  margin-top: 8px;
  padding-left: 16px;
}

.supporting-examples li {
  color: #666;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.target-area {
  color: var(--bs-primary);
  font-size: 0.9em;
  font-weight: 500;
}

.benefit {
  color: #38a169;
  font-size: 0.95em;
  font-style: italic;
}

.custom-prompt-response {
  background: #f7fafc;
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
}

.custom-prompt-response .prompt {
  margin-bottom: 8px;
  color: var(--bs-heading);
}

.custom-prompt-response .response {
  color: #2d3748;
}

.analysis-text {
  background: #f7fafc;
  border-radius: 6px;
  padding: 16px;
  margin: 0;
  white-space: pre-wrap;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--bs-heading);
}

.status-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bs-primary);
  font-weight: 500;
}

.status-loading .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.status-success {
  color: #38a169;
  font-weight: 500;
}

.status-error {
  color: var(--bs-error);
  font-weight: 500;
}

/* QA Results Styling */
.qa-results-table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 18px;
  background: var(--bs-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(30,60,90,0.04);
}

.qa-results-table th,
.qa-results-table td {
  border: 1px solid var(--bs-gray);
  padding: 10px 8px;
  text-align: left;
  font-size: 1rem;
}

.qa-results-table th {
  background-color: var(--bs-bg);
  color: var(--bs-heading);
  font-weight: 600;
}

.qa-results-table tr:nth-child(even) {
  background-color: #f7fafc;
}

.qa-results-table tr:hover {
  background-color: #e6f3ff;
}

.qa-results-table .error-cell {
  color: var(--bs-error);
  font-style: italic;
}

/* Agent Section Styling */
.agent-section {
  margin-top: 32px;
  margin-bottom: 8px;
  background: #f7fafc;
  border-radius: 8px;
  padding: 12px 18px;
}

.agent-stats {
  font-size: 0.98em;
}

/* Flagged Calls Styling */
.flagged-calls-warning {
  background: #fff3cd;
  border: 2px solid #f7931e;
  border-radius: 8px;
  padding: 18px 18px 10px 18px;
  margin-bottom: 18px;
}

.flagged-calls-warning .warning-title {
  color: #e67e22;
  font-weight: bold;
}

.flagged-calls-warning table {
  margin-bottom: 18px;
}

.flagged-calls-warning table th,
.flagged-calls-warning table td {
  padding: 8px 12px;
  border: 1px solid #f7931e;
}

.flagged-calls-warning table th {
  background-color: #fef5e7;
  color: #d68910;
  font-weight: 600;
}

/* Section Results Styling */
.section-results-container {
  margin-top: 20px;
}

.section-header {
  margin-top: 24px;
  margin-bottom: 8px;
  background: #f7fafc;
  border-radius: 8px;
  padding: 12px 18px;
}

.section-criteria-table {
  margin-bottom: 18px;
}

.section-criteria-table th,
.section-criteria-table td {
  padding: 8px 12px;
  border: 1px solid var(--bs-gray);
}

.section-criteria-table th {
  background-color: var(--bs-bg);
  color: var(--bs-heading);
  font-weight: 600;
}

.section-criteria-table tr:nth-child(even) {
  background-color: #f7fafc;
}

.section-criteria-table tr:hover {
  background-color: #e6f3ff;
}

/* Button Styling for QA Actions */
.viewQaDetailBtn,
.viewTranscriptBtn,
.viewFailuresBtn {
  background: var(--bs-primary);
  color: var(--bs-white);
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-right: 4px;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.viewQaDetailBtn:hover,
.viewTranscriptBtn:hover,
.viewFailuresBtn:hover {
  background: var(--bs-accent);
}

.viewQaDetailBtn:disabled,
.viewTranscriptBtn:disabled,
.viewFailuresBtn:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

/* QA Detail Modal Styling */
.qa-detail-modal .modal-content {
  max-width: 900px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.qa-detail-modal h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--bs-heading);
}

.qa-detail-modal h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--bs-heading);
}

.qa-detail-modal table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.qa-detail-modal table th,
.qa-detail-modal table td {
  padding: 8px 12px;
  border: 1px solid var(--bs-gray);
  text-align: left;
}

.qa-detail-modal table th {
  background-color: var(--bs-bg);
  color: var(--bs-heading);
  font-weight: 600;
}

.qa-detail-modal table tr:nth-child(even) {
  background-color: #f7fafc;
}

/* Failures Modal Styling */
.failures-modal .modal-content {
  max-width: 900px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.failures-modal h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--bs-heading);
}

.failures-modal table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.failures-modal table th,
.failures-modal table td {
  padding: 8px 12px;
  border: 1px solid var(--bs-gray);
  text-align: left;
}

.failures-modal table th {
  background-color: var(--bs-bg);
  color: var(--bs-heading);
  font-weight: 600;
}

.failures-modal table tr:nth-child(even) {
  background-color: #f7fafc;
}

/* Responsive QA Styling */
@media (max-width: 600px) {
  .qa-results-table,
  .qa-results-table th,
  .qa-results-table td {
    font-size: 0.9rem;
  }
  
  .viewQaDetailBtn,
  .viewTranscriptBtn,
  .viewFailuresBtn {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  
  .agent-section {
    padding: 8px 12px;
  }
  
  .flagged-calls-warning {
    padding: 12px 12px 8px 12px;
  }
}

/* Weekly Winners Styles */
.weekly-winners {
  margin-top: 20px;
}

.weekly-winners h3 {
  color: var(--bs-primary);
  margin-bottom: 20px;
  text-align: center;
}

.winners-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.winners-summary p {
  margin: 0;
  color: #666;
}

.winners-podium h4 {
  color: var(--bs-primary);
  margin-bottom: 20px;
  text-align: center;
}

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

.winner-card {
  background: var(--bs-white);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border: 2px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.winner-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.winner-card.rank-1 {
  border-color: #ffd700;
  background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
}

.winner-card.rank-2 {
  border-color: #c0c0c0;
  background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}

.winner-card.rank-3 {
  border-color: #cd7f32;
  background: linear-gradient(135deg, #fdf5e6 0%, #fff 100%);
}

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

.rank-badge {
  font-size: 1.2em;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.winner-name {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0;
  color: var(--bs-primary);
}

.winner-score {
  text-align: center;
  margin-bottom: 20px;
}

.score-value {
  font-size: 2.5em;
  font-weight: bold;
  display: block;
  line-height: 1;
}

.score-label {
  font-size: 0.9em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.winner-details {
  border-top: 1px solid #e9ecef;
  padding-top: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.detail-label {
  color: #666;
  font-size: 0.9em;
}

.detail-value {
  font-weight: bold;
  color: var(--bs-text);
}

.score-breakdown {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.score-breakdown h4 {
  color: var(--bs-primary);
  margin-bottom: 16px;
}

.breakdown-info ul {
  margin: 0;
  padding-left: 20px;
}

.breakdown-info li {
  margin-bottom: 5px;
  color: #666;
}

.all-agents-section {
  margin-top: 30px;
}

.all-agents-section h4 {
  color: var(--bs-primary);
  margin-bottom: 16px;
}

.no-winners {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Retentions QA Component Styles */
.retentions-qa-container {
  max-width: 100%;
}

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

.retentions-qa-actions {
  display: flex;
  gap: 10px;
}

.retentions-qa-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
}

.retentions-qa-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}

.retentions-qa-filters label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.retentions-qa-filters select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  font-size: 14px;
}

.retentions-qa-stats {
  margin-bottom: 20px;
}

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

.stat-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.retentions-qa-list {
  margin-bottom: 20px;
}

.report-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.report-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.report-item.excellent {
  border-left: 4px solid #28a745;
}

.report-item.good {
  border-left: 4px solid #17a2b8;
}

.report-item.needs-improvement {
  border-left: 4px solid #ffc107;
}

.report-item.poor {
  border-left: 4px solid #dc3545;
}

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

.report-agent {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.report-agent strong {
  font-size: 16px;
  color: #333;
}

.report-team {
  font-size: 12px;
  color: #666;
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

.report-score {
  text-align: right;
}

.score-value {
  font-size: 24px;
  font-weight: bold;
  color: #007bff;
  display: block;
}

.score-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-details {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.report-date, .report-product, .report-criteria {
  font-size: 14px;
  color: #666;
}

.report-assistants {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.assistant-badge {
  background: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.report-summary {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.retentions-details {
  max-width: 100%;
}

.retentions-details h3 {
  color: #333;
  margin-bottom: 20px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.call-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.call-info p {
  margin: 5px 0;
  font-size: 14px;
}

.assistant-section {
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.assistant-section h4 {
  background: #007bff;
  color: white;
  margin: 0;
  padding: 15px;
  font-size: 16px;
}

.criteria-list {
  padding: 0;
}

.criteria-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 15px;
}

.criteria-item:last-child {
  border-bottom: none;
}

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

.criteria-header strong {
  color: #333;
  font-size: 14px;
}

.indicator {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.indicator.yes {
  background: #d4edda;
  color: #155724;
}

.indicator.no {
  background: #f8d7da;
  color: #721c24;
}

.indicator.n/a {
  background: #fff3cd;
  color: #856404;
}

.justification {
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
  font-style: italic;
}

.quote {
  font-size: 13px;
  color: #666;
  background: #f8f9fa;
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid #007bff;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.error {
  text-align: center;
  padding: 40px 20px;
  color: #dc3545;
  background: #f8d7da;
  border-radius: 8px;
  margin: 20px 0;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.page-btn {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: #f8f9fa;
}

.page-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* Generic Modal Styles */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

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

.modal-large .modal-content {
  max-width: 90vw;
  max-height: 90vh;
  width: 90vw;
}

.modal-large .modal-body {
  max-height: 60vh;
}

/* Product Override Component */
.product-override-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 400px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.product-override-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.product-override-header h4 {
  margin: 0;
  color: #333;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: #f5f5f5;
  color: #333;
}

.current-product-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.current-product-info p {
  margin: 5px 0;
  font-size: 14px;
}

.product-selection {
  margin-bottom: 20px;
}

.product-selection label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.override-reason {
  margin-bottom: 20px;
}

.override-reason label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.override-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.override-status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Product Override Buttons in Tables */
.product-override-btn, .productOverrideBtn {
  background: #007bff;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 5px;
  transition: all 0.2s ease;
}

.product-override-btn:hover, .productOverrideBtn:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.product-override-btn:disabled, .productOverrideBtn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
}

/* Report Actions */
.report-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.report-product {
  display: inline-block;
  background: #e9ecef;
  color: #495057;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 500;
}

.override-indicator {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 500;
  border: 1px solid #ffeaa7;
  cursor: help;
}

/* Landing Screen Styles */
.landing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  min-height: 70vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.landing-header {
  text-align: center;
  margin-bottom: 50px;
}

.landing-header h1 {
  font-size: 2.5rem;
  color: var(--bs-primary);
  margin: 0 0 16px 0;
  font-weight: 700;
}

.landing-header p {
  font-size: 1.2rem;
  color: #6c757d;
  margin: 0;
  font-weight: 400;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1200px;
  width: 100%;
}

.section-card {
  background: var(--bs-white);
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.section-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--bs-primary);
}

.section-card:hover::before {
  transform: scaleX(1);
}

.section-card:active {
  transform: translateY(-4px);
}

.card-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
  transition: transform 0.3s ease;
}

.section-card:hover .card-icon {
  transform: scale(1.1);
}

.section-card h3 {
  font-size: 1.5rem;
  color: var(--bs-heading);
  margin: 0 0 16px 0;
  font-weight: 600;
}

.section-card p {
  color: #6c757d;
  line-height: 1.6;
  margin: 0;
  font-size: 1rem;
}

/* Back Button Styles */
.back-button {
  position: sticky;
  top: 80px;
  z-index: 50;
  padding: 20px 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.back-button button {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.back-button button:hover {
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sub-Landing Screen Styles */
.sub-landing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  min-height: 60vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sub-landing-header {
  text-align: center;
  margin-bottom: 40px;
}

.sub-landing-header h2 {
  font-size: 2rem;
  color: var(--bs-primary);
  margin: 0 0 12px 0;
  font-weight: 600;
}

.sub-landing-header p {
  font-size: 1.1rem;
  color: #6c757d;
  margin: 0;
  font-weight: 400;
}

.sub-landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1000px;
  width: 100%;
}

.sub-section-card {
  background: var(--bs-white);
  border-radius: 12px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.sub-section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.sub-section-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: var(--bs-primary);
}

.sub-section-card:hover::before {
  transform: scaleX(1);
}

.sub-section-card:active {
  transform: translateY(-3px);
}

.sub-section-card .card-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  display: block;
  transition: transform 0.3s ease;
}

.sub-section-card:hover .card-icon {
  transform: scale(1.05);
}

.sub-section-card h3 {
  font-size: 1.3rem;
  color: var(--bs-heading);
  margin: 0 0 12px 0;
  font-weight: 600;
}

.sub-section-card p {
  color: #6c757d;
  line-height: 1.5;
  margin: 0;
  font-size: 0.95rem;
}

/* Back to Section Button */
.back-to-section-btn {
  position: sticky;
  top: 80px;
  z-index: 50;
  padding: 15px 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 15px;
}

.back-to-section-btn button {
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.back-to-section-btn button:hover {
  transform: translateX(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Feature Container */
.feature-container {
  display: none;
}

.feature-container.active {
  display: block;
}

/* Responsive Design for Landing Screen */
@media (max-width: 768px) {
  .landing-screen {
    padding: 40px 15px;
    min-height: 60vh;
  }
  
  .landing-header h1 {
    font-size: 2rem;
  }
  
  .landing-header p {
    font-size: 1.1rem;
  }
  
  .landing-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .section-card {
    padding: 30px 20px;
  }
  
  .card-icon {
    font-size: 3rem;
  }
  
  .section-card h3 {
    font-size: 1.3rem;
  }

  /* Sub-landing responsive */
  .sub-landing-screen {
    padding: 30px 15px;
    min-height: 50vh;
  }
  
  .sub-landing-header h2 {
    font-size: 1.7rem;
  }
  
  .sub-landing-header p {
    font-size: 1rem;
  }
  
  .sub-landing-cards {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  
  .sub-section-card {
    padding: 25px 18px;
  }
  
  .sub-section-card .card-icon {
    font-size: 2.5rem;
  }
  
  .sub-section-card h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .landing-screen {
    padding: 30px 10px;
  }
  
  .section-card {
    padding: 25px 15px;
  }
  
  .card-icon {
    font-size: 2.5rem;
  }

  /* Sub-landing mobile */
  .sub-landing-screen {
    padding: 25px 10px;
  }
  
  .sub-section-card {
    padding: 20px 15px;
  }
  
  .sub-section-card .card-icon {
    font-size: 2.2rem;
  }
}

/* Enhanced Loading States */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}

.loading-state .spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--bs-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-state .loading-message {
  font-size: 1.1em;
  color: var(--bs-heading);
  margin: 0 0 8px 0;
  font-weight: 500;
}

.loading-state .loading-step {
  font-size: 0.9em;
  color: #6c757d;
  margin: 0 0 12px 0;
}

.loading-state .loading-progress {
  width: 200px;
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
  border: none;
  margin-bottom: 8px;
}

.loading-state .loading-progress::-webkit-progress-bar {
  background: #e9ecef;
  border-radius: 4px;
}

.loading-state .loading-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-success));
  border-radius: 4px;
}

.loading-state .loading-time {
  color: #6c757d;
  font-size: 0.85em;
  font-style: italic;
}