/**
 * job-monitor.css
 * Styles for Job Monitor UI
 */

/* ================================
   Container & Header
   ================================ */

.job-monitor-container {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.job-monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.job-monitor-header .header-left h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin: 12px 0 4px 0;
}

.job-monitor-header .header-left h1 i {
  color: #0d9488;
}

.job-monitor-header .header-subtitle {
  color: #64748b;
  margin: 0;
}

.job-monitor-header .header-actions {
  display: flex;
  gap: 8px;
}

.job-monitor-header .btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.job-monitor-header .btn-back:hover {
  background: #f1f5f9;
  color: #334155;
}

.job-monitor-header .btn-back i {
  width: 16px;
  height: 16px;
}

/* ================================
   Stats Grid
   ================================ */

.job-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.job-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.job-stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.job-stat-card.alert {
  border-color: #fca5a5;
  background: white;
}

.job-stat-card.alert .stat-icon.red {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: white !important;
}

.job-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-stat-card .stat-icon i {
  width: 24px;
  height: 24px;
}

.job-stat-card .stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.job-stat-card .stat-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.job-stat-card .stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.job-stat-card .stat-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.job-stat-card .stat-icon.gray { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.job-stat-card .stat-icon.purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: white; }

.job-stat-card .stat-content {
  display: flex;
  flex-direction: column;
}

.job-stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.job-stat-card .stat-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* ================================
   Filters
   ================================ */

.job-filters {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.job-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-filters .filter-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1;
}

.job-filters .filter-group select,
.job-filters .filter-group input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  min-width: 140px;
  height: 38px;
  box-sizing: border-box;
}

.job-filters .filter-group select:focus,
.job-filters .filter-group input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.job-filters .filter-group.jm-filter-search {
  flex: 1;
  min-width: 180px;
  max-width: 250px;
}

.job-filters .filter-group.jm-filter-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
  height: 38px;
  outline: none;
  box-shadow: none;
}

.job-filters .filter-search input::placeholder {
  color: #94a3b8;
}

.job-filters .filter-search input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Remove any extra border from filter-search wrapper */
.job-filters .filter-group.filter-search {
  border: none;
  background: transparent;
  padding: 0;
}

/* Ensure all filter inputs have same height */
.job-filters .filter-group select {
  height: 38px;
}

/* ================================
   Job List
   ================================ */

.job-list-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  max-height: 600px;
  overflow-y: auto;
}

.job-date-group {
  border-bottom: 1px solid #e2e8f0;
}

.job-date-group:last-child {
  border-bottom: none;
}

.job-date-group .date-label {
  padding: 12px 20px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

.job-cards {
  padding: 8px;
}

/* ================================
   Job Card
   ================================ */

.job-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.job-card:last-child {
  margin-bottom: 0;
}

.job-card:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.job-card.failed {
  background: #fef2f2;
  border-color: #fecaca;
}

.job-card.failed:hover {
  background: #fee2e2;
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.job-status-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.job-status-badge i {
  width: 18px;
  height: 18px;
}

.job-status-badge.pending { background: #f1f5f9; color: #64748b; }
.job-status-badge.running { background: #dbeafe; color: #2563eb; }
.job-status-badge.completed { background: #dcfce7; color: #16a34a; }
.job-status-badge.failed { background: #fee2e2; color: #dc2626; }
.job-status-badge.cancelled { background: #f1f5f9; color: #94a3b8; }

.job-status-badge.large {
  width: 48px;
  height: 48px;
}

.job-status-badge.large i {
  width: 24px;
  height: 24px;
}

.job-info {
  flex: 1;
  min-width: 0;
}

.job-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.job-type-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.job-type-badge.import { background: #dbeafe; color: #1d4ed8; }
.job-type-badge.validation { background: #f3e8ff; color: #7c3aed; }
.job-type-badge.enrichment { background: #fef3c7; color: #b45309; }
.job-type-badge.campaign { background: #dcfce7; color: #15803d; }
.job-type-badge.export { background: #ccfbf1; color: #0f766e; }
.job-type-badge.scheduled { background: #f1f5f9; color: #475569; }

.job-name {
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-summary {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.job-time {
  font-size: 13px;
  color: #64748b;
}

.job-duration {
  font-size: 12px;
  color: #94a3b8;
}

.job-error-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #dc2626;
  margin-top: 8px;
  padding: 4px 8px;
  background: #fee2e2;
  border-radius: 4px;
  width: fit-content;
}

.job-error-badge i {
  width: 14px;
  height: 14px;
}

.job-progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.job-progress-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ================================
   Empty State
   ================================ */

.job-list-empty {
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
}

.job-list-empty i {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.job-list-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 8px 0;
}

.job-list-empty p {
  margin: 0;
  font-size: 14px;
}

/* ================================
   Job Detail Modal
   ================================ */

.job-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
}

.job-detail-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.job-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.job-detail-header .header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.job-detail-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.job-detail-header .job-id {
  font-size: 12px;
  color: #94a3b8;
  font-family: monospace;
  margin: 4px 0 0 0;
}

.job-detail-header .btn-close {
  padding: 8px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
}

.job-detail-header .btn-close:hover {
  background: #f1f5f9;
  color: #334155;
}

/* Tabs */
.job-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.job-detail-tabs .tab-btn {
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

.job-detail-tabs .tab-btn:hover {
  color: #334155;
}

.job-detail-tabs .tab-btn.active {
  color: #0d9488;
  border-bottom-color: #0d9488;
  background: white;
}

.job-detail-tabs .tab-btn.has-errors {
  color: #dc2626;
}

.job-detail-tabs .tab-btn.has-errors.active {
  border-bottom-color: #dc2626;
}

/* Tab Content */
.job-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.tab-content {
  display: none;
}

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

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-item label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
}

.summary-item span {
  font-size: 14px;
  color: #1e293b;
}

.summary-item .status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
}

.summary-item .status-badge.completed { background: #dcfce7; color: #15803d; }
.summary-item .status-badge.failed { background: #fee2e2; color: #dc2626; }
.summary-item .status-badge.running { background: #dbeafe; color: #1d4ed8; }
.summary-item .status-badge.pending { background: #f1f5f9; color: #475569; }
.summary-item .status-badge.cancelled { background: #f1f5f9; color: #94a3b8; }

.summary-description {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.summary-description label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  display: block;
  margin-bottom: 8px;
}

.summary-description p {
  color: #334155;
  line-height: 1.6;
  margin: 0;
}

/* Data Display */
.data-display {
  background: #1e293b;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.data-display pre {
  margin: 0;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.empty-state.success {
  color: #16a34a;
}

.empty-state i {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}

/* Errors List */
.errors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.error-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

.error-index {
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  background: #fee2e2;
  padding: 2px 8px;
  border-radius: 4px;
  height: fit-content;
}

.error-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.error-row,
.error-field {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  background: white;
  border-radius: 4px;
  color: #475569;
}

.error-message {
  color: #991b1b;
  font-size: 14px;
}

.errors-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

/* Timeline */
.timeline-list {
  position: relative;
  padding-left: 24px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  border: 2px solid #0d9488;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-time {
  font-size: 12px;
  color: #94a3b8;
}

.timeline-event {
  font-weight: 500;
  color: #1e293b;
}

.timeline-details {
  font-size: 13px;
  color: #64748b;
}

/* Footer */
.job-detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 1024px) {
  .job-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .job-filters {
    flex-wrap: wrap;
  }
  
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .job-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .job-monitor-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .job-detail-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
}


/* ================================
   Enhanced Detail View Styles
   ================================ */

/* Detail Sections */
.detail-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section h4 i {
  width: 16px;
  height: 16px;
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-item label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.detail-item span {
  font-size: 14px;
  color: #1e293b;
}

.detail-item .mono {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: #64748b;
}

/* Status and Type Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge i {
  width: 14px;
  height: 14px;
}

.status-badge.completed {
  background: #dcfce7;
  color: #166534;
}

.status-badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge.pending {
  background: #f1f5f9;
  color: #475569;
}

.type-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

/* Badge variants */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-gray {
  background: #f1f5f9;
  color: #64748b;
}

.badge-amber {
  background: #fef3c7;
  color: #b45309;
}

/* Progress Indicator */
.progress-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-mini {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.result-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.result-card.error {
  background: #fef2f2;
  border-color: #fecaca;
}

.result-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.result-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.result-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.result-icon.amber {
  background: #fef3c7;
  color: #d97706;
}

.result-icon.red {
  background: #fee2e2;
  color: #dc2626;
}

.result-icon.gray {
  background: #f1f5f9;
  color: #64748b;
}

.result-icon i {
  width: 20px;
  height: 20px;
}

.result-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.result-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Success Rate */
.success-rate {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rate-bar {
  flex: 1;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.rate-fill.success {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.rate-value {
  font-size: 18px;
  font-weight: 700;
  color: #16a34a;
  min-width: 50px;
}

/* File List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.file-item i {
  width: 20px;
  height: 20px;
  color: #64748b;
  flex-shrink: 0;
  margin-top: 2px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  color: #1e293b;
  display: block;
}

.file-path {
  font-size: 12px;
  color: #94a3b8;
  font-family: 'SF Mono', Monaco, monospace;
  word-break: break-all;
}

/* Error Section */
.error-section {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  margin: -8px;
}

.error-section h4 {
  color: #991b1b;
}

.error-count {
  color: #dc2626;
  font-size: 14px;
  margin: 0 0 12px 0;
}

.error-item {
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  color: #991b1b;
  margin-top: 8px;
}

/* Logs Section */
.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.log-count {
  font-size: 13px;
  color: #64748b;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
}

.btn-small:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-small i {
  width: 14px;
  height: 14px;
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.log-entry {
  display: grid;
  grid-template-columns: 80px 60px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 13px;
  align-items: start;
}

.log-entry.log-error {
  background: #fef2f2;
}

.log-entry.log-warn {
  background: #fefce8;
}

.log-time {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 11px;
  color: #94a3b8;
}

.log-level {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}

.log-level.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.log-level.warn {
  background: #fef3c7;
  color: #b45309;
}

.log-level.error {
  background: #fee2e2;
  color: #dc2626;
}

.log-message {
  color: #1e293b;
}

.log-details {
  grid-column: span 3;
  margin-top: 8px;
}

.log-details pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  font-size: 11px;
  overflow-x: auto;
  margin: 0;
}

/* Loading and Empty States */
.loading-state,
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
}

.loading-state i,
.empty-state i,
.error-state i {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.error-state {
  color: #dc2626;
}

.error-state i {
  opacity: 1;
}

/* Spin animation for loader */
.spin {
  animation: spin 1s linear infinite;
}

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

/* Job initiated by */
.job-initiated-by {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Danger button */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-danger i {
  width: 16px;
  height: 16px;
}

/* Job list loading */
.job-list-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: #64748b;
}

.job-list-loading i {
  width: 24px;
  height: 24px;
}


/* Scheduled Job Banner */
.scheduled-job-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

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

.scheduled-info > i {
  width: 32px;
  height: 32px;
  color: #0284c7;
}

.scheduled-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scheduled-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scheduled-time {
  font-size: 16px;
  font-weight: 600;
  color: #0369a1;
}

.scheduled-details {
  display: flex;
  align-items: center;
  gap: 16px;
}

.schedule-type {
  padding: 4px 10px;
  background: #0284c7;
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.schedule-status {
  font-size: 13px;
  font-weight: 500;
}

.schedule-status.success {
  color: #059669;
}

.schedule-status.failed {
  color: #dc2626;
}

.schedule-status.pending {
  color: #64748b;
}

/* Red stat card for failed */
.job-stat-card .stat-icon.red {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
}


/* Scheduled Job Card Styling */
.job-card.scheduled {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #e9d5ff;
}

.job-card.scheduled:hover {
  border-color: #d8b4fe;
  transform: translateY(-1px);
}

.job-status-badge.scheduled {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  color: white;
}

.job-type-badge.auto_sync {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

.job-meta .scheduled-time {
  color: #7c3aed;
  font-weight: 600;
  font-size: 14px;
}

.job-meta .job-exec-time {
  color: #9333ea;
  font-size: 12px;
  font-weight: 500;
}

.job-last-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #e9d5ff;
  font-size: 12px;
  font-weight: 500;
}

.job-last-status i {
  width: 14px;
  height: 14px;
}

.job-last-status.success {
  color: #059669;
}

.job-last-status.failed {
  color: #dc2626;
}

/* 5 stat cards - adjust grid */
.job-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .job-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .job-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Purple stat icon - deep vibrant color */
.job-stat-card .stat-icon.purple {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  color: white;
}

/* Scheduled date group header */
.job-date-group h3.date-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.job-date-group h3.date-label:has(~ .job-cards .job-card.scheduled) {
  color: #7c3aed;
  border-bottom-color: #e9d5ff;
}
