/* Import Bootstrap Icons */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css');

/* ── Sidebar collapse ─────────────────────────────────────────────────────── */
html, body {
    overflow-x: hidden;
}

#sidebar {
    width: 220px;
    min-width: 220px;
    transition: width 0.2s ease, min-width 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

/* Content area always fills remaining space */
#sidebar + div {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* Collapsed state */
#sidebar.sidebar-collapsed {
    width: 62px !important;
    min-width: 62px !important;
}

#sidebar.sidebar-collapsed .sidebar-label {
    display: none;
}

#sidebar.sidebar-collapsed .logoDiv {
    justify-content: center;
    padding: 0.5rem 0;
}

#sidebar.sidebar-collapsed .logoDiv .sidebar-logo-text {
    display: none;
}

#sidebar.sidebar-collapsed .logoDiv img {
    max-width: 38px;
}

/* Nav items */
#sidebar .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #344054;
    text-decoration: none;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
}

#sidebar .sidebar-nav-item .sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sidebar .sidebar-nav-item:hover,
#sidebar .sidebar-nav-item.active {
    background-color: #e8f0fd;
    color: #1663c5;
}

#sidebar .sidebar-nav-item i {
    font-size: 1rem;
    min-width: 18px;
    text-align: center;
}

#sidebar.sidebar-collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 0.55rem 0;
}

/* Toggle button */
.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #667085;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.sidebar-toggle-btn:hover {
    background-color: #f2f4f7;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8faff;
}

/* Global utilities */
.text-decoration-none {
  text-decoration: none !important;
}

/* Bootstrap badge extensions */
.badge {
  font-weight: 500;
}

.rounded-pill {
  border-radius: 50rem !important;
}

/* Table enhancements */
.table > :not(caption) > * > * {
  border-bottom-width: 1px;
}

.border-0 {
  border: 0 !important;
}

/* Card enhancements */
.card {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Form control enhancements */
.form-control-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

input[type="date"].form-control-sm,
input[type="time"].form-control-sm {
  height: 31px !important;
  line-height: 1.5;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.form-select-sm {
  height: 31px;
  padding: 0.25rem 2.25rem 0.25rem 0.5rem;
}

.form-check-input {
  width: 1.125em;
  height: 1.125em;
  margin-top: 0.125em;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Button enhancements - Standardized sizes across application */
.btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  font-weight: 500;
  line-height: 1.5;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  min-height: 32px;
}

.btn-lg {
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  min-height: 44px;
}

.btn-link {
  text-decoration: none;
  min-height: auto;
}

.btn-link:hover {
  text-decoration: none;
}

/* Ensure consistent button group sizing */
.btn-group .btn {
  min-height: inherit;
}

/* Dropdown button consistency */
.dropdown-toggle {
  min-height: 38px;
}

/* Dropdown enhancements */
.dropdown-menu {
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item.active {
  background-color: #e8f0fd;
  color: #1663c5;
  border-left: 3px solid #1663c5;
}

/* Gap utility classes (Bootstrap 5.1+) */
.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

/* Session Timeout Modal Styles */
#sessionTimeoutModal .modal-content {
  border: 2px solid #ffc107;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#sessionTimeoutModal .modal-header {
  border-bottom: 2px solid #e0a800;
}

#sessionTimeoutModal .alert-warning {
  background-color: #fff3cd;
  border-color: #ffc107;
  color: #664d03;
  font-size: 1.5rem;
  padding: 1.5rem;
  border-radius: 0.5rem;
}

#sessionTimeoutModal #sessionTimeoutCountdown {
  font-weight: 700;
  font-size: 2rem;
  color: #dc3545;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

#sessionTimeoutModal .modal-footer {
  border-top: none;
  padding-top: 0;
}

#sessionTimeoutModal .btn {
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 1rem;
}

#sessionTimeoutModal .btn-primary {
  background-color: #198754;
  border-color: #198754;
}

#sessionTimeoutModal .btn-primary:hover {
  background-color: #146c43;
  border-color: #146c43;
}
.section-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #6c757d; margin-bottom: 0.6rem; }

.font-size-75-rem {
    font-size: 0.75rem;
}

/* ── Dashboard utility classes ────────────────────────────────────────────── */

.font-size-80-rem {
    font-size: 0.8rem;
}

.font-size-95-rem {
    font-size: 0.95rem;
}

/* Carousel arrow buttons */
.carousel-arrow-btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 28px variant — filter carousel */
.carousel-arrow-btn-sm {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 24px variant — active pills carousel */
.carousel-arrow-btn-xs {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* KPI carousel scrolling container */
.kpi-carousel {
    flex: 1;
    display: flex;
    gap: 1rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 4px 0 8px;
    min-height: 120px;
    align-items: center;
}

/* KPI carousel container that stretches items (program/client/vendor dashboards) */
.kpi-carousel-stretch {
    align-items: stretch;
}

/* KPI card item — portfolio (3-up layout, no fixed min-width) */
.kpi-card-item {
    flex: 0 0 calc((100% - 2rem) / 3);
    min-width: calc((100% - 2rem) / 3);
}

/* KPI card item — program/client/vendor (3-up with 240px min) */
.kpi-card-item-prog {
    flex: 0 0 calc((100% - 2rem) / 3);
    min-width: 240px;
}

/* Active (selected) card in KPI overview */
.kpi-card-active .card {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Carousel content area (flex:1 + overflow hidden, used inside arrow wrappers) */
.carousel-content {
    flex: 1;
    overflow: hidden;
}

/* Outer wrapper for a carousel row: arrows + scrolling content */
.carousel-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Outer wrapper aligned to flex-end (filter carousel row) */
.carousel-row-end {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* Portfolio badge (pill badges on summary cards and badge links) */
.portfolio-badge {
    font-size: 0.72rem;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

/* Stat row label (text-muted span in kpiStat) */
.stat-label {
    font-size: 0.82rem;
}

/* Stat row value (fw-bold span in kpiStat for program/client/vendor) */
.stat-value {
    font-size: 0.85rem;
}

/* KPI detail — reduce card-body padding */
.kpi-detail-slide .card-body {
    padding: 0.75rem 0.9rem !important;
}

/* KPI detail table — sticky first column header (blue) */
.detail-col-header {
    min-width: 110px;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: #0d6efd;
    color: #fff;
    z-index: 1;
    padding: 5px 9px !important;
    font-size: 0.72rem;
}

/* KPI detail table — sticky first column label cells (blue) */
.detail-col-label {
    font-weight: 500;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: #0d6efd;
    color: #fff;
    z-index: 1;
    padding: 5px 9px !important;
    font-size: 0.72rem;
}

/* KPI detail table — period header cells */
.detail-col-period {
    min-width: 80px;
    text-align: right;
    white-space: nowrap;
    padding: 5px 9px !important;
    font-size: 0.72rem;
}

/* KPI detail table — data cells */
.detail-col-data {
    text-align: right;
    padding: 5px 9px !important;
    font-size: 0.72rem;
}

/* Breakdown chart container (initial static size; height overridden by JS) */
.breakdown-chart {
    width: 100%;
    height: 320px;
}

/* Trend / detail slide chart container */
.slide-chart {
    width: 100%;
    height: 320px;
}

/* Info-circle icon next to KPI name */
.info-icon {
    font-size: 0.8rem;
    cursor: default;
    flex-shrink: 0;
}

/* Summary card icon circle (36px; background set inline per card) */
.summary-icon-circle {
    width: 36px;
    height: 36px;
}

/* Icon inside summary card circle */
.summary-icon {
    font-size: 1rem;
}

/* Filter / breakdown label above selects */
.filter-label {
    font-size: 0.82rem;
    color: #6c757d;
    white-space: nowrap;
    margin-bottom: 0;
}

/* Individual field wrapper in filter carousel */
.filter-field-wrap {
    flex: 0 0 auto;
}

/* Field label inside filter carousel */
.filter-field-label {
    font-size: 0.76rem;
    color: #6c757d;
    display: block;
    margin-bottom: 3px;
}

/* Filter select sizing */
.filter-field-select {
    min-width: 140px;
    max-width: 190px;
}

/* Active filter pill badge */
.active-pill-badge {
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 4px 8px;
}

/* Clear icon inside active filter pill */
.active-pill-clear {
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 2px;
}

/* Clear All Filters button */
.clear-all-btn {
    font-size: 0.76rem;
    padding: 3px 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Icon inside clear all button */
.clear-all-btn-icon {
    font-size: 0.7rem;
}

/* Filter carousel inner scroll container */
.filter-carousel-inner {
    flex: 1;
    display: flex;
    gap: 0.75rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 2px 0;
    align-items: flex-end;
}

/* Active pills carousel inner scroll container */
.pills-carousel-inner {
    flex: 1;
    display: flex;
    gap: 0.4rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 2px 0;
    align-items: center;
}

/* Group-by select max-width */
.breakdown-pivot-select {
    max-width: 360px;
}

/* Back button cursor */
.cursor-pointer {
    cursor: pointer;
}

/* KPI card name (0.9rem) */
.font-size-90-rem {
    font-size: 0.9rem;
}

/* KPI Baseline badge (Met/Missed) */
.kpi-baseline-badge {
    font-size: 0.7rem;
}

/* Xs chevron icon inside pills carousel arrows */
.icon-xs {
    font-size: 0.72rem;
}

/* ── Additional font-size utilities ──────────────────────────────────────────── */

.font-size-78-rem {
    font-size: 0.78rem;
}

.font-size-82-rem {
    font-size: 0.82rem;
}

.font-size-85-rem {
    font-size: 0.85rem;
}

.font-size-88-rem {
    font-size: 0.88rem;
}

.font-size-110-rem {
    font-size: 1.1rem;
}

/* ── Table / data-view utilities ─────────────────────────────────────────────── */

/* Compact input/select padding inside KPI management table cells */
.cell-input {
    padding: 2px 6px !important;
}

/* Fixed-width KPI table columns */
.kpi-col-enabled {
    width: 70px;
}

.kpi-col-value {
    width: 105px;
}

.kpi-col-unit {
    width: 115px;
}

/* Program detail card with left accent border */
.card-accent-primary {
    border-left: 4px solid #1663c5 !important;
}

/* Sheets expansion row background */
.sheets-expansion-cell {
    background: #f8f9fa;
}

/* Inline data table (viewData.js) */
.data-view-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.78rem;
    font-family: inherit;
}

.data-view-thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f0f0f0;
}

.data-view-th {
    border: 1px solid #d0d0d0;
    padding: 2px 6px;
    white-space: nowrap;
    background: #f0f0f0;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-view-th-row-num {
    min-width: 48px;
    color: #888;
    font-weight: normal;
}

.data-view-th-field {
    min-width: 120px;
}

.data-view-td {
    border: 1px solid #d0d0d0;
    padding: 2px 6px;
    white-space: nowrap;
}

.data-view-td-row-num {
    color: #aaa;
    text-align: right;
}

.data-view-td-empty {
    color: #bbb;
}

/* Section label variant (uppercase micro-label used in programUploads.js) */
.section-label-sm {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

/* Dashboard KPI card chart heights */
.dashboard-chart-main {
    height: 260px;
}

.dashboard-chart-donut {
    height: 240px;
}

/* Baseline unit select width in KPI management */
.kpi-baseline-unit-select {
    width: 110px;
}