/* Clawback Risk Dashboard Styles */

/* Page background override */
body {
    background-color: #ffffff !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.paragraph-subtle {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 0;
    font-weight: 400;
}

/* Ensure proper spacing for rows within main-content */
#main-content .row {
    margin-left: 0;
    margin-right: 0;
}

/* Remove padding from chart columns to align with cards and table */
/* Target specifically the row containing the charts */
#main-content .row:has(#riskByAgeChart)>.col-lg-6,
#main-content .row:has(#riskByLenderChart)>.col-lg-6 {
    padding-left: 0;
    padding-right: 0;
}

/* Add gap between the two charts when side by side */
#main-content .row:has(#riskByAgeChart)>.col-lg-6:first-child {
    padding-right: 8px;
}

#main-content .row:has(#riskByAgeChart)>.col-lg-6:last-child {
    padding-left: 8px;
}

/* On tablet and mobile when charts stack, remove the gap */
@media (max-width: 991px) {
    #main-content .row:has(#riskByAgeChart)>.col-lg-6:first-child {
        padding-right: 0;
        padding-bottom: 1rem;
    }

    #main-content .row:has(#riskByAgeChart)>.col-lg-6:last-child {
        padding-left: 0;
    }
}

/* Override card text colors from cards.css */
.card-title {
    color: #6b7280 !important;
    /* Gray text instead of light green */
    font-size: 0.875rem !important;
    text-transform: none !important;
}

.card-body h2 {
    color: #111827 !important;
    /* Dark text for values */
}

.card-body small {
    color: #6b7280 !important;
    /* Gray text for descriptions */
}

/* Risk amount styling */
.text-danger {
    color: #dc2626 !important;
}

/* Table styling */
#riskTable,
.clawback-table {
    font-size: 14px !important;
    /* Match analysis playground font size */
    background-color: #ffffff !important;
    width: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Modern system font stack */
}

#riskTable th,
.clawback-table th {
    background-color: #f9fafb !important;
    font-weight: 600 !important;
    /* Match analysis playground medium weight */
    font-size: 14px !important;
    /* Consistent font size with body cells */
    /* color: #6B7280 !important; */
    /* Gray-500 header color from analysis playground */
    text-transform: none !important;
    /* No text transformation */
    text-align: left !important;
    /* Left align headers */
    position: sticky;
    top: 0;
    z-index: 10;
}

#riskTable td,
.clawback-table td {
    background-color: #ffffff !important;
    color: #343a40 !important;
    /* Slightly softer dark text for cells from analysis playground */
    font-size: 14px !important;
    /* Consistent font size */
    line-height: 1.5;
    /* Adjusted line-height from analysis playground */
    text-align: left !important;
    /* Left align cell content */
    vertical-align: middle !important;
    /* Middle vertical alignment */
}

/* Add left padding to first column header and cells */
#riskTable th:first-child,
#riskTable td:first-child,
.clawback-table th:first-child,
.clawback-table td:first-child {
    padding-left: 15px !important;
}

#riskTable th,
.clawback-table th {
    border-bottom: 1px solid #e5e7eb !important;
}

/* Row striping and hover colors moved to enhanced_tables.css */

/* Badge styling removed - now using Tailwind badges with tailwind-scope */

/* Chart container sizing */
canvas {
    max-height: 300px;
}

/* Filter dropdown */
.form-select {
    border-color: #d1d5db;
}

.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* ? When the column is on a single line, we want to move the arrow up. this is the default position for the rules table */
.clawback-rules-container table.dataTable>thead .sorting:before,
.clawback-rules-container table.dataTable>thead .sorting_asc:before,
.clawback-rules-container table.dataTable>thead .sorting_desc:before,
.clawback-rules-container table.dataTable>thead .sorting:after,
.clawback-rules-container table.dataTable>thead .sorting_asc:after,
.clawback-rules-container table.dataTable>thead .sorting_desc:after {
    top: 46% !important;
}


/* Responsive wrapper - overflow fixes now in tables.css */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 40px !important;
    /* Removed negative margins that were cutting off search box */
}

.middle-row {
    margin-bottom: 40px !important;
}

/* Ensure DataTables components align properly */
.top.row {
    margin-bottom: 1rem !important;
}

.bottom.row {
    margin-top: 1rem !important;
    align-items: center !important;
}

/* Note: Pagination styling consolidated below with comprehensive styling from analysis playground */

/* Action link styling from analysis playground */
.action-link {
    color: #007bff !important;
    /* Standard blue link color */
    text-decoration: none;
    font-size: 14px !important;
    /* Match table cell font size */
}

.action-link:hover {
    text-decoration: underline;
    color: #007bff !important;
    /* Maintain blue color on hover */
}
