	<div class="modal-header">
		<h4 class="modal-title">Tambah Pengiriman</h4>
		<button type="button" class="close" data-dismiss="modal" aria-label="Close">
			<span aria-hidden="true">×</span>
		</button>
	</div>
	<div class="modal-body" style="max-height: 85vh; overflow-y: auto;">
		<?php if (auth()->user()->role == 'customer'): ?>
			<style>
				/* Custom styling untuk customer */
				.item-card .card-body {
					padding: 20px;
					background: #fafafa;
				}

				.form-control:focus {
					border-color: #667eea;
					box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
				}

				.btn-remove-item:hover {
					transform: scale(1.05);
					transition: all 0.2s;
				}

				.shadow-sm {
					box-shadow: 0 .125rem .25rem rgba(102, 126, 234, 0.2) !important;
				}
			</style>
		<?php else: ?>
			<style>
				/* Styling untuk admin/kasir - HANYA untuk form create */

				/* Scope semua styling ke dalam form create */
				#formCreateOrder .item-card .card-header {
					background-color: #007bff !important;
					color: #ffffff !important;
					display: flex !important;
					justify-content: space-between !important;
					align-items: center !important;
					padding: 1rem;
					border-bottom: 1px solid rgba(0, 0, 0, .125);
				}

				#formCreateOrder .item-card .card-header h5 {
					margin-bottom: 0;
					color: #ffffff !important;
					font-size: 1.25rem;
					font-weight: 500;
					flex: 0 0 auto;
				}

				#formCreateOrder .item-card .card-header .fas,
				#formCreateOrder .item-card .card-header .fa {
					color: #ffffff !important;
				}

				/* Button hapus item styling - posisi di kanan */
				#formCreateOrder .item-card .card-header .btn-danger {
					background-color: #dc3545 !important;
					border-color: #dc3545 !important;
					color: #ffffff !important;
					padding: 0.375rem 0.75rem;
					font-size: 0.875rem;
					margin-left: auto !important;
					flex-shrink: 0;
				}

				#formCreateOrder .item-card .card-header .btn-danger:hover {
					background-color: #c82333;
					border-color: #bd2130;
				}

				#formCreateOrder .item-card .card-header .btn-danger .fas,
				#formCreateOrder .item-card .card-header .btn-danger .fa {
					color: #ffffff !important;
				}

				/* Override icon color untuk button di dalam form create */
				#formCreateOrder .btn .fas,
				#formCreateOrder .btn .fa {
					color: inherit !important;
				}

				#formCreateOrder .btn-primary .fas,
				#formCreateOrder .btn-primary .fa {
					color: #ffffff !important;
				}

				#formCreateOrder .btn-success .fas,
				#formCreateOrder .btn-success .fa {
					color: #ffffff !important;
				}

				/* Button Pilih Model - hijau konsisten */
				#formCreateOrder div[id^="modelSelectSection_"] .btn {
					background-color: #28a745 !important;
					border-color: #28a745 !important;
					color: #ffffff !important;
				}

				#formCreateOrder div[id^="modelSelectSection_"] .btn:hover {
					background-color: #218838 !important;
					border-color: #1e7e34 !important;
				}

				#formCreateOrder div[id^="modelSelectSection_"] .btn .fas,
				#formCreateOrder div[id^="modelSelectSection_"] .btn .fa {
					color: #ffffff !important;
				}
			</style>
		<?php endif; ?>
		<form method="POST" action="<?= base_url('pengiriman/store') ?>" enctype="multipart/form-data" id="formCreateOrder">

			<?= csrf_field() ?>

			<div class="card mb-3">
				<div class="card-header bg-info text-white">
					<h6 class="mb-0"><i class="fas fa-shopping-cart"></i> Informasi Pemesanan</h6>
				</div>
				<div class="card-body">

					<div class="row">

						<div class="col-md-6">
							<div class="form-group mb-0">
								<label class="form-label" for="label-kode_permintaan_custom">Pemesanan <span class="text-danger">*</span></label>
								<div class="input-group">
									<select name="kode_permintaan_custom" id="kode_permintaan_custom" class="form-control">
										<option value="">Pilih Pemesanan</option>
										<?php foreach ($pemesanan as $p): ?>
											<option value="<?= $p->kode_permintaan_custom ?>"><?= $p->no_order_custom ?> || <?= date('d-m-Y', strtotime($p->tanggal_order)) ?> Customer : <?= $p->nama ?></option>
										<?php endforeach; ?>
									</select>

								</div>
							</div>
						</div>
						<div class="col-md-6">
							<div class="form-group mb-0">
								<label class="form-label">Tanggal Pengiriman</label>
								<div class="input-group">
									<input type="datetime-local" class="form-control" name="tanggal_pengiriman" id="tanggal_pengiriman" value="<?= date('Y-m-d\TH:i') ?>" readonly required>
								</div>
							</div>
						</div>

					</div>

				</div>
			</div>

			<div class="modal-footer">
				<?php if (auth()->user()->role == 'customer'): ?>
					<button type="button" class="btn btn-lg" data-dismiss="modal" style="background: #e0e0e0; border: none; color: #111827 !important; border-radius: 20px; padding: 10px 30px;">
						<i class="fas fa-times" style="color: #111827;"></i> Batal
					</button>
					<button type="submit" class="btn btn-lg shadow" style="background: #e5e7eb; border: none; color: #111827 !important; border-radius: 20px; padding: 10px 30px;">
						<i class="fas fa-save" style="color: #111827;"></i> Simpan Pengiriman
					</button>
				<?php else: ?>
					<button type="button" class="btn btn-secondary" data-dismiss="modal">
						<i class="fas fa-times"></i> Batal
					</button>
					<button type="submit" class="btn btn-primary">
						<i class="fas fa-save"></i> Simpan Pengiriman
					</button>
				<?php endif; ?>
			</div>
		</form>
	</div>


	<script>

	</script>