.charts-dashboard-section,
.dms-dashboard-section {
    position: relative; 
}

/* Style for the dashboard actions container */
.dashboard-export-buttons {
    position: absolute; 
    top: 10px; 
    right: 10px; 
    z-index: 10; 
    display: flex; 
    gap: 8px; 
}


.charts-dashboard-section, .dms-dashboard-section {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 20px; 
    margin: 20px auto; 
    max-width: 1600px; 
    width: 100%; 
    padding: 0 10px; 
    box-sizing: border-box;
}

/* #DonationByCampaignMonthContainer,
#DonationByCampaignYearContainer {
    flex: 1 1 100% !important; 
    max-width: 100% !important; 
} */

/* Styles for individual chart boxes*/
.chart-container-wrapper {
    flex: 1 1 calc(50% - 10px); 
    max-width: calc(50% - 10px);
    height: 60vh; 
    /* height: 600px; */
    max-height: 600px; 
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    background-color: #fff;
    padding: 25px;
    display: flex;
    flex-direction: column; 
    justify-content: flex-start;
    align-items: center; 
    box-sizing: border-box;
    position: relative;
}

/* Generic styling for all chart canvases */
.chart-canvas {
   /* width: 85% !important; 
    height: 85% !important; */
    /* display: block;  */
    flex-grow: 1; 
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

/* Generic styling for all chart messages */
.chart-message {
    text-align: center;
    /* margin-top: 10px; */
    color: #555;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 1024px) { 
    .chart-container-wrapper {
        flex: 1 1 400px; 
        height: 55vh;
        max-height: 450px;
        padding: 20px;
    }
    .chart-container-wrapper h4 {
        font-size: 1.6em;
    }

    /* Ensure full width for these containers on smaller screens too */
    #DonationByCampaignMonthContainer,
    #DonationByCampaignYearContainer {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) { 
    .charts-dashboard-section, .dms-dashboard-section {
        flex-direction: column;
        align-items: center; 
    }
    .chart-container-wrapper {
        width: 90vw; 
        flex: none; 
        height: 50vh;
        max-height: 400px;
        padding: 15px;
    }
    .chart-container-wrapper h4 {
        font-size: 1.4em;
    }

    /* Ensure full width for these containers on smaller screens too */
    #DonationByCampaignMonthContainer,
    #DonationByCampaignYearContainer {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) { 
    .chart-container-wrapper {
        width: 95vw;
        height: 45vh;
        max-height: 350px;
        padding: 10px;
    }
    .chart-container-wrapper h4 {
        font-size: 1.2em;
    }

    /* Ensure full width for these containers on smallest screens too */
    #DonationByCampaignMonthContainer,
    #DonationByCampaignYearContainer {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* VMS Modal Styles */
.vms-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    overflow: auto;
    background: rgba(0,0,0,0.4);
}

.vms-modal-content {
    background-color: #fefefe;
    margin: 40px auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1200px;
    border-radius: 5px;
    position: relative;
    z-index: 1001;
    box-shadow: 0 4px 32px rgba(0,0,0,0.2);
}

.vms-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 10px;
}

.vms-close:hover,
.vms-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* New styles to be added to vms.css from dms.css for the table content */
/* Ensure these IDs match the HTML structure (e.g., <h2 id="vms-modal-title">) */
#vms-modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

#vms-modal-body {
    margin-top: 20px;
}

/* Table styles for modal content */
#vms-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#vms-modal-body th {
    background-color: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    border: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    white-space: nowrap; /* Added from the JS generated style to prevent header wrapping */
}

#vms-modal-body td {
    padding: 8px;
    border: 1px solid #dee2e6; /* Adjusted for consistency with DMS's visual */
    vertical-align: top;
}

#vms-modal-body tr:nth-child(even) {
    background-color: #f8f9fa;
}

#vms-modal-body tr:hover {
    background-color: #e9ecef;
}

/* Responsive modal (optional, but good to include for consistency) */
@media (max-width: 768px) {
    .vms-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    #vms-modal-body {
        font-size: 14px;
    }
    
    #vms-modal-body th,
    #vms-modal-body td {
        padding: 6px 4px;
    }
}

.kpi-dashboard-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.kpi-box {
    flex: 1 1 250px;
    max-width: 500px;
    min-width: 300px;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .kpi-dashboard-section {
        flex-direction: column;
        align-items: stretch;
    }
    .kpi-box {
        max-width: 100%;
    }
}

/* Kebab menu styles for chart export */
.chart-menu-wrapper {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}
.chart-menu-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
.chart-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-width: 140px;
  margin-top: 4px;
}
.chart-menu-wrapper.open .chart-menu-dropdown {
  display: block;
}
.chart-menu-dropdown button {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}
.chart-menu-dropdown button:hover {
  background: #f5f5f5;
}

/* Styles for the VMS modal filter container */
.vms-modal .modal-filters { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    align-items: flex-end; 
    margin-bottom: 20px; 
    padding: 15px; 
    background-color: #f9f9f9; 
    border-bottom: 1px solid #eee; 
    box-sizing: border-box; 
}


.vms-modal .filter-group { 
    display: flex; 
    flex-direction: column; 
}

.vms-modal .filter-group label { 
    margin-bottom: 5px; 
    font-weight: bold;
    color: #333;
    white-space: nowrap; 
}

.vms-modal .modal-filters input[type="text"],
.vms-modal .modal-filters input[type="date"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 150px; 
    box-sizing: border-box; 
}

/* Styles for the VMS filter buttons */
.vms-modal .modal-filter-btn { 
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    align-self: flex-end; 
}

.vms-modal .modal-filter-btn:hover {
    background-color: #d0d0d0;
}

/*
stlyling for frequency
*/
/* Style for the filter container */
/* Ensure the filter container is a single row */
/* Ensure the filter container is a single row */
.chart-filters {
    display: flex;
    align-items: center;
    gap: 2px; /* Adjusts space between elements */
    flex-wrap: nowrap; /* Prevents wrapping, forcing a single line */
    justify-content: flex-start; /* Aligns items to the start of the container */
    padding-bottom: 2px;
    margin-bottom: 2px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

/* Specific styling for the 'Filter by Frequency' select dropdown */
#freqFilter {
    width: 80px; /* Adjust this value to your desired compact width */
    max-width: 100%; /* Ensures it's responsive and doesn't overflow on small screens */
    box-sizing: border-box;
    padding: 2px;
    font-size: 10px;
    height: 24px;
}

/* Ensure the date group is also a single, compact unit */
.date-filter-group {
    display: flex;
    align-items: center;
    gap: 5px; /* Keeps the date inputs and labels close together */
}

/* Style for labels to make them more compact */
.chart-filters label {
    font-size: 10px;
    font-weight: bold;
    color: #555;
    white-space: nowrap; /* Prevents labels from wrapping */
}

/* ************ KEY CHANGE HERE ************ */
/* Reduced size for ALL inputs and buttons for compactness, including text inputs (Flatpickr) */
.chart-filters select,
.chart-filters input[type="text"], /* Target text inputs for Flatpickr */
.chart-filters #applyDateFilter, .chart-filters #resetDateFilter {
    padding: 2px;
    font-size: 10px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Specific width for the date input fields */
.chart-filters input[type="text"] {
    width: 90px; /* Adjust this value to make date inputs shorter */
}
/* ****************************************** */


/* Apply button styling */
.chart-filters #applyDateFilter {
    background-color: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
}

.chart-filters #resetDateFilter {
    background-color: #555;
    color: white;
    border: none;
    cursor: pointer;
}

.chart-filters #applyDateFilter:hover {
    background-color: #005a87;
}

/* The rest of your CSS remains the same */

/* For responsiveness, you can add a media query to wrap on smaller screens */
@media (max-width: 900px) {
    .chart-filters {
        flex-wrap: wrap; /* Re-enable wrapping on smaller screens */
        justify-content: space-between;
    }
}