﻿/* ============================================================
   ROOT VARIABLES
   ============================================================ */
:root {
    --primary-dark: #0a1f44;
    --primary-accent: #2563eb;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

/* ============================================================
   MAIN DASHBOARD SECTION
   ============================================================ */
.email-dashboard-section {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    font-size: 0.85rem;
    padding: 2rem 0;
    background-color: #fff;
}

.dashboard-wrapper {
    margin: 0 auto;
    background: #ffffff;
    border-radius: 5px 5px 0px 0px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.container-fluid {
    width: 100%;
    padding: 0px 100px;
}

/* ============================================================
   HEADER
   ============================================================ */
.dashboard-header {
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================================
   FILTER SECTION
   ============================================================ */
.filter-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.email-dashboard-section .form-select {
    font-size: 0.85rem;
    border-color: var(--border-color);
    color: var(--text-main);
    box-shadow: none !important;
    border-radius: 6px;
}

.email-dashboard-section .form-control {
    border-radius: 6px 0px 0px 6px !important;
}

    .email-dashboard-section .form-control:focus {
        border-color: #e2e8f0 !important;
    }

.email-dashboard-section .input-group-text {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
}
.filter-sectionss .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
}
.btn-primary-custom {
    background-color: var(--primary-dark);
    color: white;
    font-weight: 500;
    border: none;
    transition: all 0.2s;
}

    .btn-primary-custom:hover {
        background-color: #061530;
        color: white;
    }

.email-dashboard-section .form-control-9 {
    border-radius: 0px 6px 6px 0px !important;
}

/* ============================================================
   SELECT2 CUSTOM STYLES
   ============================================================ */


.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    color: var(--text-main);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
        border-color: var(--text-muted) transparent transparent transparent;
    }

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #0a1f44 !important;
    box-shadow: 0 0 0 2px rgba(10, 31, 68, 0.1) !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.select2-container--bootstrap-5 .select2-results__option {
    font-size: 0.85rem;
    padding: 8px 12px;
    color: var(--text-main);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #f1f5f9 !important;
    color: var(--primary-dark) !important;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #f0f4ff !important;
    color: #0a1f44 !important;
    font-weight: 500;
}

/* ============================================================
   FLATPICKR CUSTOM STYLES
   ============================================================ */
.flatpickr-calendar {
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
    border: 1px solid var(--border-color) !important;
    font-family: 'Inter', sans-serif !important;
    background: #ffffff !important;
    width: 320px !important;
    padding: 0 !important;
}

.flatpickr-months {
    background: var(--primary-dark) !important;
    border-radius: 8px 8px 0 0 !important;
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    min-height: 50px !important;
}

    .flatpickr-months .flatpickr-month {
        background: var(--primary-dark) !important;
        color: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        padding: 0 !important;
        position: relative !important;
    }

.flatpickr-current-month {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    transform: none !important;
}

    .flatpickr-current-month .flatpickr-monthDropdown-months {
        background: transparent !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        font-size: 16px !important;
        padding: 4px 8px !important;
        border: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
    }

        .flatpickr-current-month .flatpickr-monthDropdown-months option {
            color: var(--text-main) !important;
            background: #ffffff !important;
            font-weight: 500 !important;
        }

    .flatpickr-current-month .numInputWrapper {
        background: transparent !important;
        width: 65px !important;
        display: inline-block !important;
    }

        .flatpickr-current-month .numInputWrapper input {
            color: #ffffff !important;
            font-weight: 600 !important;
            font-size: 16px !important;
            padding: 4px 0 !important;
            background: transparent !important;
            border: none !important;
            text-align: center !important;
            width: 100% !important;
        }

        .flatpickr-current-month .numInputWrapper span {
            display: none !important;
        }

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: #ffffff !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.flatpickr-months .flatpickr-prev-month {
    left: 8px !important;
}

.flatpickr-months .flatpickr-next-month {
    right: 8px !important;
}

    .flatpickr-months .flatpickr-prev-month:hover,
    .flatpickr-months .flatpickr-next-month:hover {
        background: rgba(255,255,255,0.15) !important;
        border-radius: 4px !important;
    }

.flatpickr-weekdays {
    background: #f8fafc !important;
    padding: 10px 0 6px 0 !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
}

.flatpickr-days {
    padding: 6px 12px 12px 12px !important;
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 2px !important;
}

.flatpickr-day {
    color: var(--text-main) !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    line-height: 38px !important;
    height: 38px !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    transition: all 0.15s ease !important;
}

    .flatpickr-day:hover {
        background: #f1f5f9 !important;
        border-radius: 6px !important;
    }

    .flatpickr-day.selected,
    .flatpickr-day.startRange,
    .flatpickr-day.endRange {
        background: var(--primary-dark) !important;
        border-color: var(--primary-dark) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
    }

        .flatpickr-day.selected:hover,
        .flatpickr-day.startRange:hover,
        .flatpickr-day.endRange:hover {
            background: #061530 !important;
            border-color: #061530 !important;
            color: #ffffff !important;
        }

    .flatpickr-day.today {
        border: 2px solid var(--primary-dark) !important;
        background: transparent !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
    }

        .flatpickr-day.today.selected {
            border-color: var(--primary-dark) !important;
            background: var(--primary-dark) !important;
            color: #ffffff !important;
        }

    .flatpickr-day.inRange {
        background: #e8f0fe !important;
        border-color: #e8f0fe !important;
        color: var(--primary-dark) !important;
        border-radius: 0 !important;
    }

        .flatpickr-day.inRange:first-of-type {
            border-radius: 6px 0 0 6px !important;
        }

        .flatpickr-day.inRange:last-of-type {
            border-radius: 0 6px 6px 0 !important;
        }

    .flatpickr-day.disabled,
    .flatpickr-day.disabled:hover {
        color: #d1d5db !important;
    }

    .flatpickr-day.flatpickr-disabled,
    .flatpickr-day.flatpickr-disabled:hover {
        color: #d1d5db !important;
    }

    .flatpickr-day.selected.startRange,
    .flatpickr-day.startRange {
        border-radius: 6px 0 0 6px !important;
    }

    .flatpickr-day.selected.endRange,
    .flatpickr-day.endRange {
        border-radius: 0 6px 6px 0 !important;
    }

    .flatpickr-day.selected.startRange.endRange {
        border-radius: 6px !important;
    }

.flatpickr-time {
    border-top: 1px solid var(--border-color) !important;
    padding: 6px 12px !important;
}

    .flatpickr-time input {
        color: var(--text-main) !important;
        font-size: 0.85rem !important;
    }

    .flatpickr-time .flatpickr-time-separator {
        color: var(--text-muted) !important;
    }

    .flatpickr-time .numInputWrapper:hover {
        background: #f1f5f9 !important;
    }

.flatpickr-input[readonly] {
    background: #ffffff !important;
    cursor: pointer !important;
}

.flatpickr-innerContainer {
    display: grid !important;
}

/* ============================================================
   TABLE PANEL
   ============================================================ */
.table-panel {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.email-dashboard-section .table th {
    min-width: 100px;
    font-weight: 600;
    color: #000;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 8px;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .email-dashboard-section .table th:first-child {
        padding-left: 16px !important;
    }

.email-dashboard-section .table td {
    padding: 16px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .clickable-row:hover {
        background-color: var(--bg-light);
    }

    .clickable-row.active-row {
        background-color: #f1f5f9;
    }

        .clickable-row.active-row td:first-child {
            box-shadow: inset 3px 0 0 0 #0a1f44;
            width: 150px !important;
            white-space: normal !important;
            padding-left: 16px !important;
        }

/* ============================================================
   DIRECTION & STATUS BADGES
   ============================================================ */
.dir-incoming {
    color: #3b82f6;
    font-weight: 500;
}

.dir-outgoing {
    color: #10b981;
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.status-verified {
    color: #10b981;
}

.status-pending {
    color: #f59e0b;
}

/* ============================================================
   DETAILS PANEL
   ============================================================ */
.details-panel {
    padding: 16px 0px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: block;
    margin-bottom: 1rem;
    margin-left: 16px;
}

.detail-label {
    width: 120px;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text-main);
    flex-grow: 1;
    word-wrap: break-word;
    margin-top: 8px;
}

.pdf-badge {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
}

.thread-details {
    display: flex !important;
}

/* ============================================================
   TIMELINE COLUMN
   ============================================================ */
.timeline-column {
    position: relative;
}

    .timeline-column::before {
        content: "";
        position: absolute;
        left: 10px !important;
        top: 15px;
        bottom: 0;
        width: 2px;
        background: var(--border-color);
    }

/* ============================================================
   TIMELINE CARD - NEW DESIGN
   ============================================================ */
.timeline-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: box-shadow 0.2s ease;
    position: relative;
    padding-right: 44px !important;
}

    .timeline-card:hover {
        box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    }

    .timeline-card.active-card {
        border-color: var(--primary-dark);
        background-color: #f0f4ff;
        box-shadow: 0 2px 8px rgba(10, 31, 68, 0.08);
    }

/* Type Badge - Positioned Top Right */
.type-badge {
    position: absolute;
    top: 12px;
    right: 10px;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 2px 12px;
  
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

    .type-badge.incoming {
        border: 1px solid #3B82F6;
        color: #3B82F6;
        background: #EFF6FF;
    }

    .type-badge.outgoing {
        border: 1px solid #10B981;
        color: #10B981;
        background: #ECFDF5;
    }

/* Timeline Card Content */
.timeline-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .timeline-card-content .date-time {
        font-size: 0.82rem;
        font-weight: 500;
        color: #111827;
    }

    .timeline-card-content .from-to {
        font-size: 0.82rem;
        color: #374151;
    }

        .timeline-card-content .from-to strong {
            font-weight: 600;
            color: #0A1F44;
        }

    .timeline-card-content .subject {
        font-size: 0.82rem;
        color: #374151;
        line-height: 1.4;
    }

        .timeline-card-content .subject strong {
            font-weight: 600;
            color: #0A1F44;
        }

/* Attachment in Timeline */
.timeline-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F3F4F6;
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    transition: all 0.2s;
    cursor: pointer;
    width: fit-content;
    position: relative;
}

    .timeline-attachment:hover {
        background: #EEF2FF;
        border-color: var(--primary-dark);
        color: var(--primary-dark);
    }

    .timeline-attachment i {
        font-size: 12px;
        color: var(--text-muted);
    }

    /* Tooltip for attachment */
    .timeline-attachment[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        background: #0A1F44;
        color: #ffffff;
        padding: 4px 12px;
        border-radius: 6px;
        font-size: 0.7rem;
        white-space: nowrap;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .timeline-attachment[data-tooltip]:hover::before {
        content: '';
        position: absolute;
        bottom: calc(100% + 2px);
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #0A1F44;
        z-index: 10;
    }

/* View Message Button */
.view-message-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 500;
    background: transparent;
    border-radius:12px;
    border: 1px solid var(--primary-dark);
    padding: 3px 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
    margin-top: 2px;
}

    .view-message-btn:hover {
        color: var(--primary-dark);
    }

    .view-message-btn i {
        font-size: 12px;
    }

/* Hide old icons in timeline cards */
.timeline-card .timeline-eye-icon {
    display: none !important;
}

/* Keep timeline-link-icon visible */
.timeline-link-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.85rem;
    opacity: 0.4;
    transition: all 0.2s ease;
    text-decoration: none;
    z-index: 1;
}
.timeline-card svg{
    color: #0a1f44 !important;
}
    .timeline-link-icon:hover {
        opacity: 1;
        color: var(--primary-dark) !important;
    }

.timeline-card:not(.active-card) .timeline-link-icon {
    display: block;
}

.timeline-card.active-card .timeline-link-icon {
    /*display: none;*/
}

/* ============================================================
   TIMELINE DOT
   ============================================================ */
.timeline-dot {
    position: absolute;
    left: -29px;
    top: 12px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #cbd5e1;
    z-index: 2;
}

    .timeline-dot.active {
        border-color: var(--primary-dark);
        background: var(--primary-dark);
        box-shadow: 0 0 0 3px rgba(10, 31, 68, 0.15);
    }

/* ============================================================
   TIMELINE ITEM & HEADER
   ============================================================ */
.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.timeline-item,
.timeline-dot,
.timeline-card {
    position: relative;
    z-index: 1;
}

/* ============================================================
   TIMELINE WRAPPER
   ============================================================ */
.timeline-wrapper {
    position: relative;
    height: 570px;
    width: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

    .timeline-wrapper::-webkit-scrollbar {
        width: 5px;
    }

    .timeline-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .timeline-wrapper::-webkit-scrollbar-thumb {
        background: var(--primary-dark);
        border-radius: 10px;
    }

        .timeline-wrapper::-webkit-scrollbar-thumb:hover {
            background: #061530;
        }

.timeline-container {
    position: relative;
    padding-left: 2rem;
}

.timeline-wrapper::before {
    display: none;
}

/* ============================================================
   DETAIL ATTACHMENT (for detail row)
   ============================================================ */
.detail-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F3F4F6;
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
    width: fit-content;
    position: relative;
    margin-right: 6px;
    margin-bottom: 4px;
}

    .detail-attachment:hover {
        background: #EEF2FF;
        border-color: var(--primary-dark);
        color: var(--primary-dark);
    }

    .detail-attachment i {
        font-size: 12px;
        color: var(--text-muted);
    }

    .detail-attachment[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        background: #0A1F44;
        color: #ffffff;
        padding: 4px 12px;
        border-radius: 6px;
        font-size: 0.7rem;
        white-space: nowrap;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .detail-attachment[data-tooltip]:hover::before {
        content: '';
        position: absolute;
        bottom: calc(100% + 2px);
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #0A1F44;
        z-index: 10;
    }

.detail-attachments-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* ============================================================
   SEE MORE LINK
   ============================================================ */
.see-more-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #0A1F44;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 10px;
    border: 1px dashed #0A1F44;
    border-radius: 6px;
    background: #F8FAFF;
    transition: all 0.2s;
    margin-left: 2px;
}

    .see-more-link:hover {
        background: #EEF2FF;
        border-color: #0A1F44;
        transform: scale(1.02);
    }

    .see-more-link i {
        font-size: 10px;
    }

/* ============================================================
   ATTACHMENT POPUP STYLES
   ============================================================ */
.attachment-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

    .attachment-popup-overlay.active {
        display: flex;
    }

.attachment-popup {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.attachment-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    background: #ffffff;
}

    .attachment-popup-header h3 {
        font-family: 'Inter', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: #111827;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .attachment-popup-header h3 i {
            color: #0A1F44;
        }

.attachment-popup-close {
    width: 36px;
    height: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #ffffff;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

    /*.attachment-popup-close:hover {
        background: #FEE2E2;
        border-color: #EF4444;
        color: #EF4444;
    }*/

.attachment-popup-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

    .attachment-popup-body::-webkit-scrollbar {
        width: 4px;
    }

    .attachment-popup-body::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .attachment-popup-body::-webkit-scrollbar-thumb {
        background: #0A1F44;
        border-radius: 10px;
    }

.attachment-table {
    width: 100%;
    border-collapse: collapse;
}

    .attachment-table thead th {
        text-align: left;
        padding: 12px 16px;
        font-family: 'Inter', sans-serif;
        font-size: 11px;
        font-weight: 600;
        color: #6B7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #E5E7EB;
        background: #F9FAFB;
    }

    .attachment-table tbody td {
        padding: 12px 16px;
        font-family: 'Inter', sans-serif;
        font-size: 13px;
        color: #111827;
        border-bottom: 1px solid #E5E7EB;
        vertical-align: middle;
    }

    .attachment-table tbody tr:hover {
        background: #F8FAFC;
    }

    .attachment-table tbody tr:last-child td {
        border-bottom: none;
    }

    .attachment-table .file-icon {
        color: #0A1F44;
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

    .attachment-table .file-name {
        font-weight: 500;
    }

    .attachment-table .file-size {
        color: #6B7280;
    }

    .attachment-table .download-btn {
        width: 32px;
        height: 32px;
        border: 1px solid #E5E7EB;
        border-radius: 6px;
        background: #ffffff;
        color: #6B7280;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .attachment-table .download-btn:hover {
            background: #0A1F44;
            color: #ffffff;
            border-color: #0A1F44;
            transform: scale(1.05);
        }

.attachment-count-badge {
    background: #EEF2FF;
    color: #0A1F44;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ============================================================
   MESSAGE POPUP - PREMIUM EMAIL DETAILS MODAL
   ============================================================ */
.message-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

    .message-popup-overlay.active {
        display: flex;
    }

.message-popup {
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 1150px;
    max-height: 820px;
    height: auto;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    animation: modalSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
}

.popup-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.popup-header-icon {
    width: 48px;
    height: 48px;
    background: #0A1F44;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: #ffffff;
    font-size: 20px;
}

    .popup-header-icon:hover {
        transform: scale(1.05);
    }

.popup-header-left h2 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    letter-spacing: -0.3px;
}

.popup-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6B7280;
    display: block;
    margin-top: 2px;
}

.popup-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #ffffff;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 16px;
}

    .header-btn:hover {
        background: #F8FAFC;
        border-color: #0A1F44;
        color: #0A1F44;
        transform: scale(1.05);
    }

.popup-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #ffffff;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
    font-size: 18px;
    font-weight: 300;
}

    .popup-close-btn:hover {
        background: #FEE2E2;
        border-color: #EF4444;
        color: #EF4444;
        transform: scale(1.05);
    }

.message-popup .popup-close-btn {
    display: none !important;
}

/* Body */
.popup-body-container {
    display: flex;
    flex: 1;
    overflow: scroll;
    background: #F8FAFC;
    padding: 24px 28px 20px 28px;
    gap: 24px;
}

.popup-left-panel {
    width: 30%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 8px;
}

    .popup-left-panel::-webkit-scrollbar {
        width: 3px;
    }

    .popup-left-panel::-webkit-scrollbar-track {
        background: transparent;
    }

    .popup-left-panel::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 10px;
    }

.info-card {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .info-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        border-color: #D1D5DB;
    }

.info-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

    .info-label i {
        font-size: 12px;
        color: #0A1F44;
        width: 14px;
        text-align: center;
    }

.info-value {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    padding-left: 22px;
}

.info-secondary {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6B7280;
    padding-left: 22px;
}

.mt-1 {
    margin-top: 2px;
}

.popup-right-panel {
    width: 70%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 4px;
}

    .popup-right-panel::-webkit-scrollbar {
        width: 3px;
    }

    .popup-right-panel::-webkit-scrollbar-track {
        background: transparent;
    }

    .popup-right-panel::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 10px;
    }

/* Conversation Header */
.conversation-header {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0A1F44;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .conversation-avatar span {
        font-family: 'Inter', sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: #ffffff;
    }

.conversation-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.conversation-sender {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.conversation-to {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .conversation-to span {
        color: #6B7280;
    }

        .conversation-to span:last-child {
            color: #111827;
            font-weight: 500;
        }

    .conversation-to i {
        margin-left: 2px;
        color: #6B7280;
        font-size: 12px;
    }

.conversation-date {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6B7280;
    flex-shrink: 0;
    margin-left: auto;
}

/* Email Body Card */
.email-body-card {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

    .email-body-card::-webkit-scrollbar {
        width: 3px;
    }

    .email-body-card::-webkit-scrollbar-track {
        background: transparent;
    }

    .email-body-card::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 10px;
    }

    .email-body-card p {
        font-family: 'Inter', sans-serif;
        font-size: 15px;
        line-height: 1.7;
        color: #111827;
        margin: 0 0 14px 0;
    }

        .email-body-card p:last-child {
            margin-bottom: 0;
        }

    .email-body-card strong {
        font-weight: 600;
        color: #111827;
    }

/* Attachments Section */
.attachments-section {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.attachments-title {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

    .attachments-title i {
        color: #6B7280;
        font-size: 14px;
    }

.attachment-count {
    background: #F3F4F6;
    padding: 1px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #F9FAFB;
    transition: all 0.2s ease;
}

    .attachment-item:hover {
        background: #ffffff;
        border-color: #0A1F44;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        transform: translateY(-1px);
    }

.attachment-icon {
    width: 36px;
    height: 36px;
    background: #EEF2FF;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0A1F44;
    font-size: 18px;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #6B7280;
}

.attachment-download {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    font-size: 16px;
}

    .attachment-download:hover {
        background: #0A1F44;
        color: #ffffff;
        border-color: #0A1F44;
        transform: scale(1.05);
    }

/* Footer */
.popup-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0;
    flex-shrink: 0;
}

.btn-close-modal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #0A1F44;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(10, 31, 68, 0.15);
}

    .btn-close-modal:hover {
        background: #061530;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(10, 31, 68, 0.25);
    }

    .btn-close-modal:active {
        transform: translateY(0);
    }

    .btn-close-modal i {
        font-size: 16px;
    }

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 15px !important;
    flex-wrap: wrap;
    padding-right: 12px;
    border-top: 1px solid #e2e8f0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
}

    .btn-action:hover {
        background: var(--bg-light);
        border-color: #cbd5e1;
    }

.btn-verify {
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

    .btn-verify:hover {
        background: var(--primary-dark);
        color: #ffffff;
    }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.maxii {
    white-space: nowrap !important;
    width: 150px;
}

.form-control:focus {
    box-shadow: none !important;
}

.btn-check:checked + .btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check) + .btn:active {
    color: white;
    background-color: var(--primary-dark);
    border-color: var(--bs-btn-active-border-color);
}

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
*::-webkit-scrollbar {
    width: 5px;
    height: 6px;
    background: #f1f1f1;
    border-radius: 10px;
}

*::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 10px;
}

    *::-webkit-scrollbar-thumb:hover {
        background: #061530;
    }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */
@media (max-width: 1200px) {
    .container-fluid {
        padding: 0px 50px;
    }
    .thread-details {
        
        flex-direction:column!important;
    }
}
@media (max-width: 1024px) {
    .message-popup {
        max-width: 95%;
        max-height: 100vh;
    }

    .popup-body-container {
        flex-direction: column;
        padding: 16px 20px;
    }

    .popup-left-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding-right: 0;
        overflow-y: visible;
        max-height: none;
    }

        .popup-left-panel .info-card {
            flex: 1;
           min-width: stretch;
        }

    .popup-right-panel {
        width: 100%;
        overflow-y: visible;
        max-height: none;
    }

    .popup-header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .popup-header-right {
        margin-left: auto;
    }

    .popup-close-btn {
        top: 16px;
        right: 16px;
    }

    .conversation-header {
        flex-wrap: wrap;
    }

    .conversation-date {
        margin-left: 0;
        width: 100%;
        padding-left: 60px;
    }

    .attachment-popup {
        max-width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 991.98px) {
    .table-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .container-fluid {
        padding: 0px 15px !important;
    }
}

@media (max-width: 767px) {
    .the_row_m .col-auto{
        width:100% !important;
    }
    .the_row_m .col-auto-m {
        flex-direction:column !important;
        justify-content:left !important;
    }
    .the_select_m{
        width:100% !important;
    }
    .col-auto-m .text-muted {
        width: 100% !important;
    }
    .action-buttons {
        flex-direction:column;
    }
}

    @media (max-width: 600px) {
        .message-popup {
            max-width: 100%;
            max-height: 100vh;
            border-radius: 0;
            width: 100%;
            height: 100%;
        }

        .popup-header {
            border-radius: 0;
        }

        .popup-body-container {
            padding: 12px 16px;
        }

        .email-body-card {
            padding: 20px;
        }

        .popup-header-left h2 {
            font-size: 17px;
        }

        .popup-header-icon {
            width: 40px;
            height: 40px;
            font-size: 18px;
        }

        .popup-left-panel .info-card {
            min-width: 100%;
        }

        .conversation-header {
            padding: 12px 16px;
        }

        .attachments-section {
            padding: 12px 16px;
        }

        .attachment-popup {
            max-width: 98%;
            max-height: 95vh;
        }

        .attachment-popup-body {
            padding: 12px 16px;
        }

        .attachment-table thead th,
        .attachment-table tbody td {
            padding: 8px 10px;
            font-size: 12px;
        }

        .detail-attachments-wrapper {
            padding-left: 0;
        }
    }

    @media (max-width: 400px) {
        .flatpickr-calendar {
            width: 280px !important;
        }
    }

    .select2-container--bootstrap-5 .select2-selection {
        font-size: 0.85rem;
        border-color: #e2e8f0 !important;
        border: 1px solid #e2e8f0;
        box-shadow: none !important;
        border-radius: 6px !important;
        min-height: 38px;
        background: #ffffff !important;
    }

.timeline-column::before {
    left: 22px !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 22px;
}

.timeline-wrapper {
    height: 655px;
}

@media (max-width: 1200px) {
    .container-fluid {
        padding: 0px 50px;
    }
}

/* ===== MOBILE RESPONSIVE STYLES (BELOW 991px) ===== */
@media (max-width: 990px) {
    /* Hide desktop header */
    /* .header {
                        display: none !important;
                    } */
    /* Mobile header */
    .mobile-header {
        display: flex !important;
        background: #0A1F44;
        height: 70px;
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 1050;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
        .mobile-header .brand-title {
            color: #fff;
            font-weight: 600;
            font-size: 18px;
            letter-spacing: 0.3px;
        }

        .mobile-header .icon-btn {
            background: transparent;
            border: 0;
            color: #fff;
            font-size: 20px;
            padding: 6px 8px;
            line-height: 1;
        }

    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
        line-height: 33px;
        padding-left: 0px;
    }

    .details-panel {
        padding: 16px 10px 16px;
    }
    
    .mobile-header .icon-btn:focus {
        outline: none;
    }
    /* Hide desktop filters */
    .filter-section .the_row_m {
        display: none !important;
    }
    /* Mobile filters - stacked vertical */
    .filter-mobile {
        display: block !important;
        background: #fff;
        border-radius: 16px;
        padding: 20px 16px;
        margin: 16px 0 20px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }
       
        .filter-mobile .form-control,
        .filter-mobile .form-select {
            height: 48px;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            font-size: 14px;
        }

        .filter-mobile .input-group-text {
            background: #fff;
            border-radius: 6px 0 0 6px;
            border: 1px solid #e2e8f0;
        }

    .input-group-tex {
        border-radius: 0px 6px 6px 0px !important;
    }

    .filter-mobile .input-group .form-control {
        border-radius: 0 6px 6px 0 !important;
    }

    .filter-mobile .input-group .datepicker {
        border-radius: 6px 0px 0px 6px !important;
    }

    .filter-mobile .btn-apply {
        background: #0A1F44;
        color: #fff;
        border-radius: 12px;
        height: 48px;
        font-weight: 600;
        flex: 1;
        border: none;
    }

    .filter-mobile .btn-reset {
        background: transparent;
        color: #0A1F44;
        border: 1px solid #0A1F44;
        border-radius: 12px;
        height: 48px;
        font-weight: 600;
        flex: 1;
    }
    /* Hide desktop table */
    .table-panel .table-responsive {
        display: none !important;
    }
    /* Mobile conversation cards */
    .convo-list {
        display: block !important;
        height: 405px;
        overflow: scroll;
    }

    .convo-card {
        background: #fff;
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border: 1px solid #f0f4fa;
        cursor: pointer;
        transition: all 0.15s ease;
    }

        .convo-card.active-row {
            border-left: 4px solid #0A1F44;
            background: #fafcff;
        }

        .convo-card .subject {
            font-weight: 700;
            font-size: 16px;
            color: #0A1F44;
            margin-bottom: 4px;
        }

        .convo-card .meta-line {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px 12px;
            font-size: 13px;
            color: #4a5a72;
            margin-top: 6px;
        }

        .convo-card .badge-dir {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }

    .badge-dir.incoming {
        background: #e6f0ff;
        color: #0A1F44;
    }

    .badge-dir.outgoing {
        background: #eef2f7;
        color: #2c3e50;
    }

    .convo-card .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 500;
        padding: 2px 10px;
        border-radius: 20px;
    }

    .convo-card .status-verified {
        background: #e3f5ec;
        color: #0b6e4f;
    }

    .convo-card .status-pending {
        background: #fff3e0;
        color: #b7651a;
    }

    .convo-card .chevron {
        color: #a0b3cc;
        font-size: 14px;
        margin-left: auto;
    }

    .select2-container--bootstrap-5 .select2-selection {
        min-height: 48px;
    }
    /* Mobile pagination */
    .pagination-mobile {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 12px;
        padding: 16px 0 8px;
    }

        .pagination-mobile .page-btn {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 30px;
            padding: 6px 18px;
            font-size: 14px;
            font-weight: 500;
            color: #2c3e50;
            transition: all 0.1s;
        }

            .pagination-mobile .page-btn.active {
                background: #0A1F44;
                color: #fff;
                border-color: #0A1F44;
            }
    /* Hide desktop details */
    .details-panel .desktop-details {
        display: none !important;
    }
    /* Mobile thread accordion */
    .thread-accordion {
        display: block !important;
        background: #fff;
        border-radius: 16px;
        padding: 0 16px 16px;
        margin: 20px 0 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border: 1px solid #f0f4fa;
    }

        .thread-accordion .accordion-toggle {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 0;
            font-weight: 600;
            color: #0A1F44;
            font-size: 16px;
            cursor: pointer;
            border-bottom: 1px solid #eef2f7;
        }

        .thread-accordion .accordion-body {
            padding-top: 16px;
            display: none;
        }

            .thread-accordion .accordion-body.open {
                display: block;
            }
    /* Mobile Conversation Info */
    .mobile-conversation-info {
        margin-top: 20px;
        background: #fff;
        border-radius: 16px;
        border: 1px solid #f0f4fa;
        overflow: hidden;
    }

    .mobile-info-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        font-weight: 600;
        color: #0A1F44;
        cursor: pointer;
        border-bottom: 1px solid #eef2f7;
    }

    .mobile-info-body {
        display: none;
        padding: 16px 20px;
    }

        .mobile-info-body.open {
            display: block;
        }

    .mobile-info-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #f5f7fa;
    }

        .mobile-info-row:last-child {
            border-bottom: none;
        }

    .mobile-info-label {
        color: #6b7d99;
        font-size: 13px;
        font-weight: 500;
    }

    .mobile-info-value {
        color: #1f2a3e;
        font-size: 13px;
        font-weight: 500;
        text-align: right;
        max-width: 60%;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
    }

    .detail-attachment {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #F3F4F6;
        border: 1px solid var(--border-color);
        padding: 2px 8px;
        border-radius: 6px;
        font-size: 0.7rem;
        color: var(--text-muted);
        transition: all 0.2s;
        cursor: pointer;
        width: fit-content;
        position: relative;
    }

        .detail-attachment:hover {
            background: #EEF2FF;
            border-color: var(--primary-dark);
            color: var(--primary-dark);
        }

        .detail-attachment i {
            font-size: 10px;
            color: var(--text-muted);
        }

    .see-more-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 0.7rem;
        color: #0A1F44;
        font-weight: 600;
        cursor: pointer;
        padding: 2px 8px;
        border: 1px dashed #0A1F44;
        border-radius: 6px;
        background: #F8FAFF;
        transition: all 0.2s;
    }

        .see-more-link:hover {
            background: #EEF2FF;
            border-color: #0A1F44;
            transform: scale(1.02);
        }

        .see-more-link i {
            font-size: 10px;
        }
    /* Mobile timeline */
    .timeline-mobile {
        position: relative;
        padding-left: 28px;
    }

        .timeline-mobile::before {
            content: '';
            position: absolute;
            left: 12px;
            top: 8px;
            bottom: 8px;
            width: 2px;
            background: #dce2ec;
        }

    .timeline-item-m {
        position: relative;
        margin-bottom: 24px;
        padding-left: 12px;
    }

        .timeline-item-m:last-child {
            margin-bottom: 0;
        }

        .timeline-item-m .dot {
            position: absolute;
            left: -22px;
            top: 6px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid #0A1F44;
            z-index: 2;
        }

            .timeline-item-m .dot.active {
                background: #0A1F44;
                border-color: #0A1F44;
            }

        .timeline-item-m .card-timeline {
            background: #fff;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            border: 1px solid #eef2f7;
            position: relative;
        }

            .timeline-item-m .card-timeline.active-card {
                border-color: #0A1F44;
                background-color: #f0f4ff;
                box-shadow: 0 2px 8px rgba(10, 31, 68, 0.08);
            }
        /* Link icon positioned at bottom right corner */
        .timeline-item-m .timeline-link-icon {
            position: absolute;
            bottom: 10px;
            right: 10px;
            font-size: 0.85rem;
            opacity: 0.4;
            transition: all 0.2s ease;
            text-decoration: none;
            z-index: 1;
            color: #6B7280;
        }

            .timeline-item-m .timeline-link-icon:hover {
                opacity: 1;
                color: #0A1F44 !important;
            }

        .timeline-item-m .card-timeline .date {
            font-size: 12px;
            color: #6b7d99;
            margin-bottom: 6px;
        }

        .timeline-item-m .card-timeline .fromto {
            font-size: 13px;
            color: #1f2a3e;
            margin-bottom: 3px;
        }

        .timeline-item-m .card-timeline .subject-preview {
            font-size: 14px;
            font-weight: 500;
            color: #0A1F44;
            margin: 6px 0 8px;
        }

        .timeline-item-m .card-timeline .attach-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: #f4f8ff;
            border-radius: 30px;
            padding: 4px 12px;
            font-size: 12px;
            color: #0A1F44;
            margin: 4px 0 10px;
            cursor: default;
        }

        .timeline-item-m .card-timeline .btn-view {
            background: transparent;
            border: 1px solid #0A1F44;
            border-radius: 30px;
            padding: 4px 16px;
            font-size: 13px;
            font-weight: 500;
            color: #0A1F44;
            transition: 0.1s;
        }

            .timeline-item-m .card-timeline .btn-view i {
                margin-right: 4px;
            }
    /* Mobile action grid */
    .action-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 16px 0 30px;
    }

        .action-grid .action-btn {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            height: 48px;
            font-weight: 500;
            font-size: 13px;
            color: #1f2a3e;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: 0.1s;
        }

            .action-grid .action-btn i {
                color: #6b7d99;
            }

            .action-grid .action-btn.verify {
                background: #0A1F44;
                color: #fff;
                border-color: #0A1F44;
            }

                .action-grid .action-btn.verify i {
                    color: #b3c9ff;
                }
    /* Mobile popup fullscreen */
    .message-popup-overlay {
        position: fixed;
        inset: 0;
        background: #f4f7fc;
        z-index: 9999;
        display: none;
        align-items: stretch;
        justify-content: stretch;
    }

        .message-popup-overlay.active {
            display: flex;
        }

    .message-popup {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        border-radius: 0 !important;
        background: #f4f7fc;
        overflow-y: auto;
        padding: 0 16px 24px;
        box-shadow: none !important;
    }

        .message-popup .popup-close-btn {
            display: none;
        }

        .message-popup .popup-header {
            background: #fff;
            border-radius: 16px;
            padding: 16px;
            margin: 16px 0 16px;
            flex-wrap: wrap;
            box-shadow: 0 2px 8px rgba(0,0,0,0.02);
        }

        .message-popup .popup-header-left h2 {
            font-size: 18px;
        }

        .message-popup .popup-header-right .header-btn {
            background: transparent;
            border: 0;
            color: #3b4d66;
            font-size: 18px;
            padding: 4px 6px;
        }

        .message-popup .popup-body-container {
            display: block !important;
            gap: 0;
        }

        .message-popup .popup-left-panel,
        .message-popup .popup-right-panel {
            width: 100% !important;
            padding: 0;
        }

            .message-popup .popup-left-panel .info-card {
                background: #fff;
                border-radius: 16px;
                padding: 16px;
                margin-bottom: 12px;
                box-shadow: 0 2px 8px rgba(0,0,0,0.02);
            }

            .message-popup .popup-right-panel .conversation-header {
                background: #fff;
                border-radius: 16px;
                padding: 16px;
                margin-bottom: 12px;
                flex-wrap: wrap;
            }

            .message-popup .popup-right-panel .email-body-card {
                background: #fff;
                border-radius: 16px;
                padding: 16px;
                margin-bottom: 12px;
                box-shadow: 0 2px 8px rgba(0,0,0,0.02);
            }

            .message-popup .popup-right-panel .attachments-section {
                background: #fff;
                border-radius: 16px;
                padding: 16px;
                margin-bottom: 12px;
            }

        .message-popup .popup-footer .btn-close-modal {
            background: #0A1F44;
            color: #fff;
            border-radius: 30px;
            padding: 10px 24px;
            border: 0;
            font-weight: 500;
        }
    /* Container padding - ONLY for email dashboard section */
    .email-dashboard-section .container-fluid {
        padding: 0 16px !important;
    }
    /* Attachment popup mobile styles */
    .attachment-popup {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        height: 100vh !important;
    }

    .attachment-popup-overlay {
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    .the-footer {
        gap: 10px;
    }
    .footer-the{
        text-align:center;
    }
        .footer-the .vdg-logo-box {
            justify-content: center;
        }
        .filter-sectionss .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
        line-height: 46px !important;
        padding-left: 12px !important;
    }
}

@media (min-width: 991px) {
    .mobile-header {
        display: none !important;
    }

    .filter-mobile {
        display: none !important;
    }

    .convo-list {
        display: none !important;
    }

    .pagination-mobile {
        display: none !important;
    }

    .thread-accordion {
        display: none !important;
    }

    .action-grid {
        display: none !important;
    }
}

/* Utility classes */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gap-2 {
    gap: 8px;
}

.mt-1 {
    margin-top: 4px;
}

.border-0 {
    border: 0;
}

.shadow-sm {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Attachment popup styles */
.attachment-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

    .attachment-popup-overlay.active {
        display: flex;
    }

.attachment-popup {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.attachment-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    background: #ffffff;
}

    .attachment-popup-header h3 {
        font-family: 'Inter', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: #111827;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .attachment-popup-header h3 i {
            color: #0A1F44;
        }

.attachment-popup-close {
    width: 36px;
    height: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #ffffff;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

    /*.attachment-popup-close:hover {
        background: #FEE2E2;
        border-color: #EF4444;
        color: #EF4444;
    }*/

.attachment-popup-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

    .attachment-popup-body::-webkit-scrollbar {
        width: 4px;
    }

    .attachment-popup-body::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .attachment-popup-body::-webkit-scrollbar-thumb {
        background: #0A1F44;
        border-radius: 10px;
    }

.attachment-table {
    width: 100%;
    border-collapse: collapse;
}

    .attachment-table thead th {
        text-align: left;
        padding: 12px 16px;
        font-family: 'Inter', sans-serif;
        font-size: 11px;
        font-weight: 600;
        color: #6B7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #E5E7EB;
        background: #F9FAFB;
    }

    .attachment-table tbody td {
        padding: 12px 16px;
        font-family: 'Inter', sans-serif;
        font-size: 13px;
        color: #111827;
        border-bottom: 1px solid #E5E7EB;
        vertical-align: middle;
    }

    .attachment-table tbody tr:hover {
        background: #F8FAFC;
    }

    .attachment-table tbody tr:last-child td {
        border-bottom: none;
    }

    .attachment-table .file-icon {
        color: #0A1F44;
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

    .attachment-table .file-name {
        font-weight: 500;
    }

    .attachment-table .file-size {
        color: #6B7280;
    }

    .attachment-table .download-btn {
        width: 32px;
        height: 32px;
        border: 1px solid #E5E7EB;
        border-radius: 6px;
        background: #ffffff;
        color: #6B7280;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .attachment-table .download-btn:hover {
            background: #0A1F44;
            color: #ffffff;
            border-color: #0A1F44;
            transform: scale(1.05);
        }

.attachment-count-badge {
    background: #EEF2FF;
    color: #0A1F44;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.dashboard-wrapper-one .timeline-column::before {
    left: 10px !important;
}
.borders {
    border: 1px solid #e2e8f0;
    border-top:none;
}
.footer .container {
    width: 100% !important;
    max-width: 100%;
    padding: 0px 100px !important;
}

/* Select2 Bootstrap 5 Arrow */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* Create the arrow */
    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
        display: block !important;
        width: 8px;
        height: 8px;
        border-right: 2px solid #495057;
        border-bottom: 2px solid #495057;
        transform: rotate(45deg);
        margin-top: -4px;
        border-top: 0;
        border-left: 0;
    }

/* Open state */
.select2-container--bootstrap-5.select2-container--open
.select2-selection--single
.select2-selection__arrow b {
    transform: rotate(-135deg);
    margin-top: 2px;
}
.fa-link {
    color: #0a1f44 !important;
}
.timeline-link-icon {
    opacity: 1 !important;
}
/* Search Input Group Styling - Icon on Right */
.input-grouppp {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 200px;
}


    .input-grouppp:focus-within {
        border-color: var(--primary-dark);
    }

    .input-grouppp .input-group-text {
        background: transparent;
        border: none;
        padding-left: 4px;
        padding-right: 12px;
        color: var(--text-muted);
    }

        .input-grouppp .input-group-text i {
            font-size: 14px;
            color: #94a3b8;
            transition: color 0.3s ease;
        }

    .input-grouppp:focus-within .input-group-text i {
        color: var(--primary-dark);
    }

    .input-grouppp .form-control {
        border: none;
        padding: 8px 4px 8px 12px;
        font-size: 0.85rem;
        color: var(--text-main);
        background: transparent;
        height: 40px;
    }

        .input-grouppp .form-control::placeholder {
            color: #94a3b8;
            font-size: 0.85rem;
        }

        .input-grouppp .form-control:focus {
            box-shadow: none;
            background: transparent;
        }
.select2-container--bootstrap-5.select2-container--open .select2-dropdown {
    margin-top:0px !important;
    border-top: 1px solid #dbe2ef !important;
}
/* When Select2 is open */
.select2-container--open .select2-selection--single {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Dropdown */
.select2-container--open .select2-dropdown--below {
    margin-top: -1px !important;
    border-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}
/* Remove shadow from Select2 */
.select2-container--bootstrap-5 .select2-selection--single,
.select2-container--bootstrap-5 .select2-dropdown {
    box-shadow: none !important;
}

/* Remove shadow when focused/open */
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    box-shadow: none !important;
}

/* Remove browser focus outline if present */
.select2-selection:focus {
    outline: none !important;
    box-shadow: none !important;
}
.incoming {
    color: #3b82f6 !important;
    font-weight: 500!important;
}
.outgoing {
    color: #10b981;
    font-weight: 500;
}