

/* Chat message bubbles */
.message-bubble {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 18px;
    margin-bottom: 4px;
    max-width: 80%;
    word-break: break-word;
    font-size: 1rem;
}
.message-mine {
    background: #0d6efd;
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
}
.message-other {
    background: #f1f3f4;
    color: #222;
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0;
}
.message-right {
    text-align: right;
}
.message-left {
    text-align: left;
}
/* End chat message bubbles */ 

/* General Styles */
.content-wrapper {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 1.5rem;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    transition: margin-left 0.3s ease;
}

/* Table Styles */
.table-container {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.table-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 15px 15px 0 0;
}

.table-body {
    padding: 0;
}

.table {
    margin-bottom: 0;
    zoom: 80%;
}

.table th {
    font-weight: 600;
    padding: 1rem;
    border-bottom-width: 1px;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.user-name {
    font-weight: 600;
    color: #344767;
}

.user-subname {
    font-size: 0.875rem;
    color: #6c757d;
}

.facility-tag {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #e3f2fd;
    color: #0d6efd;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.more-facilities {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
}

.more-facilities:hover {
    background-color: #e9ecef;
}

.account-type-tag {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.vendor-tag {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.facility-user-tag {
    background-color: #d1e7dd;
    color: #0f5132;
}

.admin-tag {
    background-color: #f8d7da;
    color: #842029;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.facilities-list {
    list-style: none;
    padding-left: 0;
}

.facilities-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.facilities-list li:last-child {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 0;
}

/* User Form Styles */
.user-form-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.user-form-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.user-form-body {
    padding: 30px;
}

/* Facility Form Styles */
.facility-form-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.facility-form-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.facility-form-body {
    padding: 30px;
}

/* Invoice Form Styles */
.invoice-form-container {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.invoice-form-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 15px 15px 0 0;
}

.invoice-form-body {
    padding: 30px;
}

/* Form field enhancements */
.form-control, .form-select, .input-group {
    border-color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Section styling */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #495057;
}

/* File upload enhancement */
.file-upload {
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload:hover {
    background: #fff;
    border-color: #0d6efd;
}

/* Select2 Customizations */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    margin-right: 5px;
    margin-top: 2px;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-search__field:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__display {
    padding-left: 8px;
    padding-right: 8px;
}

.form-label {
    font-weight: 500;
}

/* Reduce tag size and font */
.select2-container--bootstrap-5 .select2-selection__choice {
    font-size: 12px !important;
    padding: 2px 6px !important;
    margin: 2px !important;
}

/* Adjust remove button size */
.select2-container--bootstrap-5 .select2-selection__choice__remove {
    font-size: 12px !important;
    padding: 0 4px !important;
    margin-right: 2px !important;
}

/* Adjust input area height */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 38px !important;
    padding: 2px 6px !important;
}

/* Status badge styles */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.status-badge-pending {
    background-color: #fff8dd;
    color: #ffc107;
}

.status-badge-approved {
    background-color: #e0f8e9;
    color: #198754;
}

.status-badge-paid {
    background-color: #e0f8e9;
    color: #198754;
}

.status-badge-rejected {
    background-color: #feebee;
    color: #dc3545;
}

/* Dashboard Cards */
.dashboard-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dashboard-card h5 {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-card h2 {
    color: #344767;
    font-weight: 700;
    margin-bottom: 0;
}

/* Dashboard Stat Cards */
.dashboard-stat-card {
    border-radius: 15px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    height: 100%;
}

.dashboard-stat-card:hover {
    transform: translateY(-5px);
}

.stat-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card-text {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0;
}

.stat-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(45deg, #0d6efd, #6610f2);
}

.bg-gradient-success {
    background: linear-gradient(45deg, #198754, #20c997);
}

.bg-gradient-info {
    background: linear-gradient(45deg, #0dcaf0, #0d6efd);
}

.bg-gradient-warning {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
}

.bg-gradient-danger {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
}

/* Avatar Circle */
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Card Enhancements */
.card {
    border-radius: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Status Badge Enhancements */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    font-size: 0.75rem;
    display: inline-block;
}

.status-badge-pending-approval {
    background-color: #fff8dd;
    color: #ffc107;
}

.status-badge-approved {
    background-color: #e0f8ff;
    color: #0dcaf0;
}

.status-badge-paid {
    background-color: #e0f8e9;
    color: #198754;
}

.status-badge-partially-paid {
    background-color: #f0e7ff;
    color: #6f42c1;
}

/* Table Enhancements */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table-light th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: none;
}

.table td, .table th {
    padding: 1rem;
    vertical-align: middle;
}

/* Badge Styles */
.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.1);
}

.text-success {
    color: #198754 !important;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f8f9fa;
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.login-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.login-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.login-logo {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #344767;
}

.login-body {
    padding: 1rem 2rem 2rem;
}

.login-footer {
    padding: 1rem 2rem;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    color: #6c757d;
}

.form-floating > .form-control {
    padding: 1rem 0.75rem;
}

.form-floating > .form-control:focus {
    border-color: #0d6efd;
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

.login-btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
}

.forgot-password {
    color: #0d6efd;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: #0a58ca;
    text-decoration: underline !important;
}

/* Password toggle button */
.password-toggle {
    background: transparent;
    color: #6c757d;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #0d6efd;
}

.password-toggle:focus {
    box-shadow: none;
    outline: none;
}

.password-toggle i {
    font-size: 1.1rem;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.alert {
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

@media (max-width: 576px) {
    .login-header {
        padding: 1.5rem 1.5rem 0.5rem;
    }
    
    .login-body {
        padding: 0.5rem 1.5rem 1.5rem;
    }
    
    .login-footer {
        padding: 1rem 1.5rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination .page-item .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Vendor Management Styles */
.vendor-row:hover {
    background-color: rgba(13, 110, 253, 0.03);
}

.facility-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    max-width: 100%;
}

.vendor-tag, .facility-user-tag, .more-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.vendor-tag {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.facility-user-tag {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.2);
}

.more-tag {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
    cursor: pointer;
}

.more-tag:hover {
    background-color: rgba(108, 117, 125, 0.2);
}

.empty-state {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* Vendor View Page Styles */
.vendor-stats-card {
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.vendor-stats-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-right: 15px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.progress {
    height: 8px;
    margin-top: 10px;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.user-avatar i {
    color: #6c757d;
}

/* Modal Styles for Facility List */
.facility-modal .modal-body {
    max-height: 400px;
    overflow-y: auto;
}

.facility-modal .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.facility-modal .list-group-item:first-child {
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.facility-modal .list-group-item:last-child {
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* Chat Styles */
.chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.chat-card .card-header {
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    padding: 1rem;
}

.chat-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
}

.chat-input-container {
    border-top: 1px solid rgba(0,0,0,.125);
    padding: 1rem;
    background-color: #fff;
}

.message-wrapper {
    margin-bottom: 1rem;
    max-width: 80%;
}

.message-left {
    margin-right: auto;
}

.message-right {
    margin-left: auto;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
    margin-top: 0.25rem;
}

.message-mine {
    background-color: #0d6efd;
    color: white;
    border-top-right-radius: 0.25rem;
}

.message-other {
    background-color: white;
    border: 1px solid #dee2e6;
    border-top-left-radius: 0.25rem;
}

.message-sender {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.message-right .message-time {
    justify-content: flex-end;
}

.empty-chat-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-chat-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.chat-avatar, .participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sender-type {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
}

/* End Chat Page Styles */

/* Additional Sidebar Enhancements */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    z-index: 1040;
    background: linear-gradient(135deg, #1e2a3a 0%, #2c3e50 100%);
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 100vh;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar .text-center .d-flex {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 10px;
    margin: 0 1rem;
    transition: all 0.3s ease;
}

.sidebar .text-center .d-flex:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.sidebar .nav-link {
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 0.75rem 1rem;
    margin: 0.3rem 0;
    border-radius: 8px;
}

.sidebar .nav-link i {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
    color: #fff;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link.active {
    background: rgba(13, 110, 253, 0.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link.active::before {
    background: #0d6efd;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
}

.sidebar hr {
    background-color: rgba(255, 255, 255, 0.1);
    height: 1px;
    border: none;
    margin: 1rem 0;
}

.sidebar form button.nav-link.text-danger {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar form button.nav-link.text-danger:hover {
    background: rgba(220, 53, 69, 0.15);
    transform: translateX(5px);
}

/* Main content adjustment */
main.col-md-9.ms-sm-auto.col-lg-10 {
    transition: all 0.3s ease;
    width: calc(100% - 250px);
    margin-left: 250px !important;
    padding-right: 15px;
    padding-left: 15px;
}

/* Fix for sidebar on small screens */
@media (max-width: 767.98px) {
    .sidebar {
        left: -100%;
        box-shadow: none;
        width: 85%;
        max-width: 280px;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    }
    
    main.col-md-9.ms-sm-auto.col-lg-10 {
        width: 100%;
        margin-left: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 4.5rem;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, 
    .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, 
    .col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        backdrop-filter: blur(3px);
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Tablet sidebar adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 220px;
    }
    
    main.col-md-9.ms-sm-auto.col-lg-10 {
        width: calc(100% - 220px);
        margin-left: 220px !important;
    }
}

/* Medium screens */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sidebar {
        width: 250px;
    }
    
    main.col-md-9.ms-sm-auto.col-lg-10 {
        width: calc(100% - 250px);
        margin-left: 250px !important;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .sidebar {
        width: 250px;
    }
    
    main.col-md-9.ms-sm-auto.col-lg-10 {
        width: calc(100% - 250px);
        margin-left: 250px !important;
    }
}

/* Fix for main content area */
.main-content {
    min-height: 100vh;
}

/* Fix for sidebar toggle button */
#sidebarToggle {
    z-index: 1050;
}

/* Fix for logout button */
.sidebar form button.nav-link.text-danger {
    color: #dc3545 !important;
}

.sidebar form button.nav-link.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Sidebar Scrolling and Elements */
.sidebar .position-sticky {
    height: 100vh;
    overflow-y: auto;
    padding-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar .position-sticky::-webkit-scrollbar {
    width: 4px;
}

.sidebar .position-sticky::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .position-sticky::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.sidebar .text-center {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1rem;
    margin: 0.2rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    position: relative;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background: #0d6efd;
    border-radius: 0 3px 3px 0;
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.sidebar .nav-item small {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #a8c7fa !important;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar hr {
    margin: 1rem 0;
    opacity: 0.2;
}

.sidebar form button.nav-link {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

/* Fix for sidebar logo */
.sidebar .text-center .d-flex {
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar .text-center .d-flex:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Fix for sidebar items with long text */
.sidebar .nav-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Fix for sidebar header */
.sidebar .text-center h4 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Content Area Adjustments */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Row adjustments for better spacing */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.row > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Dashboard header adjustments */
.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1030;
}

/* Fix for main content area */
main {
    padding-top: 1rem;
}

@media (max-width: 767.98px) {
    main {
        padding-top: 4.5rem;
    }
}

/* Fix for content wrapper */
.content-wrapper {
    padding-bottom: 2rem;
}

/* Fix for sidebar and content alignment */
.row {
    --bs-gutter-x: 0;
}

.sidebar {
    padding: 0 !important;
    margin: 0 !important;
}

.col-md-3, .col-lg-2 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (min-width: 768px) {
    .col-md-9, .col-lg-10 {
        padding-left: 1.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .row > * {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    main {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
} 

.modal-backdrop{
    z-index: 0 !important;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 0 1rem 1rem;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.pagination-wrapper {
    display: flex;
    justify-content: flex-end;
}

.pagination {
    margin-bottom: 0;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.page-link {
    color: #0d6efd;
    padding: 0.375rem 0.75rem;
}

@media (max-width: 767.98px) {
    .pagination-container {
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-info {
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .pagination-wrapper {
        justify-content: center;
    }
}

/* Chat Access Styles */
.chat-input-container input:disabled,
.chat-input-container button:disabled {
    cursor: not-allowed;
    background-color: #f8f9fa;
    opacity: 0.8;
}

.chat-input-container input:disabled::placeholder {
    color: #dc3545;
    font-style: italic;
    opacity: 0.7;
}

/* Container and Row Styles */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

/* Fix for main content area */
.main-content {
    transition: all 0.3s ease;
}

/* Sidebar backdrop for mobile */
.sidebar-backdrop {
    display: none;
}

main.col-md-9.ms-sm-auto.col-lg-10.px-md-4.content-wrapper {
    padding: 2% !important;
}

/* Category Dropdown Styling */
.input-group .select2-container {
    flex-grow: 1;
}

.input-group .btn-outline-secondary {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 38px;
}

#addCategoryBtn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Modal Styling */
#addCategoryModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#addCategoryModal .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .input-group .btn-outline-secondary {
        min-width: 44px;
    }
}

/* Disregard Invoice Styles */
.disregard-vendor {
    color: #dc3545;
    border-color: #dc3545;
    margin-left: 5px;
}

.disregard-vendor:hover {
    background-color: #dc3545;
    color: #ffffff;
}

#disregardModal .alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
    border-radius: 4px;
}

#disregardModal .alert-warning i {
    color: #ffc107;
}

#disregardPeriod {
    font-weight: 500;
    color: #495057;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

#disregardVendorName {
    color: #212529;
    font-weight: 600;
}

#confirmDisregardBtn {
    background-color: #dc3545;
    border-color: #dc3545;
}

#confirmDisregardBtn:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* Missing Invoice Filter Styles */
.quick-filter-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.quick-filter-container .form-label {
    font-weight: 500;
    color: #495057;
}

/* Responsive adjustments for the disregard button */
@media (max-width: 767.98px) {
    .btn-group .disregard-vendor {
        margin-top: 8px;
        margin-left: 0;
    }
}

/* Vendor Form Categories Button Styling */
.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.categories-header .form-label {
    margin-bottom: 0;
}

.categories-header .btn-outline-secondary {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
}

.categories-header .btn-outline-secondary i {
    margin-right: 0.25rem;
}

/* Make the categories button responsive */
@media (max-width: 576px) {
    .categories-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .categories-header .btn {
        margin-top: 0.5rem;
        align-self: flex-start;
    }
}

/* Payment Proof Section Styles */
.payment-history {
    margin-top: 0.5rem;
}
.payment-item {
    background: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.payment-proof-full {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.payment-proof-pdf {
    width: 100%;
    max-width: 600px;
    min-height: 320px;
    max-height: 400px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.payment-proof-full-actions {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 991.98px) {
    .payment-proof-full, .payment-proof-pdf, .payment-proof-full-actions {
        max-width: 100%;
    }
}
@media (max-width: 767.98px) {
    .payment-proof-full-wrapper {
        padding: 1rem 0.25rem 0.5rem 0.25rem;
    }
    .payment-proof-full, .payment-proof-pdf, .payment-proof-full-actions {
        max-width: 100vw;
    }
    .payment-proof-full {
        max-height: 220px;
    }
    .payment-proof-pdf {
        min-height: 160px;
        max-height: 220px;
    }
}
/* Hide old grid for new layout */
.payment-proof-grid, .payment-proof-thumb-wrapper, .payment-proof-thumb { display: none !important; }

/* Vendor Missing Invoices Filter Section Styles */
#filterForm .form-label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}
#filterForm .form-select,
#filterForm .form-control {
  min-height: 38px;
  font-size: 1rem;
}
#filterForm .btn {
  min-width: 140px;
}
@media (max-width: 767.98px) {
  #filterForm .form-label {
    font-size: 0.95rem;
  }
  #filterForm .btn {
    min-width: 100px;
    font-size: 0.95rem;
    }
}

/* Check Release Report Styles */
#reportFilterForm .form-label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}
#reportFilterForm .form-select {
  min-height: 38px;
  font-size: 1rem;
}
#reportFilterForm .btn {
  min-width: 120px;
}
@media (max-width: 767.98px) {
  #reportFilterForm .form-label {
    font-size: 0.95rem;
    }
  #reportFilterForm .btn {
    min-width: 100px;
    font-size: 0.95rem;
    }
}

.empty-state {
  text-align: center;
  padding: 2rem 0;
}

/* Payment Proof Styles */
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.payment-proof-thumb-wrapper{
    margin-bottom: 1rem !important;
    position: relative;
    width: 33%;
    height: 80px;
    min-width: 80px;
    max-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-proof-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;

}

.payment-proof-thumb:hover {
    box-shadow: 0 0 0 2px #0d6efd33;
}

.payment-proof-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.payment-proof-thumb-wrapper:hover .payment-proof-actions {
    opacity: 1;
}

.payment-proof-actions .btn {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.payment-proof-actions .btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.payment-proof-actions .btn i {
    font-size: 12px;
}

.payment-proof-preview {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 9999;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    width: 200px;
    text-align: center;
    transition: all 0.2s ease;
    pointer-events: none;
}

.payment-proof-thumb-wrapper:hover .payment-proof-preview {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.payment-proof-preview img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
    max-height: 200px;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .payment-proof-thumb-wrapper { width: 48%; }
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper { width: 100%; }
}

/* Ensure preview stays within viewport */
.payment-proof-preview {
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

/* Edit Payment Modal Thumbnails */
.edit-payment-proof-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 100% !important;
    min-width: 100% !important;

    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 1rem;
    margin-bottom: 1rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    width: 100% !important;
    min-width: 100% !important;

    height: auto;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.5rem;
}
@media (max-width: 991.98px) {
    .edit-payment-proof-thumb-wrapper { width: 48%; height: 80px; }
    .edit-payment-proof-thumb { width: 80px; height: 80px; }
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper { width: 100%; height: 70px; }
    .edit-payment-proof-thumb { width: 70px; height: 70px; }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Notification Management Page Enhanced UI */
.notification-bg {
    background: linear-gradient(135deg, #f8fafc 60%, #e9f0fb 100%);
    min-height: 100vh;
}
.notification-main-card {
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(13,110,253,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
}
.notification-header-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.notifications-nav-tabs {
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem 0 1rem;
    margin-bottom: 0;
}
.notifications-nav-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    margin-right: 0.5rem;
    border-radius: 10px 10px 0 0;
    transition: color 0.2s, border-bottom 0.2s;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notifications-nav-tabs .nav-link.active {
    color: #0d6efd;
    background: #fff;
    border-bottom: 3px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.notifications-tab-pane {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 4.5rem 1.5rem;
    margin-top: -2px;
    min-height: 420px;
    position: relative;
}
.notification-fab-btns {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
}
@media (max-width: 768px) {
    .notifications-nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.98rem;
    }
    .notifications-tab-pane {
        padding: 1rem 0.5rem 4.5rem 0.5rem;
    }
    .notification-fab-btns {
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        align-items: flex-end;
    }
}
.notification-template-form .btn-primary, .notification-template-form .btn-outline-secondary {
    min-width: 140px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.08);
}
.tox-tinymce {
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(13,110,253,0.04) !important;
    border: 1px solid #dee2e6 !important;
}

/* Quill Editor Fixes */
.quill-editor {
    min-height: 300px !important;
    height: auto !important;
    width: 100% !important;
    background: #fff;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    overflow: visible !important;
    display: block !important;
}
.ql-toolbar.ql-snow {
    border-radius: 0.375rem 0.375rem 0 0;
    background: #f8f9fa;
    z-index: 1;
}
.ql-container.ql-snow {
    border-radius: 0 0 0.375rem 0.375rem;
    min-height: 200px !important;
    background: #fff;
}
@media (max-width: 767.98px) {
    .quill-editor {
        min-height: 200px !important;
        font-size: 0.95rem;
    }
    .ql-toolbar.ql-snow, .ql-container.ql-snow {
        font-size: 0.95rem;
    }
}

/* Enhanced Template variable tag for Quill editor */
.template-var {
    display: inline-block;
    background: #e7f1ff;
    color: #0a58ca;
    border-radius: 1rem;
    padding: 0.15em 0.85em;
    margin: 0 0.15em;
    font-size: 1em;
    font-family: monospace;
    border: 1px solid #b6d4fe;
    font-weight: 600;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(13,110,253,0.07);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.template-var:focus, .template-var:hover {
    background: #cfe2ff;
    color: #084298;
    border-color: #0a58ca;
}
@media (prefers-color-scheme: dark) {
    .template-var {
        background: #1a2636;
        color: #90caf9;
        border: 1px solid #1976d2;
    }
    .template-var:focus, .template-var:hover {
        background: #23344d;
        color: #fff;
        border-color: #90caf9;
    }
}

/* Payment Proof Thumbnails and Edit Modal (shared for admin/account) */
.payment-proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    transition: box-shadow 0.2s;
    border: 2px solid #dee2e6;
}
.popover-img-preview {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper {
    position: relative;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.payment-proof-thumb-wrapper iframe,
.payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 90px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
.payment-proof-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
@media (max-width: 767.98px) {
    .payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .payment-proof-thumb-wrapper iframe,
    .payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}
.edit-payment-proof-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper {
    position: relative;
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-bottom: 0.5rem;
}
.edit-payment-proof-thumb-wrapper iframe,
.edit-payment-proof-thumb-wrapper img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 0.25rem;
}
@media (max-width: 767.98px) {
    .edit-payment-proof-thumb-wrapper {
        width: 90px;
        min-width: 70px;
        max-width: 100px;
        height: 80px;
    }
    .edit-payment-proof-thumb-wrapper iframe,
    .edit-payment-proof-thumb-wrapper img {
        max-height: 60px;
    }
}

/* Batch Invoice Category Table Styles */
.batch-category-table .input-group {
    margin-bottom: 0.5rem;
}
.batch-category-table .input-group-text {
    min-width: 90px;
    font-weight: 500;
    background: #f8f9fa;
}
.batch-category-table .category-amount {
    max-width: 120px;
}
.batch-category-table .total-amount {
    font-weight: bold;
    background: #e9ecef;
    text-align: right;
}
@media (max-width: 767.98px) {
    .batch-category-table .input-group-text {
        min-width: 70px;
        font-size: 0.95em;
    }
    .batch-category-table .category-amount {
        max-width: 100px;
    }
}

/* Payment Proof Delete Button - Red and prominent */
.delete-proof-btn {
    color: #dc3545 !important;
    background: #fff !important;
    border: 1px solid #dc3545 !important;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(220,53,69,0.08);
    z-index: 10;
}
.delete-proof-btn:hover, .delete-proof-btn:focus {
    color: #fff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure icon inside is also red */
.delete-proof-btn i {
    color: #dc3545 !important;
}
.delete-proof-btn:hover i, .delete-proof-btn:focus i {
    color: #fff !important;
}

/* Printed badge for invoice rows */
.printed-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    vertical-align: middle;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Print button icon */
.print-toggle-btn {
    transition: background 0.2s, color 0.2s;
}
.print-toggle-btn:focus, .print-toggle-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

@media (max-width: 576px) {
    .printed-badge {
        font-size: 0.75rem;
        padding: 0.15em 0.4em;
    }
}

/* Payment proof download button: blue with white text */
.payment-proof-actions .btn-info {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}
.payment-proof-actions .btn-info:hover, .payment-proof-actions .btn-info:focus {
    background-color: #0b5ed7 !important;
    color: #fff !important;
    border-color: #0a58ca !important;
}

/* Payment History Edit Type Button (Account Manager) */
.btn-outline-warning.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.3rem;
}

/* Edit Payment Method Modal */
#editPaymentMethodModal .modal-content {
  border-radius: 0.5rem;
}
#editPaymentMethodModal .modal-header {
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
}
#editPaymentMethodModal .modal-title {
  color: #ad8b00;
}

@media (max-width: 767.98px) {
  #editPaymentMethodModal .modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
  }
}

/* Invoice Timeline Styles */
.invoice-timeline {
    position: relative;
    padding: 1rem;
}
.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-marker {
    width: 40px;
    flex-shrink: 0;
    position: relative;
}
.timeline-marker::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    height: calc(100% + 1.5rem);
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child .timeline-marker::before {
    display: none;
}
.marker-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.2s, border 0.2s;
}
.timeline-marker.active .marker-icon {
    background-color: #e9f5ff;
    border-color: #0d6efd;
}
.marker-icon i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.2s;
}
.timeline-marker.active .marker-icon i {
    color: #0d6efd;
}
.timeline-content {
    padding-left: 1rem;
    flex-grow: 1;
}
.timeline-header {
    margin-bottom: 0.5rem;
}
.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}
.timeline-body {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0.25rem;
}
.timeline-body p {
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-content {
        padding-left: 0.5rem;
    }
    .timeline-marker {
        width: 30px;
    }
    .marker-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
}

/* Chat message bubbles */
.message-bubble {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 18px;
    margin-bottom: 4px;
    max-width: 80%;
    word-break: break-word;
    font-size: 1rem;
}
.message-mine {
    background: #0d6efd;
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
}
.message-other {
    background: #f1f3f4;
    color: #222;
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0;
}
.message-right {
    text-align: right;
}
.message-left {
    text-align: left;
}
/* End chat message bubbles */ 