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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 30px;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Unificado - Fase 4 */
.header-unified {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    min-height: 70px;
}

/* Sección Izquierda - Título */
.header-left {
    flex-shrink: 0;
}

.header-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Sección Central - Navegación */
.header-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    flex-grow: 1;
}

/* Sección Derecha - Botón Logout */
.header-right {
    flex-shrink: 0;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Tabs de Navegación */
.nav-tab {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 1rem;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
}

.tab-content {
    display: none;
}

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

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

/* Dashboard */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.summary-card h3 {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.summary-stats p {
    margin: 10px 0;
    font-size: 1rem;
}

.summary-stats strong {
    font-size: 1.5rem;
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Tables */
.data-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

td {
    padding: 15px;
    border-top: 1px solid #eee;
}

tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

.status-busy {
    background: #fff3cd;
    color: #856404;
}

.status-offline {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Error/Success Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-top: 15px;
}

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

/* Stats Content */
.stats-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filters {
    display: flex;
    gap: 15px;
}

.form-select {
    width: auto;
    min-width: 200px;
}

/* Form Row Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.875rem;
}

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

/* ==================== Active Conversations Section ==================== */

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Forzar 5 columnas en una línea */
    gap: 1rem; /* Reducido de 20px a 1rem para más espacio */
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 1rem; /* Reducido de 20px para ser más compacto */
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.8rem; /* Reducido de 0.9rem para ocupar menos espacio */
    color: #666;
    margin-bottom: 8px; /* Reducido de 10px */
}

.stat-value {
    font-size: 1.8rem; /* Reducido de 2rem para ser más compacto */
    font-weight: bold;
    color: #667eea;
}

.stat-card-warning .stat-value {
    color: #ffc107;
}

.stat-card-info .stat-value {
    color: #17a2b8;
}

.stat-card-success .stat-value {
    color: #28a745;
}

/* Tab Controls */
.tab-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tab-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.update-indicator {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Full-Width Cards Layout (for monitoring sections) */
.full-width-cards-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.full-width-card {
    width: 100%;
    max-width: 100%;
}

/* Panel Styling */
.panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.panel-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

/* Date Filter */
.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.date-filter label {
    margin: 0;
    font-weight: 500;
}

.date-filter input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.date-filter input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.panel-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

/* Orphan Row Highlight */
.orphan-row {
    background-color: #fff3cd !important;
}

.orphan-row:hover {
    background-color: #ffe69c !important;
}

.badge-orphan {
    display: inline-block;
    padding: 3px 8px;
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    border-radius: 12px;
    margin-left: 5px;
    cursor: help;
}

/* Activity Indicators */
.activity-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.activity-recent {
    background: #d4edda;
    color: #155724;
}

.activity-moderate {
    background: #fff3cd;
    color: #856404;
}

.activity-old {
    background: #f8d7da;
    color: #721c24;
}

/* Priority Badges */
.priority-critical {
    background: #dc3545;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.priority-high {
    background: #ffc107;
    color: #333;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.priority-medium {
    background: #17a2b8;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.priority-low {
    background: #6c757d;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Service Hours Schedule Table */
.schedule-table {
    overflow-x: auto;
    margin: 15px 0;
}

.schedule-table table {
    width: 100%;
    font-size: 0.9rem;
}

.schedule-table td, .schedule-table th {
    padding: 8px;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-control-sm {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-control-sm:disabled {
    background-color: #e9ecef;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Badges for Service Hours and Conversations */
.status-unavailable {
    background: #f8d7da;
    color: #721c24;
}

.status-initiated {
    background: #e2e3e5;
    color: #383d41;
}

.status-bot_diagnosing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-waiting_for_agent {
    background: #fff3cd;
    color: #856404;
}

.status-assigned_to_agent {
    background: #cfe2ff;
    color: #084298;
}

.status-in_progress {
    background: #d1e7dd;
    color: #0f5132;
}

.status-resolved {
    background: #d4edda;
    color: #155724;
}

.status-ticket_created {
    background: #d1ecf1;
    color: #0c5460;
}

.status-closed {
    background: #f8d7da;
    color: #721c24;
}

/* GLPI Ticket Links */
.ticket-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ticket-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.ticket-number {
    font-weight: 500;
    color: #3498db;
}

.text-muted {
    color: #95a5a6;
    font-style: italic;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Toast animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Alert Styling */
.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-top: 15px;
}

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

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

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

/* Config Section Styling (for existing config tab compatibility) */
.config-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.config-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.config-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Agent Number Column Styling */
.agent-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    min-width: 60px;
    font-size: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    /* 3 columnas en tablets */
    .stats-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Header Unificado Responsive */
    .header-unified {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        min-height: auto;
        gap: 1rem;
    }

    .header-left {
        text-align: center;
    }

    .header-title {
        font-size: 1.2rem;
    }

    .header-nav {
        flex-direction: column;
    }

    .nav-tab {
        width: 100%;
        text-align: center;
    }

    .header-right {
        text-align: center;
    }

    .logout-btn {
        width: 100%;
    }

    /* Otros ajustes responsive existentes */
    .stats-cards {
        grid-template-columns: 1fr; /* 1 columna en móviles */
    }

    .tab-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .schedule-table {
        font-size: 0.8rem;
    }
}

/* ============================================================================
   TIMEOUTS CONFIGURATION SECTION
   ============================================================================ */

.timeout-config-container {
  max-width: 900px;
  margin: 20px auto;
}

.timeout-group {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.timeout-group:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #667eea;
}

.timeout-header h3 {
  margin: 0;
  color: #2d3748;
  font-size: 1.25rem;
  font-weight: 600;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  font-size: 14px;
  cursor: help;
  transition: background 0.2s ease;
}

.info-icon:hover {
  background: #5568d3;
}

.timeout-subgroup {
  margin-bottom: 20px;
}

.timeout-subgroup label {
  display: block;
  color: #4a5568;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.timeout-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.timeout-slider {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #e2e8f0, #667eea);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.timeout-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.timeout-slider::-webkit-slider-thumb:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.timeout-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.timeout-slider::-moz-range-thumb:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.timeout-value-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.timeout-value-container input[type="number"] {
  width: 70px;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  text-align: center;
  transition: border-color 0.2s ease;
}

.timeout-value-container input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
}

.timeout-unit {
  color: #718096;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.timeout-description {
  background: #fff5f5;
  border-left: 4px solid #fc8181;
  padding: 12px 16px;
  margin-top: 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #2d3748;
}

.impact-label {
  font-weight: 700;
  color: #c53030;
  margin-right: 8px;
}

.timeout-range {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #718096;
  font-style: italic;
}

.timeout-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e2e8f0;
}

.timeout-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.timeout-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.timeout-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.timeout-actions .btn-primary:active {
  transform: translateY(0);
}

.timeout-actions .btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.timeout-actions .btn-secondary:hover {
  background: #f7fafc;
  transform: translateY(-2px);
}

.save-status {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.save-status.success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.save-status.error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

.save-status.info {
  background: #bee3f8;
  color: #2c5282;
  border: 1px solid #90cdf4;
}

/* Responsive design for timeouts section */
@media (max-width: 768px) {
  .timeout-config-container {
    padding: 0 16px;
  }

  .timeout-group {
    padding: 16px;
  }

  .timeout-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .timeout-value-container {
    justify-content: center;
  }

  .timeout-actions {
    flex-direction: column;
  }

  .timeout-actions button {
    width: 100%;
  }
}

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

.timeout-group {
  animation: fadeIn 0.3s ease;
}

/* Remove spinner from number input (Chrome, Safari, Edge, Opera) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove spinner from number input (Firefox) */
input[type="number"] {
  -moz-appearance: textfield;
}

/* Especialidades - Color Badge */
.color-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
    vertical-align: middle;
    margin-right: 5px;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background-color: #27ae60;
    color: white;
}

.badge-inactive {
    background-color: #95a5a6;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.nav-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 4px;
    vertical-align: top;
}

select[multiple] {
    min-height: 100px;
}

/* Botones pequeños */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-right: 0.3rem;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* ============================================================================
   DIAGNOSIS MODAL STYLES
   ============================================================================ */

/* Diagnosis Section */
.diagnosis-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.diagnosis-section h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.diagnosis-section table {
    background: white;
    margin-bottom: 0;
}

.diagnosis-section td:first-child {
    width: 150px;
    font-weight: 600;
    color: #333;
}

/* Conversation Timeline */
.conversation-timeline {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-height: 500px;
    overflow-y: auto;
}

.conversation-timeline h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Messages List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message Item */
.message-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.message-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Message Types */
.message-item.sender-user {
    border-left-color: #3498db;
    background: #e3f2fd;
}

.message-item.sender-bot {
    border-left-color: #667eea;
    background: #ede7f6;
}

.message-item.sender-agent {
    border-left-color: #27ae60;
    background: #e8f5e9;
}

/* Message Header */
.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.sender-icon {
    font-size: 1.2rem;
}

.sender-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.message-time {
    margin-left: auto;
    color: #666;
    font-size: 0.85rem;
}

/* Message Content */
.message-content {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
}

/* Scrollbar para timeline */
.conversation-timeline::-webkit-scrollbar {
    width: 8px;
}

.conversation-timeline::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.conversation-timeline::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.conversation-timeline::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}


/* ==================== Activity Events Section ==================== */
.activity-events-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.activity-events-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.activity-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-event-item {
    display: flex;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.activity-event-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Event Types */
.activity-event-item.event-transfer {
    border-left-color: #3498db;
    background: #e3f2fd;
}

.activity-event-item.event-warning {
    border-left-color: #f39c12;
    background: #fff8e1;
}

.activity-event-item.event-expired {
    border-left-color: #e74c3c;
    background: #ffebee;
}

.activity-event-item.event-success {
    border-left-color: #27ae60;
    background: #e8f5e9;
}

.activity-event-item.event-closed {
    border-left-color: #95a5a6;
    background: #eceff1;
}

.activity-event-item.event-admin {
    border-left-color: #9b59b6;
    background: #f3e5f5;
}

.activity-event-item.event-default {
    border-left-color: #bdc3c7;
    background: #fafafa;
}

/* Event Content */
.activity-event-item .event-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}

.activity-event-item .event-content {
    flex: 1;
    min-width: 0;
}

.activity-event-item .event-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.activity-event-item .event-description {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.5;
}

.activity-event-item .event-description strong {
    color: #333;
}

.activity-event-item .event-description em {
    color: #777;
}

.activity-event-item .event-time {
    font-size: 0.8rem;
    color: #888;
    margin-top: 6px;
}
