:root{
  --rr-bg:#07111f;
  --rr-bg-2:#0c1728;
  --rr-card:#0f1d33;
  --rr-border:rgba(255,255,255,.09);
  --rr-text:#eef4ff;
  --rr-muted:#9db0d1;
  --rr-accent:#d7af5a;
  --rr-blue:#3b82f6;
  --rr-green:#22c55e;
  --rr-orange:#f59e0b;
  --rr-red:#ef4444;
  --rr-shadow:0 18px 50px rgba(0,0,0,.28);
}

body .rr-driver-shell,
.rr-driver-shell *{box-sizing:border-box}

.rr-driver-shell{
  width:100%;
  max-width:none;
  min-height:100vh;
  padding:20px;
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  gap:20px;
  background:linear-gradient(180deg,#08111d 0%,#020915 100%);
  color:var(--rr-text);
  border-radius:0;
}

.rr-driver-sidebar{
  background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.02));
  border:1px solid var(--rr-border);
  border-radius:22px;
  padding:18px;
  box-shadow:var(--rr-shadow);
  position:sticky;
  top:20px;
  height:fit-content;
}

.rr-driver-profile-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.05);
  margin-bottom:16px;
}

.rr-driver-avatar{
  width:64px;
  height:64px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid rgba(255,255,255,.14);
  flex:0 0 64px;
}

.rr-driver-profile-meta{
  min-width:0;
}

.rr-driver-profile-meta h3{
  margin:0 0 5px;
  font-size:17px;
  line-height:1.2;
  word-break:break-word;
}

.rr-driver-profile-meta p{
  margin:0;
  color:var(--rr-muted);
  font-size:12.5px;
  line-height:1.5;
  word-break:break-word;
}

.rr-driver-nav{
  display:grid;
  gap:10px;
  margin-bottom:16px;
}

.rr-driver-nav a{
  display:flex;
  align-items:center;
  min-height:46px;
  padding:0 16px;
  border-radius:999px;
  background:#0b1a30;
  border:1px solid rgba(125,158,212,.22);
  color:var(--rr-text);
  text-decoration:none;
  font-weight:600;
  font-size:14px;
  transition:.2s ease;
}

.rr-driver-nav a:hover,
.rr-driver-nav a.is-active{
  background:var(--rr-accent);
  color:#111827;
  border-color:transparent;
  transform:translateY(-1px);
}

.rr-driver-sidebar-box{
  display:grid;
  gap:6px;
  padding:16px;
  border-radius:18px;
  background:#0b1a30;
  border:1px solid rgba(255,255,255,.06);
}

.rr-label,
.rr-kicker,
.rr-stat-label{
  display:block;
  color:var(--rr-muted);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:10px;
}

.rr-driver-main{
  min-width:0;
  display:grid;
  gap:18px;
}

.rr-driver-hero,
.rr-panel,
.rr-stat-card{
  background:linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.02));
  border:1px solid var(--rr-border);
  border-radius:22px;
  box-shadow:var(--rr-shadow);
}

.rr-driver-hero{
  padding:22px 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
}

.rr-driver-hero h1{
  margin:8px 0 8px;
  font-size:28px;
  line-height:1.08;
}

.rr-driver-hero p{
  margin:0;
  color:var(--rr-muted);
  max-width:760px;
  font-size:14px;
  line-height:1.55;
}

.rr-driver-hero-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.rr-live-toggle-wrap{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:48px;
  padding:8px 14px 8px 10px;
  border-radius:999px;
  background:#0b1a30;
  border:1px solid rgba(255,255,255,.08);
  cursor:pointer;
  user-select:none;
}

.rr-live-toggle-wrap input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.rr-live-toggle-slider{
  position:relative;
  width:54px;
  height:28px;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.08);
  transition:.25s ease;
  flex:0 0 auto;
}

.rr-live-toggle-slider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#ffffff;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
  transition:.25s ease;
}

.rr-live-toggle-wrap input:checked + .rr-live-toggle-slider{
  background:rgba(34,197,94,.28);
  border-color:rgba(34,197,94,.45);
}

.rr-live-toggle-wrap input:checked + .rr-live-toggle-slider::after{
  transform:translateX(26px);
  background:#dcfce7;
}

.rr-live-toggle-wrap input:focus + .rr-live-toggle-slider{
  box-shadow:0 0 0 3px rgba(59,130,246,.18);
}

.rr-live-toggle-wrap input:disabled + .rr-live-toggle-slider{
  opacity:.6;
}

.rr-live-toggle-text{
  font-size:13px;
  font-weight:700;
  color:var(--rr-text);
  letter-spacing:.02em;
}

.rr-driver-live-status{
  margin-top:-4px;
  padding:13px 16px;
  border-radius:16px;
  background:rgba(11,26,48,.9);
  border:1px solid rgba(255,255,255,.08);
  color:var(--rr-muted);
  font-size:13px;
  line-height:1.5;
}

.rr-btn{
  border:0;
  border-radius:14px;
  padding:11px 16px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
}

.rr-btn-secondary{
  background:var(--rr-accent);
  color:#111827;
}

.rr-driver-stats-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
}

.rr-stat-card{
  padding:16px;
  min-width:0;
}

.rr-stat-card strong{
  display:block;
  margin-top:8px;
  font-size:24px;
  line-height:1;
}

.rr-stat-card.is-good strong{color:var(--rr-green)}
.rr-stat-card.is-warn strong{color:var(--rr-orange)}
.rr-stat-card.is-danger strong{color:var(--rr-red)}

/* IMPORTANT: content area becomes one column */
.rr-driver-content-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  align-items:start;
}

.rr-panel{
  padding:18px;
}

.rr-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:14px;
}

.rr-panel-head h2{
  margin:6px 0 0;
  font-size:18px;
  line-height:1.2;
}

/* YOUR DAY ON ONE LINE */
.rr-route-summary,
.rr-routes-list{
  display:grid;
  gap:14px;
}

.rr-summary-card,
.rr-route-card{
  border:1px solid rgba(255,255,255,.06);
  border-radius:20px;
  background:#0b1628;
  padding:16px;
}

.rr-summary-card{
  width:100%;
}

.rr-summary-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
}

.rr-summary-head h3,
.rr-route-card-head h3,
.rr-stop-card h4{
  margin:0;
}

.rr-summary-head h3{
  font-size:18px;
  line-height:1.2;
}

.rr-route-card-head h3{
  font-size:16px;
  line-height:1.2;
}

.rr-stop-card h4{
  font-size:15px;
  line-height:1.25;
  word-break:break-word;
}

.rr-summary-head span,
.rr-route-card-head p,
.rr-stop-address,
.rr-stop-meta,
.rr-stop-muted{
  color:var(--rr-muted);
}

.rr-summary-head span,
.rr-route-card-head p{
  font-size:13px;
  line-height:1.45;
}

/* one line horizontal stats under Your day */
.rr-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.rr-summary-grid div{
  background:#0f1d33;
  border:1px solid rgba(255,255,255,.05);
  border-radius:16px;
  padding:14px 12px;
  min-width:0;
  min-height:84px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.rr-summary-grid strong{
  display:block;
  font-size:22px;
  line-height:1;
  margin-bottom:6px;
}

.rr-summary-grid span{
  display:block;
  font-size:13px;
  line-height:1.35;
  color:var(--rr-text);
  word-break:break-word;
}

/* FULL WIDTH MAP */
.rr-driver-map{
  width:100%;
  min-height:640px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.08);
  background:#09131f;
  overflow:hidden;
}

.rr-map-fallback{
  min-height:640px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  text-align:center;
  color:var(--rr-muted);
}

.rr-map-legend{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  align-items:center;
  color:var(--rr-muted);
  font-size:12px;
}

.rr-legend-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  margin-right:5px;
}

.rr-legend-dot.is-pending{background:var(--rr-blue)}
.rr-legend-dot.is-collected{background:var(--rr-green)}
.rr-legend-dot.is-postponed{background:var(--rr-orange)}
.rr-legend-dot.is-failed{background:var(--rr-red)}

.rr-map-note{
  margin:10px 4px 0;
  color:var(--rr-muted);
  font-size:12px;
}

.rr-route-card-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:16px;
}

.rr-route-badge{
  padding:8px 11px;
  border-radius:999px;
  background:rgba(215,175,90,.12);
  border:1px solid rgba(215,175,90,.35);
  color:#f5d38d;
  font-size:12px;
  white-space:nowrap;
}

.rr-stops-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.rr-stop-card{
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.06);
  background:#0f1d33;
  display:grid;
  gap:10px;
  transition:.2s ease;
  min-width:0;
}

.rr-stop-card.is-loading{opacity:.65; pointer-events:none}

.rr-stop-card.is-pending{box-shadow:inset 0 0 0 1px rgba(59,130,246,.18)}
.rr-stop-card.is-collected{box-shadow:inset 0 0 0 1px rgba(34,197,94,.18)}
.rr-stop-card.is-postponed{box-shadow:inset 0 0 0 1px rgba(245,158,11,.18)}
.rr-stop-card.is-failed{box-shadow:inset 0 0 0 1px rgba(239,68,68,.18)}

.rr-stop-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.rr-stop-address{
  font-size:13px;
  line-height:1.5;
  word-break:break-word;
}

.rr-status-pill{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:0 11px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid transparent;
  white-space:nowrap;
}

.rr-status-pill.is-pending{background:rgba(59,130,246,.12); color:#93c5fd; border-color:rgba(59,130,246,.34)}
.rr-status-pill.is-collected{background:rgba(34,197,94,.12); color:#86efac; border-color:rgba(34,197,94,.34)}
.rr-status-pill.is-postponed{background:rgba(245,158,11,.12); color:#fcd34d; border-color:rgba(245,158,11,.34)}
.rr-status-pill.is-failed{background:rgba(239,68,68,.12); color:#fda4af; border-color:rgba(239,68,68,.34)}

.rr-stop-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
  font-size:13px;
  line-height:1.45;
}

.rr-stop-link{
  color:#cfe1ff;
  text-decoration:none;
}

.rr-stop-link:hover{
  text-decoration:underline;
}

.rr-stop-notes{
  padding:11px 13px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.05);
  color:#dfe8f8;
  font-size:13px;
  line-height:1.5;
}

.rr-stop-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.rr-status-btn{
  min-height:40px;
  padding:0 13px;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:700;
  font-size:13px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

.rr-status-btn.is-collected{background:#0d2f1c; color:#a7f3d0; border-color:rgba(34,197,94,.35)}
.rr-status-btn.is-postponed{background:#312108; color:#fde68a; border-color:rgba(245,158,11,.35)}
.rr-status-btn.is-failed{background:#341117; color:#fecdd3; border-color:rgba(239,68,68,.35)}
.rr-map-btn{background:#13243c; color:#dbeafe; border-color:rgba(59,130,246,.35)}

.rr-empty,
.rr-driver-guard{
  padding:24px;
  border-radius:18px;
  background:#0f1d33;
  border:1px solid rgba(255,255,255,.06);
  color:var(--rr-muted);
  font-size:14px;
  line-height:1.5;
}

@media (max-width: 1500px){
  .rr-driver-shell{
    grid-template-columns:280px minmax(0,1fr);
  }

  .rr-driver-map,
  .rr-map-fallback{
    min-height:600px;
  }
}

@media (max-width: 1400px){
  .rr-driver-stats-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .rr-summary-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .rr-driver-map,
  .rr-map-fallback{
    min-height:580px;
  }
}

@media (max-width: 1080px){
  .rr-driver-shell{
    grid-template-columns:1fr;
    padding:16px;
  }

  .rr-driver-sidebar{
    position:static;
  }

  .rr-stops-grid{
    grid-template-columns:1fr;
  }

  .rr-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .rr-driver-map,
  .rr-map-fallback{
    min-height:500px;
  }
}

@media (max-width: 640px){
  .rr-driver-hero{
    padding:18px;
    flex-direction:column;
    align-items:flex-start;
  }

  .rr-driver-hero h1{
    font-size:24px;
  }

  .rr-driver-hero p{
    font-size:13px;
  }

  .rr-driver-stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .rr-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .rr-route-card-head,
  .rr-summary-head,
  .rr-stop-top,
  .rr-panel-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .rr-driver-hero-actions{
    width:100%;
    justify-content:flex-start;
  }

  .rr-driver-map,
  .rr-map-fallback{
    min-height:420px;
  }
}

.rr-map-popup{
  min-width:220px;
  max-width:280px;
  padding:6px 2px;
  color:#111827;
  font-size:13px;
  line-height:1.45;
}

.rr-map-popup strong{
  display:block;
  margin-bottom:4px;
  color:#111827;
  font-size:14px;
}

.rr-map-popup .rr-map-popup-address{
  color:#374151;
  margin-bottom:4px;
}

.rr-map-popup .rr-map-popup-status{
  color:#111827;
  font-weight:600;
}

.rr-map-popup .rr-map-popup-phone{
  margin-top:4px;
  color:#1f2937;
}

.rr-map-popup .rr-map-popup-notes{
  margin-top:6px;
  color:#4b5563;
}

.rr-map-popup .rr-map-popup-link{
  display:inline-block;
  margin-top:8px;
  color:#2563eb;
  text-decoration:none;
  font-weight:600;
}

.rr-map-popup .rr-map-popup-link:hover{
  text-decoration:underline;
}