/* Delivery zones, automatic dispatch, driver scorecards and earnings (v2.3). */

/* ---------- zones page ---------- */

.zn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.zn-grid.is-empty { display: block; }
.zn-grid .skel.block { height: 220px; border-radius: 20px; }
.zn-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight);
  animation: fieldIn .5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color .3s;
  min-width: 0;
}
.zn-card:hover { border-color: var(--border-strong); }
.zn-card.is-off { opacity: .6; }
.zn-head { display: flex; align-items: center; gap: 12px; }
.zn-head > .grow { min-width: 0; }
.zn-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zn-sub { font-size: 12px; color: var(--text-3); }
.zn-communes { display: flex; flex-wrap: wrap; gap: 5px; }
.zn-drivers { display: flex; flex-direction: column; gap: 4px; }
.zn-driver { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 11px; color: var(--text); text-decoration: none; font-size: 13px; transition: background .2s; min-width: 0; }
.zn-driver:hover { background: var(--surface-2); text-decoration: none; }
.zn-driver.is-off { opacity: .55; }
.zn-driver .num { font-size: 12px; }
.zn-none { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.zn-none svg { width: 14px; height: 14px; color: var(--amber); flex: none; }

/* editor: communes and drivers checklists */
.zn-pick-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.zn-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; max-height: 230px; overflow: auto; padding: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.zn-pick-list.drivers { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 200px; }
.zn-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; font-size: 13px; cursor: pointer; min-width: 0; transition: background .15s; }
.zn-opt:hover { background: var(--surface); }
.zn-opt.is-on { background: color-mix(in srgb, var(--violet) 10%, transparent); }
.zn-opt input { accent-color: var(--violet); flex: none; }
.zn-opt > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zn-opt small { margin-inline-start: auto; font-size: 11.5px; white-space: nowrap; }

/* ---------- parcel drawer ---------- */

.zn-dr .card-head .tag { text-decoration: none; }
.zn-dr-line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.zn-dr-line svg { width: 14px; height: 14px; color: var(--violet); }
.zn-dr-sug { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--violet) 7%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 20%, transparent); flex-wrap: wrap; }
.zn-dr-sug > svg { width: 16px; height: 16px; color: var(--violet); flex: none; }
.zn-dr-sug .grow { display: flex; flex-direction: column; gap: 1px; min-width: 140px; }
.zn-dr-sug small { font-size: 12px; }
.zn-dr-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }

/* ---------- dispatch board ---------- */

.dsp-suggest { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 16px; background: linear-gradient(150deg, color-mix(in srgb, var(--violet) 9%, transparent), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--violet) 22%, transparent); flex-wrap: wrap; }
.dsp-suggest > svg { width: 18px; height: 18px; color: var(--violet); flex: none; }
.dsp-suggest .grow { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.dsp-suggest small { font-size: 12.5px; }
.dsp-sug { cursor: pointer; font: inherit; font-size: 11.5px; }
.dsp-sug:hover { filter: brightness(1.08); }

/* ---------- driver scorecard ---------- */

.zn-score-card .card-head .segmented { flex: none; }
.zn-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.zn-metric { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.zn-metric-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.zn-metric-label svg { width: 13px; height: 13px; }
.zn-metric b { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.zn-metric small { font-size: 11.5px; color: var(--text-3); }
.zn-metric.good b { color: var(--green); }
.zn-metric.warn b { color: var(--amber); }
.zn-metric.bad b { color: var(--rose); }
.zn-metric.bad { border-color: color-mix(in srgb, var(--rose) 25%, transparent); }

/* ---------- tracking page: verified driver ---------- */

.tr-driver { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.tr-driver-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tr-driver-head > .grow { min-width: 0; }
.tr-driver-avatar { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 16px; font-weight: 700; font-size: 17px; color: var(--text); background: linear-gradient(150deg, rgba(var(--a1-rgb), .25), rgba(var(--a2-rgb), .15)); border: 1px solid var(--border-strong); }
.tr-driver-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.tr-driver-check { position: absolute; inset-block-end: -4px; inset-inline-end: -4px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; border: 2px solid var(--surface); }
.tr-driver-check svg { width: 11px; height: 11px; }
.tr-driver-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.tr-driver-sub { font-size: 12.5px; color: var(--text-3); }
.tr-driver-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.tr-driver-facts > span { display: inline-flex; align-items: center; gap: 6px; }
.tr-driver-facts svg { width: 14px; height: 14px; color: var(--text-3); }
.tr-driver-facts small { color: var(--text-3); }
