/* ============================================================ */
/* RESET & BASE                                                 */
/* ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  line-height: 1.5;
  background: #f0f2f5 !important;
  color: #1a1a2e;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================ */
/* LAYOUT                                                       */
/* ============================================================ */

.main-content, div.main-content {
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 1.5rem !important;
  display: block !important;
}

/* ============================================================ */
/* HEADER                                                       */
/* ============================================================ */

.tc.mb3 {
  padding: 1.5rem 0 1rem 0 !important;
}

.tc.mb3 h1 {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: #1a1a2e !important;
  letter-spacing: -0.02em;
}

.tc.mb3 p {
  font-size: 1rem !important;
  color: #6b7280 !important;
  margin-top: 0.25rem !important;
}

/* ============================================================ */
/* TAB NAVIGATION                                               */
/* ============================================================ */

.tab-navigation {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 12px;
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
}

.tab-btn {
  flex: 1;
  padding: 0.7rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.2s ease;
  text-align: center;
}

.tab-btn:hover {
  color: #374151;
  background: #f3f4f6;
}

.tab-btn.active {
  color: white;
  background: #4f46e5;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ============================================================ */
/* AGGREGATE STATS (top row cards)                              */
/* ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-grid.stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.stats-grid > .stat-card {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 1.25rem 1.5rem !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
  position: relative;
  overflow: hidden;
}

.stats-grid > .stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stats-grid > .stat-card:nth-child(1)::before { background: #4f46e5; }
.stats-grid > .stat-card:nth-child(2)::before { background: #ef4444; }
.stats-grid > .stat-card:nth-child(3)::before { background: #8b5cf6; }
.stats-grid > .stat-card:nth-child(4)::before { background: #10b981; }
.stats-grid > .stat-card:nth-child(5)::before { background: #f59e0b; }

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.stat-number {
  font-size: 2.25rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  display: block !important;
  margin: 0 !important;
  letter-spacing: -0.02em;
}

/* ============================================================ */
/* SECTION CARDS (white panels)                                 */
/* ============================================================ */

.form-section {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  margin: 0 0 1.5rem 0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

/* ============================================================ */
/* INTEGRATION STATUS BAR                                       */
/* ============================================================ */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.status-card:hover {
  background: white;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.status-label {
  font-weight: 600;
  color: #374151;
  text-transform: capitalize;
  font-size: 0.88rem;
  line-height: 1.3;
}

.status-time {
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 500;
}

.status-count {
  color: #6b7280;
  font-size: 0.75rem;
}

.status-stale {
  display: inline-block;
  background: #fef3c7;
  color: #d97706;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-top: 0.15rem;
}

/* ============================================================ */
/* FRESHNESS & RECORD COUNTS                                    */
/* ============================================================ */

.freshness-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.freshness-row:hover {
  background: #f9fafb;
}

.freshness-row:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.freshness-source {
  color: #374151;
  font-weight: 500;
}

.freshness-time {
  color: #6b7280;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  background: #f3f4f6;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ============================================================ */
/* DATA TABLES                                                  */
/* ============================================================ */

.monitoring-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.monitoring-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.monitoring-table th {
  background: #f8fafc;
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.monitoring-table th:first-child { border-radius: 8px 0 0 0; }
.monitoring-table th:last-child { border-radius: 0 8px 0 0; }

.monitoring-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: middle;
}

.monitoring-table tbody tr {
  transition: background 0.1s ease;
}

.monitoring-table tbody tr:hover {
  background: #f8fafc;
}

.monitoring-table tbody tr:last-child td {
  border-bottom: none;
}

.monitoring-table td strong {
  font-weight: 600;
  color: #1f2937;
}

.monitoring-table .error-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9ca3af;
  font-size: 0.82rem;
}

/* ============================================================ */
/* BADGES                                                       */
/* ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-completed { background: #ecfdf5; color: #059669; }
.badge-failed { background: #fef2f2; color: #dc2626; }
.badge-running { background: #eff6ff; color: #2563eb; }
.badge-partial { background: #fffbeb; color: #d97706; }

/* ============================================================ */
/* PAGINATION                                                   */
/* ============================================================ */

.pagination {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  margin: 1.25rem 0 0.5rem 0;
}

.pagination button {
  padding: 0.4rem 0.85rem;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  transition: all 0.15s;
}

.pagination button:hover {
  background: #f3f4f6;
  border-color: #4f46e5;
  color: #4f46e5;
}

.pagination button.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

/* ============================================================ */
/* FILTER CONTROLS                                              */
/* ============================================================ */

.filter-select, .filter-input {
  padding: 0.45rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  background: white;
  color: #374151;
  font-weight: 500;
  transition: all 0.15s;
}

.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.filter-input { width: 130px; }

/* ============================================================ */
/* BUTTONS                                                      */
/* ============================================================ */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

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

.btn-secondary {
  padding: 10px 20px;
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-sm {
  padding: 0.3rem 0.75rem !important;
  font-size: 0.8rem !important;
  border-radius: 6px !important;
}

.btn-detail {
  padding: 0.25rem 0.65rem;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-detail:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.btn-rerun {
  padding: 0.25rem 0.65rem;
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-rerun:hover {
  background: #d97706;
  color: white;
  border-color: #d97706;
}

/* ============================================================ */
/* QUEUE TESTING TAB                                            */
/* ============================================================ */

/* Dashboard Grid for Queue Stats */
.dashboard-grid, #queue-stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 1rem !important;
  width: 100% !important;
}

/* Stat Card overrides for queue tab */
.stat-card {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 1rem !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

.stat-card .yellow { color: #f59e0b !important; }
.stat-card .blue { color: #3b82f6 !important; }
.stat-card .green { color: #10b981 !important; }
.stat-card .red { color: #ef4444 !important; }
.stat-card .purple { color: #8b5cf6 !important; }

.stat-card .f4 {
  font-size: 0.8rem !important;
  color: #9ca3af !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

/* Queue stat card buttons */
.stat-card button {
  display: inline-block !important;
  padding: 0.3rem 0.65rem !important;
  margin: 0.35rem 0.25rem 0 0 !important;
  border-radius: 6px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: 1px solid !important;
  background: white !important;
  transition: all 0.15s ease !important;
}

.stat-card button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
}

.stat-card .f6.link.purple { color: #4f46e5 !important; border-color: #c7d2fe !important; }
.stat-card .f6.link.purple:hover { background: #4f46e5 !important; color: white !important; }
.stat-card .f6.link.red { color: #ef4444 !important; border-color: #fecaca !important; }
.stat-card .f6.link.red:hover { background: #ef4444 !important; color: white !important; }

/* ============================================================ */
/* JOB CARDS                                                    */
/* ============================================================ */

.job-card {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 1rem 1.25rem !important;
  margin: 0.5rem 0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  transition: all 0.15s ease;
}

.job-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08) !important;
}

.job-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 0.5rem !important;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.job-type-badge {
  padding: 0.2rem 0.55rem !important;
  border-radius: 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap;
}

.job-type-transcript { background: #eff6ff !important; color: #2563eb !important; }
.job-type-webhook { background: #f5f3ff !important; color: #7c3aed !important; }

/* Progress Bar */
.progress-bar {
  width: 100% !important;
  height: 6px !important;
  background: #f3f4f6 !important;
  border-radius: 3px !important;
  overflow: hidden !important;
  margin: 0.5rem 0 !important;
  border: none !important;
}

.progress-fill {
  height: 100% !important;
  transition: width 0.3s ease !important;
  border-radius: 3px;
}

.bg-purple { background: #8b5cf6 !important; }
.bg-blue { background: #3b82f6 !important; }
.bg-dark-red { background: #ef4444 !important; }
.bg-yellow { background: #f59e0b !important; }
.bg-light-purple { background: #c4b5fd !important; }

/* Messages */
.error-message {
  color: #dc2626 !important; background: #fef2f2 !important;
  padding: 0.75rem 1rem !important; border-radius: 8px !important; margin: 0.5rem 0 !important;
  border-left: 4px solid #ef4444 !important; font-size: 0.9rem;
}

.success-message {
  color: #059669 !important; background: #ecfdf5 !important;
  padding: 0.75rem 1rem !important; border-radius: 8px !important; margin: 0.5rem 0 !important;
  border-left: 4px solid #10b981 !important; font-size: 0.9rem;
}

/* Job List Container */
.job-list-container {
  max-height: 600px !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
}

/* Empty State */
.job-list-container p {
  text-align: center !important; color: #9ca3af !important;
  margin: 2rem 0 !important; padding: 2rem !important; background: #f9fafb !important;
  border-radius: 10px !important; border: 2px dashed #e5e7eb !important; font-size: 0.95rem;
}

/* Code blocks */
code {
  background: #f3f4f6 !important; padding: 2px 6px !important;
  border-radius: 4px !important; font-family: 'SF Mono', 'Fira Code', monospace !important;
  font-size: 0.85rem;
}

pre {
  background: #1e293b !important; color: #e2e8f0 !important;
  padding: 1rem !important; border-radius: 8px !important;
  overflow-x: auto !important; font-size: 0.82rem !important;
  max-height: 200px !important; overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', monospace !important;
}

/* ============================================================ */
/* CREATE JOBS SECTION                                          */
/* ============================================================ */

.create-jobs-section {
  border-radius: 12px !important;
}

.job-type-card {
  transition: all 0.2s ease !important;
  border-radius: 10px !important;
}

.job-type-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}

.enhanced-form-group input:focus,
.enhanced-form-group select:focus,
.enhanced-form-group textarea:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
  outline: none !important;
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */

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

@media (max-width: 768px) {
  .main-content { padding: 1rem !important; }
  .tab-navigation { overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { padding: 0.6rem 1rem; font-size: 0.85rem; white-space: nowrap; flex: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .status-grid { grid-template-columns: 1fr; }
  .dashboard-grid, #queue-stats { grid-template-columns: 1fr !important; }
  .monitoring-table { font-size: 0.8rem; }
  .monitoring-table th, .monitoring-table td { padding: 0.5rem 0.6rem; }
  .form-section { padding: 1.25rem !important; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-section [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================ */
/* SCROLLBAR                                                    */
/* ============================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ============================================================ */
/* INTEGRATION SUMMARY CARDS                                    */
/* ============================================================ */

.integration-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.summary-card {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all 0.15s ease;
}

.summary-card:hover {
  background: white;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.summary-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f2937;
  text-transform: capitalize;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.summary-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

.summary-stat-label {
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.summary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid #f0f0f0;
  font-size: 0.78rem;
}

.summary-run-counts {
  display: flex;
  gap: 0.6rem;
  font-weight: 600;
}

.summary-last-run {
  color: #9ca3af;
  font-weight: 500;
}

.btn-trigger {
  padding: 0.3rem 0.75rem;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-trigger:hover {
  background: #4338ca;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.btn-trigger:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

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

/* ============================================================ */
/* INBOX INGESTION SECTION                                      */
/* ============================================================ */

.inbox-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.inbox-mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 0.85rem 0.75rem;
  transition: all 0.15s ease;
}

.inbox-mini-stat:hover {
  background: white;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.inbox-mini-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

.inbox-mini-label {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

/* Confidence bars */
.confidence-container {
  width: 60px;
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.confidence-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.confidence-bar.confidence-high { background: #10b981; }
.confidence-bar.confidence-medium { background: #f59e0b; }
.confidence-bar.confidence-low { background: #ef4444; }

.confidence-value {
  font-size: 0.82rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #6b7280;
  vertical-align: middle;
}

/* Priority badges */
.badge.priority-urgent { background: #fef2f2; color: #dc2626; }
.badge.priority-high { background: #fff7ed; color: #ea580c; }
.badge.priority-medium { background: #eff6ff; color: #2563eb; }
.badge.priority-low { background: #f9fafb; color: #6b7280; }

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

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

/* ============================================================ */
/* HEALTH CHECK                                                 */
/* ============================================================ */

.stats-grid.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.hc-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.hc-project-card {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all 0.15s ease;
}

.hc-project-card:hover {
  background: white;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.hc-project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.hc-project-key {
  font-weight: 700;
  font-size: 1rem;
  color: #1f2937;
  margin-right: 0.5rem;
}

.hc-project-name {
  font-size: 0.85rem;
  color: #6b7280;
}

.hc-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hc-status-none { background: #f3f4f6; color: #9ca3af; }
.hc-status-healthy { background: #ecfdf5; color: #059669; }
.hc-status-warn { background: #fffbeb; color: #d97706; }
.hc-status-error { background: #fef2f2; color: #dc2626; }

.hc-project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.hc-project-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hc-project-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}

.hc-project-stat-label {
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

.hc-project-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f0f0f0;
}

.hc-running {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: wait !important;
}

/* Tier sections */
.hc-tier-section {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.hc-tier-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.75rem;
}

.hc-count-bar {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.hc-count-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hc-count-label {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hc-count-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1f2937;
}

.hc-all-good {
  color: #059669;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
}

.hc-key-group {
  margin-bottom: 0.75rem;
}

.hc-key-group-header {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hc-key-missing { color: #dc2626; }
.hc-key-extra { color: #d97706; }

.hc-key-count {
  background: #f3f4f6;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #6b7280;
}

.hc-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hc-key-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 500;
}

.hc-key-tag-missing { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.hc-key-tag-extra { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

.hc-diff-indicator {
  color: #d97706;
  font-size: 0.82rem;
  font-style: italic;
}

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

@media (max-width: 768px) {
  .hc-projects-grid { grid-template-columns: 1fr; }
  .hc-project-stats { grid-template-columns: repeat(2, 1fr); }
  .stats-grid.stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hc-count-bar { flex-wrap: wrap; gap: 1rem; }
}
