:root{
  --bg:#0b1220;
  --panel:#111827;
  --card:#172033;
  --border:#25314a;
  --text:#ecf3ff;
  --muted:#9fb1cc;
  --accent:#22c55e;
  --accent-2:#16a34a;
  --danger:#ef4444;
  --warning:#f59e0b;
  --blue:#3b82f6;
  --shadow:0 12px 30px rgba(0,0,0,.25);
  --radius:18px;
  --input:#0f172a;
}

*{
  box-sizing:border-box;
}

html, body{
  margin:0;
  padding:0;
  width:100%;
  height:100%;
  font-family:Arial, Helvetica, sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{
  color:inherit;
  text-decoration:none;
}

.layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  width:100%;
  height:100vh;
}

.sidebar{
  background:var(--panel);
  border-right:1px solid var(--border);
  padding:18px;
  overflow:auto;
}

.main{
  display:flex;
  flex-direction:column;
  height:100vh;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
  background:rgba(17,24,39,.92);
}

.topbar h2,
.manager-header h1,
.brand h1{
  margin:0 0 6px;
}

.topbar p,
.manager-header p,
.brand p{
  margin:0;
  color:var(--muted);
}

.top-actions{
  display:flex;
  gap:10px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:16px;
  box-shadow:var(--shadow);
}

.card h2{
  margin:0 0 14px;
  font-size:18px;
}

label{
  display:block;
  margin:10px 0 6px;
  font-size:14px;
  color:#d6e5ff;
}

input,
select,
button{
  font:inherit;
}

input[type="text"],
input[type="number"],
select{
  width:100%;
  border:1px solid var(--border);
  background:var(--input);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  outline:none;
}

input[type="color"]{
  width:100%;
  height:44px;
  border:none;
  background:transparent;
  padding:0;
  cursor:pointer;
}

.checkbox-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:14px;
}

.checkbox-row input{
  width:18px;
  height:18px;
}

.buttons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:700;
  transition:.18s ease;
}

.btn:hover{
  transform:translateY(-1px);
}

.btn-primary{
  background:var(--accent);
  color:#06130a;
}

.btn-secondary{
  background:#243146;
  color:#e6f0ff;
}

.btn-danger{
  background:var(--danger);
  color:white;
}

.courier-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.courier-item{
  border:1px solid var(--border);
  background:#10192b;
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  transition:.18s ease;
}

.courier-item:hover{
  border-color:#3b4f73;
  transform:translateY(-1px);
}

.courier-item.active{
  outline:2px solid var(--accent);
}

.courier-item .row-1{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.courier-item .name{
  font-weight:700;
}

.courier-item .dot{
  width:14px;
  height:14px;
  border-radius:999px;
  flex:0 0 auto;
  border:2px solid rgba(255,255,255,.25);
}

.courier-item .meta{
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

#map{
  width:100%;
  height:100%;
  min-height:400px;
}

.manager-layout{
  width:100%;
  height:100vh;
  display:flex;
  flex-direction:column;
}

.manager-header{
  padding:16px 20px;
  border-bottom:1px solid var(--border);
  background:var(--panel);
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.manager-content{
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns: 340px 1fr;
}

.manager-panel{
  border-right:1px solid var(--border);
  background:var(--panel);
  padding:16px;
  overflow:auto;
}

.manager-map-wrap{
  min-height:0;
}

.leaflet-popup-content-wrapper{
  border-radius:16px;
}

.courier-marker{
  width:42px;
  height:42px;
  border-radius:999px;
  background:#ffffff;
  border:3px solid #1f2937;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  box-shadow:0 8px 18px rgba(0,0,0,.28);
}

.status-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:4px 8px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.status-badge.on{
  background:rgba(34,197,94,.16);
  color:#86efac;
}

.status-badge.off{
  background:rgba(239,68,68,.14);
  color:#fca5a5;
}

.popup-title{
  font-size:16px;
  font-weight:700;
  margin-bottom:8px;
}

.popup-meta{
  font-size:13px;
  line-height:1.5;
}

@media (max-width: 980px){
  .layout{
    grid-template-columns:1fr;
    grid-template-rows:auto 1fr;
  }

  .sidebar{
    max-height:50vh;
    border-right:none;
    border-bottom:1px solid var(--border);
  }

  .manager-content{
    grid-template-columns:1fr;
    grid-template-rows:auto 1fr;
  }

  .manager-panel{
    border-right:none;
    border-bottom:1px solid var(--border);
    max-height:35vh;
  }
}

.courier-marker{
  width:54px;
  height:54px;
  border-radius:999px;
  background:#ffffff;
  border:3px solid #1f2937;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  font-weight:800;
  color:#111827;
  box-shadow:0 8px 18px rgba(0,0,0,.28);
}

.roman-marker{
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0.5px;
}
.map-search-bar{
  display:flex;
  gap:10px;
  padding:12px 16px;
  background:#0f172a;
  border-bottom:1px solid #25314a;
}

.map-search-bar input{
  flex:1;
  border:1px solid #25314a;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:10px;
}

.map-search-bar button{
  border:none;
  background:#3b82f6;
  color:#fff;
  padding:10px 16px;
  border-radius:10px;
  cursor:pointer;
}
