/* Design tokens – single source for consistent colours */
:root {
    --primary: #5b21b6;
    --primary-hover: #6d28d9;
    --primary-light: #ede9fe;
    --primary-border: #7c3aed;
    --success: #059669;
    --success-hover: #047857;
    --success-light: #d1fae5;
    --neutral: #64748b;
    --neutral-hover: #475569;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --bg-gradient: linear-gradient(135deg, #5b21b6 0%, #6d28d9 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 0;
}

/* Login Form Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 400px;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
    text-align: center;
}

.subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

button {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(91, 33, 182, 0.35);
}
button:hover:not([class*="btn-"]):not(.logout-btn) {
    background: var(--primary-hover);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.error.show {
    display: block;
}

.success {
    background: #efe;
    color: #3c3;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.success.show {
    display: block;
}

/* Dashboard Layout */
.dashboard {
    display: none;
    height: 100vh;
    overflow: hidden;
}

.dashboard.show {
    display: flex;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background: #fdfdfd;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

.sidebar-header {
    padding: 24px 20px 16px;
    background: white;
    color: #111827;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.sidebar-header p {
    font-size: 13px;
    opacity: 0.6;
    color: #4b5563;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 20px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 5px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 10px;
}

.recordings-search {
    margin: 8px 0 16px;
    position: relative;
}

.recordings-search input {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px 10px 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.recordings-search::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.4;
}

.recordings-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.recordings-list {
    list-style: none;
    margin-top: 4px;
}

.recordings-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.recordings-pagination-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    min-width: 7.5rem;
    text-align: center;
}

.recordings-pagination-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.recordings-pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: none;
    box-shadow: none;
}

.recordings-pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* SFTP folders + breadcrumbs */
.sftp-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0 16px;
    padding: 0 4px;
    flex-wrap: wrap;
}

.sftp-crumb {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
}

.sftp-crumb:hover {
    background: #f3f4f6;
    color: #111827;
}

.sftp-crumb.active {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

.sftp-crumb-sep {
    font-size: 10px;
    color: #d1d5db;
}

.sftp-folders-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.sftp-folder-item {
    background: transparent;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

.sftp-folder-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.sftp-folder-item .folder-icon {
    font-size: 18px;
    color: #94a3b8;
    transition: color 0.2s;
}

.sftp-folder-item:hover .folder-icon {
    color: #64748b;
}

.sftp-folder-up {
    opacity: 0.7;
}

.sftp-folder-up .folder-name {
    color: #6b7280;
}

.recording-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.recording-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

.recording-item.active {
    background: #f8fafc;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.recording-item.selected {
    background: #f0fdf4;
    border-color: #86efac;
}

.recording-item.selected.active {
    border-color: var(--primary);
}

.recording-checkbox {
    flex-shrink: 0;
    margin-top: 4px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    border-radius: 4px;
}

.recording-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.play-audio-btn, .download-audio-btn {
    flex-shrink: 0;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    transition: all 0.2s;
}

.play-audio-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.download-audio-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.play-audio-btn.playing {
    background: var(--success);
    color: white;
}

.play-audio-btn .play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.play-audio-btn .play-icon svg {
    display: block;
}

.recording-inline-player {
    flex: 1 1 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    cursor: default;
}

.recording-inline-player[hidden] {
    display: none !important;
}

.recording-player-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.recording-seek-back,
.recording-seek-fwd {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.recording-seek-back:hover,
.recording-seek-fwd:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.recording-seek-back:disabled,
.recording-seek-fwd:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.recording-time-wrap {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    margin-left: auto;
}

.recording-time-current {
    color: #1e293b;
    font-weight: 600;
}

.recording-seek-bar {
    width: 100%;
    height: 6px;
    cursor: pointer;
    accent-color: var(--primary);
}

.recording-seek-bar:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.recording-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recording-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.recording-info {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.recording-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.recording-status-badge.transcriptions {
    background: #eff6ff;
    color: #2563eb;
}

.recording-status-badge.data {
    background: #f0fdf4;
    color: #16a34a;
}

.recording-status-badge.qa {
    background: #faf5ff;
    color: #7c3aed;
}

.bulk-actions {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: none;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bulk-actions.show {
    display: flex;
}

.bulk-actions p {
    font-size: 12px;
    color: #555;
    margin: 0;
}

.bulk-actions-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-actions-buttons button {
    font-size: 13px;
    padding: 8px 14px;
}

.bulk-transcribe-btn {
    background: var(--primary);
}
.bulk-transcribe-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.35);
}

.bulk-extract-btn {
    background: var(--success);
}
.bulk-extract-btn:hover {
    background: var(--success-hover);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.bulk-clear-btn {
    background: var(--neutral);
}
.bulk-clear-btn:hover {
    background: var(--neutral-hover);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.bulk-progress {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.refresh-btn {
    width: 100%;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.refresh-btn::before {
    content: "↻";
    font-size: 16px;
}

.refresh-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.sidebar-footer {
    padding: 16px;
    background: #fdfdfd;
    border-top: 1px solid #e5e7eb;
}

/* View tabs (Files | Call | Sim | API | QA) */
.view-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin: 16px 0 12px;
    gap: 4px;
}

.view-tab {
    flex: 1;
    min-width: 0;
    padding: 8px 3px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.view-tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #1e293b;
}

.view-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-tab.active:hover {
    background: white;
    color: var(--primary);
}

/* Content view panels */
.content-view {
    display: none;
}

.content-view.active {
    display: block;
    animation: viewFadeIn 0.2s ease-out;
}

@keyframes viewFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-header-top h2 {
    margin: 0;
}

.logout-btn {
    width: 100%;
    background: var(--danger);
}
.logout-btn:hover {
    background: var(--danger-hover);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.content-header-main {
    flex: 1;
    min-width: 0;
}

.content-header h2 {
    color: white;
    font-size: 24px;
    margin-bottom: 4px;
}

.content-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.portal-mode-toggle {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.portal-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.portal-mode-toggle.portal-mode-user {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.55);
}

.portal-mode-toggle.portal-mode-user:hover {
    background: rgba(251, 191, 36, 0.28);
    border-color: rgba(251, 191, 36, 0.7);
}

.content-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.transcription-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.transcription-user-mode-title {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

.transcription-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.transcription-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ElevenLabs diarized timeline (scribe_v2 diarize) */
.transcription-text .transcription-elevenlabs-diarized {
    white-space: normal;
}

.transcript-timeline {
    position: relative;
    margin-top: 4px;
    padding-left: 0;
}

/* Spine aligned with the center of the 36px speaker track column */
.transcript-timeline::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
    border-radius: 1px;
}

.transcript-timeline-date {
    display: inline-block;
    margin-bottom: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #0d9488;
}

.transcript-timeline-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.transcript-timeline-row:last-child {
    margin-bottom: 0;
}

.transcript-timeline-track {
    width: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0;
    position: relative;
    z-index: 1;
}

.transcript-timeline-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 0 0 3px #f8f9fa;
}

.transcript-timeline-avatar svg {
    display: block;
    flex-shrink: 0;
}

.transcript-timeline-avatar--1 {
    background: #2563eb;
}

.transcript-timeline-avatar--2 {
    background: #16a34a;
}

.transcript-timeline-avatar--3 {
    background: #9333ea;
}

.transcript-timeline-avatar--4 {
    background: #d97706;
}

.transcript-timeline-avatar--5 {
    background: #db2777;
}

.transcript-timeline-avatar--6 {
    background: #0d9488;
}

.transcript-timeline-avatar--neutral {
    background: #64748b;
}

.transcript-timeline-card {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.transcript-timeline-card-header {
    padding: 10px 14px;
    font-size: 14px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
}

.transcript-timeline-card-body {
    padding: 12px 14px;
    font-size: 14px;
    color: #334155;
    line-height: 1.55;
}

.transcription-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.btn-primary {
    background: var(--primary);
    width: 100%;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-openai {
    background: #10a37f;
    color: white;
}

.badge-elevenlabs {
    background: #ff6b35;
    color: white;
}
.badge-assemblyai {
    background: var(--success);
    color: white;
}
.badge-deepgram {
    background: #6366f1;
    color: white;
}
.badge-google {
    background: #4285f4;
    color: white;
}

.badge-byteplus {
    background: #0f172a;
    color: #f8fafc;
}

.badge-speechmatics {
    background: #0d9488;
    color: white;
}

.badge-mistral {
    background: #f97316;
    color: white;
}

/* Extract data modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.show {
    display: flex;
}
.modal-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-box h3 {
    margin-bottom: 12px;
    color: #333;
}
.modal-box p {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}
.extract-data-section {
    margin-top: 12px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}
.extract-data-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
}
.extract-data-list {
    list-style: none;
    font-size: 14px;
}
.extract-data-list li {
    padding: 4px 0;
    display: flex;
    gap: 8px;
}
.extract-data-list strong {
    min-width: 100px;
    color: #333;
}
.validation-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}
.validation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}
.validation-item strong {
    min-width: 90px;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
}
.email-val {
    flex: 1;
    font-family: monospace;
    color: #333;
    word-break: break-all;
}
.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge.valid {
    background: #d1fae5;
    color: #065f46;
}
.status-badge.invalid {
    background: #fee2e2;
    color: #991b1b;
}
.status-badge.unknown {
    background: #f3f4f6;
    color: #374151;
}
.status-badge.good {
    background: #d1fae5;
    color: #065f46;
}
.status-badge.partial {
    background: #fef3c7;
    color: #92400e;
}
.status-badge.poor {
    background: #fee2e2;
    color: #991b1b;
}
/* API documentation */
.api-docs-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.api-base-url {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.api-section {
    margin-bottom: 28px;
}
.api-section h4 {
    color: #334155;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.api-section p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}
.api-endpoint {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.api-endpoint code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.api-method {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 10px;
}
.api-method.get {
    background: #dbeafe;
    color: #1d4ed8;
}
.api-method.post {
    background: #d1fae5;
    color: #047857;
}
.api-method.put {
    background: #fef3c7;
    color: #b45309;
}
.api-detail {
    font-size: 13px;
    color: #475569;
    margin-top: 8px;
}
.api-detail code {
    word-break: break-all;
}

/* Extract data modal: compact, in-bounds */
.extract-modal-box {
    max-width: 340px;
}
.extract-modal-box .form-group {
    margin-bottom: 12px;
}
.extract-modal-box h3 {
    margin-bottom: 14px;
}
.extract-method-row {
    margin-bottom: 8px;
}
.extract-method-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.extract-method-options {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 20px;
}
.extract-method-option {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    min-height: 24px;
}
.extract-method-option input[type="radio"] {
    margin: 0 10px 0 0;
    width: 18px;
    min-width: 18px;
    height: 18px;
    flex-shrink: 0;
    box-sizing: border-box;
}
.extract-method-option span {
    line-height: 1.2;
}
.extract-request-group {
    margin-top: 2px;
    margin-bottom: 4px;
}
.extract-request-group label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.extract-request-group input {
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
}
.extract-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
#extractModal .error {
    margin-top: 8px;
    font-size: 13px;
}
.extract-btn {
    background: var(--success);
    font-size: 13px;
    padding: 8px 14px;
}
.extract-btn:hover {
    background: var(--success-hover);
    box-shadow: 0 5px 15px rgba(5, 150, 105, 0.4);
}
.extract-email-name-btn {
    background: var(--primary);
}
.extract-email-name-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 5px 15px rgba(91, 33, 182, 0.4);
}
.qa-btn {
    background: #6366f1;
    font-size: 13px;
    padding: 8px 14px;
}
.qa-btn:hover {
    background: #4f46e5;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}
.qa-settings-card textarea {
    width: 100%;
    min-height: 220px;
    font-size: 14px;
    line-height: 1.45;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    resize: vertical;
    font-family: inherit;
}
.qa-settings-card textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.qa-result-fields-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qa-field-editor-row {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.qa-field-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .qa-field-editor-grid {
        grid-template-columns: 1fr;
    }
}

.qa-field-editor-row .qa-f-enum-options textarea,
.qa-field-editor-row .qa-c-options {
    width: 100%;
    font-size: 13px;
    padding: 8px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    font-family: inherit;
    margin-top: 6px;
}

.qa-issue-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(100px, auto) auto;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .qa-issue-col-grid {
        grid-template-columns: 1fr;
    }
}

.qa-issue-col-row .qa-c-remove {
    padding: 6px 10px;
    font-size: 16px;
    line-height: 1;
}

/* Bulk transcribe modal */
#bulkTranscribeModal .modal-box {
    max-width: 480px;
}
#bulkTranscribeModal .bulk-transcribe-progress {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
}

.btn-secondary {
    background: var(--neutral);
}
.btn-secondary:hover {
    background: var(--neutral-hover);
}
