﻿:root {
  --indigo: #14233f;
  --peri: #454f73;
  --aqua: #1fa3b8;
  --violet: #8e86c8;
  --ice: #e7ebf6;
  --graphite: #17202f;
  --white: #fff;
  --ok: #43a047;
  --warn: #e6a23c;
  --err: #e53935;
  --rem: #ef6c00;
  --card-sh: 0 6px 24px rgba(20, 35, 63, 0.1);
  --rad: 12px;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  color: var(--graphite);
  background: var(--ice);
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font-family: inherit;
  font-size: 13.5px;
  border: 1px solid #c6cede;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--graphite);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 163, 184, 0.35);
  border-color: var(--aqua);
}
.hidden {
  display: none !important;
}

/* ===== LOGIN ===== */
#login {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(155deg, rgba(10, 16, 38, 0.42), rgba(15, 24, 52, 0.18) 45%, rgba(8, 13, 30, 0.55)),
    var(--hexbg-login) center/cover no-repeat #0f1834;
}
#login::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% 90%, rgba(26, 140, 166, 0.22), transparent 70%),
    radial-gradient(500px 380px at 10% 8%, rgba(120, 112, 178, 0.2), transparent 70%);
}
.login-card {
  position: relative;
  width: min(680px, 94vw);
  background: rgba(16, 25, 50, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 22px;
  padding: 42px 46px 34px;
  backdrop-filter: blur(16px);
  color: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
}
.login-card .loginlogo {
  height: 30px;
  margin-bottom: 18px;
  display: block;
}
.login-card .kicker {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #7fe0ee;
  font-weight: 700;
  margin-bottom: 12px;
}
.login-card h1 {
  font-size: 27px;
  line-height: 1.22;
  margin: 0 0 8px;
  font-weight: 800;
}
.login-card .sub {
  font-size: 13.5px;
  color: #cfd8ec;
  margin-bottom: 26px;
}
.role-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 620px) {
  .role-btns {
    grid-template-columns: 1fr;
  }
}
.role-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  padding: 26px 18px 20px;
  color: #fff;
  text-align: center;
  transition: 0.18s;
  min-height: 210px;
  justify-content: center;
}
.role-btn:hover {
  background: rgba(31, 163, 184, 0.22);
  border-color: #1fa3b8;
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
.role-btn img {
  height: 96px;
  width: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}
.role-btn .big-emoji {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}
.role-btn b {
  display: block;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.role-btn span {
  display: block;
  font-size: 12px;
  color: #c3cde4;
  line-height: 1.4;
  max-width: 230px;
}
#adminCorner {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 3100;
  background: rgba(16, 25, 50, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #9fb0d2;
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 12px;
  backdrop-filter: blur(8px);
  transition: 0.15s;
}
#adminCorner:hover {
  color: #fff;
  border-color: #1fa3b8;
  background: rgba(31, 163, 184, 0.25);
}
#loginPass {
  margin-top: 14px;
}
#loginPass input {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
}
#loginPass .row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
#loginPass .go {
  flex: 1;
  background: var(--aqua);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  padding: 9px;
}
#loginPass .back {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #dfe6f4;
  border-radius: 8px;
  padding: 9px 14px;
}
#loginErr {
  color: #ffb3ab;
  font-size: 12.5px;
  margin-top: 8px;
  min-height: 16px;
}
.login-foot {
  margin-top: 20px;
  font-size: 11px;
  color: #9fb0d2;
}

/* ===== APP SHELL ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  height: 54px;
  background: linear-gradient(135deg, #0f1834, #243358 70%, #31446e);
  color: #fff;
  box-shadow: 0 2px 12px rgba(15, 24, 52, 0.35);
  z-index: 1200;
}
/* Обёртка правого блока шапки: на десктопе прозрачна */
#topbar .hdr-right {
  display: contents;
}
#topbar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}
#topbar .logo img {
  height: 22px;
  width: auto;
  display: block;
}
#topbar .logo .sep {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.25);
}
#topbar .logo small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  color: #9db1d8;
  letter-spacing: 0.08em;
}
#tabs {
  display: flex;
  gap: 4px;
  margin-left: 10px;
  overflow-x: auto;
}
.tabbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: #c2cde6;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 9px;
  white-space: nowrap;
}
.tabbtn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.tabbtn.active {
  background: rgba(31, 163, 184, 0.3);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(31, 163, 184, 0.6);
}
#topbar .spacer {
  flex: 1;
}
.rolebadge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(142, 134, 200, 0.35);
  border: 1px solid rgba(142, 134, 200, 0.8);
  white-space: nowrap;
}
.rolebadge.admin {
  background: rgba(31, 163, 184, 0.3);
  border-color: var(--aqua);
}
#btnLogout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #dfe6f4;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
}
#btnLogout:hover {
  background: rgba(255, 255, 255, 0.12);
}
main {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.tabpane {
  position: absolute;
  inset: 0;
  overflow: auto;
}
#tab-map {
  overflow: hidden;
}

/* ===== MAP TAB ===== */
#map {
  position: absolute;
  inset: 0;
}
#mapNotice {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 900;
  background: #fff8d6;
  border: 1px solid #e0c95e;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  max-width: 520px;
  box-shadow: var(--card-sh);
}
#layerPanel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 900;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--rad);
  box-shadow: var(--card-sh);
  padding: 12px 14px;
  max-height: calc(100% - 80px);
  overflow: auto;
  width: 265px;
  font-size: 13px;
}
#layerPanel h3 {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--indigo);
}
#layerPanel .lyr {
  margin-top: 9px;
}
#layerPanel .lyr > label {
  font-weight: 700;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
}
#layerPanel .grp {
  margin: 4px 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#layerPanel .grp label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12.5px;
  color: #333c4f;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 11px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
#layerPanel .mini {
  display: flex;
  gap: 6px;
  margin-top: 11px;
  flex-wrap: wrap;
}
#layerPanel .mini button {
  font-size: 11.5px;
  border: 1px solid #c6cede;
  background: #fff;
  border-radius: 7px;
  padding: 4px 8px;
}
#layerPanel .mini button:hover {
  border-color: var(--aqua);
  color: var(--aqua);
}
#layerPanel .statmode {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid #e2e7f2;
}
#layerPanel .cnt {
  color: #8a93a8;
  font-weight: 500;
  font-size: 11.5px;
  margin-left: auto;
}
#btnAddPoint {
  position: absolute;
  bottom: 18px;
  left: 12px;
  z-index: 900;
  background: var(--aqua);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: var(--card-sh);
}
#btnAddPoint.armed {
  background: var(--err);
}

/* point card */
#card {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(400px, 92vw);
  z-index: 950;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(20, 35, 63, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#cardHead {
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, #14233f, #2b3a63);
  color: #fff;
}
#cardHead .cat {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fe0ee;
  font-weight: 700;
}
#cardHead h2 {
  margin: 4px 0 2px;
  font-size: 15.5px;
  line-height: 1.35;
  font-weight: 700;
}
#cardHead .sub {
  font-size: 11.5px;
  color: #b9c6e2;
}
#cardClose {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
}
#cardBody {
  flex: 1;
  overflow: auto;
  padding: 13px 16px;
}
.kv {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 4px 10px;
  font-size: 13px;
  margin-bottom: 10px;
}
.kv .k {
  color: #7c8598;
}
.kv .v {
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
}
.sec {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid #e8ecf5;
}
.sec h4 {
  margin: 0 0 7px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--peri);
}
.phrow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 5px;
}
.phrow img {
  height: 72px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #dfe4f0;
}
.phitem {
  position: relative;
  line-height: 0;
}
.phbtns {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.phitem:hover .phbtns,
.phbtns:focus-within {
  opacity: 1;
}
.phbtn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(20, 35, 63, 0.8);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phbtn:hover {
  background: #e53935;
}
.phbtn.phrep:hover {
  background: #1fa3b8;
}
.phbtn.phsave:hover {
  background: #43a047;
}
.phbtn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.phmiss {
  font-size: 11px;
  color: #98a1b5;
  border: 1px dashed #c6cede;
  border-radius: 8px;
  padding: 6px 8px;
  align-self: center;
  white-space: nowrap;
}
.cardbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 11px 16px;
  border-top: 1px solid #e8ecf5;
  background: #f7f9fd;
}
.cardbtns button {
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 11px;
  border: 1px solid #c6cede;
  background: #fff;
}
.cardbtns button:hover {
  border-color: var(--aqua);
  color: var(--aqua);
}
.cardbtns button.primary {
  background: var(--aqua);
  border-color: var(--aqua);
  color: #fff;
}
.cardbtns button.primary:hover {
  color: #fff;
  filter: brightness(1.08);
}
.cardbtns button.danger {
  color: var(--err);
}
.cardbtns button.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.cardbtns button.rem {
  background: var(--rem);
  border-color: var(--rem);
  color: #fff;
}
.cardbtns button.rej {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}
.cmt {
  background: #f2f5fb;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.cmt .meta {
  font-size: 10.5px;
  color: #8a93a8;
  margin-bottom: 2px;
}
#cardCmtBox textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
}

/* ===== GENERIC PAGE ===== */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 48px;
}
.page h2 {
  font-size: 20px;
  margin: 2px 0 4px;
  color: var(--indigo);
}
.page .pagehint {
  font-size: 13px;
  color: #69738a;
  margin-bottom: 16px;
}
.toolrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.toolrow .grow {
  flex: 1;
}
.btn {
  border: 1px solid #c6cede;
  background: #fff;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
}
.btn:hover {
  border-color: var(--aqua);
  color: var(--aqua);
}
.btn.primary {
  background: var(--aqua);
  border-color: var(--aqua);
  color: #fff;
}
.btn.primary:hover {
  color: #fff;
  filter: brightness(1.08);
}
.btn.dark {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}
.btn.danger {
  color: var(--err);
  border-color: #f0b9b5;
}
.tablewrap {
  background: #fff;
  border-radius: var(--rad);
  box-shadow: var(--card-sh);
  overflow: auto;
  max-height: calc(100vh - 250px);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
  min-width: 900px;
}
table.data th {
  position: sticky;
  top: 0;
  background: var(--indigo);
  color: #dfe6f4;
  text-align: left;
  padding: 9px 10px;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 5;
}
table.data td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f7;
  vertical-align: top;
}
table.data tr {
  cursor: pointer;
}
table.data tr:hover td {
  background: #f4f8fd;
}
table.data tr.sel td {
  background: #e6f6f9;
}
.stchip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}
.linkish {
  color: var(--aqua);
  cursor: pointer;
  font-weight: 600;
}
.pill {
  display: inline-block;
  background: #eef1f8;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  margin: 1px 2px 1px 0;
}

/* journal */
.journal {
  background: #fff;
  border-radius: var(--rad);
  box-shadow: var(--card-sh);
  padding: 14px 18px;
  margin-top: 18px;
}
.journal h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--indigo);
}
.jrow {
  display: flex;
  gap: 12px;
  font-size: 12.5px;
  padding: 7px 0;
  border-bottom: 1px solid #eef1f7;
}
.jrow .jdt {
  flex: 0 0 112px;
  color: #8a93a8;
}
.jrow .jrole {
  flex: 0 0 68px;
  font-weight: 700;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jrow .jbody {
  flex: 1;
  min-width: 0;
}
tr.newimp td:first-child {
  box-shadow: inset 3px 0 0 var(--aqua);
}
.pill.newpill {
  background: rgba(31, 163, 184, 0.16);
  color: #0d7d90;
  font-weight: 700;
}
.badge-new {
  display: inline-block;
  background: var(--aqua);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1.5px 6px;
  border-radius: 5px;
  margin-left: 5px;
  vertical-align: middle;
}
.statgrid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.statchip {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-sh);
  padding: 10px 16px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  border: 2px solid transparent;
  user-select: none;
}
.statchip:hover {
  border-color: var(--aqua);
}
.statchip.active {
  border-color: var(--aqua);
  background: #eef9fc;
}
/* информационный чип (не фильтр): без курсора и подсветки при наведении */
.statchip.static {
  cursor: default;
}
.statchip.static:hover {
  border-color: transparent;
}
.statchip.static .chip-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 18px;
  font-size: 12.5px;
  line-height: 1.4;
}
.statchip.static .chip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  white-space: nowrap;
}
.statchip.static .chip-row b {
  display: inline;
  font-size: 14px;
  font-weight: 700;
  color: var(--indigo);
}
.statchip b {
  display: block;
  font-size: 20px;
  color: var(--indigo);
}

/* ===== PRESENTATION (light) ===== */
#tab-pres {
  background: var(--ice);
  color: var(--graphite);
}
.pres {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 26px 60px;
}
.pres .preslogo {
  height: 34px;
  margin-bottom: 16px;
  display: block;
}
.pres .kicker {
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #0f7f93;
  font-weight: 700;
}
.pres h1 {
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.16;
  margin: 10px 0 8px;
  font-weight: 800;
  max-width: 900px;
  color: var(--indigo);
}
.pres .lead {
  font-size: 15px;
  color: #4a5570;
  max-width: 760px;
  margin-bottom: 26px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.kpi {
  background: #fff;
  border: 1px solid #e2e7f2;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--card-sh);
}
.kpi .n {
  font-size: 38px;
  font-weight: 800;
  color: var(--aqua);
  line-height: 1;
}
.kpi .n small {
  font-size: 16px;
  color: #63aebc;
}
.kpi .t {
  font-size: 12.5px;
  color: #5d6678;
  margin-top: 7px;
  line-height: 1.35;
}
.kpi.viol .n {
  color: #7b71b8;
}
.presgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .presgrid {
    grid-template-columns: 1fr;
  }
}
.pcard {
  background: #fff;
  border: 1px solid #e2e7f2;
  border-radius: 16px;
  padding: 17px 20px;
  box-shadow: var(--card-sh);
}
.pcard h3 {
  margin: 0 0 13px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f7f93;
}
.hbar {
  display: grid;
  grid-template-columns: 150px 1fr 44px;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  margin-bottom: 7px;
}
.hbar .lbl {
  color: #5d6678;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.hbar .tr {
  background: #edf0f7;
  border-radius: 6px;
  height: 15px;
  overflow: hidden;
}
.hbar .fl {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #1fa3b8, #4fd4e6);
}
.hbar.violet .fl {
  background: linear-gradient(90deg, #7870b2, #8e86c8);
}
.hbar b {
  color: var(--indigo);
  font-size: 12.5px;
}
.progresswrap {
  margin-top: 6px;
}
.progress {
  height: 20px;
  background: #edf0f7;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress .fl {
  height: 100%;
  background: linear-gradient(90deg, #1fa3b8, #4fd4e6);
  border-radius: 999px;
}
.progress span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--indigo);
}
#presMapWrap {
  position: relative;
  height: 520px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #dfe4f0;
  margin-bottom: 16px;
  box-shadow: var(--card-sh);
  background: #fff;
}
#presMap {
  position: absolute;
  inset: 0;
}
.pres .note {
  font-size: 11.5px;
  color: #7d8699;
  line-height: 1.5;
}
.pres .lawref {
  background: #f2f5fb;
  border-left: 3px solid var(--aqua);
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #39415a;
  margin: 14px 0 0;
}
.pres .donutlegend {
  color: #39415a;
}
.tl .tlab {
  color: #8a93a8;
}
.tl .tval {
  color: var(--indigo);
}

/* ===== ADMIN ===== */
.acard {
  background: #fff;
  border-radius: var(--rad);
  box-shadow: var(--card-sh);
  padding: 17px 20px;
  margin-bottom: 16px;
}
.acard h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  color: var(--indigo);
}
.acard .hint {
  font-size: 12px;
  color: #7d8699;
  margin-bottom: 12px;
}
.frow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
  font-size: 13px;
}
.frow label {
  flex: 0 0 210px;
  color: #5d6678;
}
.frow input,
.frow select {
  flex: 1;
  min-width: 200px;
}
.fieldtable td,
.fieldtable th {
  font-size: 12.5px;
}
.pp754list {
  font-size: 12.8px;
  line-height: 1.5;
}
.pp754list b {
  color: var(--aqua);
}
.pp754list li {
  margin-bottom: 6px;
}

/* ===== MODAL ===== */
#modalBack {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 52, 0.55);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
#modal {
  background: #fff;
  border-radius: 16px;
  width: min(560px, 96vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
#modal .mhead {
  padding: 15px 20px 12px;
  border-bottom: 1px solid #e8ecf5;
  font-weight: 800;
  font-size: 15.5px;
  color: var(--indigo);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#modal .mbody {
  padding: 15px 20px;
}
#modal .mfoot {
  padding: 12px 20px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid #e8ecf5;
}
.mrow {
  margin-bottom: 10px;
}
.mrow label {
  display: block;
  font-size: 12px;
  color: #5d6678;
  margin-bottom: 4px;
  font-weight: 600;
}
.mrow input,
.mrow select,
.mrow textarea {
  width: 100%;
}
.mgrid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) {
  .mgrid2 {
    grid-template-columns: 1fr;
  }
}

#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2600;
  background: var(--indigo);
  color: #fff;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  max-width: 82vw;
}

/* ===== Р¤РёСЂРјРµРЅРЅС‹Рµ РїРѕРґР»РѕР¶РєРё (Р”РёР·Р°Р№РЅ-СЃРёСЃС‚РµРјР° 2.0 / РЎР°Р№С‚) ===== */
#login {
  background:
    linear-gradient(155deg, rgba(10, 16, 38, 0.4), rgba(15, 24, 52, 0.14) 45%, rgba(8, 13, 30, 0.52)),
    var(--hexbg-login) center/cover no-repeat #0f1834;
}
#tab-pres .hexbg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(231, 235, 246, 0.35), rgba(231, 235, 246, 0.55)),
    var(--bg-light) center/cover no-repeat;
}
#tab-tech,
#tab-gibdd,
#tab-admin {
  background:
    linear-gradient(rgba(231, 235, 246, 0.42), rgba(231, 235, 246, 0.62)),
    var(--bg-light) center/cover no-repeat fixed;
}

/* ===== Lightbox ===== */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(10, 16, 34, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}
#lbClose {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 18px;
}
.lbNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 46px;
  height: 64px;
  border-radius: 12px;
  font-size: 22px;
}
#lbPrev {
  left: 18px;
}
#lbNext {
  right: 18px;
}
.lbNav:hover,
#lbClose:hover {
  background: rgba(31, 163, 184, 0.4);
}
#lbCap {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #c8d2e8;
  font-size: 12.5px;
  background: rgba(15, 24, 52, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ===== Presentation: layer panel + breakdown ===== */
#presPanel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  background: rgba(15, 24, 52, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  padding: 12px 14px;
  max-height: calc(100% - 24px);
  overflow: auto;
  width: 250px;
  font-size: 12.5px;
  color: #dfe6f4;
}
#presPanel h4 {
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7fe0ee;
}
#presPanel label {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 3px 0;
  cursor: pointer;
}
#presPanel .lyrhead {
  font-weight: 700;
  margin-top: 8px;
}
#presPanel .grp {
  margin-left: 20px;
}
#presPanel .cnt {
  margin-left: auto;
  color: #8fa0c4;
  font-size: 11px;
}
#presBreak {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 20;
  background: rgba(15, 24, 52, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  padding: 11px 15px;
  font-size: 12px;
  color: #dfe6f4;
  max-width: 340px;
}
#presBreak h4 {
  margin: 0 0 6px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7fe0ee;
}
#presBreak .brow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2.5px 0;
}
#presBreak .brow b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ===== Power BI style dashboards ===== */
.kpi .n,
.statchip b,
.hbar b {
  font-variant-numeric: tabular-nums;
}
.kpi {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(20, 35, 63, 0.18);
}
.kpi .spark {
  position: absolute;
  right: 14px;
  top: 16px;
  opacity: 0.85;
}
.kpi .sub {
  font-size: 11px;
  color: #8a93a8;
  margin-top: 6px;
}
.kpi .microbar {
  height: 4px;
  border-radius: 99px;
  background: #e8ecf5;
  margin-top: 9px;
  overflow: hidden;
}
.kpi .microbar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #1fa3b8, #4fd4e6);
}
.donutwrap {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.donutlegend {
  font-size: 12.5px;
  display: grid;
  gap: 5px;
}
.donutlegend .brow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.donutlegend b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.dl-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 10px;
}
.tl {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
  padding-top: 8px;
}
.tl .tcol {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 26px;
}
.tl .tbar {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #4fd4e6, #1fa3b8);
}
.tl .tlab {
  font-size: 10px;
  color: #8a93a8;
  white-space: nowrap;
}
.tl .tval {
  font-size: 11px;
  font-weight: 700;
  color: #14233f;
  font-variant-numeric: tabular-nums;
}
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .kpi {
    transition: none;
  }
}

/* ===== Tech table sorting ===== */
table.data th.sortable {
  cursor: pointer;
  user-select: none;
}
table.data th.sortable:hover {
  color: #fff;
  background: #1b2c4f;
}
.sortind {
  opacity: 0.9;
  color: #7fe0ee;
  margin-left: 4px;
}
.rescount {
  font-size: 12.5px;
  color: #69738a;
  font-weight: 600;
  white-space: nowrap;
}
:root {
  --hexbg-login: url('img/bg_hero.jpg');
  --hexbg-pres: url('img/bg_hexbg-pres.jpg');
  --bg-light: url('img/bg_bg-light.jpg');
}
@media (max-width: 760px) {
  #card {
    top: auto;
    height: 62%;
    width: 100%;
    right: 0;
    bottom: 0;
    border-radius: 14px 14px 0 0;
  }
  #layerPanel {
    width: 225px;
  }
  .kv {
    grid-template-columns: 110px 1fr;
  }
}

/* ===== Photo upload button in cards ===== */
.phupload {
  margin-top: 6px;
}
.phupload:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ===== РџРµС‡Р°С‚СЊ РїСЂРµР·РµРЅС‚Р°С†РёРё / СЌРєСЃРїРѕСЂС‚ РІ PDF ===== */
@media print {
  body {
    background: #fff !important;
  }
  #login,
  #topbar,
  #tabs,
  #roleBadge,
  #btnLogout,
  #layerPanel,
  #mapNotice,
  #card,
  #btnAddPoint,
  #adminCorner,
  #tab-map,
  #tab-tech,
  #tab-gibdd,
  #tab-admin,
  #lightbox,
  .hexbg {
    display: none !important;
  }
  #app,
  #tab-pres,
  .tabpane {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  .pres {
    width: 100% !important;
    padding: 0 !important;
  }
  #presMapWrap {
    display: block !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #presMap {
    height: 420px !important;
  }
  .pcard {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .presgrid {
    break-inside: auto;
  }
}

/* ==========================================================
   MOBILE (до 760px). Десктопная вёрстка выше не затрагивается.
   ========================================================== */
/* Кнопка-переключатель панели слоёв: на десктопе скрыта */
#layerToggle {
  display: none;
  position: absolute;
  left: 10px;
  top: 12px;
  z-index: 910;
  width: 34px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(20, 35, 63, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--indigo);
  font-size: 17px;
  box-shadow: var(--card-sh);
}
#layerToggle:hover {
  background: #fff;
  border-color: var(--aqua);
}

@media (max-width: 760px) {
  /* ===== Вход: всё помещается на экран ===== */
  #login {
    align-items: flex-start;
    overflow-y: auto;
    padding: 16px 0;
  }
  .login-card {
    padding: 22px 18px 20px;
    width: 94vw;
    border-radius: 16px;
  }
  .login-card .loginlogo {
    height: 22px;
    margin-bottom: 10px;
  }
  .login-card .kicker {
    font-size: 10.5px;
    letter-spacing: 0.16em;
    margin-bottom: 8px;
  }
  .login-card h1 {
    font-size: 20px;
    line-height: 1.25;
    margin-bottom: 6px;
  }
  .login-card .sub {
    font-size: 12px;
    margin-bottom: 14px;
  }
  .role-btns {
    gap: 10px;
  }
  .role-btn {
    min-height: 0;
    padding: 13px 10px 11px;
    gap: 7px;
    border-radius: 12px;
  }
  .role-btn img {
    height: 52px;
  }
  .role-btn b {
    font-size: 14px;
  }
  .role-btn span {
    font-size: 11px;
    max-width: none;
  }
  #loginPass input {
    font-size: 15px;
    padding: 9px 12px;
  }
  #loginPass .go,
  #loginPass .back {
    padding: 10px 12px;
    font-size: 13px;
  }
  .login-foot {
    margin-top: 12px;
    font-size: 10px;
  }
  #adminCorner {
    bottom: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }

  /* ===== Шапка: две строки (логотип+роль / вкладки) ===== */
  #topbar {
    flex-wrap: wrap;
    height: auto;
    align-items: center;
    gap: 4px 8px;
    padding: 8px 10px;
  }
  #topbar .logo {
    flex: 1;
    min-width: 0;
    gap: 8px;
    font-size: 13px;
  }
  #topbar .logo img {
    height: 18px;
    flex: 0 0 auto;
  }
  #topbar .logo .sep {
    display: none;
  }
  #topbar .logo small {
    display: none;
  }
  /* заголовок тянется и центрируется между логотипом и правым блоком */
  #topbar .logo > div:last-child {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
  }
  #topbar .hdr-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }
  #topbar .spacer {
    display: none;
  }
  #tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .rolebadge {
    font-size: 10.5px;
    padding: 4px 9px;
  }
  /* мобильные: кнопка «Сменить пользователя» скрыта, выход — по клику на бейдж роли */
  #btnLogout {
    display: none;
  }
  .rolebadge {
    cursor: pointer;
  }
  .rolebadge:active {
    opacity: 0.7;
  }

  /* ===== Карта: панель слоёв выезжает слева ===== */
  #layerToggle {
    display: flex;
  }
  #layerPanel {
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    max-height: none;
    height: 100%;
    border-radius: 0 12px 12px 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    z-index: 960;
    padding: 12px 12px 16px;
  }
  #layerPanel.open {
    transform: translateX(0);
  }

  /* ===== Карточка: компактнее ===== */
  #card {
    height: 85%;
  }
  #cardHead {
    padding: 10px 12px 8px;
  }
  #cardHead .cat {
    font-size: 9.5px;
  }
  #cardHead h2 {
    font-size: 13.5px;
    margin: 3px 0 2px;
  }
  #cardHead .sub {
    font-size: 10.5px;
  }
  #cardClose {
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  #cardBody {
    padding: 10px 12px;
  }
  .kv {
    grid-template-columns: 96px 1fr;
    font-size: 12px;
    gap: 3px 8px;
    margin-bottom: 8px;
  }
  #card .cardbtns {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  #card .cardbtns button {
    font-size: 12px;
    padding: 7px 10px;
  }
  .phitem img {
    max-height: 120px;
  }
}

/* Кнопка-переключатель панели слоёв презентации (только мобильные) */
#presLayerToggle {
  display: none;
  position: absolute;
  left: 10px;
  top: 12px;
  z-index: 30;
  width: 34px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(15, 24, 52, 0.82);
  color: #fff;
  font-size: 17px;
  box-shadow: var(--card-sh);
  backdrop-filter: blur(12px);
}
#presLayerToggle:hover {
  border-color: #1fa3b8;
}
@media (max-width: 760px) {
  #presLayerToggle {
    display: flex;
  }
  #presPanel {
    left: 0;
    top: 0;
    bottom: 0;
    max-height: none;
    height: 100%;
    border-radius: 0 14px 14px 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    z-index: 40;
  }
  #presPanel.open {
    transform: translateX(0);
  }
}

/* Модалка «Сессия завершена» — в стиле окна входа (тёмное стекло) */
#modalBack.kicked {
  background: rgba(8, 13, 30, 0.6);
  backdrop-filter: blur(4px);
}
#modalBack.kicked #modal {
  position: relative;
  background: rgba(16, 25, 50, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  color: #fff;
  backdrop-filter: blur(16px);
  padding: 26px 28px;
  width: min(420px, 92vw);
}
#modalBack.kicked #modal .mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#modalBack.kicked #modal .mhead span {
  color: #7fe0ee;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
}
#modalBack.kicked #modal .mbody {
  font-size: 14px;
  line-height: 1.5;
  color: #cfd8ec;
  padding: 12px 0 4px;
}
#modalBack.kicked #modal .mfoot {
  display: none;
}
#modalBack.kicked #modal #mClose {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
}
#modalBack.kicked #modal #mClose:hover {
  background: rgba(31, 163, 184, 0.35);
}

/* Вкладки: если не помещаются в ширину (класс icons-only ставит JS) —
   показываем только иконки, подписи прячем */
#tabs.icons-only .tabbtn .tb-label {
  display: none;
}
#tabs.icons-only .tabbtn {
  padding: 8px 10px;
}
#tabs.icons-only .tabbtn .tb-ico {
  font-size: 16px;
  line-height: 1;
}
#tabs.icons-only {
  justify-content: space-between;
}
