        body {
            padding-top: 20px;
            padding-bottom: 20px;
        }
        .container {
            max-width: 1200px;
        }
        .header {
            padding-bottom: 20px;
            margin-bottom: 20px;
            border-bottom: 1px solid #e5e5e5;
        }
        .sms-manager {
            margin-bottom: 30px;
        }
        .character-count {
            text-align: right;
            font-size: 12px;
            float: right;
        }
        .char-limit-container {
            margin-top: 5px;
            overflow: hidden; /* Clearfix */
        }
        .alert {
            padding: 15px;
            margin-bottom: 20px;
            border: 1px solid transparent;
            border-radius: 4px;
        }
        .alert-success {
            color: #3c763d;
            background-color: #dff0d8;
            border-color: #d6e9c6;
        }
        .alert-danger {
            color: #a94442;
            background-color: #f2dede;
            border-color: #ebccd1;
        }
        .login-form {
            max-width: 400px;
            margin: 0 auto;
            padding: 15px;
        }
        .user-info {
            text-align: right;
            margin-bottom: 20px;
        }
        .logo-container {
            text-align: center;
            margin-bottom: 15px;
        }
        .logo-container img {
            max-width: 200px; /* Adjust this value to control the logo size */
            height: auto;
        }
        .action-icons {
            white-space: nowrap;
            text-align: center;
        }
        .action-icons .btn {
            padding: 3px 8px;
            margin: 0 2px;
        }
        .action-icons form {
            display: inline;
        }
        /* Message log table styling */
        #message-log-panel {
            margin-bottom: 30px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        
        #message-log-panel .panel-heading {
            background-color: #f5f5f5;
            border-bottom: 1px solid #ddd;
            padding: 10px 15px;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: space-between;
        }
        
        #message-log-panel .panel-body {
            padding: 0;
            display: block;
            height: auto;
            overflow: visible;
        }
        
        /* Reset any potentially conflicting styles for table-responsive */
        .table-responsive.message-log-scroll {
            height: 500px !important;
            overflow-y: scroll !important;
            overflow-x: hidden !important;
            border: none !important;
            margin-bottom: 15px !important;
            display: block !important;
            width: 100% !important;
            -webkit-overflow-scrolling: touch !important;
            position: relative !important;
        }
        
        /* Make absolute sure no other styles are interfering */
        .message-log-scroll {
            height: 500px !important;
            overflow-y: scroll !important;
            overflow-x: hidden !important;
            border: none !important;
            margin-bottom: 15px !important;
            display: block !important;
            width: 100% !important;
        }
        
        #message-log-panel .panel-body {
            padding: 0 !important;
            display: block !important;
            height: auto !important;
            overflow: visible !important;
            position: relative !important;
        }
        
        /* Make table head sticky */
        .message-log-table thead th {
            position: sticky !important;
            top: 0 !important;
            background-color: #f9f9f9 !important;
            z-index: 10 !important;
            border-bottom: 2px solid #ddd !important;
        }
        
        .message-log-table {
            width: 100%;
            margin-bottom: 0;
            border-collapse: collapse;
            table-layout: fixed;
            background-color: #fff;
        }
        
        .message-log-table th,
        .message-log-table td {
            padding: 8px 10px !important;
            border-bottom: 1px solid #eee;
            word-wrap: break-word;
            overflow: hidden;
            text-overflow: ellipsis;
            position: relative; /* Ensure position context for children */
        }
        
        /* Column widths for message log table */
        .message-log-table th:nth-child(1), /* Type */
        .message-log-table td:nth-child(1) {
            width: 60px;
            max-width: 60px;
        }
        
        .message-log-table th:nth-child(2), /* Ward */
        .message-log-table td:nth-child(2) {
            width: 100px;
            max-width: 100px;
        }
        
        .message-log-table th:nth-child(3), /* Contacts */
        .message-log-table td:nth-child(3),
        .message-log-table th:nth-child(4), /* Characters */
        .message-log-table td:nth-child(4) {
            width: 80px;
            max-width: 80px;
            text-align: center;
        }
        
        .message-log-table th:nth-child(5), /* Status */
        .message-log-table td:nth-child(5) {
            width: 120px;
            max-width: 120px;
        }
        
        .message-log-table th:nth-child(6), /* Cost */
        .message-log-table td:nth-child(6) {
            width: 80px;
            max-width: 80px;
            text-align: right;
        }
        
        .message-log-table th:nth-child(7), /* Date Sent */
        .message-log-table td:nth-child(7) {
            width: 150px;
            max-width: 150px;
        }
        
        .message-log-table th:nth-child(8), /* Message */
        .message-log-table td:nth-child(8) {
            width: auto;
            min-width: 120px;
        }
        
        /* Message cell styling */
        .message-log-table .message-cell {
            max-width: 0;
            overflow: hidden;
        }
        
        .message-log-table .message-content {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 100%;
            display: block;
        }
        
        /* Panel body for message log */
        #message-log-panel .panel-body {
            padding: 0;
        }
        
        /* Message log panel */
        #message-log-panel {
            margin-bottom: 30px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            display: block;
        }
        
        @media (min-width: 768px) {
            .message-log-table {
                display: table;
                width: 100%;
            }
            
            .message-log-table thead {
                display: table-header-group;
            }
            
            .message-log-table tbody {
                display: table-row-group;
            }
            
            .message-log-table tr {
                display: table-row;
            }
            
            .message-log-table td {
                display: table-cell;
            }

            /* Ensure the message log can still scroll on desktop */
            .message-log-scroll {
                max-height: 500px;
                overflow-y: auto !important;
            }
        }
        
        /* Panel heading improvements for consistent alignment */
        .panel-heading.clearfix {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .panel-title.pull-left {
            margin: 0;
            flex: 1;
        }
        
        .pull-right .btn-sm {
            margin-left: 5px;
        }
        
        /* Specific styling for the Contacts panel */
        .panel-primary .panel-heading {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        /* Keep action buttons properly sized and aligned */
        .action-icons {
            white-space: nowrap;
            text-align: center;
        }
        
        .action-icons .btn {
            padding: 3px 8px;
            margin: 0 2px;
            width: auto;
            height: auto;
            display: inline-block;
        }
        
        /* Contacts table scrollable container */
        .contacts-table-scroll {
            max-height: 800px; /* Height for approximately 20 contacts */
            overflow-y: auto;
            margin-bottom: 10px;
        }
        
        .contacts-table-scroll thead th {
            position: sticky;
            top: 0;
            background-color: #f9f9f9;
            z-index: 10;
        }
        
        /* Contacts search and filter container */
        .contacts-search-container {
            margin-bottom: 15px;
        }
        
        .contacts-search-container .form-group {
            margin-bottom: 10px;
        }
        
        /* Handle long words and URLs */
        .message-content * {
            word-break: break-all;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }
        
        /* Responsive table improvements */
        @media (max-width: 767px) {
            .table-responsive {
                border: none;
                margin-bottom: 0;
            }
            
            /* Message log specific styles for mobile */
            .message-log-table {
                display: block;
                width: 100%;
                table-layout: fixed;
            }
            
            .message-log-table thead {
                display: none; /* Hide table headers on mobile */
            }
            
            .message-log-table tbody, 
            .message-log-table tr {
                display: block;
                width: 100%;
            }
            
            .message-log-table tr {
                margin-bottom: 20px;
                border: 1px solid #ddd;
                border-radius: 4px;
                padding: 12px;
                background-color: #f9f9f9;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            }
            
            /* Create a card-based layout for each message */
            .message-log-table td {
                display: block;
                text-align: left;
                border: none;
                position: relative;
                padding: 8px 0;
                margin-bottom: 8px;
                border-bottom: 1px solid #eee;
                width: 100%;
                box-sizing: border-box;
            }
            
            .message-log-table td:last-child {
                border-bottom: none;
                margin-bottom: 0;
            }
            
            /* Style the labels */
            .message-log-table td:before {
                content: attr(data-title);
                display: block;
                font-weight: bold;
                color: #555;
                margin-bottom: 5px;
            }
            
            /* Special styling for message cell */
            .message-log-table td.message-cell {
                padding: 8px 0;
                margin-bottom: 12px;
                border-bottom: 1px solid #ddd;
                font-size: 14px;
                word-wrap: break-word;
                word-break: break-word;
                overflow-wrap: break-word;
            }
            
            .message-log-table td.message-cell .message-content {
                white-space: normal;
                width: 100%;
                display: inline-block;
                overflow-wrap: break-word;
                word-wrap: break-word;
                word-break: break-word;
            }
            
            .message-log-table td.message-cell:before {
                content: "Message:";
                display: block;
                font-weight: bold;
                color: #555;
                margin-bottom: 8px;
            }
            
            /* Contacts and Groups table mobile styles */
            #contactsTable,
            .table-responsive table {
                display: block;
                width: 100%;
                table-layout: fixed;
            }
            
            #contactsTable thead,
            .table-responsive table thead {
                display: none; /* Hide table headers on mobile */
            }
            
            #contactsTable tbody, 
            #contactsTable tr,
            .table-responsive table tbody,
            .table-responsive table tr {
                display: block;
                width: 100%;
            }
            
            #contactsTable tr,
            .table-responsive table tr {
                margin-bottom: 15px;
                border: 1px solid #ddd;
                border-radius: 4px;
                padding: 12px;
                background-color: #f9f9f9;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            }
            
            #contactsTable td,
            .table-responsive table td {
                display: block;
                text-align: left;
                border: none;
                position: relative;
                padding: 8px 0;
                margin-bottom: 8px;
                border-bottom: 1px solid #eee;
                width: 100%;
                box-sizing: border-box;
            }
            
            #contactsTable td:last-child,
            .table-responsive table td:last-child {
                border-bottom: none;
                margin-bottom: 0;
            }
            
            /* Add data labels for mobile view */
            #contactsTable td:nth-of-type(2):before { content: "Last Name: "; font-weight: bold; }
            #contactsTable td:nth-of-type(3):before { content: "First Name: "; font-weight: bold; }
            #contactsTable td:nth-of-type(4):before { content: "Phone: "; font-weight: bold; }
            #contactsTable td:nth-of-type(5):before { content: "Email: "; font-weight: bold; }
            #contactsTable td:nth-of-type(6):before { content: "Groups: "; font-weight: bold; }
            #contactsTable td:nth-of-type(7):before { content: "Status: "; font-weight: bold; }
            
            /* Groups table data labels for mobile */
            .table-responsive table td:nth-of-type(2):before { content: "Group Name: "; font-weight: bold; }
            .table-responsive table td:nth-of-type(3):before { content: "Members: "; font-weight: bold; }
            .table-responsive table td:nth-of-type(4):before { content: "Date Added: "; font-weight: bold; }
            
            /* Special treatment for the actions cell in mobile view */
            #contactsTable td.action-icons,
            .table-responsive table td.action-icons {
                display: flex;
                justify-content: flex-start;
                align-items: center;
                padding: 10px 0;
                background-color: #f5f5f5;
                border-bottom: 1px solid #ddd;
                margin-bottom: 10px;
            }
            
            /* Ensure action buttons stay properly sized */
            .action-icons .btn {
                flex: none;
                margin: 0 5px 0 0;
                width: auto !important;
                min-width: 40px;
                padding: 6px 12px;
                display: inline-block !important;
            }
            
            /* Make sure all panel headings maintain alignment on mobile */
            .panel-heading.clearfix,
            .panel-primary .panel-heading {
                display: flex !important;
                flex-direction: row !important;
                flex-wrap: nowrap !important;
                justify-content: space-between !important;
                align-items: center !important;
            }
            
            /* Ensure panel titles and buttons are properly aligned */
            .panel-title.pull-left {
                float: left !important;
                margin-bottom: 0 !important;
                width: auto !important;
                flex: 1 !important;
                text-align: left !important;
            }
            
            .pull-right {
                float: right !important;
                width: auto !important;
                text-align: right !important;
                margin-bottom: 0 !important;
            }
            
            /* Allow add buttons to maintain their sizing */
            .pull-right .btn-sm {
                width: auto !important;
                margin-bottom: 0 !important;
            }
            
            /* Improve contacts table on mobile */
            .contacts-table td {
                vertical-align: middle;
            }
            
            /* Make replace code buttons more mobile-friendly */
            .replace-codes-container {
                margin-top: 10px;
            }
            
            .replace-codes-container .btn {
                margin-bottom: 5px;
                margin-right: 5px;
            }
            
            /* Improve modal dialogs on mobile */
            @media (max-width: 480px) {
                .modal-dialog {
                    margin: 10px;
                    width: auto;
                }
                
                .modal-content {
                    border-radius: 5px;
                }
                
                .modal-header {
                    padding: 10px 15px;
                }
                
                .modal-body {
                    padding: 15px;
                }
                
                .modal-footer {
                    padding: 10px 15px;
                }
                
                /* Improve form elements on mobile */
                .form-group {
                    margin-bottom: 15px;
                }
                
                .checkbox-group {
                    max-height: 200px !important;
                }
                
                /* Don't make action buttons full width even on very small screens */
                .action-icons .btn-sm {
                    width: auto !important;
                    min-width: 40px !important;
                    margin-bottom: 0 !important;
                    padding: 6px 12px !important;
                }
            }
            
            /* Fix modal display issues on mobile */
            @media (max-width: 767px) {
                /* Ensure modal is properly displayed on mobile */
                .modal {
                    position: fixed;
                    top: 0;
                    right: 0;
                    bottom: 0;
                    left: 0;
                    overflow: hidden;
                    -webkit-overflow-scrolling: touch;
                    outline: 0;
                    z-index: 1050;
                    background-color: rgba(0, 0, 0, 0.5);
                }
                
                .modal.fade .modal-dialog {
                    transform: translate(0, 0) !important;
                    transition: transform 0.3s ease-out;
                }
                
                .modal-dialog {
                    position: relative;
                    width: auto;
                    margin: 10px;
                    max-width: calc(100% - 20px);
                }
                
                .modal-content {
                    position: relative;
                    background-color: #fff;
                    border-radius: 5px;
                    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
                    background-clip: padding-box;
                    outline: 0;
                    max-height: calc(100vh - 20px);
                    overflow-y: auto;
                    margin: 10px auto;
                    width: 100%;
                }
                
                /* Center modals vertically */
                .modal-dialog {
                    display: flex;
                    align-items: center;
                    min-height: calc(100% - 20px);
                    margin: 0 auto;
                    height: 100%;
                }
                
                /* Ensure modal is above all other content */
                .modal {
                    z-index: 1050 !important;
                }
                
                .modal-backdrop {
                    z-index: 1040 !important;
                }
                
                .modal-dialog {
                    z-index: 1050 !important;
                }
                
                .modal-content {
                    z-index: 1051 !important;
                }
                
                .modal-backdrop {
                    position: fixed;
                    top: 0;
                    right: 0;
                    bottom: 0;
                    left: 0;
                    z-index: 1040;
                    background-color: #000;
                }
                
                .modal-backdrop.fade {
                    opacity: 0;
                }
                
                .modal-backdrop.in {
                    opacity: 0.5;
                }
                
                /* Fix for checkbox group in modals */
                .checkbox-group {
                    max-height: 150px;
                    overflow-y: auto;
                    border: 1px solid #ddd;
                    padding: 10px;
                    border-radius: 4px;
                    background-color: #fff;
                    z-index: 1060;
                }
                
                /* Ensure the modal body can scroll */
                .modal-body {
                    position: relative;
                    padding: 15px;
                    max-height: calc(100vh - 125px);
                    overflow-y: auto;
                    -webkit-overflow-scrolling: touch;
                }
                
                /* Specific fix for checkbox group in edit contact modal */
                .modal-body .checkbox-group {
                    max-height: 150px !important;
                    overflow-y: auto !important;
                    background-color: #fff;
                    position: relative;
                    z-index: 1060;
                    border: 1px solid #ddd !important;
                    margin-bottom: 10px;
                    padding: 10px;
                }
                
                /* Make checkbox labels wrap properly */
                .modal-body .checkbox label {
                    white-space: normal;
                    word-break: break-word;
                    display: flex;
                    align-items: flex-start;
                }
                
                .modal-body .checkbox input[type="checkbox"] {
                    margin-top: 2px;
                    margin-right: 6px;
                    flex-shrink: 0;
                }
            }
            
            /* Improve filter controls on mobile */
            @media (max-width: 767px) {
                .contacts-search-container .row [class*="col-"] {
                    margin-bottom: 10px;
                }
                
                /* Fix for panel headings on mobile - keep buttons on the right */
                .panel-heading.clearfix {
                    display: flex;
                    flex-direction: row;
                    flex-wrap: nowrap;
                    align-items: center;
                    justify-content: space-between;
                }
                
                .panel-title.pull-left {
                    float: left !important;
                    margin-bottom: 0;
                    width: auto;
                    flex: 1;
                    text-align: left;
                }
                
                .pull-right {
                    float: right !important;
                    width: auto;
                    text-align: right;
                    margin-bottom: 0;
                }
                
                /* Make buttons full width on smaller screens, except for action buttons */
                @media (max-width: 480px) {
                    /* Do not make these buttons full width */
                    .action-icons .btn-sm {
                        width: auto;
                        margin-bottom: 0;
                    }
                    
                    /* Other buttons can be full width */
                    .btn-sm:not(.action-icons .btn-sm):not(.pull-right .btn-sm) {
                        width: 100%;
                        margin-bottom: 5px;
                        padding: 8px 12px;
                        font-size: 14px;
                    }
                    
                    /* Adjust tabs for better mobile experience */
                    .nav-tabs > li {
                        float: none;
                        width: 100%;
                        text-align: center;
                        margin-bottom: 5px;
                    }
                    
                    .nav-tabs > li > a {
                        margin-right: 0;
                        border-radius: 4px;
                    }
                }
            }
        }
        
        /* Custom styles for contact chips */
        .contact-chip {
            display: inline-block;
            padding: 5px 10px;
            margin: 5px;
            border-radius: 15px;
            background-color: #f0f0f0;
            transition: opacity 0.3s ease;
        }
        
        .contact-chip:hover {
            opacity: 0.8;
        }
        
        /* Fix for alert close button positioning */
        .alert-dismissible .close {
            position: absolute !important;
            top: 10px !important;
            right: 10px !important;
            color: inherit !important;
            opacity: 0.7 !important;
            padding: 0 !important;
            font-size: 21px !important;
        }
        
        .alert-dismissible .close:hover {
            opacity: 1 !important;
        }
        
        /* Make alerts have appropriate padding for the close button */
        .alert-dismissible {
            padding-right: 35px !important;
            position: relative !important;
        }
        
        /* Improve By Selection contacts display on mobile */
        @media (max-width: 767px) {
            /* Contact selection specific styles */
            #specificContactsSelection .table-responsive {
                border: none !important;
                margin-bottom: 0 !important;
            }
            
            #specificContactsSelection table {
                border: none !important;
                width: 100% !important;
            }
            
            #specificContactsSelection thead {
                display: none !important;
            }
            
            /* Contact row styling - match main contacts table */
            #specificContactsSelection tr {
                display: flex !important;
                align-items: center !important;
                padding: 8px 12px !important;
                margin-bottom: 6px !important;
                background: #fff !important;
                border: 1px solid #ddd !important;
                border-radius: 4px !important;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
                cursor: pointer !important;
                transition: all 0.2s ease !important;
                position: relative !important;
                overflow: hidden !important;
                min-height: 48px !important;
                flex-wrap: nowrap !important;
                width: 100% !important;
            }
            
            /* Checkbox cell */
            #specificContactsSelection td:first-child {
                flex: 0 0 40px !important;
                margin-right: 10px !important;
                display: flex !important;
                align-items: center !important;
                padding: 0 !important;
                border: none !important;
                background: none !important;
                position: static !important;
            }
            
            /* Name cells */
            #specificContactsSelection td:nth-child(2){
                font-weight: bold !important;
                font-size: 15px !important;
                padding: 0 !important;
                border: none !important;
                background: none !important;
                position: static !important;
                display: inline !important;
            }
            /* Cell field on by selection? */
            #specificContactsSelection td:nth-child(3) {
                font-weight: normal !important;
                font-size: 15px !important;
                padding: 0 !important;
                border: none !important;
                background: none !important;
                position: static !important;
                text-align: right !important;
                margin-left: auto !important;
            }
            
            /* Add comma after last name */
            #specificContactsSelection td:nth-child(2)::after {
                content: ", " !important;
            }
            
            /* Phone cell */
            #specificContactsSelection td:nth-child(4) {
                font-weight: normal !important;
                font-size: 14px !important;
                color: #555 !important;
                text-align: right !important;
                margin-left: auto !important;
                padding: 0 !important;
                border: none !important;
                background: none !important;
                position: static !important;
                flex: 1 !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
            }
            
            /* Explicitly hide email and other cells */
            #specificContactsSelection td:nth-child(5),
            #specificContactsSelection td:nth-child(6),
            #specificContactsSelection td:nth-child(7),
            #specificContactsSelection td:nth-child(8) {
                display: none !important;
                width: 0 !important;
                height: 0 !important;
                padding: 0 !important;
                margin: 0 !important;
                border: none !important;
                overflow: hidden !important;
                opacity: 0 !important;
                position: absolute !important;
                pointer-events: none !important;
            }
            
            /* Remove any data labels */
            #specificContactsSelection td::before {
                display: none !important;
                content: none !important;
            }
            
            /* Improve checkbox appearance */
            #specificContactsSelection input[type="checkbox"] {
                margin: 0 !important;
                vertical-align: middle !important;
            }
            
            /* Selected row styling */
            #specificContactsSelection tr:has(input[type="checkbox"]:checked) {
                background-color: #f0f7ff !important;
                border-color: #a4c7f5 !important;
            }
            
            /* Hover effect */
            #specificContactsSelection tr:hover {
                background-color: #f5f5f5 !important;
            }
            
            /* Inactive contact styling */
            #specificContactsSelection tr.text-muted {
                opacity: 0.7 !important;
                background-color: #f5f5f5 !important;
            }
            
            #specificContactsSelection tr.text-muted td {
                color: #777 !important;
            }
        }
        
        /* Ensure desktop view remains unchanged */
        @media (min-width: 768px) {
            #specificContactsSelection table {
                display: table !important;
                width: 100% !important;
            }
            
            #specificContactsSelection tr {
                display: table-row !important;
            }
            
            #specificContactsSelection td {
                display: table-cell !important;
            }
            
            #specificContactsSelection td:nth-child(5),
            #specificContactsSelection td:nth-child(6),
            #specificContactsSelection td:nth-child(7),
            #specificContactsSelection td:nth-child(8) {
                display: table-cell !important;
                width: auto !important;
                height: auto !important;
                position: static !important;
                opacity: 1 !important;
            }
        }

        /* Better search box styling */
        #specificContactsSearch {
            width: 100%;
            max-width: 100%;
            margin-bottom: 15px;
        }
        
        /* Improve select all checkbox placement */
        #selectAllContacts {
            margin-right: 5px;
        }
        
        /* Add indicator for selected items */
        #specificContactsSelection table tr:has(input[type="checkbox"]:checked) {
            background-color: #f0f7ff;
            border-color: #a4c7f5;
        }
        /* Removed the duplicate checkmark styling that was causing visual issues */

        
        /* Make cards more visually appealing */
        #specificContactsSelection table tr {
            transition: all 0.2s ease;
        }
        
        /* Active state indication */
        #specificContactsSelection .label-success {
            font-size: 11px;
            padding: 3px 6px;
            border-radius: 3px;
        }
        
        /* Contact info styling */
        #specificContactsSelection table td:nth-child(4)::before,
        #specificContactsSelection table td:nth-child(5)::before {
            display: inline-block;
            min-width: 50px;
        }
        
        /* Help users understand selection better */
        #specificContactsSelection small.text-muted {
            margin-bottom: 15px;
            display: block;
            font-size: 13px;
            color: #777;
            padding: 5px;
            background-color: #f8f8f8;
            border-radius: 4px;
            border-left: 3px solid #003366;
        }

        /* Recipient Count Display */
        .recipient-count-display {
            display: inline-block;
            margin-left: 15px;
            padding: 6px 12px;
            background-color: #f0f0f0;
            border-radius: 4px;
            font-size: 14px;
            color: #555;
        }

        #recipientCount {
            font-weight: bold;
            color: #337ab7;
        }

        /* Phone input validation styles */
        .phone-input.is-invalid {
            border-color: #dc3545;
            padding-right: calc(1.5em + 0.75rem);
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right calc(0.375em + 0.1875rem) center;
            background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
        }

        .invalid-feedback {
            display: block;
            width: 100%;
            margin-top: 0.25rem;
            font-size: 80%;
            color: #dc3545;
        }

        /* Message controls layout */
        .message-controls {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
        }
        
        .control-group {
            display: flex;
            align-items: center;
            white-space: nowrap;
        }
        
        .control-label {
            margin-right: 8px;
            font-weight: normal;
            color: #333;
        }
        
        .control-input {
            display: inline-block;
        }
        
        .control-input select {
            width: auto;
            min-width: 130px;
        }
        
        /* Wrapper for Send to controls */
        .send-to-wrapper {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        
        /* Panel styling */
        .panel-title {
            font-size: 18px;
            font-weight: 500;
            margin: 0;
        }
        
        .panel-default > .panel-heading {
            background-color: #f5f5f5;
            border-color: #ddd;
            padding: 10px 15px;
        }
        
        /* Panel body base styling */
        .panel-body {
            padding: 15px !important;
            position: relative !important;
            overflow: hidden !important;
        }
        
        /* Message log specific panel body */
        #message-log-panel .panel-body {
            padding: 0 !important;
        }
        
        /* Message log scroll container */
        .message-log-scroll {
            max-height: 400px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            margin-bottom: 10px !important;
        }
        
        /* SMS Replies section spacing */
        .sms-replies-table {
            margin: 0 !important;
            padding: 0 !important;
        }
        
        /* SMS Replies table rows */
        .sms-replies-table tr {
            padding: 12px 15px !important;
        }
        
        /* Mobile view adjustments */
        @media (max-width: 767px) {
            .sms-replies-table tr {
                margin: 15px !important;
                padding: 12px 15px !important;
            }
            
            .panel-body {
                padding: 15px !important;
            }
        }
        
        /* Form control rows */
        .send-control-rows {
            margin-bottom: 15px;
        }
        
        .send-control-row {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .send-label {
            min-width: 70px;
            margin: 0;
            font-weight: normal;
        }
        
        .send-field {
            flex: 0 0 auto; /* Change from flex: 1 to not take full width */
        }
        
        /* Specific width for the message type dropdown */
        #messageType, #wardSelect, #groupSelect.visible {
            width: auto;
            min-width: 140px;
            max-width: 180px;
        }
        
        .send-fields {
            display: flex;
            gap: 10px;
        }
        
        .send-fields select {
            flex: 0 0 auto; /* Change from flex: 1 to match Send as dropdown */
            min-width: 140px;
            max-width: 180px;
        }
        
        /* Style dropdowns */
        .form-control.input-sm {
            height: 34px;
            padding: 5px 10px;
            border-radius: 4px;
        }
        
        /* Mobile styles */
        @media (max-width: 767px) {
            /* Keep the same layout on mobile, but with some adjustments */
            .send-control-row {
                margin-bottom: 15px;
            }
            
            .send-label {
                min-width: 70px;
            }
            
            /* Adjust all dropdowns on mobile with more specific selectors */
            #messageType, 
            #wardSelect, 
            #groupSelect.visible,
            .send-fields select {
                width: auto !important;
                min-width: 140px !important;
                max-width: 180px !important;
            }
            
            .send-fields {
                gap: 8px;
            }
        }
        
        /* Very small screens */
        @media (max-width: 480px) {
            .send-fields {
                gap: 5px;
            }
            
            /* Slightly smaller on very small screens */
            #messageType, 
            #wardSelect, 
            #groupSelect.visible,
            .send-fields select {
                min-width: 130px !important;
                max-width: 160px !important;
            }
        }
        
        /* Handle the JS showing/hiding of groupSelect differently */
        #groupSelect {
            display: inline-block !important; /* Override inline style */
            visibility: hidden; /* Hide it initially */
            width: 0; /* Take no space */
            margin: 0;
            padding: 0;
            border: 0;
            height: 0;
            overflow: hidden;
            opacity: 0;
        }
        
        #groupSelect.visible {
            visibility: visible;
            width: auto;
            margin: inherit;
            padding: 5px 10px;
            border: 1px solid #ccc;
            height: 34px;
            overflow: visible;
            opacity: 1;
        }

        /* Update styles for mobile contacts table */
        @media (max-width: 767px) {
            /* Basic row setup */
            .contacts-table tr {
                display: flex !important;
                align-items: center !important;
                padding: 8px 12px !important;
                margin-bottom: 6px !important;
                background: #fff !important;
                border-radius: 4px !important;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
            }

            /* Hide the table header */
            .contacts-table thead {
                display: none !important;
            }

            /* Checkbox cell */
            .contacts-table td:first-child {
                flex: 0 0 40px !important;
                margin-right: 10px !important;
                display: flex !important;
                align-items: center !important;
            }

            /* Name cell */
            .contacts-table td:nth-child(2) {
                flex: 1 !important;
                font-weight: bold !important;
                font-size: 15px !important;
                margin-right: 10px !important;
            }

            /* Phone cell */
            .contacts-table td:nth-child(3) {
                font-weight: normal !important;
                font-size: 14px !important;
                color: #555 !important;
                text-align: right !important;
                padding-right: 5px !important;
            }

            /* Hide all other cells */
            .contacts-table td:nth-child(4),
            .contacts-table td:nth-child(5),
            .contacts-table td:nth-child(6),
            .contacts-table td:nth-child(7),
            .contacts-table td:nth-child(8) {
                display: none !important;
            }

            /* Remove any data labels */
            .contacts-table td::before {
                display: none !important;
                content: none !important;
            }

            /* Inactive contact styling */
            .contacts-table tr.text-muted {
                opacity: 0.7 !important;
                background-color: #f5f5f5 !important;
            }

            .contacts-table tr.text-muted td {
                color: #777 !important;
            }
        }

        /* First name */
        .contacts-table td:nth-child(3) {
            flex: 0 0 auto !important;
            white-space: nowrap !important;
            display: inline-block !important;
        }

        /* Phone column - take remaining space */
        .contacts-table td:nth-child(4) {
            flex: 1 1 auto !important;
            text-align: right !important;
            font-size: 15px !important;
            color: #444 !important;
            padding-right: 10px !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        /* Hide all other cells */
        .contacts-table td:nth-child(5),
        .contacts-table td:nth-child(6),
        .contacts-table td:nth-child(7),
        .contacts-table td:nth-child(8) {
            display: none !important;
        }

        /* Base filter visibility classes */
        .filter-hidden {
            display: none !important;
        }

        .filter-visible {
            display: table-row !important;
        }

        /* Desktop view styles */
        @media (min-width: 768px) {
            .contacts-table {
                display: table !important;
                width: 100% !important;
                table-layout: fixed !important;
                border-collapse: collapse !important;
            }
            
            .contacts-table thead {
                display: table-header-group !important;
            }
            
            .contacts-table tbody {
                display: table-row-group !important;
            }
            
            .contacts-table tr {
                display: table-row !important;
            }
            
            .contacts-table td {
                display: table-cell !important;
            }

            /* Filter visibility for desktop */
            .contacts-table tr.filter-hidden {
                display: none !important;
            }

            .contacts-table tr.filter-visible {
                display: table-row !important;
            }
        }

        /* Mobile view styles */
        @media (max-width: 767px) {
            .contacts-table tr.filter-hidden {
                display: none !important;
            }

            .contacts-table tr.filter-visible {
                display: flex !important;
            }
        }

        /* Mobile formatting for Groups Table */
        @media (max-width: 767px) {
            .groups-table tr.mobile-view {
                display: flex !important;
                flex-direction: row !important;
                align-items: center !important;
                padding: 8px 12px !important;
                min-height: 50px !important;
                flex-wrap: nowrap !important;
                width: 100% !important;
                position: relative !important;
                margin-bottom: 5px !important;
                border-bottom: 1px solid #eee !important;
            }
            
            .groups-table tr.mobile-view td {
                margin: 0 !important;
                padding: 0 !important;
                border: none !important;
                background: none !important;
                position: static !important;
                display: block !important;
            }
            
            .groups-table tr.mobile-view td.action-icons {
                flex: 0 0 80px !important;
                width: 80px !important;
                min-width: 80px !important;
                display: flex !important;
                justify-content: flex-start !important;
                align-items: center !important;
                margin-right: 10px !important;
            }
            
            .groups-table tr.mobile-view td.action-icons .btn {
                margin-right: 5px !important;
                width: 32px !important;
                height: 32px !important;
                padding: 6px !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
            }
            
            /* Single button alignment for rows with only one action button */
            .groups-table tr.mobile-view td.action-icons .btn:only-child {
                margin-right: 42px !important;
            }
            
            /* Fixed width containers for group information */
            .groups-table tr.mobile-view .name-container {
                flex: 0 0 40% !important;
                width: 40% !important;
                padding-right: 10px !important;
            }
            
            .groups-table tr.mobile-view .members-container {
                flex: 0 0 30% !important;
                width: 30% !important;
                padding-right: 10px !important;
            }
            
            .groups-table tr.mobile-view .date-container {
                flex: 0 0 30% !important;
                width: 30% !important;
                text-align: right !important;
            }
            
            /* Hide table header in mobile view */
            .groups-table thead {
                display: none !important;
            }
        }

        /* Override for desktop view */
        @media (min-width: 768px) {
            .groups-table.desktop-view thead {
                display: table-header-group !important;
            }
            
            .groups-table.desktop-view tbody {
                display: table-row-group !important;
            }
            
            .groups-table.desktop-view tr {
                display: table-row !important;
            }
            
            .groups-table.desktop-view td {
                display: table-cell !important;
            }
        }

        /* Mobile formatting for Wards Table */
        @media (max-width: 767px) {
            .wards-table tr.mobile-view {
                display: flex !important;
                flex-direction: row !important;
                align-items: center !important;
                padding: 8px 12px !important;
                min-height: 50px !important;
                flex-wrap: nowrap !important;
                width: 100% !important;
                position: relative !important;
                margin-bottom: 5px !important;
                border-bottom: 1px solid #eee !important;
            }
            
            .wards-table tr.mobile-view td {
                margin: 0 !important;
                padding: 0 !important;
                border: none !important;
                background: none !important;
                position: static !important;
                display: block !important;
            }
            
            .wards-table tr.mobile-view td.action-icons {
                flex: 0 0 80px !important;
                width: 80px !important;
                min-width: 80px !important;
                display: flex !important;
                justify-content: flex-start !important;
                align-items: center !important;
                margin-right: 10px !important;
            }
            
            .wards-table tr.mobile-view td.action-icons .btn {
                margin-right: 5px !important;
                width: 32px !important;
                height: 32px !important;
                padding: 6px !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
            }
            
            /* Single button alignment for rows with only one action button */
            .wards-table tr.mobile-view td.action-icons .btn:only-child {
                margin-right: 42px !important;
            }
            
            /* Fixed width containers for ward information */
            .wards-table tr.mobile-view .name-container {
                flex: 0 0 40% !important;
                width: 40% !important;
                padding-right: 10px !important;
            }
            
            .wards-table tr.mobile-view .members-container {
                flex: 0 0 30% !important;
                width: 30% !important;
                padding-right: 10px !important;
            }
            
            .wards-table tr.mobile-view .date-container {
                flex: 0 0 30% !important;
                width: 30% !important;
                text-align: right !important;
            }
            
            /* Hide table header in mobile view */
            .wards-table thead {
                display: none !important;
            }
        }

        /* Override for desktop view */
        @media (min-width: 768px) {
            .wards-table.desktop-view thead {
                display: table-header-group !important;
            }
            
            .wards-table.desktop-view tbody {
                display: table-row-group !important;
            }
            
            .wards-table.desktop-view tr {
                display: table-row !important;
            }
            
            .wards-table.desktop-view td {
                display: table-cell !important;
            }
        }

        /* Message log filter form */
        #message-log-filter {
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid #eee;
        }

        #message-log-filter .form-group {
            margin-right: 10px;
        }

        #message-log-filter label {
            margin-right: 5px;
        }

        .ml-2 {
            margin-left: 10px;
        }

        .mb-3 {
            margin-bottom: 15px;
        }

        /* Message log header styling */
        .message-log-header {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }

        .message-log-header .panel-title {
            font-size: 16px;
            font-weight: bold;
            margin-right: 15px;
        }

        .message-log-header .filter-label {
            font-size: 14px;
            margin-right: 5px;
            white-space: nowrap;
        }

        .message-log-header select,
        .message-log-header .date-input {
            width: auto;
            display: inline-block;
            max-width: 150px;
            padding: 4px 8px;
            height: 30px;
        }

        .message-log-header .date-input {
            max-width: 130px;
            height: 34px !important;
            padding: 6px 12px !important;
            font-size: 14px !important;
            line-height: 1.42857143 !important;
            vertical-align: middle !important;
            display: inline-block !important;
            border: 1px solid #ccc !important;
            border-radius: 4px !important;
            box-shadow: inset 0 1px 1px rgba(0,0,0,.075) !important;
            transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s !important;
            margin: 0 !important;
        }

        .message-log-header .date-input:focus {
            border-color: #66afe9 !important;
            outline: 0 !important;
            box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6) !important;
        }

        .message-log-header .cost-total {
            margin-left: auto !important;
            font-weight: bold !important;
            color: #333 !important;
            float: right !important;
        }

        /* Message log summary */
        .message-log-summary {
            margin-bottom: 15px;
            font-weight: bold;
        }

        /* Cost column styling */
        .message-log-table .cost-column {
            text-align: right;
            font-family: monospace;
        }

        /* Additional column styling */
        .message-log-table th:nth-child(1), /* Type */
        .message-log-table td:nth-child(1) {
            width: 60px;
        }

        .message-log-table th:nth-child(2), /* Ward */
        .message-log-table td:nth-child(2) {
            width: 100px;
        }

        .message-log-table th:nth-child(3), /* Contacts */
        .message-log-table td:nth-child(3),
        .message-log-table th:nth-child(4), /* Characters */
        .message-log-table td:nth-child(4) {
            width: 95px;
            text-align: center;
        }

        .message-log-table th:nth-child(5), /* Status */
        .message-log-table td:nth-child(5) {
            width: 120px;
        }

        .message-log-table th:nth-child(6), /* Cost */
        .message-log-table td:nth-child(6) {
            width: 80px;
            text-align: right;
        }

        .message-log-table th:nth-child(7), /* Date Sent */
        .message-log-table td:nth-child(7) {
            width: 150px;
        }

        /* Responsive adjustments for message log filter */
        @media (max-width: 992px) {
            .message-log-header {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .message-log-header select,
            .message-log-header .date-input {
                max-width: 100%;
                width: 100%;
                margin-bottom: 5px;
            }
            
            .message-log-header .cost-total {
                float: right !important;
                margin-left: auto !important;
                margin-right: 15px !important;
                margin-top: 10px !important;
            }
            
            .message-log-table {
                display: block;
                width: 100%;
                overflow-x: auto;
            }
        }

        #reset_filters {
            height: 30px;
            padding: 4px 10px;
            margin-left: 5px;
        }

        #update_prices {
            height: 30px;
            padding: 4px 10px;
            margin-left: 5px;
        }

        /* Hide message log on mobile */
        @media (max-width: 767px) {
            #message-log-panel,
            .message-log-header,
            .message-log-scroll,
            .message-log-table,
            .panel-default:has(.message-log-table),
            .table-responsive.message-log-scroll {
                display: none !important;
                visibility: hidden !important;
                height: 0 !important;
                overflow: hidden !important;
                margin: 0 !important;
                padding: 0 !important;
            }

            /* Ensure SMS replies are visible */
            .sms-replies-table,
            .table-responsive.sms-replies-table,
            .panel:has(.sms-replies-table) {
                display: block !important;
                visibility: visible !important;
                height: auto !important;
                overflow: visible !important;
            }

            .sms-replies-table tr {
                display: block !important;
                margin-bottom: 15px !important;
                padding: 12px !important;
                background: #fff !important;
                border: 1px solid #ddd !important;
                border-radius: 4px !important;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
            }
        }

        /* Ensure message log is visible on desktop */
        @media (min-width: 768px) {
            #message-log-panel,
            .message-log-header,
            .message-log-scroll,
            .message-log-table {
                display: block !important;
                visibility: visible !important;
                height: auto !important;
                overflow: visible !important;
            }
            
            .message-log-table {
                display: table !important;
            }
        }

        .contacts-table.desktop-view {
            width: 100% !important;
            table-layout: fixed !important;
        }

        /* Column widths for desktop view */
        .contacts-table.desktop-view td:first-child { /* Actions */
            width: 80px !important;
            min-width: 80px !important;
            padding: 8px !important;
        }

        .contacts-table.desktop-view td:nth-child(2) { /* Last Name */
            width: 120px !important;
        }

        .contacts-table.desktop-view td:nth-child(3) { /* First Name */
            width: 120px !important;
        }

        .contacts-table.desktop-view td:nth-child(4) { /* Phone */
            width: 110px !important;
            white-space: nowrap !important;
        }

        .contacts-table.desktop-view td:nth-child(5) { /* Email */
            width: auto !important;
            min-width: 180px !important;
            max-width: 250px !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
        }

        .contacts-table.desktop-view td:nth-child(6) { /* Ward */
            width: 100px !important;
            white-space: nowrap !important;
        }

        .contacts-table.desktop-view td:nth-child(7) { /* Groups */
            width: 140px !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .contacts-table.desktop-view td:nth-child(8) { /* Status */
            width: 70px !important;
            white-space: nowrap !important;
        }

        /* Add tooltips for truncated content */
        .contacts-table.desktop-view td {
            position: relative !important;
        }

        .contacts-table.desktop-view td:nth-child(5),
        .contacts-table.desktop-view td:nth-child(7) {
            cursor: pointer !important;
        }

        .contacts-table.desktop-view td:nth-child(5):hover::after,
        .contacts-table.desktop-view td:nth-child(7):hover::after {
            content: attr(title);
            position: absolute;
            left: 0;
            top: 100%;
            z-index: 1000;
            background: #fff;
            padding: 5px;
            border: 1px solid #ddd;
            border-radius: 3px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            white-space: normal;
            max-width: 300px;
            word-wrap: break-word;
        }

        /* Ensure all columns are visible in desktop view */
        .contacts-table.desktop-view td {
            display: table-cell !important;
            vertical-align: middle !important;
            padding: 8px 4px !important;
        }

        /* Style for action buttons */
        .contacts-table .action-icons {
            white-space: nowrap !important;
        }

        .contacts-table .action-icons .btn {
            padding: 3px 6px !important;
            margin-right: 3px !important;
        }

        .contacts-table .action-icons .btn:last-child {
            margin-right: 0 !important;
        }

        /* Status label styling */
        .status-indicator {
            display: inline-block !important;
            padding: 2px 6px !important;
            border-radius: 3px !important;
            font-size: 12px !important;
            line-height: 1.4 !important;
            white-space: nowrap !important;
        }

        .status-active {
            background-color: #dff0d8 !important;
            color: #3c763d !important;
        }

        .status-inactive {
            background-color: #f2dede !important;
            color: #a94442 !important;
        }

        .status-optout {
            background-color: #fcf8e3 !important;
            color: #8a6d3b !important;
        }

        /* Mobile styles for SMS replies */
        @media (max-width: 767px) {
            .sms-replies-table {
                border: none !important;
                margin-bottom: 0 !important;
            }
            
            .sms-replies-table tr {
                display: block !important;
                margin-bottom: 15px !important;
                padding: 12px !important;
                background: #fff !important;
                border: 1px solid #ddd !important;
                border-radius: 4px !important;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
            }
            
            .sms-replies-table td {
                display: block !important;
                border: none !important;
                padding: 5px 0 !important;
            }
            
            .sms-replies-table td:before {
                content: attr(data-title);
                font-weight: bold;
                display: block;
                margin-bottom: 5px;
                color: #666;
            }
            
            .sms-replies-table td.message-cell {
                margin-top: 8px !important;
                padding-top: 8px !important;
                border-top: 1px solid #eee !important;
            }
            
            .sms-replies-table td.message-cell .message-content {
                white-space: pre-wrap !important;
                word-break: break-word !important;
            }
            
            /* Improve visibility of opt-out messages */
            .sms-replies-table tr[data-is-opt-out="true"] {
                background-color: #fff5f5 !important;
                border-color: #ffcdd2 !important;
            }
            
            .sms-replies-table tr[data-is-opt-out="true"] td.message-cell {
                color: #d32f2f !important;
                font-weight: bold !important;
            }
        }

        /* Add spacing between panels */
        .panel + .panel {
            margin-top: 20px;
        }

        /* Ensure proper spacing between sections */
        #message-log-panel {
            margin-bottom: 30px !important;
            border: 1px solid #ddd !important;
            border-radius: 4px !important;
            background: #fff !important;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
        }

        /* Message Log Header */
        #message-log-panel .panel-heading {
            background-color: #f5f5f5 !important;
            border-bottom: 1px solid #ddd !important;
            padding: 10px 15px !important;
            display: flex !important;
            align-items: center !important;
            flex-wrap: wrap !important;
            gap: 10px !important;
            justify-content: space-between !important;
        }

        /* Left side with title */
        #message-log-panel .panel-heading .panel-title {
            font-size: 18px !important;
            font-weight: 500 !important;
            margin: 0 !important;
            display: flex !important;
            align-items: center !important;
            gap: 15px !important;
        }

        /* Filter controls container */
        #message-log-panel .filter-controls {
            display: flex !important;
            align-items: center !important;
            gap: 10px !important;
            flex-wrap: wrap !important;
            flex: 1 !important;
            justify-content: flex-end !important;
        }

        /* Filter label styling */
        #message-log-panel .filter-label {
            font-size: 14px !important;
            font-weight: normal !important;
            color: #666 !important;
            margin: 0 !important;
        }

        /* Filter inputs styling */
        #message-log-panel select,
        #message-log-panel .date-input {
            height: 30px !important;
            padding: 4px 8px !important;
            font-size: 13px !important;
            line-height: 1.5 !important;
            border: 1px solid #ccc !important;
            border-radius: 4px !important;
            background-color: #fff !important;
            min-width: 120px !important;
        }

        /* Apply Filter button */
        #message-log-panel .btn-primary {
            padding: 4px 12px !important;
            font-size: 13px !important;
            line-height: 1.5 !important;
            height: 30px !important;
            margin-left: 5px !important;
        }

        /* Reset button */
        #message-log-panel .btn-default {
            padding: 4px 12px !important;
            font-size: 13px !important;
            line-height: 1.5 !important;
            height: 30px !important;
            margin-left: 5px !important;
        }

        /* Total Cost styling */
        #message-log-panel .cost-total {
            font-weight: 500 !important;
            color: #333 !important;
            margin-left: auto !important;
            white-space: nowrap !important;
            float: right !important;
            padding-right: 15px !important;
        }

        /* Responsive adjustments */
        @media (max-width: 992px) {
            #message-log-panel .panel-heading {
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 15px !important;
            }

            #message-log-panel .filter-controls {
                flex-wrap: wrap !important;
                justify-content: flex-start !important;
            }

            #message-log-panel .cost-total {
                float: right !important;
                margin-left: auto !important;
                margin-right: 15px !important;
                margin-top: 10px !important;
            }
        }

        /* Fix for Bootstrap's default table-responsive which might be inhibiting vertical scroll */
        @media screen and (max-width: 767px) {
            .table-responsive.message-log-scroll {
                overflow-y: auto !important;
                border: none;
            }
        }

        #cost-total-display {
            position: absolute !important;
            right: 15px !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            margin: 0 !important;
            font-weight: bold !important;
        }

        /* Position the container properly for absolute positioning */
        .message-log-header {
            position: relative !important;
            padding-right: 120px !important; /* Make room for the cost total */
        }

        /* Remove any existing right alignment that isn't working */
        #message-log-panel .cost-total {
            margin-left: 0 !important;
            float: none !important;
            font-weight: bold !important;
            white-space: nowrap !important;
        }

        .message-log-header .cost-total {
            float: none !important;
            margin-left: 0 !important;
        }

        /* Ensure responsive behavior */
        @media (max-width: 992px) {
            #cost-total-display {
                position: static !important;
                display: block !important;
                text-align: right !important;
                margin-top: 10px !important;
                margin-bottom: 5px !important;
                transform: none !important;
            }
            
            .message-log-header {
                padding-right: 15px !important;
            }
        }