/* 1. MAIN CONTAINER & TABLE STYLING */
.ctm-container { 
    margin: 20px 0; 
    overflow-x: auto; 
}

.ctm-dynamic-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 14px; 
}

.ctm-dynamic-table th { 
    background: #f8f9fa; 
    text-align: left; 
    padding: 12px; 
    border-bottom: 2px solid #dee2e6; 
}

.ctm-dynamic-table td { 
    padding: 10px; 
    border-bottom: 1px solid #eee; 
    vertical-align: top; 
}

.ctm-dynamic-table tbody tr:hover { 
    background-color: #f1f2f6; 
}

/* 2. CUSTOM DATA FORMATTING (Badges & Info) */
/* The Red Badge for shared hardware [!!] */
.ctm-badge-red {
    color: #d63031;
    background: #fff5f5;
    border: 1px solid #fab1a0;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin: 2px 0;
}

/* Styling for the "|SHARED|" text block */
.ctm-shared-info {
    color: #0984e3; 
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
    margin-left: 5px;
}

/* 3. DATATABLES UI OVERRIDES */
.dataTables_wrapper .dt-buttons { 
    margin-bottom: 15px; 
}

.dt-button.buttons-csv { 
    background: #27ae60 !important; 
    color: white !important; 
    border: none !important; 
    border-radius: 4px; 
    padding: 6px 12px;
    font-weight: 500;
}

.dt-button.buttons-csv:hover {
    background: #219150 !important;
}

/* 4. DASHBOARD GRID LAYOUT */
.audit-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Top row: 2 charts */
    gap: 25px;
    margin: 30px 0;
    align-items: start;
}

/* Individual chart box styling */
.cfq-chart-box {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f1f2f6;
}

/* Make the 3rd chart (Regional Trends superposition) span the full width */
.audit-dashboard-grid .cfq-chart-box:nth-child(3) {
    grid-column: span 2;
}

/* 5. CHART.JS CONTAINERS */
.ctm-chart-container {
    position: relative; 
    background: #fff;
    padding: 10px;
    height: 400px; 
    width: 100%;
}

.ctm-chart-container h3 {
    margin-top: 0;
    font-size: 18px;
    color: #2d3436;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* 6. RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .audit-dashboard-grid {
        grid-template-columns: 1fr; /* Stack charts on mobile */
    }
    
    .audit-dashboard-grid .cfq-chart-box:nth-child(3) {
        grid-column: span 1;
    }
}