/**
 * Profit Forecasting Table Styles
 * Used for the Profit Forecasting report table - Dual Table Layout
 * Dark Pastel Color Scheme for Month Differentiation
 *
 * Layout: #frozen-col-table (fixed left) + #profit-forecast-table (scrollable right)
 */

/* ============================================================
   SHARED TABLE STYLES
   ============================================================ */
.forecast-table {
	margin-bottom: 0;
	table-layout: fixed;
	width: max-content;
}

.forecast-table thead th {
	font-weight: 600;
	padding: 12px 8px;
	white-space: nowrap;
	text-align: center;
	border: 1px solid #ddd;
}

.forecast-table tbody td {
	padding: 5px 8px;
	vertical-align: middle;
}

.forecast-table .numeric {
	text-align: right;
	font-family: "Nunito", monospace;
	font-size: 15px;
}

.forecast-table .text-right {
	text-align: right;
}

.forecast-table tbody tr:hover td {
	opacity: 0.95;
}

.forecast-table .text-success {
	color: #28a745;
	font-weight: 500;
}

.forecast-table .text-danger {
	color: #dc3545;
	font-weight: 500;
}

.forecast-table .text-muted {
	font-size: 12px;
	color: #6c757d;
}

/* ============================================================
   FROZEN COLUMN TABLE (#frozen-col-table)
   ============================================================ */
#frozen-col-table {
	width: 250px;
	min-width: 250px;
}

#frozen-col-table thead th,
#frozen-col-table tbody td {
	width: 250px !important;
	min-width: 250px !important;
	max-width: 250px !important;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Frozen column - first header (Specific\GLCode label) */
#frozen-col-table thead tr:nth-child(1) > th {
	background: #6C757D !important;
	color: white !important;
	font-size: 14px;
}

/* Frozen column - second header (empty spacer to match data table) */
#frozen-col-table thead tr:nth-child(2) > th {
	background: #6C757D !important;
	color: white !important;
}

/* Frozen column - body cells */
#frozen-col-table tbody td {
	background-color: #FFFFFF;
	font-weight: 600;
}

/* ============================================================
   DATA TABLE (#profit-forecast-table)
   ============================================================ */
#profit-forecast-table thead tr:nth-child(1) > th {
	font-size: 18px !important;
	color: white !important;
}

/* Column width distribution - ensure all Budget/Actual/Variance columns are equal width */
#profit-forecast-table thead th:nth-child(n),
#profit-forecast-table tbody td:nth-child(n) {
	width: 120px !important;
	min-width: 120px !important;
	max-width: 120px !important;
}

/* ============================================================
   MONTH HEADER ROW 1 - MONTH NAMES (dark pastel colors)
   Data table: January=th(1), February=th(2), ... December=th(12)
   ============================================================ */

/* January - Dark Pastel Blue-Gray */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(1) {
	background: #6B8BA8 !important;
}

/* February - Dark Pastel Mauve */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(2) {
	background: #A88BA6 !important;
}

/* March - Dark Pastel Blue */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(3) {
	background: #7A9DD9 !important;
}

/* April - Dark Pastel Cyan */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(4) {
	background: #6CBAD8 !important;
}

/* May - Dark Pastel Green */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(5) {
	background: #7BA567 !important;
}

/* June - Dark Pastel Orange */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(6) {
	background: #DB914F !important;
}

/* July - Dark Pastel Rose */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(7) {
	background: #D4897F !important;
}

/* August - Dark Pastel Purple */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(8) {
	background: #9B7BA5 !important;
}

/* September - Dark Pastel Teal */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(9) {
	background: #6BA8A0 !important;
}

/* October - Dark Pastel Brown */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(10) {
	background: #A67C52 !important;
}

/* November - Dark Pastel Navy */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(11) {
	background: #5B6E8F !important;
}

/* December - Dark Pastel Burgundy */
#profit-forecast-table thead tr:nth-child(1) > th:nth-child(12) {
	background: #8B4556 !important;
}

/* ============================================================
   MONTH HEADER ROW 2 - Budget, Actual, Variance sub-headers
   Data table: th(1-3)=Jan, th(4-6)=Feb, ... th(34-36)=Dec
   ============================================================ */

/* January - Dark Pastel Blue-Gray */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(1),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(2),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(3) {
	background: #6B8BA8 !important;
	color: white !important;
}

/* February - Dark Pastel Mauve */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(4),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(5),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(6) {
	background: #A88BA6 !important;
	color: white !important;
}

/* March - Dark Pastel Blue */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(7),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(8),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(9) {
	background: #7A9DD9 !important;
	color: white !important;
}

/* April - Dark Pastel Cyan */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(10),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(11),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(12) {
	background: #6CBAD8 !important;
	color: white !important;
}

/* May - Dark Pastel Green */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(13),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(14),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(15) {
	background: #7BA567 !important;
	color: white !important;
}

/* June - Dark Pastel Orange */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(16),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(17),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(18) {
	background: #DB914F !important;
	color: white !important;
}

/* July - Dark Pastel Rose */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(19),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(20),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(21) {
	background: #D4897F !important;
	color: white !important;
}

/* August - Dark Pastel Purple */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(22),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(23),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(24) {
	background: #9B7BA5 !important;
	color: white !important;
}

/* September - Dark Pastel Teal */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(25),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(26),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(27) {
	background: #6BA8A0 !important;
	color: white !important;
}

/* October - Dark Pastel Brown */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(28),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(29),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(30) {
	background: #A67C52 !important;
	color: white !important;
}

/* November - Dark Pastel Navy */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(31),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(32),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(33) {
	background: #5B6E8F !important;
	color: white !important;
}

/* December - Dark Pastel Burgundy */
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(34),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(35),
#profit-forecast-table thead tr:nth-child(2) > th:nth-child(36) {
	background: #8B4556 !important;
	color: white !important;
}

/* ============================================================
   MONTH CELL BACKGROUND COLORS FOR DATA ROWS - Light tints
   Data table: td(1-3)=Jan, td(4-6)=Feb, ... td(34-36)=Dec
   ============================================================ */

/* January - Light tint of dark pastel blue-gray */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(1),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(2),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(3) {
	background-color: #D7E0EB !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(1),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(2),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(3) {
	background-color: #FFFFFF !important;
}

/* February - Light tint of dark pastel mauve */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(4),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(5),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(6) {
	background-color: #E8DFE7 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(4),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(5),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(6) {
	background-color: #FFFFFF !important;
}

/* March - Light tint of dark pastel blue */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(7),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(8),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(9) {
	background-color: #d5d6fd !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(7),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(8),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(9) {
	background-color: #FFFFFF !important;
}

/* April - Light tint of dark pastel cyan */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(10),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(11),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(12) {
	background-color: #D0EEF5 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(10),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(11),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(12) {
	background-color: #FFFFFF !important;
}

/* May - Light tint of dark pastel green */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(13),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(14),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(15) {
	background-color: #E0EDDA !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(13),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(14),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(15) {
	background-color: #FFFFFF !important;
}

/* June - Light tint of dark pastel orange */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(16),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(17),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(18) {
	background-color: #F5E7D8 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(16),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(17),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(18) {
	background-color: #FFFFFF !important;
}

/* July - Light tint of dark pastel rose */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(19),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(20),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(21) {
	background-color: #F0D4C9 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(19),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(20),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(21) {
	background-color: #FFFFFF !important;
}

/* August - Light tint of dark pastel purple */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(22),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(23),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(24) {
	background-color: #E8DDF2 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(22),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(23),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(24) {
	background-color: #FFFFFF !important;
}

/* September - Light tint of dark pastel teal */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(25),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(26),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(27) {
	background-color: #D7E6E3 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(25),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(26),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(27) {
	background-color: #FFFFFF !important;
}

/* October - Light tint of dark pastel brown */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(28),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(29),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(30) {
	background-color: #E5D7C9 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(28),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(29),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(30) {
	background-color: #FFFFFF !important;
}

/* November - Light tint of dark pastel navy */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(31),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(32),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(33) {
	background-color: #D7DEEB !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(31),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(32),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(33) {
	background-color: #FFFFFF !important;
}

/* December - Light tint of dark pastel burgundy */
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(34),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(35),
#profit-forecast-table tbody tr:nth-child(odd) td:nth-child(36) {
	background-color: #E8D0D8 !important;
}

#profit-forecast-table tbody tr:nth-child(even) td:nth-child(34),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(35),
#profit-forecast-table tbody tr:nth-child(even) td:nth-child(36) {
	background-color: #FFFFFF !important;
}

/* ============================================================
   YTD SIDE PANEL
   ============================================================ */

/* The wrapper that holds scrollable data + ytd panel, used for relative positioning */
.forecast-split-view {
	position: relative;
}

/* YTD toggle button - fixed on the right edge */
#ytd-toggle-btn {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	width: 32px;
	height: 80px;
	background: #343a40;
	color: #fff;
	border: none;
	border-radius: 6px 0 0 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	transition: background 0.2s, right 0.3s;
	box-shadow: -2px 0 6px rgba(0,0,0,0.15);
}

#ytd-toggle-btn:hover {
	background: #495057;
}

/* When panel is open, move button inward */
#ytd-toggle-btn.panel-open {
	right: 360px;
}

/* YTD side panel container */
#ytd-side-panel {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 360px;
	z-index: 15;
	background: #fff;
	border-left: 3px solid #6C757D;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

#ytd-side-panel.open {
	transform: translateX(0);
}

/* YTD panel scrollable body - synced with main table */
#ytd-panel-scroll {
	flex: 1;
	overflow-y: hidden;
	overflow-x: hidden;
}

/* YTD table */
#ytd-table {
	margin-bottom: 0;
	table-layout: fixed;
	width: 100%;
}

#ytd-table thead th {
	font-weight: 600;
	padding: 12px 8px;
	white-space: nowrap;
	text-align: center;
	border: 1px solid #ddd;
	background: #495057 !important;
	color: #fff !important;
	font-size: 14px;
}

#ytd-table tbody td {
	padding: 5px 8px;
	vertical-align: middle;
	text-align: right;
	font-family: "Nunito", monospace;
	font-size: 15px;
	border: 1px solid #ddd;
}

/* YTD header row 1 - "YTD" spans all 3 columns */
#ytd-table thead tr:nth-child(1) > th {
	background: #343a40 !important;
	color: #fff !important;
	font-size: 18px;
}

/* YTD header row 2 - sub headers */
#ytd-table thead tr:nth-child(2) > th {
	background: #495057 !important;
	color: #fff !important;
}

/* YTD body cell alternating colors */
#ytd-table tbody tr:nth-child(odd) td {
	background-color: #f8f9fa !important;
}

#ytd-table tbody tr:nth-child(even) td {
	background-color: #ffffff !important;
}

#ytd-table .text-success {
	color: #28a745;
	font-weight: 500;
}

#ytd-table .text-danger {
	color: #dc3545;
	font-weight: 500;
}

#ytd-table .text-muted {
	font-size: 12px;
	color: #6c757d;
}
