/*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;
}

/* Prevent horizontal overflow from reaching the PerfectScrollbar on
   #left-menu-toggle-mask. Without this, when the sidebar collapses PS shows
   a horizontal rail 20px below the viewport (the +20 in setHeight), which
   causes unwanted vertical overscroll and a floating horizontal scrollbar.
   Wide tables still scroll fine via their own .table-responsive containers. */
.global_dashboard-page #page-content {
    overflow-x: hidden;
}


/* 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;
}

.filter-item-box .select2-container.w150 {
    width: 150px !important;
}

.filter-item-box .select2-container.w200 {
    width: 200px !important;
}

.filter-item-box .select2-container.w300 {
    width: 300px !important;
}

.filter-item-box .select2-container.w400 {
    width: 400px !important;
}

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

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

/* Projects with affects_sector = false */
.no-affects-sector-row,
.no-affects-sector-row td,
#project-table tbody tr.row-no-sector td {
    background-color: #ffebee !important;
    color: #b71c1c;
}

/* Report Pages */
.report-title {
    text-align: center;
    margin-top: 20px;
}

/* ============================================================
   Compact tables for project views
   ============================================================ */
.project-details-view .display td {
    padding: 4px 8px !important;
    font-size: 13px;
}

.agreement-installment-paid {
    background-color: #198754 !important;
    color: #fff;
}

/* ── Sticky Nav Tabs (global) ──────────────────────────────────────── */
ul.nav.scrollable-tabs {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

ul.nav.scrollable-tabs::-webkit-scrollbar {
    display: none;
}

.project-tabs-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #aaa #f0f0f0;
}

.project-tabs-wrapper::-webkit-scrollbar {
    height: 4px;
}

.project-tabs-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.project-tabs-wrapper::-webkit-scrollbar-thumb {
    background-color: #aaa;
    border-radius: 4px;
}

.project-tabs-wrapper ul.nav.scrollable-tabs {
    position: static;
    z-index: auto;
    background-color: transparent;
    box-shadow: none;
    overflow-x: visible;
}

ul.nav.scrollable-tabs [data-bs-target] svg.tab-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

