/* PNF Driver Dashboard — responsive, mobile-first, purple brand accent
   (Deduplicated: every selector that previously appeared twice — once in
   the original pass and once in the later "professional UI layer" patch —
   has been merged into a single rule using the cascade-final values.) */

:root {
	--pnf-purple: #690b78;
	--pnf-purple-dark: #42104f;
	--pnf-gold: #f3a712;
	--pnf-bg: #fff;
	--pnf-success: #1f9d55;
	--pnf-warn: #c77b00;
	--pnf-ink: #172033;
	--pnf-muted: #667085;
	--pnf-border: #e6eaf0;
	--pnf-surface: #ffffff;
}

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

/* ---- Shell wrappers ---- */
.pnf-driver-login-wrap {
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
	background: var(--pnf-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 5vw, 24px);
}

.pnf-dash-wrap {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	border: 1px solid #690b78;
	border-radius: 10px 10px 10px 10px;
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background: #f5f7fb;
	color: var(--pnf-ink);
	/* Force scrollability even if the theme wrapper sets overflow:hidden or a fixed height */
	height: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
}

/* ---- Login card ---- */
.pnf-driver-login-card {
	background: #fff;
	border-radius: 22px;
	padding: clamp(28px, 5vw, 44px);
	box-shadow: none;
	width: 100%;
	max-width: 430px;
	border: 1px solid var(--pnf-border);
	box-shadow: 0 3px 12px rgba(23,32,51,.045);
	
}
.pnf-driver-login-card h1 {
	color: var(--pnf-ink);
	margin: 0 0 4px;
	font-size: 25px;
	letter-spacing: -.5px;
	text-align: center;
}
.pnf-subtitle {
	text-align: center;
	color: var(--pnf-muted);
	margin: 0 0 30px;
	font-size: 14px;
}
.pnf-driver-login-card label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	margin: 14px 0 6px;
	color: var(--pnf-ink);
	letter-spacing: .02em;
	text-transform: uppercase;
}
.pnf-driver-login-card input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d7dce5;
	border-radius: 11px;
	font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
	background: #fbfcfe;
	color: var(--pnf-ink);
	transition: border-color .2s ease, box-shadow .2s ease;
}
.pnf-driver-login-card input:focus {
	border-color: var(--pnf-purple);
	box-shadow: 0 0 0 4px rgba(91,23,109,.10);
	outline: 0;
}
.pnf-driver-login-card button {
	width: 100%;
	margin-top: 22px;
	padding: 14px;
	background: var(--pnf-purple);
	color: #fff;
	border: none;
	border-radius: 11px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px; /* touch target */
	box-shadow: 0 5px 12px rgba(91,23,109,.16);
}
.pnf-driver-login-card button:active,
.pnf-driver-login-card button:hover { background: var(--pnf-purple-dark); color:#fff; }

.pnf-error {
	background: #fdecea;
	color: #b3261e;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	margin-bottom: 12px;
}

/* ---- Dashboard header ---- */
.pnf-dash-header {
	background: var(--pnf-purple);
	color: #fff;
	border: 1px solid #690b78;
	padding: 18px clamp(20px, 4vw, 34px);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	position: relative;
	top: 0;
	z-index: 10;
	box-shadow: 0 3px 16px rgba(23,32,51,.14);
	border-radius: 9px 9px 0px 0px;
}
.pnf-brand {
	display: flex;
	align-items: center;
	gap: 9px;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: -.1px;
}
.pnf-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 29px;
	height: 29px;
	border-radius: 8px;
	background: rgba(255,255,255,.16);
}
.pnf-brand-mark svg {
	width: 18px; height: 18px;
	fill: none; stroke: currentColor; stroke-width: 1.7;
	stroke-linecap: round; stroke-linejoin: round;
}
.pnf-greeting { font-size: 13px; opacity: .78; margin-top: 2px; }

.pnf-logout {
	color: #fff;
	font-size: 13px;
	text-decoration: none;
	opacity: .85;
	white-space: nowrap;
	min-height: 36px;
	display: inline-flex;
	align-items: center;
	padding: 8px 12px;
	border: 1px solid rgba(255,255,255,.35);
	border-radius: 8px;
}
.pnf-logout:hover { background: rgba(255,255,255,.12); color: #fff; opacity: 1; }

/* ---- Summary + order list ---- */
.pnf-dash-summary { padding: 30px clamp(20px, 4vw, 34px) 8px; }
.pnf-summary-title { font-size: 13px; color: var(--pnf-muted); }
.pnf-summary-count { font-size: 26px; font-weight: 700; color: var(--pnf-ink); letter-spacing: -.6px; }

.pnf-order-list {
	padding: 16px clamp(20px, 4vw, 34px) 70px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}
.pnf-empty { text-align: center; color: #888; padding: 40px 0; font-size: 14px; }

.pnf-order-card {
	background: #fff;
	border: 1px solid var(--pnf-border);
	border-radius: 16px;
	padding: 19px;
	box-shadow: 0 3px 12px rgba(23,32,51,.045);
	min-width: 0; /* prevents grid blowout on long content */
	transition: transform .2s, box-shadow .2s;
}
.pnf-order-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(23,32,51,.10); }

.pnf-order-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}
.pnf-order-number {
	font-weight: 700;
	font-size: clamp(13px, 4vw, 15px);
	color: var(--pnf-ink);
	overflow-wrap: anywhere;
}
.pnf-order-status {
	font-size: 11px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 20px;
	text-transform: capitalize;
	white-space: nowrap;
	letter-spacing: .01em;
}
.pnf-status-partner_assigned,
.pnf-status-assigned { background: #eee3f0; color: var(--pnf-purple); }
.pnf-status-out_for_delivery { background: #fff2d9; color: var(--pnf-warn); }
.pnf-status-delivered { background: #e3f6ea; color: var(--pnf-success); }
.pnf-status-unassigned { background: #fdecea; color: #b3261e; }
.pnf-status-cancelled { background: #f0f0f0; color: #666; }
.pnf-status-refunded { background: #f0f0f0; color: #666; }
.pnf-status-rescheduled { background: #e6eefc; color: #2454a6; }

.pnf-order-meta {
	display: flex;
	align-items: center;
	gap: 7px;
	color: #475467;
	font-size: 13px;
	margin-top: 8px;
	margin-bottom: 4px;
	overflow-wrap: anywhere;
}
.pnf-meta-icon { width: 16px; height: 16px; color: var(--pnf-purple); display: inline-flex; }
.pnf-meta-icon svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Buttons (.pnf-btn and its .pnf-btn-view alias share one definition) ---- */
.pnf-btn,
.pnf-btn-view {
	margin-top: 18px;
	width: 100%;
	padding: 10px;
	border-radius: 11px;
	border: 1px solid var(--pnf-purple);
	background: #fff;
	color: var(--pnf-purple);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	min-height: 44px;
	display: block;
	box-sizing: border-box;
	text-align: center;
	box-shadow: none;
}
.pnf-btn:active, .pnf-btn:hover,
.pnf-btn-view:active, .pnf-btn-view:hover { background: #f7f1f9; color:#690b78; }

/* ---- Single order detail page ----
   A normal, full-page document — like a WooCommerce single product page —
   not an overlay. Nothing here is position:fixed, so nothing can end up
   fighting the theme's sticky site navigation bar for the same screen space;
   the action buttons are simply the last thing in the page's normal flow. */

.pnf-back-link {
	color: #fff;
	font-size: 14px;
	text-decoration: none;
	opacity: 1;
	white-space: nowrap;
	min-height: 44px;
	padding: 10px 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 1px solid rgba(255,255,255,.35);
	border-radius: 8px;
	background: transparent;
	font-weight: 600;
	cursor: pointer;
	box-sizing: border-box;
	transition: all 0.2s ease;
}
.pnf-back-link:hover {
	color: #fff;
	background: rgba(255,255,255,.12);
	text-decoration: none;
}

.pnf-dash-header-spacer { width: 1px; } /* balances the back link so brand stays centered */

.pnf-order-detail-body {
	padding: 30px clamp(16px, 4vw, 20px) clamp(32px, 8vw, 48px);
}

.pnf-order-detail-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--pnf-border);
}
.pnf-order-detail-number {
	font-size: clamp(20px, 5vw, 24px);
	font-weight: 700;
	color: #222;
	margin: 0;
	overflow-wrap: anywhere;
	letter-spacing: -.6px;
}

.pnf-voided-banner {
	background: #fdecea;
	color: #b3261e;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 13.5px;
	line-height: 1.4;
	margin-bottom: 16px;
	display: flex;
	align-items: flex-start;
	gap: 9px;
	border: 1px solid #f6c9c5;
}

.pnf-detail-row {
	display: flex;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid var(--pnf-border);
	font-size: 14px;
	gap: 12px;
	flex-wrap: wrap;
	color: var(--pnf-ink);
}
.pnf-detail-label { color: #888; flex: 0 0 auto; min-width: 82px; }
.pnf-detail-items {
	margin: 14px 0 0;
	padding: 5px 16px 8px;
	list-style: none;
	border: 1px solid var(--pnf-border);
	border-radius: 13px;
	background: #fff;
}
.pnf-detail-items li {
	font-size: 14px;
	padding: 8px 0;
	border-bottom: 1px solid var(--pnf-border);
	overflow-wrap: anywhere;
}
.pnf-detail-items li:last-child { border-bottom: 0; }

/* Action buttons sit inline in the page's normal document flow — they scroll
   with the content, so they can never be clipped or overlapped by a theme's
   fixed header/nav (the original bug with the fixed slide-up panel). */
.pnf-action-bar-inline {
	margin-top: 24px;
	background: transparent;
	padding: 0;
	box-shadow: none;
	border-top: none;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.pnf-action-btns,
.pnf-action-btn {
	padding: 13px 20px;
	border-radius: 10px;
	border: none;
	font-weight: 600;
	font-size: 13.5px;
	cursor: pointer;
	min-height: 48px;
	text-decoration: none;
	text-align: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	transition: opacity 0.2s ease, background 0.2s ease;
}
.pnf-action-btns:active, .pnf-action-btns:hover,
.pnf-action-btn:active, .pnf-action-btn:hover { opacity: .85; text-decoration: none; }
.pnf-action-btns:disabled { opacity: .6; cursor: not-allowed; }

/* Call Customer / Navigate — secondary, outline style so they read as
   lighter-weight actions compared to Start Delivery / Mark Delivered. */
.pnf-action-btns[data-action="call"],
.pnf-action-btns[data-action="navigate"] {
	background: #ffffff;
	color: var(--pnf-purple);
    grid-column: span 2;
	border: 1px solid #d8c2dd;
	border-radius: 10px;
}


/* Start Delivery uses class="pnf-action-btns pnf-primary" (plural base
   class); .pnf-action-btn.pnf-primary is the singular equivalent used
   elsewhere (e.g. the voided-order "Back to deliveries" link). Both share
   the purple fill. */
.pnf-action-btns.pnf-primary,
.pnf-action-btn.pnf-primary {
	background: var(--pnf-purple);
	color: #fff;
	grid-column: span 2;
	border-radius: 10px;
	box-shadow: 0 5px 12px rgba(91,23,109,.16);
}
.pnf-action-btns.pnf-primary:hover,
.pnf-action-btns.pnf-primary:disabled,
.pnf-action-btn.pnf-primary:hover {
	background: var(--pnf-purple);
	color: #fff;
}

.pnf-action-btn.pnf-success {
	background: #00994d;
	color: #fff;
	border-radius: 10px;
	grid-column: span 2;
}

/* WhatsApp Customer — only ever shown while an order is Out for Delivery
   (used as a fallback for when a call to the customer doesn't connect).
   Brand green, kept visually distinct from Mark Delivered. */
.pnf-action-btns.pnf-whatsapp {
	background: #ffffff;
	color: rgb(105,11,120);
	border: 1px solid #d8c2dd;
	border-radius: 10px;
	grid-column: span 2;
}

.pnf-action-btns.pnf-whatsapp svg {
    fill: currentColor;
}

/* Customer Not Available / Reschedule — a secondary, muted-amber action so
   it doesn't compete visually with the success-green Mark Delivered, but
   still reads as distinct from the plain outline Call/Navigate buttons. */
.pnf-action-btn.pnf-reschedule {
	background: #fff7e8;
	color: #8a5b00;
	border: 1px solid #f0d9a6;
	border-radius: 10px;
	grid-column: span 2;
}

/* Reschedule note shown under the order number/status when the order is
   currently in the 'rescheduled' state. */
.pnf-reschedule-note {
	display: block;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0;
	padding: 11px 13px;
	border-radius: 10px;
	background: #e6eefc;
	color: #2454a6;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
}
.pnf-reschedule-note svg {
	width: 18px; height: 18px; flex:0 0 auto;
	fill: none; stroke: currentColor; stroke-width: 1.8;
	stroke-linecap: round; stroke-linejoin: round;
}

/* Reschedule panel — inline (not a floating overlay), matching the action
   bar's own "scrolls with the page" approach so it can't get clipped. */
.pnf-reschedule-panel {
	margin-top: 14px;
	padding: 16px;
	border-radius: 13px;
	border: 1px solid var(--pnf-border);
	background: #fbfaf7;
}
.pnf-reschedule-panel-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--pnf-ink);
	margin-bottom: 12px;
}
.pnf-reschedule-option-btn {
	display: block;
	width: 100%;
	padding: 12px 16px;
	border-radius: 10px;
	border: 1px solid #d8c2dd;
	background: #fff;
	color: var(--pnf-purple);
	font-weight: 600;
	font-size: 13.5px;
	cursor: pointer;
	box-sizing: border-box;
}
.pnf-reschedule-option-btn.pnf-primary {
	background: var(--pnf-purple);
	color: #fff;
	border-color: var(--pnf-purple);
	border-radius: 10px;
	margin-bottom: 14px;
}
.pnf-reschedule-specific {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}
.pnf-reschedule-specific label {
	font-size: 12.5px;
	color: var(--pnf-muted);
	font-weight: 600;
}
.pnf-reschedule-specific input[type="date"] {
	padding: 11px 12px;
	border-radius: 10px;
	border: 1px solid var(--pnf-border);
	font-size: 14px;
	color: var(--pnf-ink);
	box-sizing: border-box;
}
.pnf-reschedule-cancel {
	display: block;
	width: 100%;
	padding: 10px 16px;
	border-radius: 10px;
	border: none;
	background: transparent;
	color: var(--pnf-muted);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	text-align: center;
}


.pnf-back-link svg, .pnf-action-btn svg, .pnf-action-btns svg, .pnf-voided-banner svg {
	width: 18px; height: 18px;
	fill: none; stroke: currentColor; stroke-width: 1.9;
	stroke-linecap: round; stroke-linejoin: round;
	flex: 0 0 auto;
}

/* ---- Small phones ---- */
@media (max-width: 380px) {
	.pnf-order-number { font-size: 13px; }
	.pnf-order-list { padding-left: 10px; padding-right: 10px; }
}

/* ---- Tablets: comfortable single column, no longer edge-locked ---- */
@media (min-width: 600px) {
	.pnf-driver-login-wrap, .pnf-dash-wrap { max-width: 560px; }
	.pnf-order-list { grid-template-columns: repeat(2, 1fr); }
	.pnf-dash-summary { grid-column: 1 / -1; }
	.pnf-action-bar-inline { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 599px) {
	.pnf-action-bar-inline { grid-template-columns: 1fr; }
}

/* ---- Desktop / large tablets: wider shell, multi-column order grid ---- */
@media (min-width: 900px) {
	.pnf-driver-login-wrap, .pnf-dash-wrap { max-width: 900px; }
	.pnf-order-list { grid-template-columns: repeat(3, 1fr); }
	.pnf-order-detail-body { max-width: 640px; margin: 0 auto; }
}

/* ---- Very large screens: cap growth so cards don't stretch too wide ---- */
@media (min-width: 1200px) {
	.pnf-driver-login-wrap, .pnf-dash-wrap { max-width: 1080px; }
	.pnf-order-list { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Toast notification (e.g. "Customer notified") ---- */
.pnf-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 20px);
	background: #1f2937;
	color: #ffffff;
	padding: 12px 20px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 9999;
	max-width: 90vw;
	text-align: center;
}
.pnf-toast-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}