/* =========================
   PPID PREMIUM SKY THEME (CLEAN)
   ========================= */
:root {
	--ppid-sky-1: #1d4ed8;
	--ppid-sky-2: #38bdf8;
	--ppid-sky-3: #a5f3fc;

	--ppid-ink: #0b1220;
	--ppid-muted: #64748b;

	--ppid-card: rgba(255, 255, 255, 0.78);
	--ppid-stroke: rgba(255, 255, 255, 0.28);

	--ppid-shadow: 0 22px 60px rgba(2, 14, 40, 0.18);
	--ppid-shadow-soft: 0 14px 35px rgba(2, 14, 40, 0.14);

	--ppid-radius-xl: 22px;
	--ppid-radius-lg: 18px;
}

/* =========================
   HERO (fix tidak kepotong)
   ========================= */
.section-frame {
	padding-top: 0 !important;
}

.ppid-hero {
	position: relative;
	border-radius: 18px 18px 28px 28px !important; /* top kecil, bottom lebih besar */
	overflow: hidden;
	min-height: 520px;
	padding-bottom: 70px; /* ruang wave */
	background:
		radial-gradient(
			900px 420px at 15% 20%,
			rgba(255, 255, 255, 0.28),
			transparent 65%
		),
		radial-gradient(
			700px 360px at 75% 35%,
			rgba(255, 255, 255, 0.22),
			transparent 70%
		),
		linear-gradient(
			135deg,
			rgba(29, 78, 216, 0.92),
			rgba(56, 189, 248, 0.78) 55%,
			rgba(165, 243, 252, 0.55)
		);
}
.ppid-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(
			1200px 500px at 50% -10%,
			rgba(255, 255, 255, 0.25),
			transparent 60%
		),
		linear-gradient(
			180deg,
			rgba(0, 0, 0, 0.28),
			rgba(0, 0, 0, 0.05) 55%,
			rgba(255, 255, 255, 0)
		);
	pointer-events: none;
}
.ppid-hero .ppid-hero-inner {
	position: relative;
	z-index: 1;
}
.ppid-hero h1,
.ppid-hero .breadcrumb {
	text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.ppid-wave {
	color: #ffffff !important;
}
.ppid-hero .divider.ppid-wave {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	z-index: 2;
	color: #ffffff !important; /* nyatu dengan ppid-shell */
}

/* matikan efek angled bawaan template yg bikin garis aneh */
.ppid-shell.angled::before,
.ppid-shell.angled::after,
.wrapper.angled::before,
.wrapper.angled::after {
	display: none !important;
}

/* haluskan negative margin bawaan */
.mt-n19 {
	margin-top: -9rem !important;
}

/* =========================
   SECTION SHELL + CARD GLASS
   ========================= */

.ppid-card {
	border-radius: var(--ppid-radius-xl);
	background: var(--ppid-card);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.55);
	box-shadow: var(--ppid-shadow);
}

/* text hero */
.ppid-kicker {
	letter-spacing: 0.12em;
	color: rgba(255, 255, 255, 0.92);
	font-weight: 700;
	text-transform: uppercase;
	opacity: 0.95;
}
.ppid-lead {
	color: rgba(255, 255, 255, 0.95);
}

/* stat chips */
.ppid-stat {
	border-radius: 16px;
	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.35),
		rgba(255, 255, 255, 0.12)
	);
	border: 1px solid var(--ppid-stroke);
	box-shadow: var(--ppid-shadow-soft);
}

/* ====== KOMODITAS CARD ====== */
.commodity-card {
	position: relative;
	border-radius: 22px;
	overflow: hidden;
	min-height: 240px;
	background-image: var(--bg);
	background-size: cover;
	background-position: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	transform: translateY(0);
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.commodity-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.1) 0%,
		rgba(0, 0, 0, 0.75) 100%
	);
}

.commodity-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
}

.commodity-card__content {
	position: relative;
	z-index: 2;
	height: 100%;
	padding: 18px 18px 16px 18px;
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.commodity-card__title {
	font-weight: 700;
	letter-spacing: 0.2px;
	font-size: 1.05rem;
}

.commodity-card__subtitle {
	margin-top: 4px;
	opacity: 0.85;
	font-size: 0.85rem;
}

.commodity-card__price {
	font-weight: 800;
	font-size: 1.25rem;
	line-height: 1.2;
}

.commodity-card__unit {
	font-weight: 600;
	font-size: 0.85rem;
	opacity: 0.85;
}

.commodity-card__cta {
	margin-top: 10px;
	font-size: 0.9rem;
	font-weight: 600;
	opacity: 0.95;
}

/* ===== Panel Harga - Card Infografis ===== */
.ph-card {
	position: relative;
	background: linear-gradient(180deg, #fff7d6 0%, #f4edc3 100%);
	border-radius: 18px;
	padding: 14px;
	box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 0, 0, 0.04);
	overflow: hidden;
}

/* watermark background komoditas */
.ph-card::before {
	content: "";
	position: absolute;
	inset: -20px;
	background-image: var(--ph-bg);
	background-repeat: no-repeat;
	background-size: 170px;
	background-position: right -14px top 10px;
	opacity: 0.16;
	filter: saturate(1.1);
	pointer-events: none;
}

.ph-card__header,
.ph-card__bottom {
	position: relative;
	z-index: 2;
}

.ph-card__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 4px 12px 4px;
}

.ph-card__bottom {
	position: relative;
	z-index: 2;
}

.ph-card__thumb {
	width: 64px;
	height: 64px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
	flex: 0 0 64px;
}

.ph-card__thumb img {
	width: 52px;
	height: 52px;
	object-fit: contain;
}

.ph-card__title {
	font-weight: 800;
	font-size: 0.95rem;
	color: #4b3a00;
	line-height: 1.2;
}

.ph-card__subtitle {
	font-size: 0.85rem;
	color: rgba(75, 58, 0, 0.75);
	margin-top: 4px;
}

.ph-card__bottom {
	display: flex;
	gap: 10px;
}

.ph-box {
	border-radius: 14px;
	padding: 12px 12px 10px 12px;
	flex: 1;
	min-height: 86px;
	color: #fff;
	position: relative;
	overflow: hidden;
}

.ph-box__label {
	font-size: 0.78rem;
	font-weight: 700;
	opacity: 0.95;
	letter-spacing: 0.2px;
	margin-bottom: 6px;
}

.ph-box__value {
	font-size: 1.05rem;
	font-weight: 900;
	line-height: 1.1;
}

.ph-box__unit {
	font-size: 0.78rem;
	font-weight: 700;
	opacity: 0.9;
}

/* box kiri kuning, box kanan hijau */
.ph-box--yellow {
	background: linear-gradient(180deg, #ffcc4a 0%, #f6b51e 100%);
	color: #2d2200;
}

.ph-box--green {
	background: linear-gradient(180deg, #1f8a3f 0%, #146a2f 100%);
}

.ph-zona {
	margin: 0;
	padding-left: 18px;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.45;
}

/* bar info sumber/update */
.ph-livebar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	color: rgba(0, 0, 0, 0.65);
	font-size: 0.88rem;
}
.ph-livebar__dot {
	opacity: 0.5;
}
.ph-livebar b {
	color: rgba(0, 0, 0, 0.82);
}

.ph-zona li {
	opacity: 0.95;
}

.ph-detail-link {
	font-size: 0.78rem;
	font-weight: 800;
	color: rgba(255, 255, 255, 0.92);
	text-decoration: none;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
}
.ph-detail-link:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.24);
}

.ph-toolbar {
	display: flex;
	justify-content: flex-start;
}

.ph-toolbar__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: start;
	justify-content: flex-start;
}

.ph-select-wrap {
	min-width: 280px;
}

.ph-select-label {
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.2px;
	color: rgba(0, 0, 0, 0.68);
	margin: 0 0 6px 6px;
}

.ph-select.ph-select--lg {
	max-width: 360px;
	height: 46px;
	border-radius: 999px;
	padding: 0 44px 0 16px;
	font-weight: 800;
	color: rgba(11, 18, 32, 0.92);
	background-color: #ffffff;
	border: 1px solid rgba(29, 78, 216, 0.22);
	box-shadow: 0 12px 28px rgba(2, 14, 40, 0.1);
}

.ph-select.ph-select--lg:focus {
	border-color: rgba(29, 78, 216, 0.45);
	box-shadow: 0 14px 34px rgba(2, 14, 40, 0.16);
}

/* mobile */
@media (max-width: 575.98px) {
	.ph-toolbar__controls {
		justify-content: stretch;
	}
	.ph-select-wrap,
	.ph-select.ph-select--lg {
		width: 100%;
		max-width: 100%;
	}

	/* detail modal rows (mirip PIHPS: group/indent) */
	#phDetailModal .table tbody tr.ph-row--prov td {
		font-weight: 800;
		background: rgba(29, 78, 216, 0.06);
	}

	#phDetailModal .table tbody tr.ph-row--kab td {
		font-weight: 700;
	}

	#phDetailModal .table tbody tr.ph-row--pasar td:first-child {
		color: rgba(11, 18, 32, 0.72);
		font-weight: 600;
	}

	#phDetailModal .table thead th {
		white-space: nowrap;
		font-size: 0.85rem;
		color: rgba(11, 18, 32, 0.7);
	}

	#phDetailModal .table tbody td {
		white-space: nowrap;
	}

	#phDetailModal .table tbody tr.ph-row--all td {
		font-weight: 800;
		background: rgba(2, 14, 40, 0.04);
	}

	#phDetailModal .table tbody tr.ph-row--prov td {
		font-weight: 800;
		background: rgba(29, 78, 216, 0.06);
	}

	#phDetailModal .table tbody tr.ph-row--pasar td:first-child {
		color: rgba(11, 18, 32, 0.72);
		font-weight: 600;
	}

	/* ===== Modal Detail PIHPS (lebih profesional) ===== */
	#phDetailModal .modal-header {
		padding: 14px 16px;
	}

	#phDetailModal .modal-title {
		font-size: 1rem;
		line-height: 1.2;
	}

	#phDetailModal .modal-body {
		padding: 12px 12px 14px 12px;
	}

	/* table base */
	.ph-detail-table {
		font-size: 0.86rem;
		line-height: 1.25;
	}

	/* sticky header ketika scroll di modal */
	#phDetailModal .table-responsive {
		max-height: 62vh;
		overflow: auto;
		border-radius: 12px;
		border: 1px solid rgba(0, 0, 0, 0.08);
	}

	.ph-detail-table thead th {
		position: sticky;
		top: 0;
		z-index: 2;
		background: #f8fafc;
		color: rgba(11, 18, 32, 0.78);
		font-weight: 800;
		white-space: nowrap;
		padding: 10px 10px;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	}

	/* body cells */
	.ph-detail-table tbody td {
		white-space: nowrap;
		padding: 9px 10px;
		border-color: rgba(0, 0, 0, 0.06);
	}

	/* zebra halus + hover */
	.ph-detail-table tbody tr:nth-child(even) td {
		background: rgba(2, 14, 40, 0.02);
	}
	.ph-detail-table tbody tr:hover td {
		background: rgba(56, 189, 248, 0.08);
	}

	/* kolom pertama: biar enak dibaca */
	.ph-detail-table tbody td:first-child,
	.ph-detail-table thead th:first-child {
		min-width: 260px;
		max-width: 420px;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* angka rata kanan */
	.ph-detail-table thead th:not(:first-child),
	.ph-detail-table tbody td:not(:first-child) {
		text-align: right;
	}

	/* highlight struktur */
	.ph-detail-table tbody tr.ph-row--all td {
		font-weight: 900;
		background: rgba(2, 14, 40, 0.05) !important;
	}
	.ph-detail-table tbody tr.ph-row--prov td {
		font-weight: 900;
		background: rgba(29, 78, 216, 0.08) !important;
	}
	.ph-detail-table tbody tr.ph-row--pasar td:first-child {
		color: rgba(11, 18, 32, 0.7);
		font-weight: 650;
	}

	/* ===== Modal Detail Premium ===== */
	#phDetailModal .modal-header {
		padding: 14px 16px;
	}
	#phDetailModal .modal-body {
		padding: 12px 12px 14px 12px;
	}

	/* toolbar */
	.ph-detail-tools {
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
		align-items: center;
		margin-bottom: 10px;
	}
	.ph-detail-search {
		min-width: 280px;
		max-width: 420px;
	}
	.ph-detail-select {
		width: 160px;
	}
	.ph-detail-btn {
		white-space: nowrap;
	}
	.ph-detail-stat {
		font-size: 0.86rem;
		color: rgba(11, 18, 32, 0.72);
		font-weight: 700;
	}

	/* wrapper tabel */
	.ph-detail-table-wrap {
		max-height: 65vh;
		overflow: auto;
		border-radius: 14px;
		border: 1px solid rgba(0, 0, 0, 0.08);
		background: #fff;
	}

	/* tabel base */
	.ph-detail-table {
		font-size: 0.86rem;
		line-height: 1.25;
		margin: 0;
	}
	.ph-detail-table thead th {
		position: sticky;
		top: 0;
		z-index: 4;
		background: #f8fafc;
		color: rgba(11, 18, 32, 0.78);
		font-weight: 800;
		white-space: nowrap;
		padding: 10px 10px;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	}

	/* sticky kolom pertama (Name) */
	.ph-detail-table thead th:first-child {
		left: 0;
		z-index: 6;
	}
	.ph-detail-table tbody td:first-child {
		position: sticky;
		left: 0;
		z-index: 3;
		background: #fff;
		box-shadow: 8px 0 14px rgba(2, 14, 40, 0.06);
	}

	/* cell */
	.ph-detail-table tbody td {
		white-space: nowrap;
		padding: 9px 10px;
		border-color: rgba(0, 0, 0, 0.06);
	}

	/* lebar kolom tanggal */
	.ph-detail-table thead th:not(:first-child),
	.ph-detail-table tbody td:not(:first-child) {
		min-width: 110px;
		text-align: right;
	}

	/* zebra halus + hover */
	.ph-detail-table tbody tr:nth-child(even) td {
		background: rgba(2, 14, 40, 0.02);
	}
	.ph-detail-table tbody tr:hover td {
		background: rgba(56, 189, 248, 0.08);
	}
	/* supaya sticky col tetap ikut zebra/hover */
	.ph-detail-table tbody tr:nth-child(even) td:first-child {
		background: #fbfdff;
	}
	.ph-detail-table tbody tr:hover td:first-child {
		background: #eef9ff;
	}

	/* highlight struktur */
	.ph-detail-table tbody tr.ph-row--all td {
		font-weight: 900;
		background: rgba(2, 14, 40, 0.05) !important;
	}
	.ph-detail-table tbody tr.ph-row--prov td {
		font-weight: 900;
		background: rgba(29, 78, 216, 0.08) !important;
	}
	.ph-detail-table tbody tr.ph-row--pasar td:first-child {
		color: rgba(11, 18, 32, 0.7);
		font-weight: 650;
	}

	/* highlight kolom tanggal terbaru */
	.ph-detail-table thead th.ph-col-latest,
	.ph-detail-table tbody td.ph-col-latest {
		background: rgba(56, 189, 248, 0.12) !important;
		font-weight: 900;
	}

	/* mobile */
	@media (max-width: 575.98px) {
		.ph-detail-search {
			min-width: 100%;
			max-width: 100%;
		}
		.ph-detail-select {
			width: 100%;
		}
		.ph-detail-btn {
			width: 100%;
		}
		.ph-detail-stat {
			width: 100%;
			margin-left: 0 !important;
		}
	}

	/* ===== Loading Overlay (Ringkas) ===== */
	.ph-grid-wrap {
		position: relative;
	}

	.ph-loading-overlay {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background: rgba(255, 255, 255, 0.72);
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
		border-radius: 16px;
		z-index: 10;
	}

	.ph-loading-card {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 14px 16px;
		border-radius: 14px;
		background: rgba(255, 255, 255, 0.92);
		border: 1px solid rgba(0, 0, 0, 0.08);
		box-shadow: 0 18px 50px rgba(2, 14, 40, 0.14);
	}

	.ph-loading-text {
		line-height: 1.15;
	}

	.ph-loading-title {
		font-weight: 900;
		font-size: 0.95rem;
		color: rgba(11, 18, 32, 0.88);
	}

	.ph-loading-sub {
		margin-top: 2px;
		font-weight: 700;
		font-size: 0.8rem;
		color: rgba(11, 18, 32, 0.55);
	}

	/* efek "dim" saat loading */
	.ph-grid-wrap.is-loading #phGrid {
		opacity: 0.45;
		filter: saturate(0.9);
		pointer-events: none;
	}
}
