/* ============================================================
   WELLCARGO MAILFLOW
   GLOBAL APPLICATION STYLES
   ============================================================ */

:root {
    --brand-blue: #0078d4;
    --brand-blue-dark: #0067b8;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --border: #d7e1eb;
    --text: #242424;
    --muted: #65748b;
    --nav-hover: #edf6ff;
    --nav-active: #e5f2ff;
    --radius: 6px;
    --transition: 0.18s ease;
    --sidebar-width: 218px;
    --sidebar-collapsed-width: 64px;
    --header-height: 56px;
}


/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}


html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}


body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}


/* ============================================================
   APPLICATION
   ============================================================ */

.app {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* ============================================================
   TOP HEADER
   ============================================================ */

.header {
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 18px;
    background: var(--brand-blue);
    color: #fff;
    position: relative;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}


/* ============================================================
   HEADER LEFT
   ============================================================ */

.header-left {
    height: 100%;
    display: flex;
    align-items: center;
    min-width: 0;
}


/* ============================================================
   BRAND
   ============================================================ */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}


    .brand:hover {
        color: #fff;
        text-decoration: none;
    }


.brand-name {
    font-size: 17.55px;
    font-weight: 600;
    letter-spacing: -0.2px;
}


/* ============================================================
   MICROSOFT STYLE LOGO
   ============================================================ */

.ms-logo {
    width: 23px;
    height: 23px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    flex-shrink: 0;
}


    .ms-logo span:nth-child(1) {
        background: #f25022;
    }


    .ms-logo span:nth-child(2) {
        background: #7fba00;
    }


    .ms-logo span:nth-child(3) {
        background: #00a4ef;
    }


    .ms-logo span:nth-child(4) {
        background: #ffb900;
    }


/* ============================================================
   HEADER DIVIDER
   ============================================================ */

.header-divider {
    width: 1px;
    height: 28px;
    margin: 0 14px;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}


/* ============================================================
   SIDEBAR TOGGLE
   ============================================================ */

.sidebar-toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: background var(--transition);
}


    .sidebar-toggle:hover {
        background: rgba(255, 255, 255, 0.14);
    }


    .sidebar-toggle:focus {
        outline: none;
        background: rgba(255, 255, 255, 0.18);
    }


/* ============================================================
   HEADER RIGHT
   ============================================================ */

.header-right {
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* =========================================================
   PROFILE MENU
   ========================================================= */

.profile-menu {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

/* Top profile button */
.profile-trigger {
    height: 40px;
    min-width: 220px;
    padding: 0 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: none;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .profile-trigger:hover,
    .profile-trigger[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.38);
    }

/* User circle */
.profile-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    border-radius: 50%;
    background: #fff;
    color: #1479c9;
    font-size: 14px;
}

/* Username/email */
.profile-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

/* Chevron */
.profile-chevron {
    font-size: 11px;
    transition: transform 0.18s ease;
}

.profile-trigger[aria-expanded="true"] .profile-chevron {
    transform: rotate(180deg);
}


/* =========================================================
   PROFILE DROPDOWN
   ========================================================= */

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 2000;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

    .profile-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }


/* Signed-in information */
.profile-info {
    padding: 14px 16px 12px;
}

.profile-info-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.profile-info-email {
    color: #172033;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Divider */
.profile-divider {
    height: 1px;
    background: #edf0f4;
}


/* Sign-out area */
.profile-signout-form {
    margin: 0;
    padding: 8px;
}

.profile-signout {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #303b4d;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .profile-signout:hover {
        background: #f1f5f9;
        color: #1479c9;
    }

    .profile-signout [data-lucide] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }




/* ============================================================
   LOGOUT
   ============================================================ */

.logout-item:hover {
    background: #fff4f4;
}


    .logout-item:hover i {
        color: #d13438;
    }


/* ============================================================
   SECURE BADGE
   ============================================================ */

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
}


    .secure-badge svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
    }


    .secure-badge circle {
        fill: currentColor;
        stroke: none;
    }


/* ============================================================
   APPLICATION CONTAINER
   ============================================================ */

.outlook-container {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    overflow: hidden;
}


/* ============================================================
   LEFT SIDEBAR
   ============================================================ */

.outlook-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
    background: linear-gradient( 180deg, #f7fbff 0%, #f3f8fd 100% );
    border-right: 1px solid #d7e1eb;
    transition: width 0.2s ease, min-width 0.2s ease, flex-basis 0.2s ease;
}


/* ============================================================
   PREVENT INITIAL COLLAPSE ANIMATION
   ============================================================ */

html.sidebar-precollapsed .outlook-sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    flex-basis: var(--sidebar-collapsed-width);
    transition: none !important;
}


/* ============================================================
   COLLAPSED SIDEBAR
   ============================================================ */

.outlook-sidebar.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    flex-basis: var(--sidebar-collapsed-width);
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.mail-navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 30px 6px 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}


/* ============================================================
   NAVIGATION ITEM
   ============================================================ */

.mail-nav-item {
    width: 100%;
    height: 42px;
    min-height: 42px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 14px;
    border-radius: 4px;
    color: #172554;
    background: transparent;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.15s ease, color 0.15s ease;
}


    /* ============================================================
   NAV ICON
   ============================================================ */
    .mail-nav-item [data-lucide] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }



    /* ============================================================
   NAV TEXT
   ============================================================ */

    .mail-nav-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        opacity: 1;
        max-width: 180px;
        transition: opacity 0.15s ease, max-width 0.2s ease;
    }


    /* ============================================================
   NAV HOVER
   ============================================================ */

    .mail-nav-item:hover {
        background: rgba(222, 236, 249, 0.55);
        color: #172554;
        text-decoration: none;
    }


        .mail-nav-item:hover i {
            color: #0067d9;
        }


    /* ============================================================
   ACTIVE NAV ITEM
   ============================================================ */

    .mail-nav-item.active {
        background: linear-gradient( 90deg, #e1f0ff 0%, #eaf5ff 100% );
        color: #0067d9;
        font-weight: 600;
    }


        .mail-nav-item.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            border-radius: 4px 0 0 4px;
            background: #1473e6;
        }


        .mail-nav-item.active i {
            color: #0067d9;
        }


        .mail-nav-item.active:hover {
            background: linear-gradient( 90deg, #dceeff 0%, #e7f4ff 100% );
            color: #0067d9;
        }


/* ============================================================
   COLLAPSED NAVIGATION
   ============================================================ */

.outlook-sidebar.sidebar-collapsed .mail-navigation {
    padding-left: 4px;
    padding-right: 4px;
}


.outlook-sidebar.sidebar-collapsed .mail-nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
}


    .outlook-sidebar.sidebar-collapsed .mail-nav-item span {
        max-width: 0;
        opacity: 0;
        margin: 0;
    }


    .outlook-sidebar.sidebar-collapsed .mail-nav-item i {
        width: 22px;
        min-width: 22px;
        font-size: 18px;
        margin: 0;
    }


    /* ============================================================
   ACTIVE ITEM - COLLAPSED
   ============================================================ */

    .outlook-sidebar.sidebar-collapsed
    .mail-nav-item.active::before {
        left: 0;
    }


    .outlook-sidebar.sidebar-collapsed
    .mail-nav-item.active {
        background: linear-gradient( 90deg, #e1f0ff 0%, #eaf5ff 100% );
    }


/* ============================================================
   SIDEBAR FOOTER
   ============================================================ */

.sidebar-footer {
    flex: 0 0 auto;
    flex-shrink: 0;
    padding: 10px 12px 12px;
    color: #65748b;
    font-size: 12px;
    line-height: 1.7;
    background: transparent;
    overflow: hidden;
    white-space: nowrap;
}


    .sidebar-footer .copyright {
        display: block;
    }


    .sidebar-footer .version {
        display: block;
        margin-top: 2px;
        font-size: 11px;
        color: #728198;
    }


/* ============================================================
   COLLAPSED FOOTER
   ============================================================ */

.outlook-sidebar.sidebar-collapsed
.sidebar-footer {
    padding: 10px 0 12px;
    text-align: center;
}


    .outlook-sidebar.sidebar-collapsed
    .sidebar-footer .copyright {
        font-size: 0;
    }


        .outlook-sidebar.sidebar-collapsed
        .sidebar-footer .copyright::before {
            content: "©";
            font-size: 13px;
        }


    .outlook-sidebar.sidebar-collapsed
    .sidebar-footer .version {
        font-size: 9px;
        margin-top: 1px;
    }


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main {
    background: var(--bg);
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    background: #eef6ff;
    border-top: 1px solid #dcebf8;
    color: #60758a;
    font-size: 12px;
}


    .footer span {
        white-space: nowrap;
    }


/* ============================================================
   GENERIC PAGE COMPONENTS
   Reusable across Templates / Contacts /
   Signatures / Settings etc.
   ============================================================ */

.page-wrapper {
    padding: 24px;
}


.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}


.page-title {
    margin: 0;
    font-size: 25px;
    font-weight: 600;
    color: #242424;
}


.page-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}


.page-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}


/* =========================================================
   EMAIL COMPOSE PAGE
   ========================================================= */

.email-page-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
}


.email-compose-page {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
    box-sizing: border-box;
}


.email-compose-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #dce8f7;
    border-radius: 9px;
    box-shadow: 0 2px 12px rgba(30, 80, 150, 0.05);
    overflow: hidden;
}



/* =========================================================
   COMPOSE HEADER
   ========================================================= */

.email-compose-header {
    flex: 0 0 auto;
    min-height: 105px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #edf1f7;
}


.email-compose-title {
    min-width: 0;
}


    .email-compose-title h1 {
        margin: 0;
        color: #111b4b;
        font-size: 29px;
        font-weight: 700;
        line-height: 1.2;
    }


    .email-compose-title p {
        margin: 8px 0 0;
        color: #66749b;
        font-size: 16px;
        line-height: 1.4;
    }



/* =========================================================
   HEADER ACTIONS
   ========================================================= */

.email-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}


.email-header-button,
.email-signature-control {
    height: 48px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #bfd6f5;
    border-radius: 6px;
    background: #ffffff;
    color: #0069e8;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
}


.email-header-button {
    padding: 0 17px;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}


    .email-header-button:hover {
        background: #f5f9ff;
        border-color: #8bbcf5;
    }


    .email-header-button svg,
    .email-signature-control svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        stroke-width: 1.8;
    }


.email-header-button-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}


.email-header-dropdown {
    padding-right: 12px;
}


.email-dropdown-arrow {
    width: 17px !important;
    height: 17px !important;
}


.email-signature-control {
    position: relative;
    min-width: 235px;
    padding: 0 12px;
    gap: 10px;
}


    .email-signature-control > svg:first-child {
        color: #0874e9;
    }


.signature-select {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    appearance: none;
    background: transparent;
    color: #18234e;
    font-size: 15px;
    padding: 0;
    cursor: pointer;
}


.email-signature-control .email-dropdown-arrow {
    color: #0874e9;
    pointer-events: none;
}



/* =========================================================
   FORM AREA
   ========================================================= */

#composeEmailForm {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: 48px 48px minmax(220px, 1fr) auto 70px;
    overflow: hidden;
}



/* =========================================================
   RECIPIENT
   ========================================================= */

.email-recipient-row {
    min-height: 0;
    margin: 12px 20px 0;
    display: flex;
    align-items: stretch;
    border: 1px solid #d4deeb;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}


.recipient-label {
    width: 64px;
    flex: 0 0 64px;
    border: 0;
    border-right: 1px solid #d4deeb;
    background: #f7f9fc;
    color: #172044;
    font-size: 15px;
    font-weight: 600;
    cursor: default;
}


.recipient-area {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0 14px;
}


.recipient-chip-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 42px;
    overflow-y: auto;
}


.recipient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}


.recipient-input {
    flex: 1 1 180px;
    min-width: 180px;
    height: 38px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #18234e;
    font-size: 15px;
}


    .recipient-input::placeholder {
        color: #8290ad;
    }



/* =========================================================
   SUBJECT
   ========================================================= */

.email-subject-row {
    min-height: 0;
    margin: 12px 20px 0;
    display: flex;
    border: 1px solid #d4deeb;
    border-radius: 6px;
    background: #ffffff;
}


.email-subject-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 16px;
    color: #18234e;
    font-size: 15px;
}


    .email-subject-input::placeholder {
        color: #8290ad;
    }



/* =========================================================
   RICH TEXT EDITOR
   ========================================================= */

.email-editor-wrapper {
    min-height: 0;
    margin: 12px 20px 0;
    border: 1px solid #d4deeb;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


    /*
 * If the custom editor is based on Quill,
 * allow the editor body to occupy all remaining height.
 */

    .email-editor-wrapper .ql-toolbar {
        flex: 0 0 auto;
        border: 0;
        border-bottom: 1px solid #d4deeb;
        background: #f8fafc;
    }


    .email-editor-wrapper .ql-container {
        flex: 1 1 auto;
        min-height: 0;
        border: 0;
        font-family: "Segoe UI", Arial, sans-serif;
    }


    .email-editor-wrapper .ql-editor {
        height: 100%;
        overflow-y: auto;
        padding: 16px;
        color: #18234e;
        font-size: 15px;
        line-height: 1.6;
    }


        .email-editor-wrapper .ql-editor.ql-blank::before {
            color: #8290ad;
            font-style: normal;
        }



/* =========================================================
   ATTACHMENTS
   ========================================================= */

.email-attachment-area {
    min-height: 0;
    margin: 12px 20px 0;
    border: 1px dashed #cbdcf3;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    z-index:1000;
}


.email-attachment-content {
    height: 100%;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    box-sizing: border-box;
}


.email-attachment-icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #111b4b;
    cursor: pointer;
}


    .email-attachment-icon-button svg {
        width: 25px;
        height: 25px;
        stroke-width: 1.8;
    }


.email-attachment-text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.attachment-drag-text {
    color: #172044;
    font-size: 15px;
    font-weight: 500;
}


.attachment-help-text {
    color: #8290ad;
    font-size: 13px;
}


/*.attachment-preview-wrapper {
    min-width: 0;
    max-height: 70px;
    overflow-y: auto;
}*/


.email-add-attachment-button {
    flex: 0 0 auto;
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 17px;
    border: 1px solid #8fc2ff;
    border-radius: 5px;
    background: #ffffff;
    color: #006fe8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


    .email-add-attachment-button svg {
        width: 21px;
        height: 21px;
    }



/* =========================================================
   BOTTOM ACTION BAR
   ========================================================= */

.email-bottom-toolbar {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 20px;
}


.email-bottom-right {
    display: flex;
    align-items: center;
    gap: 12px;
}


.email-new-email-button,
.email-draft-button,
.email-send-button {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


.email-new-email-button {
    padding: 0 18px;
    border: 1px solid #7eb7fa;
    background: #ffffff;
    color: #006fe8;
}


.email-draft-button {
    padding: 0 18px;
    border: 1px solid #d4deeb;
    background: #ffffff;
    color: #006fe8;
}


.email-send-button {
    min-width: 190px;
    padding: 0;
    border: 1px solid #006fe8;
    background: #0876e8;
    color: #ffffff;
}


    .email-send-button > svg:first-child {
        width: 20px;
        height: 20px;
    }


.email-send-divider {
    width: 1px;
    height: 100%;
    margin-left: auto;
    background: rgba(255,255,255,0.25);
}


.email-send-arrow {
    width: 17px !important;
    height: 17px !important;
    margin: 0 12px;
}


.email-new-email-button svg,
.email-draft-button svg {
    width: 19px;
    height: 19px;
}



/* =========================================================
   HIDDEN SIGNATURE CONTENT
   ========================================================= */

.sig-content-hidden {
    display: none !important;
}



/* =========================================================
   VALIDATION
   ========================================================= */

.email-validation-summary {
    flex: 0 0 auto;
}



/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {

    .email-compose-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }


    .email-header-actions {
        width: 100%;
    }


    .email-header-button,
    .email-signature-control {
        flex: 1;
    }


    .email-signature-control {
        min-width: 0;
    }
}


@media (max-width: 768px) {

    :root {
        --sidebar-width: 64px;
    }


    .outlook-sidebar {
        width: 64px;
        min-width: 64px;
        flex-basis: 64px;
    }


    .mail-navigation {
        padding: 30px 4px 0;
    }


    .mail-nav-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        gap: 0;
    }


        .mail-nav-item span {
            display: none;
        }


        .mail-nav-item i {
            font-size: 18px;
        }


    .brand-name {
        font-size: 17px;
    }


    .header-divider {
        margin: 0 10px;
    }


    .user-name {
        display: none;
    }


    .user-chevron {
        display: none;
    }


    .user-menu-button {
        padding-right: 6px;
    }


    .user-dropdown {
        right: -5px;
    }


    .page-wrapper {
        padding: 16px;
    }

    /*compose email*/
    .email-compose-page {
        padding: 5px;
    }


    .email-compose-header {
        min-height: auto;
    }


    .email-compose-title h1 {
        font-size: 23px;
    }


    .email-compose-title p {
        font-size: 14px;
    }


    .email-header-actions {
        flex-wrap: wrap;
    }


    .email-header-button,
    .email-signature-control {
        flex: 1 1 100%;
    }


    /*#composeEmailForm {
        grid-template-rows: 48px 48px minmax(180px, 1fr) auto auto;
    }*/


    .email-attachment-content {
        flex-wrap: wrap;
        height: auto;
    }


    .email-add-attachment-button {
        width: 100%;
    }


    .email-bottom-toolbar {
        flex-wrap: wrap;
        height: auto;
    }


    .email-bottom-right {
        width: 100%;
        justify-content: flex-end;
    }
}




/***********************************************compose email css here start*********************************************/
/* =========================================================
   WELL CARGO MAILFLOW
   EMAIL COMPOSE PAGE
   ========================================================= */


/* =========================================================
   1. PAGE HOST
   ========================================================= */

.contacts-page {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* =========================================================
   2. MAIN COMPOSE CARD
   ========================================================= */

.email-compose-page {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    overflow: hidden;
    padding: 15px;
}


/* =========================================================
   3. VALIDATION / SYSTEM MESSAGES
   ========================================================= */

.email-validation-summary {
    flex: 0 0 auto;
    margin: 8px 20px 0;
    padding: 8px 12px;
    border: 1px solid #f1c7c7;
    border-radius: 6px;
    background: #fff7f7;
    color: #b42318;
    font-size: 13px;
}

.email-validation-list {
    margin: 0;
    padding-left: 18px;
}


/* =========================================================
   4. COMPOSE HEADER
   ========================================================= */

.email-compose-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid #e4ebf3;
    background: #ffffff;
}


/* Left side of header */

.email-compose-heading {
    min-width: 0;
}

.email-compose-title {
    margin: 0;
    color: #101828;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.email-compose-subtitle {
    margin: 7px 0 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.4;
}


/* Right side */

.email-compose-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}


/* =========================================================
   5. COMMON OUTLINE BUTTON
   Reusable on other pages
   ========================================================= */

.mail-action-button {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 15px;
    border: 1px solid #b9d5f7;
    border-radius: 6px;
    background: #ffffff;
    color: #006fe6;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .mail-action-button:hover {
        background: #f5f9ff;
        border-color: #8ebcf0;
    }

    .mail-action-button:focus-visible {
        outline: 2px solid #2684ff;
        outline-offset: 2px;
    }

    .mail-action-button i,
    .mail-action-button svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
    }


/* =========================================================
   6. DROPDOWN ACTION BUTTON
   For Load Template / Signature
   ========================================================= */

.mail-dropdown-button {
    display: inline-flex;
    align-items: stretch;
    height: 42px;
    border: 1px solid #b9d5f7;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}

.mail-dropdown-button-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #006fe6;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.mail-dropdown-button-toggle {
    width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid #d7e4f3;
    background: #ffffff;
    color: #006fe6;
    cursor: pointer;
}

.mail-dropdown-button:hover {
    background: #f5f9ff;
    border-color: #8ebcf0;
}

.mail-dropdown-button-main:hover,
.mail-dropdown-button-toggle:hover {
    background: #f5f9ff;
}

.mail-dropdown-button svg,
.mail-dropdown-button i {
    width: 17px;
    height: 17px;
}


/* =========================================================
   7. SEND / OLD TOOLBAR
   ========================================================= */

.email-toolbar {
    flex: 0 0 auto;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #e4e7ec;
    background: #ffffff;
}

.email-send-group {
    display: flex;
    align-items: center;
}

.email-send-button {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid #006fc9;
    border-radius: 4px;
    background: #1268b3;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

    .email-send-button:hover {
        background: #0d5b9f;
    }

.send-icon {
    font-size: 14px;
}


/* Signature */

.signature-select-wrapper {
    display: flex;
    align-items: center;
}

.signature-select {
    min-width: 145px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    background: #ffffff;
    color: #344054;
    font-size: 13px;
}


/* =========================================================
   8. EMAIL FORM
   ========================================================= */

#composeEmailForm {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* =========================================================
   9. RECIPIENT SECTION
   ========================================================= */

.email-recipient-row {
    flex: 0 0 auto;
    min-height: 48px;
    display: flex;
    align-items: stretch;
    margin: 10px 20px 0;
    border: 1px solid #d3deeb;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}


/* To / Cc / Bcc label */

.recipient-label {
    flex: 0 0 64px;
    min-height: 46px;
    border: 0;
    border-right: 1px solid #d3deeb;
    background: #f8fafc;
    color: #101828;
    font-size: 14px;
    font-weight: 600;
    cursor: default;
}


/* Recipient input area */

.recipient-area {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.recipient-chip-wrapper {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 10px;
    box-sizing: border-box;
}


/* Recipient chips */

.recipient-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}


/* Recipient input */

.recipient-input {
    flex: 1 1 180px;
    min-width: 150px;
    height: 32px;
    padding: 0 4px;
    border: 0;
    outline: none;
    background: transparent;
    color: #101828;
    font-size: 13px;
}

    .recipient-input::placeholder {
        color: #98a2b3;
    }


/* =========================================================
   10. RECIPIENT OPTION BUTTONS
   ========================================================= */

.recipient-option-button {
    flex: 0 0 auto;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #006fe6;
    font-size: 13px;
    cursor: pointer;
}

    .recipient-option-button:hover {
        text-decoration: underline;
    }


/* =========================================================
   11. SUBJECT
   ========================================================= */

.email-subject-row {
    flex: 0 0 auto;
    margin: 10px 20px 0;
}

.email-subject-input {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0 16px;
    border: 1px solid #d3deeb;
    border-radius: 6px;
    outline: none;
    background: #ffffff;
    color: #101828;
    font-size: 14px;
}

    .email-subject-input::placeholder {
        color: #667085;
    }

    .email-subject-input:focus {
        border-color: #7db3ed;
        box-shadow: 0 0 0 2px rgba(0, 111, 230, 0.08);
    }


/* =========================================================
   12. EDITOR AREA
   IMPORTANT:
   No Quill/editor styling is included here.
   Your rich-text-editor.css controls the actual editor.
   ========================================================= */

.email-editor-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 10px 20px 0;
    border: 1px solid #d3deeb;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}


/*
 * The rich-text-editor partial should occupy
 * the available height supplied by this wrapper.
 *
 * No .ql-* rules are intentionally added here.
 */


/* These remain reusable when attachment
   functionality is enabled again. */

.email-attachment-content {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
}

.email-icon-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.attachment-drag-text {
    color: #344054;
    font-size: 14px;
}

/*.attachment-preview-wrapper {
    margin-left: auto;
}*/

.attachment-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-more-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* =========================================================
   14. BOTTOM ACTION BAR
   Always remains at bottom of compose card.
   ========================================================= */

.email-bottom-toolbar {
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 20px;
    border-top: 1px solid #e4ebf3;
    background: #ffffff;
    box-sizing: border-box;
}


    /* Left side */

    .email-bottom-toolbar > div:first-child {
        display: flex;
        align-items: center;
    }


/* Right side */

.email-bottom-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}


/* =========================================================
   15. NEW EMAIL BUTTON
   ========================================================= */

.email-new-email-button {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid #2684ff;
    border-radius: 5px;
    background: #ffffff;
    color: #006fe6;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .email-new-email-button:hover {
        background: #f3f8ff;
        border-color: #006fe6;
    }


/* =========================================================
   16. DRAFT BUTTON
   ========================================================= */

.email-draft-button {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    background: #ffffff;
    color: #344054;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

    .email-draft-button:hover {
        background: #f8fafc;
    }


/* =========================================================
   17. SEND EMAIL BUTTON
   ========================================================= */

.email-send-email-button {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border: 1px solid #006fc9;
    border-radius: 5px;
    background: #1268b3;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

    .email-send-email-button:hover {
        background: #0d5b9f;
    }

    .email-send-email-button i,
    .email-send-email-button svg {
        width: 17px;
        height: 17px;
    }


/* =========================================================
   18. SEND BUTTON WITH DROPDOWN
   ========================================================= */

.email-send-group-button {
    display: inline-flex;
    align-items: stretch;
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
}

    .email-send-group-button .email-send-email-button {
        height: 40px;
        border-radius: 5px 0 0 5px;
        border-right: 1px solid rgba(255, 255, 255, 0.35);
    }

.email-send-dropdown-button {
    width: 38px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #006fc9;
    border-left: 0;
    border-radius: 0 5px 5px 0;
    background: #1268b3;
    color: #ffffff;
    cursor: pointer;
}

    .email-send-dropdown-button:hover {
        background: #0d5b9f;
    }


/* =========================================================
   19. LUCIDE ICON NORMALIZATION
   Reusable across MailFlow.
   ========================================================= */

[data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
    flex-shrink: 0;
}


/* =========================================================
   20. ACCESSIBILITY
   ========================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =========================================================
   21. RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .email-compose-header {
        padding: 16px;
    }

    .email-compose-title {
        font-size: 24px;
    }

    .email-compose-header-actions {
        gap: 7px;
    }

    .mail-action-button,
    .mail-dropdown-button {
        height: 40px;
    }

    .email-recipient-row,
    .email-subject-row,
    .email-editor-wrapper {
        margin-left: 14px;
        margin-right: 14px;
    }

    .email-bottom-toolbar {
        padding-left: 14px;
        padding-right: 14px;
    }
}


/* =========================================================
   22. TABLET / SMALL SCREEN
   ========================================================= */

@media (max-width: 800px) {

    .email-compose-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .email-compose-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .email-compose-title {
        font-size: 23px;
    }

    .email-bottom-toolbar {
        flex: 0 0 auto;
        min-height: 64px;
    }
}


/* =========================================================
   23. MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .email-compose-page {
        border-radius: 0;
    }

    .email-compose-header {
        padding: 14px;
    }

    .email-compose-title {
        font-size: 21px;
    }

    .email-compose-subtitle {
        font-size: 13px;
    }

    .email-compose-header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .mail-action-button,
    .mail-dropdown-button {
        width: 100%;
    }

    .email-recipient-row,
    .email-subject-row,
    .email-editor-wrapper {
        margin-left: 10px;
        margin-right: 10px;
    }

    .recipient-label {
        flex-basis: 52px;
    }

    .email-bottom-toolbar {
        padding: 8px 10px;
    }

    .email-bottom-right {
        gap: 6px;
    }

    .email-new-email-button,
    .email-draft-button,
    .email-send-email-button {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/*
    Main content css part here
*/
/* ==========================================================================
   main.css - Main Content Section Styling
   Wellcargo MailFlow - Compose Email View
   ========================================================================== */

@import url('vendor/quill.snow.css');

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background-color: #ffffff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.composer-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.composer-header {
    margin-bottom: 0;
}

.composer-title {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.composer-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.4;
}

/* ==========================================================================
   Action Bar: Send Split Button & Signature Button
   ========================================================================== */
.composer-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edebe9;
    position: relative;
}

/* Send Split Button */
.btn-send-group {
    display: inline-flex;
    align-items: stretch;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 120, 212, 0.1);
    position: relative;
    height: 26px;
}

.btn-send-main {
    background-color: #0078d4;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

    .btn-send-main:hover {
        background-color: #106ebe;
    }

    .btn-send-main svg {
        width: 13px;
        height: 13px;
        stroke-width: 2.2;
    }

.btn-send-divider {
    width: 1px;
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-send-dropdown-toggle {
    background-color: #0078d4;
    color: #ffffff;
    border: none;
    border-radius: 0 3px 3px 0;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

    .btn-send-dropdown-toggle:hover {
        background-color: #106ebe;
    }

    .btn-send-dropdown-toggle svg {
        width: 12px;
        height: 12px;
        stroke-width: 2.2;
    }

/* Signature Button */
.signature-wrapper {
    position: relative;
}

.btn-signature {
    background-color: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    color: #0078d4;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    padding: 0 8px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

    .btn-signature:hover {
        background-color: #f0f7ff;
        border-color: #0078d4;
    }

    .btn-signature .sig-icon {
        display: inline-flex;
        align-items: center;
    }

        .btn-signature .sig-icon svg {
            width: 14px;
            height: 14px;
            stroke-width: 2;
            stroke: #0078d4;
        }

    .btn-signature .sig-chevron {
        display: inline-flex;
        align-items: center;
    }

        .btn-signature .sig-chevron svg {
            width: 12px;
            height: 12px;
            stroke-width: 2.2;
            stroke: #0078d4;
        }

/* Dropdown menus for Send & Signature */
.actions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    display: none;
    flex-direction: column;
    z-index: 150;
    overflow: hidden;
    padding: 4px 0;
}

    .actions-dropdown.show {
        display: flex;
    }

.btn-send-group .actions-dropdown {
    left: 0;
}

.signature-wrapper .actions-dropdown {
    right: 0;
}

.dropdown-action-item {
    padding: 7px 12px;
    font-size: 12px;
    color: #334155;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.15s ease;
}

    .dropdown-action-item:hover {
        background-color: #f1f5f9;
        color: #0078d4;
    }

/* ==========================================================================
   Form Fields: To and Subject
   ========================================================================== */
.composer-fields {
    display: flex;
    flex-direction: column;
}

/* "To" Field Row */
.field-row-to {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #edebe9;
}

.btn-to-badge {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 1.5px 10px;
    font-size: 11.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    user-select: none;
    height: 22px;
    display: inline-flex;
    align-items: center;
}

    .btn-to-badge:hover {
        background-color: #f8fafc;
        border-color: #9ca3af;
    }

.input-to-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.input-to {
    flex: 1;
    min-width: 150px;
    border: none;
    outline: none;
    font-size: 12.5px;
    color: #1e293b;
    font-family: inherit;
    background: transparent;
    padding: 2px 0;
}

    .input-to::placeholder {
        color: #94a3b8;
    }

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #e8f2fc;
    color: #0078d4;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11.5px;
    font-weight: 500;
}

.recipient-chip-remove {
    background: none;
    border: none;
    color: #0078d4;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 0;
}

/* Subject Field Row */
.field-row-subject {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #edebe9;
}

.input-subject {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1e293b;
    font-family: inherit;
    background: transparent;
    padding: 8px 0;
}

    .input-subject::placeholder {
        color: #64748b;
    }

/* ==========================================================================
   Quill Text Editor Customization & Complete Formatting Toolbar
   ========================================================================== */
.editor-section {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    flex: 1;
    min-height: 160px;
    background-color: #ffffff;
    min-height: 0;
    overflow: hidden;
}

/* Keep the toolbar fixed above the editor's independently scrolling body. */
.editor-section > .reusable-rich-editor {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#custom-toolbar {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    background-color: #f8fafc;
}

.editor-section > .reusable-rich-editor > .ql-container {
    flex: 1 1 0;
    min-height: 0;
    height: 0;
}

/* Signature create/edit: keep the toolbar visible while only the body scrolls. */
.signature-editor-page {
    min-height: 0;
    padding: 20px 24px;
    box-sizing: border-box;
}

.signature-editor-page .signature-editor-form {
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
}

.signature-content-group {
    min-width: 0;
}

.signature-editor-section {
    display: flex;
    flex: none;
    flex-direction: column;
    width: 100%;
    height: 420px;
    min-height: 280px;
    margin-top: 0;
    overflow: hidden;
    border: 1px solid #dce8f7;
    border-radius: 6px;
    background: #fff;
}

.signature-editor-section > .reusable-rich-editor {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
}

.signature-editor-section #custom-toolbar {
    flex: 0 0 auto;
}

.signature-editor-section > .reusable-rich-editor > .ql-container {
    flex: 1 1 0;
    width: 100%;
    height: 0;
    min-height: 0;
    overflow: hidden;
}

.signature-editor-section .ql-editor {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px !important;
    box-sizing: border-box;
}

.signature-editor-section .ql-editor img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 700px) {
    .signature-editor-page {
        padding: 12px;
    }

    .signature-editor-page .signature-editor-form {
        padding: 16px;
    }

    .signature-editor-section {
        height: 360px;
    }
}

.editor-section .ql-editor img {
    max-width: 100%;
    height: auto;
}

.quill-image-resize-handle {
    position: fixed;
    z-index: 10000;
    width: 14px;
    height: 14px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #0878d1;
    box-shadow: 0 0 0 1px #0878d1;
    cursor: nwse-resize;
    touch-action: none;
}

.quill-image-resize-handle[hidden] {
    display: none;
}

    /* Maximized / Fullscreen Editor State */
    .editor-section.editor-maximized {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
        padding: 20px 32px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3) !important;
    }

        .editor-section.editor-maximized #custom-toolbar {
            border: 1px solid #e2e8f0;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
            margin-bottom: 12px;
            padding: 6px 10px;
        }

        .editor-section.editor-maximized .ql-container {
            flex: 1;
            height: 100%;
        }

        .editor-section.editor-maximized .ql-editor {
            height: 100%;
            min-height: 100%;
            font-size: 15px;
            line-height: 1.7;
            padding: 16px 4px !important;
        }

/* Full Toolbar Container */
#custom-toolbar {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 4px;
    padding: 3px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    user-select: none;
}

.tb-group-left {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

    .tb-group-left::-webkit-scrollbar {
        height: 2px;
    }

    .tb-group-left::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }

.tb-group-right {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
    flex-shrink: 0;
}

/* Toolbar Divider Separator */
.tb-separator {
    width: 1px;
    height: 15px;
    background-color: #e2e8f0;
    margin: 0 1.5px;
    flex-shrink: 0;
}

/* Custom Select Dropdowns */
.tb-select {
    background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    height: 23px;
    padding: 0 13px 0 5px;
    font-size: 10.5px;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.15s ease;
    flex-shrink: 0;
}

    .tb-select:hover,
    .tb-select:focus {
        border-color: #9ca3af;
    }

/* Toolbar Buttons */
.tb-btn {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    height: 23px;
    padding: 0 4px;
    font-size: 11px;
    font-family: inherit;
    color: #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: background-color 0.12s ease, border-color 0.12s ease;
    outline: none;
    user-select: none;
    box-sizing: border-box;
    flex-shrink: 0;
}

    .tb-btn:hover {
        background-color: #f3f4f6;
        border-color: #9ca3af;
    }

    .tb-btn.active,
    .tb-btn.ql-active {
        background-color: #e2e8f0;
        border-color: #64748b;
        color: #0078d4;
    }

/* Specific button styles */
.tb-btn-b {
    font-weight: 700;
    min-width: 21px;
    padding: 0;
}

.tb-btn-i {
    font-style: italic;
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 12.5px;
    min-width: 21px;
    padding: 0;
}

.tb-btn-u {
    text-decoration: underline;
    min-width: 21px;
    padding: 0;
}

.tb-btn-s {
    text-decoration: line-through;
    min-width: 21px;
    padding: 0;
}

/* Color & Highlight Picker Buttons */
.tb-color-picker-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.tb-color-hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-swatch {
    width: 9px;
    height: 9px;
    border: 1px solid #94a3b8;
    display: inline-block;
    border-radius: 1px;
}

    .color-swatch.swatch-text {
        background-color: #000000;
    }

    .color-swatch.swatch-highlight {
        background-color: #ffff00;
    }

.tb-icon-marker svg {
    width: 11px;
    height: 11px;
    stroke-width: 2;
}

/* Alignment and icon buttons */
.tb-btn-icon {
    min-width: 21px;
    padding: 0 3px;
}

    .tb-btn-icon svg {
        width: 12px;
        height: 12px;
        stroke-width: 2;
    }

/* Maximize button in the right corner */
#btn-maximize-editor {
    min-width: 22px;
    color: #1e293b;
}

    #btn-maximize-editor.active {
        background-color: #e8f2fc;
        border-color: #0078d4;
        color: #0078d4;
    }

/* Quill Editor Canvas */
.ql-container.ql-snow {
    border: none !important;
    font-family: var(--font-family, 'Segoe UI', sans-serif) !important;
    font-size: 13.5px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ql-editor {
    flex: 1;
    min-height: 140px;
    padding: 12px 0 !important;
    outline: none;
    font-size: 13.5px;
    line-height: 1.5;
    color: #1e293b;
    font-family: inherit;
}

    .ql-editor.ql-blank::before {
        left: 0 !important;
        right: 0 !important;
        color: #94a3b8 !important;
        font-style: normal !important;
        font-family: inherit !important;
    }

    /* Blockquote & Code styling in editor */
    .ql-editor blockquote {
        border-left: 3px solid #0078d4;
        padding-left: 10px;
        color: #475569;
        font-style: italic;
        margin: 8px 0;
    }

    .ql-editor pre.ql-syntax,
    .ql-editor .ql-code-block {
        background-color: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        padding: 8px 12px;
        font-family: 'Courier New', Courier, monospace;
        font-size: 12.5px;
        margin: 8px 0;
    }

    /* Editor Table Formatting */
    .ql-editor table {
        border-collapse: collapse;
        width: 100%;
        margin: 10px 0;
        border: 1px solid #cbd5e1;
    }

    .ql-editor th,
    .ql-editor td {
        border: 1px solid #cbd5e1;
        padding: 5px 8px;
        font-size: 13px;
    }

    .ql-editor th {
        background-color: #f8fafc;
        font-weight: 600;
    }

/* ==========================================================================
   Attachment Card
   ========================================================================== */
.attachment-card {
    margin-top: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

    .attachment-card.drag-over {
        border-color: #0078d4;
        background-color: #f0f7ff;
        border-style: solid;
    }

.attachment-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-icon-box {
    width: 26px;
    height: 26px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .attachment-icon-box svg {
        width: 14px;
        height: 14px;
        stroke: #475569;
        stroke-width: 2;
        transform: rotate(-45deg);
    }

.attachment-text-container {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.attachment-text-main {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}

.attachment-text-sub {
    font-size: 11px;
    color: #94a3b8;
}

/* Add Attachment Button */
.btn-add-attachment {
    background-color: #ffffff;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 4px 12px;
    color: #0078d4;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    white-space: nowrap;
    height: 26px;
}

    .btn-add-attachment:hover {
        background-color: #f0f7ff;
        border-color: #0078d4;
    }

    .btn-add-attachment svg {
        width: 13px;
        height: 13px;
        stroke: #0078d4;
        stroke-width: 2.2;
        transform: rotate(-45deg);
    }

/* Attached Files List */
.attached-files-container {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11.5px;
    color: #334155;
}

    .file-chip svg {
        width: 13px;
        height: 13px;
        stroke: #0078d4;
    }

.file-chip-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-chip-size {
    color: #64748b;
    font-size: 10.5px;
}

.file-chip-remove {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .file-chip-remove:hover {
        color: #ef4444;
    }

    .file-chip-remove svg {
        width: 12px;
        height: 12px;
        stroke: currentColor;
    }

/* Toast Notification */
.toast-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1e293b;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

    .toast-notice.show {
        opacity: 1;
        transform: translateY(0);
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        padding: 12px 14px;
    }

    .attachment-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-add-attachment {
        align-self: flex-start;
    }
}

.email-count {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
    padding-right: 10px;
    font-size: 13px;
    color: #333;
}

.recipient-chip-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
    /* One row initially */
    height: 25px;
    max-height: 25px;
    overflow: hidden;
}

.recipient-chip-wrapper.has-overflow {
    max-height: 83px;
    overflow-y: auto;
    overflow-x: hidden;
}
/* Scrollbar */
.recipient-chip-wrapper::-webkit-scrollbar {
    width: 6px;
}

.recipient-chip-wrapper::-webkit-scrollbar-track {
    background: #f3f2f1;
}

.recipient-chip-wrapper::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 4px;
}

.email-recipient-chip {
    display: inline-flex;
    align-items: center;
    height: 25px;
    padding: 0 5px 0 7px;
    border: 1px solid #d6b800;
    border-radius: 4px;
    background: #fffef0;
    color: #323130;
    font-size: 13px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.chip-remove {
    width: 20px;
    height: 20px;
    margin-left: 4px;
    padding: 0;
    border: none;
    background: transparent;
    color: #605e5c;
    font-size: 18px;
    line-height: 18px;
    cursor: pointer;
}

.chip-remove:hover {
    color: #a4262c;
}


.email-attachment-area.drag-over {
    background: #eef6fc;
    outline: 2px dashed #0078d4;
    outline-offset: -3px;
}

.attachment-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

/* Individual attachment */

.email-attachment-item {
    flex: 0 0 220px;
    width: 220px;
    height: 46px;
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    background: #ffffff;
}

    .email-attachment-item:hover {
        background: #faf9f8;
    }

.attachment-file-icon {
    width: 30px;
    flex: 0 0 30px;
    font-size: 19px;
}

.attachment-file-info {
    flex: 1;
    min-width: 0;
}

.attachment-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.attachment-file-size {
    margin-top: 1px;
    color: #605e5c;
    font-size: 10px;
}

.attachment-remove {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border: none;
    background: transparent;
    color: #605e5c;
    font-size: 18px;
    cursor: pointer;
}

    .attachment-remove:hover {
        color: #a4262c;
    }


/* More attachments */

.attachment-more-button {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #323130;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

    .attachment-more-button:hover {
        color: #0078d4;
        text-decoration: underline;
    }

.attachment-preview-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

/* Validation */

.validation-summary,
.field-validation {
    color: #a4262c;
    font-size: 13px;
}

.email-service-warning {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 5px 5px;
    margin: 10px 10px;
    background: #fff4f2;
    border: 1px solid #e8b4ad;
    border-left: 4px solid #c9372c;
    border-radius: 8px;
    color: #7a271a;
}

.email-service-warning-icon {
    font-size: 22px;
    padding-top: 2px;
}

.email-service-warning-content h5 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.email-service-warning-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Keep the editor inside its grid row; let its content scroll. */
#composeEmailForm {
    grid-template-rows: 48px 48px minmax(0, 1fr) auto 70px;
}

    #composeEmailForm > .editor-section {
        min-height: 0;
        overflow: hidden;
    }

.editor-section > .reusable-rich-editor {
    flex: 1 1 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.editor-section > .reusable-rich-editor,
.editor-section .ql-container {
    min-height: 0;
    overflow: hidden;
}

/*.editor-section .ql-container {
    height: auto;
    min-height: 0;
}*/

.editor-section .ql-editor {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 16px 16px 28px;
}

.email-attachment-area {
    flex: 0 0 auto;
    z-index: auto;
}

#composeEmailForm {
    grid-template-rows: 48px 48px minmax(0, 1fr) auto 70px;
}
