/* ========================================
   Custom CSS for Outstanding PO Module
   ======================================== */

/* PO Header Labels */
.po-header-labels {
	position: sticky;
	top: 0;
	z-index: 10;
	padding: 15px 10px;
	background-color: #f8f9fa;
	border-radius: 5px;
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 10px;
	min-width: 1100px !important;
	width: 100% !important;
	min-height: 60px !important;
}

/* PO Header (Main Row) */
.po-header {
	background-color: #ffffff;
	padding: 15px;
	/* border: 1px solid #dee2e6;
	border-radius: 5px; */
	margin-bottom: 10px;
	cursor: default;
	transition: all 0.3s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	min-width: 1100px !important;
	width: 100% !important;
}

/* .po-header:hover {
	background-color: #f8f9fa;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
} */

/* Grid Layout for PO Rows */
.po-header-row {
	display: grid !important;
	grid-template-columns: 40px 120px 160px 2fr 90px 140px 110px 110px 130px !important;
	align-items: center !important;
	gap: 8px !important;
	min-width: 1100px !important;
	min-height: 50px !important;
	width: 100% !important;
}

/* PO Number Styling */
.po-number {
	color: #0d6efd;
	font-weight: 600;
	cursor: pointer;
}

.po-number:hover {
	text-decoration: underline;
}

/* Date Column */
.po-date {
	font-size: 1rem;
	line-height: 1.4;
}

/* Vendor Name */
.po-vendor {
	font-weight: 500;
}

/* Late Days Badge */
.po-late-days {
	color: #0d6efd;
	font-weight: 600;
	text-align: center;
}

/* Grand Total */
.po-grand-total {
	margin-left: 10px;
	text-align: center;
}

.po-progress-label {
	font-size: 0.75rem;
	color: #6c757d;
	margin-bottom: 2px;
}

.po-progress-value {
	text-align: center;
	font-size: 1rem;
}

/* Action Buttons Container */
.po-actions-container {
	display: flex;
	gap: 5px;
	justify-content: center !important;
	align-items: center !important;
}

.po-actions-container .btn {
	width: 40px;
	height: 40px;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle !important;
}

.po-actions-container .btn i,
.po-actions-container .btn .fas,
.po-actions-container .btn .far,
.po-actions-container .btn .la,
.po-actions-container .btn .las {
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle !important;
}

/* Detail Section (Expandable) */
.po-details {
	display: none;
	padding: 20px;
	background-color: #ffffff;
	/* border: 1px solid #dee2e6;
	border-top: none; */
	border-radius: 0 0 5px 5px;
	margin-top: -10px;
	margin-bottom: 10px;
}

.po-details.show {
	display: block;
}

/* Detail Table */
.detail-table {
	width: 100%;
	font-size: 0.85rem;
	border-collapse: collapse;
}

.detail-table th {
	background-color: #e9ecef;
	padding: 12px 12px;
	text-align: center;
	font-weight: 600;
	border: 1px solid #dee2e6;
	font-size: 0.8rem;
}

.detail-table td {
	padding: 14px 12px;
	border: 1px solid #dee2e6;
	vertical-align: middle;
}

.detail-table td.text-right {
	text-align: right;
}

/* Custom Progress Bar */
.progress-bar-custom {
	height: 20px;
	background-color: #e9ecef;
	border-radius: 10px;
	overflow: hidden;
	min-width: 80px;
}

.progress-fill {
	height: 100%;
	background-color: #198754;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 0.75rem;
	font-weight: 600;
	transition: width 0.3s;
	min-width: 40px;
}

/* Utility Classes */
.text-center {
	text-align: center;
}

.text-right {
	text-align: right;
}

.text-left {
	text-align: left;
}

/* PO List Container */
.po-list-wrapper {
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
	width: 100% !important;
}

.po-item {
	min-width: 1100px !important;
	width: 100% !important;
}

/* Responsive - Horizontal Scroll for Small Screens */
@media (max-width: 1200px) {
	.po-header-row {
		grid-template-columns: 40px 100px 140px 1fr 80px 120px 100px 100px 120px;
		gap: 6px;
	}
}

@media (max-width: 992px) {
	.po-header {
		overflow-x: visible;
	}

	.po-header-row {
		min-width: 1000px;
	}

	.po-header-labels {
		overflow-x: visible;
	}
}

/* ========================================
   Mobile Responsive Design (Card Layout)
   ======================================== */
@media (max-width: 768px) {
	/* Hide header labels on mobile */
	.po-header-labels {
		display: none !important;
	}

	/* Remove horizontal scroll */
	.po-list-wrapper {
		overflow-x: visible !important;
		width: 100%;
	}

	/* Card style for PO items */
	.po-item {
		min-width: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-bottom: 15px;
		overflow: hidden;
	}

	.po-header {
		min-width: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		padding: 15px;
		border: 1px solid #e0e0e0;
		border-radius: 8px;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
		overflow: hidden;
		box-sizing: border-box;
	}

	/* Change grid to vertical card layout */
	.po-header-row {
		display: block !important;
		min-width: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		min-height: auto !important;
	}

	.po-header-row > div {
		display: grid;
		grid-template-columns: 140px 1fr;
		gap: 10px;
		padding: 10px 0;
		border-bottom: 1px solid #f0f0f0;
		align-items: center;
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	.po-header-row > div:last-child {
		border-bottom: none;
		padding-bottom: 5px;
	}

	/* Add labels before content */
	.po-header-row > div:nth-child(1)::before {
		content: "No.";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(2)::before {
		content: "PO NUMBER";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(3)::before {
		content: "ORDER DATE - DEADLINE";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(4)::before {
		content: "VENDOR NAME";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(5)::before {
		content: "LATE DAYS";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(6)::before {
		content: "GRAND TOTAL";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(7)::before {
		content: "PROGRESS PENERIMAAN";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(8)::before {
		content: "PROGRESS PENGIRIMAN";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(9)::before {
		content: "AKSI";
		margin-top: 5px;
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.po-header-row > div:nth-child(9) {
		display: block !important;
		grid-template-columns: none !important;
		padding-top: 10px;
	}

	.po-header-row > div:nth-child(9)::before {
		display: block;
		margin-bottom: 8px;
	}

	/* Reset text alignment for mobile */
	.po-header-row > div {
		text-align: left !important;
	}

	.po-number {
		font-size: 0.95rem;
		word-break: break-all;
	}

	.po-date {
		font-size: 0.85rem;
		line-height: 1.5;
	}

	.po-vendor {
		font-size: 0.85rem;
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	.po-late-days,
	.po-grand-total,
	.po-progress-value {
		text-align: left !important;
		margin-left: 0;
		font-size: 0.9rem;
	}

	/* Action buttons on mobile */
	.po-actions-container {
		display: flex !important;
		justify-content: flex-end !important;
		gap: 8px;
	}

	.po-actions-container .btn {
		width: 33px;
		height: 33px;
		flex-shrink: 0;
	}

	/* Detail table responsive */
	.po-details {
		padding: 10px;
		overflow-x: auto;
		margin-left: -15px;
		margin-right: -15px;
		width: calc(100% + 30px);
	}

	.detail-table {
		font-size: 0.75rem;
		min-width: 800px;
	}

	.detail-table th,
	.detail-table td {
		padding: 8px 6px;
		font-size: 0.75rem;
	}

	/* Search and controls */
	.d-flex.justify-content-between {
		flex-direction: column;
		gap: 10px;
	}

	.d-flex.justify-content-between > div {
		width: 100%;
	}

	#searchInput {
		width: 100% !important;
		min-width: 100% !important;
		max-width: 100% !important;
	}

	/* Card body padding adjustment */
	.card-body {
		padding: 15px !important;
	}

	/* Export button container */
	.d-flex.justify-content-between.align-items-center.mb-4 {
		flex-direction: column;
		align-items: stretch !important;
		gap: 10px;
	}

	.d-flex.justify-content-between.align-items-center.mb-4 .btn {
		width: 100%;
	}

	.d-flex.justify-content-between.align-items-center.mb-4 .position-relative {
		width: 100%;
	}
}

/* Tablet Responsive (768px - 992px) */
@media (min-width: 769px) and (max-width: 992px) {
	.po-header-row > div:nth-child(9) .po-actions-container {
		justify-content: flex-end !important;
	}

	.po-actions-container {
		justify-content: flex-end !important;
	}
}

/* ========================================
   Custom CSS untuk PO Status Module
   ======================================== */

/* Upload Area Styling */
#upload_area_spb,
#upload_area_truck {
	border: 2px dashed #e4e6ef;
	transition: all 0.3s ease;
	min-height: 120px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

#upload_area_spb:hover,
#upload_area_truck:hover {
	border-color: #50cd89;
	background-color: #f1faff;
}

/* File Preview Container */
#file_preview_spb,
#file_preview_truck {
	max-height: 400px;
	overflow-y: auto;
}

#file_preview_spb::-webkit-scrollbar,
#file_preview_truck::-webkit-scrollbar {
	width: 6px;
}

#file_preview_spb::-webkit-scrollbar-thumb,
#file_preview_truck::-webkit-scrollbar-thumb {
	background-color: #50cd89;
	border-radius: 3px;
}

/* Jasa Card Styling */
.jasa-card {
	border: 1px solid #e4e6ef;
	border-radius: 0.475rem;
	padding: 1rem;
	margin-bottom: 1rem;
	background-color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: all 0.3s ease;
}

.jasa-card:hover {
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.jasa-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e4e6ef;
}

.jasa-card-header h5 {
	margin: 0;
	font-size: 1.1rem;
	color: #181c32;
}

/* Modal Detail Jasa */
#modal_detail_jasa .modal-dialog {
	margin: 1.75rem auto !important;
	max-width: 800px;
}

#modal_detail_jasa .modal-body {
	max-height: 60vh;
	overflow-y: auto;
}

#modal_detail_jasa .modal-body {
	max-height: 75vh;
	overflow-y: auto;
}

#modal_detail_jasa .modal-body::-webkit-scrollbar {
	background: #f1f1f1;
	width: 1px;
}

/* Tabel Tujuan Pengiriman */
#tbody_tujuan_pengiriman input[type="number"] {
	max-width: 100px;
}

/* Form Label Responsive */
.col-form-label {
	font-weight: 500;
	color: #3f4254;
}

.actions-button {
	text-align: end;
	margin-top: 1.5rem;
	margin-bottom: 1rem;
	display: flex;
	justify-content: flex-end;
	gap: 5px;
	margin-right: 20px;
}

/* ========================================
   Responsive Design untuk PO Status
   ======================================== */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
	.jasa-card {
		padding: 0.875rem;
	}

	.jasa-card-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.jasa-card-header > div:last-child {
		width: 100%;
		display: flex;
		justify-content: flex-end;
		gap: 0.5rem;
	}

	/* Form Layout Adjustment */
	.row.mb-5 {
		margin-bottom: 1.5rem !important;
	}

	.col-lg-3,
	.col-lg-9 {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
	/* Card Header */
	.card-header h3 {
		font-size: 0.95rem !important;
		line-height: 1.4;
	}

	.card-header .btn-sm {
		padding: 0.25rem 0.5rem;
	}

	.card-header .btn-sm i {
		font-size: 1.2rem !important;
	}

	/* Form Layout - Stack Vertically */
	.row.mb-5 {
		margin-bottom: 1.25rem !important;
	}

	.row.mb-5 label {
		margin-bottom: 0.5rem;
		font-size: 0.9rem;
	}

	.col-lg-3,
	.col-lg-9,
	.col-lg-7,
	.col-lg-2 {
		width: 100% !important;
		max-width: 100% !important;
		padding-left: 0;
		padding-right: 0;
		margin-top: 5px;
	}

	/* Upload Area Mobile */
	#upload_area_spb,
	#upload_area_truck {
		min-height: 100px;
		padding: 1rem;
	}

	#upload_area_spb i,
	#upload_area_truck i {
		font-size: 2.5rem !important;
	}

	#upload_area_spb .fs-5,
	#upload_area_truck .fs-5 {
		font-size: 0.95rem !important;
	}

	#upload_area_spb .fs-7,
	#upload_area_truck .fs-7 {
		font-size: 0.75rem !important;
	}

	/* File Preview Mobile */
	#file_preview_spb > div,
	#file_preview_truck > div {
		padding: 0.75rem !important;
	}

	#file_preview_spb h6,
	#file_preview_truck h6 {
		font-size: 0.85rem !important;
		max-width: 180px !important;
	}

	#file_preview_spb .btn-sm,
	#file_preview_truck .btn-sm {
		width: 32px !important;
		height: 32px !important;
		padding: 0 !important;
	}

	#file_preview_spb small,
	#file_preview_truck small {
		font-size: 0.7rem !important;
	}

	/* Jasa Card Mobile */
	.jasa-card {
		padding: 0.75rem;
		margin-bottom: 0.875rem;
	}

	.jasa-card-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.625rem;
		padding-bottom: 0.625rem;
	}

	.jasa-card-header h5 {
		font-size: 0.95rem;
	}

	.jasa-card-header > div:last-child {
		width: 100%;
		display: flex;
		justify-content: flex-start;
		gap: 0.5rem;
		flex-wrap: wrap;
	}

	.jasa-card-header .btn-sm {
		font-size: 0.8rem;
		padding: 0.375rem 0.625rem;
	}

	.jasa-card .row.mb-3 {
		margin-bottom: 0.75rem !important;
	}

	.jasa-card .col-md-4,
	.jasa-card .col-md-6 {
		margin-bottom: 0.75rem;
	}

	.jasa-card small {
		font-size: 0.75rem;
	}

	.jasa-card .fw-bold {
		font-size: 0.875rem;
	}

	/* Modal Mobile */
	#modal_detail_jasa .modal-dialog {
		margin: 0.5rem;
		padding: 1rem;
	}

	#modal_detail_jasa .modal-body {
		padding: 2rem;
		max-height: 70vh;
	}

	#modal_detail_jasa .row.mb-5 {
		margin-bottom: 1rem !important;
	}

	#modal_detail_jasa label {
		font-size: 0.85rem;
		margin-bottom: 0.375rem;
	}

	#modal_detail_jasa .form-control,
	#modal_detail_jasa .form-select {
		font-size: 0.875rem;
		padding: 0.5rem 0.75rem;
	}

	#modal_detail_jasa .btn {
		font-size: 0.875rem;
		padding: 0.5rem 1rem;
	}

	/* Tabel Spesifikasi Mobile */
	#modal_detail_jasa .table-responsive {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#modal_detail_jasa .table {
		font-size: 0.75rem;
		min-width: 500px;
	}

	#modal_detail_jasa .table th,
	#modal_detail_jasa .table td {
		padding: 0.5rem 0.375rem;
		font-size: 0.75rem;
	}

	/* Tujuan Pengiriman Mobile */
	#tbody_tujuan_pengiriman input[type="number"] {
		max-width: 80px;
		font-size: 0.8rem;
	}

	#tbody_tujuan_pengiriman .input-group-text {
		font-size: 0.75rem;
		padding: 0.375rem 0.5rem;
	}

	#tbody_tujuan_pengiriman .btn-sm {
		width: 28px !important;
		height: 28px !important;
	}

	/* Alert Mobile */
	.alert {
		padding: 0.75rem;
		font-size: 0.875rem;
	}

	.alert .btn-sm {
		font-size: 0.85rem;
		padding: 0.375rem 0.75rem;
	}

	/* Form Buttons Mobile */
	.d-flex.justify-content-end.gap-3 {
		flex-direction: column;
		gap: 0.625rem !important;
	}

	.d-flex.justify-content-end.gap-3 .btn {
		width: 100%;
	}

	/* Modal Footer Mobile */
	.modal-footer {
		justify-content: flex-end;
		flex-direction: row;
		gap: 0.5rem;
	}

	.modal-footer .btn {
		width: 100%;
		margin: 0 !important;
	}

	.actions-button {
		text-align: end;
		margin-top: 1.5rem;
		margin-bottom: 1rem;
		display: flex;
		justify-content: flex-end;
		gap: 5px;
		margin-right: 20px;
	}

	/* Textarea Mobile */
	textarea.form-control {
		font-size: 0.875rem;
		min-height: 80px;
	}

	/* Input Group Mobile */
	.input-group-text {
		font-size: 0.875rem;
	}

	/* Checkbox Mobile */
	.form-check {
		padding-left: 1.75rem;
	}

	.form-check-input {
		width: 1.125rem;
		height: 1.125rem;
	}

	.form-check-label {
		font-size: 0.85rem;
		line-height: 1.4;
	}

	/* Select Dropdown Mobile */
	.form-select {
		background-size: 16px 12px;
		padding-right: 2rem;
	}
}

.file-item-wrapper .d-flex {
	flex-wrap: wrap;
	justify-content: end;
	gap: 10px;
	margin-top: 5px;
}

.file-item-wrapper h6 {
	max-width: 300px !important;
}

/* Extra Small Mobile (max-width: 575px) */
@media (max-width: 575px) {
	.card-header h3 {
		font-size: 0.85rem !important;
	}

	.jasa-card-header h5 {
		font-size: 0.875rem;
	}

	.jasa-card .bg-light.p-2 {
		padding: 0.5rem !important;
	}

	#file_preview_spb h6,
	#file_preview_truck h6 {
		max-width: 140px !important;
		font-size: 0.8rem !important;
	}

	#modal_detail_jasa .modal-dialog {
		margin: 0.25rem;
	}

	#modal_detail_jasa .table {
		min-width: 450px;
	}
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
	#modal_detail_jasa .modal-body {
		max-height: 50vh;
	}

	.card-body {
		padding: 0.875rem !important;
	}
}

/* Print Styles */
@media print {
	.btn,
	.card-toolbar,
	.modal,
	.alert {
		display: none !important;
	}

	.jasa-card {
		page-break-inside: avoid;
		border: 1px solid #000;
	}

	.card-header {
		background-color: #f8f9fa !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}

/* ========================================
   History Card Styling for PO List Modal
   ======================================== */

/* History Card in Modal */
#itemHistoryModal .history-card {
	border: 1px solid #e4e6ef;
	border-radius: 0.475rem;
	padding: 1rem;
	background-color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#itemHistoryModal .history-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e4e6ef;
}

#itemHistoryModal .history-card-header h5 {
	margin: 0;
	font-size: 1.1rem;
	color: #181c32;
}

#itemHistoryModal .file-preview-item {
	max-width: 200px;
}

#itemHistoryModal .file-preview-item .fw-bold {
	word-break: break-all;
	max-width: 120px;
}

/* Modal positioning fix */
#itemHistoryModal .modal-dialog {
	margin: 1.75rem auto !important;
	max-width: 1140px;
	display: flex;
	align-items: center;
	min-height: calc(100vh - 3.5rem);
}

#itemHistoryModal .modal-dialog.modal-dialog-centered {
	display: flex;
	align-items: center;
	min-height: calc(100vh - 3.5rem);
}

/* Mobile responsive for history modal */
@media (max-width: 767px) {
	#itemHistoryModal .modal-dialog {
		margin: 0.5rem;
		padding: 1rem;
	}

	#itemHistoryModal .modal-body {
		padding: 1rem;
		max-height: 70vh;
	}

	#itemHistoryModal .history-card {
		padding: 0.75rem;
		margin-bottom: 0.875rem;
	}

	#itemHistoryModal .history-card-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.625rem;
		padding-bottom: 0.625rem;
	}

	#itemHistoryModal .history-card-header h5 {
		font-size: 0.95rem;
	}

	#itemHistoryModal .row.mb-3 {
		margin-bottom: 0.75rem !important;
	}

	#itemHistoryModal .col-md-3,
	#itemHistoryModal .col-md-6,
	#itemHistoryModal .col-md-12 {
		margin-bottom: 0.75rem;
	}

	#itemHistoryModal small {
		font-size: 0.75rem;
	}

	#itemHistoryModal .fw-bold {
		font-size: 0.875rem;
	}

	#itemHistoryModal .file-preview-item {
		max-width: 100%;
		width: 100%;
	}

	#itemHistoryModal .file-preview-item .d-flex {
		padding: 0.5rem !important;
	}

	#itemHistoryModal .file-preview-item .fw-bold {
		font-size: 0.75rem !important;
		max-width: 100px;
	}

	#itemHistoryModal .file-preview-item small {
		font-size: 0.7rem !important;
	}
}
/* ========================================
   Enhanced History Modal Styling
   ======================================== */

/* History Table Styling */
#itemHistoryModal .table {
	font-size: 0.875rem;
}

#itemHistoryModal .table th {
	background-color: #f8f9fa;
	font-weight: 600;
	color: #495057;
	border-color: #dee2e6;
	padding: 0.75rem 0.5rem;
	vertical-align: middle;
}

#itemHistoryModal .table td {
	padding: 0.75rem 0.5rem;
	vertical-align: middle;
	border-color: #dee2e6;
}

#itemHistoryModal .table-hover tbody tr:hover {
	background-color: #f8f9fa;
}

/* Delivery Detail Modal Styling */
.delivery-detail-content {
	padding: 0;
}

.delivery-detail-content .file-list {
	max-height: 300px;
	overflow-y: auto;
}

.delivery-detail-content .file-item {
	transition: all 0.2s ease;
	background-color: #f8f9fa;
}

.delivery-detail-content .file-item:hover {
	background-color: #e9ecef;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.delivery-detail-content .file-item .btn {
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.delivery-detail-content .file-item:hover .btn {
	opacity: 1;
}

/* Badge Styling */
.badge {
	font-size: 0.75rem;
	padding: 0.375rem 0.75rem;
}

/* Action Button Styling */
#itemHistoryModal .btn-outline-primary {
	border-color: #0d6efd;
	color: #0d6efd;
	padding: 0.25rem 0.5rem;
}

#itemHistoryModal .btn-outline-primary:hover {
	background-color: #0d6efd;
	border-color: #0d6efd;
	color: white;
}

/* Download Button Styling */
.btn-outline-success {
	border-color: #198754;
	color: #198754;
	padding: 0.25rem 0.5rem;
}

.btn-outline-success:hover {
	background-color: #198754;
	border-color: #198754;
	color: white;
}

/* Responsive Design for History Modal */
@media (max-width: 768px) {
	#itemHistoryModal .table-responsive {
		font-size: 0.75rem;
	}

	#itemHistoryModal .table th,
	#itemHistoryModal .table td {
		padding: 0.5rem 0.25rem;
	}

	.delivery-detail-content .row {
		margin: 0;
	}

	.delivery-detail-content .col-md-6 {
		padding: 0.5rem;
		margin-bottom: 1rem;
	}

	.delivery-detail-content .file-item {
		padding: 0.5rem !important;
	}

	.delivery-detail-content .file-item .fw-bold {
		font-size: 0.8rem !important;
	}

	#deliveryDetailModal .modal-dialog {
		margin: 0.5rem;
	}

	#deliveryDetailModal .modal-body {
		padding: 1rem;
	}

	#deliveryDetailModal .row.mb-4 .col-md-3,
	#deliveryDetailModal .row.mb-4 .col-md-12 {
		margin-bottom: 0.75rem;
	}
}

/* Table Scroll Styling */
.table-responsive::-webkit-scrollbar {
	height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
	background-color: #6c757d;
	border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-track {
	background-color: #f8f9fa;
}

/* File List Scroll Styling */
.file-list::-webkit-scrollbar {
	width: 6px;
}

.file-list::-webkit-scrollbar-thumb {
	background-color: #6c757d;
	border-radius: 3px;
}

.file-list::-webkit-scrollbar-track {
	background-color: #f8f9fa;
}
/* ========================================
   Bootstrap Native History Table Styling
   ======================================== */

/* Enhanced History Modal Styling */
#itemHistoryModal .table {
	font-size: 0.875rem;
	margin-bottom: 0;
}

#itemHistoryModal .table th {
	font-weight: 600;
	color: #495057;
	padding: 0.75rem 0.5rem;
	vertical-align: middle;
	border-color: #dee2e6;
}

#itemHistoryModal .table td {
	padding: 0.75rem 0.5rem;
	vertical-align: middle;
	border-color: #dee2e6;
}

#itemHistoryModal .table-hover tbody tr:hover {
	background-color: rgba(0, 0, 0, 0.075);
}

/* History Details Row Styling */
#itemHistoryModal .history-details td {
	padding: 0 !important;
	border: none !important;
}

#itemHistoryModal .history-details .bg-light {
	border-left: 4px solid #198754;
	margin: 0;
}

#itemHistoryModal .history-details .table-sm th {
	background-color: #f8f9fa;
	font-weight: 600;
	color: #495057;
	padding: 0.5rem;
	font-size: 0.8rem;
}

#itemHistoryModal .history-details .table-sm td {
	padding: 0.5rem;
	font-size: 0.85rem;
}

/* ZIP Download Button Styling */
#itemHistoryModal .btn-outline-success {
	border-color: #198754;
	color: #198754;
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
}

#itemHistoryModal .btn-outline-success:hover {
	background-color: #198754;
	border-color: #198754;
	color: white;
}

/* Toggle Button Styling */
#itemHistoryModal .btn-outline-primary {
	border-color: #0d6efd;
	color: #0d6efd;
	padding: 0.25rem 0.5rem;
}

#itemHistoryModal .btn-outline-primary:hover {
	background-color: #0d6efd;
	border-color: #0d6efd;
	color: white;
}

/* Bootstrap Table Success Header */
#itemHistoryModal .table-success th {
	background-color: #d1e7dd;
	border-color: #badbcc;
	color: #0f5132;
}

/* Responsive Design for New History Table */
@media (max-width: 768px) {
	#itemHistoryModal .table-responsive {
		font-size: 0.75rem;
	}

	#itemHistoryModal .table th,
	#itemHistoryModal .table td {
		padding: 0.5rem 0.25rem;
		font-size: 0.75rem;
	}

	#itemHistoryModal .btn-outline-success,
	#itemHistoryModal .btn-outline-primary {
		padding: 0.2rem 0.4rem;
		font-size: 0.7rem;
	}

	#itemHistoryModal .history-details .table-sm th,
	#itemHistoryModal .history-details .table-sm td {
		padding: 0.375rem 0.25rem;
		font-size: 0.75rem;
	}

	#itemHistoryModal .badge {
		font-size: 0.65rem;
		padding: 0.25rem 0.5rem;
	}
}
/* ========================================
   History Modal Layout (Similar to Parent PO)
   ======================================== */

/* History Header Labels */
.history-header-labels {
	position: sticky;
	top: 0;
	z-index: 10;
	padding: 15px 10px;
	background-color: #f8f9fa;
	border-radius: 5px;
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 10px;
	min-width: 1200px !important;
	width: 100% !important;
	min-height: 60px !important;
}

/* History Header (Main Row) */
.history-header {
	background-color: #ffffff;
	padding: 15px;
	margin-bottom: 10px;
	cursor: default;
	transition: all 0.3s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	min-width: 1200px !important;
	width: 100% !important;
}

/* Grid Layout for History Rows */
.history-header-row {
	display: grid !important;
	grid-template-columns: 100px 100px 120px 120px 100px 100px 100px 200px 2fr 80px !important;
	align-items: center !important;
	gap: 8px !important;
	min-width: 1300px !important;
	min-height: 50px !important;
	width: 100% !important;
}

/* History Elements Styling */
.history-date,
.history-spb,
.history-driver,
.history-plate,
.history-quantity,
.history-destination,
.history-notes {
	font-weight: 500;
}

.history-spb {
	color: #0d6efd;
}

.history-destination {
	font-size: 0.85rem;
	line-height: 1.6;
	color: #495057;
}

/* History Actions Container */
.history-actions-container {
	display: flex;
	gap: 5px;
	justify-content: center !important;
	align-items: center !important;
}

.history-actions-container .btn {
	width: 40px;
	height: 40px;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle !important;
}

.history-actions-container .btn i {
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle !important;
}

/* History Files Container */
.history-files .btn {
	width: 40px;
	height: 40px;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle !important;
}

.history-files .btn i {
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle !important;
}

/* History Detail Section (Expandable) */
.history-details {
	display: none;
	padding: 20px;
	background-color: #ffffff;
	border-radius: 0 0 5px 5px;
	margin-top: -10px;
	margin-bottom: 10px;
}

.history-details.show {
	display: block;
}

/* History Detail Table (Same as parent PO child table) */
.history-details .detail-table {
	width: auto;
	max-width: 800px;
	font-size: 0.95rem;
	border-collapse: collapse;
	margin: 0 auto;
}

.history-details .detail-table th {
	background-color: #e9ecef;
	padding: 14px 20px;
	text-align: center;
	font-weight: 600;
	border: 1px solid #dee2e6;
	font-size: 0.9rem;
	white-space: nowrap;
}

.history-details .detail-table td {
	padding: 16px 20px;
	border: 1px solid #dee2e6;
	vertical-align: middle;
	font-size: 0.95rem;
}

.history-details .detail-table td.text-center {
	text-align: center;
}

.history-details .detail-table td.text-right {
	text-align: right;
}

.history-details .detail-table td.fw-bold {
	font-weight: 600;
}

/* History List Container */
.history-list-wrapper {
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
	width: 100% !important;
}

.history-item {
	min-width: 1300px !important;
	width: 100% !important;
}

/* ========================================
   Responsive Design untuk History Modal
   ======================================== */

/* Tablet (768px - 1199px) */
@media (max-width: 1199px) {
	.history-header-row {
		grid-template-columns: 90px 90px 110px 110px 90px 90px 90px 180px 1fr 70px;
		gap: 6px;
	}
}

@media (max-width: 992px) {
	.history-header {
		overflow-x: visible;
	}

	.history-header-row {
		min-width: 1100px;
	}

	.history-header-labels {
		overflow-x: visible;
	}
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
	/* Hide header labels on mobile */
	.history-header-labels {
		display: none !important;
	}

	/* Remove horizontal scroll */
	.history-list-wrapper {
		overflow-x: visible !important;
		overflow-y: visible !important;
		width: 100%;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* Ensure modal body doesn't cut content */
	#itemHistoryModal .modal-body {
		padding: 15px !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
	}

	#history_list_container {
		width: 100% !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* Card style for History items */
	.history-item {
		min-width: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-bottom: 15px;
		margin-left: 0 !important;
		margin-right: 0 !important;
		overflow: visible;
	}

	.history-header {
		min-width: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		padding: 15px;
		margin: 0 !important;
		border: 1px solid #e0e0e0;
		border-radius: 8px;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
		overflow: visible;
		box-sizing: border-box;
		background-color: #ffffff;
	}

	/* Change grid to vertical card layout */
	.history-header-row {
		display: block !important;
		min-width: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		min-height: auto !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.history-header-row > div {
		display: grid;
		grid-template-columns: 140px 1fr;
		gap: 10px;
		padding: 10px 0;
		border-bottom: 1px solid #f0f0f0;
		align-items: flex-start;
		word-wrap: break-word;
		overflow-wrap: break-word;
		width: 100%;
		box-sizing: border-box;
	}

	.history-header-row > div:last-child {
		border-bottom: none;
		padding-bottom: 5px;
	}

	/* Add labels before content */
	.history-header-row > div:nth-child(1)::before {
		content: "PENGIRIMAN";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(2)::before {
		content: "TANGGAL";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(3)::before {
		content: "NO. SPB";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(4)::before {
		content: "NAMA SUPIR";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(5)::before {
		content: "PLAT NOMOR";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(6)::before {
		content: "JUMLAH KIRIM";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(7)::before {
		content: "STATUS";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(8)::before {
		content: "TUJUAN PENGIRIMAN";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(9)::before {
		content: "KETERANGAN";
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(10)::before {
		content: "BERKAS";
		margin-top: 5px;
		font-weight: 600;
		color: #6c757d;
		font-size: 0.85rem;
	}

	.history-header-row > div:nth-child(10) {
		display: block !important;
		grid-template-columns: none !important;
		padding-top: 10px;
	}

	.history-header-row > div:nth-child(10)::before {
		display: block;
		margin-bottom: 8px;
	}

	/* Reset text alignment for mobile */
	.history-header-row > div {
		text-align: left !important;
	}

	.history-date,
	.history-spb,
	.history-driver,
	.history-plate,
	.history-quantity,
	.history-destination,
	.history-notes {
		text-align: left !important;
		font-size: 0.9rem;
	}

	/* Action buttons on mobile */
	.history-actions-container,
	.history-files {
		display: flex !important;
		justify-content: flex-end !important;
		gap: 8px;
	}

	.history-actions-container .btn,
	.history-files .btn {
		width: 33px;
		height: 33px;
		flex-shrink: 0;
	}

	/* Detail section mobile */
	.history-details {
		padding: 10px;
		margin-left: -15px;
		margin-right: -15px;
		width: calc(100% + 30px);
	}
}

/* Extra Small Mobile (max-width: 575px) */
@media (max-width: 575px) {
	.history-header-row > div:nth-child(9) .btn,
	.history-header-row > div:nth-child(10) .btn {
		width: 30px;
		height: 30px;
	}
}
/* ========================================
   Modal Mobile Full Width Fix
   ======================================== */

@media (max-width: 767px) {
	/* Ensure modal is full width on mobile */
	#itemHistoryModal .modal-dialog {
		margin: 1rem !important;
		max-width: calc(100% - 1rem) !important;
		width: calc(100% - 1rem) !important;
	}

	#itemHistoryModal .modal-content {
		border-radius: 8px;
		overflow: hidden;
	}

	#itemHistoryModal .modal-body {
		padding: 10px !important;
		max-height: 70vh;
		overflow-y: auto;
		overflow-x: hidden;
	}

	/* Ensure history items don't overflow */
	.history-item {
		margin-bottom: 12px !important;
	}

	.history-header {
		padding: 12px !important;
		margin: 0 !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	/* Fix for action buttons container */
	.history-actions-container,
	.history-files {
		display: flex !important;
		justify-content: flex-start !important;
		gap: 8px;
		margin-top: 5px;
	}

	.history-header-row > div:nth-child(10) .history-files {
		justify-content: flex-start !important;
	}

	/* Ensure text content wraps properly */
	.history-destination,
	.history-notes {
		word-break: break-word;
		overflow-wrap: break-word;
		white-space: normal;
		line-height: 1.5;
	}
}

/* Extra small devices */
@media (max-width: 575px) {
	#itemHistoryModal .modal-dialog {
		margin: 0.25rem !important;
		max-width: calc(100% - 0.5rem) !important;
		width: calc(100% - 0.5rem) !important;
	}

	#itemHistoryModal .modal-body {
		padding: 8px !important;
	}

	.history-header {
		padding: 10px !important;
	}

	.history-header-row > div {
		padding: 8px 0;
		gap: 8px;
	}
}
