/* ============================================================================
   Serviços › Entregadores
   ----------------------------------------------------------------------------
   Cadastro da equipe, rotas de entrega, despacho do dia e acesso do
   entregador (QR + link). Reaproveita .tpl-* e as variáveis do painel.
   ============================================================================ */

/* --------------------------------------------------------------- indicadores */
.drv-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.drv-stat { display:flex; align-items:center; gap:11px; padding:13px 14px; border-radius:14px;
  background:var(--surface,#fff); border:1px solid var(--border,#E4E5D9); box-shadow:0 1px 2px rgba(16,24,40,.04); min-width:0; }
.drv-stat-ico { width:38px; height:38px; flex:none; border-radius:11px; display:inline-flex; align-items:center; justify-content:center; }
.drv-stat-ico svg { width:19px; height:19px; }
.drv-stat-ico.is-team { background:#E7F2ED; color:#0E7A66; }
.drv-stat-ico.is-route { background:#E8EEFB; color:#2563EB; }
.drv-stat-ico.is-done { background:#EAF6EE; color:#1B7A3C; }
.drv-stat-ico.is-value { background:#FDF3E3; color:#A15B0B; }
.drv-stat div { min-width:0; }
.drv-stat b { display:block; font-size:1.12rem; line-height:1.15; letter-spacing:-.02em; color:var(--dark,#14312B); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drv-stat span { display:block; margin-top:2px; font-size:.7rem; font-weight:600; color:var(--gray,#6B7A76); }

/* -------------------------------------------------------------------- layout */
.drv-layout { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,.85fr); gap:16px; align-items:start; margin-bottom:16px; }
.drv-side { display:flex; flex-direction:column; gap:16px; min-width:0; }
.drv-card { padding:16px 16px 15px; min-width:0; }
.drv-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:4px; }
.drv-card-head b { font-size:.78rem; letter-spacing:.05em; text-transform:uppercase; color:var(--gray,#6B7A76); }
.drv-count { font-size:.7rem; font-weight:800; color:var(--primary,#0E7A66); background:var(--primary-soft,#E7F2ED); border-radius:999px; padding:2px 9px; }
.drv-hint { margin:6px 0 12px; font-size:.76rem; line-height:1.5; color:var(--gray,#6B7A76); }
.drv-hint b { color:var(--dark,#14312B); }
.drv-badge { font-size:.66rem; font-weight:800; letter-spacing:.08em; color:var(--primary,#0E7A66); border:1px solid var(--primary,#0E7A66); border-radius:6px; padding:1px 6px; }
.drv-linkbtn { border:0; background:none; padding:2px 0; font-family:inherit; font-size:.74rem; font-weight:800; color:var(--primary,#0E7A66); cursor:pointer; }
.drv-linkbtn:hover { text-decoration:underline; }

/* ------------------------------------------------------------------ toolbar */
.drv-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.drv-search { position:relative; flex:1 1 210px; min-width:0; }
.drv-search svg { position:absolute; left:10px; top:50%; width:15px; height:15px; transform:translateY(-50%); color:var(--gray,#6B7A76); pointer-events:none; }
.drv-search input { width:100%; border:1px solid var(--border,#E4E5D9); border-radius:9px; background:#FAFBF8; padding:8px 10px 8px 32px;
  font-family:inherit; font-size:.8rem; color:var(--dark,#14312B); }
.drv-search input:focus { outline:none; border-color:var(--primary,#0E7A66); box-shadow:0 0 0 3px rgba(14,122,102,.13); background:#fff; }
.drv-filters { display:inline-flex; gap:2px; padding:3px; border-radius:10px; background:#F3F6F2; border:1px solid var(--ocux-hairline,#EFF0E6); flex-wrap:wrap; }
.drv-filters button { border:0; background:transparent; border-radius:7px; padding:5px 9px; font-family:inherit; font-size:.72rem; font-weight:700;
  color:var(--gray,#6B7A76); cursor:pointer; }
.drv-filters button:hover { color:var(--dark,#14312B); }
.drv-filters button.is-on { background:#fff; color:var(--primary,#0E7A66); box-shadow:0 1px 2px rgba(16,24,40,.1); }

/* --------------------------------------------------------------------- lista */
.drv-list { display:flex; flex-direction:column; gap:8px; }
.drv-row { display:flex; align-items:center; gap:10px; padding:10px 11px; border-radius:12px;
  border:1px solid var(--ocux-hairline,#EFF0E6); background:#fff; min-width:0; }
.drv-row:hover { background:#FAFCF9; }
.drv-row.is-off { opacity:.64; }
.drv-av { width:38px; height:38px; flex:none; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background:var(--primary-soft,#E7F2ED); color:var(--primary,#0E7A66); font-size:.82rem; font-weight:800; text-transform:uppercase; position:relative; }
.drv-av .drv-av-dot { position:absolute; right:-2px; bottom:-2px; width:11px; height:11px; border-radius:50%; background:#C9D1CB; border:2px solid #fff; }
.drv-av .drv-av-dot.is-on { background:#1E9E63; }
.drv-av .drv-av-dot.is-route { background:#2563EB; }
.drv-body { flex:1; min-width:0; }
.drv-name { display:block; font-size:.86rem; color:var(--dark,#14312B); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drv-meta { display:flex; align-items:center; gap:6px; margin-top:3px; flex-wrap:wrap; }
.drv-tag { font-size:.65rem; font-weight:700; color:var(--gray,#6B7A76); background:#F4F6F3; border-radius:999px; padding:1px 8px; white-space:nowrap; }
.drv-tag.is-code { color:#A15B0B; background:#FDF3E3; }
.drv-tag.is-off { color:#9A3B2E; background:#FDF1EF; }
.drv-tag.is-route { color:#1D4ED8; background:#E8EEFB; }
.drv-tag.is-free { color:#1B7A3C; background:#EAF6EE; }
.drv-num { flex:none; text-align:right; padding-right:2px; }
.drv-num b { display:block; font-size:.82rem; color:var(--dark,#14312B); line-height:1.2; }
.drv-num span { font-size:.63rem; color:var(--gray,#6B7A76); font-weight:600; }
.drv-tools { display:flex; align-items:center; gap:3px; flex:none; }
.drv-ico { width:30px; height:30px; border-radius:8px; border:1px solid var(--border,#E4E5D9); background:#fff;
  color:var(--gray,#6B7A76); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; text-decoration:none; }
.drv-ico:hover { color:var(--dark,#14312B); background:#F7FAF6; }
.drv-ico.is-ok:hover { color:#0E7A66; border-color:#BFDCCF; background:#F1F8F4; }
.drv-ico.is-danger:hover { color:#B4392A; border-color:#E9C4BC; background:#FDF4F2; }
.drv-ico svg { width:15px; height:15px; }
.drv-ico[disabled] { opacity:.4; cursor:default; }
.drv-row-go { border:0; background:var(--primary-soft,#E7F2ED); color:var(--primary,#0E7A66); border-radius:8px;
  padding:6px 10px; font-family:inherit; font-size:.7rem; font-weight:800; cursor:pointer; white-space:nowrap; }
.drv-row-go:hover { background:#D8ECE3; }
.drv-row-go[disabled] { opacity:.45; cursor:default; }
.drv-empty { margin:14px 4px; font-size:.78rem; line-height:1.55; color:var(--gray,#6B7A76); }
.drv-empty b { color:var(--dark,#14312B); }
.drv-add { margin-top:12px; align-self:flex-start; }

/* ---------------------------------------------------------------- formulario */
.drv-form { margin-top:13px; padding:14px; border-radius:12px; background:#F7FAF6; border:1px dashed var(--border,#E4E5D9); }
.drv-form-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.drv-form-head b { font-size:.84rem; color:var(--dark,#14312B); }
.drv-form-head span { font-size:.68rem; color:var(--gray,#6B7A76); }
.drv-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.drv-form-grid label { display:flex; flex-direction:column; gap:4px; font-size:.74rem; font-weight:700; color:var(--dark,#14312B); min-width:0; }
.drv-form-grid label.is-wide { grid-column:1 / -1; }
.drv-form small, .drv-route-form small, .drv-auto small { font-weight:500; color:var(--gray,#6B7A76); }
.drv-form input, .drv-form select, .drv-route-form input, .drv-route-form textarea, .drv-auto input {
  width:100%; border:1px solid var(--border,#E4E5D9); border-radius:9px; padding:8px 10px; font-size:.82rem;
  color:var(--dark,#14312B); background:#fff; font-family:inherit; }
.drv-form input:focus, .drv-form select:focus, .drv-route-form input:focus, .drv-route-form textarea:focus, .drv-auto input:focus {
  outline:none; border-color:var(--primary,#0E7A66); box-shadow:0 0 0 3px rgba(14,122,102,.13); }
.drv-form-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.drv-err { margin:0; font-size:.74rem; color:#B4392A; }
#drvState.is-err { background:#FDF1EF; color:#B4392A; border-color:#E9C4BC; }

/* -------------------------------------------------------------------- rotas */
.drv-routes { display:flex; flex-direction:column; gap:7px; }
.drv-route { display:flex; align-items:center; gap:9px; padding:8px 9px; border-radius:10px; background:#FAFCF9;
  border:1px solid var(--ocux-hairline,#EFF0E6); min-width:0; }
.drv-route.is-off { opacity:.6; }
.drv-route-dot { width:9px; height:9px; flex:none; border-radius:50%; background:var(--c,#0E7A66); }
.drv-route-body { flex:1; min-width:0; }
.drv-route-body b { display:block; font-size:.79rem; color:var(--dark,#14312B); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drv-route-body span { display:block; font-size:.66rem; color:var(--gray,#6B7A76); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drv-route-val { flex:none; text-align:right; }
.drv-route-val b { display:block; font-size:.74rem; color:var(--dark,#14312B); }
.drv-route-val span { font-size:.62rem; color:var(--gray,#6B7A76); }

/* -------------------------------------------------------------------- acesso */
.drv-qr { display:flex; justify-content:center; padding:8px 0 12px; }
.drv-qr canvas { width:172px; height:172px; border-radius:14px; background:#fff; border:1px solid var(--ocux-hairline,#EFF0E6); padding:8px; }
.drv-link { display:flex; gap:6px; }
.drv-link input { flex:1; min-width:0; border:1px solid var(--border,#E4E5D9); border-radius:9px; padding:8px 10px;
  font-size:.72rem; color:var(--gray,#6B7A76); background:#FAFBF8; font-family:inherit; }
.drv-link .tpl-btn { flex:none; padding:8px 11px; }
.drv-openapp { width:100%; justify-content:center; margin-top:10px; }

/* --------------------------------------------------------------- despacho */
.drv-dispatch { margin-bottom:16px; }
.drv-dispatch-head { align-items:flex-start; }
.drv-dispatch-head > div:first-child { min-width:0; }
.drv-dispatch-head .drv-hint { margin-bottom:0; max-width:60ch; }
.drv-dispatch-tools { display:flex; align-items:center; gap:6px; flex:none; }
.drv-refresh { width:34px; height:34px; border-radius:9px; border:1px solid var(--border,#E4E5D9); background:#fff;
  color:var(--gray,#6B7A76); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.drv-refresh:hover { color:var(--primary,#0E7A66); border-color:#BFDCCF; }
.drv-refresh svg { width:16px; height:16px; }
.drv-refresh.is-busy svg { animation:drv-spin .8s linear infinite; }
@keyframes drv-spin { to { transform:rotate(360deg); } }

.drv-dispatch-list { display:flex; flex-direction:column; gap:7px; margin-top:12px; }
.drv-drow { display:flex; align-items:center; gap:10px; padding:10px 11px; border-radius:11px;
  border:1px solid var(--ocux-hairline,#EFF0E6); background:#fff; min-width:0; flex-wrap:wrap; }
.drv-drow.is-delivered { opacity:.62; }
.drv-drow-main { display:flex; align-items:center; gap:10px; flex:1 1 320px; min-width:0; }
.drv-ord { font-size:.7rem; font-weight:800; color:var(--gray,#6B7A76); background:#F4F6F3; border-radius:7px; padding:4px 7px; flex:none; }
.drv-dinfo { min-width:0; flex:1; }
.drv-dinfo b { display:block; font-size:.8rem; color:var(--dark,#14312B); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drv-dinfo span { display:flex; align-items:center; gap:4px; font-size:.68rem; color:var(--gray,#6B7A76); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drv-dinfo span svg { width:11px; height:11px; flex:none; }
.drv-dval { flex:none; font-size:.78rem; font-weight:800; color:var(--dark,#14312B); }
.drv-dstatus { flex:none; font-size:.64rem; font-weight:800; border-radius:999px; padding:3px 8px; white-space:nowrap;
  background:#F4F6F3; color:var(--gray,#6B7A76); }
.drv-dstatus.is-preparing { background:#FDF3E3; color:#A15B0B; }
.drv-dstatus.is-delivering { background:#E8EEFB; color:#1D4ED8; }
.drv-dstatus.is-delivered { background:#EAF6EE; color:#1B7A3C; }
.drv-dassign { display:flex; align-items:center; gap:6px; flex:0 1 100%; justify-content:flex-end; }
.drv-dassign select { border:1px solid var(--border,#E4E5D9); border-radius:8px; background:#fff; padding:6px 8px;
  font-family:inherit; font-size:.74rem; color:var(--dark,#14312B); max-width:230px; min-width:0; }
.drv-dassign select:focus { outline:none; border-color:var(--primary,#0E7A66); box-shadow:0 0 0 3px rgba(14,122,102,.13); }
.drv-dassign .drv-row-go { padding:6px 11px; }
.drv-driver-chip { display:inline-flex; align-items:center; gap:4px; font-size:.68rem; font-weight:700; color:#0E7A66; }

/* --------------------------------------------------------------------- fluxo */
.drv-note { padding:16px; }
.drv-note h4 { margin:0 0 4px; font-size:.88rem; color:var(--dark,#14312B); }
.drv-note > p { margin:0 0 12px; font-size:.76rem; line-height:1.5; color:var(--gray,#6B7A76); }
.drv-flow { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.drv-flow div { padding:11px 12px; border-radius:11px; background:#F7FAF6; border:1px solid var(--ocux-hairline,#EFF0E6); }
.drv-flow b { display:block; font-size:.77rem; color:var(--dark,#14312B); margin-bottom:3px; }
.drv-flow span { font-size:.71rem; line-height:1.5; color:var(--gray,#6B7A76); }

/* --------------------------------------------------------------------- modal */
.drv-modal { position:fixed; inset:0; z-index:1200; display:flex; align-items:center; justify-content:center; padding:18px; }
.drv-modal[hidden] { display:none; }
.drv-modal-bg { position:absolute; inset:0; background:rgba(16,24,40,.55); backdrop-filter:blur(3px); }
.drv-modal-win { position:relative; width:min(920px,100%); max-height:92vh; overflow:auto; background:var(--surface,#fff);
  border-radius:18px; box-shadow:0 30px 90px rgba(0,0,0,.35); }
.drv-modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:18px 20px 14px;
  border-bottom:1px solid var(--ocux-hairline,#EFF0E6); position:sticky; top:0; background:var(--surface,#fff); z-index:2; border-radius:18px 18px 0 0; }
.drv-modal-head h4 { margin:0; font-size:1rem; color:var(--dark,#14312B); }
.drv-modal-head p { margin:4px 0 0; font-size:.75rem; line-height:1.5; color:var(--gray,#6B7A76); max-width:60ch; }
.drv-modal-x { width:32px; height:32px; flex:none; border-radius:9px; border:1px solid var(--border,#E4E5D9); background:#fff;
  color:var(--gray,#6B7A76); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.drv-modal-x:hover { color:var(--dark,#14312B); background:#F7FAF6; }
.drv-modal-x svg { width:15px; height:15px; }
.drv-modal-body { padding:16px 20px 20px; }
.drv-modal-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); gap:16px; align-items:start; }
.drv-modal-list { min-width:0; }
.drv-modal-list-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.drv-modal-list-head b { font-size:.74rem; letter-spacing:.05em; text-transform:uppercase; color:var(--gray,#6B7A76); }
.drv-modal-list-head span { font-size:.68rem; font-weight:800; color:var(--primary,#0E7A66); background:var(--primary-soft,#E7F2ED); border-radius:999px; padding:1px 8px; }
.drv-mroute { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:11px; border:1px solid var(--ocux-hairline,#EFF0E6);
  background:#FAFCF9; margin-bottom:7px; min-width:0; }
.drv-mroute.is-off { opacity:.6; }
.drv-mroute .drv-route-body b { font-size:.82rem; }
.drv-mroute-tools { display:flex; gap:3px; flex:none; }
.drv-route-form { padding:13px; border-radius:12px; background:#F7FAF6; border:1px dashed var(--border,#E4E5D9); display:flex; flex-direction:column; gap:9px; }
.drv-route-form > b { font-size:.84rem; color:var(--dark,#14312B); }
.drv-route-form label { display:flex; flex-direction:column; gap:4px; font-size:.73rem; font-weight:700; color:var(--dark,#14312B); }
.drv-route-2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.drv-route-form textarea { resize:vertical; min-height:44px; }
.drv-colors { display:flex; gap:6px; margin-top:2px; }
.drv-colors button { width:24px; height:24px; border-radius:50%; border:2px solid #fff; background:var(--c,#0E7A66);
  box-shadow:0 0 0 1px var(--border,#E4E5D9); cursor:pointer; padding:0; }
.drv-colors button.is-on { box-shadow:0 0 0 2px var(--dark,#14312B); }
.drv-check { flex-direction:row !important; align-items:center; gap:7px !important; font-weight:600 !important; }
.drv-check input { width:15px !important; height:15px; padding:0 !important; accent-color:var(--primary,#0E7A66); }

.drv-auto { margin-top:16px; padding:14px; border-radius:12px; border:1px solid var(--ocux-hairline,#EFF0E6); background:#FBFCFA; }
.drv-auto-main { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.drv-auto-main b { font-size:.84rem; color:var(--dark,#14312B); }
.drv-auto-main p { margin:3px 0 0; font-size:.72rem; line-height:1.5; color:var(--gray,#6B7A76); max-width:60ch; }
.drv-switch { flex:none; position:relative; display:inline-flex; width:42px; height:24px; }
.drv-switch input { position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.drv-switch span { width:42px; height:24px; border-radius:999px; background:#D8DED9; transition:background .18s ease; }
.drv-switch span::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .18s ease; }
.drv-switch input:checked + span { background:var(--primary,#0E7A66); }
.drv-switch input:checked + span::after { transform:translateX(18px); }
.drv-auto-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.drv-auto-fields label { display:flex; flex-direction:column; gap:4px; font-size:.72rem; font-weight:700; color:var(--dark,#14312B); }
.drv-auto-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:12px; }
.drv-auto-foot span { font-size:.7rem; color:var(--gray,#6B7A76); }
body.drv-modal-open { overflow:hidden; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1180px) {
  .drv-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .drv-layout { grid-template-columns:minmax(0,1fr); }
  .drv-side { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .drv-flow { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .drv-modal-grid { grid-template-columns:minmax(0,1fr); }
  .drv-dassign { justify-content:flex-start; }
  .drv-drow-main { flex:1 1 100%; }
}
@media (max-width: 720px) {
  .drv-side { grid-template-columns:minmax(0,1fr); }
  .drv-form-grid { grid-template-columns:minmax(0,1fr); }
  .drv-auto-fields { grid-template-columns:minmax(0,1fr); }
  .drv-dispatch-head { flex-direction:column; align-items:stretch; }
  .drv-dispatch-tools { justify-content:space-between; }
  .drv-dassign select { flex:1; max-width:none; }
}
@media (max-width: 560px) {
  .drv-stats { grid-template-columns:minmax(0,1fr); }
  .drv-flow { grid-template-columns:minmax(0,1fr); }
  .drv-toolbar { flex-direction:column; align-items:stretch; }
  .drv-filters { justify-content:flex-start; }
  .drv-row { flex-wrap:wrap; }
  .drv-row .drv-num { order:3; text-align:left; }
  .drv-row .drv-tools { order:4; margin-left:auto; }
  .drv-modal { padding:0; }
  .drv-modal-win { max-height:100vh; border-radius:0; height:100%; }
  .drv-modal-head { border-radius:0; }
  .drv-route-2 { grid-template-columns:1fr; }
}
