/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
#login-screen {
    min-height: 100vh;
    /* display: flex; -- ESTA LÍNEA FUE ELIMINADA */
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

/* NUEVA REGLA: Aplicar display: flex; solo cuando el login-screen está activo */
#login-screen.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

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

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.field-error {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.form-group.has-error .input-group input,
.form-group.has-error input {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group.has-error .input-group i {
    color: var(--error-color);
}

/* Settings Form - espaciado entre secciones */
.settings-form .form-group {
    margin-bottom: 1.75rem;
}

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

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface-color);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface-color);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Evitar adornos/autocompletado del navegador en campos de contraseña */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container,
input[type="password"]::-webkit-inner-spin-button,
input[type="password"]::-webkit-outer-spin-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

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

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

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

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

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

.btn-error:hover:not(:disabled) {
    background: #dc2626;
}

.btn-login {
    width: 100%;
    padding: 14px;
    min-height: 52px;
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 5.2rem;
}

.btn-loading {
    display: none !important;
}

.btn-login:hover:not(:disabled),
.btn-login:active,
.btn-login:focus {
    transform: none;
    box-shadow: var(--shadow-md);
}

.btn-login.loading {
    transform: none;
}

.btn-login.loading .btn-text {
    visibility: hidden;
}

.btn-login.loading .btn-loading {
    display: inline-block !important;
    position: absolute;
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loading {
    display: inline-block !important;
}

:root {
    --primary-color: #00ff7f;
    --primary-dark: #14c96a;
    --secondary-color: #1c4e30;
    --success-color: #00ff7f;
    --warning-color: #f5b700;
    --error-color: #ff5e5e;
    --background-color: #0a0f0b;
    --surface-color: #162018;
    --text-primary: #effaf3;
    --text-secondary: #89a08f;
    --border-color: rgba(0, 255, 127, 0.16);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.12);
    --shadow-md: 0 12px 25px -12px rgb(0 0 0 / 0.45), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 24px 60px -18px rgb(0 0 0 / 0.65), 0 8px 24px -12px rgb(0 0 0 / 0.45);
    --radius: 10px;
    --radius-lg: 18px;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(circle at top left, rgba(0, 255, 127, 0.10), transparent 32%),
        radial-gradient(circle at bottom right, rgba(28, 78, 48, 0.18), transparent 28%),
        var(--background-color);
    color: var(--text-primary);
}

h1, h2, h3, h4, .nav-brand, .call-config-title, .section-header h2, .section-header h3,
.dashboard-hero h2, .panel-heading h3, .dashboard-kpi-card strong, .performance-tile strong {
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

#login-screen {
    position: relative;
    overflow: hidden;
    background: #050705;
}

.login-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
    opacity: 1;
    z-index: 0;
}

.login-overlay {
    position: absolute;
    inset: 0;
    display: none;
    z-index: 1;
}

.login-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(34px);
    display: none;
    z-index: 1;
    background: transparent;
}

.login-glow-left {
    left: -120px;
    bottom: -160px;
}

.login-glow-right {
    right: -150px;
    top: -130px;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
}

.login-card {
    position: relative;
    background: linear-gradient(180deg, rgba(14, 22, 16, 0.92), rgba(8, 12, 9, 0.86));
    border: 2px solid rgba(0, 255, 127, 0.65);
    border-radius: 30px;
    padding: 2.35rem 2.2rem 4.8rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 255, 127, 0.2);
    backdrop-filter: blur(14px);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 36px;
    border: 1px solid rgba(0, 255, 127, 0.18);
    box-shadow: 0 0 40px rgba(0, 255, 127, 0.18);
    pointer-events: none;
}

.login-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    position: absolute;
    left: 50%;
    bottom: 0.05rem;
    transform: translateX(-50%);
    margin: 0;
    display: block;
}

.login-header i {
    color: #00ff7f;
    text-shadow: 0 0 24px rgba(0, 255, 127, 0.4);
}

.login-header h1 {
    color: transparent;
    font-size: 0;
    line-height: 0;
    margin-bottom: 0.6rem;
}

.login-header h1::after {
    content: "Thanos - Agente de Llamadas";
    color: #f2f7f4;
    font-size: 2.2rem;
    line-height: 1.08;
    letter-spacing: 0.02em;
    display: inline-block;
}

.login-header p {
    color: transparent;
    font-size: 0;
    line-height: 0;
}

.login-header p::after {
    content: "Automatizacion de prospeccion con IA";
    color: #8fa79a;
    font-size: 0.95rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
    display: inline-block;
}

.login-form label,
.login-form .form-group label {
    color: #b7cdbf;
}

.login-card input {
    background: rgba(12, 18, 14, 0.88);
    border-color: rgba(0, 255, 127, 0.22);
    color: #e8f4ec;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.login-card input::placeholder {
    color: #6e877c;
}

.login-card .input-group i {
    color: rgba(0, 255, 127, 0.6);
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #00ff7f, #0ee36f 65%, #0abf5f);
    color: #06100a;
    border: 1px solid rgba(0, 255, 127, 0.6);
    box-shadow: 0 14px 28px rgba(0, 255, 127, 0.25), 0 0 18px rgba(0, 255, 127, 0.2);
}

.navbar {
    background: rgba(10, 15, 11, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 255, 127, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav-brand {
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
}

.nav-item.active {
    background: rgba(0, 255, 127, 0.14);
    color: #00ff7f;
    box-shadow: inset 0 0 0 1px rgba(0, 255, 127, 0.2);
}

.main-content {
    max-width: 1480px;
}

.dashboard-shell {
    display: grid;
    gap: 1.7rem;
}

.dashboard-hero,
.dashboard-filters-panel,
.dashboard-kpi-card,
.dashboard-panel,
.dashboard-transcript-card {
    backdrop-filter: blur(18px);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.4rem;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(22, 32, 24, 0.96), rgba(10, 15, 11, 0.9));
    border: 1px solid rgba(0, 255, 127, 0.14);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.section-kicker,
.panel-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.72rem;
    color: #6de39c;
    font-weight: 700;
}

.dashboard-hero h2 {
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 0.95;
    margin: 0.35rem 0 0.65rem;
}

.dashboard-hero p {
    max-width: 64ch;
    color: var(--text-secondary);
}

.dashboard-meta-pill,
.panel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 255, 127, 0.08);
    color: #c7ffe0;
    border: 1px solid rgba(0, 255, 127, 0.16);
}

.dashboard-meta-pill-accent,
.panel-chip-accent {
    background: rgba(0, 255, 127, 0.14);
    color: #00ff7f;
}

.dashboard-filters-panel {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: end;
    padding: 0.75rem;
    border-radius: 16px;
    background: rgba(22, 32, 24, 0.88);
    border: 1px solid rgba(0, 255, 127, 0.12);
}

.dashboard-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    flex: 0 1 auto;
    align-items: end;
}

.dashboard-filter-actions {
    display: flex;
    gap: 0.8rem;
    flex: 0 0 auto;
    align-items: end;
}

/* Controles del panel de filtros */
.dashboard-filters-panel .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0;
}

.dashboard-filters-panel .form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #8ab69d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-filters-panel .form-group input,
.dashboard-filters-panel .form-group select {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 255, 127, 0.2);
    border-radius: 8px;
    background: rgba(16, 24, 18, 0.6);
    color: #f3fff7;
    height: 38px;
    min-height: 38px;
}

.dashboard-filters-panel .form-group input::placeholder {
    color: #6b8575;
}

.dashboard-filters-panel .form-group input:focus,
.dashboard-filters-panel .form-group select:focus {
    border-color: rgba(0, 255, 127, 0.4);
    outline: none;
}

.dashboard-filters-panel .dashboard-phone-filter input {
    grid-column: span 2;
}

.dashboard-filters-panel .dashboard-user-filter select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 255, 127, 0.2);
    border-radius: 8px;
    background: rgba(16, 24, 18, 0.6);
    color: #f3fff7;
    height: 38px;
    min-height: 38px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238ab69d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
}

.dashboard-filters-panel .dashboard-user-filter select:focus {
    border-color: rgba(0, 255, 127, 0.4);
    outline: none;
}

.dashboard-filters-panel .dashboard-user-filter select option {
    background: rgba(22, 32, 24, 0.98);
    color: #f3fff7;
}

/* Panel de filtros en Transcripciones - mismo diseño que Dashboard */
.leads-section .dashboard-filters-panel {
    margin-top: 1.5rem;
}

.leads-section .dashboard-filters-grid {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

/* El select ocupa todo el ancho de su columna */
.leads-section .dashboard-filters-panel .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.leads-section .dashboard-filters-panel .form-group label {
    font-size: 0.85rem;
    color: #8ab69d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.leads-section .dashboard-filters-panel .form-group:not(.dashboard-user-filter) select {
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 255, 127, 0.2);
    border-radius: 8px;
    background: rgba(16, 24, 18, 0.6);
    color: #f3fff7;
}

/* En mobile, el select ocupa todo el ancho */
@media (max-width: 768px) {
    .leads-section .dashboard-filters-panel .form-group select {
        width: 100%;
    }
}

.leads-section .dashboard-filters-panel .dashboard-filter-actions {
    flex-shrink: 0;
}

/* Ocultar contenedor pero mantener espacio en grid */
.dashboard-filters-panel .dashboard-user-filter[style*="display: none"],
.dashboard-filters-panel .dashboard-user-filter.hidden {
    display: none;
}

/* Botones del panel de filtros - misma altura que inputs (38px) */
.dashboard-filters-panel .dashboard-filter-actions .btn {
    padding: 0 16px;
    height: 38px;
    min-height: 38px;
    font-size: 0.8rem;
}

/* Botón en panel de Transcripciones */
.leads-section .dashboard-filters-panel .dashboard-filter-actions .btn {
    padding: 0 16px;
    height: 38px;
    min-height: 38px;
    font-size: 0.85rem;
}

.dashboard-filters-panel .dashboard-filter-actions .btn i {
    font-size: 0.85rem;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    width: 100%;
}

.dashboard-kpi-card {
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(22, 32, 24, 0.96), rgba(16, 24, 18, 0.92));
    border: 1px solid rgba(0, 255, 127, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.dashboard-kpi-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: clamp(1.8rem, 2vw, 2.4rem);
    color: #f3fff7;
}

.dashboard-kpi-card p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.kpi-label {
    color: #8ab69d;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
}

.dashboard-panels-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 0.9rem;
    width: 100%;
}

.dashboard-panels-grid-bottom {
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
}

.dashboard-panel-full {
    width: 100%;
}

.dashboard-panel {
    padding: 1rem;
    border-radius: 22px;
    background: rgba(22, 32, 24, 0.92);
    border: 1px solid rgba(0, 255, 127, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    min-height: 320px;
}

.dashboard-panel-wide {
    min-height: 360px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading h3 {
    font-size: 1.55rem;
    margin-top: 0.2rem;
}

.dashboard-bar-list {
    display: grid;
    gap: 0.8rem;
}

.dashboard-bar-row {
    display: grid;
    grid-template-columns: 220px 1fr 56px;
    gap: 0.75rem;
    align-items: center;
}

.dashboard-bar-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dashboard-bar-label strong {
    font-size: 1rem;
}

.dashboard-bar-label span,
.dashboard-lead-phone,
.dashboard-transcript-head span,
.dashboard-transcript-foot span {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.dashboard-bar-track {
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    border: 1px solid rgba(0, 255, 127, 0.10);
}

.dashboard-bar-track-soft {
    height: 10px;
}

.dashboard-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00ff7f, #89ffb9);
    box-shadow: 0 0 18px rgba(0, 255, 127, 0.32);
}

.dashboard-bar-fill-alt {
    background: linear-gradient(90deg, #1c4e30, #00ff7f);
}

.dashboard-bar-value {
    text-align: right;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.dashboard-status-list {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.status-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
    color: #ebfff2;
}

.dashboard-performance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
}

.performance-tile {
    padding: 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 255, 127, 0.10);
}

.performance-label {
    display: block;
    color: #8ab69d;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
}

.performance-tile strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.45rem;
}

.dashboard-table-wrap {
    overflow: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

.dashboard-table th,
.dashboard-table td {
    padding: 0.8rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: middle;
}

.dashboard-table thead th {
    color: #9ac8ae;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
}

.dashboard-lead-name {
    font-weight: 700;
}

.dashboard-table-empty {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
}

.dashboard-transcripts-list {
    display: grid;
    gap: 0.8rem;
}

.dashboard-transcript-card {
    padding: 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 127, 0.10);
}

.dashboard-transcript-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.dashboard-transcript-head strong {
    display: block;
}

.dashboard-transcript-card p {
    color: #d7e9db;
    line-height: 1.45;
    margin-bottom: 0.75rem;
}

.dashboard-transcript-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.dashboard-empty-state {
    padding: 1.3rem;
    border-radius: 16px;
    border: 1px dashed rgba(0, 255, 127, 0.18);
    color: var(--text-secondary);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.dashboard-empty-state-soft {
    background: rgba(255, 255, 255, 0.03);
}

.status-badge.status-dnc {
    background: #fed7aa;
    color: #7c2d12;
}

.data-table {
    background: rgba(22, 32, 24, 0.94);
    color: var(--text-primary);
    border: 1px solid rgba(0, 255, 127, 0.12);
}

.data-table th {
    color: #9ac8ae;
    background: rgba(255, 255, 255, 0.02);
}

.data-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.leads-table-container,
.users-table-container,
.clients-table-container {
    overflow: auto;
    border-radius: 20px;
}

.modal-content {
    background: linear-gradient(180deg, rgba(22, 32, 24, 0.98), rgba(12, 17, 13, 0.98));
    color: var(--text-primary);
    border: 1px solid rgba(0, 255, 127, 0.16);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.call-config-panel,
.lead-detail-panel,
.live-transcript-panel,
.transcript-card,
.number-card,
.settings-form {
    border-color: rgba(0, 255, 127, 0.10);
    background: rgba(22, 32, 24, 0.90);
}

input,
textarea,
select {
    background: rgba(18, 26, 19, 0.98);
    color: var(--text-primary);
    border-color: rgba(0, 255, 127, 0.16);
}

input::placeholder,
textarea::placeholder {
    color: #6d8473;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff7f, #12d166);
    color: #07110b;
    box-shadow: 0 10px 30px rgba(0, 255, 127, 0.18);
}

.btn-outline {
    background: rgba(22, 32, 24, 0.54);
    border-color: rgba(0, 255, 127, 0.16);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(0, 255, 127, 0.08);
    border-color: rgba(0, 255, 127, 0.28);
}

@media (max-width: 1280px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-panels-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .navbar,
    .nav-menu,
    .nav-user,
    .dashboard-filters-panel,
    .dashboard-filter-actions,
    .dashboard-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filters-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-bar-row {
        grid-template-columns: 1fr;
    }

    .dashboard-bar-value {
        text-align: left;
    }

    .main-content {
        padding: 1rem;
    }

    .login-card {
        padding: 1.5rem;
        border-radius: 24px;
    }
}

/* Error Messages */
.error-message {
    background: rgba(255, 94, 94, 0.12);
    border: 1px solid rgba(255, 94, 94, 0.3);
    color: #ff5e5e;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 1rem;
}

.success-message {
    background: rgba(0, 255, 127, 0.12);
    border: 1px solid rgba(0, 255, 127, 0.3);
    color: #00ff7f;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 255, 127, 0.2);
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 2000;
    max-width: 420px;
}

@media (max-width: 720px) {
    .success-message {
        top: 72px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* Navigation */
.navbar {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Logo wrapper para navbar */
.nav-logo-wrapper {
    width: 200px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Logo específico para navbar */
.nav-logo {
    max-width: 100% !important;
    max-height: 120px !important;
    height: auto !important;
    display: block !important;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-color);
    color: #1e293b;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

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

.section-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.section-description {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 48rem;
}

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

.call-config-panel {
    margin: 0.5rem 0 0;
    padding: 0.75rem 0.75rem 0.5rem;
    border: 1px solid rgba(0, 255, 127, 0.12);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(22, 32, 24, 0.97), rgba(12, 17, 13, 0.98));
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.call-config-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
}

.call-config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.field-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #8ea495;
}

.sim-formula {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 127, 0.12);
    background: rgba(12, 17, 13, 0.75);
    color: #c6d7cc;
    font-size: 0.8rem;
    line-height: 1.5;
}

.sim-formula p {
    margin: 0.2rem 0;
}

#sim-results .dashboard-kpi-card strong {
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
}

.active-calls-indicator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 8px 12px;
    background: var(--success-color);
    color: #1e293b;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Phone Numbers Grid */
.phone-numbers-grid {
    margin-top: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.numbers-list {
    display: grid;
    gap: 1px;
    background: var(--border-color);
}

.number-card {
    background: var(--surface-color);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.number-card:hover {
    background: var(--background-color);
}

.number-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.number-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.call-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.call-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.number-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Botones del modal CSV - agrandados */
.csv-cancel-btn,
.csv-submit-btn {
    padding: 10px 24px;
    font-size: 0.95rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--text-primary);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Data Table */
.data-table {
    width: 100%;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.data-table td {
    color: var(--text-primary);
    font-size: 0.875rem;
}

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

.data-table tr:hover {
    background: var(--background-color);
}

/* Integrations panel */
.clients-table-container {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.clients-table-container .data-table {
    border-radius: 0;
    box-shadow: none;
    min-width: 900px;
}

.clients-table-container .data-table th,
.clients-table-container .data-table td {
    white-space: nowrap;
}

.clients-table-container .data-table th:nth-child(1),
.clients-table-container .data-table td:nth-child(1) {
    width: 22%;
    white-space: normal;
}

.clients-table-container .data-table th:nth-child(2),
.clients-table-container .data-table td:nth-child(2) {
    width: 28%;
}

.clients-table-container .data-table td:nth-child(2) code {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Make the "Crear cliente" button in Integrations compact and visually consistent */
#integrations-tab .header-actions #create-client-btn {
    padding: 8px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Hide icon only inside the compact "Crear cliente" button, keep other icons visible */
#integrations-tab .header-actions #create-client-btn i {
    display: none;
}

.clients-table-container .data-table th:nth-child(5),
.clients-table-container .data-table td:nth-child(5) {
    min-width: 220px;
}

.clients-table-container .status-badge {
    display: inline-flex;
    align-items: center;
}

.clients-table-container .action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.clients-table-container .action-buttons .btn {
    white-space: nowrap;
}

.clients-table-container tbody tr:hover {
    background: rgba(0, 255, 127, 0.06);
}

#integrations-tab .clients-table-container tbody tr:hover td {
    background: transparent;
}

/* Settings Form */
.settings-form {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal .form-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-height: 40px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease-out;
}

.modal-large {
    max-width: 800px;
}

.modal.active {
    align-items: flex-start;
    padding-top: 5vh;
}

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

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

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

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

.modal-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.modal form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Create Integration Client Modal */
.create-client-modal-content {
    width: min(920px, calc(100vw - 32px));
    max-width: 920px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(13, 19, 14, 0.98), rgba(9, 13, 10, 0.98));
    border: 1px solid rgba(0, 255, 127, 0.14);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    border-radius: 28px;
}

.create-client-modal-header {
    align-items: flex-start;
    gap: 1rem;
    background: rgba(22, 32, 24, 0.92);
    border-bottom: 1px solid rgba(0, 255, 127, 0.12);
    padding: 1.5rem 1.75rem 1.2rem;
}

.create-client-modal-header p {
    margin-top: 0.35rem;
    color: #96b9a3;
    font-size: 0.875rem;
}

.create-client-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.75rem 1.2rem;
    border-bottom: 1px solid rgba(0, 255, 127, 0.08);
    background:
        radial-gradient(circle at top right, rgba(0, 255, 127, 0.12), transparent 38%),
        linear-gradient(180deg, rgba(16, 24, 18, 0.98), rgba(11, 16, 12, 0.98));
}

.create-client-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(0, 255, 127, 0.18), rgba(18, 209, 102, 0.12));
    border: 1px solid rgba(0, 255, 127, 0.18);
    color: #00ff7f;
    font-size: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.create-client-hero-copy {
    display: grid;
    gap: 0.25rem;
}

.create-client-hero-copy span {
    color: #79f2a8;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
}

.create-client-hero-copy strong {
    color: #f3fff7;
    font-size: 1.15rem;
}

.create-client-hero-copy p {
    color: #96b9a3;
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 58ch;
}

.create-client-body {
    padding: 1.35rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-client-step {
    border: 1px solid rgba(0, 255, 127, 0.12);
    border-radius: 16px;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(22, 32, 24, 0.98), rgba(16, 24, 18, 0.96));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.create-client-step-form {
    box-shadow: inset 0 1px 0 rgba(0, 255, 127, 0.04);
}

.create-client-step-result {
    border-color: rgba(0, 255, 127, 0.14);
    background: linear-gradient(180deg, rgba(18, 26, 19, 0.98), rgba(12, 17, 14, 0.98));
}

.step-label {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 255, 127, 0.08);
    color: #79f2a8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.step-label-success {
    background: rgba(0, 255, 127, 0.12);
    color: #00ff7f;
}

.create-client-step h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.step-help {
    color: #96b9a3;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.step-help-strong {
    color: #bdfad0;
}

.create-client-form {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-client-actions,
.create-client-footer-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.create-client-actions {
    margin-top: 0.25rem;
}

.credential-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.credential-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e9fff0;
}

.credential-input-group {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.credential-input-group input {
    flex: 1;
    min-width: 0;
    font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    letter-spacing: 0.01em;
    background: rgba(18, 26, 19, 0.98);
    color: #f3fff7;
    border-color: rgba(0, 255, 127, 0.16);
}

.copy-credential-btn {
    min-width: 44px;
    padding: 0 0.9rem;
    flex-shrink: 0;
}

.copy-credential-btn i {
    pointer-events: none;
}

.create-client-footer-actions {
    margin-top: 1.5rem;
}

.create-client-step-result .create-client-footer-actions .btn-secondary {
    background: rgba(22, 32, 24, 0.82);
    color: #e9fff0;
    border: 1px solid rgba(0, 255, 127, 0.12);
}

.create-client-step-result .create-client-footer-actions .btn-secondary:hover:not(:disabled) {
    background: rgba(0, 255, 127, 0.08);
}

.create-client-step-result .create-client-footer-actions .btn-primary {
    box-shadow: 0 10px 20px rgba(0, 255, 127, 0.14);
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading i {
    margin-right: 0.5rem;
}

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

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

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

.empty-state p {
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .call-config-grid {
        grid-template-columns: 1fr;
    }

    .create-client-modal-header,
    .create-client-footer-actions,
    .create-client-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .create-client-footer-actions .btn,
    .create-client-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .create-client-body,
    .create-client-modal-content .modal-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .create-client-step {
        padding: 1rem;
    }

    .credential-input-group {
        flex-direction: column;
    }

    .copy-credential-btn {
        width: 100%;
    }
    
    .number-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .number-actions {
        justify-content: center;
    }
    
    .modal-content {
        margin: 20px;
        max-width: none;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
}

/* Responsive para filtro de leads en Transcripciones */
@media (max-width: 768px) {
    .leads-section .dashboard-filters-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .leads-section .dashboard-filters-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .leads-section .dashboard-filter-actions {
        width: 100%;
    }

    .leads-section .dashboard-filter-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .modal form {
        padding: 1.5rem;
    }
}


/* ───────────────────────────────────────────────
   Panel de Transcripción en Vivo
   ─────────────────────────────────────────────── */
.live-transcript-panel {
    margin-top: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.transcript-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.transcript-header i {
    font-size: 1rem;
}

.transcript-phone {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.9;
}

.transcript-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.transcript-line {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.transcript-line .time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    min-width: 45px;
    text-align: right;
}

.transcript-line .speaker {
    font-weight: 600;
    min-width: 55px;
    text-align: right;
}

.transcript-line.alex .speaker {
    color: var(--success-color);
}

.transcript-line.usuario .speaker {
    color: var(--primary-color);
}

.transcript-line.sistema .speaker {
    color: var(--text-secondary);
}

.transcript-line .text {
    flex: 1;
    color: var(--text-primary);
}

/* ── Leads Section ────────────────────────────────────────────── */

.leads-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.leads-table {
    width: 100%;
}

.leads-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.leads-table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

/* Status badges */
.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.status-completed { background: #1a7a3a22; color: #1a7a3a; }
.status-failed { background: #c42b2b22; color: #c42b2b; }
.status-pending { background: #3a3a4a44; color: #888; }
.status-dnc { background: #c42b2b33; color: #c42b2b; font-weight: 700; }

/* Lead detail panel */
.lead-detail-panel {
    margin-top: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.lead-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.lead-detail-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.lead-detail-phone {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: monospace;
}

.lead-detail-body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

@media (max-width: 768px) {
    .lead-detail-body {
        grid-template-columns: 1fr;
    }
}

.lead-detail-col {
    min-width: 0;
}

.lead-info-card, .transcript-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.lead-info-card h4, .transcript-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.lead-info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0.5rem 0 0.1rem 0;
    letter-spacing: 0.5px;
}

.lead-info-value {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.transcript-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.transcript-call {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.transcript-call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.transcript-body {
    padding: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.transcript-line {
    padding: 3px 0;
    display: flex;
    gap: 6px;
}

.transcript-line .speaker {
    font-weight: 600;
    min-width: 55px;
    flex-shrink: 0;
}

.transcript-line.agent-line .speaker { color: #4ade80; }
.transcript-line.user-line .speaker { color: #60a5fa; }
.transcript-line.system-line { color: #888; font-style: italic; padding-left: 12px; }

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* ───────────────────────────────────────────────
   Audio Previews Section (Muestras de Voz)
   ─────────────────────────────────────────────── */
.audio-previews-section {
    margin-top: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.audio-previews-section .section-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.audio-previews-section .btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 34px;
}

.audio-previews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1rem 0.5rem;
}

.audio-previews-grid.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 210px;
    padding: 1rem;
}

.audio-previews-grid .empty-state {
    text-align: center;
    max-width: 340px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.45;
}

.audio-sample-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.audio-sample-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.audio-sample-info {
    margin-bottom: 0.5rem;
}

.audio-sample-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.audio-sample-engine {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audio-sample-player {
    display: flex;
    justify-content: flex-end;
}

.audio-sample-player .btn {
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* ───────────────────────────────────────────────
   Logo Size Fixes
   ─────────────────────────────────────────────── */
.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.login-logo .logo-img,
.login-header img {
        width: 260px !important;
    /* max-width: 100% !important; */
    height: auto !important;
    /* max-height: 210px !important; */
    object-fit: contain !important;
    display: block !important;
    /* margin-top: -83px; */
    /* margin-right: -34px; */
    margin-left: -5px;
    margin-bottom: -40px;
}

/* ───────────────────────────────────────────────
   Costs Section
   ─────────────────────────────────────────────── */

.costs-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.costs-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

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

.costs-breakdown-item:hover {
    background: rgba(0, 255, 127, 0.04);
}

.costs-breakdown-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.costs-breakdown-label i {
    color: var(--primary-color);
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
}

.costs-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.costs-breakdown-values {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.costs-calls {
    color: var(--text-secondary);
    min-width: 85px;
    text-align: right;
}

.costs-minutes {
    color: var(--text-secondary);
    min-width: 60px;
    text-align: right;
}

.costs-amount {
    color: var(--primary-color);
    font-weight: 700;
    min-width: 110px;
    text-align: right;
    font-size: 0.9rem;
}

.costs-breakdown-detail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.costs-breakdown-detail small {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.costs-rates-table-container {
    overflow-x: auto;
}

.costs-rates-table-container .data-table {
    font-size: 0.82rem;
}

.costs-rates-table-container .data-table td {
    vertical-align: top;
}

.costs-rates-table-container .rates-group td {
    background: rgba(12, 18, 14, 0.9);
    color: #8ab69d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    border-bottom: 1px solid rgba(0, 255, 127, 0.12);
}

.costs-rates-table-container .rates-metric {
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
}

.costs-rates-table-container .data-table td strong {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .costs-breakdown-values {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }

    .costs-calls,
    .costs-minutes {
        min-width: auto;
        font-size: 0.75rem;
    }

    .costs-amount {
        min-width: auto;
    }
}

/* ───────────────────────────────────────────────
   Monthly Quota Card
   ─────────────────────────────────────────────── */
.quota-card {
    margin-top: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.quota-card.quota-warning .quota-progress-fill {
    background: var(--warning-color);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.quota-card.quota-danger .quota-progress-fill {
    background: var(--error-color);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.quota-card.quota-blocked {
    border: 2px solid var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.quota-card.quota-blocked .quota-progress-fill {
    background: var(--error-color);
}

.quota-card.quota-unlimited {
    border: 1px solid rgba(0, 255, 127, 0.3);
    background: linear-gradient(135deg, rgba(0, 255, 127, 0.05), rgba(0, 255, 127, 0.02));
}

.quota-card.quota-unlimited .quota-progress-fill {
    background: linear-gradient(90deg, #00ff7f, #12d166);
}

.quota-card.quota-unlimited .quota-progress-bar {
    border: 1px dashed rgba(0, 255, 127, 0.3);
}

.quota-card.quota-unlimited .quota-progress-bar::after {
    content: "Ilimitado";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff7f;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.5;
}

.quota-card-content {
    padding: 1.25rem 1.5rem;
}

.quota-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quota-header i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.quota-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.quota-title strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quota-period {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.quota-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.quota-usage {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.quota-used {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
}

.quota-divider {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.quota-limit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.quota-remaining {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.quota-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

.quota-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.4s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.quota-message {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.quota-message.blocked {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.quota-message.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.quota-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
}

.quota-message.unlimited {
    background: rgba(0, 255, 127, 0.1);
    border: 1px solid rgba(0, 255, 127, 0.2);
    color: #00ff7f;
}

/* ───────────────────────────────────────────────
   Responsive for Quota Card
   ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .quota-card-content {
        padding: 1rem;
    }

    .quota-header {
        gap: 0.5rem;
    }

    .quota-title strong {
        font-size: 0.95rem;
    }

    .quota-usage {
        gap: 0.15rem;
    }

    .quota-used {
        font-size: 1.25rem;
    }

    .quota-limit {
        font-size: 0.85rem;
    }

    .quota-remaining {
        font-size: 0.75rem;
    }
}

/* Phone Numbers: modular layout and visual balance */
#phone-numbers-section .section-header {
    margin-bottom: 1.25rem;
    gap: 0.85rem;
}

#phone-numbers-section .header-actions {
    gap: 0.65rem;
}

#phone-numbers-section .header-actions .btn,
#phone-numbers-section .active-calls-indicator {
    min-height: 42px;
    padding-top: 0;
    padding-bottom: 0;
}

#phone-numbers-section .active-calls-indicator {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    border: 1px solid rgba(0, 255, 127, 0.2);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.phone-setup-stack {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.phone-setup-card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 255, 127, 0.14);
    background: linear-gradient(180deg, rgba(22, 32, 24, 0.96), rgba(12, 17, 13, 0.98));
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
}

.quota-card.phone-setup-card {
    margin-top: 0;
}

.quota-card.phone-setup-card .quota-card-content {
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.7rem;
}

.quota-card.phone-setup-card .quota-header {
    margin-bottom: 0;
}

.quota-card.phone-setup-card .quota-info {
    margin-bottom: 0;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
}

.quota-card.phone-setup-card .quota-used {
    font-size: 1.35rem;
}

.quota-card.phone-setup-card .quota-progress-bar {
    height: 8px;
}

.quota-card.phone-setup-card .quota-message {
    margin-top: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.call-config-panel.phone-setup-card {
    margin: 0;
    padding: 1rem 1.1rem;
}

.call-config-panel.phone-setup-card .call-config-title {
    margin-bottom: 0.8rem;
}

.call-config-panel.phone-setup-card .call-config-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.call-config-panel.phone-setup-card .form-group {
    gap: 0.35rem;
}

.call-config-panel.phone-setup-card .form-group label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9bc6ae;
}

.call-config-panel.phone-setup-card select {
    min-height: 42px;
}

.call-config-panel.phone-setup-card .field-hint {
    margin-top: 0.3rem;
    min-height: 2.2em;
}

@media (max-width: 992px) {
    .call-config-panel.phone-setup-card .call-config-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #phone-numbers-section .section-header {
        margin-bottom: 1rem;
    }

    #phone-numbers-section .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    #phone-numbers-section .header-actions .btn,
    #phone-numbers-section .active-calls-indicator {
        width: 100%;
        justify-content: center;
    }

    .phone-setup-stack {
        gap: 0.75rem;
    }

    .quota-card.phone-setup-card .quota-card-content,
    .call-config-panel.phone-setup-card {
        padding: 0.95rem;
    }

    .call-config-panel.phone-setup-card .call-config-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .call-config-panel.phone-setup-card .field-hint {
        min-height: 0;
    }
}
