/**
 * Drive application page-specific styles
 *
 * Page level styles that sit on top of design.css.
 * (Page-specific styles migrated from the old navigation.css)
 */

/* Links list */
.links ul {
	list-style: none;
	padding: 0;
}

.links ul li {
	margin: 5px 0;
}

/* =====================================================
   Session countdown in profile dropdown
   ===================================================== */
.profile-menu .profile-session {
	padding: 0.5rem 1.25rem;
	font-size: 0.813rem;
	color: var(--muted);
}

.profile-session .timeout-countdown {
	font-weight: bold;
	color: #3AC977;
}

/* =====================================================
   Login / signup page
   ===================================================== */
.login-box {
	max-width: 420px;
	margin: 4rem auto 0;
}

.login-box .card {
	margin-bottom: 0;
}

/* =====================================================
   Deliveries
   ===================================================== */
.deliveries .hint {
	color: #777;
	font-size: 0.9em;
}

/* Driver assignment picker (coloured eligibility checkboxes) */
.driver-options {
	list-style: none;
	margin: 10px 0 5px 0;
	padding: 0;
	max-width: 640px;
}

.driver-option {
	display: block;
	border: 1px solid #e6e6e6;
	border-radius: 6px;
	padding: 8px 12px;
	margin: 0 0 6px 0;
	background-color: #fff;
}

.driver-option label {
	cursor: pointer;
	margin: 0;
	font-weight: bold;
}

.driver-option input[type="checkbox"] {
	margin-right: 8px;
}

.driver-option.eligible {
	background-color: #f0fbf2;
	border-color: #bfe3c6;
}

.driver-option.eligible input[type="checkbox"] {
	accent-color: #28a745;
}

.driver-option.ineligible {
	background-color: #fdf1f2;
	border-color: #f0c1c6;
}

.driver-option.ineligible input[type="checkbox"] {
	accent-color: #dc3545;
}

.driver-eligible-tag {
	margin-left: 34px;
	font-size: 0.85em;
	color: #155724;
}

.driver-reasons {
	margin: 4px 0 0 0;
	padding-left: 28px;
	font-size: 0.85em;
	color: #721c24;
}

/* Delivery summary box on the view page */
.delivery-summary {
	background-color: #f7f9fc;
	border: 1px solid #e6e6e6;
	border-radius: 6px;
	padding: 15px 20px;
	margin: 15px 0 25px 0;
}

.delivery-summary p {
	margin: 6px 0;
}

/* Status badges */
.status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 10px;
	font-size: 0.85em;
	font-weight: bold;
	background-color: #eee;
	color: #555;
}

.status-pending {
	background-color: #fff3cd;
	color: #856404;
}

.status-in_progress {
	background-color: #cce5ff;
	color: #004085;
}

.status-completed {
	background-color: #d4edda;
	color: #155724;
}

.status-cancelled {
	background-color: #f8d7da;
	color: #721c24;
}

.status-missed {
	background-color: #e2e3e5;
	color: #383d41;
}

.status-active {
	background-color: #d4edda;
	color: #155724;
}

.status-archived {
	background-color: #e2e3e5;
	color: #383d41;
}

.status-suspended {
	background-color: #f8d7da;
	color: #721c24;
}

/* Stop tables (pickups / dropoffs) */
table.stops {
	width: 100%;
	margin: 10px 0 25px 0;
}

table.stops th,
table.stops td {
	text-align: left;
	vertical-align: top;
}

table.stops td.actions {
	white-space: nowrap;
}

/* Inline edit form inside a stop row */
form.inline-form {
	display: inline;
	margin: 0;
	padding: 0;
	border: none;
}

form.inline-form select,
form.inline-form input[type='text'],
form.inline-form input[type='datetime-local'] {
	margin: 2px;
	padding: 3px 6px;
	font-size: 0.9em;
	width: auto;
	display: inline-block;
}

form.stop-edit input[type='text'] {
	width: 160px;
}

/* Small buttons for row actions */
input.mini,
button.mini {
	padding: 2px 8px;
	font-size: 0.85em;
	cursor: pointer;
}

/* =====================================================
    Driver requirement pages (driver_view / driver_requirement)
    ===================================================== */
.req-progress-text {
	margin: 0 0 6px;
	color: #555;
	font-size: 0.9rem;
}

.req-progress {
	height: 10px;
	background-color: #eef1f5;
	border-radius: 5px;
	overflow: hidden;
}

.req-progress-fill {
	height: 100%;
	background-color: var(--success);
	border-radius: 5px;
	transition: width 0.4s ease;
}

.req-type-label {
	color: var(--text);
	font-size: 0.875rem;
	margin: 0 0 1rem;
}

.req-asterisk {
	color: var(--danger);
}

.req-completed-on {
	color: var(--success);
	font-weight: 500;
	font-size: 0.875rem;
	margin: 0 0 1rem;
}

.req-answers {
	background: #f7f9fc;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 12px 15px;
	color: var(--title);
	font-size: 0.875rem;
}

.req-answers small {
	color: var(--text);
}

.req-attest-text {
	background: #f7f9fc;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 12px 15px;
	color: var(--title);
	font-size: 0.875rem;
	white-space: pre-line;
	margin-bottom: 1rem;
}

/* Add-stop form fields */
.add-stop {
	margin-bottom: 30px;
}

.add-stop .form-field {
	margin-bottom: 8px;
}

.add-stop .form-field label {
	display: block;
	font-weight: bold;
	margin-bottom: 2px;
}

.add-stop .form-field input[type='text'] {
	width: 320px;
	max-width: 100%;
	padding: 4px 6px;
}

.add-stop .form-field textarea {
	width: 320px;
	max-width: 100%;
	padding: 4px 6px;
}

/* =====================================================
    Header notification bell (unread messages)
    ===================================================== */
.header-notifications .notifications-toggle {
	position: relative;
}

.notification-badge {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--danger);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.notifications-menu {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 320px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 0 0 var(--radius) var(--radius);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
	z-index: 1060;
}

.notifications-menu.show {
	display: block;
}

.notifications-head {
	padding: 0.75rem 1.25rem 0.6rem;
	border-bottom: 1px solid var(--border);
}

.notifications-head h6 {
	margin: 0 0 2px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--title);
}

.notifications-head p {
	margin: 0;
	font-size: 0.75rem;
	color: var(--muted);
}

.notification-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 340px;
	overflow-y: auto;
}

.notification-list li a {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 0.7rem 1.25rem;
	text-decoration: none;
	color: var(--text);
	border-bottom: 1px solid rgba(230, 230, 230, 0.6);
	transition: background 0.15s ease;
}

.notification-list li a:hover {
	background: var(--primary-softer);
}

.notification-list li.driver a {
	border-left: 3px solid var(--primary);
}

.notification-list li.client a {
	border-left: 3px solid var(--success);
}

.notification-list li.admin a {
	border-left: 3px solid var(--info);
}

.notification-avatar {
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.813rem;
	font-weight: 600;
}

.notification-list li.driver .notification-avatar {
	background: var(--primary);
}

.notification-list li.client .notification-avatar {
	background: var(--success);
}

.notification-list li.admin .notification-avatar {
	background: var(--info);
}

.notification-avatar.avatar-empty {
	background: #eef1f5;
	color: var(--muted);
}

.notification-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.notification-name {
	font-size: 0.813rem;
	font-weight: 600;
	color: var(--title);
}

.notification-snippet {
	font-size: 0.75rem;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.notification-time {
	font-size: 0.688rem;
	color: var(--muted);
}

.notification-list li.notification-empty a {
	border-bottom: none;
	cursor: default;
}

.notifications-all {
	display: block;
	padding: 0.7rem 1.25rem;
	border-top: 1px solid var(--border);
	font-size: 0.813rem;
	font-weight: 500;
	color: var(--primary);
	text-decoration: none;
	text-align: center;
}

.notifications-all:hover {
	background: var(--primary-soft);
}

/* =====================================================
    Messages (in-app messaging)
    ===================================================== */
.messages .msg-role-tag {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 8px;
	border-radius: 10px;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: capitalize;
	vertical-align: middle;
}

.msg-role-tag.role-driver {
	background: var(--primary-soft);
	color: var(--primary-hover);
}

.msg-role-tag.role-client {
	background: rgba(58, 201, 119, 0.15);
	color: #1f9d57;
}

.msg-role-tag.role-admin {
	background: rgba(88, 186, 215, 0.15);
	color: #2f8ba6;
}

/* Two-column layout: contacts + compose (admin) */
.messages-layout {
	display: flex;
	gap: 1.563rem;
	align-items: flex-start;
}

.messages-contacts {
	flex: 0 0 320px;
	max-width: 320px;
	margin-bottom: 0;
}

.messages-compose {
	flex: 1;
	min-width: 0;
	margin-bottom: 0;
}

@media (max-width: 768px) {
	.messages-layout {
		flex-direction: column;
	}
	.messages-contacts {
		flex: none;
		max-width: none;
		width: 100%;
	}
}

/* Contact list (admin) */
.contact-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 480px;
	overflow-y: auto;
}

.contact-list li a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0.7rem 1.1rem;
	text-decoration: none;
	color: var(--text);
	border-bottom: 1px solid rgba(230, 230, 230, 0.6);
	transition: background 0.15s ease;
}

.contact-list li a:hover {
	background: var(--primary-softer);
}

.contact-list li.driver a {
	border-left: 3px solid var(--primary);
}

.contact-list li.client a {
	border-left: 3px solid var(--success);
}

.contact-list li.active a {
	background: var(--primary-soft);
}

.contact-avatar {
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.813rem;
	font-weight: 600;
}

.contact-list li.client .contact-avatar {
	background: var(--success);
}

.contact-info {
	flex: 1;
	min-width: 0;
}

.contact-name {
	display: block;
	font-size: 0.813rem;
	font-weight: 600;
	color: var(--title);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.contact-snippet {
	display: block;
	font-size: 0.75rem;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.contact-snippet .mine {
	color: var(--primary-hover);
}

.contact-unread {
	flex: none;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--danger);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
}

.contact-empty {
	padding: 1.25rem;
	font-size: 0.813rem;
	color: var(--muted);
}

/* Compose form */
.compose-form select,
.compose-form textarea {
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--font-family);
	font-size: 0.813rem;
	color: var(--title);
	background: #fff;
	box-sizing: border-box;
}

.compose-form textarea {
	min-height: 120px;
	resize: vertical;
}

.compose-form label {
	display: block;
	font-size: 0.813rem;
	font-weight: 600;
	color: var(--title);
	margin: 0 0 4px;
}

.compose-form .form-row {
	margin-bottom: 14px;
}

.compose-form button[type='submit'] {
	background: var(--primary);
	border: 1px solid var(--primary);
	border-radius: var(--radius);
	color: #000;
	font-family: var(--font-family);
	font-size: 0.813rem;
	font-weight: 500;
	padding: 0.5rem 1.25rem;
	cursor: pointer;
}

.compose-form button[type='submit']:hover {
	background: #31A8FF;
	border-color: #25A3FF;
}

/* Thread (conversation) */
.messages-thread {
	margin-bottom: 1.563rem;
}

.thread-header {
	display: flex;
	align-items: center;
	gap: 10px;
}

.thread-header .back-link {
	font-size: 0.813rem;
	color: var(--primary);
	text-decoration: none;
}

.thread-header .back-link:hover {
	text-decoration: underline;
}

.thread-header .thread-with {
	font-size: 1rem;
	font-weight: 600;
	color: var(--title);
}

.thread-messages {
	padding: 1.25rem;
	max-height: 480px;
	overflow-y: auto;
	background: #f7f9fc;
}

.thread-empty {
	padding: 2rem 1rem;
	text-align: center;
	font-size: 0.875rem;
	color: var(--muted);
}

.bubble-row {
	display: flex;
	margin-bottom: 1rem;
}

.bubble-row.mine {
	justify-content: flex-end;
}

.bubble-avatar {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 600;
}

.bubble-row.mine .bubble-avatar {
	order: 2;
	margin-left: 8px;
}

.bubble-row:not(.mine) .bubble-avatar {
	margin-right: 8px;
}

.bubble {
	max-width: 70%;
	padding: 0.6rem 0.9rem;
	border-radius: 10px;
	font-size: 0.813rem;
	line-height: 1.45;
	color: var(--title);
	background: #fff;
	border: 1px solid var(--border);
	word-wrap: break-word;
	white-space: pre-line;
}

.bubble-row.mine .bubble {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
	text-align: right;
}

.bubble .bubble-time {
	display: block;
	margin-top: 4px;
	font-size: 0.688rem;
	color: var(--muted);
}

.bubble-row.mine .bubble .bubble-time {
	color: rgba(255, 255, 255, 0.75);
}

.bubble-from {
	display: block;
	font-size: 0.688rem;
	font-weight: 600;
	color: var(--primary-hover);
	margin-bottom: 2px;
}

/* Reply box */
.reply-box {
	padding: 0.9rem 1.25rem;
	border-top: 1px solid var(--border);
}

.reply-box label {
	display: block;
	font-size: 0.813rem;
	font-weight: 600;
	color: var(--title);
	margin: 0 0 4px;
}

.reply-box select {
	width: 220px;
	max-width: 100%;
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--font-family);
	font-size: 0.813rem;
	color: var(--title);
	background: #fff;
	margin-bottom: 8px;
}

.reply-box textarea {
	width: 100%;
	min-height: 80px;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--font-family);
	font-size: 0.813rem;
	color: var(--title);
	resize: vertical;
	box-sizing: border-box;
}

.reply-box .reply-actions {
	margin-top: 10px;
	text-align: right;
}

.reply-box .reply-actions button[type='submit'] {
	background: var(--primary);
	border: 1px solid var(--primary);
	border-radius: var(--radius);
	color: #000;
	font-family: var(--font-family);
	font-size: 0.813rem;
	font-weight: 500;
	padding: 0.5rem 1.25rem;
	cursor: pointer;
}

.reply-box .reply-actions button[type='submit']:hover {
	background: #31A8FF;
	border-color: #25A3FF;
}

/* Stop photo (dropoff proof-of-delivery) thumbnail in the admin stop tables */
.stops img.stop-photo {
	display: block;
	width: 120px;
	height: 120px;
	object-fit: cover;
	border: 1px solid var(--border, #e3e6ea);
	border-radius: var(--radius, 4px);
	background: #f2f3f5;
	margin-top: 6px;
	cursor: zoom-in;
}

/* =====================================================
   Delivery view - route map
   ===================================================== */
.route-map-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0 0 8px 0;
	font-size: 0.8rem;
	color: var(--muted, #666);
}

.legend-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.legend-dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.legend-line {
	display: inline-block;
	width: 18px;
	height: 4px;
	border-radius: 2px;
	background: #1a73e8;
}

.legend-ring {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: rgba(26, 115, 232, 0.12);
	border: 1.5px solid rgba(26, 115, 232, 0.5);
}

.route-trail-status {
	margin: 4px 0 8px 0;
	font-size: 0.85rem;
	color: var(--title, #333);
}

.route-note {
	margin: 4px 0 8px 0;
	font-size: 0.85rem;
	color: var(--muted, #777);
}

.route-planned-title {
	margin: 12px 0 4px 0;
	font-size: 0.95rem;
}
