:root {
	--adm-bg: #0f172a;
	--adm-surface: #ffffff;
	--adm-surface-alt: #f8fafc;
	--adm-text: #0f172a;
	--adm-muted: #64748b;
	--adm-border: #e2e8f0;
	--adm-primary: #2563eb;
	--adm-primary-dark: #1d4ed8;
	--adm-success: #16a34a;
	--adm-danger: #dc2626;
	--adm-radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--adm-surface-alt);
	color: var(--adm-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-tap-highlight-color: transparent;
}

.adm-customer-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.adm-customer-topbar {
	background: var(--adm-bg);
	color: #fff;
	padding: 16px 20px calc(16px + env(safe-area-inset-top));
	padding-top: max(16px, env(safe-area-inset-top));
	position: sticky;
	top: 0;
	z-index: 10;
}
.adm-customer-topbar-title { font-size: 18px; font-weight: 700; }

.adm-customer-main { flex: 1; padding: 16px 16px 24px; max-width: 680px; margin: 0 auto; width: 100%; }
.adm-customer-main.has-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.adm-customer-bottomnav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	background: #fff;
	border-top: 1px solid var(--adm-border);
	padding-bottom: env(safe-area-inset-bottom);
	z-index: 20;
}
.adm-nav-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 10px 0 8px;
	color: var(--adm-muted);
	text-decoration: none;
	font-size: 11px;
}
.adm-nav-item.active { color: var(--adm-primary); font-weight: 700; }
.adm-nav-icon { font-size: 20px; }

.adm-welcome { font-size: 20px; margin: 4px 0 16px; }

/* Tiles */
.adm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.adm-tile {
	background: var(--adm-surface);
	border-radius: var(--adm-radius);
	padding: 20px 16px;
	text-decoration: none;
	color: var(--adm-text);
	box-shadow: 0 1px 3px rgba(15,23,42,.06);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.adm-tile-primary { grid-column: span 2; background: var(--adm-bg); color: #fff; }
.adm-tile-primary .adm-tile-label { color: rgba(255,255,255,.7); }
.adm-tile-value { font-size: 30px; font-weight: 800; }
.adm-tile-label { font-size: 12px; color: var(--adm-muted); text-transform: uppercase; letter-spacing: .04em; }

.adm-quick-actions { display: flex; flex-direction: column; gap: 10px; }

/* Tabs */
.adm-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.adm-tab {
	flex: 1;
	text-align: center;
	padding: 10px 0;
	border-radius: 10px;
	background: var(--adm-surface);
	color: var(--adm-muted);
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
}
.adm-tab.active { background: var(--adm-bg); color: #fff; }

/* Order cards */
.adm-delivery-cards { display: flex; flex-direction: column; gap: 10px; }
.adm-delivery-card {
	background: var(--adm-surface);
	border-radius: var(--adm-radius);
	padding: 14px 16px;
	text-decoration: none;
	color: var(--adm-text);
	box-shadow: 0 1px 3px rgba(15,23,42,.06);
	display: block;
}
.adm-delivery-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm-delivery-card-meta { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--adm-muted); flex-wrap: wrap; }
.adm-delivery-card-address { margin-top: 6px; font-size: 13px; color: var(--adm-muted); }
.adm-empty { text-align: center; color: var(--adm-muted); padding: 40px 0; }

/* Badges */
.adm-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e2e8f0; color: #334155; }
.adm-badge-new { background: #e0e7ff; color: #3730a3; }
.adm-badge-assigned { background: #dbeafe; color: #1e40af; }
.adm-badge-accepted { background: #cffafe; color: #0e7490; }
.adm-badge-out_for_delivery { background: #fef3c7; color: #92400e; }
.adm-badge-arrived { background: #fde68a; color: #92400e; }
.adm-badge-delivered { background: #d1fae5; color: #065f46; }
.adm-badge-failed { background: #fee2e2; color: #991b1b; }
.adm-badge-rescheduled { background: #fce7f3; color: #9d174d; }
.adm-badge-cancelled { background: #f1f5f9; color: #475569; }

/* Detail sections */
.adm-detail-status { text-align: center; margin-bottom: 12px; }
.adm-detail-section {
	background: var(--adm-surface);
	border-radius: var(--adm-radius);
	padding: 16px;
	margin-bottom: 12px;
	box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.adm-detail-section h2 { margin: 0 0 4px; font-size: 18px; }
.adm-detail-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--adm-muted); text-transform: uppercase; letter-spacing: .04em; }
.adm-muted { color: var(--adm-muted); }
.adm-notes { background: var(--adm-surface-alt); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: 14px; }

.adm-deflist { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.adm-deflist dt { color: var(--adm-muted); font-size: 13px; }
.adm-deflist dd { margin: 0; font-weight: 600; text-align: right; font-size: 13px; }

.adm-attachment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.adm-attachment-list a { color: var(--adm-primary); text-decoration: none; font-size: 13px; }

.adm-driver-info-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.adm-driver-info-row .adm-avatar, .adm-driver-info-row .adm-avatar-photo { margin: 0; flex-shrink: 0; }

.adm-btn-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; padding: 12px 6px; }
.adm-btn-icon span { font-size: 22px; }

.adm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--adm-surface);
	border: 1px solid var(--adm-border);
	border-radius: 12px;
	padding: 12px 16px;
	text-decoration: none;
	color: var(--adm-text);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}
.adm-btn-block { width: 100%; }
.adm-btn-primary { background: var(--adm-primary); border-color: var(--adm-primary); color: #fff; padding: 16px; font-size: 16px; }
.adm-btn-primary:active { background: var(--adm-primary-dark); }
.adm-btn-danger { background: #fff; border-color: var(--adm-danger); color: var(--adm-danger); }
.adm-btn-secondary { background: var(--adm-surface-alt); }
.adm-btn:disabled { opacity: .6; }

.adm-form-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.adm-form-stack input, .adm-form-stack textarea, .adm-form-stack select {
	border: 1px solid var(--adm-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	width: 100%;
	font-family: inherit;
}
.adm-form-stack textarea { min-height: 60px; resize: vertical; }

.adm-feedback { border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.adm-feedback-success { background: #d1fae5; color: #065f46; }
.adm-feedback-error { background: #fee2e2; color: #991b1b; }

.adm-map { width: 100%; height: 260px; border-radius: var(--adm-radius); border: 1px solid var(--adm-border); background: var(--adm-surface); margin-bottom: 10px; }
.adm-selected-address { background: var(--adm-surface-alt); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.adm-location-error { color: #991b1b; background: #fee2e2; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }

/* Login / Register */
.adm-login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.adm-login-card {
	background: var(--adm-surface);
	border-radius: var(--adm-radius);
	padding: 28px 24px;
	max-width: 380px;
	width: 100%;
	box-shadow: 0 4px 16px rgba(15,23,42,.08);
	text-align: center;
}
.adm-login-card h1 { font-size: 20px; margin-bottom: 4px; }
.adm-login-card form { text-align: left; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.adm-login-card input[type=text], .adm-login-card input[type=password], .adm-login-card input[type=email] {
	border: 1px solid var(--adm-border);
	border-radius: 10px;
	padding: 12px;
	width: 100%;
	font-size: 14px;
}
.adm-login-card input[type=submit] {
	background: var(--adm-primary);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 14px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}
.adm-login-links { margin-top: 16px; font-size: 13px; }
.adm-login-links a { color: var(--adm-primary); text-decoration: none; }

.adm-field-label { font-size: 12px; font-weight: 700; color: var(--adm-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 6px; }

.adm-profile-header { text-align: center; }
.adm-avatar {
	width: 64px; height: 64px;
	border-radius: 50%;
	background: var(--adm-bg);
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-size: 26px; font-weight: 800;
	margin: 0 auto 10px;
}
.adm-avatar-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 10px; }
