/* PLAUD Admin — local Whisper transcription */

.agent-bar {
  position: sticky;
  top: 56px;
  z-index: 50;
  margin: 12px 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  font-size: 13px;
}
.agent-bar.agent-online { border-color: #10b981; background: #ecfdf5; }
.agent-bar.agent-offline { border-color: #ef4444; background: #fef2f2; }
.agent-bar.agent-busy { border-color: #f59e0b; background: #fef3c7; }
.agent-bar-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agent-spacer { flex: 1; }
.agent-led {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}
.agent-online .agent-led { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.agent-busy .agent-led { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin: 16px 0 12px;
}
.tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary, #6C63FF); font-weight: 600; }
.tab-counter { color: var(--text-muted); font-size: 12px; margin-left: 4px; }

.tab-content.active { display: block; }
.tab-content[hidden] { display: none; }

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 8px 0;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  font-size: 13px;
}

.model-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0 2px;
  font-size: 13px;
}
.model-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.model-toolbar select {
  min-width: min(360px, 86vw);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-raw      { background: #fef3c720; color: #b45309; }
.status-cloud    { background: #dbeafe;   color: #1e40af; }
.status-local    { background: #d1fae5;   color: #065f46; }
.status-both     { background: #ede9fe;   color: #5b21b6; }
.status-queued   { background: #f3f4f6;   color: #4b5563; }
.status-running  { background: #fef3c7;   color: #b45309; }
.status-done     { background: #d1fae5;   color: #065f46; }
.status-failed   { background: #fee2e2;   color: #991b1b; }
.status-cancelled{ background: #f3f4f6;   color: #6b7280; }

.progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  position: absolute;
  left: 0; top: 0; height: 100%;
  background: linear-gradient(90deg, #6C63FF, #00B4D8);
  transition: width 0.3s ease;
}
.progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-link { background: none; border: none; text-decoration: underline; cursor: pointer; padding: 0; color: var(--primary, #6C63FF); }

.checkbox-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-panel {
  position: relative;
  background: #fff;
  border-radius: 8px;
  width: min(560px, 90vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-wide { width: min(900px, 92vw); }
.modal-panel header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-panel header h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-panel footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* In-admin help/guide modal */
.help-guide h4 { margin: 18px 0 6px; font-size: 14px; }
.help-guide h4:first-child { margin-top: 0; }
.help-guide p { margin: 6px 0; }
.help-guide ul, .help-guide ol { margin: 6px 0; padding-left: 20px; }
.help-guide li { margin: 4px 0; }
.help-guide code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; word-break: break-word; }
.help-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.help-table th, .help-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.help-table th { font-weight: 600; }

.merge-list {
  list-style: none; padding: 0; margin: 8px 0; border: 1px solid var(--border); border-radius: 4px;
}
.merge-list li {
  padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: grab; user-select: none;
  display: flex; align-items: center; gap: 10px;
}
.merge-list li:last-child { border-bottom: none; }
.merge-list li.dragging { opacity: 0.5; }
.merge-handle { color: var(--text-muted); }
.merge-index { font-weight: 600; min-width: 20px; }

.modal-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; font-size: 13px; }

.read-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; padding: 8px 12px; background: #f9fafb; border-radius: 4px; }
.read-content {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
  background: #fafafa;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.duration-cell { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.name-cell { max-width: 380px; }
.name-cell strong { display: block; }
.name-cell small { color: var(--text-muted); font-size: 11px; }

.plaud-error {
  display: inline-block;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #7f1d1d;
  text-align: left;
}
.plaud-error .btn {
  margin-top: 10px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.pagination-bar .page-info {
  flex: 1;
}
