/* ── Arsip Dokumen ── */

.archive-section {
	max-width: 1240px;
	width: 100%;
	box-sizing: border-box;
	margin: 0 auto;
	padding: 0 20px 40px;
}

.archive-page-title {
	font-size: 24px;
	font-weight: 700;
	color: #0a1628;
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid #0a1628;
}

.archive-docs *,
.archive-docs *::before,
.archive-docs *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.archive-docs {
	--border: #d9d9d9;
	--header: #f5f5f5;
	--bg: #ffffff;
	--text: #222;
	--muted: #666;
	--ai: #dbeafe;
	--inis: #dcfce7;
	--inbs: #fef3c7;
	--hsin: #fce7f3;
	--pkbm: #ede9fe;

	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 13px;
}

.archive-docs .app {
	display: flex;
	flex-direction: column;
}

.archive-docs .toolbar {
	padding: 8px;
	border-bottom: 1px solid var(--border);
	background: #fff;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.archive-docs .toolbar input,
.archive-docs .toolbar select {
	padding: 6px 8px;
	border: 1.5px solid #d0d0d0;
	border-radius: 8px;
	font-size: 13px;
	min-height: 34px;
	transition: border-color 0.2s;
}

.archive-docs .toolbar input:focus,
.archive-docs .toolbar select:focus {
	border-color: #0a1628;
	outline: none;
}

.archive-docs .toolbar input {
	flex: 1;
	min-width: 180px;
}

.archive-docs .table-scroll-wrap {
	overflow-x: auto;
	background:
		linear-gradient(to right, #fff 30%, transparent) left center,
		linear-gradient(to left, #fff 30%, transparent) right center,
		linear-gradient(to right, rgba(0,0,0,.08), transparent) left center,
		linear-gradient(to left, rgba(0,0,0,.08), transparent) right center;
	background-repeat: no-repeat;
	background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
	background-attachment: local, local, scroll, scroll;
}

.archive-docs .tbl-common {
	border-collapse: separate;
	border-spacing: 0;
	min-width: 1200px;
	width: max-content;
	background: #fff;
}

.archive-docs thead th {
	background: var(--header);
	font-weight: 600;
}

.archive-docs th,
.archive-docs td {
	border-right: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	padding: 6px 8px;
	text-align: left;
	vertical-align: top;
	white-space: nowrap;
}

.archive-docs tbody td {
	background: #fff;
}

.archive-docs th:nth-child(1),
.archive-docs td:nth-child(1) {
	min-width: 50px;
	max-width: 50px;
}

.archive-docs th:nth-child(2),
.archive-docs td:nth-child(2) {
	min-width: 90px;
	max-width: 90px;
}

.archive-docs th:nth-child(3),
.archive-docs td:nth-child(3) {
	min-width: 240px;
	max-width: 240px;
}

.archive-docs td.title-cell {
	min-width: 420px;
	max-width: 420px;
	white-space: normal;
	line-height: 1.4;
}

.archive-docs th:nth-child(4) {
	min-width: 420px;
	max-width: 420px;
}

.archive-docs th:nth-child(5),
.archive-docs td:nth-child(5) {
	min-width: 80px;
	max-width: 80px;
}

.archive-docs th:nth-child(6),
.archive-docs td:nth-child(6) {
	min-width: 180px;
	max-width: 180px;
}

.archive-docs th:nth-child(7),
.archive-docs td:nth-child(7) {
	min-width: 140px;
	max-width: 140px;
}

.archive-docs .doc-link {
	color: #0f52ba;
	text-decoration: none;
	font-weight: 500;
}

.archive-docs .doc-link:hover {
	text-decoration: underline;
}

.archive-docs .disabled-title {
	color: var(--muted);
}

.archive-docs .dl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 8px;
	border-radius: 4px;
	background: #ef4444;
	color: #fff;
	text-decoration: none;
	font-size: 11px;
	font-weight: bold;
}

.archive-docs .pdf-btn {
	background: #ef4444;
}

.archive-docs .doc-btn {
	background: #1d46ff;
}

.archive-docs .user-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-width: 200px;
}

.archive-docs .tag {
	padding: 2px 6px;
	border-radius: 999px;
	font-size: 10px;
	line-height: 1.5;
	font-weight: 600;
}

.archive-docs .AI { background: var(--ai); }
.archive-docs .INIS { background: var(--inis); }
.archive-docs .INBS { background: var(--inbs); }
.archive-docs .HSIN { background: var(--hsin); }
.archive-docs .PKBM { background: var(--pkbm); }

.archive-docs .loading {
	padding: 24px;
	text-align: center;
	color: var(--muted);
}

.archive-docs .status-cell {
	white-space: normal;
	line-height: 1.4;
}

.archive-docs .empty-state {
	padding: 60px 20px;
	text-align: center;
	font-size: 15px;
	color: #8c8c8c;
}

@media (max-width: 768px) {
	.archive-section {
		padding: 0 12px 24px;
	}

	.archive-page-title {
		font-size: 20px;
		margin-bottom: 16px;
		padding-bottom: 10px;
	}

	.archive-docs {
		font-size: 12px;
	}

	.archive-docs .toolbar {
		gap: 4px;
		padding: 6px;
		flex-direction: column;
	}

	.archive-docs .toolbar input,
	.archive-docs .toolbar select {
		font-size: 12px;
		min-height: 32px;
		width: 100%;
		min-width: 0;
	}

	.archive-docs .table-scroll-wrap {
		overflow-x: visible;
		background: none;
	}

	.archive-docs thead { display: none; }

	.archive-docs .tbl-common {
		display: block;
		min-width: 0;
		width: 100%;
	}

	.archive-docs tbody { display: block; }

	.archive-docs tbody tr {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"kategori no"
			"judul judul"
			"dokumen dokumen"
			"status status"
			"link user";
		gap: 4px 8px;
		padding: 14px;
		margin-bottom: 10px;
		background: #fff;
		border: 1px solid var(--border);
		border-radius: 10px;
		box-shadow: 0 1px 4px rgba(0,0,0,0.06);
	}

	.archive-docs tbody td {
		display: block;
		border: none;
		padding: 2px 0;
		white-space: normal;
		min-width: 0 !important;
		max-width: none !important;
		background: none;
	}

	.archive-docs td:nth-child(1) {
		grid-area: no;
		text-align: right;
		color: var(--muted);
		font-size: 11px;
	}

	.archive-docs td:nth-child(2) {
		grid-area: kategori;
		font-weight: 600;
		color: var(--muted);
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.5px;
	}

	.archive-docs td:nth-child(3) {
		grid-area: dokumen;
		color: var(--muted);
	}

	.archive-docs td.title-cell,
	.archive-docs td:nth-child(4) {
		grid-area: judul;
		font-size: 14px;
		font-weight: 600;
		padding: 4px 0;
		min-width: 0 !important;
		max-width: none !important;
	}

	.archive-docs td:nth-child(5) {
		grid-area: link;
		display: flex;
		align-items: center;
		gap: 6px;
		padding-top: 6px;
	}

	.archive-docs td:nth-child(6) {
		grid-area: status;
	}

	.archive-docs td:nth-child(7) {
		grid-area: user;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding-top: 6px;
	}

	.archive-docs .user-tags {
		max-width: 100%;
		justify-content: flex-end;
	}

	.archive-docs tbody td[colspan] {
		grid-column: 1 / -1;
		text-align: center;
		padding: 24px;
	}
}

@media (max-width: 480px) {
	.archive-page-title {
		font-size: 18px;
	}

	.archive-docs .toolbar input,
	.archive-docs .toolbar select {
		font-size: 12px;
		min-height: 32px;
		padding: 4px 6px;
	}

	.archive-docs tbody tr {
		padding: 10px;
		gap: 2px 6px;
	}

	.archive-docs td.title-cell,
	.archive-docs td:nth-child(4) {
		font-size: 13px;
	}

	.archive-docs .dl-btn {
		font-size: 10px;
		padding: 5px 8px;
	}

	.archive-docs .tag {
		font-size: 10px;
		padding: 1px 5px;
	}
}
