/**
 * CSS personalizado para impersonación y tenant
 * Este archivo contiene estilos específicos para cuando un tenant está impersonando a un subcliente.
 * Asegura que ciertos elementos se oculten o se muestren de manera diferente durante la impersonación.
 */

 /* Variables */

:root {
    --tsm-green: #08B07C;
    --tsm-dark-blue: #212F58;
    --tsm-medium-blue: #3F5BAE;;
    --tsm-bright-blue:  #3366ff;
    --tsm-gray-light: #E0E0E0;
    --tsm-purple: #7C3AED;
}



/* Estilos tenant - subcliente */

.tsm-is-tenant .hide-on-impersonation,
.tsm-impersonating-subclient .hide-on-impersonation {
    display: none !important;
}

.tsm-is-tenant .my-clients-tenant-menu-item, 
.tsm-impersonating-subclient .my-clients-tenant-menu-item {
    margin-right: 20px !important;
}

.tsm_default_button {
    background-color: var(--tsm-green) !important;
    color: white !important;
    border: none !important;
    padding: 10px 10px !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    margin-left: 24px !important;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-align: center;
    line-height: 18px !important;
    font-weight: 600 !important;
}

/* Ocultar botón Continuar a Servicios contratados */
.tsm-is-tenant .cc-thankyou-services-wrap,
.tsm-is-tenant .elementor-element-2be2dae,
.tsm-impersonating-subclient .elementor-element-2be2dae, 
.page-id-8043 .entry-title  {
    display: none !important;
}

.page-id-8043 .page-header {
    padding-top: 46px;
}

/* En impersonación: reemplazar contenido del wrap con el botón de volver */
.tsm-impersonating-subclient .cc-thankyou-services-wrap.tsm-back-injected {
    display: flex !important;
}
.tsm-impersonating-subclient .cc-thankyou-services-wrap:not(.tsm-back-injected) {
    display: none !important;
}

.tsm-impersonating-subclient.woocommerce-page .elementor-widget-woocommerce-my-account .form-row label {
    margin-bottom: 10px !important;
}


.tsm-impersonating-subclient .cc-divider-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/*** En impersonación, bloquear enlace order en tabla suscripciones */
.tsm-is-tenant .wps_sfw_account_additional_wrap .woocommerce-orders-table__cell-parent-id a {
    pointer-events: none;
    color: #ccc;
    text-decoration: none;
}


/* Ocultar campos de contraseña en editar cuenta (solo impersonación) */
.tsm-impersonating-subclient .woocommerce-form-row:has(#password_current),
.tsm-impersonating-subclient .woocommerce-form-row:has(#password_1),
.tsm-impersonating-subclient .woocommerce-form-row:has(#password_2),
.tsm-impersonating-subclient fieldset:has(#password_current) {
    display: none !important;
}

/* Nombre del subcliente en el menú de navegación */
.tsm-is-tenant .woocommerce-MyAccount-navigation ul li, 
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li {
    /* padding: 1em !important; */
    margin-bottom: 4px;
    font-size: 18px;
}
.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.is-active, 
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li.is-active {
    background-color: var(--tsm-gray-light) !important;
}

.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.is-active a, 
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li.is-active a {
    text-decoration: none !important;
}

.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--subclient-name,
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--subclient-name a {
    background-color: var(--tsm-green) !important;
    pointer-events: none;
}

.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--subclient-name a,
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--subclient-name a {
    color: #ffffff !important;
    font-weight: bold;
    cursor: default;
}

.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--subclient-name a:hover,
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--subclient-name a:hover {
    color: #ffffff !important;
}

/* Ocultar opciones de menú para tenant (solo mostrar: payment-methods, edit-account, subscriptions, tenant-my-clients, personalizacion, customer-logout) */
.tsm-is-tenant .woocommerce-MyAccount-navigation ul li:not(.woocommerce-MyAccount-navigation-link--payment-methods):not(.woocommerce-MyAccount-navigation-link--edit-account):not(.woocommerce-MyAccount-navigation-link--wps_subscriptions):not(.woocommerce-MyAccount-navigation-link--tenant-my-clients):not(.woocommerce-MyAccount-navigation-link--personalizacion):not(.woocommerce-MyAccount-navigation-link--customer-logout):not(.woocommerce-MyAccount-navigation-link--tenant-account-title) {
    display: none !important;
}

/* Ocultar botón Salir en menú subcliente */
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout {
    display: none !important;
}

/* Ocultar Afiliado */
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--coupon-affiliate {
    display: none !important;
}


/* Título "Mi cuenta" para tenant */
.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--tenant-account-title {
    background-color: var(--tsm-dark-blue) !important;
    pointer-events: none;
}

.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--tenant-account-title a {
    color: #ffffff !important;
    font-weight: bold;
    cursor: default;
    background-color: transparent !important;
}

.tsm-is-tenant .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--tenant-account-title a:hover {
    color: #ffffff !important;
}

/* Ocultar título "Mi cuenta" cuando es tenant */
.tsm-is-tenant .wp-block-post-title,
.tsm-impersonating-subclient .wp-block-post-title {
    display: none !important;
}

/* Mi auditoría */

.tsm-is-tenant .panel-obligaciones .cc-audit-hero > .cc-audit-hero__title,
.tsm-impersonating-subclient .panel-obligaciones .cc-audit-hero > .cc-audit-hero__title {
    font-size: 30px;
}

.panel-obligaciones .cc-price-summary .woocommerce-Price-amount.amount {
    font-size: 18px !important;
    color: var(--tsm-dark-blue) !important;
}

/* Estilos para lista de clientes del shortcode */
.tsm-add-client-row {
    display: flex;
    margin-bottom: 24px;
    justify-content: space-between;
    align-items: start;
    margin-top: 32px;
} 

.tsm-add-client-row h2 {
    font-size: 30px;
    margin-top: 0px;
}

.tsm-search-row .tsm-search-input {
    padding: 10px 16px 10px 36px;
    border: 1px solid var(--tsm-gray-light);
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 14px;
    min-width: 300px;
}

.tsm-search-row .tsm-search-input::placeholder {
    color: #b0b5bd;
    font-size: 13px;
    font-style: italic;
}

.tsm-add-client-button.tsm-add-client-button-top {
    margin-top: 0;
    border-radius: 4px;
}

.tsm-subclients-shortcode-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.tsm-subclients-shortcode-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background-color: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
}

.tsm-client-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tsm-client-name {
    font-weight: 600;
    color: #1F2937;
}

.tsm-separator {
    color: #9CA3AF;
}

.tsm-client-nif {
    color: #6B7280;
}

.tsm-view-client {
    color: var(--tsm-green) !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 16px;
    border: 2px solid var(--tsm-green);
    padding: 2px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Botón copiar enlace en lista de subclientes */
.tsm-client-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tsm-subclients-shortcode-list .tsm-client-actions .tsm-copy-link-btn {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    margin-right: 20px;
    color: var(--tsm-dark-blue);
    font-weight: 500;
    transition: opacity 0.25s ease;
    white-space: nowrap;
    color: var(--tsm-bright-blue) !important;
}

.tsm-client-actions .tsm-copy-link-btn.tsm-fade-out {
    opacity: 0;
}

.tsm-client-actions .tsm-copy-link-btn:hover {
    background: none;
    color: var(--tsm-medium-blue);
}

.tsm-client-actions .tsm-copy-link-btn:focus,
.tsm-client-actions .tsm-copy-link-btn:focus-visible {
    background: none;
    border-color: none;
    outline: none;
    box-shadow: none;
}

.tsm-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--tsm-gray-light);
    border-top-color: var(--tsm-green);
    border-radius: 50%;
    animation: tsm-spin 0.6s linear infinite;
}

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

/* Panel de URL: flujo normal dentro del li, empuja a los siguientes lis */
.tsm-url-panel {
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* gap: 8px; */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease, margin 0.3s ease;
}

.tsm-url-panel.open {
    max-height: 120px;
    opacity: 1;
    padding: 12px !important;
    margin-top: 12px;
    border-top: 1px solid #E5E7EB;
    background: #fff;
    padding: 14px;
}

.tsm-url-panel-close {
    position: absolute;
    top: 12px;
    right: 0;
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--tsm-dark-blue) !important;
    padding: 0 4px;
    font-size: 18px !important;
    font-weight: bold !important;
}

.tsm-url-panel-close:hover {
    color: var(--tsm-medium-blue) !important;
    background: none !important;
}

.tsm-url-panel-hint {
    width: 92%;
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #6B7280;
    line-height: 1.4;
}

.tsm-url-panel-text {
    font-size: 12px;
    color: var(--tsm-dark-blue);
    padding: 8px;
    background: #F3F4F6;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    /* text-overflow: ellipsis;
    max-width: 350px; */
}

.tsm-url-panel-copy {
    background: var(--tsm-dark-blue) !important;
    color: white !important;
    padding: 6px 12px;
    font-weight: 600;
    border: 1px solid var(--tsm-dark-blue) !important;
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
    font-size: 12px;
}

.tsm-url-panel-copy:hover, 
.tsm-url-panel-copy:focus,
.tsm-url-panel-copy:focus-visible {
    background: var(--tsm-medium-blue) !important;
    border-color: var(--tsm-medium-blue) !important;
}

/* .tsm-view-client:hover {
    text-decoration: underline;
} */


/* ─── Mis Suscripciones: homogeneización de tablas TSM con WPS ─────────────── */

/* Separación entre bloques de subclientes */
.tsm-subclients-subscriptions {
    margin-top: 20px;
}

.tsm-subclient-subscription-row {
    margin-bottom: 30px;
}

/* Encabezado del subcliente: mismo aspecto que las cabeceras de sección del WPS */
.tsm-subclient-subscription-row h3 {
    padding: 10px 15px 10px 0px;
    font-size: 18px;
    margin: 0 0 10px;
    font-weight: 500;
    line-height: 1.25;
    color: #000000;
    cursor: default;
    font-size: 22px;
}

.tsm-subclient-subscription-row h3 .tsm-subclient-nif {
    margin-left: 8px;
    font-weight: 400;
    font-size: 15px;
    color: #6B7280;
}

/* Contenedor del bloque de suscripciones: igual que .wps_sfw_account_additional_wrap */
.tsm-subscription-block {
    overflow-x: auto;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.12);
    border: 1px solid #dddddd;
    transition: all 0.2s linear;
}

.tsm-subscription-block:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
}

.tsm-is-tenant .wps_sfw_account_wrap table .woocommerce-Price-amount.amount {
    font-size: 14px !important;
    color: var(--tsm-dark-blue) !important;
}

/* Tabla de suscripciones TSM */
.tsm-subscription-table {
    width: 100%;
    border: none;
    margin: 0;
}

.tsm-subscription-table thead th.woocommerce-orders-table__header {
    border-bottom: 1px solid #ccc;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.25;
    color: #000;
    background: transparent;
    padding: 15px;
    text-align: left;
    vertical-align: middle;
}

.tsm-subscription-table tbody td {
    background: transparent;
    padding: 15px;
    text-align: left;
}

.tsm-subscription-table tbody tr {
    border: none;
}

.tsm-subscription-table tbody tr:nth-of-type(even) {
    background: #f8f8f8;
}

/* Estado de la suscripción: mismo estilo de píldora que el WPS */
.tsm-subscription-table .subscription-status {
    background: #b7ddb7;
    padding: 3px 5px;
    line-height: 1.25;
    border-radius: 3px;
    color: green;
    font-size: 14px;
    text-transform: capitalize;
}

.tsm-subscription-table .subscription-status.failed,
.tsm-subscription-table .subscription-status.cancelled {
    background: #f8d7da;
    color: #842029;
}

.tsm-subscription-table .subscription-status.pending,
.tsm-subscription-table .subscription-status.on-hold {
    background: #fff3cd;
    color: #856404;
}

/* Botón "Ver" coherente con los botones de acción del WPS */
.tsm-subscription-table .woocommerce-button.button.view {
    margin: 0;
    border-radius: 5px;
    padding: 8px 18px;
    line-height: 1.25;
    font-size: 14px;
    display: inline-block;
}

/* Badges de tipo: Suscripción / Licencia */
.tsm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tsm-badge--subscription,
.tsm-badge--licence {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.tsm-badge--plan {
    background-color: var(--tsm-green);
    color: white;
}

.tsm-badge--premium {
    background-color: var(--tsm-purple);
    color: white;
}

.tsm-badge--alta {
    background-color: var(--tsm-dark-blue);
    color: white;
}

/* .tsm-badge--licence {
    background-color: #fef3c7;
    color: #92400e;
} */

.wps_sfw_details_wrap .tsm-subcriptions-title {
    display: none !important;
}


/* ─── Homogeneización de anchos de columna: WPS + TSM ───────────────────────
   La tabla WPS tiene 6 columnas; la tabla TSM tiene 7 (añade "Tipo" como col 1).
   Se usa table-layout: fixed para que los anchos sean controlados. */

.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table,
.tsm-subscription-table {
    table-layout: fixed;
    width: 100%;
}

/* TSM col 1: Tipo (badge Suscripción / Licencia) */
.tsm-subscription-table thead th:nth-child(1),
.tsm-subscription-table tbody td:nth-child(1) {
    width: 15%;
}

/* TSM col 2 / WPS col 1: Producto / ID */
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table thead th:nth-child(1),
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table tbody td:nth-child(1),
.tsm-subscription-table thead th:nth-child(2),
.tsm-subscription-table tbody td:nth-child(2) {
    width: 24%;
}

/* TSM col 3 / WPS col 2: Pedido original / Parent ID */
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table thead th:nth-child(2),
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table tbody td:nth-child(2),
.tsm-subscription-table thead th:nth-child(3),
.tsm-subscription-table tbody td:nth-child(3) {
    width: 14%;
}

/* TSM col 4 / WPS col 3: Estado */
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table thead th:nth-child(3),
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table tbody td:nth-child(3),
.tsm-subscription-table thead th:nth-child(4),
.tsm-subscription-table tbody td:nth-child(4) {
    width: 12%;
}

/* TSM col 5 / WPS col 4: Próximo pago */
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table thead th:nth-child(4),
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table tbody td:nth-child(4),
.tsm-subscription-table thead th:nth-child(5),
.tsm-subscription-table tbody td:nth-child(5) {
    width: 16%;
}

/* TSM col 6 / WPS col 5: Total */
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table thead th:nth-child(5),
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table tbody td:nth-child(5),
.tsm-subscription-table thead th:nth-child(6),
.tsm-subscription-table tbody td:nth-child(6) {
    width: 12%;
}

/* TSM col 7 / WPS col 6: Acción */
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table thead th:nth-child(6),
.wps_sfw_account_wrap .wps_sfw_account_additional_wrap table tbody td:nth-child(6),
.tsm-subscription-table thead th:nth-child(7),
.tsm-subscription-table tbody td:nth-child(7) {
    width: 12%;
}

/* Estilos para el contenedor de subclientes y botón añadir */

.tsm-subclients-container {
    max-width: 100%;
    margin-bottom: 72px;
}
.tsm-add-client-container {
    margin-top: 20px;
    padding: 10px;
    border: 2px dashed var(--tsm-gray-light);
    text-align: center;
    display: block;
    border-radius: 12px;
}

.tsm-add-client-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: var(--tsm-green);
    color: white !important;
    text-decoration: none !important;
    border-radius: 50%;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(8, 176, 124, 0.2);
}

.tsm-add-client-button:hover, 
.tsm-add-client-group .tsm-qty-input:hover {
    text-decoration: none !important;
}

.tsm-add-client-button:hover{
    background-color: #069963 !important;
    color: white !important;
}

.tsm-add-client-button:active {
    transform: translateY(0);
}

.tsm-plus-icon {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.tsm-add-text {
    white-space: nowrap;
}

.tsm-add-client-group {
    gap: 12px;
}

/* Selector cantidad */
.tsm-qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--tsm-green);
    border-radius: 6px;
    overflow: hidden;
    height: auto;
}

.tsm-qty-btn {
    border: 0;
    background: #f8f8f8;
    font-size: 24px;
    cursor: pointer;
    transition: background .2s;
    color: var(--tsm-green) !important;
    margin-top: 0px;
    border: none !important;
    font-weight: bold !important;
}

.tsm-qty-btn:hover {
    background: #efefef !important;
}

.tsm-qty-btn:focus {
    border: none !important;
    outline: none !important;
    background-color: transparent !important;
}

.tsm-qty-input {
    border: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    outline: none;
    appearance: textfield;
    color: var(--tsm-green);
    border: none !important;
    background: #08b07c2b;
    padding: 5px !important;
}

.tsm-qty-input::-webkit-inner-spin-button,
.tsm-qty-input::-webkit-outer-spin-button {
    display: none;
}

/* Botón añadir */
.tsm-add-client-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 20px !important;
    border: 2px solid var(--tsm-green) !important;
    border-radius: 7px;
    background: var(--tsm-green) !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all .2s;
    border-radius: 6px;
}

.tsm-add-client-button:hover {
    background: #f8f8f8;
}

.tsm-icon {
    font-size: 24px;
}


/* hide link--ver-cp menu item */
.tsm-impersonating-subclient .woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--ver-cp {
    display: none !important;
}

.button.cc-btn-activar {
    background-color: var(--tsm-green) !important;
    color: #fff !important;
}
.button.cc-btn-activar:hover {
    background-color: #069963 !important;
}

.button.cc-btn-activar[aria-disabled="true"] {
    background: #C3C7CE !important;
    color: #fff !important;
    border: 1px solid #CFD3DA !important;
}

/* Responsive */
@media (max-width: 768px) {
    .tsm-add-client-button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .tsm-plus-icon {
        font-size: 18px;
    }

    .tsm-subclients-shortcode-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .tsm-add-client-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tsm-url-panel.open {
        max-height: 100%;
    }

    .tsm-url-panel-text {
        word-break: break-all;
        white-space: normal;
        max-width: 100%;
    }

    .tsm-client-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: space-between;
    }

    .tsm-subclients-shortcode-list .tsm-client-actions .tsm-copy-link-btn {
        margin-right: 0;
        padding: 8px 0;
        font-size: 14px;
    }

    .tsm-client-info {
        flex-wrap: wrap;
    }
}

/* Estilos para vista consolidada de suscripciones */
.tsm-subclients-subscriptions {
    margin-top: 3rem;
}

.tsm-is-tenant .woocommerce table.shop_table {
    border: none;
}

.shop_table .woocommerce-cart-form__cart-item.cart_item .product-price .woocommerce-Price-amount.amount, 
.shop_table .woocommerce-cart-form__cart-item.cart_item .product-subtotal .woocommerce-Price-amount.amount {
    font-size: 20px !important;
}

.cart_totals .woocommerce-Price-amount.amount,
.cart_totals .woocommerce-Price-amount.amount bdi {
    font-size: 20px !important;
    color: var(--tsm-dark-blue) !important;
}

.cart_totals .includes_tax .woocommerce-Price-amount.amount {
    font-size: 14px !important;
}

.e-checkout__order_review .woocommerce-checkout-review-order-table .woocommerce-Price-amount.amount {
    font-size: 18px !important;
    color: var(--tsm-dark-blue) !important;
}

.tsm-is-tenant .elementor-widget-woocommerce-my-account .e-my-account-tab:not(.e-my-account-tab__dashboard--custom) .woocommerce .shop_table .button {
    border: none;
}

.tsm-subcriptions-title {
    margin-top: 0px;
    font-size: 22px !important;
}

.tsm-subclient-subscriptions {
    margin-bottom: 2.5rem;
}

.tsm-subscription-block {
    padding: 24px;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tsm-subscription-block h3 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tsm-gray-light);
    color: var(--tsm-dark-blue);
    font-size: 20px;
    font-weight: 600;
}

.tsm-tenant-subscriptions h3 {
    color: var(--tsm-green);
}

.tsm-subclient-nif {
    color: #6B7280;
    font-weight: 400;
    font-size: 16px;
}

.tsm-subscription-table {
    margin-top: 0 !important;
}

.tsm-subscription-block .subscription-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px !important;
    font-weight: 500;
}

@media (max-width: 768px) {
    .tsm-subscription-block {
        padding: 12px;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tsm-subscription-block h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .tsm-subscription-table {
        min-width: 600px;
    }

    .tsm-collapsible-toggle {
        flex-wrap: wrap;
    }

    .tsm-subclient-nif {
        font-size: 13px;
    }

    .tsm-subclient-subscription-row h3 {
        font-size: 18px;
    }
}


.tsm-impersonating-subclient .tsm-download-audit-bar,
.tsm-download-audit-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
    margin-top: 18px;
}

.tsm-impersonating-subclient .tsm-download-audit-bar a,
.tsm-download-audit-bar a {
    color: white !important;
    padding: 10px 20px 10px 16px !important;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px!important;
    display: flex;
    align-items: anchor-center;
    margin-right: 12px !important;
    line-height: normal !important;
    font-weight: 600 !important;
}

.tsm-impersonating-subclient .tsm-download-audit-bar a.tsm-btn-download-audit,
.tsm-download-audit-bar a.tsm-btn-download-audit {
    background-color: var(--tsm-dark-blue) !important;
    border-radius: 4px;
    text-decoration: none;
    display: flex;
}


.tsm-impersonating-subclient .tsm-download-audit-bar a::before,
.tsm-download-audit-bar a.tsm-btn-download-audit::before,
.cc-audit-cert-download::before {
    background: url('../icons/download-icon.svg');
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    font-weight: 600;
}

.tsm-btn-my-clients, .tsm-btn-back {
    background-color: var(--tsm-dark-blue) !important;
    color: white !important;
    padding: 10px 20px 10px 16px !important;
    border-radius: 4px;
    font-size: 18px !important;
    font-weight: 500 !important;
    padding: 12px 23px !important;
}

/** Estilos para imagen Certificación descargable */
.cc-audit-hero__row {
    margin-bottom: 32px;
}
.cc-audit-hero__cert{
    margin-left:auto;
}
.cc-audit-hero__cert a{display:inline-flex;
     flex-direction:column;
     align-items:center;
     gap:8px;
     text-decoration:none;
     color:#12254a;
}
.cc-audit-cert-img{width:120px;
     height:auto;
     border-radius:6px;
     box-shadow:0 2px 8px rgba(0,0,0,.15);
}
.tsm-impersonating-subclient .tsm-download-audit-bar a.cc-audit-cert-download {
    background-color: var(--tsm-green) !important;
    color: white !important;
    text-decoration: none;
}

/* Píldoras de estado para mi-plan-cumplimiento en impersonación */
.tsm-impersonating-subclient .cc-plan-cumplimiento h3 {
    margin-top: 46px;
}

.tsm-impersonating-subclient .cc-plan-cumplimiento .status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    display: inline-block;
}
.tsm-impersonating-subclient .cc-plan-cumplimiento .status.purchased {
    background: #e8f0fe;
    color: #1a73e8;
}
.tsm-impersonating-subclient .cc-plan-cumplimiento .status.ok {
    background: #e8f5e9;
    color: #1b5e20;
}
.tsm-impersonating-subclient .cc-plan-cumplimiento .status.bad {
    background: #fdecea;
    color: #b71c1c;
}
.tsm-impersonating-subclient .cc-plan-cumplimiento .status.warn {
    background: #fff8e1;
    color: #8d6e63;
}
.tsm-impersonating-subclient .cc-plan-cumplimiento .status.muted {
    background: #eef2f7;
    color: #46505a;
}

/* CHANGES FC: Ocultar "Volver a pedirlo" y enlace de factura en thank-you de pedido de subclient */
.tsm-impersonating-subclient .order-again,
.tsm-impersonating-subclient .order-actions--heading,
.tsm-impersonating-subclient .woocommerce-order-details .wpo_wcpdf-order-actions,
.tsm-impersonating-subclient .woocommerce-order-details a[href*="generate_wpo_wcpdf"] {
    display: none !important;
}

/* Estilos Botón Reactivar Suscripción */
.tsm-is-tenant .wps_sfw_account_additional_wrap table td a.button {
    background: transparent;
    padding: 0;
    color: var(--tsm-green) !important;
}
.woocommerce-info.cancelled-professional-plan,
.woocommerce-info.on-hold-professional-plan {
    margin-bottom: 64px !important;
}

.woocommerce-info.tsm-inactive-subclient-notice {
    border-top: none !important;
}


.woocommerce-info.tsm-inactive-subclient-notice::before,
.woocommerce-info.cancelled-professional-plan::before, 
.woocommerce-info.on-hold-professional-plan::before {
    display: none;
}

.tsm-is-tenant .woocommerce-orders-table__cell-order-status.wps_sfw_pending span {
    background: #fff3cd;
    color: #856404;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 14px;
}

.tsm-is-tenant .woocommerce-orders-table__cell-order-status.wps_sfw_cancelled span {
    background: #f8d7da;
    color: #842029;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 14px;
}

.tsm-is-tenant .woocommerce-orders-table__cell-order-status.wps_sfw_suspended  span {
    background: #f8d7da;
    color: #842029;
}

/* ─── Menú responsive cc-myaccount-menu: ocultar items para tenant ──────────
   El menú responsive usa clases cc-myaccount-menu-item-{endpoint}.
    Para tenant solo mostrar: tenant-account-title, tenant-my-clients,
    payment-methods, edit-account, wps_subscriptions, personalizacion, customer-logout */
.tsm-is-tenant .cc-myaccount-menu-item:not(.cc-myaccount-menu-item-tenant-account-title):not(.cc-myaccount-menu-item-tenant-my-clients):not(.cc-myaccount-menu-item-payment-methods):not(.cc-myaccount-menu-item-edit-account):not(.cc-myaccount-menu-item-wps_subscriptions):not(.cc-myaccount-menu-item-personalizacion):not(.cc-myaccount-menu-item-customer-logout) {
    display: none !important;
}

/* ─── Desplegable suscripciones por subcliente ─────────────────────────────── */

.tsm-collapsible-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tsm-collapsible-toggle:hover {
    color: var(--tsm-green);
}

.tsm-toggle-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.tsm-collapsible-toggle.open .tsm-toggle-arrow {
    transform: rotate(90deg);
}

.tsm-badge-cancelled {
    background: #f8d7da;
    color: #842029;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    text-transform: uppercase;
}

.tsm-suspended-message {
    text-align: center;
    padding: 20px;
    color: #6B7280;
    font-size: 15px;
    margin: 0;
}

/* ─── Sección de clientes cancelados/inactivos en shortcode ────────────────── */

.tsm-inactive-section {
    margin-top: 24px;
}

.tsm-inactive-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    user-select: none;
}

.tsm-inactive-toggle:hover {
    color: var(--tsm-dark-blue);
}

.tsm-inactive-toggle .tsm-toggle-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.tsm-inactive-toggle.open .tsm-toggle-arrow {
    transform: rotate(90deg);
}

.tsm-inactive-list {
    margin-top: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

.tsm-subclients-shortcode-list li.tsm-subclient-inactive {
    background-color: #FEF2F2;
    border-color: #FECACA;
    opacity: 0.85;
}

.tsm-subclients-shortcode-list li:hover {
    /* transform: scale(0.99); */
}


.tsm-inactive-section {
    margin-top: 32px;
}

.tsm-inactive-section button {
    margin-bottom: 16px;
}


/* Ocultar campos Nombre, Apellidos, Nombre visible y Correo electrónico
   cuando hay impersonación (ocultamos el .woocommerce-form-row completo) */

.tsm-impersonating-subclient .woocommerce-form-row:has(#account_first_name),
.tsm-impersonating-subclient .woocommerce-form-row:has(#account_last_name),
.tsm-impersonating-subclient .woocommerce-form-row:has(#account_display_name),
.tsm-impersonating-subclient .woocommerce-form-row:has(#account_email) {
    display: none !important;
}


section.cc-docs-pendientes div.cc-flexbar,
section.cc-docs-cp div.cc-flexbar, 
section.cc-docs-pdd div.cc-flexbar,
section.cc-docs-pd div.cc-doc-row,
section.cc-docs-pd .cc-flexbar, 
section.cc-docs-pdd.cc-doc-ptd .cc-doc-row {
    border-bottom: none !important;
    padding: 10px 0 !important;
    border-top: 1px solid #eee !important;
    border-bottom: none !important;
}

section.cc-docs-pd div.cc-doc-row, 
section.cc-docs-pdd.cc-doc-ptd .cc-doc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    text-align: left;
}

section.cc-docs-pdd.cc-doc-ptd .cc-doc-row .cc-doc-title {
    color: var(--general-text-color, #000);
}

.cc-pd-extra-rights .cc-pd-extra-vv {
    list-style: none !important;
}

.cc-pd-extra-rights .cc-pd-extra-vv a {
    background: #1C3059 !important;
    border: 1px solid #1C3059 !important;
    color: white !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    padding: var(--tables-button-padding, 5px 10px);
}

section.cc-docs-pendientes .cc-doc-row,
section.cc-docs-completados .cc-doc-row {
    border-bottom: none !important;
}

section.cc-docs-completados .cc-actions, 
section.cc-docs-pd .cc-docs-pd-actions, 
section.cc-docs-pdd .cc-doc-row .cc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-direction: row-reverse;
}

section.cc-docs-pasg .cc-pill, 
section.cc-docs-cp .cc-pill,
section.cc-docs-pd .cc-pill {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
}

table.shop_table.cc-pd-docs-table {
    margin-left: 0px !important;
    margin-top: 32px !important;
    border: none !important;
    border-top: 1px dashed color-mix(in srgb, currentColor 20%, transparent) !important;
    padding-left: 20px !important;
}

table.shop_table.cc-pd-docs-table td {
    border: none !important;
    border-top: 1px dashed color-mix(in srgb, currentColor 20%, transparent) !important;
}

.cc-doc-title {
    font-weight: 600 !important;
}

.woocommerce table.cc-cp-docs-table {
    /* tus estilos aquí */
    /* quitar bordes tabla */
    border: none !important;
}

/* Demo limit notice & disabled button */
.tsm-demo-limit-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #664d03;
    font-size: 14px;
}
.tsm-demo-limit-notice p {
    margin: 0;
}
.tsm-button-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ─── Aviso de clientes pendientes en carrito ──────────────────────────────── */
.tsm-pending-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--tsm-medium-blue);
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 15px;
    color: #1e3a5f;
}

.tsm-pending-notice .tsm-checkout-button {
    background-color: var(--tsm-green) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    white-space: nowrap;
    text-decoration: none !important;
}

.tsm-pending-notice .tsm-checkout-button:hover {
    background-color: #069963 !important;
}



@media (max-width: 1200px) {
    .tsm-premium-upgrade-cta-clients-text {
        margin-bottom: 12px;
    }
}

@media (max-width: 992px) {
   .tsm-premium-upgrade-cta-clients .tsm-premium-upgrade-cta-clients-text,
   .woocommerce .tsm-premium-upgrade-cta .tsm-premium-upgrade-cta-clients-text {
      max-width: 100%;
   }
   
   .tsm-is-tenant .button.tsm-premium-btn, .tsm-premium-upgrade-cta-clients-btn, .tsm-premium-upgrade-cta-clients-btn, .tsm-is-tenant .button.tsm-professional-btn {
      display: inline-block;
   }
}

@media (max-width: 768px) {
    .tsm-pending-notice {
        flex-direction: column;
        align-items: flex-start;
    }

    .tsm-client-actions {
        justify-content: space-between;
    }

    .tsm-url-panel-text,
   .tsm-url-panel-copy {
        margin-bottom: 12px;
    }

}

@media (max-width: 480px) {
    .tsm-url-panel-hint {
        width: 90%;
    }
}

/* ─── Grupo cantidad + botón Añadir cliente ────────────────────────────────── */
.tsm-add-client-group {
    display: inline-flex;
    align-items: stretch;
    border-radius: 6px;
    overflow: hidden;
    gap: 12px;
}

.tsm-add-client-group .tsm-qty-input::-webkit-outer-spin-button,
.tsm-add-client-group .tsm-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tsm-add-client-group .tsm-qty-input::placeholder {
    outline: none;
    background: #0699631a;
    border-color: #069963;
}

.tsm-add-client-group .tsm-qty-input:focus {
    outline: none;
    border-color: transparent !important;;
}

.tsm-add-client-group .tsm-add-client-button-top {
    border-radius: 0 !important;
    box-shadow: none !important;
    white-space: nowrap;
    margin: 0 !important;
    background: var(--tsm-green);
}

/* Hint debajo del grupo Añadir cliente */
.tsm-add-client-wrap {
    display: flex;
    /* flex-direction: column; */
    align-items: flex-end;
}

/* .tsm-add-client-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #a0a3a6;
    opacity: 0;
    transition: opacity 0.3s ease;
    letter-spacing: .1px;
    font-style: italic;
    margin-left: 12px;
}

.tsm-add-client-wrap:hover .tsm-add-client-hint {
    opacity: 1;
} */


/** Informe global */

.tsm-impersonating-subclient .tsm-intro-ig {
    margin-bottom: 24px !important;
    margin-top: 32px !important;
    padding-right: 16px;
}

.tsm-impersonating-subclient .tsm-generate-informe-global, 
.button.tsm-download-rc {
    background-color: var(--tsm-green) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    white-space: nowrap;
    border-radius: 6px !important;
}

.tsm-generate-informe-global:hover {
    background-color: #069963 !important;
}

/* Buscador de clientes */
.tsm-search-row {
	margin: 0px 0 16px;
}
.tsm-search-row .tsm-search-input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

.tsm-search-no-results {
	color: #6b7280;
	font-size: 14px;
	margin: 12px 0;
}

.woocommerce-MyAccount-content .cc-section-subtitle {
    font-size: 23px;
    font-weight: 500 !important;
    color: var(--tsm-dark-blue);
    margin-top: 32px !important;
}
.page.page-template-default .elementor-widget-woocommerce-my-account .cc-plan-cumplimiento .cc-audit-hero__title h3.cc-section-subtitle{margin-bottom:16px !important;}

/* ═══════════════════════════════════════════════════════════════════════════
 * Cumpleo Professional Premium — CTAs y Banners
 * ═══════════════════════════════════════════════════════════════════════════ */
.tsm-is-tenant .button.tsm-premium-btn, 
.tsm-premium-upgrade-cta-clients-btn, 
.tsm-premium-upgrade-cta-clients-btn,
.tsm-is-tenant .button.tsm-professional-btn {
    background: var(--tsm-bright-blue) !important;
    color: #fff !important;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.2s ease;
    font-size: 15px;
    font-weight: 500;
    margin-right: 12px;
}


.tsm-is-tenant .button.tsm-professional-btn {
    background: var(--tsm-green) !important;
}


.tsm-is-tenant .button.tsm-premium-btn:hover,
.tsm-premium-upgrade-cta-clients-btn:hover {
    background: #069963 !important;
    color: #fff !important;
}


.tsm-is-tenant .button.tsm-professional-btn:hover {
    background: #069963 !important;
    color: #fff !important;
}

.tsm-is-tenant .button.tsm-premium-dismiss-link {
    background: transparent !important;
    color: #64748b !important;
    border: none !important;
    padding: 0 !important;
    font-size: 12px !important;
    text-decoration: underline !important;
    cursor: pointer;
}

.tsm-is-tenant .tsm-premium-upgrade-cta, 
.tsm-is-tenant .tsm-premium-upgrade-cta-client {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border:1px solid #e2e8f0;
    border-left:4px solid var(--tsm-bright-blue);
    padding:14px 18px;
    margin-bottom:20px;
    border-radius:4px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px;
}
.tsm-is-tenant .tsm-info-text {
    color: #334155;
    font-size: 15px;
    margin: 0;
}
.tsm-premium-upgrade-cta-clients {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--tsm-bright-blue);
    padding: 14px 18px;
    margin-bottom: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.tsm-premium-upgrade-cta-clients-text {
    max-width: 60%;
}

.woocommerce .tsm-premium-upgrade-cta .tsm-premium-upgrade-cta-clients-text {
    max-width: 60%;
}

.tsm-premium-upgrade-cta-clients-text strong,
.tsm-premium-upgrade-cta-text strong {
    color: #1e3a5f;
    font-size: 16px;
    margin-bottom: 2px !important;
    display: inline-block;
}
.tsm-premium-upgrade-cta-clients-text span {
    font-size: 15px;
    color: #475569;
}
.tsm-premium-upgrade-cta,
.tsm-premium-active-notice,
.tsm-premium-offer-banner {
    margin-bottom: 20px;
}

.tsm-premium-upgrade-cta-actions,
.tsm-premium-upgrade-cta-clients-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    margin: 0 auto;
    margin-top: 6px;
}

.tsm-premium-dismiss-link {
    font-size: 12px;
    color: #64748b;
    text-decoration: underline;
    cursor: pointer;
}

.tsm-premium-dismiss-link:hover {
    color: #334155;
}

.tsm-premium-included {
    display: inline-block;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.tsm-alert {
    padding: 0px 5px;
    background: #f9a925;
    text-align: center;
    margin-right: 5px;
    border-radius: 2px;
    color: white !important;
}

/* ─── cc-myaccount-menu: ocultar items no permitidos durante impersonación ── */
.tsm-impersonating-subclient .cc-myaccount-menu-item-ver-cp,
.tsm-impersonating-subclient .cc-myaccount-menu-item-coupon-affiliate,
.tsm-impersonating-subclient .cc-myaccount-menu-item-mis-cursos {
    display: none !important;
}

/* ─── Barra mobile "Volver a Mis clientes" (solo en impersonación, solo tenant) ── */
#tsm-back-bar {
    display: none;
}
/* La visibilidad la controla JS inline para evitar flash en desktop */


.tsm-impersonating-subclient .header-myaccount-toggle .hamburger-text {
    display: none;
}

.header-myaccount-toggle .hamburger-text {
    display: none;
}

/* ─── "Cerrar cliente" en menú responsive durante impersonación ───────── */
.tsm-impersonating-subclient .cc-myaccount-menu-item-customer-logout a {
    color: #e74c3c !important;
    font-weight: 600;
}

/* ─── Interlineado del mensaje de thank-you en mobile ─────────────────── */
@media (max-width: 768px) {
    .woocommerce-thankyou-order-received {
        line-height: 1.3;
    }

    .cc-myaccount-menu-item.cc-myaccount-menu-item-subclient-name {
        font-weight: 700;
    }
}

/* ─── Gestión de plantilla (workforce) ────────────────────────────────── */

.tsm-workforce-page {
    font-family: "Jost", Sans-serif;
}

.woocommerce-MyAccount-content .cc-section-title.cc-section-title-plantilla {
    margin-bottom: 16px !important;
}

.woocommerce-MyAccount-content .panel-obligaciones .cc-section-title {
  margin-bottom: 10px !important;
}

.tsm-workforce-upload-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

.tsm-workforce-upload-form input[type="file"] {
    font-size: 14px;
}

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

.tsm-workforce-count {
    font-weight: 400;
    margin: 0;
    color: #2D385299;
    font-size: 16px;
}

.tsm-workforce-add {
    background: none;
    border: none;
    color: var(--tsm-green);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
}

.tsm-modal-footer .tsm-workforce-upload-submit {
    background-color: var(--tsm-dark-blue) !important;
    color: white !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
}

.tsm-modal-footer .tsm-workforce-delete-confirm {
    background-color: var(--tsm-dark-blue) !important;
    color: white !important;
}

.tsm-workforce-add:hover {
    text-decoration: underline;
    color: var(--tsm-green);
}

.tsm-workforce-template-link {
    margin-top: 14px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.tsm-workforce-template-link a {
    color: var(--tsm-green) !important;
    font-weight: 600;
    font-style: italic;
    text-decoration: underline !important;
}

.tsm-filebox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s, outline-color 0.15s;
}

.tsm-filebox:hover {
    border-color: #c8cdd3;
}

.tsm-filebox-text {
    font-size: 15px !important;
    line-height: 1;
    font-weight: 400;
    color: #B9B9B9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    font-style: italic;
}

.tsm-filebox-text.has-file {
    color: #0F1C39;
}

.tsm-filebox svg {
    flex: 0 0 auto;
    color: #0F1C39;
    pointer-events: none;
}

.tsm-filebox:focus-within {
    outline: 2px solid #0F1C39;
    outline-offset: 2px;
}

.tsm-workforce-empty {
    color: #777;
}

.tsm-workforce-list {
    position: relative;
    max-height: 550px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 4px;
}

.tsm-workforce-list::after {
    content: "\25BE";
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    text-align: center;
    font-size: 18px;
    line-height: 1;
    color: #08B07C;
    padding: 6px 0 8px;
    background: linear-gradient(to top, #fff 55%, rgba(255, 255, 255, 0));
    pointer-events: none;
}

.tsm-workforce-list.has-more::after {
    display: block;
}

.tsm-workforce-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.tsm-workforce-table [type=button] {
    border: none !important;
    color: #CD333A !important;
}
.tsm-workforce-table [type=button]:hover {
    opacity: 0.6;
    color: #CD333A !important;
}

.tsm-workforce-table [type=button].tsm-workforce-dni-toggle {
    color: var(--tsm-dark-blue) !important;
}
.tsm-workforce-table [type=button].tsm-workforce-dni-toggle:hover {
    opacity: 0.6;
}

.tsm-workforce-table td {
    padding: 0px 10px;
    text-align: left;
    font-size: 14px;
    border: none !important;
    border-bottom: 1px solid #212F5833 !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

.tsm-workforce-table td.tsm-workforce-name-cell {
    padding-top: 4px !important;
    font-weight: 600;
    color: #2D3852 !important;
    font-size: 16px;
}

.tsm-workforce-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none;
    cursor: pointer;
    color: #b71c1c;
    padding: 6px !important;
}

.tsm-workforce-delete:hover {
    opacity: 0.6;
}

.tsm-workforce-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.tsm-workforce-sep {
    color: #ccc;
    font-weight: 600;
    padding-left: 10px;
    padding-right: 10px;
}

.tsm-workforce-dni-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tsm-workforce-dni-visual {
    display: inline-grid;
    align-items: center;
    justify-items: start;
}

.tsm-workforce-dni-value,
.tsm-workforce-dni-mask {
    grid-area: 1 / 1;
    white-space: nowrap;
}

.tsm-workforce-dni-mask {
    font-size: 24px !important;
    line-height: 1;
    letter-spacing: 2px;
    font-weight: 900;
}

.tsm-workforce-dni-value {
    font-family: monospace;
    visibility: hidden;
}

.tsm-workforce-dni-visual.is-revealed .tsm-workforce-dni-value {
    visibility: visible;
}

.tsm-workforce-dni-visual.is-revealed .tsm-workforce-dni-mask {
    visibility: hidden;
}

.tsm-workforce-dni-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 2px !important;
}

.tsm-workforce-dni-toggle:hover {
    color: #333;
}

.tsm-workforce-page  .cc-section-intro.cc-section-plantilla {
    margin-bottom: 36px !important;
}

.tsm-workforce-page .tsm-workforce-add {
    color: var(--tsm-green);
    border: none;
    background: none;
    font-weight: 600;
}

.tsm-workforce-page .tsm-workforce-add:hover {
    text-decoration: underline;
    border: none;
    background: none;
    color: var(--tsm-green);
}

.tsm-workforce-page .tsm-workforce-add:active,
.tsm-workforce-page .tsm-workforce-add:focus,
.tsm-workforce-page .tsm-workforce-add:focus-visible,
.tsm-workforce-add:active,
.tsm-workforce-add:focus,
.tsm-workforce-add:focus-visible {
    background: var(--tsm-green) !important;
    background-color: var(--tsm-green) !important;
    color: #fff !important;
    border: none;
    text-decoration: none;
}

/* ─── Modales reutilizables ───────────────────────────────────────────── */
.tsm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #1c3059a1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tsm-modal-overlay[hidden] {
    display: none;
}

.tsm-modal-overlay {
    animation: tsm-modal-fade-in 0.2s ease;
}

.tsm-modal {
    animation: tsm-modal-pop-in 0.25s ease;
}

@keyframes tsm-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tsm-modal-pop-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tsm-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-family: "Roboto", Sans-serif;
    padding: 32px;
    position: relative;
}

.tsm-modal-overlay.tsm-modal--sm .tsm-modal {
    max-width: 380px;
    padding: 30px;
}

.tsm-modal-overlay.tsm-modal--sm .tsm-modal-title {
    font-size: 22px;
}

.tsm-modal-overlay.tsm-modal-no-close .tsm-modal-header {
    margin-top: 0;
}

.tsm-modal-footer .tsm-workforce-delete-confirm {
    background-color: var(--tsm-dark-blue) !important;
    color: white !important;
}

.tsm-modal-overlay.tsm-modal--lg .tsm-modal {
    max-width: 700px;
}

.tsm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
}

.tsm-modal-title {
    color: var(--tsm-dark-blue);
    font-weight: 600;
    font-size: 28px;
    font-family: 'Roboto';
}

[type=button].tsm-modal-close {
    font-weight: 300;
    background: none !important;
    background-color: transparent !important;
    border: none;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
    padding: 8px 32px;
    display: inline-block;
    text-align: right;
    width: 100%;
    color: #0F1C39 !important;
    opacity: 1 !important;
    position: absolute;
    right: 0px;
    top: 0;
}

[type=button].tsm-modal-close:focus,
[type=button].tsm-modal-close:focus-visible,
[type=button].tsm-modal-close:active {
    color: #0F1C39 !important;
    background: none !important;
    background-color: transparent !important;
}

[type=button].tsm-modal-close:hover {
    color: #000;
    background: none !important;
    background-color: transparent !important;
    border: none;
}

.tsm-modal-body {
    margin-bottom: 16px;
}

.tsm-modal-intro {
    line-height: normal;
    font-size: 15px;
}

.tsm-modal-footer {
    display: flex;
    gap: 10px;
}

.tsm-modal-footer .button.cc-send-submit {
    padding: 10px 20px !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background-color: var(--tsm-dark-blue) !important;
}

.tsm-modal-message {
    padding: 10px 14px;
    border-radius: 4px;
    margin: 8px 0px;
    font-size: 14px;
}

.tsm-modal-message[hidden] {
    display: none;
}

.tsm-modal-message-success {
    background: #e6f6f0;
    color: #1b5e20;
    border: 1px solid #b2e0d2;
}

.tsm-modal-message-error {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
}

