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

:root {
    /* Colores principales */
    --primary-color: #08324A;
    --primary-dark: #11699C;
    --primary-light: #1AA0ED;
    --accent-color: #00bfa5;
    
    --danger-color: #ef4444;
    
    /* Colores de texto */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    
    /* Colores de fondo */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --card-bg: #ffffff;
    
    /* Bordes y sombras */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* SIDEBAR STYLES */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-overlay.hidden {
    display: none;
}

.sidebar-header {
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, white 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-sm);
}

.sidebar-user-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-user-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.sidebar-user-avatar svg {
    display: block;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Remove margin when role-badge is inside a table */
td .role-badge {
    margin-top: 0;
}

.role-badge svg {
    display: block;
    flex-shrink: 0;
}

/* Badge Colors based on Role */
.badge-admin {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.badge-supervisor {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.badge-user {
    background-color: #e0f2fe;
    color: #0284c7;
    border: 1px solid #7dd3fc;
}

.team-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background-color: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
    margin: 0.1rem;
}

.sidebar-nav {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.nav-item.active:hover {
    transform: none;
    background-color: var(--primary-dark);
}

/* Priority items (My Recordings, New Recording) */
.nav-item:nth-child(1),
.nav-item:nth-child(2) {
    font-weight: 600;
    font-size: 1rem;
}

.nav-item:nth-child(1) .nav-item-icon,
.nav-item:nth-child(2) .nav-item-icon {
    width: 22px;
    height: 22px;
}

.nav-item-icon {
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item-icon svg {
    display: block;
    flex-shrink: 0;
}

.nav-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0.5rem;
    letter-spacing: 0.05em;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.nav-group-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.nav-sub-item {
    padding-left: 3rem;
    font-size: 0.9rem;
}

/* Focus Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/*SECCIÓN 1: ENCABEZADO*/
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-md) 0;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-selector {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.lang-selector:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-selector:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.lang-selector option {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo-placeholder {
    flex-shrink: 0;
}

.firm-info h1 {
    font-size: 1.33rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.025em;
}

.firm-info p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 800px;
}

/* User Menu */
.user-menu-section {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    opacity: 0.95;
}

.btn-user-menu {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.btn-user-menu:hover {
    background-color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-user-menu:active {
    transform: translateY(0);
}

.btn-user-menu svg {
    width: 24px;
    height: 24px;
}

/*SECCION PRINCIPAL: LAYOUT DE 3 COLUMNAS*/
.main-workspace {
    flex: 1;
    padding: var(--spacing-lg) 0;
    background-color: var(--bg-secondary);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.workspace-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: 420px 1fr 400px;
    gap: var(--spacing-lg);
    height: 100%;
    overflow: hidden;
}

/* COLUMNA IZQUIERDA: Upload y Preview */
.column-left {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.upload-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    top: auto;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.upload-panel:hover {
    box-shadow: var(--shadow-hover);
}

.upload-panel::-webkit-scrollbar {
    width: 8px;
}

.upload-panel::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.upload-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.upload-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.upload-panel .panel-header {
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.upload-panel .panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.upload-panel .panel-header p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.upload-panel-content {
    padding: var(--spacing-md);
    flex: 1;
    overflow-y: auto;
}

/* COLUMNA CENTRO: Summary */
.column-center {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.summary-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    position: relative;
    top: auto;
    height: 100%;
    max-height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.summary-panel:hover {
    box-shadow: var(--shadow-hover);
}

.summary-panel .panel-header {
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.summary-panel .panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.summary-panel .panel-header p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.summary-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl);
}

.summary-placeholder svg {
    margin-bottom: var(--spacing-lg);
}

.summary-placeholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.summary-placeholder p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.placeholder-hint {
    font-size: 0.875rem;
    color: var(--text-light);
}

.summary-viewer {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

.summary-viewer::-webkit-scrollbar {
    width: 8px;
}

.summary-viewer::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.summary-viewer::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.summary-viewer::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* COLUMNA DERECHA: Chat */
.column-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.chat-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    position: relative;
    top: auto;
    height: 850px;
    max-height: 850px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.chat-panel:hover {
    box-shadow: var(--shadow-hover);
}

.chat-header {
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chat-header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.chat-messages-container {
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
}

.chat-footer-container {
    padding: var(--spacing-lg);
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

/* UPLOAD COMPONENTS */
.upload-buttons-wrapper {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-md);
}

.upload-buttons-wrapper .btn {
    flex: 1;
    max-width: 48%;
}

.upload-buttons-wrapper .btn-record {
    flex: 0 0 48px;
    width: 48px !important;
    height: 48px !important;
}

.btn-record {
    flex-shrink: 0;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0 !important;
    overflow: hidden;
}

.btn-record svg {
    width: 24px;
    height: 24px;
}

.btn-record:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-record:active {
    transform: translateY(0);
}

.btn-record.recording {
    background-color: #dc2626;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

.btn-record.recording:hover {
    background-color: #b91c1c;
}

@keyframes pulse-recording {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(220, 38, 38, 0.6);
    }
}

.upload-box-new {
    background-color: white;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}

.upload-box-new:hover {
    border-color: var(--primary-color);
    background-color: #f8faff;
}

.upload-box-new.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(26, 43, 51, 0.05);
    transform: scale(1.02);
}

.upload-box-new.drag-over h3 {
    color: var(--primary-color);
}

.upload-content-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.upload-content-new p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}

/* AUDIO PREVIEW */
.audio-preview {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

.preview-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-container {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

/* Skeleton Loader */
.skeleton-loader {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite, skeleton-pulse 2s ease-in-out infinite;
    border-radius: 6px;
    width: 100%;
}

.skeleton-line.title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--spacing-sm);
}

.skeleton-line.short {
    width: 80%;
}

.loading-status {
    margin-top: var(--spacing-lg);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* LOADING (mantener para futuras implementaciones) */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--spacing-md);
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Spinner para botones */
.btn-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ERROR MESSAGE (mantener para futuras implementaciones) */
.error-message {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-sm);
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.error-message::before {
    content: "⚠";
    font-size: 1.1rem;
}

/*BOTONES*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.75rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-full-width {
    width: 100%;
}

/* AGENTS PAGE STYLES */
.agents-page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Override para recordings page - necesita más ancho para el layout con chat */
.agents-page-content:has(.recordings-workspace) {
    max-width: 1800px;
    padding: 0;
}

.agents-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    min-height: 600px;
}

.agents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.agents-header-text h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.agents-header-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Loading Placeholder for Agents Page */
.loading-placeholder {
    padding: 3rem;
    text-align: center;
}

/* Agents Table */
.agents-table-container {
    overflow-x: auto;
}

.agents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.agents-table thead {
    background-color: var(--bg-secondary);
}

.agents-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.agents-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.agents-table tbody tr {
    transition: background-color 0.2s ease;
}

.agents-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.agents-table tbody tr.inactive {
    opacity: 0.6;
}

.agent-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.agent-name-cell svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.description-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

/* Provider Badges */
.provider-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provider-openai {
    background-color: #f0fdf4;
    color: #15803d;
}

/* Users Tabs */
.users-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0;
}

.users-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.users-tab:hover {
    color: var(--primary-color);
    background: rgba(8, 50, 74, 0.05);
}

.users-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.users-tab svg {
    flex-shrink: 0;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pending-badge.hidden {
    display: none;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-pages {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

/* Pending User Row Styles */
.agents-table tbody tr.pending-row {
    background-color: #fffbeb;
}

.agents-table tbody tr.pending-row:hover {
    background-color: #fef3c7;
}

.pending-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: #fef3c7;
    color: #b45309;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background-color: #dcfce7;
    color: #15803d;
}

.status-inactive {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-secondary);
}

.btn-icon-primary {
    color: var(--primary-color);
}

.btn-icon-primary:hover {
    background-color: rgba(8, 50, 74, 0.1);
}

.btn-icon-danger {
    color: var(--danger-color);
}

.btn-icon-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
}

.form-select optgroup {
    font-weight: 600;
    color: var(--primary-color);
    font-style: normal;
    padding: 0.25rem 0;
}

.form-select option {
    padding: 0.5rem;
    color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 50, 74, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Filter Styles */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 180px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: 180px;
}

.filters-row {
    padding: 0.5rem 0;
}

.text-danger {
    color: var(--danger-color);
    font-weight: 500;
}

/* Modal Large */
.modal-large {
    max-width: 1800px;
    width: 98vw;
    max-height: 75vh;
    overflow-y: auto;
}

/* Danger Button */
.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pagination-container .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.pagination-container .btn svg {
    flex-shrink: 0;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/*FOOTER*/
.footer {
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: var(--spacing-md) 0;
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

/*MODAL*/
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

#addMemberModal .modal-content {
    max-width: 600px;
}

#membersModal .modal-content {
    max-width: 900px;
}

#teamModal .modal-content {
    max-width: 650px;
}

#recordingDetailsModal .modal-content {
    max-width: 900px;
    width: 98vw;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

#recordingDetailsModal .modal-body {
    padding: 1rem;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-body form .form-group:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Modal de selección de tipo de grabación */
#recordTypeModal .modal-content {
    max-width: 700px;
}

.record-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.record-type-option {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.record-type-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.record-type-option svg {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.record-type-option h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.record-type-option p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.record-type-option .badge-info {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
    margin-top: 0.25rem;
}

.record-type-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.record-type-option.disabled:hover {
    transform: none;
    border-color: var(--border-color);
    background: white;
}

/* Modal mas ancho para el selector de grabacion */
.modal-content-wide {
    max-width: 800px !important;
}

/* Aviso de privacidad */
.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.privacy-notice svg {
    flex-shrink: 0;
    color: #0284c7;
    margin-top: 0.1rem;
}

.privacy-notice strong {
    color: #0c4a6e;
}

.privacy-notice span {
    color: #075985;
    font-size: 0.9rem;
}

/* Aviso de compatibilidad */
.compatibility-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.compatibility-warning svg {
    flex-shrink: 0;
    color: #d97706;
    margin-top: 0.1rem;
}

.compatibility-warning strong {
    color: #92400e;
}

.compatibility-warning span,
.compatibility-warning div {
    color: #a16207;
    font-size: 0.9rem;
}

/* Instrucciones para audio del sistema */
.system-audio-instructions {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}

.system-audio-instructions h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.system-audio-instructions ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.system-audio-instructions li {
    margin-bottom: 0.4rem;
}

.system-audio-instructions li:last-child {
    margin-bottom: 0;
}

.system-audio-instructions strong {
    color: var(--primary-color);
}

/*UTILIDADES*/
.hidden {
    display: none !important;
}

/* Multiselect con checkboxes */
.multiselect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.multiselect-counter {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.multiselect-search {
    position: relative;
    margin-bottom: 0.75rem;
}

.multiselect-search .form-input {
    padding-left: 2.5rem;
    padding-right: 1rem;
    font-size: 0.95rem;
}

.multiselect-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.multiselect-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
    background-color: white;
    width: 100%;
}

.multiselect-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.multiselect-item:last-child {
    border-bottom: none;
}

.multiselect-item:hover {
    background-color: var(--bg-secondary);
}

.multiselect-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.multiselect-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    user-select: none;
    line-height: 1.4;
}

.multiselect-item input[type="checkbox"]:checked + label {
    font-weight: 500;
    color: var(--primary-color);
}

.multiselect-container::-webkit-scrollbar {
    width: 8px;
}

.multiselect-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.multiselect-container::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

.multiselect-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.no-search-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.multiselect-item[style*="display: none"] {
    display: none !important;
}

.text-center {
    text-align: center;
}

/*CHAT SYSTEM*/
.chat-footer-static {
    animation: fadeInChat 0.5s ease-out;
}

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

.chat-messages-container::-webkit-scrollbar {
    width: 8px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.chat-message {
    animation: fadeInMessage 0.3s ease-out;
    flex-shrink: 0;
    width: 100%;
}

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

.chat-message-user {
    display: flex;
    justify-content: flex-end;
}

.chat-message-assistant {
    display: flex;
    justify-content: flex-start;
}

/* Estilos para mensajes de usuario y AI */
.user-message {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-shrink: 0;
    flex-grow: 0;
    width: 100%;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border-bottom-right-radius: 4px;
    max-width: 80%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-message {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-shrink: 0;
    flex-grow: 0;
    width: 100%;
}

.ai-message .message-content {
    background: white;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
    max-width: 80%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
}

/* Estilos para listas en mensajes de IA */
.ai-message .message-content ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.ai-message .message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    list-style-type: decimal;
}

.ai-message .message-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.ai-message .message-content li:last-child {
    margin-bottom: 0;
}

/* Estilos para headers en mensajes */
.ai-message .message-content h1,
.ai-message .message-content h2,
.ai-message .message-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ai-message .message-content h1:first-child,
.ai-message .message-content h2:first-child,
.ai-message .message-content h3:first-child {
    margin-top: 0;
}

.ai-message .message-content p {
    margin: 0.5rem 0;
}

.ai-message .message-content p:first-child {
    margin-top: 0;
}

.ai-message .message-content p:last-child {
    margin-bottom: 0;
}

/* Typing indicator para mensajes de carga */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-bubble {
    max-width: 80%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    word-wrap: break-word;
    line-height: 1.6;
}

.chat-bubble-user {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-bubble-assistant h1,
.chat-bubble-assistant h2,
.chat-bubble-assistant h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-bubble-assistant h1:first-child,
.chat-bubble-assistant h2:first-child,
.chat-bubble-assistant h3:first-child {
    margin-top: 0;
}

.chat-bubble-assistant p {
    margin-bottom: 0.75rem;
}

.chat-bubble-assistant p:last-child {
    margin-bottom: 0;
}

.chat-bubble-assistant ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-bubble-assistant li {
    margin-bottom: 0.25rem;
}

/* AI Summary Section */
.speechmatics-summary-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.speechmatics-summary-content {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    line-height: 1.7;
    flex: 1;
    overflow-y: auto;
}

/* Estilos para contenido markdown dentro del resumen */
.speechmatics-summary-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 0 0.75rem 0;
}

.speechmatics-summary-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.875rem 0 0.625rem 0;
}

.speechmatics-summary-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0 0.5rem 0;
}

.speechmatics-summary-content h1:first-child,
.speechmatics-summary-content h2:first-child,
.speechmatics-summary-content h3:first-child {
    margin-top: 0;
}

.speechmatics-summary-content ul,
.speechmatics-summary-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.speechmatics-summary-content ul {
    list-style-type: disc;
}

.speechmatics-summary-content ol {
    list-style-type: decimal;
}

.speechmatics-summary-content li {
    margin-bottom: 0.375rem;
    line-height: 1.6;
}

.speechmatics-summary-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.speechmatics-summary-content em {
    font-style: italic;
}

.speechmatics-summary-content p {
    margin: 0.5rem 0;
}

/* Estilos para tablas */
.speechmatics-summary-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.speechmatics-summary-content table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.speechmatics-summary-content table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.speechmatics-summary-content table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.speechmatics-summary-content table tbody tr {
    transition: background-color 0.2s ease;
}

.speechmatics-summary-content table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.speechmatics-summary-content table tbody tr:last-child td {
    border-bottom: none;
}

.speechmatics-summary-content::-webkit-scrollbar {
    width: 8px;
}

.speechmatics-summary-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.speechmatics-summary-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.speechmatics-summary-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Estilos para tablas Markdown generadas por JS */
.markdown-table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background-color: white;
    border: 1px solid var(--border-color);
    min-width: 400px;
}

.markdown-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.markdown-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.markdown-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: top;
}

.markdown-table tbody tr {
    transition: background-color 0.2s ease;
}

.markdown-table tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

.markdown-table tbody tr:hover {
    background-color: #e8f4fd;
}

.markdown-table tbody tr:last-child td {
    border-bottom: none;
}

/* Code inline en contenido markdown */
.speechmatics-summary-content code {
    background-color: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    color: var(--primary-dark);
}

/* Horizontal rule */
.speechmatics-summary-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 1rem 0;
}

/* Soporte para tablas en movil */
@media (max-width: 768px) {
    /* Tablas speechmatics */
    .speechmatics-summary-content table {
        font-size: 0.85rem;
    }
    
    .speechmatics-summary-content table th,
    .speechmatics-summary-content table td {
        padding: 0.5rem 0.75rem;
    }
    
    /* Tablas markdown */
    .markdown-table {
        font-size: 0.8rem;
        min-width: 300px;
    }
    
    .markdown-table th,
    .markdown-table td {
        padding: 0.5rem 0.75rem;
    }
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
}

#chatInput {
    flex: 1;
    padding: 0.75rem 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.2s ease;
    max-height: 120px;
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

#chatInput::-webkit-scrollbar {
    display: none;
}

#chatInput:focus {
    outline: none;
    border-color: #2563eb;
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

/* AUDIO PLAYER */
.audio-preview-wrapper {
    display: flex;
    flex-direction: column;
}

.audio-player-container {
    width: 100%;
}

.audio-player {
    width: 100%;
    height: 50px;
    border-radius: var(--radius-md);
    outline: none;
}

.audio-player::-webkit-media-controls-panel {
    background-color: white;
    border-radius: var(--radius-md);
}

.audio-player::-webkit-media-controls-play-button,
.audio-player::-webkit-media-controls-pause-button {
    border-radius: 50%;
}

.audio-player::-webkit-media-controls-current-time-display,
.audio-player::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
}

/* Language Selector */
/* Contenedor compacto para selectores de configuración */
.config-selector-container {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.config-selector-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.config-selector-item:not(:last-child) {
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.config-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.config-label svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.config-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: white;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.config-select:hover {
    border-color: var(--primary-color);
}

.config-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 43, 51, 0.08);
}

.config-select option {
    padding: 0.5rem;
}

/* AGENT SELECTOR */
.agent-description {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 0.375rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary-color);
}

/* PARTICIPANTS SELECTOR */
.participants-container {
    position: relative;
    width: 100%;
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 2rem;
}

.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    animation: chipFadeIn 0.2s ease-out;
}

.participant-chip.external {
    background-color: var(--text-muted);
}

.participant-chip svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.participant-chip .chip-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.participant-chip .chip-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.participants-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.participants-input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.participants-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 50, 74, 0.1);
}

.participants-dropdown-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.participants-dropdown-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.participants-dropdown-btn.active {
    color: var(--primary-color);
    transform: translateY(-50%) rotate(180deg);
}

.participants-suggestions {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.participants-suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--bg-secondary);
}

.suggestion-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.suggestion-info {
    flex: 1;
}

.suggestion-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.suggestion-email {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.suggestion-create {
    color: var(--primary-color);
    font-style: italic;
}

.suggestion-empty {
    cursor: default;
    opacity: 0.7;
}

.suggestion-empty:hover {
    background-color: transparent;
}

.participants-suggestions::-webkit-scrollbar {
    width: 6px;
}

.participants-suggestions::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.participants-suggestions::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: var(--radius-sm);
}

.participants-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Agent Summary Badge */
.agent-summary-section {
    margin-bottom: var(--spacing-lg);
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.summary-badge svg {
    flex-shrink: 0;
}

/* SUMMARY DISPLAY */
.summary-container {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.summary-section {
    margin-bottom: var(--spacing-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.summary-section:last-child {
    margin-bottom: 0;
}

/* Content Tabs System */
.content-tabs {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tabs-navigation {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: white;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.6rem 1.25rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.tab-btn.active svg {
    color: white;
}

.tab-agent-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-provider-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(8, 50, 74, 0.1);
    font-weight: 600;
    color: var(--primary-color);
}

.tab-btn.active .tab-provider-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.summary-agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(8, 50, 74, 0.05) 0%, rgba(8, 50, 74, 0.02) 100%);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.summary-agent-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summary-agent-info svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.summary-agent-info .agent-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.summary-agent-info .provider-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.tabs-content {
    flex: 1;
    overflow-y: auto;
}

.tab-panel {
    display: none;
    padding: var(--spacing-sm);
    animation: fadeInTab 0.3s ease-out;
    height: 100%;
}

.tab-panel#summaryTab {
    padding: 0;
}

.tab-panel.active {
    display: block;
}

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

/* Transcription */
.transcription-container {
    height: 100%;
}

.transcription-text {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    line-height: 1.8;
    max-height: 600px;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.transcription-text::-webkit-scrollbar {
    width: 8px;
}

.transcription-text::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.transcription-text::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.transcription-text::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Dialogos con hablantes */
.dialogues-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
}

.dialogue-block {
    display: flex;
    flex-direction: column;
    animation: fadeInSlide 0.3s ease-out;
}

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

.speaker-text {
    padding: 18px 24px;
    background: white;
    border-radius: 10px;
    line-height: 1.8;
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.speaker-text:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 600px;
        transform: translateY(0);
    }
}

/* LOGIN PAGE */
body.login-page {
    background: var(--bg-secondary);
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-sm);
    position: relative;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-lang-selector {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.lang-selector-login {
    padding: 0.5rem 1rem;
    background-color: rgba(8, 50, 74, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.lang-selector-login:hover {
    background-color: rgba(8, 50, 74, 0.15);
    border-color: var(--primary-color);
}

.lang-selector-login:focus {
    background-color: rgba(8, 50, 74, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 50, 74, 0.1);
}

.login-container {
    width: 100%;
    max-width: 600px;
    margin: var(--spacing-lg) auto;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-lg);
    text-align: center;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.025em;
}

.login-header p {
    font-size: 0.95rem;
    opacity: 0.95;
}

.login-body {
    padding: var(--spacing-xl);
}

.login-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-xl);
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-label svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 50, 74, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 3rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-toggle-password:hover {
    color: var(--primary-color);
}

.btn-toggle-password svg {
    width: 20px;
    height: 20px;
}

.form-options {
    margin-top: -0.5rem;
}

.forgot-password {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn-login {
    margin-top: var(--spacing-md);
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(8, 50, 74, 0.2);
}

.btn-login:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(8, 50, 74, 0.3);
}

.login-footer {
    padding: var(--spacing-lg);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* AUTH TABS */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.auth-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.auth-tab:hover {
    color: var(--primary-color);
    background: rgba(8, 50, 74, 0.05);
}

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

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* FORM ROW (for side-by-side inputs) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* FORM HINT */
.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* SUCCESS MODAL */
.modal-success .modal-header-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.modal-success .modal-header-success h3 {
    color: white;
}

.modal-success .modal-header-success .btn-close {
    color: white;
}

.modal-success .modal-header-success .btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.success-icon svg {
    color: #059669;
}

/* LOGIN FORM SPACING FIX */
.login-form .form-group {
    margin-bottom: var(--spacing-md);
}

.login-form .form-group:last-of-type {
    margin-bottom: 0;
}

/* ===== RECORDINGS PAGE LAYOUT WITH CHAT ===== */
/* Estilos específicos para la página de recordings con chat lateral */
.recordings-workspace {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
    align-items: start;
}

.recordings-main-column {
    min-width: 0;
    overflow: visible;
}

.recordings-main-column .agents-container {
    width: 100%;
    padding: 1.75rem;
    min-height: 850px;
}

.recordings-main-column .agents-header {
    margin-bottom: 1.75rem;
}

.recordings-chat-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Asegurar que la tabla no se recorte */
.agents-table-container {
    width: 100%;
    overflow-x: auto;
}

.agents-table {
    min-width: 800px;
    table-layout: auto;
    width: 100%;
}

/* Ajuste de ancho de columnas de la tabla en recordings */
.recordings-main-column .agents-table th:nth-child(1),
.recordings-main-column .agents-table td:nth-child(1) {
    width: 32%;
    min-width: 240px;
}

.recordings-main-column .agents-table th:nth-child(2),
.recordings-main-column .agents-table td:nth-child(2) {
    width: 22%;
    min-width: 180px;
}

.recordings-main-column .agents-table th:nth-child(3),
.recordings-main-column .agents-table td:nth-child(3) {
    width: 12%;
    min-width: 100px;
}

.recordings-main-column .agents-table th:nth-child(4),
.recordings-main-column .agents-table td:nth-child(4) {
    width: 14%;
    min-width: 130px;
}

.recordings-main-column .agents-table th:nth-child(5),
.recordings-main-column .agents-table td:nth-child(5) {
    width: 8%;
    min-width: 80px;
}

.recordings-main-column .agents-table th:nth-child(6),
.recordings-main-column .agents-table td:nth-child(6) {
    width: 12%;
    min-width: 150px;
}

/* Mejorar el truncado de texto largo en celdas */
.recordings-main-column .agents-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Permitir que el nombre del archivo se muestre completo */
.recordings-main-column .agents-table td:nth-child(1) {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Columna de Owner con overflow controlado */
.recordings-main-column .agents-table td:nth-child(2) {
    max-width: 200px;
}

/* Columna de Team con overflow controlado */
.recordings-main-column .agents-table td:nth-child(3) {
    max-width: 120px;
}

/* Team filter específico para recordings */
.team-filter-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.team-filter-container .config-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.team-filter-container .config-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    transition: border-color 0.2s ease;
}

.team-filter-container .config-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.team-filter-container .form-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/*RESPONSIVO*/
@media (max-width: 1400px) {
    .workspace-container {
        grid-template-columns: 380px 1fr 380px;
        gap: var(--spacing-md);
    }
    
    /* Reducir ancho en pantallas medianas */
    .recordings-workspace {
        grid-template-columns: 1fr 380px;
        gap: 1.25rem;
        padding: 1.5rem;
    }
}

/* Tablet (max-width: 1024px) - Sidebar colapsable */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    /* Asegurar que el sidebar overlay funcione correctamente en tablets */
    .sidebar-overlay.visible {
        display: block;
    }
    
    .modal-large {
        max-width: 95%;
        width: 95vw;
        max-height: 75vh;
    }
    
    .recording-info-section .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    /* Layout de recordings: cambiar a columna unica en pantallas medianas */
    .recordings-workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.25rem;
    }
    
    .recordings-chat-column {
        order: 2;
        position: relative;
        top: 0;
    }
    
    .chat-panel {
        height: 650px;
        max-height: 650px;
    }
    
    .recordings-main-column {
        order: 1;
        overflow: visible;
    }
    
    .recordings-main-column .agents-container {
        min-height: 650px;
    }
    
    /* Workspace de index - layout vertical */
    .workspace-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        height: auto;
        overflow: visible;
    }
    
    .main-workspace {
        overflow: visible;
        height: auto;
        flex: 1 0 auto;
    }
    
    .column-left,
    .column-center,
    .column-right {
        position: relative;
        height: auto;
    }
    
    .upload-panel,
    .summary-panel {
        position: relative;
        top: 0;
        max-height: none;
        height: auto;
        min-height: 500px;
        overflow: visible;
    }
    
    /* Chat panel mantiene altura controlada */
    .chat-panel {
        position: relative;
        top: 0;
        height: auto;
        min-height: 500px;
        max-height: 700px;
    }
    
    /* Orden de los paneles en movil */
    .column-left {
        order: 1;
    }
    
    .column-center {
        order: 2;
    }
    
    .column-right {
        order: 3;
    }
}

/* Mobile (max-width: 768px) - Sidebar como drawer/overlay */
/* Recording Info Section */
.recording-info-section {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
}

.recording-info-section h4 {
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.recording-info-section .info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    column-gap: var(--spacing-xl);
}

.recording-info-section .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recording-info-section .info-item strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.recording-info-section .info-item span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Recording Audio Player */
.recording-audio-player {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
}

.recording-audio-player h4 {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.recording-audio-player audio {
    width: 100%;
    height: 45px;
    border-radius: var(--radius-md);
    outline: none;
}

.recording-audio-player audio::-webkit-media-controls-panel {
    background-color: white;
    border-radius: var(--radius-md);
}

.recording-audio-player audio::-webkit-media-controls-play-button,
.recording-audio-player audio::-webkit-media-controls-pause-button {
    border-radius: 50%;
}

.recording-audio-player audio::-webkit-media-controls-current-time-display,
.recording-audio-player audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    /* Layout de recordings: optimizado para movil */
    .recordings-workspace {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    
    .recordings-main-column .agents-container {
        padding: 1rem;
        min-height: auto;
    }
    
    .chat-panel {
        height: 550px;
        max-height: 550px;
    }
    
    .recordings-main-column .agents-table {
        font-size: 0.85rem;
        min-width: 550px;
    }
    
    .recordings-main-column .agents-table th,
    .recordings-main-column .agents-table td {
        padding: 0.65rem 0.5rem;
    }
    
    .team-filter-container {
        padding: 0.75rem;
    }
    
    #addMemberModal .modal-content,
    #membersModal .modal-content,
    #teamModal .modal-content {
        max-width: 95%;
    }
    
    .modal-large {
        max-width: 95%;
        width: 95vw;
        max-height: 80vh;
    }
    
    .recording-info-section .info-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .recording-audio-player audio {
        height: 40px;
    }
    
    .multiselect-container {
        max-height: 250px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .pagination-container .btn {
        width: 100%;
    }
    
    .header-left {
        gap: 1rem;
    }
    
    /* Sidebar drawer estilo mobile */
    .sidebar {
        width: 280px;
        max-width: 85vw;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    /* Toggle button mas visible en mobile */
    .sidebar-toggle {
        padding: 0.75rem;
        border-radius: var(--radius-md);
    }
    
    .sidebar-toggle:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    .logo-section {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .logo-placeholder img {
        width: 50px;
        height: 53px;
    }
    
    .firm-info h1 {
        font-size: 1.1rem;
    }
    
    .firm-info p {
        font-size: 0.85rem;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .workspace-container {
        padding: 0 var(--spacing-sm);
    }
    
    .upload-buttons-wrapper {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .upload-buttons-wrapper .btn {
        flex: 1;
        max-width: none;
    }
    
    .upload-buttons-wrapper .btn-record {
        flex: 0 0 48px;
        width: 48px !important;
        height: 48px !important;
        border-radius: 50% !important;
    }
    
    .chat-footer-container {
        padding: 0.95rem;
    }
    
    .chat-input-container {
        flex-direction: column;
        width: 100%;
    }
    
    .chat-input-container #chatInput,
    .chat-input-container textarea {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .chat-send-btn {
        width: 100%;
    }
    
    .tabs-navigation {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .tab-agent-name {
        max-width: 80px;
    }
    
    .tab-provider-badge {
        display: none;
    }
    
    .tab-panel {
        padding: var(--spacing-xs);
    }
    
    .audio-player {
        height: 45px;
    }
    
    body.login-page {
        padding: var(--spacing-md);
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .login-header {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .login-header h1 {
        font-size: 1.25rem;
    }
    
    .login-header p {
        font-size: 0.875rem;
    }
    
    .login-body {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .login-body h2 {
        font-size: 1.5rem;
    }
    
    /* === INDEX PAGE - MEJORAS RESPONSIVAS PARA MOVIL === */
    
    /* Main workspace ajustes */
    .main-workspace {
        padding: var(--spacing-sm) 0;
        overflow: visible;
        flex: 1 0 auto;
    }
    
    /* Footer siempre visible al final */
    .footer {
        position: relative;
        margin-top: var(--spacing-md);
    }
    
    /* Columnas del workspace */
    .column-left,
    .column-center,
    .column-right {
        width: 100%;
        min-height: auto;
    }
    
    /* Panel de upload */
    .upload-panel {
        border-radius: var(--radius-md);
        max-height: none;
        height: auto;
    }
    
    .upload-panel .panel-header {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
    
    .upload-panel .panel-header h3 {
        font-size: 1rem;
    }
    
    .upload-panel .panel-header p {
        font-size: 0.8rem;
    }
    
    .upload-panel-content {
        padding: var(--spacing-sm);
    }
    
    /* Upload box */
    .upload-box-new {
        padding: var(--spacing-sm);
    }
    
    .upload-content-new {
        min-height: 50px;
    }
    
    .upload-content-new p {
        font-size: 0.85rem;
    }
    
    /* Audio preview */
    .audio-preview {
        padding: var(--spacing-sm);
        margin-top: var(--spacing-sm);
    }
    
    .preview-header {
        margin-bottom: var(--spacing-sm);
        padding-bottom: var(--spacing-xs);
    }
    
    .preview-header h3 {
        font-size: 1rem;
    }
    
    /* Config selector */
    .config-selector-container {
        padding: var(--spacing-xs);
        margin-bottom: var(--spacing-sm);
    }
    
    .config-label {
        font-size: 0.8rem;
    }
    
    .config-label svg {
        width: 16px;
        height: 16px;
    }
    
    .config-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .agent-description {
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* Participants */
    .participants-list {
        min-height: auto;
    }
    
    .participant-chip {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .participants-input {
        padding: 0.6rem;
        font-size: 0.875rem;
    }
    
    /* Panel de summary */
    .summary-panel {
        border-radius: var(--radius-md);
        min-height: 400px;
        height: auto;
        max-height: none;
    }
    
    .summary-panel .panel-header {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
    
    .summary-panel .panel-header h3 {
        font-size: 1rem;
    }
    
    .summary-panel .panel-header p {
        font-size: 0.8rem;
    }
    
    .summary-placeholder {
        min-height: 250px;
        padding: var(--spacing-md);
    }
    
    .summary-placeholder svg {
        width: 60px;
        height: 60px;
    }
    
    .summary-placeholder h3 {
        font-size: 1.2rem;
    }
    
    .summary-placeholder p {
        font-size: 0.9rem;
    }
    
    /* Panel de chat */
    .chat-panel {
        border-radius: var(--radius-md);
        height: auto;
        min-height: 450px;
        max-height: 500px;
    }
    
    .chat-header {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
    
    .chat-header h3 {
        font-size: 1rem;
    }
    
    .chat-header p {
        font-size: 0.8rem;
    }
    
    .chat-messages-container {
        padding: var(--spacing-sm);
        min-height: 200px;
    }
    
    /* Mensajes de chat */
    .user-message .message-content,
    .ai-message .message-content {
        max-width: 90%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .chat-bubble {
        max-width: 90%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Record type modal */
    .record-type-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .record-type-option {
        padding: 1rem 0.75rem;
    }
    
    .record-type-option svg {
        width: 36px;
        height: 36px;
    }
    
    .record-type-option h4 {
        font-size: 0.9rem;
    }
    
    .record-type-option p {
        font-size: 0.8rem;
    }
    
    /* Skeleton loader */
    .skeleton-loader {
        padding: var(--spacing-md);
    }
    
    .loading-status {
        font-size: 1rem;
    }
    
    /* Speechmatics summary */
    .speechmatics-summary-section {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .speechmatics-summary-content {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .speechmatics-summary-content h1 {
        font-size: 1.25rem;
    }
    
    .speechmatics-summary-content h2 {
        font-size: 1.1rem;
    }
    
    .speechmatics-summary-content h3 {
        font-size: 1rem;
    }
    
    /* Form row en una columna */
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* === PANTALLAS MUY PEQUENAS (max-width: 480px) === */
@media (max-width: 480px) {
    /* Header compacto */
    .header {
        padding: var(--spacing-sm) 0;
    }
    
    .header-container {
        padding: 0 var(--spacing-xs);
    }
    
    .header-left {
        gap: 0.5rem;
    }
    
    .logo-section {
        gap: 0.5rem;
    }
    
    .logo-placeholder img {
        width: 40px;
        height: 42px;
    }
    
    .firm-info h1 {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .firm-info p {
        font-size: 0.75rem;
    }
    
    /* Sidebar toggle */
    .sidebar-toggle {
        padding: 0.5rem;
    }
    
    .sidebar-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* Workspace container */
    .workspace-container {
        padding: 0 var(--spacing-xs);
        gap: var(--spacing-sm);
    }
    
    .main-workspace {
        padding: var(--spacing-xs) 0;
        flex: 1 0 auto;
    }
    
    /* Paneles */
    .upload-panel .panel-header,
    .summary-panel .panel-header,
    .chat-header {
        padding: 0.75rem;
    }
    
    .upload-panel .panel-header h3,
    .summary-panel .panel-header h3,
    .chat-header h3 {
        font-size: 0.9rem;
    }
    
    .upload-panel .panel-header p,
    .summary-panel .panel-header p,
    .chat-header p {
        font-size: 0.75rem;
    }
    
    .upload-panel-content {
        padding: 0.75rem;
    }
    
    /* Upload box mas compacto */
    .upload-box-new {
        padding: 0.75rem;
    }
    
    .upload-content-new {
        min-height: 40px;
    }
    
    .upload-content-new p {
        font-size: 0.8rem;
    }
    
    /* Botones de upload */
    .upload-buttons-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upload-buttons-wrapper .btn {
        width: 100%;
        max-width: 100%;
    }
    
    .upload-buttons-wrapper .btn-record {
        flex: 0 0 48px;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px;
        min-height: 48px;
        border-radius: 50% !important;
        padding: 0 !important;
    }
    
    /* Audio preview compacto */
    .audio-preview {
        padding: 0.75rem;
    }
    
    .preview-header h3 {
        font-size: 0.9rem;
    }
    
    /* Config selectors */
    .config-selector-container {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .config-selector-item:not(:last-child) {
        padding-bottom: 0.5rem;
    }
    
    .config-label {
        font-size: 0.75rem;
    }
    
    .config-select {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Form hints */
    .form-hint {
        font-size: 0.7rem !important;
    }
    
    /* Participants */
    .participant-chip {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .participants-input {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Boton principal */
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Summary panel */
    .summary-placeholder {
        min-height: 200px;
        padding: var(--spacing-sm);
    }
    
    .summary-placeholder svg {
        width: 50px;
        height: 50px;
        margin-bottom: var(--spacing-sm);
    }
    
    .summary-placeholder h3 {
        font-size: 1.1rem;
    }
    
    .summary-placeholder p {
        font-size: 0.85rem;
    }
    
    .placeholder-hint {
        font-size: 0.75rem;
    }
    
    /* Chat panel */
    .chat-panel {
        min-height: 400px;
        max-height: 450px;
    }
    
    .chat-messages-container {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .chat-footer-container {
        padding: 0.75rem;
    }
    
    .chat-input-container {
        width: 100%;
    }
    
    #chatInput {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .chat-send-btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        width: 100%;
    }
    
    /* Mensajes chat */
    .user-message .message-content,
    .ai-message .message-content,
    .chat-bubble {
        max-width: 95%;
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }
    
    /* Tabs navigation */
    .tabs-navigation {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .tab-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Modals */
    .modal {
        padding: var(--spacing-xs);
    }
    
    .modal-content {
        border-radius: var(--radius-md);
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    /* Record type modal */
    .record-type-option {
        padding: 0.875rem;
    }
    
    .record-type-option svg {
        width: 32px;
        height: 32px;
        margin-bottom: 0.25rem;
    }
    
    .record-type-option h4 {
        font-size: 0.85rem;
    }
    
    .record-type-option p {
        font-size: 0.75rem;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-sm) 0;
        margin-top: var(--spacing-sm);
    }
    
    .footer p {
        font-size: 0.75rem;
    }
    
    /* Transcription */
    .transcription-text {
        padding: var(--spacing-sm);
        font-size: 0.85rem;
        max-height: 400px;
    }
    
    /* Dialogues */
    .dialogues-container {
        gap: 12px;
    }
    
    .speaker-text {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    /* Summary content */
    .speechmatics-summary-content {
        padding: 0.875rem;
        font-size: 0.85rem;
    }
    
    .speechmatics-summary-content h1 {
        font-size: 1.1rem;
    }
    
    .speechmatics-summary-content h2 {
        font-size: 1rem;
    }
    
    .speechmatics-summary-content h3 {
        font-size: 0.9rem;
    }
    
    .speechmatics-summary-content ul,
    .speechmatics-summary-content ol {
        padding-left: 1.25rem;
    }
    
    /* Login page */
    .login-lang-selector {
        top: 1rem;
        right: 1rem;
    }
    
    .lang-selector-login {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .login-header {
        padding: var(--spacing-md);
    }
    
    .login-header h1 {
        font-size: 1.1rem;
    }
    
    .login-header p {
        font-size: 0.8rem;
    }
    
    .login-body {
        padding: var(--spacing-md);
    }
    
    .login-body h2 {
        font-size: 1.3rem;
    }
    
    .login-subtitle {
        font-size: 0.85rem;
    }
    
    .form-input {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn-login {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    body.login-page {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .login-container {
        margin: var(--spacing-sm) auto;
    }
    
    .auth-tabs .auth-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Inline Speaker Mapping Panel */
.inline-speaker-mapping-panel {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.mapping-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.mapping-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-color);
}

.mapping-selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mapping-selector-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.speaker-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: var(--primary-color);
    color: white;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.inline-speaker-select {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    min-width: 140px;
    cursor: pointer;
}

.inline-speaker-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(8, 50, 74, 0.1);
}

/* Main page inline speaker select */
.main-inline-speaker-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    min-width: 150px;
    cursor: pointer;
    background: var(--bg-color);
    transition: border-color 0.3s ease;
}

.main-inline-speaker-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(8, 50, 74, 0.1);
}

.main-inline-speaker-select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.mapping-saved-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    color: #059669;
    font-weight: 500;
}

.mapping-saved-message svg {
    stroke: #059669;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Dialogues with named speakers */
.dialogue-speaker-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s;
}

.dialogue-speaker-name .speaker-icon {
    width: 16px;
    height: 16px;
}

.dialogue-speaker-unknown {
    background: #94a3b8;
}

/* Editable speaker with dropdown */
.dialogue-speaker-editable {
    background: var(--bg-secondary);
    color: var(--text-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
}

.dialogue-speaker-editable .speaker-icon {
    color: var(--primary-color);
}

/* Speaker Mapping Modal Styles (legacy) */
.speaker-mapping-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.speaker-mapping-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.speaker-preview {
    flex: 1;
    min-width: 0;
}

.speaker-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.speaker-sample-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
}

.speaker-mapping-arrow {
    color: var(--text-light);
    flex-shrink: 0;
}

.speaker-participant-select {
    flex: 1;
    min-width: 200px;
}

.speaker-participant-select select {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.speaker-participant-select select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 50, 74, 0.1);
}

.speaker-participant-select select:hover {
    border-color: var(--primary-light);
}

/* ====================================================================
   DOCUMENT DOWNLOAD BUTTONS
   ==================================================================== */

.download-btn-container {
    position: relative;
    display: inline-block;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-download:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-download.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
}

.btn-download.btn-sm svg {
    width: 14px;
    height: 14px;
}

.download-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-dropdown.hidden {
    display: none;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.download-option:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.download-option:active {
    background: var(--bg-tertiary);
}

.download-option svg {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.download-option:hover svg {
    color: var(--primary-color);
}

.download-option + .download-option {
    border-top: 1px solid var(--border-color);
}

/* Download Loading Indicator */
.download-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.download-loading-indicator.visible {
    opacity: 1;
    visibility: visible;
}

.download-loading-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.download-loading-content .spinner {
    animation: spin 1s linear infinite;
    color: var(--primary-color);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Summary Actions Container */
.summary-actions,
.transcription-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-agent-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.transcription-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== SUCCESS MESSAGE TOAST ===== */
.success-message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    max-width: 400px;
}

.success-message-toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.success-message-toast svg {
    flex-shrink: 0;
    stroke: white;
}

.success-message-toast span {
    line-height: 1.4;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .success-message-toast {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        box-shadow: 0 10px 40px rgba(5, 150, 105, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}