/* CSS Variables for Table Styling - matching styles.css */
:root {
	--table-primary: #2d3a4b;
	--table-accent: #4fc3f7;
	--table-bg: #ffffff;
	--table-header-bg: linear-gradient(90deg, #64b5f6 0%, #020079 100%);
	--table-row-odd: #f8fcff;
	--table-row-even: #ffffff;
	--table-border: rgba(100, 181, 246, 0.2);
	--table-border-radius: 12px;
	--table-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	--table-hover-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);

	/* Responsive font sizes */
	--table-font-header: clamp(1.1rem, 2.5vw, 1.4rem);
	--table-font-subheader: clamp(1rem, 2.2vw, 1.2rem);
	--table-font-cell: clamp(1.2rem, 2.8vw, 1.6rem);
	--table-font-large: clamp(1.4rem, 3.2vw, 1.8rem);
	--table-font-caption: clamp(1.3rem, 3vw, 1.7rem);
}

table.cool {
	margin: 5px auto;
	color: var(--table-primary);
	font-family: 'Kalpurush', 'Noto Sans Assamese', 'Arial', sans-serif;
	font-weight: normal;
	vertical-align: top;
	border-radius: var(--table-border-radius);
	max-width: 100%;
	width: 100%;
	background: var(--table-bg);
	box-shadow: var(--table-shadow);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	font-size: var(--table-font-cell);
}

table.cool * {
	font-family: 'Kalpurush', 'Noto Sans Assamese', 'Arial', sans-serif !important;
}

table.cool:hover {
	transform: translateY(-1px);
	box-shadow: var(--table-hover-shadow);
}

/* Style for table headers */
table.cool tr th,
table.cool tr.subhead th {
	padding: 8px 12px;
	border-radius: 0;
	color: white;
	background: var(--table-header-bg);
	border: none;
	border-right: 1px solid rgba(255, 255, 255, 0.2);
	text-align: center;
	font-family: 'Kalpurush', 'Noto Sans Assamese', 'Arial', sans-serif;
	position: relative;
	backdrop-filter: blur(10px);
}

table.cool tr th:last-child,
table.cool tr.subhead th:last-child {
	border-right: none;
}

table.cool tr:first-child th:first-child {
	border-radius: 0;
}

table.cool tr:first-child th:last-child {
	border-radius: 0;
}

table.cool tr th {
	font-weight: bold;
	font-size: var(--table-font-header);
	letter-spacing: 0.5px;
}

table.cool tr.subhead th {
	font-weight: 500;
	font-size: var(--table-font-subheader);
	opacity: 0.9;
}

/* Style for odd rows */
table.cool tr.rowone td {
	background-color: var(--table-row-odd);
	color: var(--table-primary);
	border: none;
	border-bottom: 1px solid var(--table-border);
	border-right: 1px solid rgba(100, 181, 246, 0.15);
	padding: 6px 10px;
	vertical-align: top;
	text-align: right;
	font-size: var(--table-font-cell);
	transition: background-color 0.2s ease;
}

table.cool tr.rowone td:last-child {
	border-right: none;
}

table.cool tr.rowone:hover td {
	background-color: rgba(100, 181, 246, 0.1);
}

/* Style of even rows */
table.cool tr.rowtwo td {
	background-color: var(--table-row-even);
	color: var(--table-primary);
	border: none;
	border-bottom: 1px solid var(--table-border);
	border-right: 1px solid rgba(100, 181, 246, 0.15);
	padding: 6px 10px;
	text-align: right;
	vertical-align: top;
	font-size: var(--table-font-cell);
	transition: background-color 0.2s ease;
}

table.cool tr.rowtwo td:last-child {
	border-right: none;
}

table.cool tr.rowtwo:hover td {
	background-color: rgba(100, 181, 246, 0.1);
}

/* Style for invisible rows */
table.cool tr.rowinv td {
	background-color: transparent;
	color: var(--table-primary);
	border: none;
	border-right: 1px solid rgba(100, 181, 246, 0.15);
	padding: 6px 10px;
	vertical-align: top;
	text-align: justify;
	font-size: var(--table-font-large);
	line-height: 1.4;
}

table.cool tr.rowinv td:last-child {
	border-right: none;
}

/* Style for left-aligned odd rows */
table.cool tr.rowoneleft td {
	background-color: var(--table-row-odd);
	color: var(--table-primary);
	border: none;
	border-bottom: 1px solid var(--table-border);
	border-right: 1px solid rgba(100, 181, 246, 0.15);
	padding: 6px 10px;
	text-align: left;
	vertical-align: top;
	font-size: var(--table-font-large);
	line-height: 1.4;
	transition: background-color 0.2s ease;
}

table.cool tr.rowoneleft td:last-child {
	border-right: none;
}

table.cool tr.rowoneleft:hover td {
	background-color: rgba(100, 181, 246, 0.1);
}

/* Style of left-aligned even rows */
table.cool tr.rowtwoleft td {
	background-color: var(--table-row-even);
	color: var(--table-primary);
	border: none;
	border-bottom: 1px solid var(--table-border);
	border-right: 1px solid rgba(100, 181, 246, 0.15);
	padding: 6px 10px;
	text-align: left;
	vertical-align: top;
	font-size: var(--table-font-large);
	line-height: 1.4;
	transition: background-color 0.2s ease;
}

table.cool tr.rowtwoleft td:last-child {
	border-right: none;
}

table.cool tr.rowtwoleft:hover td {
	background-color: rgba(100, 181, 246, 0.1);
}

/* Subtotal rows */
table.cool tr.subtotal td {
	padding: 8px 12px;
	border: none;
	border-top: 2px solid var(--table-accent);
	border-right: 1px solid rgba(255, 255, 255, 0.2);
	color: white;
	background: var(--table-header-bg);
	text-align: right;
	font-size: var(--table-font-large);
	font-weight: bold;
	vertical-align: top;
	backdrop-filter: blur(10px);
}

table.cool tr.subtotal td:last-child {
	border-right: none;
}

/* Last row styling */
table.cool tr:last-child td:first-child {
	border-radius: 0 0 0 var(--table-border-radius);
}

table.cool tr:last-child td:last-child {
	border-radius: 0 0 var(--table-border-radius) 0;
}

/* Table caption */
table.cool caption {
	font-size: var(--table-font-caption);
	font-weight: bold;
	margin: 8px 0 6px 0;
	color: var(--table-primary);
	text-align: center;
	font-family: 'Kalpurush', 'Noto Sans Assamese', 'Arial', sans-serif;
}

/* --------------- MODERN TABS ------------------- */
ul.tabs {
	width: 100%;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--table-border);
}

ul.tabs li {
	margin: 0 2px 0 0;
	list-style: none;
	border-radius: var(--table-border-radius) var(--table-border-radius) 0 0;
	font-weight: 500;
	color: var(--table-primary);
	border: 1px solid var(--table-border);
	border-bottom: none;
	padding: 6px 12px;
	display: block;
	position: relative;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: 'Kalpurush', 'Noto Sans Assamese', 'Arial', sans-serif;
	font-size: var(--table-font-header);
}

ul.tabs li.unsel {
	background: var(--table-bg);
	color: var(--table-primary);
	z-index: 1;
}

ul.tabs li.unsel:hover {
	background: rgba(100, 181, 246, 0.1);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

ul.tabs li.sel {
	background: var(--table-accent);
	color: white;
	z-index: 100;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

ul.tabs li.sel:hover {
	background: #42a5f5;
}

div.tabbody {
	border: 1px solid var(--table-border);
	border-radius: 0 var(--table-border-radius) var(--table-border-radius) var(--table-border-radius);
	background: var(--table-bg);
	padding: 12px;
	min-height: 300px;
	width: 100%;
	z-index: 10;
	margin-bottom: 10px;
	box-shadow: var(--table-shadow);
	backdrop-filter: blur(10px);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

div.tabbody:hover {
	transform: translateY(-1px);
	box-shadow: var(--table-hover-shadow);
}

/* Responsive table styles */
@media (max-width: 768px) {
	table.cool {
		margin: 2px auto;
	}

	table.cool tr th,
	table.cool tr.subhead th {
		padding: 4px 6px;
	}

	table.cool tr td {
		padding: 3px 4px;
	}

	ul.tabs li {
		padding: 4px 8px;
	}

	div.tabbody {
		padding: 8px;
		min-height: 200px;
	}
}

/* Additional responsive font adjustments */
@media (max-width: 480px) {
	:root {
		--table-font-header: clamp(0.9rem, 2vw, 1.1rem);
		--table-font-subheader: clamp(0.8rem, 1.8vw, 1rem);
		--table-font-cell: clamp(1rem, 2.3vw, 1.3rem);
		--table-font-large: clamp(1.1rem, 2.5vw, 1.4rem);
		--table-font-caption: clamp(1rem, 2.4vw, 1.3rem);
	}

	table.cool tr th,
	table.cool tr.subhead th,
	table.cool tr td {
		padding: 2px 3px;
	}

	table.cool {
		font-size: 0.9rem;
	}
}
