/* ═══════════════════ Test Lab ═══════════════════ */

.tl-section {
  background: #0c0c14;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.tl-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
}

.tl-header h3 {
  font-size: 1.1rem;
  color: #e8e8ec;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.tl-header .tl-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0,206,201,0.15);
  color: #00cec9;
}

.tl-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 480px;
}

/* ── Upload Panel ─────────────────────────────── */

.tl-upload-panel {
  padding: 20px;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tl-dropzone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #4a4a58;
  font-size: 0.8rem;
}

.tl-dropzone:hover, .tl-dropzone.dragover {
  border-color: #f59e0b;
  color: #e8e8ec;
  background: rgba(245,158,11,0.05);
}

.tl-dropzone.uploading {
  border-color: #00cec9;
  color: #00cec9;
}

.tl-dropzone.done {
  border-color: #00b894;
  color: #00b894;
}

.tl-dropzone.error {
  border-color: #e17055;
  color: #e17055;
}

.tl-drop-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  display: block;
}

.tl-drop-hint {
  font-size: 0.65rem;
  margin-top: 6px;
  opacity: 0.5;
}

.tl-file-info {
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.72rem;
  display: none;
}

.tl-file-info.visible { display: block; }

.tl-file-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: #e8e8ec;
}

.tl-file-label {
  color: #4a4a58;
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}

.tl-file-name {
  word-break: break-all;
  font-family: 'SF Mono', monospace;
}

.tl-probe-mini {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.tl-probe-mini .tl-file-row {
  font-size: 0.68rem;
}

/* ── Operation Selector ───────────────────────── */

.tl-ops {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-ops-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a4a58;
  font-weight: 600;
}

.tl-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tl-op-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #e8e8ec;
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.tl-op-btn:hover {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.08);
}

.tl-op-btn.selected {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.15);
}

.tl-op-btn .tl-op-name {
  font-weight: 600;
  display: block;
}

.tl-op-btn .tl-op-desc {
  font-size: 0.58rem;
  color: #4a4a58;
  margin-top: 2px;
  display: block;
}

.tl-run-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #0d9488);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.tl-run-btn:hover:not(:disabled) { opacity: 0.9; }
.tl-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Status / Results Panel ───────────────────── */

.tl-status-panel {
  display: flex;
  flex-direction: column;
  background: #080810;
}

.tl-status-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.tl-status-title {
  color: #4a4a58;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 0.65rem;
}

.tl-timer {
  font-family: 'SF Mono', monospace;
  color: #00cec9;
  font-size: 0.7rem;
}

.tl-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  color: #e8e8ec;
}

.tl-log-line {
  padding: 2px 0;
  display: flex;
  gap: 10px;
}

.tl-log-time {
  color: #4a4a58;
  min-width: 55px;
  font-size: 0.65rem;
}

.tl-log-msg {}

.tl-log-line.info .tl-log-msg { color: #4a4a58; }
.tl-log-line.status .tl-log-msg { color: #00cec9; }
.tl-log-line.ok .tl-log-msg { color: #00b894; }
.tl-log-line.err .tl-log-msg { color: #e17055; }
.tl-log-line.result .tl-log-msg { color: #e8e8ec; }

/* ── Result Card ──────────────────────────────── */

.tl-result-card {
  margin: 8px 0;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

.tl-result-card.success {
  border-color: rgba(0,184,148,0.3);
}

.tl-result-card.fail {
  border-color: rgba(225,112,85,0.3);
}

.tl-result-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.68rem;
}

.tl-result-label {
  color: #4a4a58;
}

.tl-result-value {
  color: #e8e8ec;
  font-family: 'SF Mono', monospace;
}

.tl-result-download {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  transition: background 0.15s;
}

.tl-result-download:hover {
  background: rgba(245,158,11,0.25);
}

/* ── Progress Bar ─────────────────────────────── */

.tl-progress-wrap {
  height: 3px;
  background: rgba(255,255,255,0.05);
  display: none;
}

.tl-progress-wrap.active { display: block; }

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

.tl-progress-bar.indeterminate {
  width: 100%;
  animation: tl-indeterminate 1.5s ease infinite;
}

@keyframes tl-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ── Empty State ──────────────────────────────── */

.tl-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4a4a58;
  text-align: center;
  padding: 40px;
}

.tl-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.tl-empty-text {
  font-size: 0.8rem;
}

.tl-empty-hint {
  font-size: 0.65rem;
  margin-top: 6px;
  opacity: 0.5;
}

/* ── Scrollbar ────────────────────────────────── */

.tl-log::-webkit-scrollbar { width: 4px; }
.tl-log::-webkit-scrollbar-track { background: transparent; }
.tl-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Responsive ───────────────────────────────── */

@media (max-width: 800px) {
  .tl-body { grid-template-columns: 1fr; }
  .tl-upload-panel { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
}
