/*Write your custom css in this file.*/

/* Summation rows in header styling */
table thead.summation-section tr.summation-row {
    background-color: #f5f5f5;
    font-weight: bold;
    border-top: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
}

table thead.summation-section tr.summation-row th {
    background-color: #f5f5f5 !important;
}

/* Sticky Header */
.table-responsive {
    position: relative;
}

table.sticky-header-table {
    position: relative;
}

/* All header cells should be sticky */
table.sticky-header-table thead th {
    position: sticky !important;
    background-color: #fff;
    z-index: 5;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Column titles row - always first, not summation-row */
table.sticky-header-table thead > tr:not(.summation-row):first-child th {
    top: 0 !important;
    z-index: 6 !important;
    background-color: #fff !important;
}

/* If no summation in header, all rows at top 0 */
table.sticky-header-table thead:not(.summation-section) th {
    top: 0 !important;
    z-index: 6 !important;
}

/* Summation rows - positions will be set by JavaScript */
table.sticky-header-table thead.summation-section tr.summation-row th {
    background-color: #f5f5f5 !important;
    z-index: 5 !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

.card-header {
    font-weight: 600;
}

.badge {
    font-size: 0.875rem;
}

.table th {
    font-weight: 600;
    font-size: 0.875rem;
}

.table td {
    font-size: 0.875rem;
}

.table-bordered th, 
.table-bordered td {
    border: 1px solid #dee2e6;
}

.dashboard-section {
    padding: 0;
}

/* Ensure proper spacing at bottom of page */
.dashboard-container {
    padding-bottom: 50px;
    margin-bottom: 50px;
}

/* Fix table display issues */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

/* Ensure last table row is fully visible */
.card-body {
    overflow: visible;
}

/* Fix horizontal scrollbar issue */
/* .dashboard-container {
    overflow-x: hidden;
} */

/* Fix right column margin and alignment */
.col-lg-4 {
    padding-right: 15px;
    padding-left: 15px;
}

/* Fix right sidebar cards */
.col-lg-4 .card {
    margin-left: 0;
    margin-right: 0;
}

/* Ensure proper spacing for right sidebar content */
.col-lg-4 .card-body {
    padding: 1rem;
}

/* Ensure tables don't cause horizontal scroll */
.table {
    margin-bottom: 0;
}

/* Fix card margins */
.card {
    margin-bottom: 1rem;
}

/* Ensure proper spacing for summary cards */
.row.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Prevent horizontal overflow */
/* .container-fluid, .row {
    max-width: 100%;
    overflow-x: hidden;
} */

/* Fix table width issues */
.table-responsive table {
    width: 100%;
    max-width: 100%;
}

.table td, .table th {
    word-wrap: break-word;
    /* white-space: nowrap; */
}

/* Ensure proper text wrapping */
/* .table td, .table th {
    word-wrap: break-word;
    white-space: nowrap;
    padding: 8px 12px;
} */

/* Fix table alignment */
.table th {
    text-align: center;
}

.table td.text-end {
    text-align: right;
}

.table td.text-center {
    text-align: center;
}

/* Fix summary cards spacing */
.col-md-3 {
    padding-left: 15px;
    padding-right: 15px;
}

/* Fix right sidebar table alignment */
.col-lg-4 .table th,
.col-lg-4 .table td {
    padding: 6px 8px;
    font-size: 0.875rem;
}

/* Ensure right sidebar tables fit properly */
.col-lg-4 .table-responsive {
    overflow-x: visible;
}

/* Fix right sidebar card headers */
.col-lg-4 .card-header {
    padding: 0.75rem 1rem;
}

/* Ensure proper text alignment in right sidebar */
.col-lg-4 .table td:first-child {
    text-align: left;
    font-weight: 500;
}

.col-lg-4 .table td:last-child {
    text-align: right;
}

/* Fix table width in right sidebar */
.col-lg-4 .table {
    width: 100%;
    table-layout: fixed;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .card-header h5, .card-header h6 {
        font-size: 0.875rem;
    }
}

.select2-container {
    width: 100% !important;
}

.select2-dropdown {
    width: 100% !important;
    max-width: 100% !important;
}

.select2-results__options {
    max-height: 300px !important;
}

/* ============================================================
   Compact tables for project views
   ============================================================ */
.project-details-view .display td {
    padding: 4px 8px !important;
    font-size: 13px;
}
.project-details-view .display th {
    padding: 4px 8px !important;
    font-size: 13px;
}
.project-details-view .display .option a {
    padding: 2px 4px;
    display: inline-block;
}
.project-details-view .display .option {
    white-space: nowrap;
}
.project-details-view .appTableFooter {
    padding: 4px 8px !important;
    min-height: 0 !important;
}