﻿/* ===== Container ===== */
.page-container {
	background: #fff;
	border-radius: 20px;
	padding: 1.5rem 1.6rem;
	width: 100%;
	height: 100%;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
	font-size: 0.9rem;
	overflow: visible !important;
}

/* ===== Header ===== */
.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.2rem;
}

/* ===== Table ===== */
.table {
	width: 100%;
	border-collapse: collapse;
	background-color: var(--ek-surface);
	font-size: 0.85rem;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

	.table th,
	.table td {
		padding: 0.55rem 0.75rem;
		text-align: center;
		border-bottom: 1px solid var(--ek-border-color); 
		background: transparent; 
	}

	.table thead th {
		background: var(--ek-table-header-bg); 
		font-weight: 700;
	}

	.table tbody tr {
		transition: background-color 0.2s ease, transform 0.1s ease;
		cursor: pointer;
	}
	.table tbody tr:hover {
		background-color: var(--ek-table-hover-bg);
	}
	.table tbody tr:active {
		transform: scale(0.99);
		background-color: var(--ek-table-active-bg); 
	}



/* ===== Status Pill ===== */
.status-pill {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	color: #fff;
	text-transform: capitalize;
}

	.status-pill.submitted {
		background: #f9a825;
	}

	.status-pill.confirmed {
		background: #2e7d32;
	}
	.status-pill.approved {
		background: #2e7d32;
	}

	.status-pill.pending {
		background: #f9a825;
	}

	.status-pill.denied {
		background: #b71c1c;
	}


/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
	.page-container {
		padding: 2rem 2.2rem;
		font-size: 0.95rem;
	}

	.table {
		font-size: 0.9rem;
	}

		.table th,
		.table td {
			padding: 0.65rem 0.875rem;
		}
}

/* Desktop & Laptop (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1024px) {
	.page-container {
		padding: 1.5rem 1.6rem;
	}

	.table {
		font-size: 0.85rem;
	}

		.table th,
		.table td {
			padding: 0.55rem 0.75rem;
		}
}

/* iPad Pro & Tablets (900px - 1023px) */
@media (max-width: 1023px) and (min-width: 900px) {
	.page-container {
		padding: 1.25rem 1.4rem;
		border-radius: 16px;
	}

	.page-header {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
		margin-bottom: 1rem;
	}

	/* Enable horizontal scroll for tables */
	.table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		font-size: 0.8rem;
	}

		.table thead,
		.table tbody,
		.table tr {
			display: table;
			width: 100%;
			table-layout: auto;
		}

		.table th,
		.table td {
			padding: 0.5rem 0.65rem;
		}

		/* Make first column sticky */
		.table thead th:first-child,
		.table tbody td:first-child {
			position: sticky;
			left: 0;
			background: var(--ek-surface, #fff);
			z-index: 2;
			box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
		}

		.table thead th:first-child {
			background: var(--ek-table-header-bg, #f5f5f5);
			z-index: 3;
		}
}

/* iPad Portrait (768px - 899px) */
@media (max-width: 899px) and (min-width: 768px) {
	.page-container {
		padding: 1rem 1.2rem;
		border-radius: 14px;
	}

	.page-header {
		flex-direction: column;
		align-items: stretch;
		gap: 0.875rem;
		margin-bottom: 1rem;
	}

	/* Horizontal scroll with sticky first column */
	.table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		font-size: 0.8rem;
	}

		.table thead,
		.table tbody,
		.table tr {
			display: table;
			width: 100%;
			table-layout: auto;
		}

		.table th,
		.table td {
			padding: 0.5rem 0.6rem;
			font-size: 0.8rem;
		}

		.table thead th:first-child,
		.table tbody td:first-child {
			position: sticky;
			left: 0;
			background: var(--ek-surface, #fff);
			z-index: 2;
			box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
		}

		.table thead th:first-child {
			background: var(--ek-table-header-bg, #f5f5f5);
			z-index: 3;
		}

		/* Disable active scale effect on touch devices */
		.table tbody tr:active {
			transform: none;
		}

	.status-pill {
		font-size: 0.7rem;
		padding: 0.2rem 0.5rem;
	}
}

/* iPad Mini & Large Mobile (600px - 767px) */
@media (max-width: 767px) and (min-width: 600px) {
	.page-container {
		padding: 0.875rem 1rem;
		border-radius: 12px;
	}

	.page-header {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
		margin-bottom: 0.875rem;
	}

	/* Card layout for tables */
	.table {
		display: block;
		box-shadow: none;
		background: transparent;
		overflow: visible;
	}

		.table thead {
			display: none;
		}

		.table tbody {
			display: block;
		}

			.table tbody tr {
				display: block;
				background: var(--ek-surface, #fff);
				border: 1px solid var(--ek-border-color, #e0e0e0);
				border-radius: 10px;
				margin-bottom: 1rem;
				padding: 1rem;
				box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
			}

				.table tbody tr:hover {
					transform: translateY(-2px);
					box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
				}

				.table tbody tr:active {
					transform: scale(0.98);
				}

			.table tbody td {
				display: grid;
				grid-template-columns: 140px 1fr;
				padding: 0.5rem 0;
				border-bottom: 1px dashed var(--ek-border-color, #f0f0f0);
				text-align: left;
				font-size: 0.85rem;
			}

				.table tbody td:last-child {
					border-bottom: none;
				}

				.table tbody td::before {
					content: attr(data-label);
					font-weight: 700;
					color: #333;
					padding-right: 0.75rem;
				}

	.status-pill {
		font-size: 0.7rem;
		padding: 0.2rem 0.5rem;
	}
}

/* Mobile (below 600px) */
@media (max-width: 599px) {
	.page-container {
		padding: 0.75rem;
		border-radius: 12px;
		font-size: 0.85rem;
	}

	.page-header {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
		margin-bottom: 0.75rem;
	}

	/* Card layout */
	.table {
		display: block;
		box-shadow: none;
		background: transparent;
		overflow: visible;
	}

		.table thead {
			display: none;
		}

		.table tbody {
			display: block;
		}

			.table tbody tr {
				display: block;
				background: var(--ek-surface, #fff);
				border: 1px solid var(--ek-border-color, #e0e0e0);
				border-radius: 8px;
				margin-bottom: 0.875rem;
				padding: 0.875rem;
				box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
			}

				.table tbody tr:hover {
					background-color: var(--ek-table-hover-bg, #fef5f5);
				}

				.table tbody tr:active {
					transform: scale(0.98);
					background-color: var(--ek-table-active-bg, #ffeaea);
				}

			.table tbody td {
				display: grid;
				grid-template-columns: 110px 1fr;
				padding: 0.45rem 0;
				border-bottom: 1px dashed var(--ek-border-color, #f0f0f0);
				text-align: left;
				font-size: 0.8rem;
				gap: 0.5rem;
			}

				.table tbody td:last-child {
					border-bottom: none;
				}

				.table tbody td::before {
					content: attr(data-label);
					font-weight: 700;
					color: #333;
					font-size: 0.75rem;
				}

	.status-pill {
		font-size: 0.65rem;
		padding: 0.2rem 0.45rem;
	}
}

/* Extra Small Mobile (below 400px) */
@media (max-width: 399px) {
	.page-container {
		padding: 0.5rem;
		border-radius: 10px;
		font-size: 0.8rem;
	}

	.page-header {
		gap: 0.65rem;
		margin-bottom: 0.65rem;
	}

	.table tbody tr {
		padding: 0.75rem;
		margin-bottom: 0.75rem;
		border-radius: 8px;
	}

	.table tbody td {
		grid-template-columns: 100px 1fr;
		padding: 0.4rem 0;
		font-size: 0.75rem;
		gap: 0.4rem;
	}

		.table tbody td::before {
			font-size: 0.7rem;
		}

	.status-pill {
		font-size: 0.6rem;
		padding: 0.15rem 0.4rem;
	}
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
	.table tbody tr {
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
	}

		.table tbody tr:active {
			transform: scale(0.98);
			transition: transform 0.1s ease;
		}
}