@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bgbody: #f8fafc;
    --bgcard: #ffffff;
    --bordercolor: #e2e8f0;
    --textmain: #0f172a;
    --textmuted: #64748b;
    --colorprimary: #2563eb;
    --colorprimaryhover: #1d4ed8;
    --colorprimarylight: #eef2ff;
    --colorsuccess: #10b981;
    --colorwarning: #f59e0b;
    --colordanger: #ef4444;
    --colorpurple: #9333ea;
    --fontfamily: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadowsm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadowmd: 0 4px 12px rgba(0, 0, 0, 0.07);
    --shadowlg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --radiusxl: 14px;
    --radiusmd: 8px;
    --radiussm: 6px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--fontfamily);
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--fontfamily);
    background-color: var(--bgbody);
    color: var(--textmain);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button,
input,
select,
textarea {
    font-family: var(--fontfamily);
    font-size: 0.875rem;
}

.crmshell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOP BAR */
.crmtopbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bordercolor);
    box-shadow: var(--shadowsm);
}

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

.crmbrandlogo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border-radius: var(--radiussm);
    flex-shrink: 0;
}

.crmbrandlogo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.crmbrandtext {
    font-size: 1.18rem;
    letter-spacing: -0.02em;
}

.crmbranddark {
    font-weight: 800;
    color: #0f172a;
}

.crmbrandblue {
    font-weight: 700;
    color: var(--colorprimary);
}

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

.crmbcvpill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.85rem;
    background-color: #f1f5f9;
    border: 1px solid var(--bordercolor);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}

.crmplanbadge {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.75rem;
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.crmcopilotbtn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.95rem;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.crmcopilotbtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

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

.crmsearchinput {
    width: 270px;
    padding: 0.45rem 2.2rem 0.45rem 0.85rem;
    background-color: #f8fafc;
    border: 1px solid var(--bordercolor);
    border-radius: var(--radiussm);
    font-size: 0.85rem;
    color: var(--textmain);
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.crmsearchinput:focus {
    background-color: #ffffff;
    border-color: var(--colorprimary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.crmsearchkey {
    position: absolute;
    right: 0.6rem;
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--textmuted);
    background-color: #e2e8f0;
    border-radius: 4px;
}

.crmuserwrap {
    position: relative;
}

.crmuserbtn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radiussm);
    transition: background-color 0.15s;
}

.crmuserbtn:hover {
    background-color: #f1f5f9;
}

.crmuseravatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
}

.crmusername {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--textmain);
    line-height: 1.2;
}

.crmlayout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px);
}

/* SIDEBAR HOMOLOGADO AL SISTEMA ADMINISTRATIVO */
.crmsidebar {
    width: 256px;
    min-width: 256px;
    background-color: #ffffff;
    border-right: 1px solid var(--bordercolor);
    padding: 1rem 0.75rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease;
    overflow-x: hidden;
    overflow-y: auto;
    user-select: none;
}

/* Sidebar Company Box */
.crmsidebarcompanybox {
    margin-bottom: 0.65rem;
    cursor: pointer;
}

.crmsidebarcompanytitle {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0.2rem 0.25rem 0.35rem;
}

.crmsidebarcompanybadge {
    padding: 0.5rem 0.75rem;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 700;
    border-radius: var(--radiussm);
    font-size: 0.85rem;
    border: 1px solid #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
}

.crmsidebarcompanybadge:hover {
    background: #e0e7ff;
}

.crmsidebarcompanyname {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crmsidebarcompanytax {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

/* Botón Contraer / Expandir Todos los Submenús */
.crmsidebarcollapseallcontainer {
    margin: 0.25rem 0 0.75rem 0;
}

.crmsidebarcollapseallbtn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.42rem 0.65rem;
    background: #f8fafc;
    border: 1px solid var(--bordercolor);
    border-radius: var(--radiussm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--textmuted);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1;
}

.crmsidebarcollapseallbtn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--colorprimary);
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.crmsidebarcollapseallbtn:active {
    transform: translateY(0);
}

/* Grupos Retráctiles de Menú */
.crmsidebargroup {
    margin-bottom: 0.15rem;
}

.crmsidebargroupheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-radius: 7px;
    padding: 0.48rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.crmsidebargroup:not(.collapsed)>.crmsidebargroupheader {
    color: #0f172a;
}

.crmsidebargroupheader:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.crmgroupchevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
    flex-shrink: 0;
}

.crmsidebargroupheader:hover .crmgroupchevron,
.crmsidebargroup:not(.collapsed)>.crmsidebargroupheader .crmgroupchevron {
    color: #475569;
}

.crmsidebargroup.collapsed .crmgroupchevron {
    transform: rotate(-90deg);
}

.crmsidebargroupitems {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
    margin-bottom: 0.35rem;
}

.crmsidebargroup.collapsed .crmsidebargroupitems {
    display: none;
}

/* Items individuales del menú */
.crmsidebaritem {
    display: flex;
    align-items: center;
    gap: 0.68rem;
    padding: 0.46rem 0.65rem;
    color: #1e293b;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.35;
    border-radius: 7px;
    transition: background-color 0.14s ease, color 0.14s ease;
    text-decoration: none;
    cursor: pointer;
}

.crmsidebartext {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crmsidebaricon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.14s ease;
}

.crmsidebaricon svg,
.crmsidebaricon.lucide,
.crmsidebaricon [data-lucide] {
    width: 17px;
    height: 17px;
    stroke-width: 1.75;
    stroke: currentColor;
}

.crmsidebaritem:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.crmsidebaritem:hover .crmsidebaricon {
    color: #334155;
}

.crmsidebaritem.active {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.crmsidebaritem.active .crmsidebaricon {
    color: var(--colorprimary);
}

/* Barra inferior del Sidebar (Comprimir / Expandir) */
.crmsidebarfooterbar {
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid var(--bordercolor);
    display: flex;
    align-items: center;
}

.crmsidebarfootertogglebtn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.55rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.crmsidebarfootertogglebtn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.crmsidebarfootertogglebtn svg {
    flex-shrink: 0;
    color: #475569;
}

/* Modo Comprimido del Sidebar */
.crmsidebar.collapsed {
    width: 76px;
    min-width: 76px;
    padding: 0.75rem 0.35rem 2rem 0.35rem;
}

.crmsidebar.collapsed .crmsidebarcompanybox,
.crmsidebar.collapsed .crmsidebarcollapseallcontainer,
.crmsidebar.collapsed .crmsidebarfootertoggletext,
.crmsidebar.collapsed .crmsidebargroupheader span:first-child,
.crmsidebar.collapsed .crmgroupchevron,
.crmsidebar.collapsed .crmsidebartext {
    display: none !important;
}

.crmsidebar.collapsed .crmsidebargroupitems {
    display: flex !important;
    align-items: center;
}

.crmsidebar.collapsed .crmsidebaritem {
    justify-content: center;
    padding: 0.5rem 0;
    width: 100%;
}

.crmsidebar.collapsed .crmsidebarfootertogglebtn {
    justify-content: center;
    padding: 0.4rem 0;
}

/* MAIN CONTENT */
.crmmaincontainer {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
}

/* CARDS */
.crmcard {
    background-color: var(--bgcard);
    border: 1px solid var(--bordercolor);
    border-radius: var(--radiusxl);
    box-shadow: var(--shadowsm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* BUTTONS */
.crmbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.48rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radiussm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.crmbtnprimary {
    background-color: var(--colorprimary);
    color: #ffffff;
}

.crmbtnprimary:hover {
    background-color: var(--colorprimaryhover);
}

.crmbtnsecondary {
    background-color: #ffffff;
    border-color: var(--bordercolor);
    color: #334155;
}

.crmbtnsecondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.crmbtndanger {
    background-color: var(--colordanger);
    color: #ffffff;
}

.crmbtndanger:hover {
    background-color: #dc2626;
}

/* TABLES */
.crmtablewrapper {
    overflow-x: auto;
    border: 1px solid var(--bordercolor);
    border-radius: var(--radiusxl);
    background-color: #ffffff;
}

.crmtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.crmtable th {
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid var(--bordercolor);
    white-space: nowrap;
}

.crmtable td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--bordercolor);
    color: var(--textmain);
}

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

/* Standard Unified Action Buttons for All Table Listings */
.crmtableactions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: flex-end;
}

.crmtableactionbtn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    color: #475569;
}

.crmtableactionbtn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.crmtableactionbtn svg,
.crmtableactionbtn i {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.crmtableactionbtn-edit i,
.crmtableactionbtn-edit svg {
    color: #475569;
}

.crmtableactionbtn-delete {
    color: #ef4444;
}

.crmtableactionbtn-delete i,
.crmtableactionbtn-delete svg {
    color: #ef4444;
}

.crmtableactionbtn-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.crmtableactionbtn-view i,
.crmtableactionbtn-view svg {
    color: #2563eb;
}

.crmtableactionbtn-view:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.crmtableactionbtn-copy i,
.crmtableactionbtn-copy svg {
    color: #475569;
}

.crmtableactionbtn-copy:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.crmtableactionbtn-msg i,
.crmtableactionbtn-msg svg {
    color: #2563eb;
}

.crmtableactionbtn-msg:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.crmtable tr:hover td {
    background-color: #f8fafc;
}

/* COMPACT RESPONSIVE TABLE OVERRIDES */
#crmsellerstable th,
#crmsellerstable td,
#crmleadstable th,
#crmleadstable td,
#crmproductstable th,
#crmproductstable td,
.crmtablecompact th,
.crmtablecompact td {
    padding: 0.35rem 0.65rem;
    vertical-align: middle;
}

.crmtablecompact th {
    padding: 0.45rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.03em;
}

/* BADGES */
.crmbadge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.crmbadggreen {
    background-color: #ecfdf5;
    color: #065f46;
}

.crmbadgblue {
    background-color: #eff6ff;
    color: #1e40af;
}

.crmbadgamber {
    background-color: #fffbeb;
    color: #92400e;
}

.crmbadgred {
    background-color: #fef2f2;
    color: #991b1b;
}

.crmbadgpurple {
    background-color: #faf5ff;
    color: #6b21a8;
}

.crmbadggray {
    background-color: #f1f5f9;
    color: #475569;
}

/* MODALS */
.crmmodalbackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.crmmodalbackdrop.active {
    display: flex;
}

.crmmodalbox {
    background-color: var(--bgcard);
    border-radius: var(--radiusxl);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadowlg);
    border: 1px solid var(--bordercolor);
    overflow: hidden;
    animation: modalappear 0.2s ease-out;
}

.crmmodalheader {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--bordercolor);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crmmodaltitle {
    font-size: 1.05rem;
    font-weight: 700;
}

.crmmodalbody {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.crmmodalfooter {
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--bordercolor);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #f8fafc;
}

/* FORMS */
.crmformgroup {
    margin-bottom: 1.1rem;
}

.crmformlabel {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.crmforminput,
.crmformselect,
.crmformtextarea {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--bordercolor);
    border-radius: var(--radiussm);
    background-color: #ffffff;
    color: var(--textmain);
    outline: none;
    font-size: 0.875rem;
    transition: border-color 0.15s;
}

.crmforminput:focus,
.crmformselect:focus,
.crmformtextarea:focus {
    border-color: var(--colorprimary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* TOASTS (Alertas flotantes prioritarias en primer plano) */
.crmtoastcontainer {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999999 !important;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.crmtoast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background-color: #0f172a;
    color: #ffffff;
    border-radius: var(--radiussm);
    font-size: 0.875rem;
    box-shadow: var(--shadowlg);
    animation: toastslide 0.25s ease-out;
}

.crmtoastsuccess {
    background-color: #065f46;
}

.crmtoasterror {
    background-color: #991b1b;
}

@keyframes modalappear {
    from {
        transform: scale(0.96);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes toastslide {
    from {
        transform: translateY(15px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* COPILOT EXPRESS EXECUTOR DRAWER */
.crmcopilotdrawerbackdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 3200;
    display: none;
    justify-content: flex-end;
}

.crmcopilotdrawerbackdrop.active {
    display: flex;
}

.crmcopilotdrawerpanel {
    width: 560px;
    max-width: 96vw;
    height: 100%;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    box-shadow: -12px 0 36px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.crmcopilotdrawerhead {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.crmcopilottabs {
    display: flex;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.crmcopilottabbtn {
    flex: 1;
    padding: 0.42rem 0.7rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.crmcopilottabbtn.active {
    background: #faf5ff;
    color: #7e22ce;
    border-color: #d8b4fe;
}

.crmcopilotpane {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.crmexecutorchips {
    display: flex;
    gap: 0.35rem;
    padding: 0.65rem 1rem 0.35rem 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.crmexecutorchip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.71rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.crmexecutorchip:hover {
    border-color: #9333ea;
    color: #7e22ce;
    background: #faf5ff;
}

.crmexecutorstream {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crmexecutorwelcomecard,
.crmexecutorqcard,
.crmexecutorplancard,
.crmexecutorsuccesscard,
.crmexecutorloadingcard,
.crmexecutorerrorcard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
}

.crmexecutorloadingcard {
    background: #faf5ff;
    border-color: #e9d5ff;
}

.crmexecutorerrorcard {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    font-size: 0.8rem;
}

.crmexecutorusermsg {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 0.55rem 0.8rem;
    border-radius: 12px 12px 2px 12px;
    max-width: 88%;
    line-height: 1.4;
}

.crmexecutorbadgeai {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.69rem;
    font-weight: 700;
}

.crmexecutorqitem {
    border-top: 1px solid #f1f5f9;
    padding-top: 0.55rem;
    margin-top: 0.55rem;
}

.crmexecutorqlabel {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
}

.crmexecutoroptrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.crmexecutoroptbtn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    border-radius: 8px;
    padding: 0.25rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.crmexecutoroptbtn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.crmexecutorplanhead {
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.65rem;
}

.crmexecutorblock {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.6rem;
}

.crmexecutorblocktitle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.crmexecutorstepnum {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.crmexecutorsummary {
    font-size: 0.75rem;
    color: #475569;
    background: #f8fafc;
    border-left: 3px solid #9333ea;
    padding: 0.45rem 0.65rem;
    border-radius: 4px;
    margin-bottom: 0.55rem;
}

.crmexecutorsafetynote {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.73rem;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.65rem;
}

.crmexecutorplanactions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.crmexecutorresourcelist {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.crmexecutorresourcerow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
}

.crmexecutorcomposer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.7rem 1rem;
    flex-shrink: 0;
}

.crmassistantcards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crmassistantcard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem;
}

/* HTML Mail Viewer & Multi-Communication Campaign Cards */
.crmhtmlmailviewerbox {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.crmhtmlmailviewerbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.crmhtmlmailframe {
    width: 100%;
    height: 480px;
    border: none;
    background: #ffffff;
    display: block;
}

.crmhtmlmailsourcebox {
    padding: 0.85rem;
    background: #f8fafc;
}

.crmcampaignmsgcard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.6rem;
}

.crmcampaignmsghead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}

.crmcampaignmsggrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

.crmcampaignhtmlpill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    flex-wrap: wrap;
}

/* Copilot Message Count Proposal & Multi-Step Plan */
.crmexecutorproposalcard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem;
}

.crmexecutorcountstepper {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.2rem 0.4rem;
}

.crmexecutorstepoutlineitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.76rem;
}

.crmexecutorstepcard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
}