/* CRM Express Mobile Experience & PWA Styles */
/* Strict lowercase, English, no separators for all new selectors */

.crmmobileonly {
    display: none;
}

.crmmobilebottomnav {
    display: none;
}

.crmmobilesheetbackdrop {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 9500;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease-out, visibility 0s linear 160ms;
}

.crmmobilesheetbackdrop.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 180ms ease-out, visibility 0s;
}

.crmmobilesheetbackdrop.closing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 145ms ease-in;
}

.crmmobilesheet {
    width: 100%;
    max-width: 560px;
    max-height: 88dvh;
    overflow-y: auto;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.18);
    padding: 0.9rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 190ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.crmmobilesheetbackdrop.active .crmmobilesheet {
    transform: translateY(0);
}

.crmmobilesheetbackdrop.closing .crmmobilesheet {
    transform: translateY(100%);
    transition: transform 145ms cubic-bezier(0.4, 0, 1, 1);
}

@keyframes crmmobilesubup {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

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

.crmmobilesubenter {
    animation: crmmobilesubup 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.crm360tabsbar {
    display: none;
}

.crmmobilesheethandle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0 auto 0.75rem auto;
}

.crmmobileactionbtn {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.crmmobileactionbtn:active {
    background: #f8fafc;
}

@media (max-width: 768px) {
    .crmmobileonly {
        display: inline-flex !important;
    }

    /* Compact mobile top bar */
    .crmtopbar {
        padding: 0.5rem 0.75rem !important;
        gap: 0.45rem !important;
    }

    .crmsearchinputwrap,
    .crmplancontainer,
    .crmcopilotbtn {
        display: none !important;
    }

    .crmbrandtext {
        white-space: nowrap !important;
        font-size: 1rem !important;
    }

    .crmtopactions {
        gap: 0.45rem !important;
    }

    .crmbcvpill {
        font-size: 0.72rem !important;
        padding: 0.28rem 0.6rem !important;
        white-space: nowrap !important;
    }

    .crmusername,
    #crmuserroleel {
        display: none !important;
    }

    /* Hide desktop left sidebar on mobile; navigation handled by bottom bar + More sheet */
    .crmsidebar {
        display: none !important;
    }

    .crmmaincontainer {
        padding: 0.75rem 0.7rem calc(5.2rem + env(safe-area-inset-bottom)) 0.7rem !important;
        width: 100% !important;
    }

    /* Fixed Bottom Navigation Bar */
    .crmmobilebottomnav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 62px;
        padding-bottom: env(safe-area-inset-bottom);
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
        z-index: 9000;
    }

    .crmmobiletab {
        min-height: 48px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: transparent;
        border: none;
        color: #64748b;
        font-size: 0.67rem;
        font-weight: 700;
        cursor: pointer;
        position: relative;
        text-decoration: none;
        padding: 0.25rem 0.1rem;
    }

    .crmmobiletab.active {
        color: #2563EB;
    }

    .crmmobiletabcenter {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        margin-top: -12px;
    }

    .crmmobilecenterpill {
        width: 46px;
        height: 46px;
        border-radius: 999px;
        background: #2563EB;
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        font-weight: 800;
        box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
        border: 3px solid #f8fafc;
    }

    .crmmobilecenterlabel {
        font-size: 0.65rem;
        font-weight: 800;
        color: #2563EB;
        margin-top: 2px;
    }

    .crmmobilebadge {
        display: none;
        position: absolute;
        top: 4px;
        right: calc(50% - 18px);
        background: #ef4444;
        color: #ffffff;
        font-size: 0.62rem;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        border-radius: 999px;
        padding: 0 4px;
        text-align: center;
    }

    /* Dashboard Mobile Compact Order & KPIs */
    .crmdashheader h1 {
        font-size: 1.2rem !important;
    }

    #crmdashperiodbar {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto !important;
        width: 100%;
    }

    #crmdashperiodbar .crmbtn {
        min-height: 34px !important;
        padding: 0.28rem 0.5rem !important;
        font-size: 0.72rem !important;
    }

    #crmdashkpisgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    #crmdashkpisgrid .crmcard {
        padding: 0.8rem !important;
    }

    #crmdashkpisgrid .crmdashkpicard>div:nth-child(2) {
        font-size: 1.22rem !important;
    }

    /* Make all inline 2-col grids single-column inside cards and modals on mobile */
    .crmmodalbox {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 92dvh !important;
        border-radius: 14px !important;
    }

    .crmmodalbody [style*="grid-template-columns: 1fr 1fr"],
    .crmmodalbody [style*="grid-template-columns:1fr 1fr"],
    .crmmodalbody [style*="grid-template-columns:1.35fr"],
    .crmmodalbody [style*="grid-template-columns:1.25fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Omnichannel Inbox Two-Pane Toggle (WhatsApp Mobile Style) */
    .crminboxtopheader,
    .crminboxsecondarybtn {
        display: none !important;
    }

    .criminboxwrap {
        grid-template-columns: 1fr !important;
        height: calc(100dvh - 134px) !important;
        min-height: 420px !important;
        max-height: calc(100dvh - 134px) !important;
        border-radius: 14px !important;
    }

    #crmcommsearchinput {
        border-radius: 999px !important;
        background: #f1f5f9 !important;
        border: 1px solid #e2e8f0 !important;
        padding: 0.5rem 0.95rem !important;
        font-size: 0.85rem !important;
    }

    #crmcommfilterall,
    #crmcommfilterwhatsapp,
    #crmcommfilteremail,
    #crmcommfilterurgent {
        border-radius: 999px !important;
        min-height: 32px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.74rem !important;
    }

    .criminboxwrap:not(.crmmobilechatactive) .criminboxchat {
        display: none !important;
    }

    .criminboxwrap.crmmobilechatactive .criminboxsidebar {
        display: none !important;
    }

    .criminboxwrap.crmmobilechatactive .criminboxchat {
        display: flex !important;
        height: 100% !important;
    }

    /* Full-screen WhatsApp-like Chat Mode when inside an active conversation */
    body.crmmobileinchat .crmtopbar,
    body.crmmobileinchat .crmmobilebottomnav {
        display: none !important;
    }

    body.crmmobileinchat .crmmaincontainer {
        padding: 0 !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }

    body.crmmobileinchat .criminboxwrap {
        height: 100dvh !important;
        max-height: 100dvh !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .crmmobilehide {
        display: none !important;
    }

    .crmchatheader {
        padding: 0.4rem 0.55rem !important;
        flex-wrap: nowrap !important;
        gap: 0.35rem !important;
        min-height: 52px;
    }

    #crmmobileinboxbackbtn {
        background: transparent !important;
        border: none !important;
        padding: 0.25rem !important;
        min-height: 36px !important;
        width: 32px;
        flex-shrink: 0;
    }

    .crmchatheader>div:nth-child(2) {
        flex: 1;
        min-width: 0;
    }

    #crmchatsentimentcontainer,
    #crmchatactivetitle .crmbadge,
    #crmchatactivetitle button,
    #crmchatactivesub>span:not(:first-child),
    #crmchatcontactlinks {
        display: none !important;
    }

    #crmchatactivetitle {
        font-size: 0.94rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block !important;
    }

    #crmchatactivesub {
        font-size: 0.71rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex-wrap: nowrap !important;
    }

    #crmbtnmanualoverride {
        padding: 0.22rem 0.45rem !important;
        font-size: 0.68rem !important;
        min-height: 30px !important;
        white-space: nowrap;
    }

    #crmmobilechatoptionsbtn {
        background: transparent !important;
        border: none !important;
        padding: 0.2rem !important;
        min-height: 32px !important;
        width: 28px;
    }

    .crmchatmessages {
        padding: 0.65rem 0.7rem !important;
        background: #efeae2 !important;
    }

    .crmchatcomposer {
        padding: 0.45rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom)) 0.55rem !important;
        gap: 0.35rem !important;
    }

    .crmchatcomposer:not(.crmmobiletoolsexpanded) .crmmobilecollapsibletools {
        display: none !important;
    }

    .crmmobilechannelrow {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
        width: 100%;
    }

    .crmmobilechannelrow .crmbtn {
        flex: 1 1 auto;
        min-height: 34px !important;
        padding: 0.25rem 0.55rem !important;
        font-size: 0.74rem !important;
        justify-content: center;
        white-space: nowrap;
    }

    .crmmobilechannelrow select {
        max-width: 120px !important;
        font-size: 0.7rem !important;
        padding-left: 5px !important;
    }

    #crmcomposertemplatepopover {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 66px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 55dvh !important;
        z-index: 9600 !important;
    }

    .crmmobileairow {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.3rem !important;
        width: 100%;
    }

    .crmmobileairow .crmbtn {
        min-height: 32px !important;
        padding: 0.2rem 0.4rem !important;
        font-size: 0.7rem !important;
        justify-content: center;
    }

    .crmcomposertoolbar {
        gap: 0.25rem !important;
        padding: 0 !important;
    }

    .crmcomposertoolbar .crmtoolbtn {
        min-height: 30px !important;
        padding: 0.18rem 0.45rem !important;
        font-size: 0.72rem !important;
    }

    #crmcomposerinput {
        min-height: 40px !important;
        max-height: 110px !important;
        border-radius: 20px !important;
        padding: 0.5rem 0.85rem !important;
        resize: none !important;
    }

    #crmsendmsgbtn {
        width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }

    #crmsendbtntext {
        display: none !important;
    }

    /* Tables converted cleanly into scannable cards on small screens */
    .crmtablewrapper {
        border: none !important;
        background: transparent !important;
        overflow-x: visible !important;
    }

    .crmtable,
    .crmtable thead,
    .crmtable tbody,
    .crmtable th,
    .crmtable td,
    .crmtable tr {
        display: block;
        width: 100%;
    }

    .crmtable thead {
        display: none;
    }

    .crmtable tr {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 0.7rem;
        padding: 0.65rem 0.75rem;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    }

    .crmtable td {
        border: none !important;
        padding: 0.25rem 0 !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        font-size: 0.84rem;
    }

    .crmtableactionbtn,
    .crmbtn {
        min-height: 40px;
    }

    .crmtableactions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.4rem;
        padding-top: 0.45rem !important;
        border-top: 1px dashed #e2e8f0 !important;
    }

    /* Minimalist Tickets View on Mobile */
    .crmticketheader {
        flex-wrap: wrap;
        margin-bottom: 0.75rem !important;
    }

    .crmticketheader h1 {
        font-size: 1.18rem !important;
        margin-bottom: 0 !important;
    }

    .crmticketheadersub {
        display: none !important;
    }

    .crmticketheader .crmbtn {
        min-height: 34px !important;
        padding: 0.35rem 0.65rem !important;
        font-size: 0.78rem !important;
    }

    .crmticketkpisgrid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.45rem !important;
        margin-bottom: 0.65rem !important;
    }

    .crmticketkpicard {
        padding: 0.55rem 0.65rem !important;
        border-radius: 10px !important;
        box-shadow: none !important;
    }

    .crmticketkpicard>div:first-child {
        width: 100%;
    }

    .crmticketkpicard #crmticketkpiopen,
    .crmticketkpicard #crmticketkpiinprogress,
    .crmticketkpicard #crmticketkpiclosed {
        font-size: 1.25rem !important;
        margin: 0.15rem 0 0 0 !important;
    }

    .crmticketkpisub,
    .crmticketkpiicon {
        display: none !important;
    }

    .crmticketfiltercard {
        padding: 0.6rem !important;
        margin-bottom: 0.7rem !important;
        box-shadow: none !important;
    }

    .crmticketfiltergrid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.4rem !important;
    }

    .crmticketfiltersearchwrap {
        grid-column: 1 / -1;
    }

    .crmticketfiltergrid .crmformselect {
        font-size: 0.75rem !important;
        padding: 0.3rem 1.3rem 0.3rem 0.45rem !important;
        height: 34px !important;
        text-overflow: ellipsis;
    }

    #crmticketclearfiltersbtn {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
        min-height: 32px !important;
        height: 32px !important;
    }

    .crmtickettablewrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .crmtickettable tr.crmticketrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem 0.45rem;
        padding: 0.8rem 0.85rem;
        border-radius: 14px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
        margin-bottom: 0.6rem;
    }

    .crmtickettable tr.crmticketrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmticketcellcode {
        order: 1;
    }

    .crmticketcellprio {
        order: 2;
    }

    .crmticketcellstat {
        order: 3;
    }

    .crmticketcellexpand {
        order: 4;
        margin-left: auto;
        width: auto !important;
    }

    .crmticketcellexpand .crmtableactionbtn {
        min-height: 28px !important;
        width: 28px !important;
        height: 28px !important;
        border-radius: 8px;
    }

    .crmticketcellmain {
        order: 5;
        flex: 1 0 100%;
        width: 100% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 0.2rem !important;
        margin-top: 0.15rem;
    }

    .crmticketcellmain .crmlogdescwrapper {
        max-width: 100% !important;
    }

    .crmticketcellhours {
        order: 6;
        flex: 1 1 auto;
        flex-wrap: wrap;
        justify-content: flex-start !important;
        gap: 0.35rem !important;
        margin-top: 0.2rem;
    }

    .crmticketcellagent {
        order: 7;
        margin-left: auto;
        font-size: 0.76rem !important;
        color: #64748b;
        font-weight: 500;
        margin-top: 0.2rem;
    }

    .crmticketcellactions {
        order: 8;
        flex: 1 0 100%;
        width: 100% !important;
        margin-top: 0.25rem;
    }

    .crmticketcellactions .crmtableactions {
        width: 100%;
        padding-top: 0.45rem !important;
        border-top: 1px solid #f1f5f9 !important;
        gap: 0.4rem;
    }

    .crmticketcellactions .crmtableactionbtn {
        min-height: 34px !important;
        height: 34px;
        width: 36px;
        border-radius: 9px;
    }

    .crmtickettable tr.crmticketexpandrow {
        padding: 0 !important;
        border-radius: 12px;
        margin-top: -0.35rem;
        margin-bottom: 0.65rem;
    }

    .crmtickettable tr.crmticketexpandrow td {
        padding: 0.65rem !important;
        display: block !important;
    }

    /* Mobile Support Agreement Statement Modal (above bottom nav + minimalist header + proportional zoom) */
    #crmagreementstatementmodal {
        align-items: flex-start !important;
        padding: 0.45rem 0.45rem calc(74px + env(safe-area-inset-bottom, 0px)) 0.45rem !important;
    }

    .crmstatementmodalbox {
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100dvh - 82px - env(safe-area-inset-bottom, 0px)) !important;
        max-height: calc(100dvh - 82px - env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 14px !important;
    }

    .crmstatementheader {
        padding: 0.65rem 0.75rem !important;
        gap: 0.45rem !important;
    }

    .crmstatementtitleicon,
    .crmstatementclosedesk {
        display: none !important;
    }

    .crmstatementclosemob {
        display: inline-flex !important;
    }

    .crmstatementtitlewrap h3 {
        font-size: 0.94rem !important;
    }

    .crmstatementactions {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem !important;
    }

    .crmstatementactions .crmbtn {
        min-height: 34px !important;
        padding: 0.3rem 0.45rem !important;
        font-size: 0.74rem !important;
        white-space: nowrap;
    }

    #crmstatementdocument {
        padding: 0.55rem !important;
    }

    .crmstatementfooter {
        padding: 0.45rem 0.7rem !important;
    }

    /* Compact Mobile Ticket Interventions Cards */
    .crmtickettable tr.crmticketexpandrow td {
        padding: 0.4rem !important;
    }

    .crminterventionstable tbody {
        display: block;
        margin: 0.4rem;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        background: #ffffff;
        overflow: hidden;
    }

    .crminterventionstable tr.crminterventionrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 0.45rem;
        padding: 0.55rem 0.65rem;
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        width: 100%;
    }

    .crminterventionstable tr.crminterventionsummaryrow,
    .crminterventionstable tr.crminterventiondescrow {
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .crminterventionstable tr.crminterventionsummaryrow td,
    .crminterventionstable tr.crminterventiondescrow td {
        padding: 0 0.65rem 0.5rem 0.65rem !important;
        display: block !important;
        width: 100% !important;
    }

    .crminterventionstable tr.crminterventionrow td {
        width: auto;
        padding: 0 !important;
        font-size: 0.75rem !important;
    }

    .crminterventioncellcode {
        order: 1;
        font-size: 0.78rem !important;
    }

    .crminterventioncellmod {
        order: 2;
    }

    .crminterventioncelldate {
        order: 3;
        margin-left: auto;
        font-size: 0.71rem !important;
        color: #64748b !important;
    }

    .crminterventioncelldesc {
        order: 4;
        flex: 1 0 100%;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.8rem !important;
        color: #0f172a !important;
        line-height: 1.35;
        margin: 0.1rem 0;
    }

    .crminterventioncellhrs {
        order: 5;
    }

    .crminterventioncellitems {
        order: 6;
    }

    .crminterventioncelltech {
        order: 7;
        font-size: 0.72rem !important;
        color: #64748b !important;
        margin-left: auto;
    }

    .crminterventioncellactions {
        order: 8;
        flex: 1 0 100%;
        width: 100% !important;
        margin-top: 0.15rem;
    }

    .crminterventioncellactions .crmtableactions {
        width: 100%;
        padding-top: 0.35rem !important;
        border-top: 1px solid #f1f5f9 !important;
        gap: 0.35rem;
    }

    .crminterventioncellactions .crmtableactionbtn {
        min-height: 30px !important;
        height: 30px;
        width: 32px;
        border-radius: 7px;
    }

    /* Mobile Technical Interventions Modal (anchored bottom, full width, above bottom nav) */
    #crmticketinterventionsmodal {
        display: flex !important;
        z-index: 9600 !important;
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease-out, visibility 0s linear 160ms;
    }

    #crmticketinterventionsmodal.active {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition: opacity 180ms ease-out, visibility 0s;
    }

    #crmticketinterventionsmodal.closing {
        opacity: 0;
        pointer-events: none;
        transition: opacity 145ms ease-in;
    }

    #crminterventionmodalbox {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 92dvh !important;
        max-height: 92dvh !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
        margin: 0 !important;
        animation: none !important;
        transform: translateY(100%);
        transition: transform 195ms cubic-bezier(0.22, 1, 0.36, 1);
        will-change: transform;
    }

    #crmticketinterventionsmodal.active #crminterventionmodalbox {
        transform: translateY(0);
    }

    #crmticketinterventionsmodal.closing #crminterventionmodalbox {
        transform: translateY(100%);
        transition: transform 145ms cubic-bezier(0.4, 0, 1, 1);
    }

    .crminterventionheader {
        padding: 0.55rem 0.75rem !important;
    }

    .crminterventionheadericon,
    .crminterventionclosedesk {
        display: none !important;
    }

    .crminterventionclosemob {
        display: inline-flex !important;
    }

    #crminterventionmodaltitle {
        font-size: 0.88rem !important;
    }

    .crminterventionheadermeta {
        width: 100%;
        justify-content: space-between;
    }

    #crminterventiontogglelogbtn {
        min-height: 30px !important;
        padding: 0.22rem 0.55rem !important;
    }

    #crminterventionform .crmmodalbody {
        padding: 0.55rem !important;
    }

    #crminterventionformcard {
        padding: 0.65rem 0.75rem !important;
    }

    #crminterventionformcard .crmformlabel {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    #crminterventionform .crmmodalbody .crminterventiontopgrid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.45rem !important;
    }

    #crminterventionform .crmmodalbody .crminterventionmodbtns,
    #crminterventionform .crmmodalbody .crminterventionstatusgrid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
    }

    .crminterventionmodgroup {
        grid-column: 1 / -1;
    }

    .crminterventiontopgrid .crmbtn {
        min-height: 34px !important;
        padding: 0.28rem 0.45rem !important;
    }

    .crminterventiontimegrid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.45rem !important;
    }

    .crminterventionagwrap {
        grid-column: 1 / -1;
    }

    .crminterventionexpgrid {
        grid-template-columns: 92px 1fr !important;
        gap: 0.45rem !important;
    }

    .crminterventionfooter {
        padding: 0.55rem 0.85rem calc(0.6rem + env(safe-area-inset-bottom, 0px)) 0.85rem !important;
    }

    .crminterventionfooter .crmbtn {
        min-height: 36px !important;
        padding: 0.35rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    /* Centered Mobile Toast Alerts (above modals/sheets, never overlapping bottom buttons) */
    .crmtoastcontainer {
        top: calc(0.75rem + env(safe-area-inset-top, 0px)) !important;
        bottom: auto !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        align-items: center !important;
    }

    .crmtoast {
        width: 100%;
        max-width: 440px;
        justify-content: center;
        text-align: center;
        border-radius: 12px !important;
        padding: 0.72rem 1rem !important;
        font-size: 0.83rem !important;
        line-height: 1.35;
        box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25) !important;
    }

    /* High-Density Minimalist Support Agreements List on Mobile */
    .crmagreementheader {
        margin-bottom: 0.65rem !important;
    }

    .crmagreementheader h1 {
        font-size: 1.15rem !important;
        margin-bottom: 0 !important;
    }

    .crmagreementheadericon,
    .crmagreementheadersub {
        display: none !important;
    }

    .crmagreementheader .crmbtn {
        min-height: 34px !important;
        padding: 0.32rem 0.65rem !important;
        font-size: 0.78rem !important;
    }

    .crmagreementkpisgrid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 0.35rem !important;
        margin-bottom: 0.6rem !important;
    }

    .crmagreementkpicard {
        padding: 0.45rem 0.4rem !important;
        border-radius: 9px !important;
        box-shadow: none !important;
    }

    .crmagreementkpicard>div:first-child {
        width: 100%;
        text-align: center;
    }

    .crmagreementkpicard #crmkpiactiveagreements,
    .crmagreementkpicard #crmkpicontractedhours,
    .crmagreementkpicard #crmkpiconsumedhours,
    .crmagreementkpicard #crmkpithresholdalerts {
        font-size: 1.05rem !important;
        margin: 0.1rem 0 0 0 !important;
    }

    .crmagreementkpicard span {
        font-size: 0.65rem !important;
    }

    .crmagreementkpisub,
    .crmagreementkpiicon {
        display: none !important;
    }

    .crmagreementfiltercard {
        padding: 0.5rem !important;
        margin-bottom: 0.65rem !important;
        box-shadow: none !important;
    }

    .crmagreementfiltergrid {
        grid-template-columns: 1fr 1fr auto !important;
        gap: 0.35rem !important;
    }

    .crmagreementfiltersearch {
        grid-column: 1 / -1;
    }

    .crmagreementfiltergrid .crmformselect {
        font-size: 0.75rem !important;
        height: 33px !important;
        padding: 0.25rem 1.25rem 0.25rem 0.45rem !important;
    }

    .crmagreementclearbtn {
        min-height: 33px !important;
        height: 33px !important;
        padding: 0 0.55rem !important;
    }

    .crmagreementclearbtn span {
        display: none;
    }

    .crmagreementtablewrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .crmagreementtable tr.crmagreementrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.22rem 0.4rem;
        padding: 0.6rem 0.7rem;
        margin-bottom: 0.45rem;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .crmagreementtable tr.crmagreementrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmagreementcellcode {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.4rem !important;
        flex-wrap: wrap;
    }

    .crmagreementcellcode .crmagreementrate {
        display: none;
    }

    .crmagreementcellstatus {
        order: 2;
        margin-left: auto;
    }

    .crmagreementcellclient {
        order: 3;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-start !important;
    }

    .crmagreementcellclient .crmagreementtaxid {
        display: none;
    }

    .crmagreementcelldates {
        order: 4;
        margin-left: auto;
        font-size: 0.7rem !important;
        flex-direction: column;
        align-items: flex-end !important;
        gap: 0 !important;
    }

    .crmagreementcellusage {
        order: 5;
        flex: 1 0 100%;
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.15rem !important;
        margin-top: 0.15rem;
    }

    .crmagreementcellusage .crmagreementusagemeta {
        display: none !important;
    }

    .crmagreementcellrules {
        order: 6;
        flex: 1 1 auto;
        justify-content: flex-start !important;
        margin-top: 0.2rem;
    }

    .crmagreementcellactions {
        order: 7;
        margin-left: auto;
        margin-top: 0.2rem;
    }

    .crmagreementcellactions .crmtableactions {
        padding-top: 0 !important;
        border-top: none !important;
        gap: 0.28rem !important;
    }

    .crmagreementcellactions .crmtableactionbtn {
        min-height: 30px !important;
        height: 30px;
        width: 30px;
        border-radius: 7px;
    }

    /* Mobile Log Time Modal (#crmlogtimemodal): bottom-anchored, full width, above bottom nav, slide-up */
    #crmlogtimemodal {
        display: flex !important;
        z-index: 9650 !important;
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease-out, visibility 0s linear 160ms;
    }

    #crmlogtimemodal.active {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition: opacity 180ms ease-out, visibility 0s;
    }

    #crmlogtimemodal.closing {
        opacity: 0;
        pointer-events: none;
        transition: opacity 145ms ease-in;
    }

    #crmlogtimemodal .crmmodalbox {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 92dvh !important;
        max-height: 92dvh !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
        margin: 0 !important;
        animation: none !important;
        transform: translateY(100%);
        transition: transform 195ms cubic-bezier(0.22, 1, 0.36, 1);
        will-change: transform;
    }

    #crmlogtimemodal.active .crmmodalbox {
        transform: translateY(0);
    }

    #crmlogtimemodal.closing .crmmodalbox {
        transform: translateY(100%);
        transition: transform 145ms cubic-bezier(0.4, 0, 1, 1);
    }

    #crmlogtimemodal .crmmodalfooter {
        padding: 0.55rem 0.85rem calc(0.6rem + env(safe-area-inset-bottom, 0px)) 0.85rem !important;
    }

    #crmlogtimemodal .crmmodalheader {
        padding: 0.55rem 0.85rem !important;
    }

    .crmlogtimeheadericon {
        display: none !important;
    }

    #crmlogtimemodal .crmmodalbody {
        padding: 0.55rem 0.85rem !important;
        gap: 0.42rem !important;
    }

    .crmlogtimecard {
        padding: 0.45rem 0.7rem !important;
    }

    .crmlogtimegrid2 {
        gap: 0.42rem !important;
    }

    .crmlogtimedategrid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.42rem !important;
    }

    .crmlogtimedatewrap {
        grid-column: 1 / -1;
    }

    #crmlogtimemodal .crmformlabel {
        font-size: 0.71rem !important;
        margin-bottom: 2px !important;
        white-space: nowrap;
    }

    #crmlogtimemodal .crmforminput,
    #crmlogtimemodal .crmformselect {
        padding: 0.36rem 0.55rem !important;
        font-size: 0.81rem !important;
    }

    .crmlogtimepreview {
        padding: 0.38rem 0.65rem !important;
        font-size: 0.76rem !important;
    }

    #crmlogtimemodal .crmrichtoolbar {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    #crmlogtimedescriptioneditor {
        min-height: 76px !important;
        max-height: 120px !important;
        padding: 0.45rem 0.6rem !important;
        font-size: 0.81rem !important;
    }

    /* Minimalist Customers Directory & 360° Profile on Mobile */
    .crmcustomerheader {
        margin-bottom: 0.65rem !important;
    }

    .crmcustomerheader h1 {
        font-size: 1.18rem !important;
        margin-bottom: 0 !important;
    }

    .crmcustomerheadericon,
    .crmcustomerheaderstar,
    .crmcustomerheadersub {
        display: none !important;
    }

    .crmcustomerheaderactions {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.32rem !important;
    }

    .crmcustomerheaderactions .crmbtn {
        min-height: 32px !important;
        padding: 0.25rem 0.3rem !important;
        font-size: 0.7rem !important;
        justify-content: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crmcustomerkpisgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.4rem !important;
        margin-bottom: 0.6rem !important;
    }

    .crmcustomerkpicard {
        padding: 0.5rem 0.65rem !important;
        border-radius: 10px !important;
        box-shadow: none !important;
    }

    .crmcustomerkpicard>div:nth-child(2) {
        font-size: 1.15rem !important;
    }

    .crmcustomerkpisub {
        display: none !important;
    }

    .crmcustomerfiltercard {
        padding: 0.5rem !important;
        margin-bottom: 0.6rem !important;
        box-shadow: none !important;
    }

    .crmcustomerfiltergrid {
        grid-template-columns: 1fr 1fr auto !important;
        gap: 0.35rem !important;
    }

    .crmcustomerfiltersearch {
        grid-column: 1 / -1;
    }

    .crmcustomerfiltergrid .crmformselect {
        font-size: 0.74rem !important;
        height: 33px !important;
        padding: 0.25rem 1.25rem 0.25rem 0.45rem !important;
    }

    .crmcustomerclearbtn {
        min-height: 33px !important;
        height: 33px !important;
        padding: 0 0.55rem !important;
    }

    .crmcustomerclearbtn span {
        display: none;
    }

    .crmcustomertablewrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .crmcustomertable tr.crmcustomerrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 0.45rem;
        padding: 0.6rem 0.7rem;
        margin-bottom: 0.45rem;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .crmcustomertable tr.crmcustomerrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmcustomercellname {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
    }

    .crmcustomercelltype {
        order: 2;
        margin-left: auto;
    }

    .crmcustomercellcontact {
        order: 3;
        flex: 1 1 55%;
        min-width: 0;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
    }

    .crmcustomercellbalance {
        order: 4;
        margin-left: auto;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0 !important;
    }

    .crmcustomercellbalance .crmcustomercelllimit {
        display: none;
    }

    .crmcustomercellseller {
        order: 5;
        flex: 1 1 auto;
        justify-content: flex-start !important;
        margin-top: 0.15rem;
    }

    .crmcustomercellactions {
        order: 6;
        margin-left: auto;
        margin-top: 0.15rem;
    }

    .crmcustomercellactions .crmtableactions {
        padding-top: 0 !important;
        border-top: none !important;
        gap: 0.3rem !important;
    }

    .crmcustomercellactions .crmtableactionbtn {
        min-height: 30px !important;
        height: 30px;
        width: 30px;
        border-radius: 7px;
    }

    /* Customer 360° Mobile Segmented Tabs */
    .crm360tabsbar {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.25rem;
        background: #f1f5f9;
        padding: 0.25rem;
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }

    .crm360tabbtn {
        border: none;
        background: transparent;
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 0.42rem 0.2rem;
        border-radius: 8px;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crm360tabbtn.active {
        background: #ffffff;
        color: #2563eb;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .crm360tabpane {
        display: none !important;
    }

    .crm360tabpane.active {
        display: block !important;
    }

    /* Minimalist Quotes Directory on Mobile */
    .crmquoteheader {
        margin-bottom: 0.55rem !important;
    }

    .crmquoteheadericon,
    .crmquoteheaderbadge,
    .crmquoteheadersub {
        display: none !important;
    }

    .crmquoteheader h1 {
        font-size: 1.15rem !important;
    }

    .crmquoteheaderactions {
        width: 100%;
        display: grid !important;
        grid-template-columns: auto 1fr;
        gap: 0.4rem !important;
    }

    .crmquoteheaderactions .crmbtn {
        min-height: 34px !important;
        height: 34px !important;
        justify-content: center;
    }

    .crmquotekpisgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.45rem !important;
        padding: 0.55rem 0.65rem !important;
        margin-bottom: 0.55rem !important;
    }

    .crmquotekpiitem {
        border-right: none !important;
        padding-right: 0 !important;
    }

    .crmquotekpiicon {
        display: none !important;
    }

    .crmquotefiltercard {
        padding: 0.5rem !important;
        margin-bottom: 0.6rem !important;
    }

    .crmquotefiltergrid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.35rem !important;
        width: 100%;
    }

    .crmquotefiltersearch {
        grid-column: 1 / -1;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .crmquotefiltergrid .crmformselect {
        width: 100% !important;
        min-width: 0 !important;
        height: 33px !important;
        font-size: 0.74rem !important;
    }

    .crmquotedaterange {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: auto 1fr auto 1fr !important;
        width: 100%;
        height: 33px !important;
        gap: 0.25rem !important;
    }

    .crmquotedaterange i,
    .crmquotedaterange svg {
        display: none !important;
    }

    .crmquotedaterange input[type="date"] {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 0.72rem !important;
    }

    .crmquoteclearbtn {
        grid-column: 1 / -1;
        width: 100%;
        height: 32px !important;
        min-height: 32px !important;
    }

    .crmquotetablewrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .crmquotetable tr.crmquotelistrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.28rem 0.45rem;
        padding: 0.7rem 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .crmquotetable tr.crmquotelistrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmquotecellmain {
        order: 1;
        flex: 1 0 100%;
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.18rem !important;
    }

    .crmquotecellclient {
        order: 2;
        flex: 1 1 55%;
        min-width: 0;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.12rem !important;
    }

    .crmquotecellusd {
        order: 3;
        margin-left: auto;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0 !important;
    }

    .crmquotecellbs {
        order: 4;
        flex: 1 1 auto;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
    }

    .crmquotecellstatus {
        order: 5;
        margin-left: auto;
    }

    .crmquotecellactions {
        order: 6;
        flex: 1 0 100%;
        width: 100% !important;
        margin-top: 0.2rem;
    }

    .crmquotecellactions .crmtableactions {
        width: 100%;
        padding-top: 0.4rem !important;
        border-top: 1px solid #f1f5f9 !important;
        gap: 0.35rem !important;
    }

    .crmquotecellactions .crmtableactionbtn {
        min-height: 32px !important;
        height: 32px !important;
        width: 34px !important;
        border-radius: 8px;
    }

    /* =====================================================================
       QUOTE GENERATOR MODAL (MOBILE FULLSCREEN, ABOVE BOTTOM NAV, CLEAN UX)
       ===================================================================== */
    .crmmodalbackdrop {
        z-index: 9600 !important;
    }

    #crmquotemodal .crmquotemodalwide {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    #crmquotemodal .crmquotemodalheader {
        padding: 0.65rem 0.9rem !important;
        flex-shrink: 0;
    }

    #crmquotemodal .crmmodaltitle {
        font-size: 0.96rem !important;
        line-height: 1.25;
    }

    #crmquotemodal .crmquotemodaltitledesc {
        display: none !important;
    }

    #crmquotemodal #crmquoteform {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    #crmquotemodal #crmquotemodebar {
        padding: 0.55rem 0.9rem !important;
        gap: 0.4rem !important;
        flex-shrink: 0;
    }

    #crmquotemodal #crmquotemodebar>div {
        width: 100%;
        gap: 0.4rem !important;
    }

    #crmquotemodal .crmquotemodepills {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 0.3rem;
        padding: 0.2rem;
    }

    #crmquotemodal .crmquotemodebtn {
        justify-content: center;
        text-align: center;
        padding: 0.42rem 0.45rem !important;
        font-size: 0.72rem !important;
        line-height: 1.2;
        min-height: 36px;
    }

    #crmquotemodal #crmquotemodehint {
        display: none !important;
    }

    #crmquotemodal .crmquotetemplatesbar {
        padding: 0.55rem 0.9rem !important;
        gap: 0.45rem !important;
        flex-shrink: 0;
    }

    #crmquotemodal .crmquotetemplatesrow {
        min-width: 0 !important;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.4rem !important;
    }

    #crmquotemodal .crmquotetemplatesrow>span {
        flex: 1 0 calc(100% - 26px);
    }

    #crmquotemodal #crmquotetemplateselect {
        flex: 1 1 160px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: 36px;
        font-size: 0.8rem !important;
    }

    #crmquotemodal .crmquotetemplatesrow button {
        flex: 0 0 auto;
        min-height: 36px;
        white-space: nowrap;
        padding: 0.35rem 0.65rem !important;
    }

    #crmquotemodal .crmquotesavetemplatewrap {
        display: none !important;
    }

    #crmquotemodal .crmquotemetabar {
        padding: 0.65rem 0.9rem !important;
        gap: 0.55rem !important;
        flex-shrink: 0;
    }

    #crmquotemodal .crmquotemetarow {
        gap: 0.55rem !important;
    }

    #crmquotemodal .crmquotetabsbar {
        padding: 0.35rem 0.9rem 0 !important;
        gap: 0.25rem !important;
        overflow-x: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }

    #crmquotemodal .crmquotetabbtn {
        padding: 0.48rem 0.65rem !important;
        font-size: 0.75rem !important;
        flex-shrink: 0;
    }

    #crmquotemodal .crmquotetabcontent {
        flex: none !important;
        overflow: visible !important;
        padding: 0.85rem 0.9rem !important;
    }

    #crmquotemodal .crmquotemodalfooter {
        position: sticky;
        bottom: 0;
        z-index: 5;
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
        padding: 0.6rem 0.9rem max(0.65rem, env(safe-area-inset-bottom)) !important;
        flex-shrink: 0;
    }

    #crmquotemodal .crmquotemodalfooter>div {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.4rem !important;
    }

    #crmquotemodal .crmquotemodalfooter .crmbtn {
        min-height: 36px;
        padding: 0.38rem 0.68rem !important;
        font-size: 0.78rem !important;
    }

    #crmquotemodal #crmquotesubmitbtn {
        flex: 1 1 auto;
        justify-content: center;
    }

    #crmcopilotdrawer.crmcopilotdrawerbackdrop {
        z-index: 9650 !important;
    }

    .crmcopilotdrawerpanel {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* =====================================================================
       COLLECTIONS (CXC) MODULE - MINIMALIST COMPACT MOBILE LAYOUT
       ===================================================================== */
    .crmcollectionheader {
        gap: 0.45rem !important;
        margin-bottom: 0.5rem !important;
    }

    .crmcollectionheader h1 {
        font-size: 1.05rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crmcollectionheadersub {
        display: none !important;
    }

    .crmcollectionheaderactions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem !important;
    }

    .crmcollectionheaderactions .crmbtn {
        min-height: 32px !important;
        height: 32px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.74rem !important;
        justify-content: center;
        white-space: nowrap;
    }

    .crmcollectionkpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.45rem !important;
        margin-bottom: 0.55rem !important;
    }

    .crmcollectionkpiitem {
        padding: 0.5rem 0.65rem !important;
        border-radius: 10px !important;
        min-width: 0;
    }

    .crmcollectionkpiitem .crmstathead {
        font-size: 0.68rem !important;
        margin-bottom: 0.12rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crmcollectionkpiitem .crmstatvalue {
        font-size: clamp(0.86rem, 3.7vw, 1.08rem) !important;
        line-height: 1.15;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crmcollectiontablewrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .crmcollectiontable tr.crmcollectionrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.22rem 0.45rem;
        padding: 0.55rem 0.7rem;
        margin-bottom: 0.45rem;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .crmcollectiontable tr.crmcollectionrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmcollectioncellinvoice {
        order: 1;
        font-size: 0.78rem !important;
        color: #0f172a;
    }

    .crmcollectioncellstatus {
        order: 2;
        margin-left: auto;
    }

    .crmcollectioncellstatus .crmbadge {
        font-size: 0.66rem !important;
        padding: 0.14rem 0.45rem !important;
    }

    .crmcollectioncellclient {
        order: 3;
        flex: 1 1 58%;
        min-width: 0;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.05rem !important;
    }

    .crmcollectionclientname {
        width: 100%;
        font-size: 0.82rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .crmcollectionclienttax {
        font-size: 0.68rem !important;
        color: #64748b;
    }

    .crmcollectioncellpending {
        order: 4;
        margin-left: auto;
        flex-shrink: 0;
        font-size: 0.92rem !important;
        font-variant-numeric: tabular-nums;
    }

    .crmcollectioncelldue,
    .crmcollectioncelltotal,
    .crmcollectioncellpaid {
        display: none !important;
    }

    .crmcollectioncellactions {
        order: 5;
        flex: 1 0 100%;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.4rem !important;
        padding-top: 0.32rem !important;
        margin-top: 0.12rem;
        border-top: 1px solid #f1f5f9 !important;
    }

    .crmcollectionmobilemeta {
        display: flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.25rem;
        font-size: 0.69rem;
        color: #64748b;
        min-width: 0;
        font-variant-numeric: tabular-nums;
    }

    .crmcollectioncellactions .crmtableactions {
        padding-top: 0 !important;
        border-top: none !important;
        flex-shrink: 0;
    }

    .crmcollectioncellactions .crmtableactionbtn {
        min-height: 28px !important;
        height: 28px !important;
        width: 30px !important;
        border-radius: 7px;
    }

    /* =====================================================================
       CAMPAIGNS & CAMPAIGN STATS - MINIMALIST COMPACT MOBILE LAYOUT
       ===================================================================== */
    .crmcampheader {
        gap: 0.45rem !important;
        margin-bottom: 0.5rem !important;
    }

    .crmcampheader h1 {
        font-size: 1.05rem !important;
        line-height: 1.2;
    }

    .crmcampheader h1 i,
    .crmcampheader h1 svg {
        width: 19px !important;
        height: 19px !important;
    }

    .crmcampheadersub {
        display: none !important;
    }

    .crmcampheaderactions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem !important;
    }

    .crmcampheaderactions .crmbtn {
        min-height: 32px !important;
        height: 32px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.74rem !important;
        justify-content: center;
        white-space: nowrap;
    }

    .crmcampemailbanner {
        padding: 0.42rem 0.6rem !important;
        margin-bottom: 0.5rem !important;
        gap: 0.4rem !important;
    }

    .crmcampemailicon {
        width: 24px !important;
        height: 24px !important;
    }

    .crmcampemailtitle {
        display: none;
    }

    #crmcampaignemailbannertext {
        margin-left: 0 !important;
        font-size: 0.72rem !important;
    }

    .crmcampemailprefbtn {
        min-height: 26px !important;
        height: 26px !important;
        padding: 0.18rem 0.45rem !important;
        font-size: 0.69rem !important;
    }

    .crmcampkpisgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.4rem !important;
        margin-bottom: 0.5rem !important;
    }

    .crmcampkpiitem {
        padding: 0.45rem 0.6rem !important;
        border-radius: 10px !important;
    }

    .crmcampkpilabel {
        font-size: 0.62rem !important;
        margin-bottom: 0.08rem !important;
    }

    .crmcampkpival {
        font-size: 1.05rem !important;
        line-height: 1.15;
        font-variant-numeric: tabular-nums;
    }

    .crmcampkpisub {
        display: none !important;
    }

    .crmcampfiltercard {
        padding: 0.45rem !important;
        margin-bottom: 0.55rem !important;
        gap: 0.35rem !important;
    }

    .crmcampfilterinputs {
        min-width: 0 !important;
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem !important;
    }

    .crmcampsearchwrap {
        grid-column: 1 / -1;
        min-width: 0 !important;
    }

    .crmcampsearchwrap input {
        height: 32px !important;
        font-size: 0.76rem !important;
    }

    .crmcampfilterinputs .crmformselect {
        width: 100% !important;
        height: 32px !important;
        font-size: 0.73rem !important;
        padding-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
    }

    .crmcampfiltermeta {
        width: 100%;
        justify-content: space-between;
    }

    .crmcampfiltermeta .crmbtn {
        min-height: 28px !important;
        height: 28px !important;
        padding: 0.2rem 0.55rem !important;
        font-size: 0.72rem !important;
    }

    .crmcamptablewrap {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .crmcamptable {
        table-layout: auto !important;
    }

    .crmcamptable tr.crmcamprow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.24rem 0.45rem;
        padding: 0.48rem 0.65rem;
        margin-bottom: 0.42rem;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .crmcamptable tr.crmcamprow td {
        width: auto;
        padding: 0 !important;
    }

    .crmcampcellmain {
        order: 1;
        flex: 1 1 0%;
        min-width: 0;
        overflow: hidden;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.14rem !important;
    }

    .crmcampname {
        width: 100%;
        font-size: 0.84rem !important;
        line-height: 1.25;
    }

    .crmcamptplwrap {
        display: none !important;
    }

    .crmcampmsgwrap {
        margin-top: 0.08rem !important;
    }

    .crmcampmsgwrap .crmbadge {
        font-size: 0.65rem !important;
        padding: 1px 6px !important;
    }

    .crmcampmetricline,
    .crmcampqueuedline {
        margin-top: 0.06rem !important;
        font-size: 0.67rem !important;
        line-height: 1.25;
    }

    .crmcampcellstatus {
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0 !important;
    }

    .crmcampcellstatus .crmswitchwrap {
        flex-wrap: nowrap !important;
        gap: 0.28rem !important;
    }

    .crmcampstatuslbl {
        font-size: 0.69rem !important;
    }

    .crmcampsubstate {
        display: none !important;
    }

    .crmcampcellchannel {
        order: 3;
        flex: 1 0 100%;
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.35rem !important;
    }

    .crmcampcellchannel > div:first-child {
        display: inline-flex !important;
        flex-shrink: 0;
    }

    .crmcampcellchannel .crmbadge {
        font-size: 0.64rem !important;
        padding: 1px 6px !important;
    }

    .crmcampemailpill {
        display: none !important;
    }

    .crmcampdates {
        margin-top: 0 !important;
        margin-left: auto;
        font-size: 0.66rem !important;
        flex-shrink: 0;
    }

    .crmcampcellaudience,
    .crmcampcellbudget {
        display: none !important;
    }

    .crmcampcellactions {
        order: 4;
        flex: 1 0 100%;
        width: 100% !important;
        margin-top: 0.05rem;
    }

    .crmcampcellactions .crmtableactions {
        width: 100%;
        padding-top: 0.28rem !important;
        border-top: 1px solid #f1f5f9 !important;
        justify-content: flex-end;
        gap: 0.35rem !important;
    }

    .crmcampcellactions .crmtableactionbtn {
        min-height: 27px !important;
        height: 27px !important;
        width: 28px !important;
        border-radius: 7px;
    }

    .crmcampcellactions .crmcampstatsbtn {
        width: auto !important;
        padding: 0 0.52rem !important;
        gap: 0.25rem;
        background: #eff6ff !important;
        border: 1px solid #bfdbfe !important;
        font-size: 0.71rem;
        font-weight: 700;
        margin-right: auto;
    }

    .crmcampstatsbtntext {
        display: inline !important;
    }

    /* Campaign Stats Mobile Compact */
    .crmcampstatsheader {
        gap: 0.55rem !important;
        margin-bottom: 0.65rem !important;
    }

    .crmcampstatsheader h1 {
        font-size: 1.05rem !important;
    }

    .crmcampstatsactions {
        width: 100%;
        gap: 0.4rem !important;
    }

    .crmcampstatsactions .crmbtn {
        min-height: 32px !important;
        height: 32px !important;
        padding: 0.25rem 0.6rem !important;
        font-size: 0.74rem !important;
    }

    .crmcampstatsscope {
        padding: 0.45rem 0.6rem !important;
        margin-bottom: 0.55rem !important;
        gap: 0.35rem !important;
    }

    .crmcampstatsscopelabel {
        display: none;
    }

    .crmcampstatsscopebtns {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem !important;
    }

    .crmcampstatsscopebtns .crmbtn {
        min-height: 30px !important;
        height: 30px !important;
        padding: 0.2rem 0.35rem !important;
        font-size: 0.72rem !important;
        justify-content: center;
    }

    .crmcampstatskpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.45rem !important;
        margin-bottom: 0.65rem !important;
    }

    .crmcampstatskpis .crmcard {
        padding: 0.5rem 0.65rem !important;
        margin-bottom: 0 !important;
    }

    .crmcampstatskpis .crmcard > div:nth-child(2) {
        font-size: 1.1rem !important;
        margin-top: 0.08rem !important;
    }

    /* =====================================================================
       CAMPAIGN CREATE / EDIT MODAL - MINIMALIST MOBILE UX
       ===================================================================== */
    #crmcampaignmodal .crmmodalbox {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        display: flex;
        flex-direction: column;
    }

    #crmcampaignmodal .crmmodalheader {
        padding: 0.65rem 0.9rem !important;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    #crmcampaignmodal .crmmodaltitle {
        font-size: 0.95rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    #crmcampaignmodal .crmmodalheader > div {
        flex-shrink: 0;
        gap: 0.45rem !important;
    }

    #crmcampaignmodal #crmcampaignform {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    #crmcampaignmodal .crmmodalbody {
        flex: 1 1 auto;
        max-height: none !important;
        padding: 0.75rem 0.9rem !important;
        overflow-y: auto;
        overflow-x: hidden;
    }

    #crmcampaignmodal .crmformlabel {
        font-size: 0.72rem !important;
        margin-bottom: 0.2rem !important;
    }

    #crmcampaignmodal .crmforminput,
    #crmcampaignmodal .crmformselect {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 0.8rem !important;
        padding: 0.36rem 0.5rem !important;
        height: 36px;
    }

    #crmcampaignmodal .crmcampmodalrowname {
        grid-template-columns: 1fr 105px !important;
        gap: 0.5rem !important;
        margin-bottom: 0.55rem !important;
    }

    #crmcampaignmodal .crmcampmodalrowmeta {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        margin-bottom: 0.55rem !important;
    }

    #crmcampaignmodal .crmcampmodalrowpair {
        grid-template-columns: 1fr !important;
        gap: 0.55rem !important;
        margin-bottom: 0.55rem !important;
    }

    #crmcampaignmodal small {
        font-size: 0.67rem !important;
        line-height: 1.25;
    }

    #crmcampaignmessagessection {
        padding: 0.55rem 0.65rem !important;
        margin-bottom: 0.55rem !important;
    }

    #crmcampaignmessagessection .crmcampaignmsgcard {
        padding: 0.55rem !important;
    }

    #crmcampaignmessagessection .crmcampaignmsggrid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.45rem !important;
    }

    #crmcampaignmessagessection .crmcampaignmsggrid > div {
        min-width: 0;
    }

    #crmcampaignmodal .crmmodalfooter {
        padding: 0.6rem 0.9rem max(0.65rem, env(safe-area-inset-bottom)) !important;
        display: grid !important;
        grid-template-columns: 1fr 1.4fr;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    #crmcampaignmodal .crmmodalfooter .crmbtn {
        min-height: 38px;
        justify-content: center;
        font-size: 0.82rem !important;
    }

    /* Campaign Stats Tables & Filter Bar Mobile Compact */
    .crmstatssectioncard {
        padding: 0.65rem 0.7rem !important;
        margin-bottom: 0.65rem !important;
    }

    .crmstatssectionsub {
        display: none !important;
    }

    .crmstatsfilterbar {
        width: 100%;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.3rem !important;
        padding-bottom: 2px;
    }

    .crmstatsfilterbar .crmbtn {
        min-height: 28px !important;
        height: 28px !important;
        padding: 0.18rem 0.55rem !important;
        font-size: 0.72rem !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .crmstatsbtnstable tr.crmstatsbtnrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.2rem 0.45rem;
        padding: 0.5rem 0.65rem;
        margin-bottom: 0.4rem;
        border-radius: 10px;
    }

    .crmstatsbtnstable tr.crmstatsbtnrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmstatsbtncelllabel {
        order: 1;
        flex: 1 1 55%;
        min-width: 0;
        font-size: 0.8rem !important;
    }

    .crmstatsbtncelltotal {
        order: 2;
        margin-left: auto;
        font-size: 0.76rem !important;
    }

    .crmstatsbtncellunique {
        order: 3;
        font-size: 0.74rem !important;
        color: #64748b !important;
    }

    .crmstatsmobilelbl {
        display: inline !important;
        font-weight: 500;
        font-size: 0.7rem;
        color: #64748b;
    }

    .crmstatsbtncellurl {
        order: 4;
        flex: 1 1 60%;
        min-width: 0;
        font-size: 0.68rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: normal !important;
        display: block !important;
    }

    .crmstatsbtncelldate {
        order: 5;
        margin-left: auto;
        font-size: 0.67rem !important;
    }

    .crmstatsrecstable tr.crmstatsrecrow {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.18rem 0.45rem;
        padding: 0.5rem 0.65rem;
        margin-bottom: 0.38rem;
        border-radius: 10px;
    }

    .crmstatsrecstable tr.crmstatsrecrow td {
        width: auto;
        padding: 0 !important;
    }

    .crmstatsreccellname {
        order: 1;
        flex: 1 1 0%;
        min-width: 0;
        font-size: 0.82rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block !important;
    }

    .crmstatsreccellstatus {
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
    }

    .crmstatsreccellstatus .crmbadge {
        font-size: 0.65rem !important;
        padding: 1px 6px !important;
    }

    .crmstatsreccellcontact {
        order: 3;
        flex: 1 0 100%;
        width: 100% !important;
        font-size: 0.73rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block !important;
    }

    .crmstatsreccellread,
    .crmstatsreccellreply,
    .crmstatsreccellclicks,
    .crmstatsdesktopdate {
        display: none !important;
    }

    .crmstatsreccelldate {
        order: 4;
        flex: 1 0 100%;
        width: 100% !important;
        margin-top: 0.08rem;
    }

    .crmstatsrecmobilemeta {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        width: 100%;
        font-size: 0.68rem;
        color: #64748b;
        font-variant-numeric: tabular-nums;
    }

    .crmstatsrecmetaleft {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.25rem;
        min-width: 0;
    }

    .crmstatsrecmetaright {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        flex-shrink: 0;
    }
}