/* ==========================================================================
   Pengadaan Barang dan Jasa — Frontend Styles
   ========================================================================== */

.pbj-block {
	--pbj-blue: #0B4C8C;
	--pbj-blueDark: #062F52;
	--pbj-sky: #1E9DE3;
	--pbj-gold: #E4A93D;
	--pbj-teal: #16794F;
	--pbj-ink: #10243B;
	--pbj-muted: #5D7285;
	--pbj-line: #E1EAF2;
	--pbj-bg: #F5F9FC;

	font-family: 'Inter', 'Segoe UI', sans-serif;
	color: var(--pbj-ink);
}

.pbj-block *, .pbj-block *::before, .pbj-block *::after { box-sizing: border-box; }

/* ---------------------------- Filter tahun ---------------------------- */
.pbj-year-filter {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 24px;
}
.pbj-year-filter label { font-weight: 600; font-size: 13.5px; color: var(--pbj-muted); }
.pbj-year-select {
	padding: 9px 32px 9px 14px;
	border-radius: 999px;
	border: 1.5px solid var(--pbj-line);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--pbj-blueDark);
	background: #fff;
	cursor: pointer;
}
.pbj-year-select:focus { outline: none; border-color: var(--pbj-sky); box-shadow: 0 0 0 4px rgba(30,157,227,.15); }

.pbj-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: var(--pbj-muted);
	background: var(--pbj-bg);
	border-radius: 14px;
	font-size: 14px;
}

.pbj-block.is-loading .pbj-sections { opacity: .5; pointer-events: none; transition: opacity .2s ease; }

/* ---------------------------- Section ---------------------------- */
.pbj-section { margin-bottom: 34px; }

.pbj-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 17px;
	color: var(--pbj-blueDark);
	margin: 0 0 16px;
}

.pbj-section-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pbj-section-dot.is-selesai { background: var(--pbj-teal); }
.pbj-section-dot.is-belum { background: var(--pbj-gold); }

.pbj-paket-list { display: flex; flex-direction: column; gap: 12px; }

/* ---------------------------- Paket Card ---------------------------- */
.pbj-paket-card {
	background: #fff;
	border: 1px solid var(--pbj-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 6px 18px -14px rgba(11,76,140,.3);
}

.pbj-paket-header {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}

.pbj-paket-rank {
	flex-shrink: 0;
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 13px;
	color: var(--pbj-sky);
	background: rgba(30,157,227,.1);
	border-radius: 8px;
	padding: 4px 8px;
}

.pbj-paket-info { flex: 1; min-width: 0; }

.pbj-paket-nama {
	display: block;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 14.5px;
	color: var(--pbj-ink);
	margin-bottom: 6px;
}

.pbj-paket-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.pbj-paket-nilai {
	font-weight: 700;
	font-size: 14px;
	color: var(--pbj-blueDark);
}

.pbj-status-badge {
	font-size: 11.5px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 999px;
}
.pbj-status-badge.is-selesai { background: rgba(22,121,79,.12); color: var(--pbj-teal); }
.pbj-status-badge.is-belum { background: rgba(228,169,61,.15); color: #a8760f; }

.pbj-doc-count {
	font-size: 11.5px;
	color: var(--pbj-muted);
	font-weight: 500;
}

.pbj-chevron {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	color: var(--pbj-muted);
	transition: transform .2s ease;
}
.pbj-paket-header[aria-expanded="true"] .pbj-chevron { transform: rotate(180deg); }

.pbj-paket-panel {
	max-height: 0;
	overflow: hidden;
	transition: max-height .3s ease;
}
.pbj-paket-panel.is-open { max-height: 600px; }

.pbj-doc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
	padding: 4px 18px 18px;
	border-top: 1px solid var(--pbj-line);
	margin-top: 4px;
	padding-top: 14px;
}

.pbj-doc-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 12.5px;
	font-weight: 600;
	text-align: left;
	font-family: inherit;
	line-height: 1.35;
}

.pbj-doc-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.pbj-doc-btn.is-available {
	background: var(--pbj-bg);
	border: 1px solid var(--pbj-line);
	color: var(--pbj-blueDark);
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
.pbj-doc-btn.is-available:hover { background: rgba(30,157,227,.1); border-color: var(--pbj-sky); }

.pbj-doc-btn.is-unavailable {
	background: #fafafa;
	border: 1px dashed var(--pbj-line);
	color: #a2adb8;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	cursor: default;
}
.pbj-doc-btn.is-unavailable small { font-weight: 400; font-size: 11px; margin-left: 28px; }

/* ---------------------------- Modal ---------------------------- */
.pbj-modal { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; padding: 20px; }
.pbj-modal.is-open { display: flex; }
.pbj-modal-overlay { position: absolute; inset: 0; background: rgba(6,47,82,.72); backdrop-filter: blur(2px); }

.pbj-modal-panel {
	position: relative; z-index: 1; width: 100%; max-width: 980px; height: 92vh;
	background: #fff; border-radius: 16px; overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
	animation: pbj-modal-in .25s ease;
}
@keyframes pbj-modal-in { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.pbj-modal-header {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 18px; background: linear-gradient(135deg, #0B4C8C, #062F52); color: #fff; flex-shrink: 0;
}
.pbj-modal-title { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbj-modal-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.pbj-modal-newtab { font-size: 12.5px; color: rgba(255,255,255,.85); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.4); white-space: nowrap; }
.pbj-modal-newtab:hover { color: #fff; }
.pbj-modal-close {
	background: rgba(255,255,255,.12); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%;
	font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pbj-modal-close:hover { background: rgba(255,255,255,.24); }
.pbj-modal-body { flex: 1; background: #525659; }
.pbj-modal-body iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 640px) {
	.pbj-modal { padding: 0; }
	.pbj-modal-panel { max-width: 100%; height: 100vh; border-radius: 0; }
	.pbj-modal-newtab { display: none; }
	.pbj-doc-grid { grid-template-columns: 1fr; }
	.pbj-paket-header { align-items: flex-start; }
}
