/* ================================================= */
/*  Slimmail Stylesheet (v9.4 - Security Gate Size)  */
/* ================================================= */

/* --- Main List on /slimmail page --- */
.slimmail-conversation-list { border: 1px solid #ccc; border-radius: 4px; overflow: hidden; }
.slimmail-conversation-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background-color: #f9f9f9; border-bottom: 1px solid #ddd; cursor: pointer; transition: background-color 0.2s; }
.slimmail-conversation-header:hover { background-color: #f0f0f0; }
.slimmail-conversation-header.status-new { border-left: 5px solid #28a745; }
.slimmail-conversation-header.status-read { border-left: 5px solid #aaa; }
.slimmail-conversation-header.status-answered { border-left: 5px solid #007bff; }
.slimmail-conversation-header.status-sent { border-left: 5px solid #845ef7; }
.slimmail-conversation-header.status-archived { border-left: 5px solid #6c757d; }
.header-left-group { flex-grow: 1; min-width: 0; }
.header-main-content { font-size: 1.1em; color: #222; }
.header-meta-content { display: flex; align-items: center; gap: 15px; }
.header-meta-content .meta-info { color: #6c757d; font-size: 0.9em; font-style: italic; }
.message-count { color: #888; font-size: 0.9em; }
.status-badge { color: white; font-size: 0.8em; font-weight: bold; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; }
.status-new .status-badge { background-color: #28a745; }
.status-read .status-badge { background-color: #aaa; }
.status-answered .status-badge { background-color: #007bff; }
.status-sent .status-badge { background-color: #845ef7; }
.status-archived .status-badge { background-color: #6c757d; }
.slimmail-conversation-body { padding: 15px; background-color: #fdfdfd; border-bottom: 1px solid #ddd; }


/* --- Forms & Fields --- */
.slimmail-form, .slimmail-reply-form {
    padding: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}
.slimmail-form-field { margin-bottom: 20px; }
.slimmail-form-field label { display: block; font-weight: bold; margin-bottom: 5px; color: #333; }
.slimmail-form-field input[type="text"], .slimmail-form-field input[type="email"], .slimmail-form-field textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.slimmail-form-field button { padding: 12px 25px; border: none; background-color: #2c5b8a; color: white; font-size: 1.1em; cursor: pointer; border-radius: 4px; }

/* --- Single Conversation View on /message --- */
.slimmail-conversation-thread, #slimmail-last-message-wrapper, #slimmail-full-thread-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    max-width: 700px;
    margin: 30px auto;
}
.slimmail-thread-message { padding: 20px; border-bottom: 1px solid #eee; }
.slimmail-thread-message:last-child { border-bottom: none; }
.slimmail-thread-message .thread-meta { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dotted #ccc; color: #333; font-size: 1em; }
.slimmail-thread-message .thread-meta strong { font-weight: bold; }
.slimmail-thread-message .slimmail-thread-body { color: #555555; font-style: italic; line-height: 1.6; padding-top: 10px; margin-top: 10px; border-top: 1px dotted #e0e0e0; }
.slimmail-thread-toggle-button { display: inline-block; background-color: #f0f0f0; color: #333; padding: 8px 15px; border: 1px solid #ccc; border-radius: 4px; text-decoration: none; font-size: 0.9em; font-weight: bold; cursor: pointer; }
.slimmail-thread-toggle-button:hover { background-color: #e0e0e0; }

/* --- Security Gate on /message --- */
/* --- THIS IS THE FIX: Reduced max-width and padding --- */
.slimmail-security-gate { background-color: #f5f5f5; max-width: 380px; margin: 40px auto; padding: 25px; border: 1px solid #ccc; border-radius: 5px; text-align: center; }
.slimmail-security-gate h3, .slimmail-security-gate p { color: #333; }
.slimmail-security-gate label { margin-right: 10px; color: #555; font-weight: bold; }
.slimmail-security-gate input[type="text"] { width: 120px; padding: 8px; font-size: 1.2em; text-align: center; letter-spacing: 5px; }
.slimmail-security-gate form button { background-color: #2c5b8a !important; color: white !important; margin-left: 15px; border: 1px solid transparent !important; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out; margin-top: 15px; padding: 10px 20px; }
.slimmail-security-gate form button:hover { background-color: #fff !important; color: #2c5b8a !important; border-color: #2c5b8a !important; }

/* --- Admin Notices, Popups & Overlays --- */
.slimmail-header-nav { font-size: 1.2em; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #ccc; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.slimmail-header-nav a.slimmail-new-message-link { margin-left: auto; background-color: #28a745; color: white; padding: 5px 12px; text-decoration: none; border-radius: 20px; font-size: 11px; text-transform: uppercase; font-weight: bold; line-height: 1.5; }
.slimmail-error { color: #D8000C; background-color: #FFBABA; padding: 10px; border: 1px solid; margin-bottom: 15px; border-radius: 4px; }
.slimmail-sending-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: transparent;  z-index: 9998; backdrop-filter: none; -webkit-backdrop-filter: none; }
.slimmail-sending-message { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(40, 40, 40, 0.8); color: #fff; font-size: 1.8em; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); z-index: 9999; padding: 25px 50px; border-radius: 8px; }
.slimmail-popup-notice { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: rgba(40, 40, 40, 0.9); color: white; padding: 20px 40px; border-radius: 8px; z-index: 99999; font-size: 1.2em; font-weight: bold; opacity: 1; transition: opacity 0.5s ease-in-out; }
.slimmail-popup-notice.fade-out { opacity: 0; }

/* ================================================= */
/*    DEFINITIVE Badge-Style Buttons (High Specificity)   */
/* ================================================= */
.slimmail-actions-bar > form, .action-group-left > form, .action-group-right > form { margin: 0 !important; }
#slimmail-list-container .slimmail-action-btn { display: inline-block; padding: 4px 12px !important; border-radius: 20px !important; color: #fff !important; text-decoration: none !important; font-weight: bold !important; font-size: 11px !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; text-transform: uppercase !important; border: none !important; cursor: pointer !important; line-height: 1.5 !important; transition: all 0.2s ease-in-out !important; box-shadow: none !important; transform: none !important; }
#slimmail-list-container .slimmail-action-btn:hover { opacity: 0.85 !important; }
#slimmail-list-container .slimmail-action-btn.btn-view { background-color: #f08c00 !important; }
#slimmail-list-container .slimmail-action-btn.btn-archive { background-color: #6c757d !important; }
#slimmail-list-container .slimmail-action-btn.btn-delete { background-color: #c92a2a !important; }
#slimmail-list-container .slimmail-action-btn.btn-reply { background-color: #007bff !important; }


/* --- Urgent Status Styles --- */
.slimmail-conversation-header.status-urgent { border-left: 5px solid #c92a2a; }
.slimmail-action-btn.btn-urgent { background-color: #e03131 !important; }
.slimmail-conversation-header.status-urgent .header-main-content { color: #c92a2a; font-weight: bold; }

/* --- Custom Blue Buttons for Forms --- */
.slimmail-reply-form .slimmail-form-field button,
.slimmail-admin-initiate-form .slimmail-form-field button { background-color: #6EC1E4 !important; color: #fff !important; border: 1px solid transparent !important; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out; }
.slimmail-reply-form .slimmail-form-field button:hover,
.slimmail-admin-initiate-form .slimmail-form-field button:hover { background-color: #fff !important; color: #6EC1E4 !important; border-color: #6EC1E4 !important; }

/* --- Admin Contact Picker Styles --- */
.slimmail-contact-picker-container { padding: 20px; border: 1px solid #ddd; background: #f9f9f9; border-radius: 4px; height: 100%; box-sizing: border-box; }
.slimmail-contact-picker-container h3 { margin-top: 0; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #e0e0e0; color: #333; }
#slimmail-contact-search { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; margin-bottom: 15px; font-size: 1em; }
#slimmail-contact-results { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; border: 1px solid #ddd; border-radius: 4px; background-color: #fff; }
.contact-item { padding: 10px 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: background-color 0.2s ease; display: flex; flex-direction: column; }
.contact-item:last-child { border-bottom: none; }
.contact-item:hover { background-color: #e6f7ff; }
.contact-name { font-weight: bold; color: #333; margin-bottom: 3px; }
.contact-email { font-size: 0.9em; color: #666; }
.contact-item-none { padding: 15px; color: #888; font-style: italic; text-align: center; }

/* ================================================= */
/*          Assignment / Triage Styles               */
/* ================================================= */
.assignment-flag-container { flex-shrink: 0; margin-left: 20px; }
.assignment-flag { padding: 4px 12px; border-radius: 20px; color: #fff; font-weight: bold; font-size: 11px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; }
.assignment-flag-clive { background-color: #1c7ed6; }
.assignment-flag-vic   { background-color: #37b24d; }
.assignment-flag-slim  { background-color: #7048e8; }

.slimmail-actions-bar {
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}
.action-group-left { display: flex; align-items: center; gap: 8px; }
.action-group-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-assign { background-color: #adb5bd !important; color: #fff !important; border: 1px solid #adb5bd !important; }
.btn-assign:hover { background-color: #868e96 !important; opacity: 1 !important; }
.btn-assign.btn-assign-active { background-color: #c92a2a !important; color: #fff !important; border-color: #c92a2a !important; }

/* ================================================= */
/*          Admin Tools (Canned Responses)           */
/* ================================================= */
.slimmail-admin-tool-container { padding: 20px; border: 1px solid #ddd; background: #f9f9f9; border-radius: 4px; margin-top: 20px; }
.slimmail-admin-tool-container h3, .slimmail-admin-tool-container label, .slimmail-admin-tool-container p { color: #333 !important; }
.tool-section { margin-bottom: 15px; }
.tool-section label { font-weight: bold; margin-right: 10px; }
#canned-response-select { min-width: 250px; }
.section-management #canned-manage-btn, .section-management #add-canned-btn { margin-bottom: 15px; border: 1px solid #ccc !important; background: #fff !important; color: #555 !important; box-shadow: none !important; }
.section-management #canned-manage-btn:hover, .section-management #add-canned-btn:hover { background: #f0f0f0 !important; }
#canned-responses-list { list-style: none; margin: 0 0 15px 0; padding: 0; border: 1px solid #ddd; border-radius: 3px; background: #fff; }
#canned-responses-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid #eee; }
#canned-responses-list li:last-child { border-bottom: none; }
#canned-responses-list .response-title { color: #222 !important; font-weight: 600 !important; border: none !important; background: none !important; padding: 0 !important; }
.response-actions button.button-link { text-decoration: underline; color: #0073aa; border: none; background: none; cursor: pointer; padding: 0 5px; }
.response-actions button.delete-canned-btn { color: #d63638; }
#canned-response-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10000; display: flex; align-items: center; justify-content: center; }
#canned-response-modal { background: #fff; padding: 25px; border-radius: 4px; width: 90%; max-width: 500px; }
#canned-response-modal h2 { margin-top: 0; }
#canned-response-modal .form-row { margin-bottom: 15px; }
#canned-response-modal label { display: block; font-weight: bold; margin-bottom: 5px; }
#canned-response-modal input[type="text"], #canned-response-modal textarea { width: 100%; padding: 8px; box-sizing: border-box; }
#canned-response-modal .description { font-size: 0.9em; color: #666; margin-top: 5px; }
#canned-response-modal .form-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
.slimmail-admin-tool-container h3, .slimmail-admin-tool-container label, .slimmail-admin-tool-container p { color: #333 !important; }
#canned-response-modal h2, #canned-response-modal label, #canned-response-modal p { color: #333 !important; }
.section-management #canned-manage-btn, .section-management #add-canned-btn, #canned-response-modal .button { border: 1px solid #ccc !important; background: #f7f7f7 !important; color: #555 !important; box-shadow: none !important; text-shadow: none !important; }
#canned-response-modal .button-primary { background: #0073aa !important; border-color: #0073aa !important; color: #fff !important; }
.slimmail-admin-tool-popup { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); background: #23282d; color: #fff; padding: 10px 20px; border-radius: 3px; z-index: 10001; font-size: 13px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); display: none; }
.slimmail-admin-tool-popup.error { background: #d63638; }

/* ================================================= */
/*       UNIFIED ADMIN TOOL BUTTON STYLES            */
/* ================================================= */
#canned-manage-btn, #add-canned-btn, #contact-manage-btn, #add-contact-btn { border: 1px solid #ccc !important; background: #f7f7f7 !important; color: #555 !important; box-shadow: none !important; text-shadow: none !important; font-weight: 600 !important; padding: 6px 14px !important; font-size: 13px !important; line-height: 2 !important; border-radius: 3px !important; margin-bottom: 15px !important; }
#canned-manage-btn:hover, #add-canned-btn:hover, #contact-manage-btn:hover, #add-contact-btn:hover { background: #f0f0f0 !important; border-color: #999 !important; color: #222 !important; }
#add-canned-btn.button-primary, #add-contact-btn.button-primary { background: #0073aa !important; border-color: #0073aa !important; color: #fff !important; }
#add-canned-btn.button-primary:hover, #add-contact-btn.button-primary:hover { background: #0085ba !important; border-color: #0085ba !important; color: #fff !important; }

/* ================================================= */
/*       Message Category Styles                     */
/* ================================================= */
.slimmail-radio-group .radio-options-wrapper { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 10px; }
.slimmail-radio-group .radio-item { display: flex; align-items: center; gap: 5px; }
.slimmail-radio-group input[type="radio"] { accent-color: #007bff; width: 1.2em; height: 1.2em; }
.slimmail-radio-group .radio-item label { font-weight: normal; margin-bottom: 0; }
.category-badge-container { flex-shrink: 0; margin-left: 20px; }
.category-badge { padding: 4px 12px; border-radius: 20px; color: #fff; font-weight: bold; font-size: 11px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; text-align: center; min-width: 80px; }
.category-badge-general { background-color: #6c757d; }
.category-badge-joining { background-color: #007bff; }
.category-badge-technical { background-color: #fd7e14; }
.category-badge-private { background-color: #6f42c1; }
.category-badge-b2b { background-color: #20c997; }
.slimmail-conversation-header { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.header-main-content { margin-bottom: 8px; }

/* ================================================= */
/* === Inline Thread View & IP Address Styles === */
/* ================================================= */

.original-ip { color: #888; font-size: 0.9em; font-weight: normal; }
.slimmail-inline-thread-container { margin-top: 15px; }
.slimmail-thread-message-inline { padding: 12px; border: 1px solid #e9ecef; border-radius: 4px; background-color: #fff; margin-bottom: 10px; }
.slimmail-thread-message-inline:last-child { margin-bottom: 0; }
.thread-meta-inline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dotted #ced4da; font-size: 0.9em; color: #6c757d; }
.first-read-info { font-style: italic; color: #868e96; }
.slimmail-thread-body-inline { font-size: 0.95em; line-height: 1.5; color: #495057; white-space: pre-wrap; }

/* ================================================= */
/*       Center Reply Form Heading & Universal Buttons */
/* ================================================= */
.elementor-shortcode > h3 { max-width: 700px; margin-left: auto; margin-right: auto; padding-left: 20px; box-sizing: border-box; margin-bottom: 20px; }
body .slimmail-form .slimmail-form-field button { background-color: #6EC1E4 !important; color: #fff !important; border: 1px solid #6EC1E4 !important; transition: all 0.2s ease-in-out !important; padding: 12px 25px !important; font-size: 1.1em !important; }
body .slimmail-form .slimmail-form-field button:hover { background-color: #fff !important; color: #6EC1E4 !important; border-color: #6EC1E4 !important; }
body.admin-bar .slimmail-reply-form h3 { color: #555; }

/* ================================================= */
/*    Conditional "Show" Logic for Blocks         */
/* ================================================= */
body:not(.slimmail-is-viewing-message) [data-slimmail-visibility="show-on-reply"] { display: none !important; }
body.slimmail-is-viewing-message [data-slimmail-visibility="show-on-no-reply"] { display: none !important; }

/* ================================================= */
/*     NEW: Style Customer Reply Form Heading      */
/* ================================================= */
/* This rule targets the <h3> heading in the customer's reply form
   on the single message page to ensure it is black.
   The 'body:not(.admin-bar)' selector ensures it doesn't affect logged-in admins. */
body:not(.admin-bar) .slimmail-reply-form h3 {
    color: black !important;
}
/* ================================================= */
/*       Canned Responses UI Polish (Edit Button)    */
/* ================================================= */

.canned-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between items */
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
}

.canned-selector-wrapper label {
    font-weight: bold;
    flex-shrink: 0; /* Prevents the label from shrinking */
}

.canned-selector-wrapper #canned-response-select {
    flex-grow: 1; /* Allows the select box to take up available space */
    min-width: 200px;
}

/* Style the new button to match the 'Manage' button */
#canned-edit-selected-btn {
    border: 1px solid #ccc !important;
    background: #f7f7f7 !important;
    color: #555 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#canned-edit-selected-btn:hover {
    background: #f0f0f0 !important;
    border-color: #999 !important;
    color: #222 !important;
}

/* Specific color for the Edit button */
#slimmail-canned-responses-manager .response-actions .edit-canned-btn {
    background-color: #007bff !important; /* Blue */
}

/* Specific color for the Delete button */
#slimmail-canned-responses-manager .response-actions .delete-canned-btn {
    background-color: #c92a2a !important; /* Red */
}
/* --- New Category Badge Color --- */
.category-badge-consultation { background-color: #17a2b8; } /* Teal */

/* Add this CSS to your stylesheet to fix the assignment flag visibility */

.assignment-flag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #6c757d; /* A neutral, visible grey */
    color: #ffffff;           /* White text for contrast */
    border-radius: 12px;       /* Rounded corners to match other badges */
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 8px;          /* Space it out from the category badge */
    vertical-align: middle;
}
/*
 * SlimMail Inline Thread Order
 * Displays messages within the dropdown with the newest at the top.
 */
.slimmail-inline-thread-container {
    display: flex;
    flex-direction: column-reverse; /* This is the magic! */
}

/* ================================================= */
/*   UNIFIED ADMIN TOOL ACTION BUTTONS (FINAL)       */
/* ================================================= */

/* Base style for Edit/Delete buttons in all management lists */
.slimmail-admin-tool-container .contact-actions .button-link,
.slimmail-admin-tool-container .response-actions .button-link {
    display: inline-block;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 11px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    text-transform: uppercase !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: none !important;
    transform: none !important;
    margin-left: 5px; /* Adds space between buttons */
}

.slimmail-admin-tool-container .contact-actions .button-link:hover,
.slimmail-admin-tool-container .response-actions .button-link:hover {
    opacity: 0.85 !important;
}

/* Specific color for ALL Edit buttons */
.slimmail-admin-tool-container .edit-contact-btn,
.slimmail-admin-tool-container .edit-canned-btn {
    background-color: #007bff !important; /* Blue */
}

/* Specific color for ALL Delete buttons */
.slimmail-admin-tool-container .delete-contact-btn,
.slimmail-admin-tool-container .delete-canned-btn {
    background-color: #c92a2a !important; /* Red */
}

/* ================================================= */
/*   PERSONAL CONTACTS LIST ITEM LAYOUT & STYLE      */
/* ================================================= */

/* Remove default list styling (fixes the bullet points) */
#personal-contacts-list {
    list-style-type: none !important;
    padding-left: 0 !important;
}

/* Apply Flexbox to each list item for a clean, single-line layout */
#personal-contacts-list li {
    display: flex;
    justify-content: space-between; /* Pushes info to left, actions to right */
    align-items: center;          /* Vertically aligns everything */
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

#personal-contacts-list li:last-child {
    border-bottom: none;
}

/* Style the container for the name and email to be black */
#personal-contacts-list .contact-info {
    color: black;
}

/* Make the contact name bold */
#personal-contacts-list .contact-name {
    font-weight: bold;
    margin-right: 0.75em; /* Adds a nice space after the name */
}

/* Ensure the actions container doesn't shrink */
#personal-contacts-list .contact-actions {
    flex-shrink: 0;
    white-space: nowrap; /* Prevents buttons from wrapping */
}

/* ================================================= */
/*      CONTACT MODAL BUTTON STYLING (FINAL)         */
/* ================================================= */

#contact-modal .form-actions button {
    /* --- UPDATED PROPERTIES FOR SMALLER SIZE --- */
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    /* --- End of Updates --- */
    
    font-weight: bold !important;
    cursor: pointer !important;
    border: 1px solid transparent !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Save Button (Primary Action) - Blue */
#contact-modal .form-actions button[type="submit"] {
    background-color: #007bff !important;
    color: #fff !important;
    border-color: #007bff !important;
}

#contact-modal .form-actions button[type="submit"]:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

/* Cancel Button (Secondary Action) - Grey */
#contact-modal .form-actions #contact-modal-cancel {
    background-color: #6c757d !important;
    color: #fff !important;
    border-color: #6c757d !important;
}

#contact-modal .form-actions #contact-modal-cancel:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
}
/* ================================================= */
/*          MODAL TITLE COLOR FIX                    */
/* ================================================= */

/* Targets the H2 title inside the contact modal specifically */
#contact-modal #contact-modal-title {
    color: black !important;
}

/* ================================================= */
/*        INBOX POLLING STATUS BOX STYLES            */
/* ================================================= */

#slimmail-polling-status {
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-right: auto; /* Pushes other nav links to the right */
    transition: all 0.3s ease-in-out;
    color: #fff;
    min-width: 220px; /* Give it some space */
    text-align: center;
}

/* Default state: No new messages */
#slimmail-polling-status.status-ok {
    background-color: #6c757d; /* A calm, neutral grey */
}
#slimmail-polling-status.status-ok:hover {
    background-color: #5a6268;
}

/* New message state: Draws attention */
#slimmail-polling-status.status-new {
    background-color: #007bff; /* The vibrant blue */
    animation: pulse-blue 2s infinite;
}
#slimmail-polling-status.status-new:hover {
    background-color: #0056b3;
    animation: none; /* Stop pulsing on hover */
}

/* A subtle pulse animation for new messages */
@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}
/* ================================================= */
/*   JS-GENERATED MESSAGE LINE STYLING (FINAL)       */
/* ================================================= */
.slimmail-message-line {
    /* This creates the space for a blank line when the user hits Enter twice */
    min-height: 1em;
}
/* ================================================= */
/*       ATTACHMENT LINK STYLING                     */
/* ================================================= */
.slimmail-attachment-link-container {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95em;
}

.slimmail-attachment-link-container strong {
    color: #495057;
}

.slimmail-attachment-link-container a {
    text-decoration: underline;
    color: #007bff;
}

.slimmail-attachment-link-container a:hover {
    color: #0056b3;
}
/* (Please add this block to the END of your existing CSS file) */

/* ================================================= */
/*       ATTACHMENT & FORMATTING FIXES               */
/* ================================================= */

/* 1. Fix the faint filename text by forcing a dark color */
.slimmail-form-field input[type="file"] {
    color: #212529; /* A standard, dark bootstrap text color */
}

/* 2. Style the attachment download link container */
.slimmail-attachment-link-container {
    margin-top: 20px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95em;
}

.slimmail-attachment-link-container strong {
    color: #495057;
    margin-right: 8px;
}

.slimmail-attachment-link-container a {
    text-decoration: underline;
    color: #007bff;
    font-weight: bold;
}

.slimmail-attachment-link-container a:hover {
    color: #0056b3;
}

/* 3. Override any unwanted formatting on the message bodies */
.slimmail-thread-body,
.slimmail-thread-body-inline {
    white-space: pre-wrap; /* This preserves all line breaks and spacing */
}

/* (Please add this block to the END of your existing CSS file) */

/* ================================================= */
/*       MAINTENANCE & DELETION TOOLS                */
/* ================================================= */

.maintenance-action {
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
}

#maintenance-feedback {
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    font-weight: bold;
}

.thread-meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.slimmail-single-delete-btn {
    background: none;
    border: none;
    color: #c92a2a;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
}
.slimmail-single-delete-btn:hover {
    color: #a61e1e;
}

/* (Please add this block to the END of your existing CSS file) */

/* ================================================= */
/*       ATTACHMENT DELETE BUTTON UI POLISH          */
/* ================================================= */

.slimmail-attachment-link-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95em;
}

.slimmail-attachment-link-container strong {
    color: #495057;
    margin-right: 8px;
}

.slimmail-attachment-link-container a {
    text-decoration: underline;
    color: #007bff;
    font-weight: bold;
}

.slimmail-attachment-link-container a:hover {
    color: #0056b3;
}

.slimmail-delete-attachment-form {
    margin: 0;
}

.btn-delete-attachment {
    background-color: #c92a2a !important;
    padding: 4px 12px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    border-radius: 20px !important;
    border: none !important;
    font-weight: bold !important;
    cursor: pointer !important;
    line-height: 1.5 !important;
}

.btn-delete-attachment:hover {
    opacity: 0.85 !important;
}
/* (Please add this block to the END of your existing CSS file) */

/* ================================================= */
/*       FINAL 404 PAGE STYLING FIX                  */
/* ================================================= */

/*
 This rule is highly specific. It will only apply when WordPress has
 triggered a 404 on one of our message view pages, ensuring the
 theme's intended black background is applied.
*/
body.error404.slimmail-is-viewing-message {
    background-color: #000 !important;
}
/* ================================================= */
/*          NEW: Lock/Unlock UI Styles               */
/* ================================================= */

/* 1. Style for the "Lock" button in the actions bar */
#slimmail-list-container .slimmail-action-btn.btn-lock {
    background-color: #fd7e14 !important; /* Orange */
}

/* 2. Style for the "Unlock" button in the actions bar */
#slimmail-list-container .slimmail-action-btn.btn-unlock {
    background-color: #28a745 !important; /* Green */
}

/* 3. Style for the conversation header when a thread is locked */
.slimmail-conversation-header.status-locked {
    border-left: 5px solid #6f42c1; /* Purple */
    background-color: #f4f2f7;
}

/* 4. Style for the status badge itself when locked */
.status-locked .status-badge {
    background-color: #6f42c1; /* Purple */
}
/* ================================================= */
/*       NON-BLOCKING POPUP NOTICE STYLES            */
/* ================================================= */

#slimmail-popup-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748; /* Dark grey-blue */
    color: #fff;
    padding: 15px 25px;
    border-radius: 6px;
    z-index: 100000;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

#slimmail-popup-notice.error {
    background-color: #c53030; /* Red for errors */
}

#slimmail-popup-notice.fade-out {
    opacity: 0;
}
.category-badge-system { background-color: #845ef7; } /* Same as 'Sent' for consistency */

/* FPDF Badge/Pill base (reusable) */
.badge-pill{
  display:inline-block;
  padding: .35rem .7rem;
  border-radius: 9999px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: transform .06s ease, box-shadow .15s ease, opacity .2s ease;
}

/* Specific PDF accent */
.slimmail-action-btn.btn-pdf{
  background: linear-gradient(180deg, #ff5a5a, #d63b3b);
  color: #fff !important;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.slimmail-action-btn.btn-pdf:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.16);
  opacity: .95;
}
.slimmail-action-btn.btn-pdf:active{
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

/* Slimmail toast */
/* Slimmail toast (positionable) */
#slm-toast{
  position:fixed; z-index:99999;
  display:none; align-items:center; gap:.6rem;
  padding:.6rem .8rem; border-radius:.6rem; box-shadow:0 8px 30px rgba(0,0,0,.25);
  background:#222; color:#fff; font:600 13px/1.2 system-ui,-apple-system,Segoe UI,Inter,Roboto,sans-serif;
}
#slm-toast.visible{ display:flex; }
#slm-toast .spinner{
  width:16px; height:16px; border:3px solid #fff; border-top-color:transparent; border-radius:50%;
  animation:slm-spin 1s linear infinite;
}
#slm-toast.error{ background:#b00020; }
#slm-toast.ok   { background:#0b7a0b; }

/* positions */
#slm-toast.pos-top{
  top:16px; left:50%; transform:translateX(-50%);
}
#slm-toast.pos-middle{
  top:50%; left:50%; transform:translate(-50%,-50%);
}
#slm-toast.pos-bottom-right{
  right:16px; bottom:16px; transform:none;
}

@keyframes slm-spin { to { transform: rotate(360deg); } }

/* Toast "panel" mode */
#slm-toast.is-panel {
  width: 720px; max-width: calc(100vw - 40px);
  max-height: 85vh; overflow: hidden; padding: 0; border-radius: 12px;
}
#slm-toast.is-panel .text { width: 100%; max-height: 85vh; overflow: auto; padding: 12px 16px; }
#slm-toast .slm-toast-panel-head { position: sticky; top: 0; display:flex; justify-content:space-between; align-items:center; padding: 8px 0 12px; background: inherit; }
#slm-toast .slm-close { background: none; border: 0; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
#slm-toast .slm-toast-panel-body { display:block; }

