/* ================= DESE Control — интерфейс панели ================= */

:root {
  --bg:          #F5F7FB;
  --surface:     #FFFFFF;
  --surface-2:   #FAFBFE;
  --ink:         #0F172A;
  --ink-2:       #334155;
  --muted:       #64748B;
  --muted-2:     #94A3B8;
  --line:        #E9EDF4;
  --line-2:      #F1F5F9;

  --brand:       #2563EB;
  --brand-dark:  #1D4ED8;
  --brand-soft:  #EFF5FF;
  --green:       #16A34A;
  --green-soft:  #E9F7EE;
  --amber:       #F59E0B;
  --amber-soft:  #FEF5E1;
  --red:         #EF4444;
  --red-soft:    #FDECEC;
  --violet:      #7C3AED;
  --violet-soft: #F2EDFC;

  --shadow-sm:   0 1px 2px rgba(15, 23, 42, .05);
  --shadow:      0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg:   0 18px 48px rgba(15, 23, 42, .14);

  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  --sidebar-w: 262px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont,
               "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

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

/* ================= каркас ================= */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- боковое меню ---------- */
.sidebar {
  background: linear-gradient(170deg, #0B1220 0%, #101B31 55%, #0D1526 100%);
  color: #E2E8F0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(150deg, #3B82F6, #2563EB 60%, #1E40AF);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .45);
}
.brand-text b { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; color: #fff; }
.brand-text span { font-size: 11.5px; color: #7C8DA6; letter-spacing: .3px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1 1 auto; }
.nav::-webkit-scrollbar { width: 0; }
.nav-cap {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: #55657E; padding: 18px 12px 7px; font-weight: 700;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: #A9B6CA; font-weight: 500; font-size: 14px;
  transition: background .14s, color .14s;
}
.nav a svg { flex: 0 0 auto; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #E9EEF6; }
.nav a.on {
  background: linear-gradient(100deg, rgba(37, 99, 235, .95), rgba(37, 99, 235, .72));
  color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .35);
}
.nav a.on svg { opacity: 1; }
.nav .count {
  margin-left: auto; font-size: 11.5px; font-weight: 700;
  background: rgba(255, 255, 255, .09); padding: 2px 8px; border-radius: 999px; color: #C7D2E2;
}
.nav a.on .count { background: rgba(255, 255, 255, .22); color: #fff; }

.side-foot { border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 14px; margin-top: 10px; }
.side-user { display: flex; align-items: center; gap: 11px; padding: 6px 8px; }
.side-user .ava {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(150deg, #334155, #1E293B); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .12);
}
.side-user .who { min-width: 0; flex: 1 1 auto; }
.side-user .who b { display: block; font-size: 13.5px; color: #E7EDF6; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 11.5px; color: #6C7C93; }
.side-user form { margin: 0; }
.icon-out {
  border: 0; background: transparent; color: #6C7C93; cursor: pointer;
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
}
.icon-out:hover { background: rgba(255, 255, 255, .08); color: #E2E8F0; }

/* ---------- верхняя полоса ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(245, 247, 251, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 16px 30px;
  display: flex; align-items: center; gap: 18px;
}
.topbar h1 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.45px; }
.topbar .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.topbar .grow { flex: 1 1 auto; }

.langs { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; box-shadow: var(--shadow-sm); }
.langs a {
  padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 700;
  color: var(--muted); letter-spacing: .3px;
}
.langs a:hover { color: var(--ink); }
.langs a.on { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }

.content { padding: 26px 30px 44px; flex: 1 1 auto; }

/* ================= элементы ================= */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--line-2);
}
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.card-head .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-head .grow { flex: 1 1 auto; }
.card-body { padding: 20px 22px; }
.card-body.tight { padding: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, transform .08s, box-shadow .14s;
}
.btn:hover { background: var(--surface-2); border-color: #DCE3ED; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(160deg, #3B82F6, var(--brand) 65%);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .32);
}
.btn-primary:hover { background: linear-gradient(160deg, #2E76F0, var(--brand-dark) 70%); border-color: transparent; }
.btn-danger { color: var(--red); border-color: #F6DADA; background: #FEF6F6; }
.btn-danger:hover { background: var(--red-soft); border-color: #F3C6C6; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-sm { height: 33px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { width: 36px; padding: 0; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- поля ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .lbl {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2);
  margin-bottom: 7px; letter-spacing: -.1px;
}
.field .note { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 14.5px;
  transition: border-color .14s, box-shadow .14s;
}
textarea.input { height: auto; padding: 11px 13px; line-height: 1.5; resize: vertical; min-height: 96px; }
.input:focus, .select:focus, textarea.input:focus {
  outline: 0; border-color: #A9C4F7; box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .13);
}
.input::placeholder { color: var(--muted-2); }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input.err, .select.err { border-color: #F0A9A9; box-shadow: 0 0 0 3.5px rgba(239, 68, 68, .1); }
.err-msg { color: var(--red); font-size: 12.5px; margin-top: 6px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }

/* переключатель */
.switch {
  width: 44px; height: 26px; border-radius: 999px; background: #DFE5EE;
  position: relative; cursor: pointer; flex: 0 0 auto; transition: background .16s;
  border: 0; padding: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
  transition: transform .16s;
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-row .t { font-size: 14px; font-weight: 600; }
.switch-row .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- языковые вкладки ---------- */
.lang-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.lang-tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: var(--r-sm); padding: 6px 12px; font-size: 12.5px; font-weight: 650;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.lang-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: #CBD5E1; }
.lang-tab .dot.filled { background: var(--green); }
.lang-tab.on { background: var(--brand-soft); border-color: #C5DAFB; color: var(--brand); }
.lang-pane { display: none; }
.lang-pane.on { display: block; }

/* ---------- таблица ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted-2); font-weight: 700; padding: 12px 22px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #FBFCFE; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.badge-num {
  display: inline-grid; place-items: center; min-width: 44px; height: 34px;
  padding: 0 9px; border-radius: 10px; color: #fff;
  font-weight: 750; font-size: 15px; letter-spacing: -.3px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--line-2); color: var(--ink-2);
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok   { background: var(--green-soft);  color: #12803C; }
.pill.warn { background: var(--amber-soft);  color: #A96A05; }
.pill.off  { background: var(--line-2);      color: var(--muted); }
.pill.info { background: var(--brand-soft);  color: var(--brand); }

.dim { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }

/* ---------- карточки статистики ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 14px;
}
.stat .val { font-size: 30px; font-weight: 780; letter-spacing: -1px; line-height: 1; }
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 7px; }
.stat .trend { font-size: 12px; font-weight: 650; margin-top: 9px; display: inline-flex; gap: 5px; align-items: center; }
.stat .trend.up { color: var(--green); }
.stat .trend.flat { color: var(--muted-2); }

/* ---------- график ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted-2); }
.chart-tip {
  position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -100%);
  background: #0F172A; color: #fff; border-radius: 10px; padding: 8px 11px;
  font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-lg); transition: opacity .12s;
  z-index: 5;
}
.chart-tip b { font-size: 13px; }
.chart-tip span { color: #94A3B8; }
.chart-hit { fill: transparent; cursor: crosshair; }

.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ---------- сообщения и пустые экраны ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border-radius: var(--r-md); font-size: 14px; margin-bottom: 18px;
}
.alert.ok  { background: var(--green-soft); color: #12803C; }
.alert.bad { background: var(--red-soft);   color: #B02323; }
.alert svg { flex: 0 0 auto; margin-top: 1px; }

.empty { padding: 62px 24px; text-align: center; color: var(--muted); }
.empty .ico {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px;
  background: var(--line-2); display: grid; place-items: center; color: var(--muted-2);
}
.empty b { display: block; color: var(--ink); font-size: 16.5px; margin-bottom: 6px; font-weight: 700; }

/* ---------- пагинация ---------- */
.pagination { display: flex; gap: 5px; padding: 16px 22px; justify-content: flex-end; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.pagination .cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .dis { color: var(--muted-2); background: var(--surface-2); }

/* ---------- фильтры ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search {
  position: relative; flex: 1 1 260px; max-width: 380px;
}
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search .input { padding-left: 40px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 8px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }

/* ---------- вход ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -5%, #DCE9FF 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 100%, #E7DFFA 0%, transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 412px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow-lg); padding: 34px 32px 30px;
}
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.auth h1 { margin: 0 0 6px; font-size: 23px; font-weight: 760; letter-spacing: -.5px; }
.auth .lead { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth .btn { width: 100%; height: 46px; font-size: 15px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--muted-2); }
.auth-langs { display: flex; justify-content: center; gap: 4px; margin-top: 16px; }

/* ---------- редактор маршрута на карте ---------- */
.builder { display: grid; grid-template-columns: 1fr 372px; gap: 18px; align-items: start; }
@media (max-width: 1240px) { .builder { grid-template-columns: 1fr; } }
.builder-map {
  height: calc(100vh - 208px); min-height: 460px;
  border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative;
}
#map { width: 100%; height: 100%; background: #E8EDF4; }
.map-tools {
  position: absolute; top: 12px; left: 12px; z-index: 500;
  display: flex; gap: 7px; background: rgba(255, 255, 255, .96);
  padding: 6px; border-radius: 13px; box-shadow: var(--shadow);
}
.map-tools .btn { height: 34px; }
.map-hint {
  position: absolute; bottom: 12px; left: 12px; z-index: 500;
  background: rgba(15, 23, 42, .84); color: #fff; font-size: 12.5px;
  padding: 8px 13px; border-radius: 10px; max-width: 60%;
}
.side-panel { position: sticky; top: 92px; }
.stop-list { max-height: calc(100vh - 430px); overflow-y: auto; }
.stop-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px;
  border-bottom: 1px solid var(--line-2); cursor: grab;
}
.stop-item:last-child { border-bottom: 0; }
.stop-item:hover { background: var(--surface-2); }
.stop-item.drag { opacity: .4; }
.stop-item .seq {
  width: 27px; height: 27px; border-radius: 8px; flex: 0 0 auto;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.stop-item .nm { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-item .co { font-size: 11px; color: var(--muted-2); }
.stop-item .rm { opacity: 0; }
.stop-item:hover .rm { opacity: 1; }

.stop-marker {
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid var(--brand); box-shadow: 0 2px 8px rgba(15, 23, 42, .3);
  display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--brand);
}
.vertex-marker {
  width: 11px; height: 11px; border-radius: 50%; background: #fff;
  border: 2.5px solid var(--brand); box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
}
.leaflet-div-icon { background: transparent; border: 0; }
.leaflet-container { font: inherit; }

/* ---------- модальное окно ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 24px;
}
.modal-back[hidden] { display: none !important; }
.modal {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
}
.modal .card-head { position: sticky; top: 0; background: var(--surface); border-radius: 22px 22px 0 0; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px; border-top: 1px solid var(--line-2);
  position: sticky; bottom: 0; background: var(--surface);
}

/* ---------- мелочи ---------- */
.tag-lang {
  font-size: 10px; font-weight: 700; letter-spacing: .4px; color: var(--muted-2);
  background: var(--line-2); border-radius: 5px; padding: 2px 5px; margin-left: 6px;
}
.miss { color: var(--amber); }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 18px 0; }

@media (max-width: 940px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav-cap, .side-foot { display: none; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}

/* ---------- маленькая карта выбора точки в форме ---------- */
.pick-map {
  height: 220px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); background: #E8EDF4;
}
.pick-map .leaflet-control-zoom { border: 0; box-shadow: var(--shadow-sm); }

/* ---------- страницы ошибок ---------- */
.errpage {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -5%, #DCE9FF 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 100%, #E7DFFA 0%, transparent 55%),
    var(--bg);
  text-align: center;
}
.errpage .code {
  font-size: 76px; font-weight: 800; letter-spacing: -3px; line-height: 1;
  background: linear-gradient(150deg, #3B82F6, #2563EB 60%, #7C3AED);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.errpage h1 { margin: 16px 0 8px; font-size: 22px; font-weight: 750; letter-spacing: -.4px; }
.errpage p { margin: 0 0 24px; color: var(--muted); max-width: 380px; }

/* остановки других маршрутов в редакторе — бледные, кликабельные */
.ghost-marker {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--muted-2);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .2); cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.ghost-marker:hover { transform: scale(1.35); border-color: var(--brand); }

/* ---------- окно должно быть выше карты ---------- */
/* Leaflet раскладывает свои слои до z-index 1000, поэтому карту запираем
   в собственный контекст наложения, а окно поднимаем над всем. */
.builder-map { z-index: 0; }
.modal-back { z-index: 2000; }

/* ---------- правка названия прямо в списке остановок ---------- */
.stop-item .nm-input {
  flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 10px;
  border: 1px solid #A9C4F7; border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: #fff; outline: 0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.stop-item .nm { cursor: text; }
.stop-item .nm:hover { color: var(--brand); }
.stop-item.editing { background: var(--brand-soft); }
.stop-item .row-btn {
  opacity: 0; flex: 0 0 auto; width: 28px; height: 28px; border: 0;
  background: transparent; color: var(--muted-2); border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
}
.stop-item:hover .row-btn, .stop-item.editing .row-btn { opacity: 1; }
.stop-item .row-btn:hover { background: #fff; color: var(--ink); }
.stop-item .row-btn.danger:hover { color: var(--red); }
.stop-item .lang-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
  flex: 0 0 auto; margin-left: 2px;
}
.stop-hint {
  padding: 10px 14px; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--line-2); background: var(--surface-2);
}

/* ---------- график работы маршрута по дням ---------- */
.sched { border-collapse: collapse; }
.sched td { padding: 3px 6px 3px 0; vertical-align: middle; }
.sched .input { width: 120px; }
.sched-day { min-width: 150px; }
.sched-on { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.sched-dash { color: var(--muted); }
.sched tr.off .sched-on { color: var(--muted); }
.sched tr.off .input { opacity: .45; }
