@import url('/css/crm-notification-popover-2026.css?v=20260824-1');

/* Autos Esquivel CRM · brand preview hard fix
   Loaded after Vite so generic CRM image/card rules cannot stretch brand assets. */
html[data-crm-theme] body #app .master-settings .master-assets {
    align-items: stretch !important;
}

html[data-crm-theme] body #app .master-settings .master-asset {
    display: grid !important;
    grid-template-rows: 164px auto auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    isolation: isolate !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-compact {
    grid-template-rows: 122px auto auto !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-wide {
    grid-template-rows: 176px auto auto !important;
}

html[data-crm-theme] body #app .master-settings .master-asset__preview {
    position: relative !important;
    inset: auto !important;
    z-index: 1 !important;
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 22px !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border-color, #dfe3e8) !important;
    border-radius: 0 !important;
    background: #f4f4f2 !important;
    transform: none !important;
    filter: none !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-preview-dark .master-asset__preview {
    background: #111214 !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-preview-icon .master-asset__preview {
    padding: 20px !important;
    background:
        linear-gradient(45deg, #f1f1ef 25%, transparent 25%),
        linear-gradient(-45deg, #f1f1ef 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f1ef 75%),
        linear-gradient(-45deg, transparent 75%, #f1f1ef 75%),
        #fff !important;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0 !important;
    background-size: 16px 16px !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-preview-social .master-asset__preview {
    padding: 18px 28px !important;
    background: #efefed !important;
}

html[data-crm-theme] body #app .master-settings .master-asset__preview > img,
html[data-crm-theme] body #app .master-settings .master-asset__preview > .master-asset__image {
    all: unset !important;
    display: block !important;
    position: static !important;
    inset: auto !important;
    float: none !important;
    flex: 0 1 auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: min(78%, 380px) !important;
    max-height: 112px !important;
    margin: auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    aspect-ratio: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    opacity: 1 !important;
    transform: none !important;
    transform-origin: center !important;
    filter: none !important;
    box-shadow: none !important;
    clip: auto !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-preview-dark .master-asset__preview > img {
    max-height: 110px !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-preview-icon .master-asset__preview > img {
    max-width: 76px !important;
    max-height: 76px !important;
}

html[data-crm-theme] body #app .master-settings .master-asset.is-preview-social .master-asset__preview > img {
    max-width: min(86%, 520px) !important;
    max-height: 138px !important;
}

html[data-crm-theme] body #app .master-settings .master-asset__preview > span {
    all: unset !important;
    display: grid !important;
    place-items: center !important;
    gap: 7px !important;
    color: #747d89 !important;
    font: 700 12px/1.3 Montserrat, Inter, system-ui, sans-serif !important;
    text-align: center !important;
}

html[data-crm-theme] body #app .master-settings .master-asset__copy,
html[data-crm-theme] body #app .master-settings .master-asset__actions {
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    transform: none !important;
    background: var(--surface-muted, #fafafa) !important;
}

html[data-crm-theme="dark"] body #app .master-settings .master-asset__preview {
    border-bottom-color: #2d3137 !important;
}

html[data-crm-theme="dark"] body #app .master-settings .master-asset.is-preview-light .master-asset__preview,
html[data-crm-theme="dark"] body #app .master-settings .master-asset.is-preview-social .master-asset__preview,
html[data-crm-theme="dark"] body #app .master-settings .master-asset.is-preview-icon .master-asset__preview {
    background-color: #ececea !important;
}

@media (max-width: 760px) {
    html[data-crm-theme] body #app .master-settings .master-asset,
    html[data-crm-theme] body #app .master-settings .master-asset.is-wide {
        grid-template-rows: 148px auto auto !important;
    }

    html[data-crm-theme] body #app .master-settings .master-asset.is-compact {
        grid-template-rows: 112px auto auto !important;
    }
}

/* Leads · fixes the two controls that were rendering as solid black blocks.
   Uses selectors tied to the actual Leads markup and does not depend on :has(). */
html[data-crm-theme="light"] body #app a[href$="/crm/leads/create"].bg-foreground,
html[data-crm-theme="light"] body #app input[placeholder="Persona, teléfono, interés o campaña"] ~ button[type="submit"].bg-foreground {
    background: #ffffff !important;
    color: #18181b !important;
    border: 1px solid #d4d4d8 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    opacity: 1 !important;
}

html[data-crm-theme="light"] body #app a[href$="/crm/leads/create"].bg-foreground:hover,
html[data-crm-theme="light"] body #app input[placeholder="Persona, teléfono, interés o campaña"] ~ button[type="submit"].bg-foreground:hover {
    background: #f4f4f5 !important;
    color: #09090b !important;
    border-color: #a1a1aa !important;
}

html[data-crm-theme="dark"] body #app a[href$="/crm/leads/create"].bg-foreground,
html[data-crm-theme="dark"] body #app input[placeholder="Persona, teléfono, interés o campaña"] ~ button[type="submit"].bg-foreground {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

html[data-crm-theme="dark"] body #app a[href$="/crm/leads/create"].bg-foreground:hover,
html[data-crm-theme="dark"] body #app input[placeholder="Persona, teléfono, interés o campaña"] ~ button[type="submit"].bg-foreground:hover {
    background: #e2e8f0 !important;
    color: #020617 !important;
}

/* Calendario · selección neutra y controles con mejor respiración.
   Mantiene el círculo del día seleccionado, pero elimina halos/accentos rojos. */
html[data-crm-theme] body #app .eng-calendar-board .eng-calendar-grid > article.is-selected .eng-calendar-date {
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

html[data-crm-theme] body #app .eng-calendar-board .eng-calendar-grid > article.is-selected .eng-calendar-date::before,
html[data-crm-theme] body #app .eng-calendar-board .eng-calendar-grid > article.is-selected .eng-calendar-date::after {
    box-shadow: none !important;
    filter: none !important;
}

html[data-crm-theme] body #app .eng-calendar-header {
    align-items: center !important;
    gap: 16px !important;
}

html[data-crm-theme] body #app .eng-calendar-period-nav {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

html[data-crm-theme] body #app .eng-calendar-period-nav > button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: inline-grid !important;
    place-items: center !important;
    padding: 0 !important;
    border: 1px solid #dfe3e8 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #39414b !important;
    box-shadow: none !important;
    transition: background .15s ease, border-color .15s ease, transform .15s ease !important;
}

html[data-crm-theme] body #app .eng-calendar-period-nav > button:hover {
    border-color: #c9d0d8 !important;
    background: #f5f7f9 !important;
    transform: translateY(-1px) !important;
}

html[data-crm-theme] body #app .eng-calendar-period-jump > summary {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 14px !important;
    border: 1px solid #dfe3e8 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #252b33 !important;
    box-shadow: none !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
}

html[data-crm-theme] body #app .eng-calendar-period-jump > summary:hover,
html[data-crm-theme] body #app .eng-calendar-period-jump[open] > summary {
    border-color: #c9d0d8 !important;
    background: #f5f7f9 !important;
    color: #252b33 !important;
}

html[data-crm-theme] body #app .eng-calendar-view-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

html[data-crm-theme] body #app .eng-calendar-view-controls > [role="group"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px !important;
    overflow: visible !important;
    border: 1px solid #e0e4e8 !important;
    border-radius: 11px !important;
    background: #f6f7f9 !important;
}

html[data-crm-theme] body #app .eng-calendar-view-controls > [role="group"] button {
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 11px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #68717c !important;
    box-shadow: none !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
}

html[data-crm-theme] body #app .eng-calendar-view-controls > [role="group"] button:hover:not(.is-active) {
    background: #fff !important;
    color: #2e343b !important;
    box-shadow: 0 1px 3px rgba(24, 28, 33, .08) !important;
}

html[data-crm-theme] body #app .eng-calendar-view-controls > [role="group"] button.is-active {
    background: #171a1f !important;
    color: #fff !important;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .12) !important;
}

html[data-crm-theme="dark"] body #app .eng-calendar-period-nav > button,
html[data-crm-theme="dark"] body #app .eng-calendar-period-jump > summary {
    border-color: #2d343d !important;
    background: #12171d !important;
    color: #eef1f4 !important;
}

html[data-crm-theme="dark"] body #app .eng-calendar-period-nav > button:hover,
html[data-crm-theme="dark"] body #app .eng-calendar-period-jump > summary:hover,
html[data-crm-theme="dark"] body #app .eng-calendar-period-jump[open] > summary {
    border-color: #3b4551 !important;
    background: #1a2027 !important;
    color: #fff !important;
}

html[data-crm-theme="dark"] body #app .eng-calendar-view-controls > [role="group"] {
    border-color: #2d343d !important;
    background: #12171d !important;
}

html[data-crm-theme="dark"] body #app .eng-calendar-view-controls > [role="group"] button {
    color: #aeb7c2 !important;
}

html[data-crm-theme="dark"] body #app .eng-calendar-view-controls > [role="group"] button:hover:not(.is-active) {
    background: #1b222b !important;
    color: #fff !important;
}

html[data-crm-theme="dark"] body #app .eng-calendar-view-controls > [role="group"] button.is-active {
    background: #f2f4f6 !important;
    color: #111317 !important;
    box-shadow: none !important;
}

@media (max-width: 760px) {
    html[data-crm-theme] body #app .eng-calendar-header {
        align-items: stretch !important;
        gap: 12px !important;
    }

    html[data-crm-theme] body #app .eng-calendar-period-nav {
        width: 100% !important;
        justify-content: space-between !important;
    }

    html[data-crm-theme] body #app .eng-calendar-period-jump {
        flex: 1 1 auto !important;
    }

    html[data-crm-theme] body #app .eng-calendar-period-jump > summary {
        width: 100% !important;
        justify-content: center !important;
    }

    html[data-crm-theme] body #app .eng-calendar-view-controls {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    html[data-crm-theme] body #app .eng-calendar-view-controls > [role="group"] {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
}
