#mensajeria-view { position:absolute; inset:0; overflow:auto; background:var(--bg,#f4f7fb); z-index:5; }
.dl { --dl-line:var(--border,#dbe4ee); --dl-card:var(--card,#fff); --dl-text:var(--text,#142d48); --dl-muted:var(--muted,#61758b); color:var(--dl-text); font:14px/1.5 Inter,system-ui,sans-serif; box-sizing:border-box; }
.dl *, .dl *::before, .dl *::after { box-sizing:border-box; }
.dl-shell { padding:24px 28px 80px; max-width:1800px; margin:auto; }
.dl h1 { font-size:25px; margin:0; letter-spacing:-.6px; }
.dl h2 { font-size:18px; margin:0; }
.dl h3 { font-size:15px; margin:0; }
.dl p { margin:5px 0 14px; }
.dl small,.dl-muted { color:var(--dl-muted); }
.dl-head,.dl-toolbar,.dl-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.dl-head { justify-content:space-between; margin-bottom:20px; }
.dl-head-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.dl-toolbar { margin:12px 0; }
.dl button,.dl .dl-button { font:600 13px/1.25 Inter,system-ui,sans-serif; color:var(--dl-text); background:var(--dl-card); border:1px solid var(--dl-line); border-radius:9px; padding:9px 12px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px; text-decoration:none; min-height:36px; }
.dl button:hover,.dl .dl-button:hover { border-color:#1981cc; background:#edf6ff; color:#075587; }
.dl button:disabled { opacity:.5; cursor:wait; }
.dl button:focus-visible,.dl a:focus-visible,.dl input:focus-visible,.dl select:focus-visible { outline:3px solid #56a9ec; outline-offset:2px; }
.dl .dl-primary { background:#137dc5; border-color:#137dc5; color:#fff; }
.dl .dl-danger { color:#ba3348; }
.dl svg { width:17px; height:17px; }
.dl label { display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:600; }
.dl input,.dl select,.dl textarea { width:100%; min-width:0; height:39px; background:var(--dl-card); color:var(--dl-text); border:1px solid var(--dl-line); border-radius:8px; padding:8px 10px; font:14px Inter,system-ui,sans-serif; }
.dl textarea { height:65px; resize:vertical; }
.dl-toolbar input[type=date] { width:160px; }
.dl-toolbar input[type=search] { width:240px; max-width:100%; }
.dl-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:16px 0; }
.dl-stat { background:var(--dl-card); border:1px solid var(--dl-line); border-radius:12px; padding:12px 16px; display:flex; justify-content:space-between; gap:8px; align-items:center; }
.dl-stat strong { font-size:24px; color:#127ac3; }
.dl-workspace { display:grid; grid-template-columns:300px minmax(0,1fr); gap:18px; align-items:start; }
.dl-list { display:flex; flex-direction:column; gap:9px; max-height:72vh; overflow:auto; }
.dl .dl-route-card { text-align:left; display:block; width:100%; padding:15px; border-radius:12px; }
.dl-route-card.selected { border-color:#1684d1; box-shadow:inset 3px 0 #1684d1; }
.dl-route-card small { display:block; margin:6px 0; }
.dl-badge { display:inline-block; border-radius:20px; padding:3px 9px; background:#eaf1f8; color:#466079; font-size:11px; font-weight:600; }
.dl-badge.active,.dl-badge.in_transit,.dl-badge.picked_up { color:#0764a4; background:#dff1ff; }
.dl-badge.delivered,.dl-badge.completed { color:#08754e; background:#ddf5e9; }
.dl-badge.failed,.dl-badge.returned { color:#a23e12; background:#fff0d9; }
.dl-card { background:var(--dl-card); border:1px solid var(--dl-line); border-radius:14px; padding:18px; min-width:0; }
.dl-empty { padding:50px 24px; text-align:center; color:var(--dl-muted); }
.dl-map { width:100%; height:320px; border:1px solid var(--dl-line); border-radius:12px; overflow:hidden; background:#e4edf1; margin:12px 0; }
.dl-map-note { font-size:12px; color:var(--dl-muted); }
.dl .maplibregl-ctrl-group button { display:block; width:29px; height:29px; min-height:0; padding:0; border:0; border-radius:0; background:transparent; }
.dl .maplibregl-ctrl-group button+button { border-top:1px solid #ddd; }
.dl .maplibregl-ctrl-group button span { width:100%; height:100%; }
.dl .maplibregl-ctrl-attrib-button { display:block; min-height:0; width:24px; height:24px; padding:0; border:0; border-radius:50%; }
.dl-stops { display:flex; flex-direction:column; gap:10px; margin:14px 0; }
.dl-stop { border:1px solid var(--dl-line); border-radius:11px; padding:13px; background:var(--dl-card); overflow-wrap:anywhere; }
.dl-stop[draggable=true] { cursor:grab; }
.dl-stop-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dl-number { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; background:#e6f3ff; color:#0871bc; font-weight:700; flex-shrink:0; }
.dl-stop p { margin:6px 0; }
.dl-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.dl-actions button { padding:7px 10px; min-height:33px; font-size:12px; }
.dl-notice { margin:10px 0; border-radius:9px; padding:10px 13px; background:#e9f4fd; color:#126294; }
.dl-notice:empty { display:none; }
.dl-notice.error { background:#fff0f0; color:#a52f3a; }
.dl-progress { height:5px; width:100%; background:#edf1f5; border-radius:5px; overflow:hidden; margin-top:8px; }
.dl-progress span { display:block; height:100%; background:#12a67d; }
.dl-dialog { position:fixed; inset:50% auto auto 50%; transform:translate(-50%,-50%); margin:0; display:flex; flex-direction:column; border:1px solid #dbe4ee; border-radius:16px; padding:0; width:min(920px,95vw); max-height:92dvh; color:var(--dl-text); background:var(--dl-card); }
.dl-dialog::backdrop { background:rgba(12,28,45,.55); }
.dl-dialog-body { padding:22px; min-height:0; overflow-y:auto; flex:1 1 auto; }
.dl-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:14px 0; }
.dl-form-stop { border:1px solid var(--dl-line); border-radius:10px; padding:14px; margin:12px 0; }
.dl-full { grid-column:1/-1; }
.dl-dialog-foot { position:sticky; bottom:0; padding:12px 22px; border-top:1px solid var(--dl-line); background:var(--dl-card); display:flex; justify-content:flex-end; gap:8px; flex:0 0 auto; }
.dl-pin { background:#fff; border:2px solid #1684d1; color:#075587; border-radius:50%; width:29px; height:29px; display:flex; align-items:center; justify-content:center; font:700 12px system-ui; box-shadow:0 2px 5px #0003; }
.dl-pin.gps { background:#0a9671; color:white; border-color:white; width:34px; height:34px; }
.dl-history { margin-top:12px; max-height:280px; overflow:auto; }
.dl-history div { padding:8px 0; border-bottom:1px solid var(--dl-line); font-size:12px; }
.dl-messenger-list { display:grid; gap:8px; margin-top:12px; }
.dl-messenger-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:10px; border:1px solid var(--dl-line); border-radius:10px; padding:10px 12px; }
.dl-messenger-row small { display:block; overflow-wrap:anywhere; }
.dl-portal { background:#f4f7fb; margin:0; min-height:100dvh; }
.dl-portal main { max-width:950px; margin:auto; padding:18px 18px 60px; }
.dl-portal-header { display:flex; align-items:center; gap:12px; padding:18px 0; }
.dl-portal-header img { width:135px; }
.dl-courier-portal { --dl-card:#fff; --dl-text:#142d48; --dl-muted:#61758b; --dl-line:#dbe4ee; background:linear-gradient(145deg,#edf5fb,#f8fafc 45%,#edf4fb); }
.dl-courier-portal main { max-width:1180px; padding-top:max(18px,env(safe-area-inset-top)); }
.dl-courier-portal .dl-portal-header { justify-content:space-between; border-bottom:1px solid #dbe4ee; margin-bottom:16px; color:#31516d; font-weight:700; }
.dl-courier-card { box-shadow:0 16px 45px rgba(35,71,106,.09); }
.dl-courier-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; padding-bottom:14px; border-bottom:1px solid var(--dl-line); }
.dl-courier-toolbar>div:first-child { display:grid; gap:2px; }
.dl-courier-toolbar strong { font-size:18px; }
.dl-courier-tools { display:flex; gap:8px; }
.dl .dl-quiet { background:transparent; }
.dl-courier-routes { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:9px; margin:14px 0; }
.dl .dl-courier-route { justify-content:space-between; text-align:left; min-height:74px; padding:11px 13px; }
.dl-courier-route.selected { border-color:#1684d1; box-shadow:inset 3px 0 #1684d1,0 3px 12px #1684d11c; background:#f4faff; }
.dl-courier-route>span:first-child { display:grid; min-width:0; }
.dl-courier-route>span:first-child strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dl-courier-route small { font-size:11px; }
.dl-courier-route-meta { display:grid; justify-items:end; gap:4px; flex:none; }
.dl-courier-progress { color:var(--dl-muted); }
.dl-courier-progress strong { color:#08754e; font-size:20px; }
.dl-courier-card .dl-map { height:min(40dvh,380px); min-height:240px; }
.dl-courier-card .dl-stop { box-shadow:0 2px 8px rgba(35,71,106,.04); }
.dl-portal .dl-map { height: min(45dvh,400px); min-height:240px; }
.dl-track-status { font-size:25px; font-weight:700; margin:12px 0; }
.dl-timeline { display:grid; grid-template-columns:repeat(4,1fr); margin:20px 0; gap:6px; font-size:11px; color:var(--dl-muted); }
.dl-timeline span { border-top:4px solid #dbe4ee; padding-top:7px; }
.dl-timeline .done { border-color:#13a47b; color:#087351; }
.dark .dl { --dl-card:#162538; --dl-text:#e0ebf6; --dl-muted:#a5b6ca; --dl-line:#35465b; }
@media(max-width:900px) {
  .dl-shell { padding:16px 14px 90px; }
  .dl-workspace { grid-template-columns:1fr; }
  .dl-list { max-height:240px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dl-map { height:300px; }
}
@media(max-width:540px) {
  .dl h1 { font-size:22px; }
  .dl-stats { grid-template-columns:repeat(2,1fr); gap:8px; }
  .dl-stat { padding:10px; font-size:12px; }
  .dl-stat strong { font-size:20px; }
  .dl-head { margin-bottom:10px; }
  .dl-head-actions { gap:6px; }
  .dl-shell>header.dl-head { flex-wrap:nowrap; }
  .dl-shell>header.dl-head p { font-size:12px; }
  .dl-shell>header.dl-head button { flex-shrink:0; }
  .dl-list { grid-template-columns:1fr; max-height:230px; }
  .dl-card { padding:13px; }
  .dl-form-grid { grid-template-columns:1fr; }
  .dl-dialog { width:calc(100vw - 24px); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); height:auto; border-radius:14px; }
  .dl-dialog-body { padding:16px; }
  .dl-portal main { padding:8px 12px 40px; }
  .dl-toolbar input[type=search] { flex:1; width:150px; }
  .dl-messenger-row { grid-template-columns:minmax(0,1fr) auto; }
  .dl-messenger-row button { grid-column:1/-1; }
  .dl-courier-portal main { padding:8px 10px max(26px,env(safe-area-inset-bottom)); }
  .dl-courier-portal .dl-portal-header { padding:12px 0; margin-bottom:10px; }
  .dl-courier-portal .dl-portal-header img { width:118px; }
  .dl-courier-card { padding:12px; }
  .dl-courier-toolbar { align-items:flex-start; }
  .dl-courier-tools { gap:5px; }
  .dl-courier-tools button { padding:8px; min-height:36px; }
  .dl-courier-tools button svg { width:15px; }
  .dl-courier-routes { display:flex; overflow:auto; padding:2px 1px 7px; margin:10px 0; }
  .dl .dl-courier-route { flex:0 0 min(82vw,300px); }
  .dl-courier-card .dl-map { height:36dvh; min-height:210px; }
  .dl-courier-card .dl-stop { padding:11px; }
}
