:root {
	--pt-primary: #1F3A8A;
	--pt-gray-50: #F9FAFB;
	--pt-gray-100: #F3F4F6;
	--pt-gray-200: #E5E7EB;
	--pt-gray-300: #D1D5DB;
	--pt-gray-500: #6B7280;
	--pt-gray-700: #374151;
	--pt-gray-800: #1F2937;
	--pt-border: #E5E7EB;
	--pt-radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif; background: #fff; color: var(--pt-gray-800); }

/* ═══ PAGE WRAPPER ═══ */
.pt-page { display: flex; flex-direction: column; min-height: 100vh; }

/* ═══ HEADER ═══ */
.pt-header { background: #fff; border-bottom: 1px solid var(--pt-border); padding: 18px 0; }
.pt-header-inner { margin: 0; padding-left: 28px; display: flex; align-items: center; gap: 14px; width: 100%; }
.pt-header-title { font-size: 26px; font-weight: 700; color: var(--pt-gray-800); }

/* ═══ BODY ═══ */
.pt-body { flex: 1; width: 100%; padding: 24px 0 32px; }
.pt-body-inner { margin: 0; padding: 0 28px; }

/* Search Card */
.pt-search-card { background: #fff; border-radius: var(--pt-radius); padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 24px; display: flex; gap: 12px; align-items: center; border: 1px solid var(--pt-border); }
.pt-search-group { flex: 1; display: flex; flex-direction: column; }
.pt-search-label { font-size: 14px; font-weight: 500; color: var(--pt-gray-500); margin-bottom: 6px; }
.pt-search-row { display: flex; gap: 10px; }
.pt-search-input { flex: 1; padding: 10px 14px; border: 1px solid var(--pt-border); border-radius: 6px; font-size: 14px; outline: none; color: var(--pt-gray-700); background: #fff; transition: border-color 0.2s; }
.pt-search-input:focus { border-color: var(--pt-primary); box-shadow: 0 0 0 2px rgba(31,58,138,0.1); }
.pt-search-btn { height: 40px; padding: 0 24px; background: var(--pt-primary); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.pt-search-btn:hover { background: #1e40af; }
.pt-search-btn:disabled { background: #93a3cf; cursor: not-allowed; }

/* Table */
.pt-table-wrapper { background: #fff; border-radius: var(--pt-radius); border: 1px solid var(--pt-border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow-x: auto; margin-bottom: 24px; }
.pt-table-wrapper::-webkit-scrollbar { height: 6px; }
.pt-table-wrapper::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.pt-table-wrapper::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
.pt-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.pt-table th { background: var(--pt-gray-50); color: var(--pt-gray-500); font-weight: 500; font-size: 12px; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--pt-border); }
.pt-table td { padding: 16px; border-bottom: 1px solid var(--pt-border); vertical-align: top; font-size: 13px; }
.pt-table tbody tr:hover { background: var(--pt-gray-50); }
.pt-table tbody tr.pt-clickable { cursor: pointer; }

/* Box Cell */
.pt-box-cell { display: flex; align-items: flex-start; }
.pt-box-icon { color: #9ca3af; font-size: 18px; margin-right: 12px; margin-top: 2px; }
.pt-box-name { font-weight: 600; color: var(--pt-gray-800); margin-bottom: 4px; }
.pt-box-meta { font-size: 11px; color: var(--pt-gray-500); }

/* Badges */
.pt-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pt-badge.delivered { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.pt-badge.on-vehicle { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.pt-badge.arrived-at-jdt { background: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }
.pt-badge.pending-pick-up { background: #F3F4F6; color: #4B5563; border: 1px solid #D1D5DB; }

/* Timeline */
.pt-timeline-row { display: none; background: #FAFAFA; }
.pt-timeline-row.open { display: table-row; }
.pt-timeline-container { padding: 20px 40px; }

.pt-timeline { position: relative; padding-left: 20px; }
.pt-timeline::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 0; width: 2px; background: var(--pt-gray-200); }

.pt-timeline-item { position: relative; margin-bottom: 24px; display: grid; grid-template-columns: 120px 1fr 100px; gap: 20px; align-items: flex-start; }
.pt-timeline-item:last-child { margin-bottom: 0; }

.pt-timeline-item::before { content: ''; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--pt-primary); z-index: 1; }
.pt-timeline-item.completed::before { background: var(--pt-primary); }

.pt-time-info { font-size: 12px; color: var(--pt-gray-500); line-height: 1.4; }
.pt-time-info strong { display: block; color: var(--pt-gray-800); }

.pt-event-info { display: flex; gap: 12px; }
.pt-event-icon { font-size: 16px; color: var(--pt-primary); margin-top: 2px; width: 20px; text-align: center; }
.pt-event-details h4 { font-size: 13px; font-weight: 500; color: var(--pt-gray-800); margin: 0 0 2px; }
.pt-event-details p { font-size: 12px; color: var(--pt-gray-500); margin: 0; }

.pt-pic-info { font-size: 12px; color: var(--pt-gray-500); text-align: right; }

/* Info Card */
.pt-info-card { background: #fff; border-radius: var(--pt-radius); border: 1px solid var(--pt-border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); padding: 20px 24px; }
.pt-info-content h3 { font-size: 14px; color: var(--pt-gray-800); margin: 0 0 6px; }
.pt-info-content h3 .fa { color: #9ca3af; margin-right: 8px; }
.pt-info-content ul { margin: 0; padding: 0 0 0 18px; font-size: 13px; color: var(--pt-gray-500); }
.pt-info-content li { margin-bottom: 3px; }

/* Messages */
.pt-error { background: #FEF2F2; color: #DC2626; padding: 12px 18px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; border: 1px solid #FECACA; }
.pt-empty { text-align: center; padding: 32px; color: var(--pt-gray-500); font-size: 14px; }

/* Detail label — hidden on desktop, shown on mobile */
.pt-detail-label { display: none; }

/* Skeleton */
@keyframes pt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ═══ FOOTER ═══ */
.pt-footer { background: #fff; border-top: 1px solid var(--pt-border); padding: 20px 28px; text-align: center; font-size: 14px; color: var(--pt-gray-500); }

/* ═══ MOBILE (≤768px) ═══ */
@media (max-width: 768px) {
	/* Header */
	.pt-header { padding: 12px 0; }
	.pt-header-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; padding-left: 16px; gap: 10px; }
	.pt-header-title { font-size: 16px; }
	.pt-header img { height: 36px !important; }

	/* Body */
	.pt-body { padding: 16px 0 24px; }
	.pt-body-inner { padding: 0 12px; }

	/* Search Card */
	.pt-search-card { padding: 12px 14px; flex-direction: column; }
	.pt-search-row { flex-direction: column; }
	.pt-search-btn { width: 100%; }
	.pt-search-label { font-size: 13px; }

	/* Table → Card Layout */
	.pt-table-wrapper { overflow-x: visible; border: none; box-shadow: none; background: transparent; }
	.pt-table { min-width: 0; }
	.pt-table thead { display: none; }
	.pt-table tbody tr { display: block; margin-bottom: 12px; border: 1px solid var(--pt-border); border-radius: var(--pt-radius); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
	.pt-table tbody tr.pt-clickable { cursor: pointer; position: relative; }
	.pt-table tbody tr.pt-timeline-row { display: none; margin-top: -8px; border-top: none; border-radius: 0 0 var(--pt-radius) var(--pt-radius); }
	.pt-table tbody tr.pt-timeline-row.open { display: block; }
	.pt-table td { display: grid; grid-template-columns: 100px 1fr; align-items: start; padding: 10px 12px; border-bottom: 1px solid var(--pt-gray-100); font-size: 12px; text-align: left; }
	.pt-table td:last-child { border-bottom: none; }
	.pt-table td::before { content: attr(data-label) ":"; font-weight: 500; color: var(--pt-gray-500); font-size: 11px; text-transform: uppercase; }
	.pt-table td:last-child::before { content: none; }
	.pt-table td:last-child { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 12px; background: var(--pt-gray-50); border-radius: 0 0 var(--pt-radius) var(--pt-radius); cursor: pointer; }
	.pt-table td:last-child::after { content: none; }
	.pt-detail-label { display: inline; font-size: 11px; color: var(--pt-primary); font-weight: 500; }
	.pt-chevron { font-size: 10px; color: var(--pt-primary); }

	/* Badges stay inline */
	.pt-badge { font-size: 11px; }

	/* Box cell on mobile */
	.pt-box-cell { flex-direction: column; }
	.pt-box-icon { display: none; }
	.pt-box-meta { display: none; }

	/* Timeline */
	.pt-timeline-container { padding: 14px 16px; }
	.pt-timeline { padding-left: 16px; }
	.pt-timeline-item { grid-template-columns: auto 1fr; gap: 4px 4px; margin-bottom: 16px; }
	.pt-timeline-item::before { left: -21px; width: 10px; height: 10px; }
	.pt-time-info { grid-column: 1; grid-row: 1; display: flex; gap: 2px; align-items: baseline; }
	.pt-time-info strong { display: inline; }
	.pt-pic-info { grid-column: 2; grid-row: 1; text-align: left; font-size: 11px; white-space: nowrap; padding-left: 4px; }
	.pt-event-info { grid-column: 1 / -1; grid-row: 2; }

	/* Info Card */
	.pt-info-card { padding: 14px 16px; }
	.pt-info-content ul { font-size: 12px; padding-left: 16px; }

	/* Footer */
	.pt-footer { padding: 14px 12px; font-size: 11px; }
}

/* ═══ PAGINATION ═══ */
#pt-pagination {
	display: flex;
	justify-content: center;
}
.pt-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 0;
	margin-top: 4px;
}
.pt-pagination-info {
	font-size: 13px;
	color: var(--pt-gray-500);
}
.pt-pagination-buttons {
	display: flex;
	align-items: center;
	gap: 4px;
}
.pt-page-btn {
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	border: 1px solid var(--pt-border);
	border-radius: 6px;
	background: #fff;
	color: var(--pt-gray-700);
	font-size: 13px;
	cursor: pointer;
	transition: all 0.15s;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}
.pt-page-btn:hover:not(:disabled) {
	background: var(--pt-gray-50);
	border-color: var(--pt-primary);
	color: var(--pt-primary);
}
.pt-page-btn.active {
	background: var(--pt-primary);
	color: #fff;
	border-color: var(--pt-primary);
}
.pt-page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.pt-page-ellipsis {
	padding: 0 4px;
	color: var(--pt-gray-500);
	font-size: 13px;
}

/* Page size selector */
.pt-page-size {
	display: flex;
	align-items: center;
	gap: 6px;
}
.pt-page-size label {
	font-size: 12px;
	color: var(--pt-gray-500);
	margin-bottom: 0;
}
