/* Audit Dashboard Styles */

.audit-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.audit-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.audit-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.audit-controls .account-select {
  min-width: 320px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
}

.btn-primary {
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  border: none;
  background: #00d4aa;
  color: #0a0a1a;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Scheduler controls */
.scheduler-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.btn-schedule {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: 1px solid #00d4aa;
  background: transparent;
  color: #00d4aa;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-schedule:hover { background: rgba(0, 212, 170, 0.1); }
.btn-schedule:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-schedule.btn-stop { border-color: #ff4757; color: #ff4757; }
.btn-schedule.btn-stop:hover { background: rgba(255, 71, 87, 0.1); }

.schedule-status {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: #888;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary:hover:not(:disabled) {
  background: #00e8bb;
}

/* Loading */
.audit-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 0;
  color: #888;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top: 3px solid #00d4aa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Clean state */
.audit-clean {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 4rem 0;
  color: #888;
}

.clean-icon {
  font-size: 3rem;
}

.audit-clean h2 {
  color: #00d4aa;
  font-family: 'Syne', sans-serif;
}

/* Summary cards */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid #222;
}

.summary-number {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
}

.summary-label {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-total .summary-number { color: #e0e0e0; }
.summary-critical .summary-number { color: #ff4757; }
.summary-warning .summary-number { color: #ffa502; }
.summary-info .summary-number { color: #70a1ff; }

/* Findings */
.findings-group {
  margin-bottom: 2rem;
}

.findings-group-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #222;
}

.findings-group-title.severity-critical { color: #ff4757; }
.findings-group-title.severity-warning { color: #ffa502; }
.findings-group-title.severity-info { color: #70a1ff; }

.finding-card {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid #333;
}

.finding-card.severity-critical { border-left-color: #ff4757; }
.finding-card.severity-warning { border-left-color: #ffa502; }
.finding-card.severity-info { border-left-color: #70a1ff; }

.finding-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.finding-category {
  font-size: 0.7rem;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  background: #0a0a1a;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.finding-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e0e0e0;
}

.finding-message {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.5;
}

/* Details table */
.finding-details {
  margin-top: 0.75rem;
  overflow-x: auto;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
}

.details-table th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  background: #0a0a1a;
  color: #888;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #222;
}

.details-table td {
  padding: 0.35rem 0.5rem;
  color: #ccc;
  border-bottom: 1px solid #1a1a2e;
  white-space: nowrap;
}

.details-more {
  font-size: 0.75rem;
  color: #666;
  padding: 0.25rem 0.5rem;
  font-family: 'DM Mono', monospace;
}

/* Audit meta */
.audit-meta {
  font-size: 0.75rem;
  color: #555;
  font-family: 'DM Mono', monospace;
  text-align: right;
  padding-top: 1rem;
  border-top: 1px solid #1a1a2e;
}

/* Not connected (reuses global styles) */
.not-connected {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 4rem 0;
  color: #888;
}

.not-connected-icon {
  font-size: 3rem;
}

.not-connected h2 {
  font-family: 'Syne', sans-serif;
  color: #e0e0e0;
}

/* Diagnosis & Fix */
.diagnosis-section { margin-bottom: 2rem; }
.diagnosis-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  color: #e0e0e0;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #222;
}
.diagnosis-card {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid #333;
}
.diagnosis-card.fixable { border-left-color: #00d4aa; }
.diagnosis-card.manual { border-left-color: #ffa502; }
.diagnosis-header {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}
.fix-list, .manual-notes {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fix-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #0a0a1a;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: #ccc;
}
.fix-desc { flex: 1; margin-right: 0.75rem; }
.btn-fix {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  border: 1px solid #00d4aa;
  background: transparent;
  color: #00d4aa;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-fix:hover { background: rgba(0, 212, 170, 0.1); }
.manual-notes li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #0a0a1a;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.5;
}
.fix-results { padding: 1rem 0; }
.fix-success {
  color: #00d4aa;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  padding: 0.3rem 0;
}
.fix-failure {
  color: #ff4757;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  padding: 0.3rem 0;
}

/* Responsive */
@media (max-width: 640px) {
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .audit-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .audit-controls .account-select {
    min-width: unset;
  }
}
