:root {
  --portal-blue: #075fbe;
  --portal-blue-deep: #053879;
  --portal-navy: #081a3a;
  --portal-canvas: #f5f8fc;
  --portal-line: #dce5f1;
  --portal-muted: #60708c;
  --portal-shadow: 0 8px 24px rgba(27, 53, 94, .08);
}

body { font-size: 14px; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { color: var(--text); font-size: 28px; line-height: 1.18; }
h2 { color: var(--text); font-size: 18px; line-height: 1.25; }
.primary-button, .secondary-button, .text-link { justify-content: center; text-decoration: none; }

/* Authenticated application shell */
.app-body { min-height: 100vh; background: var(--portal-canvas); }
.topbar {
  left: 266px;
  height: 76px;
  justify-content: flex-end;
  padding: 0 26px;
  border: 0;
  background: transparent;
  color: var(--text);
}
.topbar .brand {
  position: fixed;
  z-index: 2;
  top: 14px;
  left: 8px;
  width: 250px;
}
.topbar .brand img { width: 250px; height: 50px; }
.account { color: var(--text); }
.account-copy { display: grid; min-width: 0; max-width: 160px; text-align: left; }
.account-copy strong { overflow: hidden; order: 1; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { order: 2; color: var(--muted); font-size: 11px; }
.account-avatar { border-color: var(--portal-line); background: #edf3fb; color: var(--portal-blue-deep); }
.account-avatar .ui-icon { width: 22px; height: 22px; }
.topbar-action { border: 0; }
.topbar-action .ui-icon { filter: none; }
.notification-button { position: relative; border: 0; background: transparent; }
.notification-button .ui-icon { filter: none; }
.notification-button span {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #ef3340;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}
.sidebar {
  top: 0;
  width: 266px;
  padding: 90px 14px 16px;
  background: #064b96;
  box-shadow: inset -1px 0 rgba(255,255,255,.08);
}
.sidebar-label { margin: 8px 8px 10px; color: rgba(255,255,255,.65); font-size: 10px; }
.sidebar a { height: 46px; padding: 0 14px; color: rgba(255,255,255,.92); font-size: 13px; }
.sidebar a[aria-current="page"] { background: #0878e8; box-shadow: 0 7px 18px rgba(0,34,89,.18); }
.sidebar-theme { margin-top: auto; }
.app-main {
  width: calc(100% - 266px);
  margin-left: 266px;
  padding: 47px 22px 28px;
}
.page-heading { min-height: 52px; margin-bottom: 18px; transform: translateY(-20px); }
.page-heading .eyebrow { margin: 0 0 4px; color: var(--portal-muted); font-size: 13px; font-weight: 500; text-transform: none; }
.page-heading h1 { font-size: 27px; }
.content-section, .wizard, .filter-bar, .danger-zone {
  border: 1px solid var(--portal-line);
  background: var(--surface);
  box-shadow: var(--portal-shadow);
}
.content-section { padding: 20px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 15px; }
.role-admin .metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metrics article { min-height: 98px; border: 1px solid var(--portal-line); background: var(--surface); box-shadow: var(--portal-shadow); }
.role-admin .metrics article { min-height: 129px; }
.metrics article > div > span { color: var(--portal-muted); }
.metric-icon { order: 2; margin-left: auto; }
.metrics strong { font-size: 27px; }
.section-heading h2 { font-size: 18px; }
.filter-bar { padding: 18px; border-radius: 8px; }
.order-list { background: var(--surface); box-shadow: var(--portal-shadow); }
.order-card { min-height: 102px; padding: 16px 20px; }
.order-card-top { align-items: center; }
.order-id { font-size: 13px; }
.route-line { grid-template-columns: minmax(180px, 1fr) 34px minmax(180px, 1fr); }
.route-line b { background: transparent; }
.stage { white-space: nowrap; }
.responsive-table { border: 1px solid var(--portal-line); border-radius: 8px; }
.responsive-table th { height: 48px; color: var(--text); font-size: 11px; }
.responsive-table td { height: 58px; }
.admin-analytics { display: grid; grid-template-columns: 478px minmax(480px,1fr); gap: 16px; margin-bottom: 14px; }
.admin-analytics .content-section { min-height: 280px; margin-top: 0; }
.role-admin .admin-analytics + .content-section { margin-top: 0; }
.status-overview { display: grid; grid-template-columns: 1fr 130px; align-items: center; }
.status-overview h2 { grid-column: 1 / -1; }
.donut {
  position: relative;
  display: grid;
  width: 124px;
  aspect-ratio: 1;
  place-content: center;
  border-radius: 50%;
  background: conic-gradient(#41bd73 0 var(--done), #3389ef var(--done) 100%);
  color: var(--text);
  text-align: center;
}
.donut::before { position: absolute; top: 50%; left: 50%; width: 78px; aspect-ratio: 1; border-radius: 50%; background: var(--surface); content: ""; transform: translate(-50%, -50%); }
.donut strong, .donut span { position: relative; z-index: 1; }
.donut strong { font-size: 22px; }
.donut span { color: var(--muted); font-size: 11px; }
.status-legend { display: grid; gap: 14px; }
.status-legend span { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.status-legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-success { background: #41bd73; }
.legend-info { background: #3389ef; }
.legend-warning { background: #f59a18; }
.legend-neutral { background: #91a0b7; }
.legend-new { background: #8b50dc; }
.trend-chart { position: relative; height: 180px; margin-top: 10px; border-bottom: 1px solid var(--portal-line); background: repeating-linear-gradient(to bottom, var(--portal-line) 0 1px, transparent 1px 44px); }
.trend-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.trend-area { fill: #dbeaff; opacity: .7; }
.trend-line { fill: none; stroke: #0878e8; stroke-width: 2.2; }
.trend-points circle { fill: #0878e8; stroke: #fff; stroke-width: 2; }
.orders-filter-bar { grid-template-columns: minmax(320px,1fr) minmax(200px,260px); padding: 20px; margin: 0; border-radius: 8px 8px 0 0; box-shadow: none; }
.orders-table { overflow: hidden; border: 1px solid var(--portal-line); border-radius: 0 0 8px 8px; background: var(--surface); box-shadow: var(--portal-shadow); }
.orders-table-head, .orders-table-row { display: grid; grid-template-columns: 64px 110px minmax(150px,1.25fr) minmax(150px,1.25fr) 120px 120px 105px 105px; gap: 12px; align-items: center; }
.orders-table-head { min-height: 54px; padding: 0 18px; background: #f7f9fc; color: var(--text); font-size: 11px; font-weight: 700; }
.orders-table-row { min-height: 88px; padding: 12px 18px; border-top: 1px solid var(--portal-line); font-size: 12px; }
.orders-table-row:hover { background: color-mix(in srgb, var(--surface) 76%, #eaf3ff); }
.orders-table-row strong { font-weight: 600; line-height: 1.45; }
.table-id { color: var(--portal-blue); font-weight: 700; text-decoration: none; }
.table-open { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.orders-table-footer { display: flex; min-height: 60px; align-items: center; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--portal-line); color: var(--muted); font-size: 12px; }
.orders-table-footer div { display: flex; gap: 6px; }
.orders-table-footer button { width: 34px; height: 34px; border: 1px solid var(--portal-line); border-radius: 6px; background: var(--surface); color: var(--text); }
.orders-table-footer button[aria-current="page"] { border-color: var(--portal-blue); background: var(--portal-blue); color: #fff; }
.dashboard-orders-table { overflow: hidden; border: 1px solid var(--portal-line); border-radius: 7px; }
.dashboard-orders-head, .dashboard-orders-row { display: grid; grid-template-columns: 52px 128px minmax(150px,1fr) minmax(150px,1fr) 130px 130px 108px 42px; gap: 10px; align-items: center; }
.dashboard-orders-head { min-height: 42px; padding: 0 14px; background: #f7f9fc; font-size: 10px; font-weight: 700; }
.dashboard-orders-row { min-height: 58px; padding: 8px 14px; border-top: 1px solid var(--portal-line); font-size: 11px; }
.dashboard-orders-row > a:first-child { color: var(--portal-blue); font-weight: 700; text-decoration: none; }
.dashboard-orders-row .icon-button { width: 36px; height: 36px; }

/* Public landing */
.landing-body { background: #f6f9fd; }
.public-header { min-height: 90px; background: #0757a1; }
.public-header-inner { width: min(1400px, calc(100% - 72px)); }
.public-nav { justify-content: flex-start; gap: 52px; }
.public-nav a { font-size: 14px; }
.public-header-actions { gap: 28px; }
.support-link { padding: 12px 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; background: rgba(255,255,255,.06); }
.landing-content { width: min(1300px, calc(100% - 64px)); padding: 38px 0 28px; }
.landing-hero {
  position: relative;
  min-height: 470px;
  grid-template-columns: minmax(0, 1fr) 535px;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--portal-shadow);
}
.landing-hero::before {
  position: absolute;
  inset: 112px 43% 0 0;
  background: url('/assets/portal-fleet-hero.webp') left bottom / cover no-repeat;
  opacity: .1;
  mask-image: linear-gradient(to right, #000 62%, transparent 100%);
  content: "";
}
.landing-intro { position: relative; z-index: 1; min-height: 468px; padding: 56px 50px 38px; background: transparent; }
.landing-intro h1 { max-width: 650px; margin: 0; font-size: 42px; line-height: 1.12; }
.landing-intro h1 span { display: block; margin-top: 4px; color: #0664d9; }
.landing-intro > p { max-width: 460px; margin-top: 26px; color: #51627d; font-size: 18px; line-height: 1.55; }
.landing-features { position: absolute; right: 34px; bottom: 38px; left: 50px; gap: 48px; }
.landing-features > div { padding: 0; background: transparent; }
.feature-mark { width: 58px; height: 58px; border: 1px solid #c9ddfa; border-radius: 8px; background: rgba(255,255,255,.92); }
.landing-qr { z-index: 1; align-self: center; width: calc(100% - 48px); min-height: 378px; margin-right: 24px; padding: 28px 24px; border: 1px solid #e1e7f0; border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 8px 24px rgba(27,53,94,.08); }
.landing-qr h2 { margin-bottom: 20px; font-size: 20px; text-align: center; }
.qr-launch-panel { min-height: 194px; padding: 22px 16px 14px; border-radius: 7px; background: #f5f9ff; }
.qr-device-mark { height: 90px; }
.qr-camera-button { min-height: 50px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.landing-roles { gap: 18px; margin: 28px 50px 0; }
.landing-role { min-height: 116px; border-radius: 8px; }
.landing-role-master { background: #edf5ff; }
.landing-role-driver { background: #edf9f1; }
.landing-advantages { padding: 38px 0 4px; }
.landing-help { display: none; }
.public-footer { background: #0757a1; }
.footer-actions > a { padding-left: 18px; border-left: 1px solid rgba(255,255,255,.22); }

/* Login screens */
.auth-body { background: var(--portal-canvas); }
.auth-body .guest-theme { z-index: 20; }
.auth-shell { background: var(--portal-canvas); }
.auth-brand { background-color: #074a92; }
.auth-brand::before {
  position: absolute;
  inset: 0;
  background: url('/assets/portal-fleet-hero.webp') center bottom / cover no-repeat;
  opacity: .17;
  content: "";
}
.auth-brand::after { position: absolute; inset: 0; background: rgba(0,55,120,.38); content: ""; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand > img:first-child { width: 274px; height: 58px; }
.auth-panel { width: min(560px, calc(100% - 72px)); padding: 42px 44px; border: 1px solid var(--portal-line); background: var(--surface); }
.auth-panel h1 { margin-bottom: 8px; text-align: center; }
.auth-panel > p { text-align: center; }
.auth-panel form { gap: 12px; }
.field-with-icon { position: relative; display: flex; align-items: center; }
.field-with-icon .ui-icon { position: absolute; z-index: 1; left: 16px; width: 20px; height: 20px; }
.field-with-icon input { width: 100%; padding-left: 48px; }
.remember-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; color: var(--text); }
.remember-row input { min-height: 18px; }
.remember-row a { color: var(--portal-blue); text-decoration: none; }
.auth-divider { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--portal-line); content: ""; }
.auth-role-icon { margin-right: auto; margin-left: auto; }
.auth-shell-driver { display: block; padding: 135px 20px 156px; background: #0757a1 url('/assets/portal-fleet-hero.webp') center / cover no-repeat fixed; }
.auth-shell-driver::before { position: fixed; inset: 0; background: rgba(0,82,164,.79); content: ""; }
.auth-shell-driver .auth-brand { position: absolute; top: 32px; left: 50%; min-height: 70px; padding: 0; background: transparent; transform: translateX(-50%); }
.auth-shell-driver .auth-brand::before, .auth-shell-driver .auth-brand::after, .auth-shell-driver .auth-brand p { display: none; }
.auth-shell-driver .auth-brand > img:first-child { width: 320px; height: 70px; object-position: center; }
.auth-shell-driver .auth-panel { position: relative; display: flex; width: min(708px, calc(100% - 32px)); height: auto; min-height: 687px; flex-direction: column; justify-content: flex-start; margin: 0 auto; padding: 34px 44px; }
.auth-shell-driver .auth-role-icon { width: 86px; height: 86px; margin-right: auto; margin-bottom: 22px; margin-left: auto; }
.auth-shell-driver .auth-role-icon .ui-icon { width: 40px; height: 40px; }
.auth-shell-driver .auth-panel h1 { font-size: 34px; }
.auth-shell-driver .auth-panel > p { margin-top: 14px; font-size: 18px; }
.auth-shell-driver .auth-panel form { gap: 10px; margin-top: 14px; }
.auth-shell-driver input, .auth-shell-driver .primary-button, .auth-shell-driver .secondary-button { min-height: 56px; }
.auth-shell-driver .back-link { display: none; }
.driver-auth-help { position: absolute; z-index: 1; bottom: 72px; left: 50%; display: flex; align-items: center; gap: 14px; min-height: 44px; max-width: calc(100% - 32px); border-radius: 6px; color: #fff; text-decoration: none; transform: translateX(-50%); }
.driver-auth-help:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.driver-auth-help:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.driver-auth-help .ui-icon { width: 42px; height: 42px; flex-shrink: 0; filter: brightness(0) invert(1); }
.driver-auth-help p { display: grid; margin: 0; }
.driver-auth-help span { font-size: 13px; }
.driver-auth-copyright { position: absolute; z-index: 1; bottom: 24px; left: 50%; color: rgba(255,255,255,.82); transform: translateX(-50%); }
.auth-shell-admin .auth-brand { padding: 60px 42px 34px; }
.auth-shell-admin { grid-template-columns: 540px minmax(0, 1fr); }
.auth-shell-admin .auth-brand > div { margin: auto 0; }
.auth-shell-admin .auth-brand h2 { color: #fff; font-size: 27px; }
.auth-shell-admin .auth-brand small { margin-top: auto; color: rgba(255,255,255,.84); }
.auth-shell-admin .auth-panel { width: min(628px, calc(100% - 72px)); min-height: 759px; margin-right: auto; margin-left: clamp(36px, 10vw, 155px); padding: 44px 36px; transform: translateY(-31px); }
.auth-shell-admin .auth-brand > img:first-child { width: min(375px, 100%); height: auto; }
.auth-shell-admin .auth-role-icon { width: 80px; height: 80px; margin-right: auto; margin-left: auto; }
.auth-shell-admin .auth-role-icon .ui-icon { width: 34px; height: 34px; }
.auth-shell-admin .auth-panel h1 { font-size: 31px; }
.auth-shell-admin .auth-panel > p { margin-top: 10px; font-size: 17px; }
.auth-shell-admin .auth-panel form { gap: 16px; margin-top: 32px; }
.auth-shell-admin .auth-brand h2::after { display: block; width: 40px; height: 3px; margin-top: 28px; background: #4799ff; content: ""; }
.auth-shell-admin .auth-brand p { margin-top: 30px; }
.auth-shell-admin input, .auth-shell-admin .primary-button, .auth-shell-admin .secondary-button { min-height: 54px; }
.auth-divider { position: relative; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--border); content: ""; }
.auth-divider span { padding: 0 18px; }
.auth-panel button:disabled { opacity: .72; cursor: not-allowed; }
.auth-shell-master > .back-link { display: none; }
.auth-shell-master { grid-template-columns: 44.5% 55.5%; width: min(872px, calc(100% - 64px)); min-height: 590px; margin: auto; overflow: hidden; border: 1px solid #cfe0f5; border-radius: 8px; background: var(--surface); box-shadow: var(--portal-shadow); transform: translateY(-12px); }
.auth-body:has(.auth-shell-master) .guest-main { display: flex; min-height: 100vh; flex-direction: column; padding: 0; background: #f5f9fd; }
.auth-master-stage { position: relative; display: grid; min-height: calc(100vh - 188px); padding: 32px 0; overflow: hidden; }
.auth-master-stage::before { position: absolute; inset: 22% 53% 0 0; background: url('/assets/portal-fleet-hero.webp') left bottom / cover no-repeat; opacity: .07; mask-image: linear-gradient(to right, #000 65%, transparent 100%); content: ""; }
.auth-body:has(.auth-shell-master) > .guest-theme { display: none; }
.auth-shell-master .auth-brand { min-height: 590px; padding: 34px 32px; background: rgba(244,248,254,.88); color: var(--text); }
.auth-shell-master .auth-brand::before { opacity: .04; }
.auth-shell-master .auth-brand::after { display: none; }
.auth-shell-master .auth-brand > img:first-child { display: none; }
.auth-master-copy { width: 100%; margin: auto; text-align: center; transform: translateY(-32px); }
.auth-master-shield { display: grid; width: 150px; height: 150px; margin: 0 auto 14px; place-items: center; border: 1px dashed #bcd7fb; border-radius: 50%; }
.auth-master-shield .ui-icon { width: 86px; height: 86px; }
.auth-master-copy h2 { color: var(--text); font-size: 26px; }
.auth-master-copy h2 b { color: var(--portal-blue); }
.auth-master-copy p { max-width: 310px; color: var(--muted); }
.auth-benefits { display: grid; gap: 13px; margin-top: 28px; text-align: left; }
.auth-benefits > div { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; }
.auth-benefits > div > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 7px; background: #fff; box-shadow: 0 4px 12px rgba(31,75,126,.07); }
.auth-benefits .ui-icon { width: 20px; height: 20px; }
.auth-benefits p { display: grid; margin: 0; }
.auth-benefits strong { font-size: 13px; }
.auth-benefits small { color: var(--muted); font-size: 11px; }
.auth-shell-master .auth-panel { align-self: stretch; width: 100%; margin: 0; padding: 34px; border: 0; border-radius: 0; box-shadow: none; }
.auth-shell-master .auth-panel h1, .auth-shell-master .auth-panel > p { text-align: left; }
.auth-shell-master .back-link { top: auto; right: 42px; bottom: 30px; left: auto; }
.auth-public-header .support-link { display: inline-flex; align-items: center; gap: 8px; }
.auth-public-header .support-link .ui-icon { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.auth-public-footer { flex: 0 0 98px; }
.auth-method-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #c8d8ee; border-radius: 7px; }
.auth-method-tabs span { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; color: var(--muted); }
.auth-method-tabs span[aria-current="true"] { background: var(--portal-blue); color: #fff; }
.auth-method-tabs span[aria-current="true"] .ui-icon { filter: brightness(0) invert(1); }
.otp-input { font-size: 24px; font-weight: 700; letter-spacing: 10px; text-align: center; }

/* Forms and details */
.wizard { max-width: none; padding: 24px; }
.wizard-progress { margin-bottom: 24px; }
.wizard-step { min-height: 330px; }
.form-grid { gap: 18px; }
.cargo-row { border-color: var(--portal-line); }
.order-detail-grid { gap: 14px; }
.order-summary dl { grid-template-columns: 160px 1fr; }
.timeline li { min-height: 50px; }
.detail-back { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; color: var(--primary); font-size: 13px; font-weight: 700; text-decoration: none; }
.detail-back .ui-icon { width: 16px; height: 16px; }
.order-detail-heading { align-items: center; margin-bottom: 18px; transform: none; }
.order-detail-heading h1 { font-size: 28px; }
.order-detail-heading p { margin: 7px 0 0; color: var(--muted); }
.order-detail-grid { grid-template-columns: minmax(0, 1.35fr) minmax(390px, .95fr); align-items: start; }
.order-detail-primary, .order-detail-secondary { display: grid; gap: 14px; }
.order-detail-grid .content-section { margin: 0; }
.order-summary { min-height: 410px; }
.order-facts { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0 28px !important; }
.order-facts > div { min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--border); }
.order-facts dt { margin-bottom: 6px; font-size: 12px; }
.order-facts dd { font-weight: 600; overflow-wrap: anywhere; }
.route-card { min-height: 150px; }
.route-line { display: grid; grid-template-columns: 1fr 130px 1fr; align-items: center; gap: 12px; margin-top: 22px; }
.route-line > div { display: grid; gap: 7px; }
.route-line span { color: var(--muted); font-size: 12px; }
.route-line strong { font-size: 13px; }
.route-truck { position: relative; display: grid; color: var(--primary) !important; place-items: center; }
.route-truck::before { position: absolute; right: 0; left: 0; border-top: 2px dashed var(--border); content: ""; }
.route-truck .ui-icon { z-index: 1; width: 28px; height: 28px; padding: 4px; background: var(--surface); }
.workflow-panel { min-height: 280px; }
.workflow-panel .timeline { display: flex; margin: 30px 0 24px; }
.workflow-panel .timeline li { min-width: 0; min-height: 82px; flex: 1; grid-template-columns: 1fr; grid-template-rows: 28px auto; gap: 9px; text-align: center; }
.workflow-panel .timeline li span { z-index: 1; margin: 0 auto; }
.workflow-panel .timeline li::after { top: 11px; right: -50%; bottom: auto; left: 50%; width: 100%; height: 2px; }
.workflow-panel .timeline li:last-child::after { display: none; }
.workflow-panel .timeline li strong { padding: 0 2px; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.detail-cargo-section { min-height: 238px; }
.detail-cargo-section .cargo-item { grid-template-columns: 1fr auto; padding: 13px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.scanner-dialog { border: 1px solid var(--portal-line); border-radius: 8px; box-shadow: 0 24px 60px rgba(4,25,61,.28); }
.camera-choice { border-radius: 7px; }

:root[data-theme="dark"] .app-body,
:root[data-theme="dark"] .auth-body { --portal-canvas: #0d1727; --portal-line: #334663; --portal-muted: #aebbd0; }
:root[data-theme="dark"] .topbar { background: #111d31; }
:root[data-theme="dark"] .landing-body { background: #0d1727; }
:root[data-theme="dark"] .landing-hero::before { opacity: .12; }
:root[data-theme="dark"] .landing-role-master,
:root[data-theme="dark"] .landing-role-driver { background: var(--surface); }
:root[data-theme="dark"] .orders-table-head { background: #152238; }
:root[data-theme="dark"] .orders-table-row:hover { background: #182840; }
:root[data-theme="dark"] .auth-shell-master .auth-brand { background: #121f34; }
:root[data-theme="dark"] .qr-launch-panel { background: #14243b; }
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .table-open { border-color: #42658f; color: #8fc4ff; }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #8f9eb5; opacity: 1; }

@media (max-width: 1100px) {
  .sidebar { width: 232px; }
  .topbar { left: 232px; }
  .app-main { width: calc(100% - 232px); margin-left: 232px; }
  .landing-intro h1 { font-size: 35px; }
  .landing-features { gap: 18px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-analytics { grid-template-columns: 1fr; }
  .orders-table { overflow-x: auto; }
  .orders-table-head, .orders-table-row { min-width: 1050px; }
}

@media (max-width: 820px) {
  .topbar { left: 0; background: #0757a1; }
  .topbar .brand { position: static; width: 170px; margin-right: auto; }
  .topbar .brand img { width: 170px; }
  .notification-button .ui-icon, .topbar-action .ui-icon { filter: brightness(0) invert(1); }
  .notification-button span { border-color: #0757a1; }
  .app-main { width: 100%; margin-left: 0; padding-top: 82px; }
  .page-heading { transform: none; }
  .landing-content { width: min(100% - 32px, 680px); }
  .landing-hero { display: block; }
  .landing-hero::before { inset: 130px 0 auto; height: 390px; mask-image: linear-gradient(to bottom, transparent, #000 30%, transparent 100%); }
  .landing-intro { min-height: 500px; padding: 34px 30px; }
  .landing-intro h1 { font-size: 34px; }
  .landing-features { right: 28px; left: 28px; }
  .landing-qr { width: 100%; margin: 16px 0 0; }
  .landing-roles { margin: 18px 0 0; }
  .public-footer { padding-bottom: 88px; }
  .auth-shell-admin { display: block; min-height: 100vh; padding: 96px 16px 34px; }
  .auth-shell-admin .auth-brand { height: 78px; min-height: 78px; padding: 8px 18px; }
  .auth-shell-admin .auth-brand > div, .auth-shell-admin .auth-brand small { display: none; }
  .auth-shell-admin .auth-panel { margin: 0 auto; }
  .auth-shell-admin .auth-panel { min-height: auto; transform: none; }
  .auth-shell-master { display: block; width: min(100% - 28px, 560px); min-height: auto; transform: none; }
  .auth-shell-master .auth-brand { min-height: 235px; padding: 28px; }
  .auth-shell-master .auth-panel { padding: 28px; }
  .auth-shell-master .back-link { display: none; }
  .auth-master-copy { transform: none; }
  .auth-public-header, .auth-public-footer { display: none; }
  .auth-master-stage { min-height: 100vh; padding: 20px 0 80px; }
  .wizard { padding: 18px; }
  .wizard-step { min-height: 290px; }
}

@media (max-width: 700px) {
  .app-main { padding-right: 12px; padding-left: 12px; }
  .page-heading h1 { font-size: 23px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metrics article { min-height: 92px; padding: 13px; }
  .public-header-inner { width: calc(100% - 24px); }
  .public-brand img { width: 242px; height: 64px; }
  .landing-content { padding-top: 18px; }
  .landing-intro h1 { font-size: 32px; }
  .landing-intro > p { font-size: 16px; }
  .landing-features { position: absolute; gap: 12px; }
  .landing-features > div { align-items: flex-start; }
  .landing-features small { font-size: 12px; }
  .landing-roles { grid-template-columns: 1fr; }
  .landing-advantages { display: none; }
  .auth-shell-driver { padding: 106px 12px 40px; }
  .auth-shell-driver .auth-brand { top: 18px; }
  .auth-shell-driver .auth-brand > img:first-child { width: 250px; }
  .auth-panel { width: 100%; padding: 28px 20px; }
  .auth-shell-driver .auth-panel { min-height: auto; padding: 28px 20px; }
  .driver-auth-help { position: relative; bottom: auto; left: auto; width: fit-content; margin: 24px auto 0; transform: none; }
  .driver-auth-copyright { display: none; }
  .auth-shell-driver .back-link { display: none; }
  .order-summary dl { grid-template-columns: 1fr; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-facts { grid-template-columns: 1fr !important; }
  .order-summary { min-height: auto; }
  .route-line { grid-template-columns: 1fr 56px 1fr; }
  .workflow-panel .timeline { overflow-x: auto; }
  .workflow-panel .timeline li { min-width: 100px; }
  .landing-qr-card .qr-camera-button { width: 100%; padding-right: 10px; padding-left: 10px; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
  .metric-card strong { font-size: 24px; white-space: nowrap; }
  .orders-filter-bar { grid-template-columns: 1fr; border-radius: 8px; }
  .orders-table { border-radius: 8px; }
  .orders-table-head { display: none; }
  .orders-table-row { display: grid; min-width: 0; grid-template-columns: 1fr 1fr; gap: 10px; }
  .orders-table-row > *::before { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; content: attr(data-label); }
  .table-open { align-self: end; }
  .status-overview { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 430px) {
  .account-copy, .notification-button { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .landing-intro { min-height: 505px; padding: 28px 22px; }
  .landing-intro h1 { font-size: 29px; }
  .landing-features { right: 18px; bottom: 24px; left: 18px; }
  .landing-features p { margin: 0; }
  .feature-mark { width: 52px; height: 52px; }
  .landing-role { grid-template-columns: 54px minmax(0,1fr) 34px; padding: 16px; }
  .auth-body:has(.auth-shell-master) .guest-main { padding: 20px 0 80px; }
  .auth-shell-master .auth-brand { min-height: 205px; }
  .auth-shell-master .auth-panel { padding: 24px 18px; }
  .wizard { padding: 16px 14px; }
  .wizard-progress li { font-size: 11px; }
}
