/* =========================================================================
   Rediseño 2026 — sistema visual del panel.
   Se carga al final (después de branding.css y layout-shell.css) y
   reestiliza Bootstrap y la capa compartida app-* sin tocar cada página.
   ========================================================================= */

:root {
    --ds-ink: #111827;
    --ds-ink-2: #374151;
    --ds-ink-3: #4B5563;
    --ds-bg: #F3F4F6;
    --ds-panel: #FFFFFF;
    --ds-sunk: #F9FAFB;
    --ds-stripe: #F3F4F6;
    --ds-hover: #F3F4F6;
    --ds-row-hover: #E5E7EB;
    --ds-border: #E5E7EB;
    --ds-border-2: #D1D5DB;
    --ds-accent: #F4561D;
    --ds-accent-hover: #DD4513;
    --ds-accent-tint: #FFF6F2;
    --ds-accent-ink: #C2410C;
    --ds-ok: #1E7A3D;
    --ds-ok-tint: #E8F5EC;
    --ds-warn: #8A5300;
    --ds-warn-tint: #FEF4E2;
    --ds-err: #B42318;
    --ds-err-tint: #FDECEC;
    --ds-info: #1D4ED8;
    --ds-info-tint: #EAF1FD;
    --ds-radius: 8px;
    --ds-radius-card: 12px;
    --ds-sidebar-w: 256px;

    /* Bootstrap */
    --bs-body-font-family: var(--brand-font-family);
    --bs-font-sans-serif: var(--brand-font-family);
    --bs-body-font-size: 0.875rem;
    --bs-body-color: var(--ds-ink);
    --bs-body-bg: var(--ds-bg);
    --bs-secondary-color: var(--ds-ink-3);
    --bs-border-color: var(--ds-border);
    --bs-border-radius: var(--ds-radius);
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: var(--ds-radius-card);
    --bs-primary: var(--ds-accent);
    --bs-primary-rgb: 212, 67, 14;
    --bs-link-color: var(--ds-accent-ink);
    --bs-link-color-rgb: 168, 58, 12;
    --bs-link-hover-color: var(--ds-accent-hover);
    --bs-link-hover-color-rgb: 184, 56, 10;
    --bs-focus-ring-color: rgba(244, 86, 29, 0.18);

    /* Variables propias del panel (layout-shell.css las redefine; ganan estas) */
    --app-surface-radius: 14px;
    --app-surface-padding: 1.75rem 2rem 3rem;
    --app-header-radius: 12px;
    --app-header-padding: 0;
    --app-header-gap: 1rem;
    --app-card-radius: 12px;
    --app-font-size-base: 0.875rem;
    --app-font-size-title: 1.375rem;
    --app-font-size-label: 0.8125rem;
    --app-font-size-help: 0.78rem;
}

body {
    background: var(--ds-bg);
    color: var(--ds-ink);
    font-size: 0.875rem;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ds-accent-ink); }
a:hover { color: var(--ds-accent-hover); }

/* -------------------------------------------------------------------------
   Shell: sidebar claro + panel principal con inserto
   ------------------------------------------------------------------------- */
.sidebar {
    width: var(--ds-sidebar-w);
    background: var(--ds-bg);
    color: var(--ds-ink);
}

.main-wrapper {
    margin-left: var(--ds-sidebar-w);
    padding: 8px 8px 8px 0;
}

body.pending-plan .main-wrapper { padding-left: 8px; }

.app-body-surface {
    min-height: calc(100vh - 16px);
    padding: var(--app-surface-padding);
    /* Los botones flotantes (Volver arriba, Guardar) ocupan 64 px abajo: con este espacio al final, lo
       último de la página siempre puede subir por encima de ellos y no queda tapado. */
    padding-bottom: 5.5rem;
    border-radius: 14px;
    background: var(--ds-panel);
    border: 1px solid var(--ds-border);
}

@media (max-width: 991.98px) {
    .main-wrapper { padding: 8px; }
    .app-body-surface { padding: 1.25rem 1rem 5.5rem; }
}

/* Cabecera del sidebar */
.ds-sb-head {
    padding: 14px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.ds-sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px;
    text-decoration: none;
    color: var(--ds-ink);
    min-width: 0;
}

.ds-sb-brand:hover { color: var(--ds-ink); }

.ds-sb-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--ds-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    flex: none;
}

.ds-sb-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.ds-sb-brand-text b {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-sb-brand-text span {
    font-size: 12px;
    color: var(--ds-ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-sb-head .sidebar-toggle { margin-left: auto; color: var(--ds-ink-3); }
.ds-sb-head .sidebar-toggle:hover { background: var(--ds-hover); }

/* Selector de asistente */
.ds-ctx { display: flex; flex-direction: column; gap: 4px; }

.ds-ctx .bot-switcher-btn,
.bot-switcher-btn {
    background: var(--ds-panel);
    color: var(--ds-ink);
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    padding: 8px 10px;
    min-height: 44px;
    font-size: 13.5px;
    font-weight: 600;
}

.bot-switcher-btn:hover,
.bot-switcher-btn:focus,
.bot-switcher-btn.show {
    background: var(--ds-panel);
    color: var(--ds-ink);
    border-color: var(--ds-border-2);
}

.bot-switcher-btn small {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: var(--ds-ink-3);
}

.bot-switcher-menu {
    background: var(--ds-panel) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: 10px;
    padding: 4px;
}

.bot-switcher-menu .dropdown-item {
    border-radius: 6px;
    color: var(--ds-ink-2) !important;
    font-size: 13.5px;
}

.bot-switcher-menu .dropdown-item:hover { background: var(--ds-hover); color: var(--ds-ink) !important; }
.bot-switcher-menu .dropdown-item.is-current { color: var(--ds-ink) !important; font-weight: 600; }
.bot-switcher-menu .dropdown-divider { border-color: var(--ds-border) !important; opacity: 1; }
.current-site-dot { color: var(--ds-accent); }
.ds-site-context .bot-switcher-btn,
.ds-site-context .bot-switcher-btn:hover,
.ds-site-context .bot-switcher-btn:focus,
.ds-site-context .bot-switcher-btn.show { border-left: 3px solid var(--ds-accent); }

/* Menú */
.sidebar-menu {
    padding: 6px 12px 12px;
    scrollbar-color: var(--ds-border-2) transparent;
}

.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background: var(--ds-border-2); border: 2px solid var(--ds-bg); }
.sidebar-menu::-webkit-scrollbar-thumb:hover { background: var(--ds-ink-3); }

.ds-sb-group { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }

/* Recuadro de la compañía dentro de un asistente o popup */
.ds-sb-company { margin-top: 12px; padding: 8px; border-radius: 10px; background: var(--ds-border); }
body.sidebar-collapsed .ds-sb-company { padding: 4px; }

/* Asistentes y popups en el menú de empresa: nombres largos en una línea */
.ds-sb-site span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Accesos de la parte inferior del menú de SuperAdmin */
.ds-sb-foot { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ds-border); }

.ds-sb-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ds-ink-3);
    padding: 8px 10px 6px;
}

.sidebar .nav-link {
    color: var(--ds-ink-2);
    padding: 7px 10px;
    min-height: 34px;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    border-left: 1px solid transparent;
    border-radius: 8px;
}

.sidebar .nav-link i { font-size: 15px; color: inherit; }

.sidebar .nav-link:hover {
    color: var(--ds-ink);
    background: var(--ds-hover);
}

.sidebar .nav-link.active {
    color: var(--ds-ink);
    background: var(--ds-panel);
    border-color: var(--ds-border);
    border-left-color: var(--ds-border);
    box-shadow: 0 1px 2px rgba(24, 24, 27, 0.05);
}

.sidebar .nav-link.active i { color: var(--ds-accent); }

.ds-sb-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--ds-ink-3);
    font-size: 13px;
}

/* Pie del sidebar */
.sidebar-bottom { padding: 8px 12px 14px; }

.ds-sb-card {
    border: 1px solid var(--ds-border);
    background: var(--ds-panel);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.ds-sb-card .nav-link { min-height: 32px; }

.btn-add-new {
    background: var(--ds-accent);
    border-radius: 8px;
    padding: 9px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.btn-add-new:hover { background: var(--ds-accent-hover); }

.bottom-links {
    margin-top: 0;
    border-top: 1px solid var(--ds-border);
    padding-top: 6px;
}

.bottom-links a {
    color: var(--ds-ink-2);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 13px;
    gap: 10px;
}

.bottom-links a i { font-size: 14px; }

.bottom-links a:hover { color: var(--ds-ink); background: var(--ds-hover); }

/* Colapsado */
body.sidebar-collapsed .sidebar { width: 72px; }
body.sidebar-collapsed .main-wrapper { margin-left: 72px; }
body.sidebar-collapsed .ds-sb-brand-text,
body.sidebar-collapsed .ds-ctx,
body.sidebar-collapsed .ds-sb-label { display: none !important; }
body.sidebar-collapsed .ds-sb-head { align-items: center; }
body.sidebar-collapsed .ds-sb-brand { justify-content: center; }
body.sidebar-collapsed .ds-sb-head .sidebar-toggle { margin-left: 0; }
body.sidebar-collapsed .ds-sb-card { padding: 4px; }

/* Barra superior móvil */
.ds-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--ds-panel);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
}

/* -------------------------------------------------------------------------
   Encabezado de página
   ------------------------------------------------------------------------- */
.app-page-header,
.wz-header {
    position: relative;
    top: 0;
    padding: 0;
    margin-bottom: 1.5rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    gap: 1rem;
    align-items: end;
}

.app-page-kicker {
    margin: 0 0 4px;
    color: var(--ds-ink-3);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.app-page-title,
.wz-title {
    color: var(--ds-ink);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

/* Con asistente seleccionado: la sección es el título y el sitio va arriba en gris */
body.ds-site-context .app-page-header-main > div:not(.dropdown) {
    display: flex;
    flex-direction: column-reverse;
}

body.ds-site-context .app-page-header-main .app-page-kicker {
    margin: 0;
    color: var(--ds-ink);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

body.ds-site-context .app-page-header-main .app-page-title {
    margin: 0 0 4px;
    color: var(--ds-ink-3);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
}

.wz-back {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--ds-border-2);
    box-shadow: none;
    color: var(--ds-ink-2);
}

.wz-back:hover {
    color: var(--ds-ink);
    border-color: var(--ds-border-2);
    background: var(--ds-hover);
    transform: none;
}

.header-user-controls { gap: 8px; }
.header-user-trigger { color: var(--ds-ink-2); font-size: 13.5px; }
.header-user-name { font-size: 13.5px; }

/* El sidebar ya cubre la navegación por secciones del asistente */
.app-navtabs.ds-site-tabs { display: none; }

/* Pestañas genéricas: subrayado */
.app-navtabs {
    gap: 4px;
    padding: 0;
    margin: 0 0 1.25rem;
    border: 0;
    border-bottom: 1px solid var(--ds-border);
    border-radius: 0;
    background: transparent;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.app-navtab {
    padding: 10px 12px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--ds-ink-3);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}

.app-navtab:hover { color: var(--ds-ink); background: transparent; border-color: transparent; }
.app-navtab.is-active { color: var(--ds-ink); background: transparent; border-color: var(--ds-ink); font-weight: 500; }

.nav-tabs { border-bottom-color: var(--ds-border); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ds-ink-3); font-size: 13.5px; font-weight: 500; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--ds-ink); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--ds-ink); background: transparent; border-bottom-color: var(--ds-ink); }

.nav-pills .nav-link { border-radius: 7px; color: var(--ds-ink-2); font-size: 13px; font-weight: 500; }
.nav-pills .nav-link.active { background: var(--ds-ink); color: #fff; }

/* -------------------------------------------------------------------------
   Tarjetas
   ------------------------------------------------------------------------- */
.card,
.app-page-card {
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius-card) !important;
    background: var(--ds-panel);
    box-shadow: none !important;
}

.card:hover { border-color: var(--ds-border); box-shadow: none; }

.card-header {
    background: var(--ds-panel);
    border-bottom: 1px solid var(--ds-border);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 15px;
}

.card-body { padding: 20px; }

.card-footer {
    background: var(--ds-sunk);
    border-top: 1px solid var(--ds-border);
    padding: 12px 20px;
}

/* -------------------------------------------------------------------------
   Botones
   ------------------------------------------------------------------------- */
.btn {
    --bs-btn-font-size: 13.5px;
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 8px;
    --bs-btn-padding-x: 14px;
    --bs-btn-padding-y: 7px;
    box-shadow: none !important;
}

.btn-sm { --bs-btn-font-size: 12.5px; --bs-btn-padding-x: 10px; --bs-btn-padding-y: 4px; --bs-btn-border-radius: 7px; }
.btn-lg { --bs-btn-font-size: 14.5px; --bs-btn-padding-x: 18px; --bs-btn-padding-y: 10px; --bs-btn-border-radius: 9px; }

.btn-primary,
.btn-brand {
    --bs-btn-bg: var(--ds-accent);
    --bs-btn-border-color: var(--ds-accent);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--ds-accent-hover);
    --bs-btn-hover-border-color: var(--ds-accent-hover);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--ds-accent-hover);
    --bs-btn-active-border-color: var(--ds-accent-hover);
    --bs-btn-disabled-bg: var(--ds-accent);
    --bs-btn-disabled-border-color: var(--ds-accent);
}

.btn-dark {
    --bs-btn-bg: var(--ds-ink);
    --bs-btn-border-color: var(--ds-ink);
    --bs-btn-hover-bg: #000;
    --bs-btn-hover-border-color: #000;
}

.btn-outline-secondary,
.btn-outline-dark,
.btn-light,
.btn-secondary {
    --bs-btn-color: var(--ds-ink);
    --bs-btn-bg: var(--ds-panel);
    --bs-btn-border-color: var(--ds-border-2);
    --bs-btn-hover-color: var(--ds-ink);
    --bs-btn-hover-bg: var(--ds-hover);
    --bs-btn-hover-border-color: var(--ds-border-2);
    --bs-btn-active-color: var(--ds-ink);
    --bs-btn-active-bg: var(--ds-hover);
    --bs-btn-active-border-color: var(--ds-border-2);
}

.btn-outline-primary {
    --bs-btn-color: var(--ds-accent-ink);
    --bs-btn-border-color: #F9C3AE;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ds-accent);
    --bs-btn-hover-border-color: var(--ds-accent);
}

.btn-outline-danger {
    --bs-btn-color: var(--ds-err);
    --bs-btn-border-color: #F3C7C3;
    --bs-btn-hover-color: var(--ds-err);
    --bs-btn-hover-bg: var(--ds-err-tint);
    --bs-btn-hover-border-color: #F3C7C3;
}

.btn-danger {
    --bs-btn-bg: var(--ds-err);
    --bs-btn-border-color: var(--ds-err);
}

.btn-success {
    --bs-btn-bg: var(--ds-ok);
    --bs-btn-border-color: var(--ds-ok);
}

.app-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ds-border-2);
    background: var(--ds-panel);
    color: var(--ds-ink-2);
    box-shadow: none;
}

.app-icon-btn:hover { background: var(--ds-hover); color: var(--ds-ink); border-color: var(--ds-border-2); }
.app-icon-btn--danger { color: var(--ds-err); border-color: #F3C7C3; }
.app-icon-btn--danger:hover { background: var(--ds-err-tint); color: var(--ds-err); border-color: #F3C7C3; }

/* -------------------------------------------------------------------------
   Formularios
   ------------------------------------------------------------------------- */
.form-label,
.wz-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ds-ink);
    margin-bottom: 6px;
}

.form-text,
.wz-hint {
    font-size: 12.5px;
    color: var(--ds-ink-3);
}

.form-control,
.form-select,
.wz-input,
.wz-select,
.wz-textarea,
.wz-file {
    border: 1px solid var(--ds-border-2);
    border-radius: 8px;
    background-color: var(--ds-panel);
    color: var(--ds-ink);
    font-size: 14px;
    box-shadow: none;
}

.form-control::placeholder,
.wz-input::placeholder,
.wz-textarea::placeholder { color: #6B7280; }

.form-control:focus,
.form-select:focus,
.wz-input:focus,
.wz-select:focus,
.wz-textarea:focus {
    border-color: var(--ds-accent);
    box-shadow: 0 0 0 3px rgba(244, 86, 29, 0.14);
}

.form-check-input:checked {
    background-color: var(--ds-accent);
    border-color: var(--ds-accent);
}

.form-check-input:focus { box-shadow: 0 0 0 3px rgba(244, 86, 29, 0.14); border-color: var(--ds-accent); }

.input-group-text {
    background: var(--ds-sunk);
    border-color: var(--ds-border-2);
    color: var(--ds-ink-2);
}

/* -------------------------------------------------------------------------
   Tablas y DataTables
   ------------------------------------------------------------------------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--ds-sunk);
    --bs-table-striped-bg: var(--ds-sunk);
    --bs-table-border-color: var(--ds-border);
    font-size: 13.5px;
    color: var(--ds-ink);
}

.table > thead > tr > th,
.table thead th {
    /* Sin relleno: encima de la tabla ya hay una barra blanca (buscador, filtros) y
       dos bandas apiladas compiten. La cabecera se distingue por la tipografía en
       mayúsculas y por una línea inferior más marcada que separa de la primera fila. */
    background: var(--ds-panel) !important;
    color: var(--ds-ink) !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--ds-border-2) !important;
    padding: 10px 16px;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 12px 16px;
    border-bottom-color: var(--ds-border);
    vertical-align: middle;
}

/* Filas cebra: alternar el fondo deja seguir una fila de izquierda a derecha en
   tablas anchas. Gana por especificidad a .ds-sticky-col, así que la columna fija
   de acciones acompaña el color de su fila en vez de quedar blanca. */
.table > tbody > tr:nth-child(even) > td {
    background-color: var(--ds-stripe);
}

/* El rayado ya ocupa el gris claro, así que el hover de fila baja un escalón más
   en la misma escala fría: se distingue de las filas rayadas y de las blancas. */
.table.table-hover > tbody > tr:hover > td {
    background-color: var(--ds-row-hover);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
    font-size: 13px;
    color: var(--ds-ink-3);
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--ds-border-2);
    border-radius: 8px;
    min-height: 34px;
    padding: 4px 10px;
}

.dataTables_wrapper .pagination .page-link {
    border-color: var(--ds-border-2);
    color: var(--ds-ink-2);
    font-size: 13px;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background: var(--ds-ink);
    border-color: var(--ds-ink);
    color: #fff;
}

.dataTables_wrapper .pagination .page-item.disabled .page-link { color: #9CA3AF; }

/* -------------------------------------------------------------------------
   Badges, alertas, menús, acordeones
   ------------------------------------------------------------------------- */
.badge {
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 8px;
    letter-spacing: 0;
}

.tenant-plan-badge {
    background: var(--ds-accent-tint);
    color: var(--ds-accent-ink);
    font-size: 11.5px;
    letter-spacing: 0;
    border-radius: 6px;
}

.tenant-plan-badge--free { background: #F3F4F6; color: var(--ds-ink-2); }
.tenant-plan-badge--standard { background: var(--ds-info-tint); color: var(--ds-info); }
.tenant-plan-badge--legacy { background: #F3F4F6; color: var(--ds-ink-3); }

.tenant-bots-badge {
    background: var(--ds-panel);
    color: var(--ds-ink-3);
    border: 1px solid var(--ds-border);
    font-size: 11.5px;
    border-radius: 6px;
}

.text-bg-success, .bg-success { background-color: var(--ds-ok-tint) !important; color: var(--ds-ok) !important; }
.text-bg-warning, .bg-warning { background-color: var(--ds-warn-tint) !important; color: var(--ds-warn) !important; }
.text-bg-danger, .bg-danger { background-color: var(--ds-err-tint) !important; color: var(--ds-err) !important; }
.text-bg-info, .bg-info { background-color: var(--ds-info-tint) !important; color: var(--ds-info) !important; }
.text-bg-secondary, .bg-secondary { background-color: #F3F4F6 !important; color: var(--ds-ink-2) !important; }
.text-bg-primary, .bg-primary { background-color: var(--ds-accent-tint) !important; color: var(--ds-accent-ink) !important; }
.text-primary { color: var(--ds-accent-ink) !important; }

.alert {
    border-radius: 10px;
    font-size: 13.5px;
    border-width: 1px;
}

.alert-success { background: var(--ds-ok-tint); border-color: #CBE8D4; color: var(--ds-ok); }
.alert-warning { background: var(--ds-warn-tint); border-color: #F5DFB5; color: var(--ds-warn); }
.alert-danger { background: var(--ds-err-tint); border-color: #F3C7C3; color: var(--ds-err); }
.alert-info { background: var(--ds-sunk); border-color: var(--ds-border); color: var(--ds-ink-2); }

.dropdown-menu {
    border: 1px solid var(--ds-border) !important;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(24, 24, 27, 0.12) !important;
    padding: 4px;
    font-size: 13.5px;
}

.dropdown-item { border-radius: 6px; padding: 7px 10px; }
.dropdown-item:active { background: var(--ds-accent-tint); color: var(--ds-accent-ink); }

.accordion {
    --bs-accordion-border-color: var(--ds-border);
    --bs-accordion-border-radius: 12px;
    --bs-accordion-inner-border-radius: 11px;
    --bs-accordion-active-bg: var(--ds-panel);
    --bs-accordion-active-color: var(--ds-ink);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(244, 86, 29, 0.14);
}

.accordion-button { font-size: 14px; font-weight: 500; }

.modal-content {
    border: 1px solid var(--ds-border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(24, 24, 27, 0.18);
}

.modal-header { border-bottom-color: var(--ds-border); padding: 16px 20px; }
.modal-header .modal-title { font-size: 15px; font-weight: 600; }
.modal-footer { border-top-color: var(--ds-border); background: var(--ds-sunk); border-radius: 0 0 14px 14px; }

.progress { background: #E5E7EB; border-radius: 6px; height: 6px; }
.progress-bar { background: var(--ds-ink); }

/* -------------------------------------------------------------------------
   Acceso: login, registro y verificación
   ------------------------------------------------------------------------- */
body.login-page {
    background: var(--ds-bg);
    min-height: 100vh;
}

.login-shell.ds-auth {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    gap: 0;
}

.ds-auth-form {
    flex: 1 1 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.ds-auth .login-card,
.ds-auth-center .login-card {
    width: 100%;
    max-width: 400px !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
}

.ds-auth .login-topbar { margin-bottom: 28px; }

.ds-auth-brand,
.ds-auth .login-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ds-ink);
    text-transform: none;
}

.ds-auth-heading { margin-bottom: 20px; }
.ds-auth-heading h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }

.ds-auth .login-form-label { font-size: 13px; font-weight: 500; color: var(--ds-ink); }
.ds-auth .login-input-group .input-group-text,
.ds-auth .login-input-group .form-control,
.ds-auth .form-control { min-height: 44px; }

.login-input-group:focus-within .input-group-text,
.input-group:has(.password-with-toggle):focus-within .password-toggle-btn {
    border-color: var(--ds-accent);
    color: var(--ds-accent);
}

.login-btn-submit {
    width: 100%;
    min-height: 44px;
    border-radius: 9px;
    background: var(--ds-accent) !important;
    border: 1px solid var(--ds-accent) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 14.5px;
    box-shadow: none !important;
}

.login-btn-submit:hover { background: var(--ds-accent-hover) !important; border-color: var(--ds-accent-hover) !important; }

.ds-auth-center {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.ds-state-card {
    background: var(--ds-panel) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: 14px !important;
    padding: 36px !important;
    max-width: 460px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ds-state-card h1 { font-size: 22px; font-weight: 600; margin: 4px 0 0; }
.ds-state-card p { color: var(--ds-ink-2); margin: 0 0 8px; }

.ds-state-ico {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 24px;
    border: 1px solid var(--ds-border);
}

.ds-state-ico--ok { background: var(--ds-ok-tint); color: var(--ds-ok); border-color: #CBE8D4; }
.ds-state-ico--err { background: var(--ds-err-tint); color: var(--ds-err); border-color: #F3C7C3; }
.ds-state-ico--ac { background: var(--ds-accent-tint); color: var(--ds-accent-ink); border-color: #F6D3C2; }

/* Wizard / Sites edit shell (wz-*) sin vidrio ni degradados */
.wz-shell { background: transparent; }
.wz-card, .wz-section {
    background: var(--ds-panel);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    box-shadow: none;
}

.ai-topup-summary-card--accent { background: var(--ds-ink); }

/* Segmentado (filtros) */
.ds-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: #F3F4F6; border-radius: 9px; }
.ds-seg button { border: 0; background: transparent; border-radius: 7px; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--ds-ink-2); min-height: 30px; cursor: pointer; }
.ds-seg button span { font-size: 11.5px; color: var(--ds-ink-3); margin-left: 4px; }
.ds-seg button.is-active { background: var(--ds-panel); color: var(--ds-ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }

.ds-mono-cell { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 12.5px; }
.ds-qual-badge { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.ds-auth-brand .ds-sb-logo,
.login-brand .ds-sb-logo { color: #fff !important; font-size: 13px !important; font-weight: 700; display: grid !important; }

/* Un solo naranja por pantalla: dentro del contenido, los btn-primary/btn-brand
   que no envían formularios pasan a secundarios. Guardar/enviar y la acción
   del encabezado siguen en naranja. */
.app-body-surface .card .btn-primary:not([type="submit"]):not(.btn-save),
.app-body-surface .card .btn-brand:not([type="submit"]):not(.btn-save),
.app-body-surface .wz-card .btn-primary:not([type="submit"]):not(.btn-save),
.app-body-surface .btn-sm.btn-primary:not([type="submit"]) {
    --bs-btn-color: var(--ds-ink);
    --bs-btn-bg: var(--ds-panel);
    --bs-btn-border-color: var(--ds-border-2);
    --bs-btn-hover-color: var(--ds-ink);
    --bs-btn-hover-bg: var(--ds-hover);
    --bs-btn-hover-border-color: var(--ds-border-2);
    --bs-btn-active-color: var(--ds-ink);
    --bs-btn-active-bg: var(--ds-hover);
    --bs-btn-active-border-color: var(--ds-border-2);
    background-color: var(--ds-panel) !important;
    border-color: var(--ds-border-2) !important;
    color: var(--ds-ink) !important;
}

.app-body-surface .card .btn-primary:not([type="submit"]):not(.btn-save):hover,
.app-body-surface .card .btn-brand:not([type="submit"]):not(.btn-save):hover,
.app-body-surface .btn-sm.btn-primary:not([type="submit"]):hover {
    background-color: var(--ds-hover) !important;
}

.btn-cancel {
    background: var(--ds-panel);
    border: 1px solid var(--ds-border-2);
    color: var(--ds-ink);
}

.btn-cancel:hover { background: var(--ds-hover); color: var(--ds-ink); }

/* Barra de secciones para páginas largas (redesign.js) */
.ds-section-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: -4px 0 20px;
    padding: 8px 0 0;
    background: var(--ds-panel);
    border-bottom: 1px solid var(--ds-border);
    scrollbar-width: none;
}

.ds-section-nav::-webkit-scrollbar { display: none; }

.ds-section-nav a {
    white-space: nowrap;
    padding: 8px 12px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--ds-ink-3);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.ds-section-nav a:hover { color: var(--ds-ink); }
.ds-section-nav a.is-active { color: var(--ds-ink); border-bottom-color: var(--ds-ink); }

[data-ds-autonav] .card { scroll-margin-top: 64px; }
.sysconfig-grid > .ds-section-nav { grid-column: 1 / -1; }

/* Estados de procesamiento */
.badge.badge-status-done, .badge-status-done { background: var(--ds-ok-tint) !important; color: var(--ds-ok) !important; }
.badge.badge-status-pending, .badge-status-pending { background: #F3F4F6 !important; color: var(--ds-ink-2) !important; }
.badge.badge-status-processing, .badge-status-processing { background: var(--ds-info-tint) !important; color: var(--ds-info) !important; }
.badge.badge-status-failed, .badge-status-failed { background: var(--ds-err-tint) !important; color: var(--ds-err) !important; }

input[type="range"], .form-range { accent-color: var(--ds-accent); }
.form-range::-webkit-slider-thumb { background: var(--ds-accent); }
.form-range::-moz-range-thumb { background: var(--ds-accent); }
.form-switch .form-check-input:checked { background-color: var(--ds-accent); border-color: var(--ds-accent); }

/* Fila de indicadores */
.ds-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.ds-stat { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); min-width: 0; }
.ds-stat-l { font-size: 12px; color: var(--ds-ink-3); font-weight: 500; }
.ds-stat-v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ds-ink); }

.tenants-row-logo { width: 32px; height: 32px; font-size: 13px; background: var(--ds-ink); }
.tenants-table .progress { height: 6px; }

/* Inicio del cliente */
/* Encabezado con muchos controles: título arriba y controles en su propia fila */
.app-page-header.ds-header-stack { grid-template-columns: minmax(0, 1fr); }
.ds-header-stack .app-page-header-actions { flex-wrap: wrap; justify-content: flex-start; }
.ds-header-stack .ds-push-end { margin-left: auto; }
@media (max-width: 991.98px) { .ds-header-stack .ds-push-end { margin-left: 0; } }

/* Inicio del asistente: banda negra con texto blanco y cifras grandes */
.ds-home-hero { padding: 20px 24px; border-radius: 12px; background: var(--ds-ink); }
body.ds-site-context .ds-home-hero .app-page-header-main .app-page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: #FFFFFF; margin: 0; }
.ds-home-hero .ds-page-desc { color: #D1D5DB; }
.ds-home-hero .ds-seg { background: rgba(255, 255, 255, .12); }
.ds-home-hero .ds-seg a { color: #E5E7EB; }
.ds-home-hero .ds-seg a:hover { color: #FFFFFF; }
.ds-home-hero .ds-seg a.is-active { background: #FFFFFF; color: var(--ds-ink); }
.ds-home-hero-name { min-width: 0; overflow-wrap: anywhere; }
/* Indicadores de la home dentro de una tarjeta: las tiras pierden su borde propio (lo pone
   la tarjeta) y la segunda fila se separa de la primera con una línea. */
.card > .ds-stat-strip { border: 0; border-radius: 0; }
.card > .ds-stat-strip + .ds-stat-strip { border-top: 1px solid var(--ds-border); }
/* Conversaciones y leads recientes: mitad y mitad desde escritorio, apiladas antes */
.ds-home-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 992px) { .ds-home-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Cabecera de la empresa: mismo bloque oscuro que la del asistente, y el naranja
   de marca contrastando contra el negro (distintivo, antetítulo y plan). */
.ds-company-hero { padding: 20px 24px; border-radius: 12px; background: var(--ds-ink); }
.ds-company-hero .app-page-kicker { color: var(--ds-accent); display: block; }
.ds-company-hero .app-page-title { color: #FFFFFF; }
.ds-company-hero .ds-page-desc { color: #D1D5DB; margin-bottom: 0; }
.ds-company-hero .ds-company-logo { background: var(--ds-accent); color: #FFFFFF; }
.ds-company-hero .app-page-title .badge { background: var(--ds-accent) !important; color: #FFFFFF !important; }
.ds-company-hero .ds-tabs-bar a { color: #D1D5DB; }
.ds-company-hero .ds-tabs-bar a.is-active { color: #FFFFFF; }
.ds-home-kpis .ds-stat { padding: 20px 22px; }
.ds-widget-snippet[hidden] { display: none; }
.ds-widget-snippet { margin: 0; max-height: 130px; overflow: auto; padding: 10px; border: 1px solid var(--ds-border); border-radius: 8px; background: var(--ds-sunk); font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ds-ink-2); }
/* Instalación: "¿Con qué está hecha tu web?" como tarjetas de opción con el logo de cada plataforma.
   Mismo patrón que .act-types: radio oculto + label; la elegida con borde naranja y tinte. */
/* 80px de ancho mínimo: en la columna angosta del Inicio caben 3 por fila */
.ds-platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.ds-platform {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 80px; margin: 0; padding: 12px 4px 10px; cursor: pointer; text-align: center;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius); background: var(--ds-panel); color: var(--ds-ink-3);
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ds-platform:hover { border-color: var(--ds-border-2); background: var(--ds-sunk); color: var(--ds-ink-2); }
.ds-platform-logo { width: 26px; height: 26px; flex-shrink: 0; font-size: 24px; line-height: 1; }
.ds-platform-name { font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--ds-ink); }
.ds-platform-tag {
    position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 999px;
    font-size: 10.5px; font-weight: 600; line-height: 1.5; background: var(--ds-ok-tint); color: var(--ds-ok);
}
.ds-platforms input:checked + .ds-platform { border-color: var(--ds-accent); background: var(--ds-accent-tint); color: var(--ds-accent-ink); }
.ds-platforms input:focus-visible + .ds-platform { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-plugin-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 20px; padding: 16px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius); background: var(--ds-sunk); }
.ds-plugin-box h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.ds-plugin-box p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ds-ink-3); }

/* Instalación (Sites/Install y el Inicio): estado → 3 pasos numerados → delegar. Texto de lectura a 14 px con
   medida acotada; en pantallas anchas los pasos y el código van lado a lado, con el código fijo al bajar. */
.ds-install-page { display: flex; flex-direction: column; gap: 16px; }
/* Instalación: dos caminos al mismo nivel (instalar en la web / compartir sin instalar), arriba de la página */
.ds-install-paths-label { margin: 4px 0 10px; font-size: 15px; font-weight: 600; color: var(--ds-ink); }
.ds-install-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.ds-install-path {
    display: flex; align-items: flex-start; gap: 14px; margin: 0; padding: 16px 18px; cursor: pointer;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-card); background: var(--ds-panel);
    transition: border-color .15s ease, background-color .15s ease;
}
.ds-install-path:hover { border-color: var(--ds-border-2); background: var(--ds-sunk); }
.ds-install-path-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px;
    border-radius: 10px; background: var(--ds-sunk); color: var(--ds-ink-3); font-size: 22px; line-height: 1;
}
.ds-install-path > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ds-install-path b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ds-ink); }
.ds-install-path > span > span { font-size: 13.5px; line-height: 1.45; color: var(--ds-ink-3); }
.ds-install-path-tag { position: static; }
.ds-install-paths input:checked + .ds-install-path { border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.ds-install-paths input:checked + .ds-install-path .ds-install-path-icon { background: var(--ds-panel); color: var(--ds-accent-ink); }
.ds-install-paths input:focus-visible + .ds-install-path { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
[data-install-panel][hidden] { display: none !important; }
.ds-install { display: flex; flex-direction: column; gap: 16px; }
.ds-install-status, .ds-install-delegate {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px;
    border: 1px solid var(--ds-border); border-radius: var(--ds-radius-card); background: var(--ds-panel);
    font-size: 14px; line-height: 1.5; color: var(--ds-ink-2);
}
.ds-install-status > .flex-grow-1, .ds-install-delegate > .flex-grow-1 { flex-basis: 0; min-width: 180px; }
.ds-install-status-icon, .ds-install-delegate-icon { flex-shrink: 0; font-size: 22px; line-height: 1; }
.ds-install-status-title { font-size: 15px; font-weight: 600; color: var(--ds-ink); }
.ds-install-status.is-ok { border-color: color-mix(in srgb, var(--ds-ok) 30%, transparent); background: var(--ds-ok-tint); }
.ds-install-status.is-ok .ds-install-status-icon { color: var(--ds-ok); }
.ds-install-status.is-warn { border-color: color-mix(in srgb, var(--ds-warn) 30%, transparent); background: var(--ds-warn-tint); }
.ds-install-status.is-warn .ds-install-status-icon { color: var(--ds-warn); }
.ds-install-status.is-muted .ds-install-status-icon, .ds-install-delegate-icon { color: var(--ds-ink-3); }
.ds-install-delegate { background: var(--ds-sunk); border-style: dashed; }
.ds-step-num {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 10px;
    border-radius: 999px; background: var(--ds-ink); color: #FFFFFF; font-size: 12.5px; font-weight: 600; vertical-align: 1px;
}
.ds-install-step .ap-ch p { margin-left: 34px; }
.ds-install-grid, .ap-cb.ds-install-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 28px; align-items: start; }
/* Dos columnas según el ancho del bloque, no de la pantalla: en la columna del Inicio se apila */
.ds-install-step, .ds-install-share { container-type: inline-size; }
@container (max-width: 860px) { .ds-install-grid, .ap-cb.ds-install-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } .ds-install-code { position: static; } }
.ds-install-guide > [data-platform-guide], .ds-install-share .ds-install-grid > div:first-child { max-width: 68ch; }
.ds-install-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding-left: 1.4em; font-size: 14px; line-height: 1.55; color: var(--ds-ink-2); }
.ds-install-list li::marker { font-weight: 600; color: var(--ds-ink); }
.ds-install-subtitle { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.ds-install-text { font-size: 14px; line-height: 1.55; color: var(--ds-ink-2); max-width: 68ch; }
.ds-install-hint { font-size: 13px; line-height: 1.5; color: var(--ds-ink-3); margin: 0; }
.ds-install-note {
    display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; padding: 10px 12px;
    border-radius: var(--ds-radius); background: var(--ds-sunk); border: 1px solid var(--ds-border);
    font-size: 13px; line-height: 1.5; color: var(--ds-ink-2);
}
.ds-install-note > .bi { color: var(--ds-ink-3); margin-top: 1px; }
.ds-install-code { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ds-install-code-label { font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ds-ink-3); }
.ds-install-code .ds-widget-snippet { max-height: 220px; }
.ds-install-share-form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
/* Paso 3 (comprobar): toma el color del estado y muestra el resultado; tras "Comprobar ahora" se marca un momento */
.ds-install-check-result { display: flex; gap: 8px; align-items: flex-start; flex-basis: 100%; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ds-ink-2); }
.ds-install-check-result > .bi { font-size: 18px; line-height: 1.3; color: var(--ds-ink-3); }
.ds-install-check-result strong { color: var(--ds-ink); font-weight: 600; }
.ds-install-check-time { color: var(--ds-ink-3); }
.ds-install-check.is-ok { border-color: color-mix(in srgb, var(--ds-ok) 35%, transparent); }
.ds-install-check.is-ok > .ap-ch { background: var(--ds-ok-tint); border-bottom-color: color-mix(in srgb, var(--ds-ok) 25%, transparent); }
.ds-install-check.is-ok .ds-step-num { background: var(--ds-ok); }
.ds-install-check.is-ok .ds-install-check-result > .bi { color: var(--ds-ok); }
.ds-install-check.is-warn { border-color: color-mix(in srgb, var(--ds-warn) 35%, transparent); }
.ds-install-check.is-warn > .ap-ch { background: var(--ds-warn-tint); border-bottom-color: color-mix(in srgb, var(--ds-warn) 25%, transparent); }
.ds-install-check.is-warn .ds-step-num { background: var(--ds-warn); }
.ds-install-check.is-warn .ds-install-check-result > .bi { color: var(--ds-warn); }
.ds-install-check.is-just-checked { animation: ds-install-checked 1.6s ease-out 1; }
@keyframes ds-install-checked {
    0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ds-accent) 35%, transparent); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .ds-install-check.is-just-checked { animation: none; outline: 2px solid var(--ds-accent); outline-offset: 2px; } }
/* En pantallas táctiles chicas los botones de la instalación miden al menos 44 px de alto */
@media (max-width: 575.98px) { .ds-install-page .btn, .ds-install .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; } }
.ds-guide-message { margin: 0 0 6px; padding: 10px; border: 1px solid var(--ds-border); border-radius: 8px; background: var(--ds-sunk); font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ds-ink-2); }
.ds-help-case { border: 1px solid var(--ds-border); border-radius: var(--ds-radius); background: var(--ds-panel); }
.ds-help-case > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--ds-ink); }
.ds-help-case[open] > summary { border-bottom: 1px solid var(--ds-border); background: var(--ds-sunk); }
.ds-help-case-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; color: var(--ds-ink-2); font-size: 13.5px; }
.ds-help-label { margin-bottom: 2px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ds-ink-3); }
.ds-stats.ds-home-kpis .ds-stat-v { font-size: 40px; line-height: 1.1; }
.ds-trend { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12.5px; font-weight: 500; color: var(--ds-ink-3); }
.ds-trend.is-up { color: var(--ds-ok); }
.ds-trend.is-down { color: #B91C1C; }
.ds-home-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ds-accent-tint); color: var(--ds-accent-ink); flex: none; }
.ds-home .list-group-item { border-color: var(--ds-border); }
.ds-home-checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--ds-border); font-size: 13.5px; }
.ds-home-checklist li:first-child { border-top: 0; margin-top: 8px; }
.ds-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--ds-border-2); flex: none; display: grid; place-items: center; font-size: 12px; }
.ds-check.is-done { border: 0; background: var(--ds-ok-tint); color: var(--ds-ok); }
a.ds-stat:hover { border-color: var(--ds-border-2); background: var(--ds-sunk); }

/* -------------------------------------------------------------------------
   Barra superior del panel (ruta + acciones) y patrón de encabezado
   ------------------------------------------------------------------------- */
.ds-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: -1.75rem -2rem 1.75rem;
    padding: 10px 20px;
    min-height: 56px;
    border-bottom: 1px solid var(--ds-border);
}

@media (max-width: 991.98px) {
    .ds-topbar { margin: -1.25rem -1rem 1.25rem; padding: 10px 14px; }
}

.ds-crumbs {
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--ds-ink-3);
}

.ds-crumbs a { color: var(--ds-ink-3); text-decoration: none; }
.ds-crumbs a:hover { color: var(--ds-ink); }
.ds-crumbs b { color: var(--ds-ink); font-weight: 500; }
/* Vuelta a la plataforma (solo superadmin, dentro de una empresa o un asistente) */
.ds-crumbs .ds-crumbs-platform { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.ds-crumbs .ds-crumbs-platform i { font-size: 12px; }
.ds-crumbs-sep { color: var(--ds-border-2); }

.ds-topbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ds-topbar-ghost { border-color: transparent; color: var(--ds-ink-2); }
.ds-topbar-ghost:hover { background: var(--ds-hover); color: var(--ds-ink); }

.ds-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--ds-accent-tint);
    color: var(--ds-accent-ink);
    font-weight: 600;
    font-size: 12px;
    display: inline-grid;
    place-items: center;
    flex: none;
}

.header-user-trigger .header-user-name { display: none; }
.header-user-trigger { gap: 4px; }

/* Encabezado: título de sección + descripción + acciones; sin flecha atrás */
.app-page-header .wz-back { display: none !important; }
.app-page-header { margin-bottom: 1.5rem; }
.app-page-header-main { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Plataforma: el título es la sección; el kicker sobra */
body:not(.ds-site-context) .app-page-header-main .app-page-kicker { display: none; }

/* Con asistente: el kicker es la sección (título) y el nombre del sitio ya está en la ruta */
body.ds-site-context .app-page-header-main .app-page-title { display: none; }
body.ds-site-context .app-page-header-main .app-page-kicker {
    display: block;
    margin: 0;
    color: var(--ds-ink);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.ds-page-desc { margin: 4px 0 0; color: var(--ds-ink-2); font-size: 14px; max-width: 680px; }

.ds-sb-card { gap: 8px; padding: 12px; }
.ds-sb-card-title { font-size: 13px; font-weight: 600; }
.ds-sb-card-meta { font-size: 12px; color: var(--ds-ink-3); }
body.sidebar-collapsed .ds-sb-card { display: none; }

/* Barra de consumo del mes: verde, naranja desde la mitad y roja cerca del final */
.ds-usage--low { --ds-usage: var(--ds-ok); }
.ds-usage--mid { --ds-usage: var(--ds-accent); }
.ds-usage--high { --ds-usage: #DC2626; }
.ds-usage-fill { background: var(--ds-usage) !important; }

/* Consumo compacto dentro de un asistente: solo la barra; la tarjeta se abre hacia arriba con el mouse o el foco */
.ds-sb-usage { position: relative; outline: none; }
.ds-sb-usage-row {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    min-height: 28px; padding: 7px 10px 9px; margin-bottom: 8px;
    border: 1px solid var(--ds-ink); border-radius: 8px; background: var(--ds-ink);
    cursor: default;
}
.ds-sb-usage-row .progress { background: rgba(255, 255, 255, .25); }
/* Sobre fondo negro, verde y rojo más claros para que se distingan */
.ds-sb-usage.ds-usage--low .ds-sb-usage-row { --ds-usage: #22C55E; }
.ds-sb-usage.ds-usage--high .ds-sb-usage-row { --ds-usage: #F87171; }
.ds-sb-usage-label { font-size: 12px; font-weight: 500; line-height: 1.2; color: #FFFFFF; }
@media (max-width: 991.98px) { .ds-sb-usage-row { min-height: 44px; } }
.ds-sb-usage:focus-visible .ds-sb-usage-row { box-shadow: 0 0 0 3px rgba(244, 86, 29, .18); }
.ds-sb-usage .ds-sb-card {
    position: absolute; left: 0; right: 0; bottom: 100%; z-index: 5;
    margin-bottom: 0;
    box-shadow: 0 8px 24px rgba(24, 24, 27, .14);
    opacity: 0; visibility: hidden; transition: opacity .15s ease, visibility .15s;
}
.ds-sb-usage:hover .ds-sb-card,
.ds-sb-usage:focus-within .ds-sb-card { opacity: 1; visibility: visible; }
body.sidebar-collapsed .ds-sb-usage { display: none; }
@media (prefers-reduced-motion: reduce) { .ds-sb-usage .ds-sb-card { transition: none; } }
body.ds-site-context .app-page-header-main > div:not(.dropdown) { flex-direction: column; }

/* Pestañas de página (redesign.js, [data-ds-tabs]) */
.ds-tabs-bar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--ds-border);
    scrollbar-width: none;
}
.ds-tabs-bar::-webkit-scrollbar { display: none; }
.ds-tabs-bar button, .ds-tabs-bar a {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ds-ink-3);
    padding: 10px 12px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}
.ds-tabs-bar button:hover, .ds-tabs-bar a:hover { color: var(--ds-ink); }
.ds-tabs-bar button.is-active, .ds-tabs-bar a.is-active { color: var(--ds-ink); border-bottom-color: var(--ds-ink); }
[data-ds-tabs] [data-ds-tab].ds-tab-hidden { display: none !important; }

/* Diseño en dos columnas: contenido + panel lateral */
.ds-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.ds-split-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ds-split-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
/* A partir de escritorio el reparto es 60/40 en vez de dejar la columna lateral
   en su mínimo: ahí viven listas de personas (nombre + correo + rol) que con
   300 px se cortaban con puntos suspensivos. El 10px de cada lado descuenta el gap. */
@media (min-width: 992px) {
    .ds-split-main { flex: 1 1 calc(60% - 10px); }
    .ds-split-side { flex: 1 1 calc(40% - 10px); max-width: calc(40% - 10px); }
}
@media (min-width: 1200px) { .ds-split-side { position: sticky; top: 16px; } }
.ds-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.ds-explain { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-sunk); font-size: 13px; color: var(--ds-ink-2); }
.ds-explain .badge { align-self: flex-start; }
.ds-explain b { color: var(--ds-ink); font-size: 13.5px; }
.ds-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 20px; color: var(--ds-ink-3); font-size: 13.5px; }
.ds-empty b { color: var(--ds-ink); font-size: 15px; }
.ds-empty-ico { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ds-border); background: var(--ds-sunk); display: grid; place-items: center; font-size: 20px; color: var(--ds-ink-2); }

.ds-stat-v--sm { font-size: 18px; }

/* Barra de filtros sin tarjeta */
.ds-toolbar { display: block; }
.ds-toolbar .form-control, .ds-toolbar .form-select { background: var(--ds-panel); }

/* Embudo horizontal */
.ds-funnel { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.ds-funnel-step { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); min-width: 0; }
.ds-funnel-step.is-accent .ds-stat-v { color: var(--ds-accent); }
.ds-funnel-arrow { display: grid; place-items: center; color: var(--ds-ink-3); }
@media (max-width: 640px) { .ds-funnel-arrow { display: none; } }

/* Lista de ranking con barra */
.ds-rank-list li { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--ds-border); font-size: 13px; }
.ds-rank-list li:first-child { border-top: 0; }
.ds-rank-list .progress { height: 6px; }
.ds-rank-list .progress-bar { background: var(--ds-accent); }

/* Perfil: secciones con título a la izquierda y campos a la derecha */
.profile-shell { display: flex; flex-direction: column; gap: 20px; max-width: 980px; }
.card.profile-card .card-body { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 32px; padding: 24px !important; }
.profile-card-heading { flex-direction: column; align-items: flex-start; gap: 4px; margin: 0; }
.profile-card-heading .profile-card-icon { display: none; }
.profile-card-heading h2 { font-size: 15px; font-weight: 600; margin: 0; }
.profile-card-heading p { font-size: 13px; color: var(--ds-ink-3); margin: 0; }
@media (max-width: 860px) { .card.profile-card .card-body { grid-template-columns: 1fr; gap: 16px; } }

/* Ayuda: buscador, categorías y acordeón */
.faq-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 16px; margin-bottom: 20px; border: 1px solid var(--ds-border); border-radius: 14px; background: var(--ds-panel); text-align: center; }
.faq-hero h2 { font-size: 20px; font-weight: 600; margin: 0; }
.faq-search { position: relative; width: min(100%, 560px); }
.faq-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ds-ink-3); }
.faq-search .form-control { padding-left: 38px; height: 42px; }
.faq-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-bottom: 24px; }
.faq-cat { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); color: var(--ds-ink); text-decoration: none; font-size: 13.5px; }
.faq-cat:hover { border-color: var(--ds-ink-3); color: var(--ds-ink); }
.faq-cat-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ds-sunk); color: var(--ds-ink-2); }
.faq-shell .accordion-item { border: 1px solid var(--ds-border) !important; box-shadow: none !important; border-radius: 10px !important; overflow: hidden; }
.faq-section-title { scroll-margin-top: 16px; }

.ds-cycle-toggle { display: inline-flex; align-items: center; padding: 4px 12px; border: 1px solid var(--ds-border); border-radius: 999px; background: var(--ds-panel); font-size: 13px; }
.ds-cycle-toggle .toggle-switch { margin: 0 10px !important; }

/* Lista clave-valor */
.ds-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 13px; }
.ds-kv dt { font-weight: 400; color: var(--ds-ink-3); }
.ds-kv dd { margin: 0; text-align: right; font-weight: 600; color: var(--ds-ink); }
.ds-tabs-bar a { text-decoration: none; }

/* Índice lateral de secciones */
.ds-autonav-side { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.ds-section-nav.ds-section-nav--side { position: sticky; top: 16px; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; margin: 0; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); overflow: visible; }
.ds-section-nav--side a { border-bottom: 0 !important; border-radius: 8px; padding: 8px 10px; white-space: normal; }
.ds-section-nav--side a.is-active { background: var(--ds-sunk); }
@media (max-width: 991px) { .ds-autonav-side { grid-template-columns: 1fr; } .ds-section-nav.ds-section-nav--side { position: static; flex-direction: row; overflow-x: auto; } }

.ds-narrow { max-width: 860px; }

.min-w-0 { min-width: 0 !important; }
.ds-stat > .ds-stat-l:first-child::first-letter { text-transform: uppercase; }

/* Configuración del sistema: filas de paquetes que se acomodan al ancho */
.ds-autonav-body .sysconfig-package-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.ds-autonav-body .sysconfig-package-row > div:has([data-field="stripe"]) { grid-column: span 2; }

/* ===== Ajustes de revisión: fondos, contraste y estados activos ===== */

/* Sin fondos ajenos al diseño */
.card .list-group-item { background: transparent; }
.nav-tabs .badge, .ds-tabs-bar .badge, .context-main-tabs .badge { background: var(--ds-hover) !important; color: var(--ds-ink-2) !important; font-weight: 500; }
.sidebar { scrollbar-width: none; border-right: 0 !important; box-shadow: none !important; }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .sidebar-nav, .sidebar .ds-sb-menu { scrollbar-width: none; }
.sidebar .sidebar-nav::-webkit-scrollbar, .sidebar .ds-sb-menu::-webkit-scrollbar { display: none; }

/* Contraste */
.text-muted, .text-secondary, .form-text, .small.text-muted { color: var(--ds-ink-3) !important; }
.ds-sb-label { color: var(--ds-ink); }
.form-control::placeholder { color: #6B7280; }
.btn:disabled, .btn.disabled { opacity: .55; }

/* Estados activos claros */
.sidebar .nav-link.active {
    color: var(--ds-accent-ink);
    background: var(--ds-accent-tint);
    border-color: transparent;
    border-left-color: transparent;
    box-shadow: none;
    font-weight: 600;
}
.ds-tabs-bar button.is-active, .ds-tabs-bar a.is-active,
.nav-tabs .nav-link.active, .app-navtab.is-active, .ds-section-nav a.is-active {
    color: var(--ds-accent-ink);
    border-bottom: 2px solid var(--ds-accent) !important;
    font-weight: 600;
}
.ds-section-nav--side a.is-active { background: var(--ds-accent-tint); color: var(--ds-accent-ink); box-shadow: none; }
.ds-seg button.is-active { background: var(--ds-ink); color: #fff; font-weight: 600; box-shadow: none; }
.ds-seg button.is-active span { color: rgba(255, 255, 255, .75); }
.nav-pills .nav-link.active { background: var(--ds-accent); color: #fff; }
.btn-check:checked + .btn, .btn.active { background: var(--ds-ink) !important; border-color: var(--ds-ink) !important; color: #fff !important; }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px rgba(244, 86, 29, .2) !important; border-color: var(--ds-accent) !important; }
.cycle-label--active { color: var(--ds-ink); font-weight: 600; }

/* Apariencia: todas las secciones visibles, como en el diseño */
.ds-appearance-flat .wz-steps,
.ds-appearance-flat .wz-footer-nav { display: none !important; }
.ds-appearance-flat .wz-panel { display: block !important; margin-bottom: 20px; padding: 0; border: 1px solid var(--ds-border); border-radius: 12px; animation: none; }
.ds-appearance-flat .wz-panel > * { padding-left: 20px; padding-right: 20px; }
.ds-appearance-flat .wz-panel > :last-child { padding-bottom: 20px; }
.ds-appearance-flat .wz-panel-head { padding: 16px 20px; margin: 0 0 18px; border-bottom: 1px solid var(--ds-border); }
.ds-appearance-flat .wz-panel-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.ds-appearance-flat .wz-panel-copy { font-size: 13px; color: var(--ds-ink-3); margin: 2px 0 0; }
.ds-appearance-flat .wz-right { top: 16px; }
.ds-appearance-flat .wz-icon-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.ds-appearance-flat .wz-icon-btn { aspect-ratio: auto; height: 56px; border-radius: 9px; background: #fff; box-shadow: none; font-size: 18px; }
.ds-appearance-flat .wz-icon-btn.is-selected,
.ds-appearance-flat .wz-position-card.is-selected,
.ds-appearance-flat .wz-style-card.is-selected { border-color: var(--ds-accent); background: var(--ds-accent-tint); color: var(--ds-accent-ink); box-shadow: 0 0 0 1px var(--ds-accent); }
.ds-appearance-flat .wz-position-card, .ds-appearance-flat .wz-style-card { box-shadow: none; border-radius: 10px; }

/* Vista previa clara y selector de dispositivo */
.ds-appearance-flat .wz-preview-panel { padding: 16px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); }
.wz-preview-panel.is-mobile .wz-preview { max-width: 340px; margin: 0 auto; }
.wz-preview.is-chat-spotlight .wz-preview-chat,
.wz-preview.is-chat-spotlight .wz-preview-messages { background: #fff; }
.wz-preview.is-chat-spotlight .wz-preview-msg-bot { color: var(--ds-ink); background: #F3F4F6; }
.wz-preview.is-chat-spotlight .wz-preview-input { color: var(--ds-ink-3); border-top-color: var(--ds-border); }
.wz-chat-demo--spotlight { background: #fff; }
.wz-chat-demo--spotlight .wz-chat-demo-msg--bot { background: #F3F4F6 !important; color: var(--ds-ink) !important; }
.wz-preview.is-chat-spotlight .wz-preview-chat,
.wz-preview.is-chat-spotlight .wz-preview-messages,
.wz-chat-demo--spotlight { background: #fff !important; }
.wz-preview.is-chat-spotlight .wz-preview-msg-bot,
.wz-chat-demo--spotlight .wz-chat-demo-msg--bot { color: var(--ds-ink) !important; background: #F3F4F6 !important; }
.wz-preview.is-chat-spotlight .wz-preview-input { border-top-color: var(--ds-border) !important; }
.lead-qualification-modal .modal-header, .lead-qualification-modal .modal-body, .lead-qualification-modal .modal-footer { background: var(--ds-panel) !important; }
.lead-qualification-modal .modal-title, .lead-qualification-section-title { color: var(--ds-ink) !important; }
.lead-qualification-attribute { background: var(--ds-panel) !important; border: 1px solid var(--ds-border); }
.site-edit-wizard-banner, .site-edit-wizard-banner-body, .site-edit-wizard-banner-icon { background: var(--ds-panel) !important; }
.site-edit-wizard-banner { border: 1px solid var(--ds-border) !important; }

/* ===== Apariencia (diseño: tarjetas apiladas + vista previa) ===== */
.ap-editor .card { border-radius: 12px; }
.ap-ch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--ds-border); }
.ap-ch h2 { font-size: 15px; font-weight: 600; margin: 0; color: var(--ds-ink); }
.ap-ch p { font-size: 13px; color: var(--ds-ink-3); margin: 2px 0 0; }
.ap-cb { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ap-cb--tight { gap: 10px; }
.ap-g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.ap-g2--cards { gap: 20px; align-items: start; }
.ap-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ap-f > label, .ap-lb { font-size: 13px; font-weight: 500; color: var(--ds-ink); margin: 0; }
.ap-opt { font-weight: 400; color: var(--ds-ink-3); }

.ap-editor .ap-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.ap-editor .wz-icon-btn.ap-icn { aspect-ratio: auto; height: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--ds-border); border-radius: 9px; background: #fff; box-shadow: none; font: inherit; font-size: 11.5px; color: var(--ds-ink-2); cursor: pointer; }
.ap-editor .wz-icon-btn.ap-icn i { font-size: 17px; }
.ap-editor .wz-icon-btn.ap-icn:hover { border-color: var(--ds-border-2); }
.ap-editor .wz-icon-btn.ap-icn.is-selected { border-color: var(--ds-accent); background: var(--ds-accent-tint); color: var(--ds-accent-ink); box-shadow: none; }

.ap-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.ap-swatch-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--ds-ink-3); }
.ap-editor .ap-swatch { width: 100%; height: 40px; border-radius: 9px; border: 2px solid transparent; padding: 0; cursor: pointer; box-shadow: none; }
.ap-editor .ap-swatch.is-on { outline: 2px solid var(--ds-ink); outline-offset: 2px; }
.ap-color { width: 38px; height: 38px; flex: none; padding: 2px; border: 1px solid var(--ds-border-2); border-radius: 8px; background: #fff; cursor: pointer; }

.ap-mode label, .ap-position label { padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--ds-ink-2); cursor: pointer; min-height: 30px; display: inline-flex; align-items: center; margin: 0; }
.ap-mode input:checked + label,
.ap-editor .ap-position .wz-position-card.is-selected { background: var(--ds-ink); color: #fff; font-weight: 600; }
.ap-editor .ap-position .wz-position-card { border: 0; box-shadow: none; background: transparent; }
.ap-mode input:focus-visible + label { outline: 2px solid var(--ds-accent); }

.ap-editor .wz-style-card.ap-rc { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--ds-border); border-radius: 10px; cursor: pointer; background: #fff; box-shadow: none; margin: 0; }
.ap-editor .wz-style-card.ap-rc:hover { border-color: var(--ds-border-2); }
.ap-editor .wz-style-card.ap-rc.is-selected { border-color: var(--ds-accent); background: var(--ds-accent-tint); box-shadow: none; }
.ap-rc input { margin-top: 3px; accent-color: var(--ds-accent); }
.ap-rc b { display: block; font-weight: 600; font-size: 13.5px; color: var(--ds-ink); }
.ap-rc span { font-size: 12.5px; color: var(--ds-ink-2); }

/* Vista previa */
.ap-preview-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-sunk); }
.ap-preview-title { font-size: 13.5px; }
.ap-preview { display: flex; flex-direction: column; gap: 12px; }
#wzPreviewPanel.is-mobile .ap-preview { max-width: 300px; margin: 0 auto; width: 100%; }
.ap-chat { border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--ds-border); box-shadow: 0 12px 32px rgba(24, 24, 27, .10); }
.ap-chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, var(--wz-primary, #2563EB), var(--wz-secondary, #2563EB)); }

.ap-chat-head b { font-size: 14px; }
.ap-chat-head span { font-size: 12px; opacity: .85; }
.ap-chat-avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); flex: none; overflow: hidden; }
.ap-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-chat-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; }
.ap-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.ap-bubble--bot { background: #F3F4F6; color: var(--ds-ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.ap-bubble--user { align-self: flex-end; background: var(--wz-primary, #2563EB); color: #fff; border-bottom-right-radius: 4px; }
.ap-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--wz-primary, #2563EB); background: #fff; color: var(--ds-ink); font-size: 11.5px; font-weight: 600; }
.ap-chat-input { padding: 10px 12px; border-top: 1px solid var(--ds-border); }
.ap-chat-input span { display: flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid var(--ds-border-2); border-radius: 8px; color: #6B7280; font-size: 14px; }

/* Estilos de chat en la vista previa */
.is-chat-compact .ap-chat-body { gap: 6px; padding: 12px; }
.is-chat-compact .ap-bubble { padding: 7px 11px; font-size: 13px; }
.is-chat-framed .ap-bubble--bot { background: #fff; border: 1px solid var(--ds-border); }
.is-chat-spotlight .ap-chat { width: 320px; max-width: 100%; }
.is-chat-spotlight .ap-chat-head { padding: 14px; }
.is-chat-spotlight .ap-chat-head b { font-size: 14px; line-height: 1.4; }

/* Botón flotante */
.ap-launcher-wrap { display: flex; justify-content: flex-end; }
.is-position-bottomleft .ap-launcher-wrap { justify-content: flex-start; }
.is-position-bottomcenter .ap-launcher-wrap { justify-content: center; }
.ap-launcher { display: inline-flex; align-items: center; gap: 8px; height: 56px; min-width: 56px; padding: 0 16px; justify-content: center; border-radius: 999px; background: var(--wz-primary, #2563EB); color: #fff; box-shadow: 0 8px 20px rgba(24, 24, 27, .18); }
.ap-launcher-icon { display: grid; place-items: center; font-size: 22px; width: 24px; height: 24px; overflow: hidden; border-radius: 50%; }
.ap-launcher-icon img { width: 100%; height: 100%; object-fit: cover; }
.ap-launcher-text { display: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ap-launcher.has-label .ap-launcher-text { display: inline; }
.ap-launcher:not(.has-label) { width: 56px; padding: 0; }
.is-button-glass .ap-launcher { background: #fff; color: var(--wz-primary, #2563EB); border: 1px solid var(--ds-border-2); }
.is-button-pulse .ap-launcher { box-shadow: 0 0 0 8px rgba(var(--wz-primary-rgb, 37, 99, 235), .16), 0 8px 20px rgba(24, 24, 27, .18); }
.ap-editor .wz-style-card.ap-rc { flex-direction: row; position: static; }
.ap-editor .wz-style-card.ap-rc::after { display: none; }
.ap-editor .ap-rc .wz-style-radio { position: static; opacity: 1; pointer-events: auto; flex: none; width: 16px; height: 16px; }
.ap-editor .ap-position .wz-position-card { padding: 5px 12px; min-height: 30px; }

/* Segmentos como enlaces, enlaces discretos y filas de lista */
.ds-seg a { border: 0; background: transparent; border-radius: 7px; padding: 5px 12px; font-size: 13px; color: var(--ds-ink-2); min-height: 30px; display: inline-flex; align-items: center; text-decoration: none; }
.ds-seg a:hover { color: var(--ds-ink); }
.ds-seg a.is-active { background: var(--ds-ink); color: #fff; font-weight: 600; }
.ds-link-quiet { font-size: 13px; font-weight: 500; color: var(--ds-ink-2); text-decoration: none; }
.ds-link-quiet:hover { color: var(--ds-ink); text-decoration: underline; }
.ds-rows { display: flex; flex-direction: column; }
.ds-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--ds-border); color: var(--ds-ink); text-decoration: none; background: transparent; }
.ds-row:first-child { border-top: 0; }
.ds-row:hover { background: var(--ds-sunk); color: var(--ds-ink); }
.ds-row-avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--ds-accent-tint); color: var(--ds-accent-ink); font-weight: 600; font-size: 12px; }
.ds-row-title { font-size: 14px; font-weight: 500; }
.ds-row-meta { font-size: 12.5px; color: var(--ds-ink-3); }
.ds-dot-badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: middle; }

/* Menú lateral más compacto, como el diseño: todo cabe sin desplazar */
.sidebar .bot-switcher-container { padding: 4px 0 0; margin-bottom: 4px; } /* mismo ancho que los ítems del menú */
.sidebar .ds-ctx .ds-sb-label { padding: 8px 10px 6px; }
.sidebar .bot-switcher-btn { align-items: center !important; white-space: normal; }
.sidebar .bot-switcher-btn small { white-space: normal; line-height: 1.35; margin-top: 2px; }
.sidebar .bot-switcher-btn .bi-chevron-down { margin-top: 0; }
.ds-sb-group { margin-top: 6px; gap: 0; }
.sidebar .nav-link { padding: 6px 10px; min-height: 32px; font-weight: 400; font-size: 13.5px; }
.sidebar .nav-link.active { font-weight: 600; }
.sidebar-menu { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar-menu:hover { scrollbar-color: var(--ds-border-2) transparent; }
.sidebar-menu::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: transparent; border: 0; }
.sidebar-menu:hover::-webkit-scrollbar-thumb { background: var(--ds-border-2); }

/* Tablas como en el diseño: barra de filtros dentro de la tarjeta y selector de cantidad visible */
.dataTables_wrapper .dataTables_length { display: block; margin-bottom: 12px; }
.ds-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ds-border); }
.ds-table-toolbar .ds-search { flex: 0 1 320px; }
.ds-table-toolbar .ds-bulk { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ds-table-toolbar .ds-bulk[hidden] { display: none; }
.ds-search { position: relative; display: block; margin: 0; }
.ds-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ds-ink-3); font-size: 13px; pointer-events: none; }
.ds-search input { width: 100%; min-height: 38px; padding: 8px 12px 8px 34px; border: 1px solid var(--ds-border-2); border-radius: 8px; font: inherit; font-size: 14px; background: var(--ds-panel); color: var(--ds-ink); }
.ds-search input::placeholder { color: #6B7280; }
.ds-search input:focus { outline: 0; border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(244, 86, 29, .2); }
.card:has(> .ds-table-toolbar) .dataTables_filter { display: none; }
.card:has(> .ds-table-toolbar) .dataTables_wrapper .row:first-child { padding: 12px 16px 0; }
.card .dataTables_wrapper .dataTables_info, .card .dataTables_wrapper .dataTables_paginate { padding: 12px 16px; }
.ds-page-cell { color: var(--ds-accent-ink); font-size: 12.5px; }

/* Enlace de regreso sobre el título */
.ds-back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 13.5px; color: var(--ds-accent-ink); text-decoration: none; }
.ds-back-link:hover { text-decoration: underline; }
.ds-back-link + .app-page-header { margin-top: 0; }

/* Transcripción de la conversación */
.ds-transcript { display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-sunk); }
.ds-transcript-pill { align-self: center; padding: 3px 8px; border-radius: 6px; background: #F3F4F6; color: var(--ds-ink-2); font-size: 11.5px; font-weight: 600; }
.ds-msg { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.ds-msg--user { align-self: flex-end; align-items: flex-end; }
.ds-msg--bot { align-self: flex-start; align-items: flex-start; }
.ds-msg-bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.ds-msg--user .ds-msg-bubble { background: var(--ds-ink); color: #fff; }
.ds-msg--bot .ds-msg-bubble { background: var(--ds-panel); color: var(--ds-ink); border: 1px solid var(--ds-border); }
/* Enlaces del bot: heredan el color de la burbuja (clara u oscura) y se marcan con subrayado */
.ds-msg-bubble a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
/* Cita de la fuente: discreta, el detalle completo sale al pasar el mouse */
.ds-msg-bubble .bot-source { display: inline-block; font-size: 11px; font-weight: 500; line-height: 1.4; padding: 0 6px; border-radius: 999px; border: 1px solid currentColor; opacity: .6; text-decoration: none; vertical-align: 1px; cursor: help; }
.ds-msg-bubble a.bot-source { cursor: pointer; }
.ds-msg-bubble .bot-source:hover { opacity: 1; }
.ds-msg-meta { font-size: 12px; color: var(--ds-ink-3); }
.ds-kv--left { grid-template-columns: minmax(80px, auto) 1fr; }
.ds-kv--left dd { text-align: left; font-weight: 400; }

/* Franja de métricas unida (Analítica) y barra de conversión */
.ds-stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); overflow: hidden; }
.ds-stat-strip .ds-stat { border: 0; border-radius: 0; border-left: 1px solid var(--ds-border); margin-left: -1px; }
.ds-bar { height: 6px; border-radius: 999px; background: #E5E7EB; overflow: hidden; }
.ds-bar span { display: block; height: 100%; background: var(--ds-accent); border-radius: inherit; }

/* Configuración: tarjeta punteada, tarjeta hundida y accesos rápidos */
.ds-card-dashed { border-style: dashed !important; }
.ds-card-sunk { background: var(--ds-sunk) !important; }
.ds-badge-accent { background: var(--ds-accent-tint) !important; color: var(--ds-accent-ink) !important; font-weight: 600; font-size: 11.5px; }
.ds-quick-links { display: flex; flex-direction: column; }
.ds-quick-links a { padding: 10px 12px; border-radius: 8px; color: var(--ds-ink-2); text-decoration: none; font-size: 14px; }
.ds-quick-links a:hover { background: var(--ds-hover); color: var(--ds-ink); }
.sites-edit-form .ds-split { margin-bottom: 0; }
.context-main-tabs .nav-link .badge, .context-main-tabs .nav-link.active .badge, .nav-tabs .nav-link.active .badge { background: #F3F4F6 !important; color: var(--ds-ink-2) !important; border: 0 !important; }

/* Fragmentos de una fuente */
.ds-chunk { border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); }
.ds-chunk-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.ds-chunk.is-open .ds-chunk-head { border-bottom: 1px solid var(--ds-border); }
.ds-chunk-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0; font: inherit; color: var(--ds-ink); cursor: pointer; text-align: left; }
.ds-chunk-body { display: none; padding: 16px 20px; }
.ds-chunk.is-open .ds-chunk-body { display: block; }
.ds-chunk-text { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.6; color: var(--ds-ink); background: transparent; }

/* Editor de texto a lo ancho de la tarjeta */
.ds-editor { display: block; width: 100%; min-height: 480px; padding: 20px; border: 0; border-radius: 0 0 12px 12px; resize: vertical; font: inherit; font-size: 14.5px; line-height: 1.6; color: var(--ds-ink); background: var(--ds-panel); }
.ds-editor:focus { outline: 2px solid var(--ds-accent-tint); }
.ds-editor[readonly] { background: var(--ds-sunk); color: var(--ds-ink-2); }
.ds-card-danger { border-color: #F3C5C0 !important; }
.ds-narrow-center { max-width: 816px; margin: 0 auto; }

/* Segmento con radios (formularios) */
.ds-seg input[type=radio] + label { border-radius: 7px; padding: 5px 12px; font-size: 13px; color: var(--ds-ink-2); min-height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; }
.ds-seg input[type=radio]:checked + label { background: var(--ds-ink); color: #fff; font-weight: 600; }
.ds-seg input[type=radio]:focus-visible + label { outline: 2px solid var(--ds-accent); }
.ds-seg--block { display: flex; }
.ds-seg--block > label { flex: 1; }

/* Popup de salida: pestañas subrayadas y cada pestaña como tarjeta */
.ep-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ds-border); margin-bottom: 20px; background: transparent !important; padding: 0 !important; border-radius: 0 !important; }
.ep-tabs .ep-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0 !important; background: transparent !important; padding: 10px 12px; font-size: 14px; color: var(--ds-ink-2); box-shadow: none !important; }
.ep-tabs .ep-tab.is-active { color: var(--ds-accent-ink) !important; border-bottom-color: var(--ds-accent); font-weight: 600; }
.ep-tab-panel.is-active { border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); padding: 20px; }
.ep-tab-panel .ep-section-head h2 { font-size: 15px; font-weight: 600; }
.ep-tab-panel .ep-divider { margin: 20px -20px; border-color: var(--ds-border); opacity: 1; }
.ep-left { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.ep-metrics--side { margin-top: 16px; }
.ep-save-footer { display: none; }
.ep-save-footer { display: none !important; }
/* La vista previa siempre muestra el popup; atenuado mientras está desactivado */
.ep-browser-body .wz-exit-preview:not(.is-traffic-canvas):not([hidden]) { display: grid !important; margin-top: 1.2rem; }
.ds-big-number { font-size: 30px; font-weight: 600; letter-spacing: -.01em; color: var(--ds-ink); margin-right: 6px; }
.ds-bar--lg { height: 10px; }
.ds-check-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ds-check-list li { position: relative; padding-left: 24px; }
.ds-check-list li::before { content: "\2713"; position: absolute; left: 4px; color: var(--ds-ok); font-weight: 700; }

/* Paquetes de mensajes */
.ds-narrow-center--wide { max-width: 1016px; }
.ds-pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.ds-pack { display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); cursor: pointer; margin: 0; }
.ds-pack:hover { border-color: var(--ds-border-2); }
.ds-pack.is-selected { border: 2px solid var(--ds-accent); background: var(--ds-accent-tint); padding: 19px; }
.ds-pack:has(input:focus-visible) { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-pack-amount { font-size: 26px; font-weight: 600; margin-top: 6px; }
.ds-pack-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ds-border); }

/* Planes a todo el ancho como el diseño */
.billing-container { max-width: none !important; padding: 0 !important; }
.plans-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important; gap: 16px !important; }
.plan-card { border: 1px solid var(--ds-border) !important; border-radius: 12px !important; box-shadow: none !important; padding: 24px !important; }
.plan-card--current { border: 2px solid var(--ds-ink) !important; padding: 23px !important; }
.plan-card .plan-badge { position: absolute; top: 24px; right: 24px; font-size: 11.5px; font-weight: 600; }
.plan-card .plan-cta { font-weight: 500; }
.plan-card .plan-cta:disabled { opacity: 1; color: var(--ds-ink-3); }

/* Ajustes con título a la izquierda (Perfil) */
.ds-profile-avatar { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--ds-accent-tint); color: var(--ds-accent-ink); font-weight: 600; font-size: 18px; }
.ds-settings { display: flex; flex-direction: column; }
.ds-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 32px; padding: 24px 0; border-top: 1px solid var(--ds-border); }
.ds-settings-head h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.ds-settings-head p { font-size: 13px; color: var(--ds-ink-3); margin: 0; }
.ds-settings-card .card-footer { background: var(--ds-sunk); border-top: 1px solid var(--ds-border); }
.ds-input-readonly[readonly] { background: var(--ds-sunk); color: var(--ds-ink-2); }
.ds-seg button[type=submit] { border: 0; }
@media (max-width: 860px) { .ds-settings-row { grid-template-columns: 1fr; gap: 12px; } }

/* Ayuda según el diseño */
.faq-hero { border: 0 !important; background: transparent !important; padding: 16px 0 8px !important; }
.faq-hero h1 { font-size: 28px; font-weight: 600; margin: 0; }
.faq-cats, .faq-shell { max-width: 976px; margin-left: auto; margin-right: auto; }
.faq-cats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important; }
.faq-cat { text-align: left; font: inherit; cursor: pointer; }
.faq-cat b { font-size: 14px; }
.faq-cat span { font-size: 13px; color: var(--ds-ink-3); }
.faq-cat.is-active { border: 2px solid var(--ds-ink); padding: 13px 15px; }
.faq-card { overflow: hidden; }
.faq-card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--ds-border); }
.faq-card .accordion { margin: 0 !important; }
.faq-card .accordion-item { border: 0 !important; border-top: 1px solid var(--ds-border) !important; border-radius: 0 !important; margin: 0 !important; }
.faq-card .accordion-item:first-child { border-top: 0 !important; }
.faq-card .accordion-button { font-weight: 400 !important; background: transparent !important; box-shadow: none !important; padding: 16px 20px; }
.faq-card .accordion-button::after { background-image: none; content: "+"; font-size: 18px; line-height: 1; width: auto; height: auto; transform: none !important; }
.faq-card .accordion-button:not(.collapsed)::after { content: "\2212"; }
.card:has(> .ap-ch) .dataTables_filter { display: none; }
.card:has(> .ap-ch) .dataTables_wrapper .row:first-child { display: none; }
.faq-card .accordion-item, .faq-card .accordion-button { background: var(--ds-panel) !important; color: var(--ds-ink) !important; }
.faq-footnote-callout, .faq-footnote-callout .faq-footnote-text, .faq-footnote-callout .faq-footnote-icon { color: var(--ds-ink-2) !important; }
.ds-bar--ink span { background: var(--ds-ink); }
.ds-bar--danger span { background: var(--ds-err); }
.ds-company-logo { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--ds-accent); color: #fff; font-weight: 700; font-size: 18px; }

/* Tarjetas de opción (radio) reutilizables */
.ap-rc { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--ds-border); border-radius: 10px; cursor: pointer; background: var(--ds-panel); margin: 0; }
.ap-rc:hover { border-color: var(--ds-border-2); }
.ap-rc.is-selected { border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.ap-rc span { font-size: 12.5px; color: var(--ds-ink-2); }
.ap-rc .form-switch { padding-left: 2.5em; }
.ds-plan-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.card-footer { background: var(--ds-sunk); border-top: 1px solid var(--ds-border); }
.ds-row-avatar--danger { background: var(--ds-err-tint); color: var(--ds-err); }

/* Configuración del sistema: planes lado a lado como el diseño */
#form-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
#form-plans > hr { display: none; }
#form-plans > .row { margin: 0 !important; padding: 16px; border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-sunk); --bs-gutter-x: 0; row-gap: 12px; }
#form-plans > .row > [class*="col-"] { width: 100%; flex: 0 0 100%; max-width: 100%; }
#form-plans > .row h5 { font-size: 14px; color: var(--ds-ink) !important; }
#form-plans > .row h5 i { display: none; }
#form-plans > .row > .col-12 > p { display: none; }
#form-plans > .sysconfig-actions { grid-column: 1 / -1; margin-top: 0 !important; }
.sysconfig-card .card-header .badge { font-weight: 600; }
.sysconfig-card .card-header > i { display: none; }
.sysconfig-actions .btn-lg { font-size: 14px; padding: 8px 16px; }

.ap-ch h2::first-letter, .card-header::first-letter { text-transform: uppercase; }
.ai-copilot-container { background: var(--ds-panel) !important; border: 1px solid var(--ds-border) !important; box-shadow: none !important; }
.ai-copilot-badge { background: var(--ds-accent-tint) !important; color: var(--ds-accent-ink) !important; box-shadow: none !important; }

/* Navegación de tablas largas: filas por página al pie, columna de acciones fija y orden visible */
.dataTables_wrapper .dataTables_length.ds-length-foot { display: inline-flex !important; align-items: center; margin: 0 0 0 16px; padding: 10px 0; font-size: 13px; color: var(--ds-ink-3); }
.dataTables_length.ds-length-foot label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.dataTables_length.ds-length-foot select { width: auto; min-width: 72px; }
.dataTables_wrapper .dataTables_info { display: inline-block; }
.ds-toolbar-select { width: auto; min-width: 160px; }
.ds-contact-cell { max-width: 240px; }
.ds-sticky-col { position: sticky; right: 0; background: var(--ds-panel); box-shadow: -8px 0 8px -8px rgba(24, 24, 27, .12); z-index: 1; }
thead .ds-sticky-col { background: var(--ds-panel); }
table.dataTable thead th.sorting, table.dataTable thead th.sorting_asc, table.dataTable thead th.sorting_desc { cursor: pointer; }
table.dataTable thead th.sorting_asc, table.dataTable thead th.sorting_desc { color: var(--ds-ink); }
.ds-qual-badge { max-width: 210px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
#sessionsTable td:nth-child(2) { white-space: nowrap; }

/* Vista previa de Apariencia: mismos 4 estilos de chat y 4 de botón que el widget */
.ap-chat-head > .d-flex > span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22C55E; margin-right: 5px; vertical-align: middle; }
.ap-chat-foot { text-align: center; font-size: 11px; color: #6B7280; padding: 0 12px 10px; }
.ap-chat-input { border-top: 0 !important; }
.ap-bubble--bot { border-bottom-left-radius: 4px; }
.ap-bubble--user { border-bottom-right-radius: 4px; }

/* Compacto */
.is-chat-compact .ap-chat-head { background: #FFFFFF !important; color: var(--ds-ink); border-bottom: 1px solid var(--ds-border); padding: 10px 14px; }
.is-chat-compact .ap-chat-head > .d-flex > span { color: #1E7A3D; opacity: 1; }
.is-chat-compact .ap-chat-avatar { background: var(--wz-primary, #2563EB); color: #FFFFFF; width: 26px; height: 26px; border-radius: 50%; }
.is-chat-compact .ap-chat-body { gap: 6px; padding: 12px; min-height: 200px; }
.is-chat-compact .ap-bubble { padding: 7px 11px; font-size: 13px; border-radius: 12px; }
.is-chat-compact .ap-chat-input { border-top: 1px solid var(--ds-border) !important; }

/* Tarjeta */
.is-chat-framed .ap-chat { background: color-mix(in srgb, var(--wz-primary, #2563EB) 6%, white); }
.is-chat-framed .ap-chat-avatar { background: #FFFFFF; color: var(--wz-primary, #2563EB); }
.is-chat-framed .ap-bubble--bot { background: #FFFFFF; border: 1px solid var(--ds-border); border-radius: 14px; }
.is-chat-framed .ap-bubble--user { border-radius: 999px; padding: 10px 16px; }
.is-chat-framed .ap-chat-input span { background: #FFFFFF; }

/* Inmersivo */
.is-chat-spotlight .ap-chat-head > .d-flex { min-width: 0; overflow-wrap: anywhere; }
.is-chat-spotlight .ap-chat-head span { font-size: 11px; line-height: 1.4; }
.is-chat-spotlight .ap-chat-avatar { width: 32px; height: 32px; border-radius: 50%; }
.is-chat-spotlight .ap-chat-head > .d-flex > span::before { display: none; }
.is-chat-spotlight .ap-chip {
    max-width: 100%; box-sizing: border-box; white-space: normal; overflow-wrap: anywhere;
    height: auto; min-height: 28px; padding: 5px 10px; border-radius: 999px;
    color: var(--wz-primary, #2563EB); font-size: 13px; font-weight: 500;
}

/* Botón flotante */
.ap-launcher { position: relative; }
.is-button-soft .ap-launcher-text { display: inline; }
.is-button-glass .ap-launcher { background: #FFFFFF; color: var(--ds-ink); border: 1px solid var(--ds-border-2); }
.is-button-glass .ap-launcher-icon { background: var(--wz-primary, #2563EB); color: #FFFFFF; width: 30px; height: 30px; font-size: 15px; }
.is-button-glass .ap-launcher:not(.has-label) { background: var(--wz-primary, #2563EB); border: 0; }
.is-button-glass .ap-launcher:not(.has-label) .ap-launcher-icon { background: transparent; }
.is-button-pulse .ap-launcher::after { content: "1"; position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #DC2626; color: #FFFFFF; border: 2px solid #FFFFFF; font: 700 10px/14px Inter, sans-serif; text-align: center; box-sizing: border-box; }

/* Encabezados de módulo: fondo propio para separarlos del contenido y del fondo de la página */
.card-header, .card > .ap-ch {
    background: #F3F4F6;
    border-bottom: 1px solid #DEE3EA;
    border-top-left-radius: calc(var(--ds-radius-card) - 1px);
    border-top-right-radius: calc(var(--ds-radius-card) - 1px);
}

/* Espacio actual (plataforma / empresa / asistente) en la barra superior */
.ds-topbar { border-top: 3px solid transparent; }
.ds-topbar.ds-space-platform,
.ds-topbar.ds-space-assistant { border-top-color: var(--ds-accent); }
/* En la vista de empresa no lleva franja: queda pegada a la barra oscura
   "Estás viendo X como administrador" y le compite el único aviso que importa. */
.ds-space-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 10px; margin-right: 6px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ds-space-platform .ds-space-pill { background: #1F2937; color: #FFFFFF; }
.ds-space-company .ds-space-pill { background: var(--ds-accent-tint); color: var(--ds-accent-ink); }
.ds-space-assistant .ds-space-pill { background: var(--ds-accent-tint); color: var(--ds-accent-ink); }

/* SuperAdmin dentro de una empresa: aviso con salida a plataforma */
.ds-company-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
    margin: -1.75rem -2rem 0; padding: 8px 20px;
    background: #1F2937; color: #FFFFFF;
    font-size: 13px; font-weight: 500;
}
.ds-company-banner-text { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
/* Dentro de un asistente el aviso baja de tono: nota en naranja sobre el mismo blanco
   del panel. Sin fondo tintado — la franja de color hacía ruido y el texto naranja
   junto a la línea de la barra superior ya alcanzan para que se note. */
.ds-company-banner--note { background: var(--ds-panel); color: var(--ds-accent-ink); border-bottom: 1px solid var(--ds-border); }
.ds-company-banner--note .ds-company-banner-exit { background: var(--ds-panel); border-color: var(--ds-border-2); color: var(--ds-ink); }
.ds-company-banner--note .ds-company-banner-exit:hover,
.ds-company-banner--note .ds-company-banner-exit:focus-visible { background: var(--ds-accent); border-color: var(--ds-accent); color: #FFFFFF; }
.ds-company-banner-exit { background: #FFFFFF; border-color: #FFFFFF; color: var(--ds-ink); font-weight: 600; white-space: nowrap; }
.ds-company-banner-exit:hover, .ds-company-banner-exit:focus-visible { background: var(--ds-accent-tint); border-color: var(--ds-accent-tint); color: var(--ds-accent-ink); }
.ds-company-banner + .ds-topbar { margin-top: 0; border-radius: 0; }
@media (max-width: 991.98px) {
    .ds-company-banner { margin: -1.25rem -1rem 0; padding: 8px 14px; }
}

/* Filas cliqueables */
tr[data-row-href] { cursor: pointer; }
tr[data-row-href] > td { transition: background-color .12s ease; }
tr[data-row-href]:hover > td { background-color: var(--ds-row-hover) !important; }

/* Botones secundarios: negros con texto blanco y hover naranja, para que se distingan del fondo blanco */
.btn-outline-secondary,
.btn-outline-dark,
.btn-light,
.btn-secondary,
.btn-cancel,
.app-body-surface .card .btn-primary:not([type="submit"]):not(.btn-save),
.app-body-surface .card .btn-brand:not([type="submit"]):not(.btn-save),
.app-body-surface .wz-card .btn-primary:not([type="submit"]):not(.btn-save),
.app-body-surface .btn-sm.btn-primary:not([type="submit"]) {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: var(--ds-ink);
    --bs-btn-border-color: var(--ds-ink);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: var(--ds-accent);
    --bs-btn-hover-border-color: var(--ds-accent);
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: var(--ds-accent-hover);
    --bs-btn-active-border-color: var(--ds-accent-hover);
    --bs-btn-disabled-color: #FFFFFF;
    --bs-btn-disabled-bg: var(--ds-ink);
    --bs-btn-disabled-border-color: var(--ds-ink);
    background-color: var(--ds-ink) !important;
    border-color: var(--ds-ink) !important;
    color: #FFFFFF !important;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus-visible, .btn-outline-secondary.active, .btn-outline-secondary.show,
.btn-outline-dark:hover, .btn-outline-dark:focus-visible,
.btn-light:hover, .btn-light:focus-visible,
.btn-secondary:hover, .btn-secondary:focus-visible,
.btn-cancel:hover, .btn-cancel:focus-visible,
.app-body-surface .card .btn-primary:not([type="submit"]):not(.btn-save):hover,
.app-body-surface .card .btn-brand:not([type="submit"]):not(.btn-save):hover,
.app-body-surface .wz-card .btn-primary:not([type="submit"]):not(.btn-save):hover,
.app-body-surface .btn-sm.btn-primary:not([type="submit"]):hover {
    background-color: var(--ds-accent) !important;
    border-color: var(--ds-accent) !important;
    color: #FFFFFF !important;
}
.btn-outline-secondary i, .btn-outline-dark i, .btn-light i, .btn-secondary i, .btn-cancel i { color: inherit !important; }

/* Botón de alta dentro de un módulo: se mantiene naranja aunque esté dentro de una tarjeta */
.app-body-surface .btn.ds-btn-accent,
.btn.ds-btn-accent {
    background-color: var(--ds-accent) !important;
    border-color: var(--ds-accent) !important;
    color: #FFFFFF !important;
}
.btn.ds-btn-accent:hover, .btn.ds-btn-accent:focus-visible {
    background-color: var(--ds-accent-hover) !important;
    border-color: var(--ds-accent-hover) !important;
}

.site-edit-explainer-note { font-size: 13px; color: var(--ds-ink-3); margin: 0 0 18px; }
.site-edit-explainer-note b, .site-edit-explainer-note a { font-weight: 600; }
.site-edit-explainer-note b { color: var(--ds-ink); }

/* La barra superior queda por encima de encabezados fijos de página (p. ej. "Guardar cambios"), para que sus menús (idioma, usuario) no queden tapados */
.ds-topbar { position: relative; z-index: 1035; }

/* Editor de reglas en lista (rule-list.js) */
.ds-rules { border: 1px solid var(--ds-border); border-radius: 10px; background: var(--ds-panel); }
.ds-rules.is-invalid { border-color: var(--ds-err, #DC2626); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.ds-rules-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid var(--ds-border); background: var(--ds-sunk);
    border-radius: 10px 10px 0 0;
}
.ds-rules-toolbar[hidden] { display: none; }
.ds-rules-search { position: relative; flex: 1 1 200px; min-width: 160px; max-width: 320px; margin: 0; }
.ds-rules-search[hidden] { display: none; }
.ds-rules-search .bi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ds-ink-3); font-size: 13px; }
.ds-rules-search-input { width: 100%; height: 32px; padding: 4px 10px 4px 30px; border: 1px solid var(--ds-border-2); border-radius: 8px; background: #FFFFFF; font-size: 13px; }
.ds-rules-search-input:focus { outline: none; border-color: var(--ds-ink-3); }
.ds-rules-filter { width: auto; max-width: 240px; height: 32px; font-size: 13px; }
.ds-rules-filter[hidden] { display: none; }
.ds-rules-toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.ds-rules-list { display: flex; flex-direction: column; }
.ds-rules-list:empty { display: none; }
.ds-rule { display: flex; align-items: flex-start; gap: 6px; padding: 6px 10px 6px 4px; border-bottom: 1px solid var(--ds-border); background: var(--ds-panel); }
.ds-rule[hidden] { display: none; }
.ds-rule:hover { background: var(--ds-sunk); }
.ds-rule-handle {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 30px; border-radius: 6px; color: var(--ds-ink-3); opacity: 0; transition: opacity .12s ease;
}
.ds-rule-handle, .ds-rule-handle * { cursor: grab !important; }
.ds-rule-handle:hover { color: var(--ds-ink); background: var(--ds-hover); }
.ds-rule-handle:active, .ds-rule-handle:active * { cursor: grabbing !important; }
.ds-rule:hover .ds-rule-handle, .ds-rule:focus-within .ds-rule-handle { opacity: 1; }
.ds-rule-dot { flex-shrink: 0; width: 6px; height: 6px; margin: 13px 4px 0 2px; border-radius: 50%; background: var(--ds-accent); }
.ds-rule-text {
    flex: 1 1 auto; min-width: 0; resize: none; overflow: hidden;
    border: 1px solid transparent; border-radius: 6px; background: transparent;
    padding: 4px 8px; font-size: 14px; line-height: 1.45; color: var(--ds-ink);
}
.ds-rule-text:focus { outline: none; border-color: var(--ds-border-2); background: #FFFFFF; }
.ds-rule-icon {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--ds-ink-3);
    opacity: 0; transition: opacity .12s ease;
}
.ds-rule-icon:hover { color: var(--ds-ink); background: var(--ds-hover); }
.ds-rule-del:hover { color: var(--ds-err, #DC2626); }
.ds-rule:hover .ds-rule-icon, .ds-rule:focus-within .ds-rule-icon, .ds-rule .show > .ds-rule-icon { opacity: 1; }
.ds-rule-move { flex-shrink: 0; }
.ds-rule-move .dropdown-menu { max-height: 320px; overflow-y: auto; font-size: 13px; }
.ds-rule-move .dropdown-item.active { background: var(--ds-accent-tint); color: var(--ds-accent-ink); }
@media (hover: none) { .ds-rule-handle, .ds-rule-icon { opacity: .7; } }

.ds-rule--section { background: #F3F4F6; padding-top: 8px; }
.ds-rule--section:hover { background: #E5E7EB; }
.ds-rule--section .ds-rule-text { font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ds-ink-2, var(--ds-ink)); }
.ds-rule--section .ds-rule-text::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ds-ink-3); }
.ds-rule--section .ds-rule-insert { opacity: 1; }
.ds-rule-toggle {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--ds-ink-3);
}
.ds-rule-toggle:hover { color: var(--ds-ink); background: rgba(24, 24, 27, .06); }
.ds-rule-toggle .bi { transition: transform .15s ease; }
.ds-rule--section.is-collapsed .ds-rule-toggle .bi { transform: rotate(-90deg); }
.ds-rule-badge {
    flex-shrink: 0; align-self: center; min-width: 22px; padding: 1px 7px; border-radius: 999px;
    background: #FFFFFF; border: 1px solid #DEE3EA; font-size: 11.5px; font-weight: 600; color: var(--ds-ink-3); text-align: center;
}
.ds-rules-empty { padding: 16px 12px; font-size: 13px; color: var(--ds-ink-3); text-align: center; border-bottom: 1px solid var(--ds-border); }
.ds-rules-empty[hidden] { display: none; }
.ds-rules-add { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--ds-ink-3); }
.ds-rules-add[hidden] { display: none; }
.ds-rules-add-input { flex: 1 1 auto; border: 0; background: transparent; font-size: 14px; padding: 4px 0; color: var(--ds-ink); }
.ds-rules-add-input:focus { outline: none; }
.ds-rules-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--ds-border); background: var(--ds-sunk); font-size: 12.5px; color: var(--ds-ink-3); border-radius: 0 0 10px 10px; }
.ds-rules-link { border: 0; background: transparent; padding: 0; font-size: 12.5px; font-weight: 500; color: var(--ds-ink-2, var(--ds-ink)); }
.ds-rules-link:hover { color: var(--ds-accent-hover); }
.ds-rules-source:not([hidden]) { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--ds-border); border-radius: 0; min-height: 160px; padding: 12px; font-size: 14px; }
.ds-rules .sortable-ghost { opacity: .4; }

/* Contador del tab activo: naranja con texto blanco */
.context-main-tabs .nav-link.active .badge,
.nav-tabs .nav-link.active .badge { background: var(--ds-accent) !important; color: #FFFFFF !important; }

/* Fragmentos de conocimiento: datos de la fuente (cabecera del sistema) aparte del contenido */
.ds-chunk-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0 0 8px; font-size: 12.5px; }
.ds-chunk-meta dt { font-weight: 500; color: var(--ds-ink-3); }
.ds-chunk-meta dd { margin: 0; color: var(--ds-ink); overflow-wrap: anywhere; }
.ds-chunk-source { padding: 12px 14px; border: 1px solid #DEE3EA; border-radius: 10px; background: #F3F4F6; }
.ds-chunk-source-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ds-ink-3); margin-bottom: 8px; }

/* Explicación de la pestaña "Lo que aprendió el asistente" */
.ds-insp-intro { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: #EAF1FF; color: #1E3A8A; font-size: 14px; line-height: 1.5; }
.ds-insp-intro .bi { font-size: 18px; margin-top: 1px; }

/* Encabezados de tarjeta con bg-white (Bootstrap) también llevan el fondo de módulo */
.card-header.bg-white { background-color: #F3F4F6 !important; }

/* Pestañas activas: fondo suave de acento, como la etiqueta de espacio "Asistente" */
.ds-tabs-bar button.is-active, .ds-tabs-bar a.is-active,
.nav-tabs .nav-link.active, .app-navtab.is-active, .ds-section-nav a.is-active,
.context-main-tabs .nav-link.active {
    background: var(--ds-accent-tint) !important;
    color: var(--ds-accent-ink) !important;
    border-radius: 8px 8px 0 0;
}

/* Submenú de apartados de la pestaña activa (redesign.js) */
.ds-tab-subnav { margin-bottom: 0; }
.ds-tab-subnav {
    position: sticky; top: 8px; z-index: 20;
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    margin: 0 0 8px; padding: 8px 10px;
    background: #F3F4F6; border: 1px solid #DEE3EA; border-radius: 12px;
    transition: box-shadow .15s ease;
}
/* Al quedar fijo arriba, sombra para separarlo del contenido que pasa por debajo */
.ds-tab-subnav.is-stuck { box-shadow: 0 6px 18px rgba(24, 24, 27, .12); border-color: #CFD6DF; }
.ds-tab-subnav[hidden] { display: none; }
.ds-tab-subnav a {
    display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--ds-border-2); background: #FFFFFF;
    font-size: 13px; font-weight: 500; color: var(--ds-ink-2, var(--ds-ink)); text-decoration: none; white-space: nowrap;
}
.ds-tab-subnav a:hover { border-color: var(--ds-ink-3); color: var(--ds-ink); }
.ds-tab-subnav a.is-active { background: var(--ds-accent-tint); border-color: #F9C3AE; color: var(--ds-accent-ink); }
[data-ds-tab] .card, [data-ds-section] { scroll-margin-top: 110px; }

/* Títulos de módulo sin íconos decorativos (como el diseño); los íconos de botones y enlaces del encabezado se mantienen */
.card-header i.bi:not(.btn *):not(button *):not(a *):not(.badge *),
.ap-ch h2 > i.bi,
[data-ds-section] > .d-flex > .form-label > i.bi,
[data-ds-tab="goals"] .card-header i.bi { display: none !important; }

/* Botón flotante "Volver arriba" */
/* Acciones flotantes (Guardar + Volver arriba) */
.ds-float-actions { position: fixed; right: 24px; bottom: 24px; z-index: 1030; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.ds-float-save {
    height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600;
    box-shadow: 0 8px 20px rgba(244, 86, 29, .30);
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.ds-float-save.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.ds-float-save:not(.is-visible) { visibility: hidden; }
.ds-to-top {
    display: inline-flex; align-items: center; gap: 6px;
    height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
    background: var(--ds-ink); color: #FFFFFF; font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 20px rgba(24, 24, 27, .22);
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease, background-color .15s ease;
}
.ds-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.ds-to-top:hover { background: var(--ds-accent); }
@media (max-width: 575.98px) { .ds-to-top span { display: none; } .ds-to-top { width: 40px; padding: 0; justify-content: center; } }
.ds-to-top:not(.is-visible) { display: none; }

/* Ayudante flotante de la home ("Saca más de tu asistente"): una píldora fija que despliega la
   lista de pasos hacia arriba. Tiene su propio lugar, arriba del de "Volver arriba" (40px de
   alto + 8px de separación sobre los 24px del borde): si compartiera fila con ese botón, que
   aparece y desaparece al hacer scroll, el ayudante saltaría de lado. */
.ds-helper { position: fixed; right: 24px; bottom: 72px; z-index: 1030; }
/* Botón redondo chico y claro (solo ícono y contador): el ayudante acompaña sin competir con
   "Volver arriba", que es oscuro. El título queda para lectores de pantalla. */
.ds-helper > summary {
    position: relative; display: grid; place-items: center; list-style: none; cursor: pointer;
    width: 40px; height: 40px; border-radius: 50%;
    background: #FFFFFF; color: var(--ds-ink); border: 1px solid var(--ds-border-2);
    box-shadow: 0 4px 12px rgba(24, 24, 27, .12); transition: border-color .15s ease, color .15s ease;
}
.ds-helper > summary::-webkit-details-marker { display: none; }
.ds-helper > summary:hover, .ds-helper[open] > summary { border-color: var(--ds-accent); color: var(--ds-accent); }
.ds-helper > summary:focus-visible { outline: 3px solid rgba(244, 86, 29, .35); outline-offset: 2px; }
.ds-helper-count {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 999px;
    background: var(--ds-accent); color: #FFFFFF; font-size: 10.5px; font-weight: 700; line-height: 1;
}
.ds-helper-panel {
    position: absolute; right: 0; bottom: calc(100% + 10px);
    width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
    /* Tiene que despegarse del fondo blanco de la página: borde oscuro y sombra marcada */
    /* !important porque las tarjetas del admin anulan toda sombra (.card, box-shadow: none !important) */
    border: 1px solid var(--ds-ink) !important;
    box-shadow: 0 24px 56px rgba(17, 24, 39, .32), 0 2px 6px rgba(17, 24, 39, .12) !important;
}
/* Encabezado negro con texto blanco, como la cabecera de la home, para el contraste */
.ds-helper-panel > .ds-helper-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--ds-ink) !important; color: #FFFFFF; border-bottom: 0;
}
.ds-helper-sub { font-size: 12.5px; font-weight: 400; color: #D1D5DB; }
.ds-helper-close {
    flex: none; display: grid; place-items: center; width: 32px; height: 32px;
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px;
    background: transparent; color: #FFFFFF; cursor: pointer;
}
.ds-helper-close:hover, .ds-helper-close:focus-visible { background: var(--ds-accent); border-color: var(--ds-accent); outline: none; }

/* Temperatura con un modelo que no la admite: visible pero bloqueada, con nota */
#temperatureFieldGroup.is-unsupported .form-range,
#temperatureFieldGroup.is-unsupported .site-edit-temperature-scale,
#temperatureFieldGroup.is-unsupported output { opacity: .4; }
#temperatureFieldGroup.is-unsupported .form-range { cursor: not-allowed; }
.site-edit-temperature-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #EAF1FF; color: #1E3A8A; font-size: 13px; line-height: 1.45; }
.site-edit-temperature-note[hidden] { display: none; }

/* Menú lateral: línea separadora entre secciones (Resultados, Configurar, Captar más leads, Mi cuenta…) */
.sidebar .sidebar-menu .ds-sb-group + .ds-sb-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ds-border); }
body.sidebar-collapsed .sidebar .sidebar-menu .ds-sb-group + .ds-sb-group { margin-top: 6px; padding-top: 6px; }

/* Tarjetas internas de Derivación (zona horaria, asuntos, SMTP, webhook, CRM) con el mismo estilo de módulo */
.card-header.bg-light-subtle { background-color: #F3F4F6 !important; border-bottom: 1px solid #DEE3EA !important; padding: 14px 20px !important; }
.card-header.bg-light-subtle > .fw-semibold.small.text-muted.text-uppercase,
.card-header.bg-light-subtle > .fw-semibold.small.text-uppercase {
    font-size: 15px !important; font-weight: 600; color: var(--ds-ink) !important; text-transform: none !important; letter-spacing: 0;
}
#advancedSettingsAccordion .card { border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius-card) !important; overflow: hidden; }
#advancedSettingsAccordion .card > .card-body { padding: 20px !important; }

/* Ítem activo (opción A): tarjeta blanca con borde, texto negro e ícono naranja */
.sidebar .nav-link.active,
.ds-section-nav--side a.is-active {
    background: #FFFFFF !important;
    color: var(--ds-ink) !important;
    border: 1px solid #E5E7EB !important;
    box-shadow: 0 1px 2px rgba(24, 24, 27, .04) !important;
    font-weight: 600;
}
.sidebar .nav-link { border: 1px solid transparent; transition: background-color .12s ease, color .12s ease; }
.sidebar .nav-link:not(.active):hover,
.sidebar .nav-link:not(.active):focus-visible { background: #FFFFFF; border-color: var(--ds-border-2); box-shadow: 0 1px 2px rgba(24, 24, 27, .06); color: var(--ds-ink); }
.sidebar .nav-link:not(.active):hover i,
.sidebar .nav-link:not(.active):focus-visible i { color: var(--ds-ink); }
.sidebar .nav-link.active i, .ds-section-nav--side a.is-active i { color: var(--ds-accent) !important; }

/* Pestaña activa con el mismo lenguaje: tarjeta blanca unida al contenido, texto negro y línea naranja */
.ds-tabs-bar button.is-active, .ds-tabs-bar a.is-active,
.nav-tabs .nav-link.active, .app-navtab.is-active, .ds-section-nav a.is-active:not(.ds-section-nav--side a),
.context-main-tabs .nav-link.active {
    background: #FFFFFF !important;
    color: var(--ds-ink) !important;
    box-shadow: inset 0 0 0 1px #E5E7EB;
    border-bottom: 2px solid var(--ds-accent) !important;
}
/* Submenú de apartados: el activo también en negro, con borde naranja */
.ds-tab-subnav a.is-active { background: #FFFFFF; border-color: var(--ds-accent); color: var(--ds-ink); font-weight: 600; }

/* Pestañas de página (opción F): franja gris con pestañas de carpeta; la activa es blanca y se une al contenido */
.ds-tabs-bar, .context-main-tabs.nav-tabs, .app-navtabs {
    gap: 2px !important;
    padding: 6px 6px 0 !important;
    background: #F3F4F6 !important;
    border: 0 !important;
    border-bottom: 1px solid #D1D5DB !important;
    border-radius: 10px 10px 0 0 !important;
}
.ds-tabs-bar button, .ds-tabs-bar a,
.context-main-tabs .nav-link, .app-navtab {
    padding: 8px 14px !important;
    margin-bottom: -1px !important;
    border: 1px solid transparent !important;
    border-radius: 8px 8px 0 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ds-ink-3) !important;
    font-weight: 500;
}
.ds-tabs-bar button:hover, .ds-tabs-bar a:hover,
.context-main-tabs .nav-link:hover, .app-navtab:hover { color: var(--ds-ink) !important; background: rgba(24, 24, 27, .04) !important; }
.ds-tabs-bar button.is-active, .ds-tabs-bar a.is-active,
.context-main-tabs .nav-link.active, .app-navtab.is-active {
    background: #FFFFFF !important;
    color: var(--ds-ink) !important;
    border-color: #D1D5DB #D1D5DB #FFFFFF !important;
    font-weight: 600;
}

/* Botones de alta dentro de módulos ("Agregar asistente", "Agregar popup"): naranja, por encima de la regla de secundarios */
.app-body-surface .card .btn.btn-primary.ds-btn-accent.ds-btn-accent,
.card .btn.btn-primary.ds-btn-accent.ds-btn-accent {
    background-color: var(--ds-accent) !important;
    border-color: var(--ds-accent) !important;
    color: #FFFFFF !important;
}
.app-body-surface .card .btn.btn-primary.ds-btn-accent.ds-btn-accent:hover,
.card .btn.btn-primary.ds-btn-accent.ds-btn-accent:hover {
    background-color: var(--ds-accent-hover) !important;
    border-color: var(--ds-accent-hover) !important;
}

/* La línea inferior de la franja se pinta como fondo (no como borde) para que la pestaña activa la tape sin
   salirse 1px: así la barra no genera scroll vertical cuando tiene desplazamiento horizontal */
.ds-tabs-bar, .context-main-tabs.nav-tabs, .app-navtabs {
    border-bottom: 0 !important;
    background: #F3F4F6 linear-gradient(#D1D5DB, #D1D5DB) left bottom / 100% 1px no-repeat !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
}
.ds-tabs-bar::-webkit-scrollbar, .context-main-tabs::-webkit-scrollbar, .app-navtabs::-webkit-scrollbar { display: none; }
.ds-tabs-bar button, .ds-tabs-bar a,
.context-main-tabs .nav-link, .app-navtab { margin-bottom: 0 !important; }

/* Enlace secundario al final de la barra de pestañas (p. ej. "URLs excluidas"): no es una pestaña, es un acceso */
.context-main-tabs .nav-link.context-tabs-aside { color: var(--ds-ink-3) !important; font-size: 13px; }
.context-main-tabs .nav-link.context-tabs-aside:hover { color: var(--ds-ink) !important; }
.js-page-topic.is-valid { border-color: var(--ds-ok, #16A34A); }
/* "URLs excluidas" como botón secundario al final de la barra de pestañas */
.context-main-tabs .context-tabs-aside-item { display: flex; align-items: center; padding: 0 4px 6px 8px; }
.context-main-tabs .context-tabs-aside-btn { white-space: nowrap; }

/* Botón terciario con borde (p. ej. "Reprocesar"): visible como botón sin competir con el negro ni el naranja */
.btn.ds-btn-outline { background: #FFFFFF; border: 1px solid #D1D5DB; color: var(--ds-ink); font-weight: 500; }
.btn.ds-btn-outline:hover, .btn.ds-btn-outline:focus-visible { border-color: var(--ds-ink); background: #FFFFFF; color: var(--ds-ink); }

/* Contador de pestañas inactivas: pastilla blanca con borde para que se distinga sobre la franja gris */
.context-main-tabs .nav-link:not(.active) .badge,
.ds-tabs-bar button:not(.is-active) .badge, .ds-tabs-bar a:not(.is-active) .badge {
    background: #FFFFFF !important;
    color: var(--ds-ink) !important;
    border: 1px solid #D1D5DB !important;
    font-weight: 600;
}
/* Las pestañas se apoyan en el borde inferior de la franja, así la activa tapa la línea gris por completo */
.ds-tabs-bar, .context-main-tabs.nav-tabs, .app-navtabs { align-items: flex-end !important; }
.context-main-tabs .nav-item { display: flex; align-items: flex-end; }

/* Vista previa "Móvil" de Apariencia: marco de teléfono con el chat a pantalla completa (como se abre en el celular) */
#wzPreviewPanel.is-mobile .ap-preview {
    position: relative;
    width: 250px; max-width: 250px; height: 500px; margin: 4px auto 0;
    padding: 28px 0 0; gap: 0;
    background: #FFFFFF; border: 9px solid #111827; border-radius: 38px;
    box-shadow: 0 14px 30px rgba(24, 24, 27, .18);
    overflow: hidden;
}
#wzPreviewPanel.is-mobile .ap-preview::before {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 76px; height: 18px; border-radius: 999px; background: #111827;
}
#wzPreviewPanel.is-mobile .ap-chat {
    height: 100%; display: flex; flex-direction: column;
    border: 0; border-radius: 0; box-shadow: none;
}
#wzPreviewPanel.is-mobile .ap-chat-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
/* En el teléfono, el botón flotante se ve sobre la pantalla, en la posición elegida (izquierda, centro o derecha) */
#wzPreviewPanel.is-mobile .ap-launcher-wrap {
    display: flex; position: absolute; left: 12px; right: 12px; bottom: 78px; z-index: 2; pointer-events: none;
}
#wzPreviewPanel.is-mobile .ap-launcher { box-shadow: 0 8px 18px rgba(24, 24, 27, .25); }
#wzPreviewPanel .ap-preview { transition: width .2s ease; }
#wzPreviewPanel.is-mobile .ap-chat-body > * { flex-shrink: 0; }

/* Apariencia: zona para subir o arrastrar la imagen propia */
.ap-drop {
    display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 16px; cursor: pointer;
    border: 1.5px dashed #D1D5DB; border-radius: 10px; background: var(--ds-sunk);
    transition: border-color .15s ease, background-color .15s ease;
}
.ap-drop:hover, .ap-drop.is-over { border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.ap-drop.has-file { border-style: solid; border-color: var(--ds-ok, #16A34A); background: #F0FDF4; }
.ap-drop > .bi { font-size: 22px; color: var(--ds-ink-3); }
.ap-drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-drop-text b { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.ap-drop-text span { font-size: 12.5px; color: var(--ds-ink-3); }

/* Selector de color con la misma forma que los cuadros de la paleta */
.ap-editor .ap-color, .ap-color {
    width: 56px; height: 40px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
    -webkit-appearance: none; appearance: none;
}
.ap-color::-webkit-color-swatch-wrapper { padding: 0; }
.ap-color::-webkit-color-swatch { border: 0; border-radius: 9px; }
.ap-color::-moz-color-swatch { border: 0; border-radius: 9px; }
.ap-color:focus-visible { outline: 2px solid var(--ds-ink); outline-offset: 2px; }
.ap-swatches[hidden] { display: none !important; }

/* Acciones: elección de tipo con su explicación (Enlace / Derivación) */
.act-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.act-type {
    display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 16px; cursor: pointer;
    border: 1px solid var(--ds-border); border-radius: 10px; background: #FFFFFF;
    transition: border-color .15s ease, background-color .15s ease;
}
.act-type:hover { border-color: var(--ds-border-2); background: var(--ds-sunk); }
.act-type > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.act-type b { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.act-type > span:last-child > span { font-size: 13px; color: var(--ds-ink-3); line-height: 1.45; }
.act-type-radio { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--ds-border-2); background: #FFFFFF; position: relative; }
.act-types input:checked + .act-type { border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.act-types input:checked + .act-type .act-type-radio { border-color: var(--ds-accent); }
.act-types input:checked + .act-type .act-type-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ds-accent); }
.act-types input:focus-visible + .act-type { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ap-ch h2 .act-count { background: #FFFFFF; color: var(--ds-ink); border: 1px solid #D1D5DB; font-size: 12px; vertical-align: 2px; }

/* Formularios de acciones: etiquetas claramente distintas del valor, y marca de obligatorio/opcional en la URL */
.act-form .form-label { font-size: 13.5px; font-weight: 600; color: var(--ds-ink); margin-bottom: 6px; }
.act-form .form-control, .act-form .form-select { font-size: 14px; }
.act-url-flag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: 1px; background: #F3F4F6; color: var(--ds-ink-3); text-transform: lowercase; }
.act-url-flag.is-required { background: var(--ds-accent-tint); color: var(--ds-accent-ink); }
.act-subnav { margin: 0; }
.act-subnav a .badge { background: #FFFFFF; color: var(--ds-ink); border: 1px solid #D1D5DB; }

/* Colores de marca de terceros (no se pintan con el naranja de EmpowerOS) */
.ds-brand-messenger { color: #0866FF !important; }
.ds-brand-whatsapp { color: #128C4A !important; }


/* Conocimiento: indicadores en una franja baja de una sola línea; la lista de fuentes queda arriba */
.kb-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); overflow: hidden; }
.kb-stats .ds-stat { border: 0; border-radius: 0; border-left: 1px solid var(--ds-border); margin-left: -1px; padding: 10px 14px; gap: 2px; }
.kb-stats .ds-stat-v { font-size: 20px; line-height: 1.2; }
.kb-stats .ds-stat-v--sm { font-size: 16px; }
.kb-stats .ds-stat > .ds-stat-l:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) {
    /* 3 arriba y 2 abajo, a lo ancho, sin tarjetas sueltas */
    .kb-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .kb-stats .ds-stat { grid-column: span 2; border-top: 1px solid var(--ds-border); margin-top: -1px; padding: 8px 12px; }
    .kb-stats .ds-stat:nth-child(n+4) { grid-column: span 3; }
    .kb-stats .ds-stat > .ds-stat-l:last-child { display: none; }
    .kb-stats .ds-stat-v { font-size: 18px; }
}

/* En celular la columna fija de acciones tapaba el nombre: se desplaza con el resto de la tabla */
@media (max-width: 767.98px) {
    .ds-sticky-col { position: static; box-shadow: none; }
}

/* Derivación: integraciones técnicas plegadas (SMTP, webhook, CRM) */
details.ds-adv { border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); margin-bottom: 1.5rem; }
details.ds-adv > summary { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; list-style: none; min-height: 44px; }
details.ds-adv > summary::-webkit-details-marker { display: none; }
details.ds-adv > summary:hover { background: var(--ds-hover); border-radius: 12px; }
details.ds-adv > summary:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; border-radius: 12px; }
.ds-adv-text { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.ds-adv-text b { font-size: 15px; font-weight: 600; color: var(--ds-ink); }
.ds-adv-text small { font-size: 13px; color: var(--ds-ink-3); }
details.ds-adv > summary .bi { color: var(--ds-ink-3); transition: transform .2s; }
details.ds-adv[open] > summary .bi { transform: rotate(180deg); }
details.ds-adv[open] > summary { border-bottom: 1px solid var(--ds-border); border-radius: 12px 12px 0 0; }
.ds-adv-body { padding: 20px 20px 4px; }

/* Aviso de cambios sin guardar debajo del botón Guardar (cuelga del botón: no cambia el alto del encabezado) */
.ds-save-wrap { position: relative; display: inline-flex; }
.ds-unsaved { position: absolute; top: calc(100% + 4px); right: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ds-ink-2); white-space: nowrap; }
.ds-unsaved[hidden] { display: none; }
.ds-unsaved-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ds-accent); animation: ds-dirty-pulse 1.6s ease-in-out infinite; }
.ds-float-save.is-dirty::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ds-accent); border: 2px solid #FFFFFF; animation: ds-dirty-pulse 1.6s ease-in-out infinite; }
.ds-float-save { position: relative; }
@keyframes ds-dirty-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ds-unsaved-dot, .ds-float-save.is-dirty::after { animation: none; } }

/* Teléfono: el submenú de apartados va en una sola línea que se desliza de lado, como las pestañas */
@media (max-width: 767.98px) {
    .ds-tab-subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .ds-tab-subnav::-webkit-scrollbar { display: none; }
    .ds-tab-subnav a { flex: 0 0 auto; }
}

/* Probar asistente: chat abierto a la izquierda y controles a la derecha; en "sitio web" el widget flota sobre la página */
.tw-chat { border: 1px solid var(--ds-border); border-radius: 16px; overflow: hidden; background: #FFFFFF; box-shadow: 0 1px 2px rgba(24, 24, 27, .04); }
.tw-chat iframe { display: block; width: 100%; height: 640px; border: 0; }
.tw-controls { display: flex; flex-direction: column; gap: 16px; }
.tw-control { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tw-label { font-size: 12px; font-weight: 600; color: var(--ds-ink-2); }
.tw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-site-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; display: grid; place-items: center; background: var(--ds-accent-tint); color: var(--ds-accent); font-size: 18px; }
body.tw-site-on .ds-float-actions { display: none; }
.tw-prompts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tw-prompts-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-prompt { display: inline-flex; align-items: center; gap: 8px; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 999px; padding: 6px 14px; font-size: 13.5px; color: var(--ds-ink); min-height: 36px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.tw-prompt i { color: var(--ds-ink-3); font-size: 12px; }
.tw-prompt:hover { border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.tw-prompt:hover i { color: var(--ds-accent); }
/* Probar asistente oculta el widget flotante al volver a Conversar con el atributo hidden de
   <cb-widget> (TestWidget/Index.cshtml, setMode). No se puede hacer desde acá: el widget fuerza
   display con !important en :host para que el CSS de las webs de los clientes no lo oculte, y esa
   regla le gana a cualquiera del documento. */

/* Marca EmpowerOS: logo completo en acceso y registro; el ícono reemplaza la letra cuando no hay empresa */
img.ds-sb-logo, img.ds-focus-logo { object-fit: cover; background: none; padding: 0; }
.ds-brand-logo { height: 30px; width: auto; display: block; }

/* Menú de apartados: etiqueta "Ir a" y, al quedar fijo arriba, barra oscura que se distingue del contenido */
.ds-tab-subnav-label { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 2px; font-size: 12px; font-weight: 600; color: var(--ds-ink-3); white-space: nowrap; flex: 0 0 auto; }
.ds-tab-subnav.is-stuck { background: #111827; border-color: #111827; border-radius: 0; padding: 10px 32px; box-shadow: 0 10px 28px rgba(17, 24, 39, .28); }
.ds-tab-subnav.is-stuck .ds-tab-subnav-label { color: #D1D5DB; }
.ds-tab-subnav.is-stuck a { background: transparent; border-color: rgba(255, 255, 255, .22); color: #F9FAFB; }
.ds-tab-subnav.is-stuck a:hover { border-color: #FFFFFF; color: #FFFFFF; }
.ds-tab-subnav.is-stuck a.is-active { background: #FFFFFF; border-color: #FFFFFF; color: #111827; }
/* Pegado al borde superior de la ventana (sin franja de contenido visible encima) */
.ds-tab-subnav { top: 0; }
/* Enlaces del menú de apartados: hover y activo en naranja con texto blanco, fijo o no */
.ds-tab-subnav a:hover,
.ds-tab-subnav a.is-active,
.ds-tab-subnav.is-stuck a:hover,
.ds-tab-subnav.is-stuck a.is-active { background: var(--ds-accent); border-color: var(--ds-accent); color: #FFFFFF; }
.ds-tab-subnav a.is-active .badge, .ds-tab-subnav a:hover .badge { background: #FFFFFF; color: var(--ds-accent-ink); border-color: #FFFFFF; }
/* "Volver arriba" dentro del menú de apartados, a la derecha, solo con el menú fijo */
.ds-tab-subnav-top { display: none; margin-left: auto; flex: 0 0 auto; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 999px; border: 1px solid #FFFFFF; background: #FFFFFF; color: #111827; font-size: 13px; font-weight: 600; cursor: pointer; }
.ds-tab-subnav.is-stuck .ds-tab-subnav-top { display: inline-flex; }
.ds-tab-subnav-top:hover { background: var(--ds-accent); border-color: var(--ds-accent); color: #FFFFFF; }
/* En celulares no va dentro del menú (taparía los enlaces): se usa el botón flotante de abajo */
@media (max-width: 767.98px) { .ds-tab-subnav.is-stuck .ds-tab-subnav-top { display: none; } }
/* Fijo: una sola línea; si no caben los enlaces, se deslizan y "Volver arriba" queda siempre visible a la derecha */
.ds-tab-subnav.is-stuck { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-left: 24px; padding-right: 24px; }
.ds-tab-subnav.is-stuck::-webkit-scrollbar { display: none; }
.ds-tab-subnav.is-stuck a { flex: 0 0 auto; }
.ds-tab-subnav.is-stuck .ds-tab-subnav-top { position: sticky; right: 0; box-shadow: -14px 0 12px #111827; }

/* Selector de asistente: ícono en columna fija y mismo tamaño, y textos largos en dos líneas en vez de cortarse */
.bot-switcher-menu .dropdown-item,
.bot-switcher-menu .dropdown-item.text-truncate { display: flex; align-items: flex-start; gap: 10px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; padding: 8px 10px; }
.bot-switcher-menu .dropdown-item > i.bi { flex: 0 0 16px; width: 16px; margin: 1px 0 0 !important; font-size: 15px; text-align: center; color: var(--ds-ink-3); }
.bot-switcher-menu .dropdown-item > i.bi.current-site-dot { color: var(--ds-accent); }
.bot-switcher-menu .dropdown-item:hover > i.bi { color: var(--ds-ink); }

/* Ventanas emergentes: fondo blanco como las tarjetas (el gris queda solo para el fondo de página) */
.modal-content { background: var(--ds-panel); }

/* Agregar fuente: el tipo se elige con tarjetas, igual que "Nueva acción" */
.kb-types-label { font-size: 13px; font-weight: 600; color: var(--ds-ink); margin: 0 0 10px; }
.kb-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--ds-border); }
.kb-type { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 12px 14px; border: 1px solid var(--ds-border); border-radius: 10px; background: #FFFFFF; cursor: pointer; transition: border-color .15s, background-color .15s; }
.kb-type:hover { border-color: var(--ds-border-2); background: var(--ds-sunk); }
.kb-type > i.bi { font-size: 18px; color: var(--ds-ink-3); margin-top: 1px; }
.kb-type > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kb-type b { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.kb-type > span > span { font-size: 12.5px; color: var(--ds-ink-3); line-height: 1.4; }
.kb-type.active { border-color: var(--ds-accent); background: var(--ds-accent-tint); }
.kb-type.active > i.bi { color: var(--ds-accent); }
.kb-type:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* Cuadros de cifras: un solo estilo en todo el admin (Inicio, Analítica, Conocimiento, Empresas, Popup...).
   Una franja con borde y divisiones finas; etiqueta arriba, cifra, y una línea de ayuda. */
.ds-stats, .ds-stat-strip, .kb-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0;
    border: 1px solid var(--ds-border); border-radius: 12px; background: var(--ds-panel); overflow: hidden;
}
.ds-stats > .ds-stat, .ds-stat-strip > .ds-stat, .kb-stats > .ds-stat {
    border: 0; border-radius: 0; margin: 0; background: transparent;
    /* divisiones: izquierda y arriba; las del borde exterior quedan ocultas por el contenedor */
    box-shadow: -1px 0 0 var(--ds-border), 0 -1px 0 var(--ds-border);
    padding: 14px 18px; gap: 4px; min-width: 0;
}
/* Franja de cifras dentro de una tarjeta: la tarjeta ya pone el marco, asi que la franja
   va sin borde. Ademas evita el hueco enmarcado cuando la ultima fila queda incompleta. */
.ds-stats--flush { border: 0; border-radius: 0; background: transparent; }

.ds-stats .ds-stat > .ds-stat-l:first-child, .ds-stat-strip .ds-stat > .ds-stat-l:first-child, .kb-stats .ds-stat > .ds-stat-l:first-child { font-size: 12.5px; font-weight: 500; color: var(--ds-ink-3); }
.ds-stats .ds-stat-v, .ds-stat-strip .ds-stat-v, .kb-stats .ds-stat-v { font-size: 22px; line-height: 1.25; font-weight: 600; color: var(--ds-ink); }
.ds-stats .ds-stat-v--sm, .ds-stat-strip .ds-stat-v--sm, .kb-stats .ds-stat-v--sm { font-size: 16px; }
.ds-stats .ds-stat > .ds-stat-l:last-child:not(:first-child), .ds-stat-strip .ds-stat > .ds-stat-l:last-child:not(:first-child), .kb-stats .ds-stat > .ds-stat-l:last-child:not(:first-child) { font-size: 12px; font-weight: 400; color: var(--ds-ink-3); }
.kb-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .kb-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ds-stat-strip--fixed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-stat-strip--fixed > .ds-stat { padding: 12px 14px; }
.ds-stat-strip.ep-metrics--side { width: 100%; align-self: stretch; }

/* Encabezados de módulo en azul grisáceo, distinto del gris del menú lateral, para que se reconozcan como módulos */
.card-header, .card > .ap-ch,
.card-header.bg-white, .card-header.bg-light-subtle { background-color: #EEF2F7 !important; border-bottom-color: #DCE3EC !important; }

/* La franja de color de la barra superior sigue la curva de las esquinas del panel */
.ds-topbar { border-top-left-radius: 13px; border-top-right-radius: 13px; }

/* Ventana de confirmación común */
.ds-confirm-modal .modal-dialog { max-width: 440px; }
.ds-confirm-modal .modal-body { padding: 24px 24px 8px; text-align: left; }
.ds-confirm-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #FEF2F2; color: #B42318; font-size: 18px; margin-bottom: 14px; }
.ds-confirm-title { font-size: 17px; font-weight: 600; color: var(--ds-ink); margin: 0 0 8px; }
.ds-confirm-body { font-size: 14px; line-height: 1.55; color: var(--ds-ink-2); margin: 0; }
.ds-confirm-modal .modal-footer { background: var(--ds-panel); border-top: 0; padding: 16px 24px 20px; gap: 8px; }
.ds-confirm-modal .modal-footer > * { margin: 0; }

/* Conversaciones: rango de fechas junto al selector de período */
.ds-date-range { display: flex; align-items: center; gap: 8px; }
.ds-date-range[hidden] { display: none; }
.ds-date-range label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--ds-ink-3); }
.ds-date-range input { width: 150px; height: 38px; }

/* Contadores dentro de filtros segmentados (p. ej. Todas / Con lead / Sin lead): mismo formato que los de las pestañas de Conocimiento */
.ds-seg button > span {
    display: inline-block; min-width: 22px; margin-left: 6px; padding: 2px 7px; border-radius: 6px;
    background: #FFFFFF; color: var(--ds-ink); border: 1px solid #D1D5DB;
    font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: center;
}
.ds-seg button.is-active > span { background: var(--ds-accent); color: #FFFFFF; border-color: var(--ds-accent); }
.ds-date-range { flex-wrap: wrap; }
.ds-date-range-error { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #B42318; flex-basis: 100%; }
.ds-date-range-error[hidden] { display: none; }

/* Plan y consumo: garantía de continuidad como nota corta bajo las cifras de consumo */
.ds-guarantee-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -8px 0 24px; font-size: 13px; color: var(--ds-ink-3); }
.ds-guarantee-note i { color: var(--ds-ok); font-size: 15px; }
.ds-guarantee-note b { color: var(--ds-ink); font-weight: 600; }

/* Ficha comercial (lead): encabezado tipo tarjeta de contacto, contactos como enlaces directos,
   resumen destacado con la barra de marca y lo que busca el lead en fichas (cortas en fila, largas a todo el ancho) */
.lead-qualification-modal .lead-qualification-modal__header { align-items: flex-start; padding: 20px 24px; border-bottom: 1px solid var(--ds-border) !important; background: var(--ds-panel) !important; }
.lead-sheet-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lead-sheet-avatar {
    flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ds-accent-tint); color: var(--ds-accent-ink); font-size: 17px; font-weight: 600; letter-spacing: .02em;
}
.lead-sheet-avatar i { font-size: 22px; line-height: 1; }
.lead-sheet-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lead-sheet-kicker { font-size: 12.5px; font-weight: 500; color: var(--ds-ink-3); }
.lead-qualification-modal .modal-title { font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ds-ink); overflow-wrap: anywhere; }
.lead-sheet-meta { font-size: 13px; color: var(--ds-ink-3); }
.lead-sheet-meta[hidden] { display: none; }
.lead-qualification-modal .modal-body { padding: 20px 24px 24px; }

.lead-sheet-contact { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lead-sheet-contact[hidden], .lead-sheet-contact li[hidden] { display: none; }
.lead-sheet-contact li {
    display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 6px 14px;
    border: 1px solid var(--ds-border); border-radius: 999px; background: var(--ds-panel); font-size: 13.5px;
}
.lead-sheet-contact li i { color: var(--ds-ink-3); font-size: 14px; }
.lead-sheet-contact li a { color: var(--ds-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-sheet-contact li:hover { border-color: var(--ds-border-2); background: var(--ds-sunk); }
.lead-sheet-contact li:hover a { color: var(--ds-accent-ink); }
.lead-sheet-contact li:focus-within { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.lead-sheet-contact li a:focus { outline: none; }
.lead-sheet-empty { margin: 0 0 20px; font-size: 13.5px; color: var(--ds-ink-3); }

.lead-qualification-modal .modal-body .lead-qualification-section-title {
    display: block; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--ds-ink-3); margin: 0 0 8px;
}
.lead-qualification-modal .modal-body .lead-qualification-summary {
    margin: 0 0 24px; padding: 14px 18px; border: 0; border-left: 3px solid var(--ds-accent);
    border-radius: 0 10px 10px 0; background: var(--ds-sunk); box-shadow: none;
}
.lead-qualification-modal .modal-body .lead-qualification-summary p { font-size: 15px; line-height: 1.65; color: var(--ds-ink); }

.lead-sheet-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.lead-sheet-fact { flex: 1 1 160px; padding: 12px 16px; border: 1px solid var(--ds-border); border-radius: 10px; background: var(--ds-panel); }
.lead-sheet-fact[hidden] { display: none; }
.lead-sheet-fact--wide { flex-basis: 100%; }
.lead-sheet-fact dt { font-size: 12.5px; font-weight: 500; color: var(--ds-ink-3); margin: 0 0 3px; }
.lead-sheet-fact dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ds-ink); overflow-wrap: anywhere; }
.lead-sheet-fact--wide dd { font-size: 14.5px; font-weight: 400; line-height: 1.6; }
@media (max-width: 575.98px) {
    .lead-qualification-modal .lead-qualification-modal__header, .lead-qualification-modal .modal-body { padding-left: 16px; padding-right: 16px; }
    .lead-sheet-contact li { width: 100%; }
}
.conv-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 4px; }
.conv-head-row .ds-page-desc { margin: 0; }
.lead-sheet-contact--page { margin: 0; }
@media (max-width: 575.98px) { .lead-sheet-contact--page li { width: auto; } }
/* Menú de asistentes: los nombres de dominio son una sola palabra; se parten en sus cortes naturales
   (VantageRecreational·Finance·.com, con <wbr> en el HTML) y solo como último recurso en cualquier letra */
.bot-switcher-menu .bot-switcher-name { min-width: 0; overflow-wrap: anywhere; }
/* Mi perfil: nombre como título con rol y correo; formularios en dos columnas; idioma y sesión en una tarjeta */
.ds-profile-kicker { font-size: 12.5px; font-weight: 500; color: var(--ds-ink-3); margin: 0 0 2px; }
.ds-profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 0; font-size: 13.5px; color: var(--ds-ink-3); }
.ds-profile-role { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--ds-accent-tint); color: var(--ds-accent-ink); font-size: 12.5px; font-weight: 600; }
.ds-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.ds-form-grid__full { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .ds-form-grid { grid-template-columns: minmax(0, 1fr); } }
.ds-pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 16px 20px; }
.ds-pref-row + .ds-pref-row { border-top: 1px solid var(--ds-border); }
.ds-pref-title { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.ds-pref-help { font-size: 13px; color: var(--ds-ink-3); }
/* Selector de país del teléfono: se ve como parte del campo, no como un botón oscuro */
.phone-with-dial-code .country-dial-code-select__button,
.phone-with-dial-code .country-dial-code-select__button:hover,
.phone-with-dial-code .country-dial-code-select__button[aria-expanded="true"] {
    background: var(--ds-sunk) !important; color: var(--ds-ink) !important; border: 1px solid var(--ds-border-2) !important; border-right: 0 !important; box-shadow: none;
}
.phone-with-dial-code .country-dial-code-select__button:hover { background: var(--ds-hover) !important; }
.phone-with-dial-code .country-dial-code-select__button:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 1px; }
.ds-profile-avatar { width: 64px; height: 64px; border-radius: 50%; font-size: 21px; }
.ds-form-grid .phone-with-dial-code .country-dial-code-select { flex: 0 0 88px; width: 88px; }
/* Mi perfil a todo el ancho: datos personales y contraseña lado a lado (con los pies alineados),
   preferencias debajo a todo el ancho; en pantallas medianas, una sola columna */
.ds-profile .ds-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; padding-top: 24px; border-top: 1px solid var(--ds-border); }
.ds-profile .ds-settings-row { display: flex; flex-direction: column; gap: 12px; padding: 0; border-top: 0; }
.ds-profile .ds-settings-row > .card { flex: 1; display: flex; flex-direction: column; }
.ds-profile .ds-settings-row > .card > .card-body { flex: 1; }
.ds-profile .ds-settings-row--full { grid-column: 1 / -1; }
.ds-profile .ds-settings-row--full > .card { flex-direction: row; flex-wrap: wrap; }
.ds-profile .ds-settings-row--full .ds-pref-row { flex: 1 1 380px; }
.ds-profile .ds-settings-row--full .ds-pref-row + .ds-pref-row { border-top: 0; border-left: 1px solid var(--ds-border); }
@media (max-width: 1199.98px) {
    .ds-profile .ds-settings { grid-template-columns: minmax(0, 1fr); }
    .ds-profile .ds-settings-row--full > .card { flex-direction: column; }
    .ds-profile .ds-settings-row--full .ds-pref-row + .ds-pref-row { border-left: 0; border-top: 1px solid var(--ds-border); }
}
/* Títulos y tarjetas de las dos columnas alineados entre sí (subgrid), y los campos arriba sin estirarse */
.ds-profile .ds-settings { row-gap: 12px; }
.ds-profile .ds-settings-row { display: grid; grid-template-columns: minmax(0, 1fr); grid-row: span 2; grid-template-rows: subgrid; gap: 12px; }
.ds-profile .ds-settings-row--full { margin-top: 20px; }
.ds-profile .ds-settings-row > .card > .card-body { align-content: start; }
@media (max-width: 1199.98px) { .ds-profile .ds-settings-row + .ds-settings-row { margin-top: 20px; } }
@media (max-width: 1199.98px) { .ds-profile .ds-settings-row--full .ds-pref-row { flex: none; } }
/* Lista de países del teléfono: la tarjeta no la recorta; el menú queda por encima del resto */
.ds-settings-card { overflow: visible; }
.ds-settings-card:has(.country-dial-code-select.is-open) { position: relative; z-index: 20; }
.country-dial-code-select__menu { border-color: var(--ds-border) !important; border-radius: 10px !important; box-shadow: 0 12px 32px rgba(17, 24, 39, .12) !important; }
.country-dial-code-select__menu .form-control-sm { min-height: 36px; font-size: 13.5px; }
/* Selector de país: línea que separa los países fijados (EE. UU., Colombia) del resto; se oculta al buscar */
.country-dial-code-select__option.is-last-pinned { position: relative; margin-bottom: 9px; }
.country-dial-code-select__option.is-last-pinned::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -5px; border-bottom: 1px solid var(--ds-border); }
.country-dial-code-select.is-searching .country-dial-code-select__option.is-last-pinned { margin-bottom: 0; }
.country-dial-code-select.is-searching .country-dial-code-select__option.is-last-pinned::after { display: none; }
/* Prueba en vivo (SMTP): campo y botón alineados a la misma altura; el botón solo ocupa lo que necesita */
.ds-inline-test { display: flex; gap: 8px; align-items: stretch; }
.ds-inline-test .form-control { flex: 1 1 auto; min-width: 0; }
.ds-inline-test .btn { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; }
@media (max-width: 575.98px) { .ds-inline-test { flex-direction: column; } .ds-inline-test .btn { justify-content: center; } }
.ds-tab-intro { margin: 0 0 16px; font-size: 14px; color: var(--ds-ink-3); max-width: 72ch; }
