/* ==========================================================================
   Senddle Tracking — portal + wp-admin styles
   ========================================================================== */

.snd-portal {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	color: #1e293b;
	max-width: 1152px;
	margin: 0 auto;
}
.snd-portal *, .snd-admin * { box-sizing: border-box; }
.snd-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }
.snd-svg--sm { width: 0.8em; height: 0.8em; }

/* Cards */
.snd-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Tracking form */
.snd-form-card { max-width: 560px; margin: 0 auto; padding: 44px 36px; text-align: center; }
.snd-form-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; border-radius: 14px;
	background: #1d4ed8; color: #fff; margin-bottom: 14px;
}
.snd-form-icon .snd-svg { width: 24px; height: 24px; }
.snd-title { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0 0 8px; }
.snd-sub-text { font-size: 14px; color: #64748b; line-height: 1.6; margin: 0 0 20px; }
.snd-alert {
	background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
	border-radius: 10px; padding: 12px 14px; font-size: 13.5px;
	margin-bottom: 16px; text-align: left;
}
.snd-form { display: flex; gap: 10px; }
.snd-form input {
	flex: 1; min-width: 0;
	border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px 14px;
	font-size: 14.5px; font-family: inherit; outline: none;
}
.snd-form input:focus { border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
.snd-form button {
	border: none; background: #1d4ed8; color: #fff;
	border-radius: 10px; padding: 12px 22px;
	font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.snd-form button:hover { background: #1e40af; }
@media (max-width: 520px) { .snd-form { flex-direction: column; } }
.snd-empty { color: #94a3b8; text-align: center; padding: 24px 0; margin: 0; }

/* Header card */
.snd-head {
	display: grid;
	grid-template-columns: 1.1fr 1.8fr 1fr;
	gap: 18px;
	padding: 22px 26px;
	margin-bottom: 16px;
}
.snd-label {
	display: block; font-size: 11px; text-transform: uppercase;
	letter-spacing: 0.06em; color: #94a3b8; font-weight: 600; margin-bottom: 6px;
}
.snd-value { display: block; font-weight: 700; color: #0f172a; font-size: 15px; }
.snd-tn { font-size: 17px; letter-spacing: 0.02em; }
.snd-sub { display: block; font-size: 12px; color: #64748b; margin-top: 3px; }
.snd-cell--route { display: flex; align-items: center; gap: 14px; min-width: 0; }
.snd-place { min-width: 0; }
.snd-route-arrow { color: #cbd5e1; flex: 0 0 auto; }
@media (max-width: 860px) {
	.snd-head { grid-template-columns: 1fr; }
	.snd-cell--route { flex-wrap: wrap; }
}

/* Badges */
.snd-badge {
	display: inline-block; padding: 4px 12px; border-radius: 999px;
	font-size: 12px; font-weight: 700; margin-top: 6px;
}
.snd-badge--order_received { background: #f1f5f9; color: #475569; }
.snd-badge--picked_up { background: #dbeafe; color: #1d4ed8; }
.snd-badge--in_transit { background: #dcfce7; color: #15803d; }
.snd-badge--on_hold { background: #fee2e2; color: #b91c1c; }
.snd-badge--out_for_delivery { background: #e0f2fe; color: #0369a1; }
.snd-badge--delivered { background: #16a34a; color: #fff; }
.snd-flag--departed, .snd-flag--arrived, .snd-flag--delivered { background: #dcfce7; color: #15803d; margin-top: 0; }
.snd-flag--on_hold { background: #fee2e2; color: #b91c1c; margin-top: 0; }
.snd-flag--pending, .snd-flag--checked { background: #f1f5f9; color: #475569; margin-top: 0; }

/* Map */
.snd-map-wrap {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	margin-bottom: 16px;
	height: 420px;
	background: #e2e8f0;
}
.snd-map-wrap.snd-full { position: fixed; inset: 12px; z-index: 99999; height: auto; }
#snd-map { width: 100%; height: 100%; }
.snd-marker { background: none !important; border: none !important; }
.snd-marker span {
	display: flex; align-items: center; justify-content: center;
	width: 26px; height: 26px; border-radius: 999px;
	color: #fff; font-size: 12px; font-weight: 700;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.4);
	border: 2px solid #fff;
}
.snd-marker--done span { background: #16a34a; }
.snd-marker--current span { background: #2563eb; }
.snd-marker--hold span { background: #dc2626; }
.snd-marker--upcoming span { background: #94a3b8; }
.snd-tip { font-weight: 600; border-radius: 8px !important; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15) !important; }
.snd-layer-toggle {
	display: flex; background: #fff; border-radius: 8px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3); overflow: hidden;
}
.snd-layer-toggle button {
	border: none; background: transparent; padding: 7px 14px;
	font-size: 12.5px; font-weight: 600; cursor: pointer;
	color: #334155; font-family: inherit;
}
.snd-layer-toggle button.is-active { background: #2563eb; color: #fff; }
.snd-map-expand-wrap { display: flex; }
.snd-map-expand {
	background: #fff !important; border: none !important;
	border-radius: 8px !important; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3) !important;
	width: 34px; height: 34px; font-size: 15px; cursor: pointer;
	color: #334155; display: flex; align-items: center; justify-content: center;
}

/* Travel history */
.snd-history { padding: 22px 26px; }
.snd-history-head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}
.snd-h3 { font-size: 19px; font-weight: 800; color: #0f172a; margin: 0; }
.snd-link-btn {
	border: none; background: none; color: #2563eb;
	font-size: 13px; font-weight: 600; cursor: pointer;
	display: inline-flex; align-items: center; gap: 4px; font-family: inherit;
}
.snd-timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.snd-timeline:not(.snd-all) .snd-step:nth-child(n+6) { display: none; }
.snd-step {
	position: relative;
	display: grid;
	grid-template-columns: 26px 84px 30px minmax(0, 1fr);
	gap: 4px 14px;
	align-items: flex-start;
	padding: 14px 0 22px;
}
.snd-step::before {
	content: '';
	position: absolute;
	left: 12px; top: 36px; bottom: 2px;
	width: 2px; background: #e2e8f0;
}
.snd-step:last-child::before { display: none; }
.snd-step.is-done::before { background: #16a34a; }
.snd-num {
	position: relative; z-index: 1;
	display: flex; align-items: center; justify-content: center;
	width: 26px; height: 26px; border-radius: 999px;
	background: #e2e8f0; color: #475569;
	font-size: 12.5px; font-weight: 700;
}
.snd-step.is-done .snd-num { background: #16a34a; color: #fff; }
.snd-step.is-current .snd-num { background: #2563eb; color: #fff; }
.snd-step.is-hold .snd-num { background: #dc2626; color: #fff; }
.snd-step.is-upcoming .snd-num { background: #f1f5f9; color: #94a3b8; }
.snd-when { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.snd-date { font-size: 13px; font-weight: 700; color: #0f172a; }
.snd-step.is-upcoming .snd-date { color: #94a3b8; }
.snd-time { font-size: 12px; color: #64748b; }
.snd-ico { color: #64748b; padding-top: 4px; }
.snd-ico .snd-svg { width: 18px; height: 18px; }
.snd-step.is-hold .snd-ico { color: #dc2626; }
.snd-main {
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 12px; min-width: 0;
}
.snd-what { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.snd-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.snd-place { font-size: 12.5px; color: #475569; }
.snd-desc { font-size: 12.5px; color: #64748b; }
.snd-step.snd-collapsed .snd-desc { display: none; }
.snd-reason {
	display: block;
	background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
	border-radius: 8px; padding: 10px 12px;
	font-size: 12.5px; margin-top: 6px; line-height: 1.55;
}
.snd-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.snd-chev {
	border: none; background: none; cursor: pointer;
	color: #94a3b8; padding: 2px; line-height: 1;
}
.snd-chev .snd-svg { transition: transform 0.15s ease; }
.snd-step.snd-collapsed .snd-chev .snd-svg { transform: rotate(-90deg); }
@media (max-width: 700px) {
	.snd-step { grid-template-columns: 26px 80px minmax(0, 1fr); }
	.snd-ico { display: none; }
	.snd-main { flex-wrap: wrap; }
	.snd-side { flex-direction: column; align-items: flex-end; gap: 6px; }
}

/* ==========================================================================
   wp-admin screens
   ========================================================================== */
.snd-admin-h2 { font-size: 17px; font-weight: 700; color: #1e293b; margin: 26px 0 10px; }
.snd-admin-toolbar { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.snd-admin-scroll { overflow-x: auto; }
.snd-admin-table {
	width: 100%; border-collapse: collapse;
	background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
}
.snd-admin-table th {
	text-align: left; font-size: 11px; text-transform: uppercase;
	letter-spacing: 0.08em; color: #64748b;
	background: #f8fafc; padding: 12px 14px; border-bottom: 1px solid #e2e8f0;
}
.snd-admin-table td {
	padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
	font-size: 13.5px; vertical-align: middle;
}
.snd-admin-table tr:last-child td { border-bottom: none; }
.snd-admin-empty { text-align: center; color: #94a3b8; padding: 32px 14px !important; }
.snd-admin-form { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 24px 20px; max-width: 880px; }
.snd-admin-actions { white-space: nowrap; }
.snd-admin-actions form { display: inline-block; margin: 0 0 0 4px; }
.snd-admin-btn {
	display: inline-block; border: none; border-radius: 6px;
	padding: 7px 16px; font-size: 13px; font-weight: 600;
	cursor: pointer; text-decoration: none; font-family: inherit;
}
.snd-admin-btn--navy { background: #1d4ed8; color: #fff; }
.snd-admin-btn--navy:hover { background: #1e40af; color: #fff; }
.snd-admin-btn--ghost { background: #f1f5f9; color: #334155; }
.snd-admin-btn--ghost:hover { background: #e2e8f0; color: #334155; }
.snd-admin-btn--red { background: #fee2e2; color: #b91c1c; }
.snd-admin-btn--red:hover { background: #fecaca; color: #b91c1c; }
.snd-tn-mono { font-weight: 700; font-family: monospace; letter-spacing: 0.02em; white-space: nowrap; }
.snd-geo-ok { color: #16a34a; font-size: 11.5px; font-weight: 600; white-space: nowrap; }

/* Marker types: departure flag, destination pin, on hold, current position */
.snd-marker--origin span { background: #16a34a; }
.snd-marker--dest span { background: #dc2626; }
.snd-marker--hold span { background: #dc2626; }
.snd-marker--currentpos span, .snd-marker--holdpos span {
	background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.35);
}
.snd-marker--currentpos span { color: #1d4ed8; border: 2px solid #1d4ed8; }
.snd-marker--holdpos span { color: #dc2626; border: 2px solid #dc2626; }
.snd-marker span svg { width: 14px; height: 14px; }

/* Legend */
.snd-legend {
	display: flex; flex-wrap: wrap; gap: 6px 18px;
	padding: 0 4px 16px; font-size: 12px; color: #64748b;
}
.snd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.snd-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.snd-dot--origin { background: #16a34a; }
.snd-dot--current { background: #1d4ed8; }
.snd-dot--hold { background: #dc2626; }
.snd-dot--dest { background: #dc2626; border-radius: 2px; transform: rotate(45deg); }
.snd-dot--step { background: #94a3b8; }