/* More specific selectors to override Bootstrap */

/* Prevent Bootstrap from shifting the body/navbar when a modal opens.
   Bootstrap adds padding-right to compensate for the disappearing scrollbar,
   which causes fixed navbars and fullscreen modals to shift right. */
body.modal-open {
    padding-right: 0 !important;
    overflow: hidden;
}

/* Also cancel the inline padding-right Bootstrap injects on the navbar */
.navbar {
    padding-right: 0 !important;
}

/* Raise hovered card above siblings so its tooltip isn't clipped by adjacent cards */
.kpi-card:hover {
    z-index: 10;
}

/* Increase corner rounding on sparkline dcc.Tooltip bubbles */
.dcc-tooltip {
    border-radius: 8px !important;
}

.table tbody .highlight-row {
    background-color: #ffcdd2 !important;
    color: #d32f2f !important;
    border-left: 4px solid #f44336 !important;
}

.table tbody .highlight-row td {
    background-color: #ffcdd2 !important;
    color: #d32f2f !important;
}

/* Override hover effects */
.table-hover tbody .highlight-row:hover {
    background-color: #f8bbd9 !important;
    color: #d32f2f !important;
}

/* style to get the offcanvas to appear above everything else */
.offcanvas {
    z-index: 2000 !important;
}

/* style to get the offcanvas backdrop to appear above everything else, but below the offcanvas */
.offcanvas-backdrop {
    z-index: 1999 !important;
}

/* style for tool info popover to grow with SVG content */
.tool-info-popover.popover,
.tool-info-popover {
    max-width: none !important;
    width: auto !important;
}

.tool-info-popover .popover-body {
    max-width: none !important;
    width: auto !important;
    padding: 0.5rem !important;
}

/* style for popover to appear above the offcanvas for add a new action */
.action-text-popover.popover {
    z-index: 2001 !important;
    max-width: none !important;
    width: auto !important;
}

/* style for popover to appear above the offcanvas for add a new comment */
.comment-text-popover.popover {
    z-index: 2001 !important;
    max-width: none !important;
    width: auto !important;
}

.custom-dropdown-cell {
    border-radius: 16px !important;
    text-align: left !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: flex-start !important;
}

/* Custom dropdown arrow for dropdown cells in action tracker*/
.custom-dropdown-cell::after {
    content: "▼";
    position: absolute;
    right: 15px;
    color: #888;
    font-size: 10px;
    pointer-events: none;
    /* Important: lets clicks pass through to the grid */
    vertical-align: top;
}

/* hide the default ag-grid dropdown arrow when editing */

/* Fullscreen spinner with semi-transparent light grey background */
/* Target the Bootstrap fullscreen spinner backdrop */
.spinner-border-wrapper {
    background-color: rgba(240, 240, 240, 0.75) !important;
    backdrop-filter: blur(3px) !important;
    /* Ensure it appears above the manage kpi popover */
    z-index: 2000 !important;
}

/* Make spinner larger and more visible */
.global-kpi-loading-spinner {
    width: 4rem !important;
    height: 4rem !important;
    border-width: 0.4em !important;
}

/* Ensure smooth spinner rotation without interruption */
.spinner-border {
    animation: spinner-border 0.75s linear infinite !important;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.custom-dropdown-cell.ag-cell-inline-editing::after {
    display: none !important;
}

/* Row status colors - need to target cells within rows */
.status-comment .ag-cell {
    background-color: #f5f5f5 !important;
}

.status-todo .ag-cell {
    background-color: #fff3e0 !important;
}

.status-doing .ag-cell {
    background-color: #e3f2fd !important;
}

.status-done .ag-cell {
    background-color: #e8f5e9 !important;
}

.status-cancelled .ag-cell {
    background-color: #ffebee !important;
}

/* Custom Spinner class to prevent flickering on kpi cards */
/* Don't override the default spinner animation - let Bootstrap handle it */
.min-display-spinner {
    min-width: 2rem;
    min-height: 2rem;
}

/* Smooth fade for content inside spinner wrapper */
.spinner-border {
    transition: opacity 0.2s ease-in-out;
}

/* Add fade transition to kpi value elements to smooth the replacement */
[id*="kpi-value-single-value"],
[id*="kpi-sparkline"],
[id*="kpi-calculation-counts"],
[id*="kpi-target-value"] {
    transition: opacity 0.25s ease-in-out;
}

/* Landing page multi-select dropdown spacing */
/**#department-filter-dropdown .Select-control,
#kpi-origin-filter-dropdown .Select-control {
    height: 2.375rem;
    min-height: 2.375rem;
}

#department-filter-dropdown .Select-multi-value-wrapper,
#kpi-origin-filter-dropdown .Select-multi-value-wrapper {
    padding: 4px 8px !important;
    min-height: calc(2.375rem - 2px);
    box-sizing: border-box;
}

#department-filter-dropdown .Select-placeholder,
#kpi-origin-filter-dropdown .Select-placeholder {
    top: 0;
    bottom: 0;
    left: 8px;
    display: flex;
    align-items: center;
    line-height: 1.2;
}*/

.dropdown-sm .Select-control {
    height: 31px;
    min-height: 31px;
    font-size: 0.875rem;
}

.dropdown-sm .Select-placeholder,
.dropdown-sm .Select--single>.Select-control .Select-value {
    line-height: 29px;
}

.dropdown-sm .Select-input {
    height: 29px;
}

.dropdown-sm .Select--single .Select-value-label {
    font-size: 0.875rem;
    line-height: 29px;
}

.dropdown-sm .Select--multi .Select-multi-value-wrapper {
    min-height: 29px;
    padding: 0 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    box-sizing: border-box;
}

.dropdown-sm .Select--multi .Select-placeholder {
    margin: 0;
    line-height: 1.2;
}

.dropdown-sm .Select--multi .Select-value {
    margin: 1px 3px 1px 0;
    font-size: 0.72rem;
    line-height: 1.1;
    flex-shrink: 0;
}

.dropdown-sm .Select--multi .Select-value-label,
.dropdown-sm .Select--multi .Select-value-icon {
    padding-top: 0;
    padding-bottom: 0;
}

.kpi-filter-info {
    color: #000000;
    font-size: 0.65rem;
    text-align: left;
    flex: 1;
    padding-right: 0.35rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-width: 0;
}

.kpi-filter-info-viewport {
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.kpi-filter-info-track {
    display: inline-block;
    white-space: nowrap;
}

.kpi-filter-info-track.scrolling {
    padding-left: 100%;
    animation: kpi-filter-marquee 10s linear infinite;
}

@keyframes kpi-filter-marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/** Sidebar styles and control */
.main-wrapper {
    display: flex;
    min-height: 0;
}

.sidebar {
    transition: width 0.3s ease;
    flex-shrink: 0;
    background-color: #f0f0f0;
    border-right: 1px solid #dee2e6;
    align-self: stretch;
}

.sidebar .nav-link {
    font-size: 1.3rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-open {
    width: 250px;
}

.sidebar-closed {
    width: 50px;
}

.sidebar .nav-pills .nav-link.active {
    background-color: #e4e4e4 !important;
    color: #0d6efd !important;
    border-left: 4px solid #0d6efd;
    border-radius: 0;
    font-weight: bold;
}

.sidebar .nav-pills .nav-link:hover {
    background-color: #d6d8db !important;
    border-radius: 0;
}

.sidebar-closed .sidebar-link-text {
    display: none;
}

.content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#toggle-sidebar-button {
    background: none;
    border: none;
    width: 100%;
    padding: 0.5rem;
    cursor: pointer;
    /* icon stays right-aligned */
    /* text-align: right; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* dark grey (Bootstrap's $gray-700) */
    color: #495057;
    /* bigger icon */
    font-size: 1.5rem;
    /* prevent line breaking when sidebar is open/closing */
    white-space: nowrap;
    overflow: hidden;
}

#toggle-sidebar-button:hover {
    /* darker than sidebar's, when hovering to indicate interactivity */
    background-color: #d6d8db;
}

/* Add custom styling to action & comment tracker
    - add a pencil symbol to editable column headers */
.editable-column-header .ag-header-cell-label::after {
    content: " ✏️";
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

/* Center header label text for matrix/category-breakdown grid columns (AG Grid headers ignore cellStyle) */
.centered-header .ag-header-cell-label {
    justify-content: center;
}

/** Custom Styles for SQDEC page */
.sqdec-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    /*height: calc(100vh - 160px);*/

}

.sqdec-board-row {
    flex: 1;
    overflow: hidden;
    min-width: max-content;
    flex-wrap: nowrap;
    flex-shrink: 0;
    --bs-gutter-x: 0.2rem;
}

.sqdec-board-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid #dee2e6;
    min-width: 250px;
    flex-shrink: 0;
    position: relative;
    /* needed for z-index to apply */
}

/* Raise entire column above siblings when a card is hovered, so its tooltip isn't clipped */
.sqdec-board-column:has(.kpi-card:hover) {
    z-index: 10;
}

.sqdec-board-column:last-child {
    border-right: none;
}

/** SQDEC column header styles */
.sqdec-column-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    color: white;
}

.sqdec-header-safety_sustainability {
    background-color: #003366 !important;
}

.sqdec-header-quality {
    background-color: #2B4D8E !important;
}

.sqdec-header-delivery {
    background-color: #4A7EC2 !important;
}

.sqdec-header-engagement {
    background-color: #7CB3E0 !important;
}

.sqdec-header-cost {
    background-color: #A8C8E8 !important;
}

/* Column Scrolling is separated to each column, no full-page scroll */
.sqdec-column-body {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background-color: #fafafa;
}

.content-wrapper>.container {
    max-width: 1420px;
}

.content-wrapper:has(.sqdec-board) {
    min-height: 0;
    overflow: hidden;
}

.container:has(.sqdec-board) {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.container div:has(.sqdec-board) {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#app-layout:has(.sqdec-board) {
    height: 100vh;
    overflow: hidden;
}

/* custom tooltip styling for the last data update */
.kpi-update-tooltip .tooltip-inner {
    max-width: 400px !important;
    white-space: pre-line !important;
    text-align: left !important;
}