:root {
  --bg: #12100e;
  --bg-soft: #1a1714;
  --card: #201c18;
  --card-hover: #262120;
  --border: #332c25;
  --text: #ece6dc;
  --muted: #a69b8c;
  --gold: #c9a24b;
  --gold-light: #e2c27a;
  --red: #b4482f;
  --red-bright: #e05437;
  --green: #4e9a67;
  --yellow: #c9a24b;
  --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", "Arial", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  background: #141110;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  background: var(--gold);
  color: #241c10;
  transition: background .15s;
}

.btn:hover { background: var(--gold-light); }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.ghost:hover { border-color: var(--gold); }

.btn.danger {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red-bright);
}

.btn.danger:hover { background: var(--red); color: #fff; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 8px;
  font-size: 40px;
  color: var(--gold);
  letter-spacing: 4px;
}

.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  margin: 4px 0 28px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-box .field { margin-bottom: 14px; }

.login-error {
  background: rgba(180,72,47,.12);
  border: 1px solid var(--red);
  color: var(--red-bright);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  display: none;
}

.login-error.show { display: block; }

.login-box .btn { width: 100%; margin-top: 8px; }

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}

.side-logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.side-logo small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1px; font-weight: 400; margin-top: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-bottom: 2px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  width: 100%;
}

.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--card); color: var(--gold); }

.nav-ico { width: 18px; text-align: center; font-size: 15px; }

.side-user {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.side-user .name { font-weight: 600; font-size: 13px; }
.side-user .role { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.side-user .btn.ghost { width: 100%; font-size: 12px; padding: 7px; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 26px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 4px;
  text-align: center;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
  text-align: center;
}

/* ---------- Cards / statuses ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.stat-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

.s-active .stat-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.s-silence .stat-dot { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.s-critical .stat-dot { background: var(--red-bright); box-shadow: 0 0 8px var(--red-bright); animation: blink 1s infinite; }
.s-finished .stat-dot { background: #555; }
.s-no_data .stat-dot { background: #666; }

@keyframes blink { 50% { opacity: .3; } }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge.active { background: rgba(78,154,103,.15); color: var(--green); border-color: rgba(78,154,103,.4); }
.badge.silence { background: rgba(201,162,75,.15); color: var(--gold); border-color: rgba(201,162,75,.4); }
.badge.critical { background: rgba(224,84,55,.15); color: var(--red-bright); border-color: rgba(224,84,55,.5); }
.badge.finished { background: rgba(255,255,255,.04); color: var(--muted); }

.session-card .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.session-card .who { font-size: 16px; font-weight: 700; }
.session-card .who .callsign { color: var(--gold); }
.session-card .dest { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.session-card .meta { color: var(--muted); font-size: 12px; }
.session-card .meta div { margin-bottom: 2px; }
.session-card .coords { font-size: 12px; color: var(--gold-light); font-family: Consolas, monospace; margin-top: 6px; }

/* ---------- Table ---------- */
table.list {
  width: 100%;
  border-collapse: collapse;
}

table.list th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

table.list td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(51,44,37,.5);
}

table.list tr:hover td { background: rgba(255,255,255,.02); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn { padding: 5px 10px; font-size: 12px; }

/* ---------- Detail ---------- */
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.detail-meta .card { margin: 0; }
.detail-meta .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.detail-meta .value { font-weight: 600; font-size: 15px; }
#route-map { width: 100%; height: 420px; border-radius: 12px; border: 1px solid var(--border); background: #0f0d0b; z-index: 0; }

.leaflet-container { background: #0f0d0b; font-family: inherit; }
.leaflet-tile-pane { filter: brightness(.85) contrast(1.05); }

.route-start-marker {
  background: #4e9a67;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  width: 14px; height: 14px;
  transform: rotate(-45deg);
}

.route-end-marker {
  background: #e05437;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  width: 14px; height: 14px;
  transform: rotate(-45deg);
}

.route-me-marker {
  background: transparent;
  border: none;
}
.route-me-marker span {
  display: block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(78,154,103,.35);
  border: 2.5px solid #4e9a67;
  box-shadow: 0 0 0 3px rgba(78,154,103,.2);
}

.map-placeholder {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Карта «Кто сейчас на задании» */
.now-map-wrap { margin-bottom: 16px; }
#now-map { width: 100%; height: 380px; border-radius: 12px; border: 1px solid var(--border); background: #0f0d0b; z-index: 0; }
@media (max-width: 720px) { #now-map { height: 260px; } }

/* ---------- Events ---------- */
.event-form { max-width: 480px; margin-bottom: 24px; }
.event-form .field { margin-bottom: 12px; }
.event-item { margin-bottom: 10px; }
.event-item .title { font-weight: 700; color: var(--gold); }
.event-item .body { color: var(--text); margin: 4px 0; }
.event-item .when { color: var(--muted); font-size: 12px; }

/* ---------- Users ---------- */
.user-add-form { margin-bottom: 18px; }
.user-add-title { font-weight: 700; color: var(--gold); margin-bottom: 12px; font-size: 15px; }
.user-add-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 10px; align-items: center; }
@media (max-width: 900px) { .user-add-grid { grid-template-columns: 1fr 1fr; } }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.user-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.u-callsign { font-weight: 700; font-size: 16px; color: var(--gold-light); }
.u-role { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; }
.u-email { color: var(--muted); font-size: 12px; width: 100%; }
.role-select { background: #141110; border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 5px 8px; font-size: 12px; }
.row-actions .role-select { margin-right: 6px; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
  font-size: 13px;
}

/* Пустые состояния растягиваются на весь центр, чтобы футер был внизу */
.main .empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.ms-chat-body .empty { flex: 0 0 auto; }
@media (max-width: 720px) {
  .main .empty { flex: 0 0 auto; padding: 30px 0; }
}

/* ---------- Panel footer ---------- */
.panel-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.panel-footer a { color: var(--gold-light); text-decoration: none; }

/* ---------- Mobile header ---------- */
.m-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.m-brand { display: flex; flex-direction: column; font-weight: 700; font-size: 14px; color: var(--gold); letter-spacing: 1px; text-decoration: none; }
.m-brand small { color: var(--muted); font-size: 10px; letter-spacing: .5px; font-weight: 400; text-transform: none; }
.m-actions { display: flex; align-items: center; gap: 8px; }
.m-link {
  background: none; border: 1px solid var(--border); color: var(--muted); font-size: 12px;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.m-link:hover { border-color: var(--gold); color: var(--gold-light); }
.m-bell {
  position: relative;
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
}
.m-bell:hover { border-color: var(--gold); color: var(--gold-light); }

/* ---------- Banner: download app ---------- */
.dl-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(201,162,75,.14), rgba(201,162,75,.05));
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.dl-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.dl-banner-text strong { font-size: 14px; color: var(--gold-light); }
.dl-banner-text span { font-size: 12px; color: var(--muted); }
.dl-banner-btn { white-space: nowrap; background: var(--gold); color: #241c10; border: none; border-radius: 8px; padding: 9px 20px; font-weight: 700; font-size: 13px; text-decoration: none; }
.dl-banner-btn:hover { background: var(--gold-light); color: #241c10; }
.dl-banner-close {
  background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 6px; line-height: 1;
}
.dl-banner-close:hover { color: var(--text); }

@media (max-width: 720px) {
  .dl-banner { padding: 10px 12px; gap: 10px; }
  .dl-banner-text span { font-size: 11px; }
  .dl-banner-btn { padding: 8px 14px; font-size: 12px; }
}

.loading {
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s;
  pointer-events: none;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Messenger ---------- */
.ms-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ms-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.ms-tab:hover { color: var(--text); }
.ms-tab.active { background: var(--card); border-color: var(--gold); color: var(--gold); font-weight: 600; }
.messenger-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  height: calc(100vh - 220px);
  min-height: 420px;
}
.ms-side {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-side-head { padding: 12px; border-bottom: 1px solid var(--border); }
.ms-side-head .btn { width: 100%; }
/* Быстрые кнопки мессенджера: на десктопе столбик, на мобилке — ряд иконок */
.ms-quick-btns { display: flex; flex-direction: column; gap: 6px; }
.ms-quick-btns .btn { width: 100%; }
@media (max-width: 720px) {
  .ms-quick-btns { flex-direction: row; gap: 8px; }
  .ms-quick-btns .btn { width: auto; flex: 1; padding: 10px 0; font-size: 16px; }
}
.ms-topics { flex: 1; overflow-y: auto; padding: 8px; }
.ms-topic {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.ms-topic:hover { background: var(--card); }
.ms-topic.active { background: var(--card); border-color: var(--gold); }
.ms-topic-title { font-weight: 700; font-size: 14px; color: var(--text); }
.ms-topic-last { color: var(--muted); font-size: 12px; margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-topic-last.muted { color: #555; }
.ms-topic-meta { color: #777; font-size: 11px; }
.ms-main {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-chat-placeholder { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--muted); font-size: 14px; text-align: center; padding: 24px; }
.ms-chat-loading { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--muted); }
.ms-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.ms-chat-close { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 18px; }
.ms-chat-close:hover { color: var(--red-bright); }
.ms-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-bubble {
  max-width: 78%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  align-self: flex-start;
}
.ms-bubble.mine {
  align-self: flex-end;
  background: rgba(201,162,75,.12);
  border-color: rgba(201,162,75,.4);
  border-radius: 12px 12px 4px 12px;
}
.ms-author { font-size: 11px; color: var(--gold); margin-bottom: 2px; }
.ms-text { font-size: 14px; line-height: 1.5; word-break: break-word; }
.ms-time { font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.ms-attach { display: inline-block; color: var(--gold-light); font-size: 13px; margin-top: 4px; text-decoration: none; }
.ms-attach-img { max-width: 220px; max-height: 160px; border-radius: 8px; margin-top: 4px; display: block; }
.ms-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.ms-chat-input input[type=text] { flex: 1; }
.ms-file-btn { cursor: pointer; font-size: 20px; display: flex; align-items: center; padding: 0 8px; color: var(--muted); }
.ms-file-btn:hover { color: var(--gold); }

@media (max-width: 720px) {
  .messenger-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .ms-side { max-height: none; flex-shrink: 1; }
  .ms-main { min-height: 0; flex-shrink: 1; }
  /* Пустой чат (до выбора темы) не занимает место и не перекрывает список */
  .ms-main:empty { display: none; }
  .ms-chat-body { max-height: 45vh; }
}
.sos-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(3px);
}
.sos-modal-box {
  width: 560px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}
.sos-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
}
.sos-modal-box h3 {
  color: var(--gold);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 8px;
}
.sos-media-list { display: flex; flex-direction: column; gap: 8px; }
.sos-media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
}
.sos-media-item audio { flex: 1; height: 34px; }
.sos-media-list { flex-direction: row; flex-wrap: wrap; }
.sos-photo {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  margin-left: 8px;
  vertical-align: middle;
}
.live-dot.live {
  background: var(--red-bright);
  box-shadow: 0 0 8px var(--red-bright);
  animation: blink 1s infinite;
}
.sos-refresh-hint { color: var(--muted); font-size: 12px; margin-right: 10px; }

/* ---------- Personal user pick ---------- */
.user-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; margin-top: 4px; }
.user-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.user-pick:hover { border-color: var(--gold); background: var(--card); }
.u-role-chip { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; }

/* ---------- Bell & Notifications ---------- */
.bell {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}
.bell:hover { border-color: var(--gold); }
.bell-icon { line-height: 1; }
.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red-bright);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border: 2px solid var(--bg);
}
.notif-panel {
  position: fixed;
  top: 70px;
  right: 22px;
  width: 340px;
  max-height: 70vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  z-index: 70;
  display: none;
  overflow: hidden;
}
.notif-panel.open { display: block; animation: slideIn .2s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
}
.notif-head .btn.small { padding: 5px 10px; font-size: 11px; }
.notif-list { max-height: calc(70vh - 55px); overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid rgba(51,44,37,.5); cursor: pointer; }
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread { border-left: 3px solid var(--gold); background: rgba(201,162,75,.06); }
.notif-title { font-weight: 700; font-size: 14px; color: var(--gold-light); margin-bottom: 2px; }
.notif-body { color: var(--text); font-size: 13px; line-height: 1.5; margin-bottom: 4px; }
.notif-time { color: var(--muted); font-size: 11px; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Единая модалка ---------- */
.push-overlay, .modal-box-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(3px);
}
.push-card, .modal-box {
  width: 420px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px;
  text-align: center;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-head .modal-title { font-size: 18px; font-weight: 700; }
.modal-close { cursor: pointer; color: var(--muted); font-size: 20px; background: none; border: none; }
.modal-close:hover { color: var(--red-bright); }
.push-icon { font-size: 42px; margin-bottom: 10px; }
.push-title, .modal-title-inner { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.push-desc, .modal-desc { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.push-btns, .modal-btns { display: flex; gap: 10px; }
.push-btns .btn, .modal-btns .btn { flex: 1; }
.modal-field { margin-bottom: 12px; }
.modal-field input, .modal-field textarea { width: 100%; text-align: left; }

@media (max-width: 720px) {
  .bell { display: none; }
  .notif-panel { right: 10px; left: 10px; width: auto; }
}

/* ---------- Forms / labels ---------- */
.field label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.field input, .field textarea { margin-bottom: 14px; }

/* ---------- Mobile: bottom nav ---------- */
@media (max-width: 720px) {
  /* Тело — флекс-колонка на всю высоту экрана. Внутри #app уже flex-контейнер. */
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  #app {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100dvh;
  }
  .m-header { flex-shrink: 0; z-index: 60; }
  .dl-banner { flex-shrink: 0; }
  .layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .sidebar {
    position: relative;
    top: auto; bottom: auto; left: auto; right: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 6px 4px;
    border-top: 1px solid var(--border);
    border-right: none;
    z-index: 50;
    gap: 0;
    flex-shrink: 0;
    order: 2;
  }
  .side-logo { display: none; }
  /* Мобильное меню — только иконки, без подписей */
  .nav-item { flex-direction: column; gap: 0; padding: 6px 0; font-size: 0; margin: 0; text-align: center; flex: 1; }
  .nav-ico { font-size: 22px; }
  .dl-nav-item { display: none; }
  .side-user { margin: 0; padding: 0 4px 0 6px; border: none; border-left: 1px solid var(--border); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .side-user .role, .side-user .name { font-size: 9px; text-align: center; }
  .side-user .btn { display: none; }
  .side-user .name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-user .role { margin-bottom: 0; }
  .main {
    order: 1;
    margin-left: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 20px;
  }
  .panel-footer {
    order: 3;
    margin: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
    font-size: 11px;
  }
  .grid { grid-template-columns: 1fr; }
  .user-add-grid { grid-template-columns: 1fr 1fr; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .row-actions { flex-wrap: wrap; }
  #route-map { height: 300px; }
}