/* Almutamyzon dashboard — works in RTL and LTR through logical properties. */

@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
	--amz-bg: #F4F6F8;
	--amz-surface: #FFFFFF;
	--amz-surface-2: #F9FAFB;
	--amz-ink: #101828;
	--amz-ink-2: #344054;
	--amz-muted: #475467;
	--amz-line: #E4E7EC;
	--amz-line-strong: #D0D5DD;
	--amz-primary: #0B57A4;
	--amz-primary-ink: #08427D;
	--amz-primary-soft: #E8F1FB;
	--amz-ok-bg: #ECFDF3; --amz-ok: #067647;
	--amz-warn-bg: #FFFAEB; --amz-warn: #93370D;
	--amz-bad-bg: #FEF3F2; --amz-bad: #B42318;
	--amz-info-bg: #EFF6FF; --amz-info: #0B57A4;
	--amz-mute-bg: #F2F4F7; --amz-mute: #344054;
	--amz-radius: 14px;
	--amz-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

html, body.amz { background: var(--amz-bg); }
html:has(body.amz), body.amz { overflow-x: clip; } /* safety net: never scroll sideways (clip keeps sticky headers working) */
body.amz {
	margin: 0;
	color: var(--amz-ink);
	font-family: var(--amz-font);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	--bs-body-font-family: var(--amz-font);
}
.amz h1, .amz h2, .amz h3 { font-family: var(--amz-font); color: var(--amz-ink); }
.amz a { color: var(--amz-primary); }
.amz a:hover { color: var(--amz-primary-ink); }
.amz :focus-visible { outline: 3px solid #84ADDA; outline-offset: 2px; }

.amz-skip { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100; background: var(--amz-ink); color: #fff !important; padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 8px; }
.amz-skip:focus { top: 12px; }

/* Layout */
.amz-layout { display: flex; min-height: 100vh; }
.amz-sidebar {
	flex: 0 0 264px;
	background: var(--amz-surface);
	border-inline-end: 1px solid var(--amz-line);
	padding: 20px 14px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	box-sizing: border-box;
}
.amz-main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.amz-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.amz-brand img { height: 40px; width: auto; }
.amz-brand-tag { font-size: 13px; color: var(--amz-muted); }
.amz-help { margin: auto 0 0; padding: 12px; border-radius: 12px; background: var(--amz-surface-2); border: 1px solid var(--amz-line); font-size: 13px; color: var(--amz-muted); }

/* Navigation */
.amz-nav { display: flex; flex-direction: column; gap: 2px; }
.amz .amz-nav-item {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
	border: 0; border-radius: 10px; background: transparent; color: var(--amz-ink-2);
	font: inherit; font-size: 15px; font-weight: 500; text-align: start; cursor: pointer; text-decoration: none;
}
.amz .amz-nav-item:hover { background: var(--amz-mute-bg); color: var(--amz-ink); }
.amz .amz-nav-item[aria-current="page"], .amz .amz-nav-item.is-active { background: var(--amz-primary-soft); color: var(--amz-primary); font-weight: 600; }
.amz-nav-item .amz-ico { width: 20px; height: 20px; flex: 0 0 20px; }
.amz-nav-item .amz-label { flex: 1; }
.amz-nav-item .amz-caret { font-size: 12px; color: #667085; transition: transform .15s; }
.amz-nav-item[aria-expanded="true"] .amz-caret { transform: rotate(180deg); }
.amz-nav-sub { display: flex; flex-direction: column; gap: 2px; padding-inline-start: 44px; padding-block: 4px; }
.amz-nav-sub[hidden] { display: none; }
.amz .amz-nav-subitem {
	display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
	color: var(--amz-muted); font-size: 14px; text-decoration: none;
}
.amz .amz-nav-subitem:hover { background: var(--amz-mute-bg); color: var(--amz-ink); }
.amz .amz-nav-subitem[aria-current="page"] { color: var(--amz-primary); background: #F5F9FE; font-weight: 600; }
.amz-count { display: inline-flex; min-width: 22px; justify-content: center; padding: 1px 8px; border-radius: 999px; background: var(--amz-warn-bg); color: var(--amz-warn); font-size: 12px; font-weight: 600; }

/* Top bar */
.amz-topbar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 28px;
	background: var(--amz-surface); border-bottom: 1px solid var(--amz-line);
}
.amz-top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.amz-icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--amz-line-strong); border-radius: 10px; background: var(--amz-surface); color: var(--amz-ink-2); cursor: pointer; }
.amz-menu-toggle { display: none; }
.amz .amz-user { display: flex; align-items: center; gap: 10px; padding-inline: 6px; min-height: 44px; border-radius: 10px; color: var(--amz-ink); text-decoration: none; }
.amz .amz-user:hover { background: var(--amz-mute-bg); }
.amz-avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--amz-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.amz-user-text { display: flex; flex-direction: column; line-height: 1.25; }
.amz-user-name { font-weight: 600; font-size: 14px; }
.amz-user-role { font-size: 12px; color: var(--amz-muted); }
.amz-net { font-size: 13px; color: var(--amz-muted); display: inline-flex; align-items: center; gap: 6px; }
.amz-net::before { content: ""; width: 9px; height: 9px; border-radius: 999px; background: #12B76A; }
.amz-net.is-offline { color: var(--amz-warn); font-weight: 600; }
.amz-net.is-offline::before { background: #F79009; }

/* Buttons (self-contained so the offline page works without Bootstrap) */
.amz .btn, .amz-btn-primary, .amz-btn-outline, .amz-btn-ghost {
	white-space: nowrap;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600;
	cursor: pointer; text-decoration: none;
}
.amz-btn-primary { background: var(--amz-primary); border: 1px solid var(--amz-primary); color: #fff !important; }
.amz-btn-primary:hover { background: var(--amz-primary-ink); }
.amz-btn-outline { background: var(--amz-surface); border: 1px solid var(--amz-line-strong); color: var(--amz-ink) !important; }
.amz-btn-outline:hover { background: var(--amz-surface-2); }
.amz-btn-ghost { background: transparent; border: 1px solid transparent; color: var(--amz-ink-2) !important; }
.amz-btn-ghost:hover { background: var(--amz-mute-bg); }
.amz .btn:disabled { opacity: .55; cursor: not-allowed; }

/* Content */
.amz-content { padding: 24px 28px 48px; max-width: 1240px; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; }
.amz-content:focus { outline: none; }
.amz-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.amz-page-head h1 { margin: 0; font-size: 26px; font-weight: 700; }
.amz-eyebrow { margin: 0; font-size: 13px; color: var(--amz-muted); }
.amz-sub { margin: 4px 0 0; color: var(--amz-muted); }
.amz-card { background: var(--amz-surface); border: 1px solid var(--amz-line); border-radius: var(--amz-radius); }
.amz-card-pad { padding: 18px; }
.amz-card h2 { margin: 0; font-size: 17px; font-weight: 700; }
.amz-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--amz-line); }

.amz-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.amz-kpi { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.amz-kpi-label { font-size: 14px; color: var(--amz-muted); }
.amz-kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }

.amz-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.amz-status-card {
	display: flex; flex-direction: column; gap: 4px; min-height: 72px; padding: 12px 14px;
	border: 1px solid var(--amz-line); border-radius: 12px; background: var(--amz-surface-2);
	color: var(--amz-ink) !important; text-decoration: none; text-align: start;
}
.amz-status-card:hover { border-color: var(--amz-line-strong); background: var(--amz-surface); }
.amz-status-card span:first-child { font-size: 13px; color: var(--amz-muted); }
.amz-status-card strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.amz-attention { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.amz-att-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--amz-surface-2); border: 1px solid #EAECF0; color: var(--amz-ink) !important; text-decoration: none; }
.amz-att-item:hover { border-color: var(--amz-line-strong); }
.amz-att-item strong { font-size: 20px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

.amz-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.amz-b-ok { background: var(--amz-ok-bg); color: var(--amz-ok); }
.amz-b-warn { background: var(--amz-warn-bg); color: var(--amz-warn); }
.amz-b-bad { background: var(--amz-bad-bg); color: var(--amz-bad); }
.amz-b-info { background: var(--amz-info-bg); color: var(--amz-info); }
.amz-b-mute { background: var(--amz-mute-bg); color: var(--amz-mute); }

/* Tabs and filters */
.amz-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.amz-tab { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--amz-line-strong); border-radius: 999px; background: var(--amz-surface); color: var(--amz-ink-2) !important; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.amz-tab[aria-current="page"] { background: var(--amz-primary); border-color: var(--amz-primary); color: #fff !important; font-weight: 600; }
.amz-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.amz-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--amz-muted); flex: 1 1 280px; max-width: 460px; }
.amz-input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--amz-line-strong); border-radius: 10px; font: inherit; font-size: 14px; background: var(--amz-surface); color: var(--amz-ink); }

/* Tables */
.amz-table-wrap { overflow-x: auto; position: relative; }
.amz-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }
.amz-table th { background: var(--amz-surface-2); color: var(--amz-muted); font-weight: 600; text-align: start; padding: 10px 12px; white-space: nowrap; }
.amz-table td { padding: 12px; border-top: 1px solid #EAECF0; vertical-align: top; }
.amz-table th:first-child, .amz-table td:first-child { padding-inline-start: 18px; }
.amz-table tbody tr:hover { background: #FAFBFC; }
.amz-table td a { display: inline-flex; align-items: center; min-height: 24px; }
@media (max-width: 991.98px), (pointer: coarse) { .amz-table td a { min-height: 44px; } }
.amz-cell-sub { font-size: 13px; color: var(--amz-muted); }
.amz-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amz-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--amz-line); font-size: 14px; color: var(--amz-muted); }
.amz-pager-btns { display: flex; gap: 8px; }

/* States */
.amz-empty { padding: 40px 24px; text-align: center; color: var(--amz-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.amz-empty h2 { font-size: 20px; margin: 0; }
.amz-empty p { margin: 0; max-width: 520px; }
.amz-dashed { border-style: dashed; border-color: var(--amz-line-strong); }
.amz-skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 50%, #EEF0F3 75%); background-size: 200% 100%; animation: amz-shimmer 1.4s infinite; }
@keyframes amz-shimmer { to { background-position: -200% 0; } }
.amz-error { border-color: #FDA29B; background: var(--amz-bad-bg); color: #7A271A; padding: 16px 18px; border-radius: 12px; }
.amz-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.amz-row > .amz-grow { flex: 999 1 520px; min-width: 0; }
.amz-row > .amz-side { flex: 1 1 300px; }

/* Utilities (no inline styles: the strict content security policy forbids them) */
.amz-w40 { width: 40%; } .amz-w70 { width: 70%; }
.amz-error-body { margin: 6px 0 10px; }
.amz-empty-title { font-size: 22px; margin: 0; }
.amz-self-start { align-self: flex-start; }
.amz-strong { font-weight: 600; }
.amz-start { text-align: start; }
.amz-mt6 { margin-top: 6px; }
.amz-flex1 { flex: 1; }

/* Detail screen */
.amz .amz-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.amz .amz-back::before { content: "→"; margin-inline-end: 6px; }
[dir="ltr"] .amz .amz-back::before { content: "←"; }
.amz-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.amz-actionbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: var(--amz-surface); border: 1px solid var(--amz-line); border-radius: var(--amz-radius); }
.amz-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.amz-dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px 14px; margin: 14px 0 0; }
.amz-dl dt { color: var(--amz-muted); font-weight: 500; }
.amz-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.amz-h3 { font-size: 15px; margin: 18px 0 8px; }
.amz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.amz-list li { padding: 10px 12px; border: 1px solid #EAECF0; border-radius: 10px; background: var(--amz-surface-2); }
.amz-timeline { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.amz-timeline li { position: relative; padding-inline-start: 22px; }
.amz-timeline li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 8px; width: 9px; height: 9px; border-radius: 999px; background: var(--amz-primary); }
.amz-text-bad { color: var(--amz-bad); }
.amz-ok { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--amz-ok-bg); color: #054F31; border: 1px solid #ABEFC6; }
.amz-hidden { display: none !important; }
.amz .amz-row-link { color: var(--amz-ink); text-decoration: none; display: block; }
.amz .amz-row-link:hover { color: var(--amz-primary); text-decoration: underline; }
.amz-inline-link { font-weight: 600; }
.amz-btn-danger, .amz-btn-danger-outline { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.amz-btn-danger { background: var(--amz-bad); border: 1px solid var(--amz-bad); color: #fff !important; }
.amz-btn-danger-outline { background: var(--amz-surface); border: 1px solid #FDA29B; color: var(--amz-bad) !important; }

/* Dialogs */
.amz-dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(16, 24, 40, .25); color: var(--amz-ink); font-family: var(--amz-font); }
.amz-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.amz-dialog-form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.amz-dialog-form h2 { margin: 0; font-size: 19px; }
.amz-dialog-form p { margin: 0; }
.amz-dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.amz-form-row { display: flex; flex-direction: column; gap: 4px; }
.amz-form-row label { font-weight: 600; font-size: 14px; }
.amz-help-text { font-size: 13px; color: var(--amz-muted); }
.amz-textarea { min-height: 72px; padding: 10px 14px; resize: vertical; }
select.amz-input { padding-inline-end: 32px; }

/* Trips & driver app */
.amz-trip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.amz .amz-trip-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--amz-surface); border: 1px solid var(--amz-line); border-radius: var(--amz-radius); color: var(--amz-ink); text-decoration: none; min-height: 44px; }
.amz .amz-trip-card:hover { border-color: var(--amz-line-strong); }
.amz-trip-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.amz-trip-time { font-size: 20px; font-variant-numeric: tabular-nums; margin-inline-end: auto; }
.amz-progress { height: 8px; border-radius: 999px; background: var(--amz-mute-bg); overflow: hidden; }
.amz-progress-bar { display: block; height: 100%; background: var(--amz-primary); border-radius: 999px; }
.amz-w-0 { width: 0%; } .amz-w-5 { width: 5%; } .amz-w-10 { width: 10%; } .amz-w-15 { width: 15%; } .amz-w-20 { width: 20%; } .amz-w-25 { width: 25%; } .amz-w-30 { width: 30%; } .amz-w-35 { width: 35%; } .amz-w-40 { width: 40%; } .amz-w-45 { width: 45%; } .amz-w-50 { width: 50%; } .amz-w-55 { width: 55%; } .amz-w-60 { width: 60%; } .amz-w-65 { width: 65%; } .amz-w-70 { width: 70%; } .amz-w-75 { width: 75%; } .amz-w-80 { width: 80%; } .amz-w-85 { width: 85%; } .amz-w-90 { width: 90%; } .amz-w-95 { width: 95%; } .amz-w-100 { width: 100%; } 
.amz-trip-details { padding: 0; overflow: hidden; }
.amz-trip-details > summary { list-style: none; cursor: pointer; }
.amz-trip-details > summary::-webkit-details-marker { display: none; }
.amz-trip-details > summary .amz-trip-card { border: 0; border-radius: 0; pointer-events: none; }
.amz-trip-details[open] > summary { border-bottom: 1px solid var(--amz-line); }
.amz-pad { padding: 12px 16px 16px; }
.amz-li-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.amz-unread { border-inline-start: 4px solid var(--amz-primary) !important; }
.amz-syncbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--amz-ok-bg); color: #054F31; border: 1px solid #ABEFC6; font-weight: 600; }
.amz-syncbar.has-pending { background: var(--amz-warn-bg); color: var(--amz-warn); border-color: #FEDF89; }
.amz-manifest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.amz-mf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; background: var(--amz-surface); border: 1px solid var(--amz-line); border-radius: var(--amz-radius); }
.amz-mf-row.is-boarded { border-inline-start: 5px solid var(--amz-ok); }
.amz-mf-row.is-absent { border-inline-start: 5px solid var(--amz-bad); }
.amz-mf-who { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.amz-mf-who strong { font-size: 17px; }
.amz-mf-actions { display: flex; gap: 8px; flex: 1 1 240px; }
.amz-mf-actions .btn { flex: 1; }
.amz .amz-btn-big { min-height: 56px; font-size: 16px; }
.amz-w100 { width: 100%; }
.amz-sticky-actions { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--amz-bg) 70%, transparent); }

/* Forms and management screens */
.amz-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px 20px; }
.amz-form > *, .amz-form-row { min-width: 0; } /* long option labels must not widen the column */
select.amz-input { max-width: 100%; text-overflow: ellipsis; }
.amz-form-wide { grid-column: 1 / -1; }
.amz-form-wide > h2 { font-size: 17px; margin: 8px 0 4px; }
.amz-form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.amz-form-actions > p { flex: 1 1 100%; margin: 0; }
.amz-field-error { margin: 2px 0 0; color: var(--amz-bad); font-size: 13px; font-weight: 600; }
.amz-req { color: var(--amz-bad); }
.amz-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; color: var(--amz-ink-2); }
.amz-check input { width: 20px; height: 20px; accent-color: var(--amz-primary); flex: 0 0 auto; }
.amz-checklist { display: flex; flex-wrap: wrap; gap: 0 18px; }
.amz-fieldset { border: 1px solid var(--amz-line); border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 12px; min-width: 0; }
.amz-fieldset legend { font-weight: 600; font-size: 14px; padding: 0 6px; float: none; width: auto; margin: 0; }
.amz-price-grid { border-collapse: collapse; width: 100%; min-width: 420px; }
.amz-price-grid th, .amz-price-grid td { padding: 6px; text-align: start; font-size: 14px; }
.amz-price-grid thead th { color: var(--amz-muted); font-weight: 600; }
.amz-lookup { display: flex; flex-direction: column; gap: 6px; }
.amz-password { font-size: 24px; font-weight: 700; letter-spacing: 1px; padding: 12px; background: var(--amz-surface-2); border: 1px dashed var(--amz-line-strong); border-radius: 10px; text-align: center; user-select: all; }
.amz-card-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
@media (max-width: 640px) {
	.amz-form { grid-template-columns: 1fr; }
	.amz-form-actions .btn { flex: 1 1 100%; }
	.amz-checklist { flex-direction: column; }
	.amz-price-grid { min-width: 0; }
	.amz-price-grid thead { display: none; }
	.amz-price-grid tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px 0; border-top: 1px solid var(--amz-line); }
	.amz-price-grid tr > th { grid-column: 1 / -1; }
	.amz-price-grid td { padding: 0; }
	.amz-price-grid td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--amz-muted); margin-bottom: 2px; }
}

/* Parent self-service and settings */
.amz-wizard { display: flex; flex-direction: column; gap: 14px; }
.amz-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.amz-choice { display: flex; align-items: flex-start; gap: 10px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--amz-line-strong); border-radius: 12px; background: var(--amz-surface); cursor: pointer; }
.amz-choice:has(input:checked) { border-color: var(--amz-primary); background: var(--amz-primary-soft); box-shadow: 0 0 0 1px var(--amz-primary) inset; }
.amz-choice input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--amz-primary); flex: 0 0 auto; }
.amz-choice-text { display: flex; flex-direction: column; gap: 2px; }
.amz-terms { max-height: 180px; overflow-y: auto; white-space: pre-wrap; padding: 12px; border: 1px solid var(--amz-line); border-radius: 10px; background: var(--amz-surface-2); font-size: 14px; margin: 10px 0; }
.amz-test-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.amz-test-row .amz-input { flex: 1 1 200px; width: auto; }
.amz-test-row p { flex: 1 1 100%; margin: 0; }
.amz-signup { max-width: 440px; width: 100%; text-align: start; align-items: stretch; }
.amz-signup-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.amz-signup-body { display: flex; flex-direction: column; gap: 12px; }
.amz-signup-body h1 { font-size: 22px; margin: 4px 0 0; }
.amz-signup-form { display: flex; flex-direction: column; gap: 12px; text-align: start; }
.amz-signup .amz-form-row { align-items: stretch; }
.amz-code-row { display: flex; gap: 8px; align-items: flex-end; }
.amz-code-row .amz-form-row { flex: 1; }
.amz-trap { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; } /* hidden in place: an off-screen offset would widen RTL pages */

/* Offline and install */
.amz-stale { margin: 0; padding: 10px 28px; background: var(--amz-warn-bg); color: var(--amz-warn); border-bottom: 1px solid #FEDF89; font-size: 14px; font-weight: 600; }
@media (max-width: 991.98px) { .amz-stale { padding: 10px 16px; } }
.amz-draft-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px; border-radius: 12px; background: var(--amz-info-bg); color: var(--amz-info); font-weight: 600; font-size: 14px; }
.amz-toast { position: fixed; inset-inline: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; max-width: 520px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--amz-ink); color: #fff; box-shadow: 0 12px 30px rgba(16, 24, 40, .25); }
body.amz-has-bottomnav .amz-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
.amz-steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.amz-installbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 28px; padding-inline-start: 28px; background: var(--amz-primary-soft); color: var(--amz-ink); border-bottom: 1px solid var(--amz-line); font-size: 14px; }
.amz-installbar > span { flex: 1 1 auto; min-width: 0; }
.amz-installbar .btn { flex: 0 0 auto; }
.amz-installbar-x { border: 0; background: transparent; font-size: 22px; line-height: 1; }
@media (max-width: 991.98px) { .amz-installbar { padding-inline: 16px 8px; } }
@media (max-width: 640px) {
	/* Phones: the connection status shows only its dot (screen readers still hear the text). */
	.amz-net { font-size: 0; gap: 0; }
	.amz-net::before { width: 11px; height: 11px; }
	.amz-installbar > span { font-size: 13px; }
}

/* Support thread, exports */
.amz-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.amz-msg { max-width: min(560px, 88%); padding: 10px 14px; border-radius: 14px; background: var(--amz-surface-2); border: 1px solid var(--amz-line); align-self: flex-start; }
.amz-msg.is-mine { align-self: flex-end; background: var(--amz-primary-soft); border-color: #C7DBF2; }
.amz-msg.is-office:not(.is-mine) { border-inline-start: 4px solid var(--amz-primary); }
.amz-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.amz-export-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .amz-export-row .btn { flex: 1 1 100%; } }

/* Offline page */
.amz-offline-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.amz-offline-card { max-width: 460px; background: var(--amz-surface); border: 1px solid var(--amz-line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.amz-offline-card h1 { font-size: 22px; margin: 6px 0 0; }
.amz-offline-card h2 { font-size: 18px; margin: 0; }
.amz-offline-card hr { width: 100%; border: 0; border-top: 1px solid var(--amz-line); margin: 10px 0; }
.amz-offline-card div[lang="en"] { display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* Phones and small tablets: sidebar becomes a drawer */
@media (max-width: 991.98px) {
	.amz-menu-toggle { display: inline-flex; }
	.amz-sidebar {
		position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: 84vw; max-width: 300px;
		transform: translateX(-105%); transition: transform .2s ease, visibility 0s linear .2s; box-shadow: 0 10px 40px rgba(16, 24, 40, .18); overflow-y: auto;
		visibility: hidden; /* closed drawer: not visible, not focusable, adds no page width */
	}
	[dir="rtl"] .amz-sidebar { transform: translateX(105%); }
	.amz-sidebar.is-open { transform: translateX(0); visibility: visible; transition: transform .2s ease, visibility 0s; }
	.amz-topbar { padding: 12px 16px; }
	.amz-content { padding: 18px 16px 40px; }
	.amz-user-text { display: none; }
	.amz-topbar { flex-wrap: nowrap; gap: 8px; }
	.amz-top-actions { flex-wrap: nowrap; gap: 4px; }
	.amz-top-actions .btn { padding: 0 10px; }
	.amz-net { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.amz-page-head h1 { font-size: 22px; }
}
.amz-scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 40; }

/* ---------- Mobile pass ---------- */
.amz-topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
@media (max-width: 991.98px) {
	.amz-topbar { padding-top: calc(12px + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 30; }
	.amz-sidebar { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
	.amz-content { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
	body.amz { font-size: 16px; }
	.amz-input { font-size: 16px; } /* prevents iOS zoom on focus */
	.amz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.amz-kpi { padding: 14px; }
	.amz-kpi-value { font-size: clamp(17px, 5vw, 24px); overflow-wrap: normal; line-height: 1.2; }
	.amz-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.amz-detail-grid, .amz-trip-list { grid-template-columns: 1fr; }
	.amz-dl { grid-template-columns: 1fr; gap: 2px 0; }
	.amz-dl dd { margin-bottom: 10px; }
	.amz-actionbar { position: sticky; bottom: 0; z-index: 20; padding-bottom: calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(16, 24, 40, .08); }
	.amz-actionbar .btn { flex: 1 1 calc(50% - 8px); }
	.amz-field { max-width: none; flex: 0 0 auto; } /* in a stacked toolbar a 280px basis would become 280px of height */
	.amz-toolbar { flex-direction: column; align-items: stretch; }
	.amz-pager { flex-direction: column; align-items: stretch; }
	.amz-pager-btns .btn { flex: 1; }
	/* Tables become cards: each cell shows its column name (set by the app). */
	.amz-table, .amz-table-narrow { min-width: 0; }
	/* Headers stay for screen readers but take no space (also in RTL, where hidden cells used to push 3px past the edge). */
	.amz-table thead, .amz-table thead tr, .amz-table thead th { display: block; }
	.amz-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; inset-inline-start: 0; }
	.amz-table, .amz-table tbody, .amz-table tr, .amz-table td { display: block; width: 100%; box-sizing: border-box; }
	.amz-table tr { padding: 12px 14px; border-top: 1px solid var(--amz-line); }
	.amz-table tbody tr:first-child { border-top: 0; }
	.amz-table td { border: 0; padding: 4px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
	.amz-table td::before { content: attr(data-label); color: var(--amz-muted); font-weight: 500; text-align: start; flex: 0 0 auto; }
	.amz-table td { flex-wrap: wrap; }
	.amz-table td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
	.amz-table .amz-num { white-space: normal; }
	.amz-content > * { min-width: 0; max-width: 100%; }
	.amz-tabs { max-width: 100%; }
	/* Dialogs become bottom sheets */
	.amz-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; }
	.amz-dialog-form { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
	.amz-dialog-actions { flex-direction: column-reverse; }
	.amz-dialog-actions .btn { width: 100%; }
	.amz-top-actions .amz-btn-ghost { padding: 0 8px; font-size: 13px; }
	.amz-top-actions .amz-btn-outline { padding: 0 10px; }
}

/* Bottom tab bar (parents and drivers on phones) */
body.amz-single-section .amz-menu-toggle { display: none !important; }
@media (max-width: 991.98px) { body.amz-single-section .amz-sidebar { display: none; } }
.amz-bottomnav { display: none; }
@media (max-width: 991.98px) {
	body.amz-has-bottomnav .amz-bottomnav {
		display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
		background: var(--amz-surface); border-top: 1px solid var(--amz-line);
		padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
	}
	body.amz-has-bottomnav .amz-menu-toggle { display: none; }
	body.amz-has-bottomnav .amz-content { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
	body.amz-has-bottomnav .amz-sticky-actions,
	body.amz-has-bottomnav .amz-actionbar { bottom: calc(64px + env(safe-area-inset-bottom)); }
	.amz .amz-bn-item {
		flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
		color: var(--amz-muted); text-decoration: none; font-size: 12px; font-weight: 500; padding: 6px 2px;
	}
	.amz .amz-bn-item[aria-current="page"] { color: var(--amz-primary); font-weight: 700; }
	.amz .amz-bn-item[aria-current="page"] .amz-ico { transform: translateY(-1px); }
	.amz-bn-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
