/* Cabinet shell + city picker + map */
.wrap--wide { max-width: 1180px; }
.cab {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.cab-side {
  position: sticky;
  top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 12px 14px;
  backdrop-filter: blur(10px);
}
.cab-user {
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.cab-user__hello { font-size: 0.78rem; color: var(--fog); margin: 0 0 4px; }
.cab-user__name {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.12rem; font-weight: 700; color: #fff; margin: 0;
  line-height: 1.25;
}
.cab-user__role {
  display: inline-block; margin-top: 8px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink); background: var(--amber); border-radius: 999px; padding: 4px 10px;
}
.cab-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(232, 163, 23, 0.28);
  background: rgba(232, 163, 23, 0.1);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}
.cab-balance:hover { border-color: rgba(232, 163, 23, 0.55); }
.cab-balance strong { font-size: 0.95rem; font-weight: 800; color: #ffd789; }
.cab-nav { display: grid; gap: 3px; }
.cab-nav__label {
  margin: 10px 8px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6f8092;
}
.cab-nav__label:first-child { margin-top: 2px; }
.cab-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 12px;
  color: #d7e0ea; font-weight: 700; font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.cab-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.cab-nav a.is-active {
  background: rgba(232, 163, 23, 0.14);
  border-color: rgba(232, 163, 23, 0.35);
  color: #fff;
}
.cab-nav a.cab-nav__cta {
  background: rgba(232, 163, 23, 0.16);
  border-color: rgba(232, 163, 23, 0.28);
  color: #fff;
}
.cab-nav a.cab-nav__cta:hover,
.cab-nav a.cab-nav__cta.is-active {
  background: rgba(232, 163, 23, 0.24);
  border-color: rgba(232, 163, 23, 0.5);
}
.cab-nav__ico {
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-grid; place-items: center;
  background: rgba(0,0,0,0.25); font-size: 0.8rem;
  flex-shrink: 0;
}
.cab-nav__meta { margin-left: auto; font-size: 0.75rem; color: var(--fog); font-weight: 600; }
.cab-badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8a317;
  color: #1a2330;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cab-main { display: grid; gap: 14px; min-width: 0; }

/* Page chrome */
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 2px 2px;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
}
.page-head .muted { margin: 0; max-width: 46rem; line-height: 1.45; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.text-strong { color: #fff; font-weight: 700; }

.stat-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  color: inherit;
}
.stat--link { transition: border-color .15s, background .15s; }
.stat--link:hover {
  border-color: rgba(232, 163, 23, 0.4);
  background: rgba(232, 163, 23, 0.08);
}
.stat__label { font-size: 0.75rem; color: var(--fog); margin: 0 0 6px; }
.stat__value {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.card--section { margin: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.section-head__link {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.note {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.note strong { display: block; color: #fff; margin-bottom: 6px; font-size: 0.95rem; }
.note ul {
  margin: 0;
  padding-left: 1.15em;
  color: var(--fog);
  font-size: 0.88rem;
  line-height: 1.5;
}
.note--warn {
  border-color: rgba(232, 163, 23, 0.4);
  background: rgba(232, 163, 23, 0.08);
}

.empty-state {
  padding: 22px 8px 8px;
  text-align: center;
}
.empty-state p {
  margin: 0 0 14px;
  color: var(--fog);
}

.cab-hint {
  margin: 0;
  padding: 0 4px;
  color: #7a8b9c;
  font-size: 0.8rem;
  line-height: 1.45;
}
.cab-hint a { font-weight: 700; }

.list-row {
  display: block; padding: 14px 0; border-top: 1px solid var(--line); color: inherit;
  transition: background .15s;
  border-radius: 0;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}
.list-row:first-of-type { border-top: 1px solid var(--line); margin-top: 8px; }
.list-row:hover { background: rgba(255,255,255,0.03); }
.list-row__top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.list-row__title { margin-top: 4px; color: #fff; font-weight: 600; }
.list-row__meta { margin: 4px 0 0; font-size: 0.88rem; color: var(--fog); }
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.75rem; font-weight: 700;
  border-radius: 999px; padding: 3px 9px;
  background: rgba(255,255,255,0.08); color: var(--fog);
}
.badge--ok { background: rgba(62,207,142,0.18); color: #b8f5d6; }
.badge--warn { background: rgba(232,163,23,0.18); color: #ffd789; }

/* Notifications — dark theme */
.notif-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.notif-item a {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.22);
  text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
.notif-item a:hover { border-color: rgba(255,255,255,0.22); }
.notif-item.is-unread a {
  border-color: rgba(232, 163, 23, 0.45);
  background: rgba(232, 163, 23, 0.1);
}
.notif-item strong { color: #fff; }
.notif-item span { color: var(--fog); font-size: 0.92rem; }
.notif-item em { color: #8a9aab; font-style: normal; font-size: 0.82rem; }
.notif-item time { color: #6f8092; font-size: 0.75rem; }

/* Slim top nav inside cabinet */
body.page-cabinet .nav .btn-ghost[href*="zayavki"],
body.page-cabinet .nav .btn-ghost[href*="marshrut"],
body.page-cabinet .nav .btn-ghost[href*="lenta"],
body.page-cabinet .nav .btn-ghost[href*="otkliki"],
body.page-cabinet .nav .btn-ghost[href*="mashiny"],
body.page-cabinet .nav .btn-primary[href*="novaya"] {
  display: none;
}

.cab-hero {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
}
.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-map-wrap {
  border-radius: 16px;
  overflow: visible;
  border: 1px solid var(--line);
  background: #0a121a;
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 0 4px;
}
.route-map {
  width: 100%;
  height: 300px;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
}
.route-map--lg { height: 380px; }
.route-map__tools {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 22, 32, 0.96);
  max-width: none;
  overflow: visible;
  border-radius: 16px 16px 0 0;
}
.route-map__tools .has-tip[data-tip]::after {
  bottom: auto;
  top: calc(100% + 8px);
}
.route-map__hint {
  position: relative;
  z-index: 2;
  left: auto;
  bottom: auto;
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(14, 22, 32, 0.96);
  font-size: 0.78rem;
  color: var(--fog);
  max-width: none;
  pointer-events: none;
  line-height: 1.35;
}
.route-map__chk {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--fog);
  cursor: pointer;
  width: auto;
}
.route-map__chk input {
  width: auto !important;
  margin: 0 !important;
  flex-shrink: 0;
}
.route-map__chk span {
  color: inherit;
  line-height: 1.2;
}
.route-map__btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.route-map__btn[hidden] { display: none !important; }
.route-map__btn:hover { border-color: var(--amber); color: var(--amber); }

.route-map__warn {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(232, 163, 23, 0.45);
  background: rgba(232, 163, 23, 0.12);
  color: #f0d9a0;
  font-size: 0.82rem;
  line-height: 1.4;
}
.route-map__warn[hidden] { display: none !important; }
.route-map__warn.is-risk {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.12);
  color: #ffc9c9;
}
.route-map__legal {
  margin: 8px 0 0;
  color: #7a8b9c;
  font-size: 0.72rem;
  line-height: 1.4;
}
.route-map__legal[hidden] { display: none !important; }
.city-picker { position: relative; z-index: 2; }
.city-picker.is-open { z-index: 1200; }
.city-picker__input { width: 100%; }
.city-picker__list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 1200; max-height: 260px; overflow: auto;
  background: #121c28; border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}
.city-picker.is-open .city-picker__list { display: block; }
.row:has(.city-picker.is-open) { position: relative; z-index: 1200; }
.card:has(.city-picker.is-open) { overflow: visible; }
.city-picker__item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; background: transparent;
  color: #fff; font: inherit; cursor: pointer;
}
.city-picker__item:hover,
.city-picker__item.is-active { background: rgba(232,163,23,0.16); }
.city-picker__item small { display: block; color: var(--fog); font-size: 0.75rem; margin-top: 2px; }
.city-picker__empty { padding: 12px; color: var(--fog); font-size: 0.85rem; }
.leaflet-container { background: #0a121a; font: inherit; }
.leaflet-control-attribution { font-size: 9px !important; background: rgba(0,0,0,0.45) !important; color: #8a9aab !important; }
.leaflet-control-attribution a { color: #b8c6d4 !important; }
/* OSM с русскими подписями + тёмный вид */
.leaflet-tile-pane .vyvezi-map-tiles {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.95) saturate(0.7);
}
.leaflet-container .leaflet-tooltip {
  background: rgba(14, 22, 32, 0.92);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 8px;
  box-shadow: none;
}
.leaflet-container .leaflet-tooltip-top:before {
  border-top-color: rgba(14, 22, 32, 0.92);
}
/* Всплывающие подсказки «?» */
.tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}
.tip__btn {
  appearance: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 163, 23, 0.55);
  background: rgba(232, 163, 23, 0.12);
  color: #e8a317;
  font: 700 11px/1 Manrope, system-ui, sans-serif;
  cursor: help;
  flex-shrink: 0;
}
.tip__btn:hover,
.tip__btn:focus-visible,
.tip.is-open .tip__btn {
  background: rgba(232, 163, 23, 0.28);
  border-color: #e8a317;
  outline: none;
}
.tip__bubble {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(280px, 72vw);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(232, 163, 23, 0.35);
  background: rgba(8, 14, 22, 0.96);
  color: #e8eef5;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: normal;
  text-align: left;
  display: none;
}
.tip--wide .tip__bubble { width: min(340px, 84vw); }
.tip__bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(8, 14, 22, 0.96);
}
.tip:hover .tip__bubble,
.tip:focus-within .tip__bubble,
.tip.is-open .tip__bubble {
  display: block;
}

/* chips / map buttons with data-tip */
.has-tip {
  position: relative;
}
.has-tip[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(260px, 70vw);
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(232, 163, 23, 0.35);
  background: rgba(8, 14, 22, 0.96);
  color: #e8eef5;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  white-space: normal;
  text-align: left;
}
.has-tip[data-tip]:hover::after,
.has-tip[data-tip]:focus-within::after,
.has-tip.is-tip-open[data-tip]::after {
  opacity: 1;
  visibility: visible;
}

.calc-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.calc-role {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--fog);
}
.calc-role strong {
  display: block;
  color: #fff;
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.corridor-chip {
  display: inline-block;
  margin: 2px 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
}
.corridor-chip:hover { border-color: var(--amber); }

/* Filters / wallet packs / ledger */
.filter-panel {
  display: grid;
  gap: 12px;
}
.filter-smart {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}
.filter-smart legend {
  padding: 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--amber);
}
.filter-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 0 8px !important;
}
.filter-check input { width: auto !important; margin: 0 !important; }
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wallet-balance {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--amber);
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.pack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pay-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--fog);
}
.pay-card strong { color: #fff; }
.pay-grid {
  display: grid;
  gap: 10px;
}
.tx-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.tx-row:first-of-type { border-top: 0; padding-top: 4px; }
.tx-row__amt { white-space: nowrap; font-weight: 800; }
.tx-row__amt.is-in { color: var(--ok); }
.tx-row__amt.is-out { color: #ffb4b4; }

/* Order wizard (cabinet) */
.wiz-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.wiz-step {
  flex: 1;
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  color: var(--fog);
  font-size: 0.82rem;
  font-weight: 700;
}
.wiz-step.is-on {
  color: #fff;
  border-color: rgba(232,163,23,0.45);
  background: rgba(232,163,23,0.12);
}
.wiz-step.is-done { color: #b8f5d6; border-color: rgba(62,207,142,0.35); }
.wiz-pane[hidden] { display: none !important; }
.wiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.wiz-checks {
  display: grid;
  gap: 10px;
  margin: 4px 0 8px;
}
.wiz-checks label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

@media (max-width: 860px) {
  .cab { grid-template-columns: 1fr; }
  .cab-side { position: static; }
  .cab-hero { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-head { align-items: stretch; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; justify-content: center; }
  .calc-roles { grid-template-columns: 1fr; }
  .wiz-actions { flex-direction: column; align-items: stretch; }
  .wiz-actions .btn { width: 100%; justify-content: center; }
  body.page-cabinet .nav .btn-ghost[href*="zayavki"],
  body.page-cabinet .nav .btn-ghost[href*="marshrut"],
  body.page-cabinet .nav .btn-ghost[href*="lenta"],
  body.page-cabinet .nav .btn-primary[href*="novaya"] {
    display: inline-flex;
  }
}
@media (max-width: 560px) {
  .stat-grid,
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip .stat:last-child { grid-column: 1 / -1; }
  .route-map { height: 240px; }
  .route-map--lg { height: 280px; }
  .tip__bubble { left: 0; transform: none; }
  .tip__bubble::after { left: 10px; transform: none; }
  .wiz-bar { gap: 6px; }
}
