/* ── Conversaciones module styles ── */

/* Encabezado: mismo tamaño que .mod-title / .mod-subtitle */
.conv-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Botón + icónico: visible solo en móvil */
.conv-btn-nueva-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding: 0 !important;
    font-size: 1.4rem;
    line-height: 1;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.module-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.module-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Stats grid */
.conv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.conv-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
}

.conv-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.conv-stat-card .stat-label {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Header actions */
.conv-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.conv-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.conv-filters select {
    font-size: 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

/* Table */
.conv-table-wrapper {
    overflow-x: auto;
}

.conv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.conv-table th {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.conv-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.conv-table tr:hover td {
    background: #f9fafb;
}

/* Estado badges */
.badge-conv {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-conv-abierta    { background: #d1fae5; color: #065f46; }
.badge-conv-revision   { background: #fef3c7; color: #92400e; }
.badge-conv-cerrada    { background: #f3f4f6; color: #6b7280; }

/* Row actions */
.conv-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Empty state */
.conv-empty {
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ── Encabezado de detalle de conversación ── */
.conv-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.conv-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    font-size: 0.8125rem;
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.conv-back-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.conv-back-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.conv-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.conv-detail-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dot de estado dentro del badge en la vista detalle */
.badge-conv-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

.badge-conv-abierta  .badge-conv-dot { background: #059669; }
.badge-conv-revision .badge-conv-dot { background: #d97706; }
.badge-conv-cerrada  .badge-conv-dot { background: #9ca3af; }

/* ── Tarjeta de metadatos de la conversación ── */
.conv-detail-meta {
    display: flex;
    flex-wrap: nowrap;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.conv-meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 20px;
    flex: 1;
    border-right: 1px solid #f3f4f6;
    min-width: 0;
}

.conv-meta-item:last-child {
    border-right: none;
}

.conv-meta-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    white-space: nowrap;
}

.conv-meta-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #9ca3af;
}

.conv-meta-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Transcription panel */
.conv-transcript-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.conv-transcript-box,
.conv-recording-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conv-transcript-box h3,
.conv-recording-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.conv-transcript-history {
    flex: 1;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.6;
    background: #f9fafb;
}

.conv-transcript-history:empty::before {
    content: 'La transcripción acumulada aparecerá aquí…';
    color: #9ca3af;
}

/* Recording controls */
.conv-record-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-record {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn-record:hover:not(:disabled) {
    background: #047857;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.btn-record:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

.btn-record:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

.btn-record-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-record-stop {
    background: #dc2626;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.btn-record-stop:hover:not(:disabled) {
    background: #b91c1c;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.btn-record:disabled,
.btn-record-stop:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.conv-record-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #dc2626;
    font-weight: 600;
}

.conv-record-indicator.active { display: flex; }

.conv-record-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ── Sección de subida de audio ── */

.conv-file-input-hidden {
    display: none;
}

.btn-upload-audio {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--info-bg);
    color: var(--primary);
    border: 1.5px solid var(--border-medium);
    border-radius: 7px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn-upload-audio:hover:not(:disabled) {
    background: var(--surface-blue);
    border-color: var(--primary);
    box-shadow: 0 3px 8px rgba(72, 147, 198, 0.15);
    transform: translateY(-1px);
}

.btn-upload-audio:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-upload-audio:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-upload-audio:disabled {
    background: #f9fafb;
    color: #d1d5db;
    border-color: #e5e7eb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-upload-audio-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Spinner del botón durante carga/transcripción */
.btn-upload-spinner {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    animation: btn-spin 0.9s linear infinite;
    transform-origin: center;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.conv-upload-status {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 6px;
    min-height: 0;
}

.conv-upload-status:empty {
    display: none;
}

.conv-upload-loading { color: var(--primary); }
.conv-upload-ok      { color: #059669; }
.conv-upload-error   { color: #dc2626; }

/* ── Área de transcripción provisional ── */
.conv-interim-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface-blue);
    border: 1.5px dashed var(--border-medium);
    border-radius: 10px;
    padding: 12px 16px;
}

.conv-interim-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--background-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.conv-interim-icon-wrap svg {
    width: 15px;
    height: 15px;
}

.conv-interim-text {
    flex: 1;
    min-height: 32px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    padding-top: 5px;
    word-break: break-word;
}

.conv-interim-text:empty::before {
    content: 'Texto provisional mientras hablas…';
    color: var(--text-muted);
    font-style: italic;
}

/* Word counter */
.conv-word-count {
    font-size: 0.78rem;
    color: #6b7280;
    text-align: right;
}

/* Manual textarea */
.conv-manual-area {
    width: 100%;
    min-height: 100px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    color: #374151;
}

.conv-manual-area:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(72, 147, 198, 0.15);
}

/* Speech API warning */
.conv-speech-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #92400e;
}

/* Estado select inline */
.conv-estado-select {
    font-size: 0.82rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
    background: #fff;
    cursor: pointer;
}

/* Resumen / notas section */
.conv-notes-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-top: 20px;
}

.conv-notes-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 10px;
}

.conv-notes-textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    color: #374151;
    box-sizing: border-box;
}

.conv-notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(72, 147, 198, 0.15);
}

/* Copy button */
.btn-copy-transcript {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-copy-transcript:hover { background: #e5e7eb; }

/* Future: btn crear requerimiento (disabled) */
.btn-req-soon {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-req-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #6b7280;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Estado bar (estado + guardar + crear req) */
.conv-estado-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.conv-estado-label {
    font-weight: 700;
}

/* Bloque actions row */
.conv-bloque-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Transcript box header */
.conv-transcript-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Notes grid */
.conv-notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Indicador de autoguardado ── */
.conv-autosave-status {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    min-height: 28px;
    display: flex;
    align-items: center;
}

.conv-autosave-hidden { display: none; }

.conv-autosave-saving {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--surface-blue);
}

.conv-autosave-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.conv-autosave-idle {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.conv-autosave-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Tarjetas de bloques de transcripción ── */
.transcripcion-bloque {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}

.transcripcion-bloque:last-child { margin-bottom: 0; }

.transcripcion-bloque-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.transcripcion-bloque-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Badge de tipo de bloque */
.badge-tipo {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-auto  { background: var(--info-bg); color: var(--info-text); }
.badge-manual { background: var(--success-bg); color: var(--success-text); }
.badge-final  { background: var(--surface-blue); color: var(--primary-dark); }

.transcripcion-bloque-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.transcripcion-bloque-meta strong { color: #374151; }

.transcripcion-bloque-texto {
    font-size: 0.87rem;
    color: #111827;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 5px;
    padding: 8px 10px;
}

/* Estado vacío del historial */
.transcript-empty {
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
    font-size: 0.85rem;
    font-style: italic;
}

/* Utilidades menores */
.text-muted  { color: #9ca3af; }
.text-center { text-align: center; }

/* Copiar todo — estados de feedback */
.btn-copiado {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.btn-copiado:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-copiar-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
    cursor: default;
}

/* Guardar estado — toggle auto guardado */
.btn-autoguardado-on,
.btn-autoguardado-off,
.btn-autoguardado-saving,
.btn-autoguardado-ok {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s, color 0.15s;
}

.btn-autoguardado-on {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.btn-autoguardado-on:hover:not(:disabled) {
    background: #bbf7d0;
}

.btn-autoguardado-off {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.btn-autoguardado-off:hover:not(:disabled) {
    background: #fee2e2;
}

.btn-autoguardado-saving {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.75;
}

.btn-autoguardado-ok {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
    cursor: default;
}

/* Guardar notas — estado de error */
.btn-notas-error {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

/* ── Botón expandir bloques ── */
.conv-transcript-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-expandir-bloques {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-expandir-bloques:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

/* ── Modal expandido de bloques guardados ── */
.conv-bloques-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: conv-bloques-fadein 0.18s ease;
}

.conv-bloques-overlay--saliendo {
    animation: conv-bloques-fadeout 0.2s ease forwards;
}

@keyframes conv-bloques-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes conv-bloques-fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.conv-bloques-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: conv-bloques-slidein 0.2s ease;
}

@keyframes conv-bloques-slidein {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.conv-bloques-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    gap: 12px;
}

.conv-bloques-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.conv-bloques-modal-words {
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

.conv-bloques-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.conv-bloques-modal-cerrar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-primary);
}

.conv-bloques-modal-cerrar:hover {
    background: #e5e7eb;
    color: #111827;
}

.conv-bloques-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.conv-bloques-modal-body .transcripcion-bloque-texto {
    font-size: 0.9rem;
    max-height: none;
}

/* ── Encabezado sección notas ── */
.conv-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.conv-notes-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

/* ── Modal expandido de resumen y notas ── */
.conv-resumen-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    width: 95vw;
    max-width: 1400px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: conv-bloques-slidein 0.2s ease;
}

.conv-resumen-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.conv-resumen-modal-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conv-resumen-modal-textarea {
    flex: 1;
    min-height: 480px;
    resize: vertical;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 12px;
    font-size: 0.875rem;
    font-family: var(--font-primary);
    color: #111827;
    line-height: 1.6;
    background: #f9fafb;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.conv-resumen-modal-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(72, 147, 198, 0.15);
    background: #fff;
}

.conv-resumen-modal-textarea:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.conv-resumen-modal-footer {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 767px) {
    .conv-resumen-modal-body { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 1023px) {
    .conv-stats { grid-template-columns: repeat(2, 1fr); }
    .conv-transcript-panel { grid-template-columns: 1fr; }
    .conv-notes-grid { grid-template-columns: 1fr; }
    .conv-detail-meta { flex-wrap: wrap; }
    .conv-meta-item {
        flex: 0 0 calc(50% - 1px);
        border-right: 1px solid #f3f4f6;
        border-bottom: 1px solid #f3f4f6;
    }
    .conv-meta-item:nth-child(even) { border-right: none; }
    .conv-meta-item:last-child,
    .conv-meta-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}

@media (max-width: 767px) {
    /* Botón + icónico junto al título, botón completo oculto */
    .conv-btn-nueva-mobile {
        display: flex;
    }

    #btn-nueva-conv {
        display: none;
    }

    /* Stats: 4 columnas compactas en móvil, separadas del subtítulo */
    .conv-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-top: 16px;
        margin-bottom: 8px;
    }

    .conv-stat-card {
        padding: 8px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Label arriba, valor abajo */
    .conv-stat-card .stat-label {
        order: 1;
        font-size: 0.6rem;
    }

    .conv-stat-card .stat-value {
        order: 2;
        font-size: 1.3rem;
    }

    .conv-header-actions { flex-direction: column; align-items: stretch; }

    /* Filtros: fila única, cliente 60% y estado 40% */
    .conv-filters {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .conv-filters #filter-cliente {
        flex: 3;
        min-width: 0;
        font-size: 0.8rem;
    }

    .conv-filters #filter-estado {
        flex: 2;
        min-width: 0;
        font-size: 0.8rem;
    }
    /* Columnas Cliente y Proyecto: mismo ancho */
    .conv-table td:nth-child(2),
    .conv-table td:nth-child(3) {
        min-width: 160px;
        max-width: 200px;
    }

    .conv-td-clip {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.35;
    }

    .conv-actions {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .conv-actions .btn {
        flex: 1;
        font-size: 0.75rem;
        padding: 5px 8px;
        text-align: center;
        justify-content: center;
        white-space: nowrap;
    }

    /* Botones guardar/limpiar bloque en una sola fila */
    .conv-bloque-actions {
        flex-wrap: nowrap;
    }

    .conv-bloque-actions .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        font-size: 0.82rem;
    }
    /* Estado bar: fila 1 = label + select / fila 2 = botones */
    .conv-estado-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .conv-estado-label {
        flex: 0 0 auto;
    }

    .conv-estado-select {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Botones: cada uno ocupa ~50% para ir juntos en la fila 2 */
    .conv-estado-bar #btn-guardar-estado,
    .conv-estado-bar .btn-req-soon {
        flex: 1 1 40%;
        font-size: 0.78rem;
        padding: 6px 10px;
        text-align: center;
        justify-content: center;
    }

    /* Controles de grabación: 3 botones en una sola fila */
    .conv-record-controls {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .conv-record-controls .btn-record,
    .conv-record-controls .btn-upload-audio {
        flex: 1;
        min-width: 0;
        font-size: 0.72rem;
        padding: 7px 6px;
        gap: 4px;
        justify-content: center;
    }

    /* Ocultar texto largo, mostrar solo icono + texto corto en mobile */
    .conv-record-controls .btn-record span,
    .conv-record-controls .btn-upload-audio span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conv-record-controls .btn-record-icon,
    .conv-record-controls .btn-upload-audio-icon {
        flex-shrink: 0;
        width: 14px;
        height: 14px;
    }
    .conv-notes-grid { grid-template-columns: 1fr; }
    /* Meta: 2 columnas compactas en móvil */
    .conv-detail-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        flex-wrap: unset;
    }

    .conv-meta-item {
        flex: unset;
        padding: 10px 12px;
        border-right: 1px solid #f3f4f6;
        border-bottom: 1px solid #f3f4f6;
    }

    /* Par derecho: sin borde derecho */
    .conv-meta-item:nth-child(even) { border-right: none; }

    /* Última fila: sin borde inferior */
    .conv-meta-item:nth-last-child(-n+2) { border-bottom: none; }

    .conv-meta-value { white-space: normal; font-size: 0.82rem; }
    .conv-meta-label { font-size: 0.72rem; }
    /* Header: botón ← arriba, título + badge abajo */
    .conv-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .conv-title-group {
        gap: 8px;
        width: 100%;
    }

    .conv-detail-title { font-size: 1rem; }
}
