/* Auditorias section — legacy audit grid (kept for reference) */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.audit-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.audit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.audit-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.audit-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.audit-platform-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
}
.audit-score {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.audit-score small {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 500;
}
.audit-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #6b7280;
  margin: 8px 0;
}
.audit-stats {
  display: flex;
  gap: 8px;
}
.audit-stats .stat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
}
.audit-stats .stat-warn {
  background: #fef3c7;
  color: #92400e;
}
.audit-stats .stat-unack {
  background: #fee2e2;
  color: #991b1b;
}

.audit-detail {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-top: 16px;
}
.audit-narrative {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  margin: 8px 0 16px;
  padding: 12px;
  background: #f9fafb;
  border-left: 3px solid #ec8223;
}
.audit-score-big {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  margin: 16px 0;
}
.audit-score-big small {
  font-size: 24px;
  color: #9ca3af;
  font-weight: 500;
}

.audit-alert-list,
.audit-finding-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 24px;
}
.audit-alert-list .alert {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fef2f2;
  border-left: 3px solid #ef4444;
}
.audit-alert-list .alert-win {
  background: #ecfdf5;
  border-left-color: #10b981;
}
.audit-alert-list .ack-badge {
  font-size: 11px;
  color: #10b981;
  margin-left: 8px;
}
.audit-finding-list .finding {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
}
.audit-finding-list .sev-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}
.audit-finding-list .recommendation {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}
.audit-finding-list .empty,
.audit-alert-list .empty {
  color: #9ca3af;
  font-size: 13px;
  padding: 12px;
}
.audit-empty {
  padding: 48px;
  text-align: center;
  color: #9ca3af;
  margin-top: 16px;
}

/* ------------------------------------------------------------------ */
/* ads-audits.css — Action Queue Wave 1                                 */
/* ------------------------------------------------------------------ */

.auditorias-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.auditorias-header h2 { margin: 0; }
.auditorias-header .muted { color: #6b7280; margin: 4px 0 0; flex: 1; min-width: 200px; }

.queue-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.queue-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.queue-empty p {
  text-align: center;
  color: #6b7280;
  padding: 24px;
  margin: 0;
}

.queue-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.queue-card:last-child { margin-bottom: 0; }
.queue-card-title { font-weight: 500; color: #111827; }
.queue-card-meta { color: #6b7280; font-size: 13px; margin-top: 4px; }
.queue-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-link {
  background: none;
  border: 0;
  color: #2563eb;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.error {
  color: #b91c1c;
  background: #fee2e2;
  padding: 12px;
  border-radius: 6px;
}

/* Toast notifications */
.audit-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #16a34a;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  max-width: 340px;
}
.audit-toast--visible { opacity: 1; transform: translateY(0); }
.audit-toast--info  { background: #2563eb; }
.audit-toast--warn  { background: #d97706; }
.audit-toast--error { background: #dc2626; }

/* Weekly summary section */
.queue-section--week {
  background: #f0f9ff;
  border-color: #bae6fd;
}
.queue-section--week h3 { color: #0369a1; }
.queue-card--week { border-color: #bae6fd; }

/* ===== Wave 1.5: Client-grouped queue ===== */

.client-queue { display: flex; flex-direction: column; gap: 12px; }

.client-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.client-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.audit-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

.client-card-info { min-width: 0; }
.client-card-name { font-weight: 600; font-size: 14px; color: #111827; }
.client-card-meta { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.plat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.plat-badge--google { background: #ea4335; }
.plat-badge--meta { background: #1877f2; }

.health-pill {
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  min-width: 36px;
  text-align: center;
}
.health-pill--good { background: #d1fae5; color: #065f46; }
.health-pill--warn { background: #fef3c7; color: #92400e; }
.health-pill--bad  { background: #fee2e2; color: #991b1b; }
.health-pill--null { background: #f3f4f6; color: #6b7280; }

.client-card-metrics { font-size: 12px; color: #4b5563; white-space: nowrap; }
.client-card-summary {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.chevron {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #6b7280;
  transition: transform 0.2s;
  width: 28px;
  height: 28px;
}
.client-card.expanded .chevron { transform: rotate(180deg); }

.btn-sm { padding: 4px 10px; font-size: 12px; }

.client-card-body[hidden] { display: none; }
.client-card-body {
  padding: 8px 16px 14px 60px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: #1f2937;
}
.rec-row-term { flex: 1; font-family: monospace; }
.rec-row-conf {
  background: #eef2ff;
  color: #3730a3;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.btn-link {
  background: none;
  border: 1px solid #e5e7eb;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #374151;
}
.btn-link:hover { background: #f3f4f6; }
.btn-link--primary { background: #3B82F6; border-color: #3B82F6; color: #fff; }
.btn-link--primary:hover { background: #2563eb; }

.client-card-body-more {
  margin-top: 4px;
  font-size: 12px;
  color: #3B82F6;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  text-align: left;
}

/* Mobile: collapse layout */
@media (max-width: 720px) {
  .client-card-header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "av name pill"
      "av meta meta"
      "metrics metrics metrics"
      "summary summary chev"
      "open open open";
    row-gap: 6px;
  }
  .audit-avatar { grid-area: av; }
  .client-card-info { grid-area: name / name / meta / meta; }
  .health-pill { grid-area: pill; }
  .client-card-metrics { grid-area: metrics; white-space: normal; }
  .client-card-summary { grid-area: summary; }
  .chevron { grid-area: chev; }
  [data-action="open-client"] { grid-area: open; width: 100%; }
}

/* ===== Wave 1.5: per-client modal ===== */

.modal-header-client {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.modal-header-text { flex: 1; min-width: 0; }
.modal-header-text h2 { margin: 0; font-size: 18px; color: #111827; }
.health-pill--lg { padding: 6px 14px; font-size: 14px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.kpi-tile {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 6px;
  padding: 10px 12px;
}
.kpi-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.4px; }
.kpi-value { font-size: 16px; font-weight: 700; color: #111827; margin-top: 2px; }
.kpi-risk--low { color: #065f46; }
.kpi-risk--medium { color: #92400e; }
.kpi-risk--high { color: #991b1b; }
.kpi-risk--critical { color: #7f1d1d; }
.kpi-risk--unknown { color: #6b7280; }

.modal-table-wrap { max-height: 50vh; overflow-y: auto; margin-bottom: 16px; }
.recs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.recs-table th {
  background: #f9fafb;
  text-align: left;
  padding: 8px;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
}
.recs-table td { padding: 8px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.recs-table tr:hover td { background: #fafbfc; }
.rec-type-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.rec-type-pill--neg { background: #fee2e2; color: #991b1b; }
.rec-type-pill--pro { background: #d1fae5; color: #065f46; }
.rec-term { font-family: monospace; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-metrics { color: #6b7280; font-size: 12px; }
.rec-conf { font-weight: 700; color: #3730a3; }
.rec-actions { white-space: nowrap; }
.recs-table tr.rec-row--failed td { background: #fef2f2; }

.modal-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.selected-counter { font-size: 13px; color: #6b7280; }
.modal-footer-actions { display: flex; gap: 8px; align-items: center; }

.modal-empty { padding: 24px; text-align: center; color: #6b7280; font-size: 14px; }

@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-footer-bar { flex-direction: column; align-items: stretch; }
  .modal-footer-actions { flex-wrap: wrap; }
}
