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, 90%, 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-title {
	text-align: left;
	margin: 0px;
}

.slider-container {
    max-width: 720px;                  /* slightly wider than 600px to feel less cramped */
    margin: 24px auto;
    padding: 16px 24px 28px 24px;      /* more consistent padding */
    text-align: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 1px;                         /* more breathing room between slider and button */
    width: 100%;
}

.slider-main-area {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    padding: 0 28px;                   /* ? KEY: left/right padding so pips/labels stay inside */
    box-sizing: border-box;
}

#rangeSlider {
    width: 100% !important;
    height: 18px;
    margin: 5px 0 12px 0;             /* reduced bottom margin to tighten layout */
}

/* Constrain pips (ticks) and prevent overflow */
.noUi-pips-horizontal {
    padding: 10px 28px;                   /* match .slider-main-area padding */
    box-sizing: border-box;
	height: 20px;
}

.noUi-pips-horizontal .noUi-marker {
    height: 6px;
    background: #666;
}

.noUi-value {
    color: #444;
    font-size: 11px;
    margin-top: 4px;
    white-space: nowrap;
}

/* Custom handle labels (your dynamic ones) */
.slider-handle-labels {
    position: relative;
    height: 12px;
	margin-top: 10px;
    margin-bottom: 4px;
}

.handle-label {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    pointer-events: none;              /* prevent clicking through to slider */
}

/* Reset button tweaks */
.reset-slider-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.18s ease;
    margin-top: 16px;                   /* ? lowered more to center with handle */
	border-radius: 5px;
	border: 1px solid #ccc;
	background: #f5f5f5;
`
}

.reset-slider-btn:hover {
    background: #aaa;
    color: white;
    border-color: #5a6268;
}

.reset-slider-btn:active {
    transform: scale(0.94);
}

/* Prevent right handle from crowding the button */
.noUi-horizontal .noUi-handle:nth-child(2) {
    margin-right: -8px;                /* tiny pull-back on right handle */
}

/* Optional: if pips still feel too wide, add this */
.noUi-pips-horizontal .noUi-value {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.noUi-connect {
	background-color: #28a745;
}

.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;
}

.header-center {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 0;
	padding: 0 20px;
}

.client-header-controls {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
}

.client-switcher-host,
.demo-mode-host {
	display: flex;
	align-items: center;
	font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.client-switcher {
	position: relative;
}

.client-switcher-trigger {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: 420px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	font-size: 15px;
    font-weight: 600;
    line-height: 1;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.client-switcher-trigger:hover {
	background: rgba(255, 255, 255, 0.18);
}

.client-switcher-name {
	display: block;
	max-width: 340px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.client-switcher-caret {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8rem;
	opacity: 0.9;
}

.client-switcher.open .client-switcher-caret {
	transform: rotate(180deg);
}

.client-switcher-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 280px;
	max-width: 420px;
	max-height: 320px;
	overflow-y: auto;
	padding: 8px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
	z-index: 2000;
}

.client-switcher-item {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: none;
	background: transparent;
	border-radius: 10px;
	text-align: left;
	cursor: pointer;
	font-size: 15px;
    font-weight: 600;
    line-height: 1;
	color: #1d3557;
}

.client-switcher-item:hover {
	background: rgba(29, 53, 87, 0.08);
}

.client-switcher-item.active {
	background: rgba(29, 53, 87, 0.14);
	font-weight: 700;
}

.demo-mode-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	font-size: 18px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.demo-mode-button:hover {
	background: rgba(255, 255, 255, 0.18);
}

.demo-mode-button.active {
	background: #fff;
	color: #1d3557;
	border-color: #fff;
}

@media (max-width: 980px) {
	.header-center {
		padding: 0 10px;
	}

	.client-switcher-trigger {
		max-width: 260px;
	}

	.client-switcher-name {
		max-width: 180px;
	}
}

/* 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 {
	padding: 40px;
	/*
	background: white;
	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;
}

.sidebar-controls-host {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.sidebar-control-summary-row {
	width: 100%;
	border: 1px solid rgba(0,0,0,0.08);
	border-radius: 8px;
	background: rgba(255,255,255,0.40);
	color: inherit;
	text-align: left;
	padding: 8px 8px 8px 10px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
	transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.sidebar-control-summary-row:hover {
	background: rgba(255,255,255,0.68);
	border-color: rgba(0,0,0,0.12);
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar-control-summary-row.active {
	background: rgba(255,255,255,0.82);
	border-color: rgba(0,123,255,0.28);
	box-shadow: 0 0 0 2px rgba(0,123,255,0.08);
}

.sidebar-control-summary-row:active {
	transform: translateY(1px);
}

.sidebar-control-summary-label {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.72;
	white-space: nowrap;
}

.sidebar-control-summary-value {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;

	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	color: #007bff;

	white-space: nowrap;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(0,123,255,0.08);
}

.sidebar-control-summary-arrow {
	flex: 0 0 auto;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	color: #555;
	opacity: 0.75;
	transition: transform 0.16s ease, opacity 0.16s ease;
}

.sidebar-control-summary-row:hover .sidebar-control-summary-arrow,
.sidebar-control-summary-row.active .sidebar-control-summary-arrow {
	opacity: 1;
	transform: translateX(1px);
}

.sidebar-control-summary-row .sidebar-control-summary-label {
	max-width: 48%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sidebar-control-summary-row .sidebar-control-summary-value {
	text-align: left;
}


.sidebar-control-summary-row.active .sidebar-control-summary-value {
	background: rgba(0,123,255,0.14);
	color: #005fcc;
	font-weight: 600;
}

.sidebar-control-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.18);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 1200;
}

.sidebar-control-overlay.open {
	opacity: 1;
	pointer-events: auto;
}

.sidebar-control-flyout {
	position: fixed;
	opacity: 0;
	transform: translateX(-18px);
	pointer-events: none;
	transition: transform 0.22s ease, opacity 0.22s ease;
	z-index: 1201;
	background: #fff;
	color: #222;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.22);
	border: 1px solid rgba(0,0,0,0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.sidebar-control-flyout.open {
	opacity: 1;
	transform: translateX(0);
	pointer-events: auto;
}

.sidebar-control-flyout-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0px 16px;
	border-bottom: 1px solid rgba(0,0,0,0.08);
	background: #f8f9fb;
}

.sidebar-control-flyout-title {
	font-size: 16px;
	font-weight: 600;
}

.sidebar-control-flyout-close {
	border: 0;
	background: transparent;
	font-size: 18px;
	cursor: pointer;
	color: #555;
	padding: 4px 6px;
	border-radius: 8px;
}

.sidebar-control-flyout-close:hover {
	background: rgba(0,0,0,0.06);
}

.sidebar-control-flyout-body {
	padding: 16px 16px 18px;
	overflow-y: auto;
	overflow-x: hidden;
	flex: 1 1 auto;
	min-height: 0;
}

.sidebar-flyout-control-group .slider-title {
	margin-top: 0;
	margin-bottom: 12px;
}

.sidebar-flyout-control-group .slider-row {
	display: flex;
	/* align-items: flex-start; */
	gap: 12px;
	align-items: stretch;
}

.sidebar-flyout-control-group .slider-main-area {
	flex: 1 1 auto;
	min-width: 0;
}

.sidebar-flyout-control-group .slider-bar {
	margin-top: 6px;
}

.sidebar-flyout-control-group .range-slider-wrap,
.sidebar-flyout-control-group #rangeSlider {
	width: 100%;
}

.sidebar-control-flyout[data-panel-key="date-range"] .sidebar-control-flyout-body {
/*	padding-bottom: 24px; */
}

.sidebar-control-flyout[data-panel-key="date-range"] .sidebar-flyout-control-group {
/*	min-height: 220px; */
}

.sidebar-control-flyout[data-panel-key="date-range"] .slider-row {
	align-items: stretch;
}

.sidebar-flyout-control-group .switch-wrapper {
	margin-top: 0 !important;
}

.sidebar-flyout-control-group .segmented-control {
	margin-top: 0 !important;
}

.sidebar-flyout-control-group .segmented-button {
	white-space: nowrap;
}

.sidebar-control-flyout-title-text {
	display: inline-block;
}

.sidebar-control-summary-row-pills {
	align-items: center;
}

.sidebar-control-summary-row-pills .sidebar-control-summary-value {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	align-items: center;
	white-space: normal;
	padding: 0;
	background: transparent;
	flex: 1 1 auto;
	min-width: 0;
}

.sidebar-value-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(0,123,255,0.08);
	color: #007bff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

.sidebar-value-pill-muted {
	background: rgba(0,0,0,0.06);
	color: #666;
}

.sidebar-control-summary-row-pills .sidebar-control-summary-arrow {
	margin-top: 1px;
}

@media (max-width: 1200px) {
	.sidebar-control-flyout {
		left: 16px !important;
		right: 16px;
		width: auto !important;
		max-width: none;
	}
}

/* --- 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 */

/* Cash Waterfall Chart */
#cash-waterfall-section {
	margin-top: 24px;
}

#cashWaterfallCanvas,
#cashWaterfallChart {
	width: 100%;
	min-height: 400px;
}

#cash-waterfall-subtitle {
	font-size: 14px;
	color: #555;
	margin-bottom: 12px;
	text-align: center;
}

#cash-waterfall-message {
	font-size: 14px;
	color: #666;
	margin-top: 8px;
}
/* END:  Cash Waterfall Chart */ 

/* Comparison pill (triangle + %/pp diff) */
.comp-pill{
	display:inline-flex;
	align-items:center;
	gap:4px;
	padding:1px 8px;
	border-radius:999px;
	border:1px solid;
	font-size:0.72em;
	font-weight:600;
	white-space:nowrap;
	vertical-align:middle;
	margin-left:6px;
	line-height:1.35;
}

.comp-pill i{
	font-size:0.95em;
	line-height:1;
}

.comp-pill.good{
	background:#dff5e6;
	border-color:#67c48c;
	color:#1f7a43;
}

.comp-pill.bad{
	background:#fde3e3;
	border-color:#e07171;
	color:#b42323;
}

.comp-pill.neutral{
	background:#f2f2f2;
	border-color:#c9c9c9;
	color:#666;
}

/* Allow tooltip triggers that are pills/badges to keep their natural size */
.mvb-tip-icon.comp-pill{
	width: auto;
	height: auto;
	justify-content: flex-start;
	padding: 1px 8px;     /* keep pill padding */
	margin-left: 6px;     /* ensure spacing from prior element */
}

/* END:  Comparison pill (triangle + %/pp diff) */


/* Agency page styles */
.agency-page {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 20px 48px;
}

.card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
	padding: 22px;
	margin-bottom: 22px;
}

.agency-hero {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	gap: 20px;
	flex-wrap: wrap;
}

.agency-hero-main h1 {
	margin: 6px 0 8px;
	font-size: 2rem;
	line-height: 1.15;
}

.agency-org-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.eyebrow {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6c7a89;
}

.muted {
	color: #6c7a89;
}

.agency-hero-stats {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.agency-stat {
	min-width: 130px;
	padding: 14px 16px;
	border-radius: 14px;
	background: #f5f7fb;
}

.agency-stat-label {
	font-size: 0.78rem;
	color: #6c7a89;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.agency-stat-value {
	font-size: 1.6rem;
	font-weight: 700;
	color: #1d3557;
}

.agency-table-card .section-header {
	margin-bottom: 16px;
}

.table-wrap {
	overflow-x: auto;
}

.agency-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.agency-table th,
.agency-table td {
	padding: 12px 10px;
	border-bottom: 1px solid #e7ecf2;
	text-align: left;
	vertical-align: middle;
}

.agency-table th {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6c7a89;
}

.status-pill-cell {
	white-space: normal;
	vertical-align: top;
}

.status-pill-stack {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 4px;
	line-height: 1;
}

.status-pill {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	margin: 0;
	white-space: nowrap;
}

.status-pill.warn {
	background: rgba(241, 196, 15, 0.14);
	color: #b7791f;
}
.status-pill.good {
	background: rgba(39, 174, 96, 0.12);
	color: #1d7d46;
}

.status-pill.neutral {
	background: rgba(108, 122, 137, 0.14);
	color: #52606d;
}
/*
.status-pill.warn {
	background: rgba(241, 196, 15, 0.14);
	color: #f1c40f;
}
*/
.agency-actions-cell {
	display: flex;
	gap: 5px;
	flex-wrap: nowrap;
	align-items: center;
}

.agency-action-btn {
	padding: 8px 12px;
	border: 1px solid #d5dce5;
	border-radius: 5px;
	background: #fff;
	color: #1d3557;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	margin: 2px;
}

.agency-action-btn:hover {
	background: #d0d0d0;
	color: #1d3557;
}

.agency-action-btn.primary {
	background: #1d3557;
	border-color: #1d3557;
	color: #fff;
}

.agency-action-btn i {
	font-size: 18px;
}

.agency-action-btn.primary:hover {
	background: #3d5577;
	border-color: #1d3557;
	color: #fff;
}

.agency-message {
	padding: 12px 14px;
	border-radius: 12px;
	margin-bottom: 14px;
	font-size: 14px;
}

.agency-message.success {
	background: rgba(39, 174, 96, 0.12);
	color: #1d7d46;
}

.agency-message.error {
	background: rgba(192, 57, 43, 0.12);
	color: #a12417;
}

.agency-message.info {
	background: rgba(29, 53, 87, 0.08);
	color: #1d3557;
}

.agency-assign-preview {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	background: #f5f7fb;
	color: #1d3557;
	font-size: 14px;
	line-height: 1.5;
}

.agency-assign-preview.error {
	background: rgba(192, 57, 43, 0.12);
	color: #a12417;
}

.agency-warn-icon {
	color: #f1c40f;
	margin-left: 3px;
}
.agency-client-name {
	font-weight: 600;
}
.agency-no-client-name {
	font-style: italic;
}

.bv-form-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 720px) {
	.bv-form-grid-2 {
		grid-template-columns: 1fr;
	}
}

.agency-users-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.agency-user-name {
	font-weight: 600;
}

.agency-user-actions {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
	align-items: center;
}

.agency-action-btn.small {
	padding: 6px 8px;
	font-size: 12px;
}

.agency-action-btn.danger {
	border-color: rgba(192, 57, 43, 0.28);
	color: #a12417;
	background: #fff;
}

.agency-action-btn.danger:hover {
	background: rgba(192, 57, 43, 0.08);
	color: #8f1c11;
}
/* END:  Agency page styles */

/* Admin dashboard styles */
.admin-dashboard-page {
	max-width: 1460px;
	margin: 0 auto;
	padding: 24px 0 48px;
}

.admin-hero {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	gap: 18px;
	flex-wrap: wrap;
}

.admin-hero > div:first-child {
	flex: 1 1 420px;
}

.admin-hero-text {
	margin-top: 8px;
	max-width: 760px;
}

.admin-hero .agency-action-btn.primary {
	margin-top: 14px;
}

.admin-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin: 0;
	flex: 1 1 520px;
	align-self: stretch;
}

.admin-stat-card {
	background: #f8fafc;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 16px;
	padding: 16px 18px;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.admin-stat-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
	margin-bottom: 8px;
}

.admin-stat-value {
	font-size: 28px;
	font-weight: 700;
	line-height: 1.1;
	color: #0f172a;
}

.admin-card {
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 18px;
	padding: 18px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
	margin-bottom: 18px;
}

.admin-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	width: 100%;
	gap: 12px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.admin-section-header {
	background: none;
	padding: 0;
	text-align: left;
	margin-bottom: 14px;
	border: none;
}

.admin-section-header h2,
.admin-section-header h3 {
	text-align: left;
	margin: 0;
}

.admin-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.admin-search {
	min-width: 260px;
	padding: 10px 12px;
	border: 1px solid rgba(15, 23, 42, 0.14);
	border-radius: 10px;
	background: #fff;
	color: #0f172a;
	font-size: 14px;
	box-sizing: border-box;
}

.admin-search:focus {
	outline: none;
	border-color: rgba(29, 53, 87, 0.35);
	box-shadow: 0 0 0 3px rgba(29, 53, 87, 0.08);
}

.admin-detail-card {
	padding-bottom: 22px;
}

.admin-detail-badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.admin-detail-section + .admin-detail-section {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-table-scroller {
	overflow: auto;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 14px;
	background: #fff;
}

.admin-table-scroller-xl {
	max-height: 560px;
}

.admin-table-scroller-lg {
	max-height: 420px;
}

.admin-table-scroller-md {
	max-height: 320px;
}

.admin-table {
	width: 100%;
	border-collapse: collapse;
}

.admin-table th,
.admin-table td {
	padding: 10px 12px;
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
	vertical-align: middle;
	text-align: left;
	background: #fff;
}

.admin-table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #f8fafc;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
	font-weight: 700;
}

.admin-table tbody tr:hover {
	background: rgba(15, 23, 42, 0.025);
}

.admin-table tbody tr:hover td {
	background: rgba(15, 23, 42, 0.025);
}

.admin-agency-name {
	font-weight: 600;
}

.admin-selected-row td {
	background: rgba(59, 130, 246, 0.08);
}

.admin-actions {
	display: flex;
	gap: 5px;
	flex-wrap: nowrap;
	align-items: center;
}

.admin-message-error {
	color: #991b1b;
}

.admin-message-success {
	color: #166534;
}

@media (max-width: 1100px) {
	.admin-stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.admin-stats-grid {
		grid-template-columns: 1fr;
	}

	.admin-search {
		min-width: 100%;
		width: 100%;
	}

	.admin-actions {
		flex-wrap: wrap;
	}
}
/* END: Admin dashboard styles */