body {
    font-family: 'Roboto', sans-serif;
	font-size: 14px;
    margin: 0;
    padding-top: 60px; /* leave space for header */
	height: 100%;
    /* background-image: linear-gradient(to right bottom, rgb(187, 247, 208), rgb(34, 197, 94)); #f5f5f5;*/
	background-image: linear-gradient(to right bottom, hsl(141deg, 79%, 85%), hsl(142deg, 71%, 45%)); 
	background-repeat: no-repeat; 
	background-attachment: fixed;
	color: #333;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-container input[type="email"],
.login-container input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    box-sizing: border-box; /* ? this makes padding behave correctly */
    border: 
    border-radius: 4px;
}

/* Make the old wrapper a neutral, full-width container */
.chart-container {
	/* responsive max-width: grows on large screens, shrinks on small */
	max-width: clamp(1000px, 80%, 1400px); 
	width: 100%;
	margin: 0 auto; /* center within .page-content */

	background: #fff;
	padding: 24px;
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);

	/* allow expanded charts to render without clipping */
	overflow: visible;
}

/* Inside the white column, widths include padding (prevents 40px overhang) */
.chart-container,
.chart-container * {
	box-sizing: border-box;
}

/* Keep the Upload page card styling */
.upload-container {
	max-width: 1000px;
	margin: 0px auto;
	background: white;
	padding: 20px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


h1, h2, h3 {
    text-align: center;
    color: #333;
    margin: 10px 0;
}

p.row-label {
	font-size: 1.5em;
	font-weight: bold;
}

label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
}

button {
    padding: 10px 20px;
    margin: 5px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.cancel-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #888;
}
.cancel-button:hover {
    background-color: #d0d0d0;
}

a.button {
    padding: 10px 20px;
    margin: 5px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
	text-decoration: none;
}


button:hover {
    background-color: #0056b3;
}

#businessName { text-align: center; margin: 10px 0; font-size: 2em; font-weight: bold; }
#nav { margin: 10px; text-align: right; }

#message {
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

#classError {
    text-align: left;
	margin-left: 15px;
}

#classError.success,
#message.success {
    color: #28a745;
}

#classError.error,
#message.error {
    color: #dc3545;
}

#message.loading {
    color: blue;
}

#back-to-charts {
    background-color: #6c757d;
}

#back-to-charts:hover {
    background-color: #5a6268;
}

#logoutBtn {
    background-color: #dc3545;
}

#logoutBtn:hover {
    background-color: #c82333;
}

/* This is the styling for the date-range slider */
.slider-container {
	/* display: flex; */
    max-width: 600px;
    margin: 20px auto;
    padding: 15px 20px 25px 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.inner-slider-container {
	/* display: flex; */
	width: 100%;
	}

.slider-title {
	text-align: left;
	margin: 0px;
}


.inner-slider-container label {
	/* display: flex; */
	margin-right: 20px;
	margin-top: 20px;
	}
	
.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
}
#rangeSlider .noUi-connect {
  background: #007bff; /* hsl(142deg, 71%, 45%); */
}

#rangeSlider {
    margin: 20px auto;
    width: 90%;
    vertical-align: middle;
}

.inner-inner-slider-container {
	position: relative; 
	/* padding: 0px 20px;
	overflow: hidden; */
	width: 100%;
}

.slider-bar {
	width: 90%;
	box-sizing: border-box;
}

.slider-handle-labels {
	position: relative;
	height: 12px;
	transform: translateY(12px);
	margin-top: 6px;
}

.handle-label {
	position: absolute;
	bottom: 0;

	/* transform: translateX(-50%);
	max-width: calc(100% - 40px);*/
	font-size: 14px;
	color: #333;
	white-space: nowrap;
}


.noUi-value {
	color: #333;
}

/* Style pip ticks */
.noUi-pips-horizontal .noUi-marker {
	height: 6px;
	background: #333;
}
/* End of Date-Range Slider */

.hidden {
    display: none;
}

section {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0;
}

.tab-button {
    padding: 10px 20px;
    margin: 0 2px 0 0;
    background: #e0e0e0;
    border: 1px solid #ccc;
    border-bottom: 1px solid #333;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    text-align: left;
    min-width: 200px;
}

.tab-button:hover {
    background: #f0f0f0;
}

.tab-button.active {
    background: white;
    border: 1px solid #333;
    border-bottom: 1px solid white;
    position: relative;
    z-index: 1;
}

.tab-content {
    display: none;
    border: 1px solid #333;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
    margin-top: -1px;
}

.tab-content.active {
    display: block;
}

.tab-title {
    display: block;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
	color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-stats {
    display: block;
    font-size: 18px;
	color: #333;
    margin-top: 5px;
}

.negative {
    color: red;
}

.positive {
    color: green;
}

.fa-arrow-trend-up, .fa-arrow-trend-down {
    font-size: 18px;
    vertical-align: middle;
}

.trend.up {
  color: #28a745;
  font-weight: bold;
}
.trend.down {
  color: #dc3545;
  font-weight: bold;
}

.trend-icon {
}

.trend-good i { color: #28a745; }     /* green */
.trend-caution i { color: #f1c40f; }  /* yellow */
.trend-bad i { color: #dc3545; }      /* red */
.trend-none i { color: #aaa; }      /* gray */

.account-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.account-item span {
    flex: 1;
}

.account-item select {
    margin-left: 10px;
}

select.uncategorized {
    border: 2px solid #dc3545; /* Red for uncategorized */
}

select {
    border: 1px solid #ccc; /* Default */
    padding: 5px;
}

.metrics-table-container {
	max-width: 100%;
	width: 100%;
	margin: 32px 0px;
	padding: 20px;
	background: white;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.3);

	/* keep content contained; if a table is truly wider, this local scrollbar handles it */
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
}


.metrics-table-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.metrics-table-container table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
	table-layout: auto; /* use content to size columns naturally */
}


/* The chart areas themselves should respect page width and wrap */
.metrics-table-container .chart-area,
.metrics-table-container .chart-wrapper,
.metrics-table-container canvas {
	max-width: 100% !important;     /* no overshoot beyond content width */
	width: 100% !important;
	box-sizing: border-box;
	display: block;
	height: auto !important; /* override inline canvas sizes */
}

/* Optional: prevent text blow-ups in narrow numeric columns */
/*
.metrics-table-container th,
.metrics-table-container td {
	white-space: nowrap; /* typically preferable for numeric cells */
}
*/

.metrics-table {
    width: 100%;
    border-collapse: collapse;
	table-layout: auto;
    font-size: 16px;
}


.metrics-table col {
  width: max-content;
}

.metrics-table th {
	vertical-align: bottom;
}

.metrics-table th, .metrics-table td {
    padding: 12px 16px;
	white-space: nowrap;
    border-bottom: 1px solid #ccc;
    text-align: right;
}


.metrics-table th:first-child,
.metrics-table td:first-child {
    text-align: left;
    font-weight: bold;
}

#metricsTable th:nth-child(3) {
    text-align: center;
}

.metrics-table th {
    background-color: #f0f0f0; 
}

.metrics-table tr:last-child td {
    border-bottom: none;
}

.metrics-table td.positive {
    color: hsl(142deg, 71%, 25%)); /* #28a745; */
}

.metrics-table td.negative {
    color: #dc3545;
}

/* METRIC "SUB-ROWS" */
.sub-metric-row td {
  font-size: 0.85em;
  font-weight: 400;
  padding: 3px 10px;
  background: #f9f9f9;
  border-top: 1px solid #eee;
}

.metrics-table .sub-label {
  font-style: italic;
  color: #555;
  padding-left: 50px;
}

.sub-cell {
  text-align: right;
  white-space: nowrap;
}

/* END:  METRIC "SUB-ROWS" */

.metric-toggle {
    cursor: pointer;
    color: #007bff;
    font-size: 16px;
    padding-right: 8px;
}

.chart-container canvas {
    max-height: 250px;
}

.chart-wrapper {
  display: block;
  width: 100%;
  overflow: hidden;  /* Prevents charts from pushing column widths */
}

.chart-row {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    display: none;
}

.chart-row.open {
    height: auto;
    padding: 10px 0;
    display: table-row;
}

#strategicTable th {
	vertical-align: bottom;
}

#strategicTable th:not(:first-child) {
    text-align: right;
}

.metric-chart-container {
    padding: 10px 0;
}
.metric-tabs {
    display: flex;
    margin-bottom: 8px;
}
.metric-tabs button {
    margin-right: 5px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
}
.metric-tabs button.active {
    background: #007bff;
    color: white;
    border: none;
}

.metric-row.no-border td {
    border-bottom: none !important;
}

.metric-row:hover {
    background-color: #f9f9f9;
}

.metrics-table td.metrics-section-header {
  font-weight: normal;
  /* font-style: italic; */
  background-color: #f0f0f0;
  text-align: left;
  font-size: 15px;
  padding: 8px 44px;
  border-top: 2px solid #ccc;
}


.upload-container {
    margin-top: 0px;
    margin-bottom: 0px;
}

.upload-container form {
    margin-top: 20px;
}

.upload-container input[type="file"] {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    margin-bottom: 15px;
    /* border-radius: 4px; */
}


html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.main-footer {
    margin-top: auto;
}

.main-content {
    flex: 1 0 auto;
    padding: 0px 20px;
}

.form-div {
    display: table-cell;
    vertical-align: middle;
    height: 50px;
}

form .form-row {
    display: flex;
    /* align-items: center;  */
    margin-bottom: 15px;
}

form .form-row label:not(.switch) {
    flex: 0 0 220px;
	text-align: right;
	padding-right: 10px;
    /* margin: 0; */
    font-weight: bold;
}

form .form-row input[type="file"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
	width: 350px;
    /* margin-right: 20px; */
}

form .button-row {
    justify-content: flex-end;
}

.upload-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
	text-decoration: none;
}

.upload-button:hover {
    background-color: #1D4ED8;
}

/* Toggle switch container */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    margin-right: 10px;
}

/* Hide default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider track */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 34px;
}

/* The slider handle */
.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

/* Toggle on */
.switch input:checked + .slider {
    background-color: #007bff;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* Optional label style */
.toggle-label {
    margin-right: 10px;
    font-size: 14px;
    vertical-align: middle;
}

/* Scoped to the either-or-switch toggle */
.either-or-switch .switch input + .slider {
	background-color: #28a745; /* green when unchecked (Dollars) */
}

.either-or-switch .switch input:checked + .slider {
	background-color: #007bff; /* blue when checked (% of Revenue) */
}

.either-or-switch .toggle-label:nth-child(2) {
	color: #28a745;
}

.either-or-switch .toggle-label:last-child {
	color: #007bff;
}

.switch-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
}
.switch-container {
	display: inline-block;       /* shrink to fit contents */
    padding: 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.switch-container-no-border {
	display: inline-block;       /* shrink to fit contents */
    padding: 0px;
	margin-top: 20px;
    text-align: center;
    background: white;
}

.zoom-toggle {
	padding-left: 10px;
	display: inline-block;
}

.checkbox-group { 
	margin-top: 20px; 
	text-align: center;
}

/* Account categorization table */
.table-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.month-label { 
  font-size: 0.9em;
}

.share-label { 
	display: block;
	margin-top: 10px;
  font-size: 0.9em;
}

.account-table {
  /* width: 100%; prevents centering of the table */
  border-collapse: collapse;
  margin-top: 1rem;
}

.account-table th, .account-table td {
  border-bottom: 1px solid #ddd;
  padding: 4px;
  vertical-align: middle;
}

.account-table th {
  text-align: left;
  background-color: #f8f8f8;
}

.section-header {
  font-weight: bold;
  text-align: center;
  background-color: #f0f0f0;
  font-size: 16px;
  padding: 12px 8px;
}

.section-divider td {
  height: 2px;
  background-color: #ccc;
  margin-top: 5px;
}

.subheader-row th {
  background-color: #f9f9f9;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #ccc;
}

.account-table td {
  height: 32px; 
  vertical-align: middle;
}

.account-table select {
  height: 26px;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1.1;
  box-sizing: border-box;
}

.account-table td:nth-child(3) {
  text-align: center;
}
.account-table .switch.small {
  display: inline-block;
  margin: 0 auto;
}

.upload-container .button-row {
	display: flex;
	justify-content: center;
}

.upload-container .button-row button {
	margin: 20px 20px;
}

/* Headcount Table */
.headcount-table-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.headcount-table {
  width: 300px;
  border-collapse: collapse;
  font-size: 14px;
}

.headcount-table caption {
  background-color: #f9f9f9;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #ccc;
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 0.5rem;
}

.headcount-table th,
.headcount-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  font-size: 16px;
}

.headcount-table th {
  padding-right: 16px;
}

.headcount-table td:last-child,
.headcount-table th:last-child  {
  text-align: right;
}

.headcount-table input[type="number"] {
  width: 80px;
  height: 30px;
  text-align: right;
  font-size: 14px;
  padding: 2px 6px;
  box-sizing: border-box;
}

/* header & footer navigation formatting */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: hsl(142deg, 71%, 30%); 
    color: white;
    display: flex;
    flex-wrap: wrap; /* ? allow wrapping on small screens */
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .main-header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    .header-nav {
        margin-top: 10px;
    }
}

.header-left {
    font-weight: bold;
    font-size: 18px;
}


.main-footer {
    display: flex;
    justify-content: space-between;
	align-items: center; /* Vertically centers all children */
    padding: 15px 30px;
    background-color: hsl(141deg, 79%, 90%); /* #f0f0f0; */
    font-size: 14px;
    margin-top: 40px;
	z-index: 1000;
}

.footer-left {
}

/* Nav link as button */
.header-nav .nav-link {
  display: inline-block;
  padding: 8px 14px;
  margin-left: 10px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: background-color 0.2s, transform 0.2s;
}

.header-nav .nav-link.disabled {
	pointer-events: none;
	opacity: 0.5;
	cursor: default;
}

/* Hover effect */
.header-nav .nav-link:hover {
  background-color: hsl(142deg, 71%, 40%); /* Slightly lighter */
  transform: translateY(-1px);
}

/* Active or selected (optional) */
.header-nav .nav-link.active {
  background-color: hsl(142deg, 71%, 40%); 
  color: white;
}

.footer-nav .nav-link {
  display: inline-block;
  padding: 8px 14px;
  margin-left: 10px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.2s, transform 0.2s;
}

/* Hover effect */
.footer-nav .nav-link:hover {
  background-color: hsl(141deg, 79%, 80%); /* Slightly darker */
  transform: translateY(-1px);
}

/* Active or selected (optional) */
.footer-nav .nav-link.active {
  background-color: hsl(141deg, 79%, 800%); 
  color: white;
}

/* Upload status overlay styles */
.upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 30, 30, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.upload-box {
  background: white;
  padding: 30px 40px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  max-width: 300px;
}

.upload-message {
  font-size: 18px;
  margin-bottom: 20px;
}

.upload-ok-button {
  background-color: #2c3e50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.upload-ok-button:hover {
  background-color: #1abc9c;
}

.hidden {
  display: none;
}

/* Class Pie/Line Chart styling */
.chart-row-content {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.chart-half {
  /* min-width: 300px; */
}

/* Apply width directly to each chart role */
.chart-half.line-chart {
  flex: 0 0 76%;
}

.chart-half.pie-chart {
  flex: 0 0 20%;
}

.no-data-message {
	text-align: center;
    font-style: italic;
    padding: 20px;
}

/* Custom Chart styling */
#custom-chart-section {
	margin-top: 40px;
	padding: 20px;
	border-top: 1px solid #ccc;
}

.chart-controls {
	margin-bottom: 10px;
}

.chartjs-legend ul {
	flex-wrap: wrap;
}

.chartjs-legend li {
	margin-right: 12px;
	margin-bottom: 6px;
}

/* Small multiples grid for class comparison charts */
.small-multiples-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	align-items: stretch;
}

.small-multiple-chart {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	/* This is the actual vertical room each mini-chart gets */
	height: 160px;
}

.small-multiple-title {
	display: block;          /* make sure it's a block, not flexed weirdly */
	flex: 0 0 auto;          /* don't let flexbox shrink it to 0 height */
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	margin-bottom: 4px;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Let Chart.js control the drawing height; don't stretch the bitmap */
.small-multiple-chart canvas {
	flex: 1;
	width: 100% !important;
}

/* END:  Small multiples grid for class comparison charts */


#selected-items {
	margin-bottom: 15px;
}

.selected-item {
	display: inline-block;
	background: #f1f1f1;
	border: 1px solid #ccc;
	padding: 6px 10px;
	border-radius: 4px;
	margin: 3px;
	font-size: 14px;
	cursor: default;
}

.selected-item button {
	margin-left: 6px;
	border: none;
	background: none;
	color: #900;
	cursor: pointer;
	font-weight: bold;
	padding:0px 0px 0px 10px;
	
}

.choices__inner {
	min-height: 12px;
}


.choices {
	display: flex !important;
	justify-content: space-between;
	/* width: auto !important; */
	/*min-width: 200px;  optional base width */
	/* max-width: 100%;  prevent overflow */
	margin-right: 30px;
	margin-bottom: 10px;
}

#custom-chart-tabs .tab-button {
	position: relative;
	z-index: 0;
}

#custom-chart-tabs .tab-button.active {
	z-index: 1;
}

.choices__list--dropdown, .choices__list[aria-expanded] {
	z-index: 2;
	word-break: break-word;
	width: max-content;
}

.custom-chart-canvas {
	width: 100% !important;
	height: 300px; /* default */
}

/* preferences.html styles */
#prefsPanel {
	background: white;
	padding: 40px;
	max-width: 600px;
	margin: 0 auto;
	border-radius: 6px;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

#prefsPanel h1 {
	text-align: center;
	margin-bottom: 20px;
}

.prefs-row {
	display: flex;
	align-items: center;
	/* justify-content: space-between; */
	gap: 20px;
	margin-bottom: 14px;
}

.prefs-row label {
	font-weight: 500;
	/* flex: 1; */
	margin: 0;
}

.prefs-toggle {
	width: 42px;
	height: 24px;
	appearance: none;
	background: #ccc;
	border-radius: 12px;
	position: relative;
	cursor: pointer;
	outline: none;
	transition: background 0.2s ease;
}

.prefs-toggle:checked {
	background: #4caf50;
}

.prefs-toggle::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	background: white;
	border-radius: 50%;
	top: 3px;
	left: 3px;
	transition: transform 0.2s ease;
}

.prefs-toggle:checked::before {
	transform: translateX(18px);
}

.prefs-input {
	width: 80px;
	padding: 4px 6px;
	font-size: 14px;
}
.prefs-actions {
	text-align: center;
	margin-top: 24px;
}

.prefs-either-or-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
}

.prefs-either-or-row .either-or-label {
	font-weight: 500;
	white-space: nowrap;
}

.prefs-either-or-row label,
.prefs-either-or-row .either-or-label {
	display: inline-flex;
	align-items: center;
	margin: 0;
	line-height: 1.2;
}


.prefs-switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 24px;
}

.prefs-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.prefs-switch .slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #4CAF50; /* Green default */
	transition: background-color 0.2s;
	border-radius: 24px;
}

.prefs-switch .slider::before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	border-radius: 50%;
	transition: transform 0.2s;
}

.prefs-switch input:checked + .slider {
	background-color: #2196F3; /* Blue when checked */
}

.prefs-switch input:checked + .slider::before {
	transform: translateX(24px);
}

/* Alert section styling */
.alert-section ul {
	padding-left: 20px;
	margin-top: 0;
}

.alert-section h3 {
	margin-bottom: 6px;
	text-align: left;
	color: #444;
	text-decoration: underline dotted 1.5px;
	width: 100%;
}

#alert-summary {
	margin-bottom: 30px;
}

.alert-list {
	list-style: none;
	padding-left: 0;
	margin-top: 0;
	column-count: 2;               /* ?? Enables 2 columns */
	column-gap: 32px;              /* Adjust spacing between columns */
}

.alert-list li {
	/* margin-bottom: 6px; */
	break-inside: avoid;
	margin-bottom: 8px;
	display: flex;
	align-items: center;  
	line-height: 1.4;
}

.alert-icon {
	min-width: 16px;
	font-size: 1rem;
	margin-right: 8px;
	line-height: 1.4;
}
/* END Alert section styling */

/* Benchmark styling in tables */
.benchmark-diff {
	font-size: 1em;
	display: inline;
}
.benchmark-pct-diff {
	font-size: 0.8em;
	display: inline;
	color: #999;
}
.benchmark-diff.positive, 
.benchmark-pct-diff.positive {
	color: green;
}
.benchmark-diff.negative, 
.benchmark-pct-diff.negative {
	color: red;
}

#benchmarkModal .upload-overlay {
  justify-content: left;
  align-items: left;
}

#benchmarkModal .upload-box {
  text-align: left;
  max-width: 500px;
}
/* END Benchmark styling in tables */

/* Button warning color change */
.red-warning {
	background-color: #dc3545 !important;
	color: white;
}
/* Button warning color change */


/* Tool-tip styling */
/* === Tooltips === */
.mvb-tip-icon {
	--mvb-tip-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--mvb-tip-size);
	height: var(--mvb-tip-size);
	margin-left: 6px;
	cursor: pointer;
	color: #aaa; /* gray < 500 */
	vertical-align: middle;
}
.mvb-tip-icon:hover { color: #111827; } /* gray-900 */

.mvb-tip-pop {
	position: absolute;
	z-index: 10000;
	max-width: min(420px, calc(100vw - 24px));
	background: #111827; /* near-black for contrast */
	color: #f9fafb;      /* gray-50 */
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0,0,0,.25);
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.35;
	transform: translate(-50%, 8px);
	opacity: 0;
	pointer-events: none;
	transition: opacity .12s ease, transform .12s ease;
}
.mvb-tip-pop[data-open="true"] {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}
.mvb-tip-pop .mvb-tip-simple { font-weight: 600; }
.mvb-tip-pop .mvb-tip-sep {
	margin: 8px 0;
	border: 0;
	border-top: 1px solid rgba(255,255,255,.4);
	display: none; /* only shown when expanded */
}
.mvb-tip-pop .mvb-tip-detail { display: none; }

.mvb-tip-pop[data-expanded="true"] .mvb-tip-sep { display: block; }
.mvb-tip-pop[data-expanded="true"] .mvb-tip-detail { display: block; }

/*
.mvb-tip-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: transparent;
	border: 0;
	font-weight: bold;
	color: #aaaaaa; 
	cursor: pointer;
	font-size: 16px;
}
.mvb-tip-close:hover { color: #e5e7eb; }
*/

.mvb-tip-anchor {
	position: relative; /* to anchor the popover */
	display: inline-flex;
	align-items: center;
}

/* optional: tooltip arrow */
.mvb-tip-pop::after {
	content: "";
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-bottom: 6px solid #111827;
}

/* Fallback "?" icon if Font Awesome is missing */
.mvb-tip-icon[data-fallback="true"] {
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	font-size: 12px;
	font-weight: 700;
	background: #e5e7eb; /* gray-200 */
	border-radius: 999px;
	color: #374151; /* gray-700 */
}

.mvb-tip-pop a {
	color: #34d399; /* emerald-400 */
	text-decoration: underline;
}
.mvb-tip-pop a:hover {
	color: #6ee7b7; /* emerald-300 */
	text-decoration: none;
}

/* Close button overlaps the corner; hidden until expanded */
.mvb-tip-pop .mvb-tip-close {
	position: absolute;
	top: 0;
	right: 0;
	transform: translate(30%, -30%);
	display: none;              /* only show when expanded */
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 4px;               /* a few pixels padding */
	border-radius: 9999px;
	background: #111827;        /* match .mvb-tip-pop background */
	color: #f9fafb;             /* match .mvb-tip-pop foreground */
	border: 1px solid rgba(255,255,255,0.12);
	box-shadow: 0 2px 6px rgba(0,0,0,.35);
	cursor: pointer;
}

.mvb-tip-pop[data-expanded="true"] .mvb-tip-close {
	display: flex;              /* show only in expanded stage */
}

/* Icon sizing; no hover color change needed */
.mvb-tip-pop .mvb-tip-close i {
	font-size: 16px;
	line-height: 1;
}

/* Optional: keep a visible keyboard focus */
.mvb-tip-pop .mvb-tip-close:focus {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

/* Remove/override any previous hover styles for the close button 
.mvb-tip-pop .mvb-tip-close:hover { color: ffffff; }
*/
/* END Tool-tip styling */

/* MODAL sytling */
/* Central modal defaults */
.bv-modal-overlay {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.35);
	z-index: 1000;
}
.bv-modal-overlay.hidden { display: none; }
.bv-modal-box {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(0,0,0,0.25);
	min-width: 320px;
	max-width: 520px;
	padding: 20px 20px 16px;
}
.bv-modal-box[data-type="progress"] .bv-modal-actions { display: none; }
.bv-modal-title {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 600;
}
.bv-modal-body {
	font-size: 15px;
	line-height: 1.45;
	margin-bottom: 16px;
}
.bv-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}
.bv-btn {
	border: 0;
	border-radius: 8px;
	padding: 8px 14px;
	cursor: pointer;
}
.bv-btn.primary { background: #007bff; color: #fff; }
.bv-btn.secondary { background: #e5e7eb; color: #111; }
.bv-btn.danger { background: #dc3545; color: #fff; }

/* === Modal form layout === */
.bv-form { display: flex; flex-direction: column; gap: 12px; }
.bv-field { display: flex; flex-direction: column; gap: 6px; }
.bv-field > label { font-size: 13px; font-weight: 500; }
.bv-input-group { display: flex; align-items: center; gap: 6px; }
.bv-input-group input, .bv-input-group select {
	flex: 1 1 auto;
	padding: 8px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
}
.bv-affix {
	padding: 6px 8px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #f3f4f6;
	font-size: 13px;
}
.bv-error { color: #b91c1c; font-size: 13px; }
.bv-help { font-size: 12px; color: #6b7280; }
/* END MODAL styling */


/* --- Sidebar layout & scrollspy --- */
/* --- Reset nested-scroll so body owns vertical scrolling --- */

/* Body should own the vertical scroll */
html, body {
	height: auto;
	min-height: 100%;
	overflow-y: auto;
}

/* Make sure the flex wrapper can grow with content */
.page {
	min-height: 100%;
	overflow: visible;
}

/* Kill any accidental inner scroll constraints on the main area */
main.page-content,
.page-content ,
#chart  {
	overflow: visible !important;
	height: auto !important;
	max-height: none !important;
}

/* Table wrapper can still handle its own horizontal overflow only 
.metrics-table-container {
	overflow-x: auto;
	overflow-y: visible;
}
*/
/* Keep the sidebar independently scrollable (intended behavior) */
.sidebar {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}


.page {
	display: flex;
}

/* Prevent any page-level horizontal scroll */
html, body, .page {
	overflow-x: hidden;
}

:root {
	--header-height: 60px;
	--sidebar-gap: 16px;
	/* Sidebar flexes with viewport, capped; shrinks earlier to prevent page overflow */
	--sidebar-width: clamp(200px, 24vw, 300px);
}

/* Fixed left sidebar under the fixed header */
.sidebar {
	position: fixed;
	top: var(--header-height);
	left: 0;
	bottom: 0;
	width: var(--sidebar-width);
	min-width: var(--sidebar-width); 
	overflow: auto;
	background: rgba(255,255,255,0.96);
	box-shadow: 2px 0 6px rgba(0,0,0,0.2);
	padding: 16px 12px;
	box-sizing: border-box;
	z-index: 900;
}

/* Main content shifts over by the live sidebar width, then centers itself */
.page-content {
	/* use padding-left so the content stays centered in the remaining space */
	padding-left: calc(var(--sidebar-width) + var(--sidebar-gap));
	padding-right: 16px;
	box-sizing: border-box;

	/* center the white column within the available area */
	/* max-width: 1200px; adjust if you prefer wider/narrower */
	width: 100%;
	min-width: 0;        /* critical for preventing overflow in flex layouts */
	margin-left: auto;
	margin-right: auto;
}


/* Sidebar section nav */
.sidebar .nav-title {
	margin: 4px 8px 10px;
	font-weight: 600;
	color: #2b2b2b;
}

.sidebar .section-nav {
	list-style: none;
	margin: 0;
	padding: 0 6px 12px;
}

.sidebar .section-nav li {
	margin: 4px 0;
}

.sidebar .section-link {
	display: block;
	padding: 8px 10px;
	border-radius: 6px;
	text-decoration: none;
	color: #333;
	transition: background 0.15s, transform 0.05s;
	/* allow wrapping + 10px hanging indent on wrapped lines */
	white-space: normal;           /* allow wrap */
	overflow: visible;
	text-overflow: clip;
	padding-left: 20px;            /* base left padding */
	text-indent: -10px;            /* first line pulls left 10px, wrapped lines hang by 10px */
	line-height: 1.25;
}

/* Active state unchanged */
.sidebar .section-link.active {
	background: hsl(141deg, 79%, 90%);
	font-weight: 600;
}

.sidebar .section-link:hover {
	background: #f2f6f3;
}

/* Responsive: hide sidebar on small screens */
/* Shrink rail earlier so the main content never gets clipped */
@media (max-width: 1400px) {
	:root { --sidebar-width: clamp(180px, 22vw, 280px); }
}
@media (max-width: 1200px) {
	:root { --sidebar-width: clamp(160px, 20vw, 240px); }
}
@media (max-width: 1050px) {
	:root { --sidebar-width: clamp(140px, 18vw, 200px); }
}

/* Hide rail on small screens; remove its reserved space */
@media (max-width: 900px) {
	.sidebar { display: none; }
	:root { --sidebar-width: 0px; }
	.page-content { padding-left: 16px; }
}

/* Ensure your centered cards still look centered inside content area */
.page-content .chart-container,
.page-content /* .metrics-table-container */ {
	margin-left: auto;
	margin-right: auto;
}
/* --- END:  Sidebar layout & scrollspy --- */

/* --- Typography: enforce 16px inside metrics tables --- */
.metrics-table {
	font-size: 16px;
}

.metrics-table th,
.metrics-table td {
	font-size: inherit; /* take 16px from .metrics-table */
}

/* keep intended smaller sizes intact where you explicitly reduced them */
.sub-metric-row td { /* already present earlier as 0.85em; repeat here for clarity */
	font-size: 0.85em;
}


/* Segmented "button radio" control */
.segmented-control {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}

.segmented-button {
	padding: 8px 16px;
	border-radius: 5px;
	border: 1px solid #ccc;
	background: #f5f5f5;
	cursor: pointer;
	font-size: 14px;
	min-width: 80px;
	text-align: center;
	color: #999;
}

.segmented-button.active {
	background-color: #007bff;
	color: #fff;
	border-color: #0056b3;
}

.segmented-button:not(.active):hover {
	background-color: #e0e0e0;
	color: #fff;
}

.segmented-pretext {
	padding: 15px 10px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	min-width: 80px;
	text-align: left;
	display: inline-block;
    /* vertical-align: middle; */
}
/* END:  Segmented "button radio" control */


/* P&L Sankey diagram */
#pl-sankey-section,
#cash-sankey-section {
	margin-top: 24px;
}

#pl-sankey,
#cash-sankey,
#class-single-sankey,
#class-comparison-sankey {
	width: 100%;
	min-height: 420px;
}

#pl-sankey svg,
#cash-sankey svg,
#class-single-sankey svg,
#class-comparison-sankey svg {
	display: block;
	width: 100%;
	height: 420px;
}

.sankey-subtitle {
	font-size: 14px;
	color: #555;
	margin-bottom: 12px;
}

.pl-sankey-tooltip {
	position: absolute;
	pointer-events: none;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	padding: 6px 8px;
	border-radius: 4px;
	font-size: 12px;
	opacity: 0;
	transition: opacity 0.15s ease-out;
	z-index: 1000;
}

.sankey-empty-message {
	font-size: 14px;
	color: #666;
	margin-top: 8px;
}

.sankey-node-label {
	font-size: 14px;
	font-family: Arial, sans-serif;
	font-weight: 600; /* bold-ish */
	fill: #003366; /* dark blue-green */
}

/* END:  P&L Sankey diagram */