.analytics-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.stat-card .num { font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat-card .label { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.stat-card.fail .num { color: var(--fail); }
.stat-card.pass .num { color: var(--pass); }

.testers-panel, .detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-header h2 { margin: 0; font-size: 15px; }
.panel-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

.filter-dropdown-wrap { position: relative; }
.filter-menu[hidden] { display: none; }
.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
  z-index: 10;
}
.filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.filter-menu label:hover { background: var(--surface-2); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-cell .mini-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  min-width: 60px;
}
.progress-cell .mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff8a5c);
}
.progress-cell .pct { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }

.count-pass { color: var(--pass); font-weight: 700; }
.count-fail { color: var(--fail); font-weight: 700; }
.count-na { color: var(--na); font-weight: 700; }

.remove-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fail);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.remove-btn:hover { background: var(--fail-bg); border-color: var(--fail); }

.detail-body-inner { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.detail-meta strong { color: var(--text); }

.detail-section h3 {
  font-size: 13px;
  margin: 0 0 8px;
}
.detail-item-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.detail-item-row:last-child { border-bottom: none; }
.detail-status {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}
.detail-status.pass { background: var(--pass-bg); color: var(--pass); }
.detail-status.fail { background: var(--fail-bg); color: var(--fail); }
.detail-status.na { background: var(--na-bg); color: var(--na); }
.detail-status.untested { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.detail-item-text { flex: 1; }
.detail-item-note { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; }

.row-attachment-btn {
  flex-shrink: 0;
  align-self: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
  cursor: pointer;
}
.row-attachment-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.only-fail-toggle { margin-left: auto; }

/* Attachment viewer modal */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-media {
  flex: 1;
  min-height: 280px;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0d10;
  overflow: hidden;
}
.modal-media-el { max-width: 100%; max-height: 70vh; object-fit: contain; }
.modal-unsupported {
  color: #cfd2d8;
  text-align: center;
  font-size: 13px;
  padding: 40px 20px;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.65); }
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 99px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
}
.modal-nav:hover { background: rgba(0, 0, 0, 0.65); }
.modal-nav-prev { left: 10px; }
.modal-nav-next { right: 10px; }
.modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.modal-filename {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}
.modal-counter { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.modal-download { flex-shrink: 0; text-decoration: none; }
