/* ==========================================================================
   LHKPM PDAM — Frontend Styles
   Palet warna terinspirasi identitas PDAM (biru air / teal modern)
   ========================================================================== */

.lhkpm-wrap {
	--lhkpm-primary: #0a4c8c;
	--lhkpm-primary-dark: #073761;
	--lhkpm-primary-light: #eaf3fb;
	--lhkpm-accent: #17a6e0;
	--lhkpm-accent-2: #0ea5a5;
	--lhkpm-bg: #f4f9fc;
	--lhkpm-card: #ffffff;
	--lhkpm-text: #142b3d;
	--lhkpm-muted: #64798c;
	--lhkpm-border: #e2edf5;
	--lhkpm-radius: 16px;
	--lhkpm-radius-sm: 10px;
	--lhkpm-shadow: 0 10px 30px -12px rgba(10, 76, 140, 0.18);
	--lhkpm-font-display: 'Poppins', 'Segoe UI', sans-serif;
	--lhkpm-font-body: 'Inter', 'Segoe UI', sans-serif;

	font-family: var(--lhkpm-font-body);
	color: var(--lhkpm-text);
	max-width: 100%;
	box-sizing: border-box;
}

.lhkpm-wrap *,
.lhkpm-wrap *::before,
.lhkpm-wrap *::after {
	box-sizing: border-box;
}

/* ---------------------------- Toolbar ---------------------------- */
.lhkpm-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 18px;
	align-items: center;
}

.lhkpm-search-box {
	position: relative;
	flex: 1 1 280px;
	min-width: 220px;
}

.lhkpm-icon-search {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--lhkpm-muted);
	display: inline-flex;
	pointer-events: none;
}

.lhkpm-search-input {
	width: 100%;
	padding: 12px 16px 12px 42px;
	border-radius: 999px;
	border: 1.5px solid var(--lhkpm-border);
	background: var(--lhkpm-card);
	font-family: var(--lhkpm-font-body);
	font-size: 14.5px;
	color: var(--lhkpm-text);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lhkpm-search-input:focus {
	border-color: var(--lhkpm-accent);
	box-shadow: 0 0 0 4px rgba(23, 166, 224, 0.15);
}

.lhkpm-filter-box {
	flex: 0 0 auto;
}

.lhkpm-year-filter {
	padding: 12px 38px 12px 16px;
	border-radius: 999px;
	border: 1.5px solid var(--lhkpm-border);
	background-color: var(--lhkpm-card);
	font-family: var(--lhkpm-font-body);
	font-size: 14.5px;
	color: var(--lhkpm-text);
	cursor: pointer;
	outline: none;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #64798c 50%), linear-gradient(135deg, #64798c 50%, transparent 50%);
	background-position: calc(100% - 20px) center, calc(100% - 14px) center;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lhkpm-year-filter:focus {
	border-color: var(--lhkpm-accent);
	box-shadow: 0 0 0 4px rgba(23, 166, 224, 0.15);
}

/* ---------------------------- Table Card ---------------------------- */
.lhkpm-table-card {
	background: var(--lhkpm-card);
	border-radius: var(--lhkpm-radius);
	box-shadow: var(--lhkpm-shadow);
	border: 1px solid var(--lhkpm-border);
	overflow: hidden;
	position: relative;
}

.lhkpm-table-wave {
	height: 6px;
	line-height: 0;
	background: linear-gradient(90deg, var(--lhkpm-primary), var(--lhkpm-accent) 55%, var(--lhkpm-accent-2));
}

.lhkpm-table-wave svg {
	display: none; /* garis solid gradasi sudah cukup jadi aksen; svg gelombang tersimpan untuk pengembangan lanjut */
}

.lhkpm-table-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.lhkpm-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

.lhkpm-table thead th {
	background: linear-gradient(135deg, var(--lhkpm-primary) 0%, var(--lhkpm-primary-dark) 100%);
	color: #ffffff;
	font-family: var(--lhkpm-font-display);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: left;
	padding: 16px 18px;
	white-space: nowrap;
}

.lhkpm-table thead th.lhkpm-col-no {
	width: 60px;
	text-align: center;
}

.lhkpm-table thead th.lhkpm-col-tahun,
.lhkpm-table thead th.lhkpm-col-laporan {
	width: 160px;
}

.lhkpm-table tbody tr {
	border-bottom: 1px solid var(--lhkpm-border);
	transition: background-color 0.15s ease;
}

.lhkpm-table tbody tr:last-child {
	border-bottom: none;
}

.lhkpm-table tbody tr:hover {
	background-color: var(--lhkpm-primary-light);
}

.lhkpm-table tbody td {
	padding: 14px 18px;
	font-size: 14.5px;
	vertical-align: middle;
}

.lhkpm-col-no {
	text-align: center;
	color: var(--lhkpm-muted);
	font-weight: 500;
}

/* Nama + avatar inisial */
.lhkpm-nama-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lhkpm-avatar {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--lhkpm-accent), var(--lhkpm-primary));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--lhkpm-font-display);
	font-weight: 600;
	font-size: 13px;
}

.lhkpm-nama-text {
	font-weight: 600;
	color: var(--lhkpm-text);
}

.lhkpm-col-jabatan {
	color: var(--lhkpm-muted);
}

/* Tombol lihat laporan */
.lhkpm-view-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--lhkpm-primary-light);
	color: var(--lhkpm-primary);
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	border: 1px solid rgba(10, 76, 140, 0.15);
	transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
	white-space: nowrap;
}

.lhkpm-view-btn:hover {
	background: var(--lhkpm-primary);
	color: #fff;
	transform: translateY(-1px);
}

.lhkpm-view-btn svg {
	flex-shrink: 0;
}

/* Badge tahun */
.lhkpm-year-badge {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(14, 165, 165, 0.12);
	color: var(--lhkpm-accent-2);
	font-family: var(--lhkpm-font-display);
	font-weight: 600;
	font-size: 13px;
}

/* Empty state */
.lhkpm-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 46px 16px;
	color: var(--lhkpm-muted);
	text-align: center;
}

.lhkpm-empty-state svg {
	color: var(--lhkpm-accent);
	opacity: 0.6;
}

/* ---------------------------- Meta / Pagination ---------------------------- */
.lhkpm-meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	background: var(--lhkpm-bg);
	border-top: 1px solid var(--lhkpm-border);
}

.lhkpm-count-info {
	margin: 0;
	font-size: 13.5px;
	color: var(--lhkpm-muted);
}

.lhkpm-pagination {
	display: flex;
	gap: 6px;
	align-items: center;
}

.lhkpm-page-btn {
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border-radius: 8px;
	border: 1px solid var(--lhkpm-border);
	background: var(--lhkpm-card);
	color: var(--lhkpm-text);
	font-family: var(--lhkpm-font-body);
	font-weight: 500;
	font-size: 13.5px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.lhkpm-page-btn:hover:not(:disabled) {
	border-color: var(--lhkpm-accent);
	color: var(--lhkpm-primary);
}

.lhkpm-page-btn.is-active {
	background: var(--lhkpm-primary);
	border-color: var(--lhkpm-primary);
	color: #fff;
}

.lhkpm-page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.lhkpm-page-ellipsis {
	color: var(--lhkpm-muted);
	padding: 0 2px;
}

/* Loading state ringan saat AJAX berjalan */
.lhkpm-wrap.is-loading .lhkpm-table-card {
	opacity: 0.6;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ---------------------------- Responsif ---------------------------- */
@media (max-width: 680px) {
	.lhkpm-table {
		min-width: 0;
	}

	.lhkpm-table thead {
		display: none;
	}

	.lhkpm-table,
	.lhkpm-table tbody,
	.lhkpm-table tr,
	.lhkpm-table td {
		display: block;
		width: 100%;
	}

	.lhkpm-table tbody tr {
		padding: 14px 16px;
		border-bottom: 8px solid var(--lhkpm-bg);
	}

	.lhkpm-table tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 8px 0;
		border: none;
		text-align: right;
	}

	.lhkpm-table tbody td::before {
		content: attr(data-label);
		font-family: var(--lhkpm-font-display);
		font-weight: 600;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: var(--lhkpm-muted);
		text-align: left;
	}

	.lhkpm-col-no {
		display: none !important;
	}

	.lhkpm-nama-cell {
		justify-content: flex-end;
	}

	.lhkpm-meta-row {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.lhkpm-pagination {
		justify-content: center;
		flex-wrap: wrap;
	}
}
