@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/manrope-cyrillic.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/manrope-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #eef1f3;
  --surface: #ffffff;
  --surface-soft: #f7f8f9;
  --surface-raised: #fbfcfc;
  --ink: #181a1e;
  --ink-soft: #30343a;
  --muted: #707780;
  --muted-light: #9aa0a8;
  --line: #dce1e5;
  --line-strong: #cbd1d7;
  --rail: #17191d;
  --rail-soft: #24272c;
  --accent: #d82332;
  --accent-dark: #b91d29;
  --accent-soft: #fff0f1;
  --teal: #147d74;
  --teal-soft: #e9f6f3;
  --green: #178052;
  --green-soft: #eaf7f0;
  --amber: #a86408;
  --amber-soft: #fff6e5;
  --danger: #c52331;
  --danger-soft: #fff0f1;
  --shadow-low: 0 1px 2px rgba(20, 24, 29, 0.05);
  --shadow-mid: 0 14px 34px rgba(20, 24, 29, 0.10);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink-soft);
  background: var(--bg);
  font-family: "Manrope Variable", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 480;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: 100%;
  min-height: 100vh;
  padding: 0 34px 46px 294px;
}

.app-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 262px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  padding: 30px 22px 22px;
  color: #fff;
  background: var(--rail);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 22px;
}

.brand-logo {
  width: 218px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: -3px 0 -5px;
  border-radius: 8px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1,
.product-name {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
}

.brand-copy p {
  margin: 6px 0 0;
  color: #989fa8;
  font-size: 12px;
  line-height: 1.55;
}

.header-actions,
.inline-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-actions {
  width: 100%;
  min-height: 0;
  align-items: stretch;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  margin-top: 38px;
}

.header-actions .btn {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 13px;
  color: #b9bec5;
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
  font-weight: 610;
}

.header-actions .btn:hover {
  color: #fff;
  background: var(--rail-soft);
  border-color: transparent;
}

.header-actions .btn.active,
.header-actions .btn[aria-current="page"] {
  color: #fff;
  background: #2b2e34;
  box-shadow: inset 3px 0 0 var(--accent);
}

.header-actions .btn-red {
  order: 3;
  margin-top: 6px;
  color: #ff9ca4;
  border-color: rgba(255, 156, 164, 0.16);
}

.header-actions .btn-red:hover {
  color: #fff;
  background: rgba(216, 35, 50, 0.16);
  border-color: rgba(255, 156, 164, 0.22);
}

.operator-badge {
  order: 2;
  min-height: 48px;
  display: flex;
  align-items: center;
  margin-top: auto;
  padding: 10px 13px;
  color: #d7dade;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
}

.operator-badge::before {
  width: 8px;
  height: 8px;
  margin-right: 9px;
  content: "";
  background: #3bc281;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(59, 194, 129, 0.10);
}

.page-heading {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 27px 0 23px;
  border-bottom: 1px solid var(--line);
}

.page-heading-copy {
  min-width: 260px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 760;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 690;
  line-height: 1.15;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.status-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  color: #5b626b;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
}

.status-chip::before {
  width: 6px;
  height: 6px;
  content: "";
  flex: 0 0 auto;
  background: var(--muted-light);
  border-radius: 50%;
}

.status-chip.healthy {
  color: #126a46;
  background: var(--green-soft);
  border-color: #bfe3cf;
}

.status-chip.healthy::before {
  background: var(--green);
}

.status-chip.warning {
  color: #8c570b;
  background: var(--amber-soft);
  border-color: #ead5ac;
}

.status-chip.warning::before {
  background: var(--amber);
}

.status-chip.error {
  color: #aa1f2b;
  background: var(--danger-soft);
  border-color: #efc4c8;
}

.status-chip.error::before {
  background: var(--danger);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-low);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  margin-top: 24px;
  margin-bottom: 20px;
  overflow: hidden;
}

.traffic-panel {
  min-width: 0;
  padding: 22px 24px 24px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  line-height: 1.3;
}

.section-head p,
.section-copy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.traffic-values {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.traffic-value {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 620;
}

.traffic-value strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.chart-box {
  position: relative;
  height: 300px;
  margin-top: 16px;
  overflow: hidden;
  background: #fafbfb;
  border: 1px solid var(--line);
  border-radius: 5px;
}

#trafficCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--muted);
  background: rgba(250, 251, 251, 0.91);
  text-align: center;
  font-size: 12px;
  font-weight: 620;
}

.chart-empty.hidden {
  display: none;
}

.chart-tip {
  position: absolute;
  display: none;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  padding: 8px 10px;
  color: #fff;
  background: var(--rail);
  border-radius: 5px;
  box-shadow: var(--shadow-mid);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 620;
  line-height: 1.45;
}

.chart-tip.show {
  display: block;
}

.overview-row {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  background: var(--surface-soft);
  border-left: 1px solid var(--line);
}

.overview-item {
  min-height: 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.overview-item:last-child {
  border-bottom: 0;
}

.overview-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  line-height: 1.4;
}

.overview-value {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: #353a41;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.btn:hover {
  background: var(--surface-soft);
  border-color: #b7bec5;
}

.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.speed-input:focus-visible,
.action-menu summary:focus-visible,
.filter-btn:focus-visible {
  outline: 3px solid rgba(216, 35, 50, 0.15);
  outline-offset: 1px;
}

.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 1px rgba(151, 16, 27, 0.16);
}

.btn-primary:hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-danger,
.btn-red {
  color: #b11d29;
  background: var(--danger-soft);
  border-color: #efc4c8;
}

.btn-danger:hover,
.btn-red:hover {
  color: #941722;
  background: #ffe5e8;
  border-color: #eab2b8;
}

.btn-quiet {
  background: transparent;
}

.btn[disabled],
button[disabled] {
  opacity: 0.58;
  cursor: wait;
}

.users-panel {
  overflow: visible;
}

.standalone-panel {
  margin-top: 24px;
}

.users-toolbar {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: end;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}

.toolbar-block {
  min-width: 0;
}

.toolbar-label {
  display: block;
  margin-bottom: 8px;
  color: #464c54;
  font-size: 11px;
  font-weight: 680;
}

.create-form,
.search-row,
.speed-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
}

.select {
  cursor: pointer;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa0a7;
}

.input:focus,
.select:focus,
.textarea:focus,
.speed-input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 35, 50, 0.10);
}

.filter-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 22px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.filter-btn {
  min-height: 32px;
  padding: 5px 11px;
  color: #626970;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.filter-btn:hover {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.filter-btn.active {
  color: var(--ink);
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-low);
}

.result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.table-wrap {
  overflow: visible;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  height: 43px;
  padding: 9px 14px;
  color: #697079;
  background: #f8f9fa;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 740;
}

thead th.sortable {
  cursor: pointer;
}

thead th.sortable::after {
  margin-left: 6px;
  content: "↕";
  color: #a4aab1;
}

thead th.sortable.active.asc::after {
  content: "↑";
  color: var(--accent);
}

thead th.sortable.active.desc::after {
  content: "↓";
  color: var(--accent);
}

tbody td {
  height: 76px;
  padding: 11px 14px;
  color: #3b4148;
  background: #fff;
  border-bottom: 1px solid #e7eaed;
  vertical-align: middle;
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfcfc;
}

.user-cell {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-dot {
  width: 9px;
  height: 9px;
  display: block;
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #b9c0c7;
  border-radius: 50%;
}

.live-dot.online {
  background: #2eb875;
  border-color: #2eb875;
  box-shadow: 0 0 0 4px rgba(46, 184, 117, 0.11);
}

.live-dot.offline {
  background: #fff;
}

.live-dot.unknown {
  background: #a2a8ae;
  border-color: #a2a8ae;
  box-shadow: 0 0 0 4px rgba(162, 168, 174, 0.10);
}

.user-copy {
  min-width: 0;
}

.user-name {
  max-width: 250px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 690;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.user-id {
  padding-right: 7px;
  border-right: 1px solid var(--line);
}

.pill {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  color: #5d646c;
  background: #f3f5f6;
  border: 1px solid #dce1e5;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 680;
}

.pill.green {
  color: #126a46;
  background: var(--green-soft);
  border-color: #bfe3cf;
}

.pill.amber {
  color: #8c570b;
  background: var(--amber-soft);
  border-color: #ead5ac;
}

.pill.red {
  color: #aa1f2b;
  background: var(--danger-soft);
  border-color: #efc4c8;
}

.state-stack {
  min-width: 125px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex-direction: column;
}

.speed-cell {
  min-width: 205px;
}

.speed-form {
  gap: 5px;
}

.speed-field {
  position: relative;
  width: 116px;
  flex: 0 0 auto;
}

.speed-input {
  width: 100%;
  height: 38px;
  padding: 6px 46px 6px 10px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
}

.speed-unit {
  position: absolute;
  top: 50%;
  right: 8px;
  color: #959ca4;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 9px;
  font-weight: 620;
}

.speed-save,
.speed-reset {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.speed-save {
  color: var(--ink);
  background: #f4f6f7;
  font-size: 16px;
}

.speed-reset {
  color: var(--ink);
  font-size: 17px;
}

.date-cell {
  min-width: 132px;
  color: #626970;
  white-space: nowrap;
}

.access-btn {
  min-width: 126px;
  color: #fff;
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.access-btn:hover {
  color: #fff;
  background: #181a1e;
  border-color: #181a1e;
}

.action-cell {
  width: 58px;
  position: relative;
  text-align: right;
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu summary {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f565e;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  list-style: none;
  font-size: 19px;
  font-weight: 720;
  line-height: 1;
}

.action-menu summary:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu[open] summary {
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(216, 35, 50, 0.08);
}

.action-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  width: 184px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow-mid);
  text-align: left;
}

.action-popover form {
  margin: 0;
}

.menu-btn {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  color: #3b4148;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 610;
}

.menu-btn:hover {
  background: #f3f5f6;
}

.menu-btn.danger {
  color: #ad1f2b;
}

.empty-state td {
  height: 116px;
  color: var(--muted);
  text-align: center;
  font-weight: 610;
}

.toast {
  position: fixed;
  top: 18px;
  left: calc(50% + 130px);
  z-index: 90;
  width: min(calc(100% - 32px), 580px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #126a46;
  background: #f2fbf6;
  border: 1px solid #bfe3cf;
  border-radius: 6px;
  box-shadow: var(--shadow-mid);
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 620;
}

.toast.error {
  color: #aa1f2b;
  background: #fff5f6;
  border-color: #efc4c8;
}

.toast-close {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: currentColor;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 16, 19, 0.72);
  backdrop-filter: blur(3px);
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.30);
}

.modal-wide {
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 188px;
  gap: 0 18px;
}

.modal-wide .modal-head,
.modal-wide .protocol-tabs {
  grid-column: 1 / -1;
}

.modal-wide .qr-stage,
.modal-wide .qr-status {
  grid-column: 1;
}

.modal-wide .download-grid {
  grid-column: 2;
  grid-row: 3 / span 2;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.modal-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 690;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.modal-close {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: #555c64;
  background: var(--surface-soft);
  font-size: 18px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.protocol-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.protocol-tab {
  min-height: 40px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 680;
}

.protocol-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.qr-stage {
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 18px;
  background: #f6f7f8;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.qr-stage img {
  width: min(100%, 490px);
  max-height: 59vh;
  display: block;
  object-fit: contain;
  background: #fff;
}

.qr-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.download-grid {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.download-grid .btn {
  width: 100%;
  justify-content: flex-start;
}

.page-stack {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.page-panel {
  padding: 22px 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.field {
  min-width: 0;
}

.field.span-2 {
  grid-column: span 2;
}

.field.span-4 {
  grid-column: span 4;
}

.field label,
.field-label {
  display: block;
  margin: 0 0 7px;
  color: #454b52;
  font-size: 11px;
  font-weight: 680;
}

.field-hint,
.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.callout {
  padding: 12px 13px;
  color: #765015;
  background: #fff8e9;
  border: 1px solid #ead5ac;
  border-left: 3px solid #c88622;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.55;
}

.callout.error {
  color: #a31d29;
  background: #fff4f5;
  border-color: #efc4c8;
  border-left-color: var(--danger);
}

.switch-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: #c7ccd1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.22);
  transition: transform 140ms ease;
}

.switch input:checked + .switch-track {
  background: var(--teal);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch-copy strong,
.switch-copy span {
  display: block;
}

.switch-copy strong {
  color: #3c4249;
  font-size: 11px;
  font-weight: 680;
}

.switch-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.compact-table tbody td {
  height: auto;
  min-height: 56px;
  padding-top: 12px;
  padding-bottom: 12px;
  vertical-align: top;
  line-height: 1.5;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  counter-reset: help-step;
}

.help-item {
  min-height: 154px;
  position: relative;
  padding: 46px 18px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-low);
  counter-increment: help-step;
}

.help-item::before {
  position: absolute;
  top: 17px;
  left: 18px;
  content: "0" counter(help-step);
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
}

.help-item h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 690;
}

.help-item p {
  margin: 0;
  color: #5b626a;
  font-size: 11px;
  line-height: 1.65;
}

.definition-list {
  border-top: 1px solid var(--line);
}

.definition-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  padding: 15px 0;
  border-bottom: 1px solid #e7eaed;
}

.definition-row:last-child {
  border-bottom: 0;
}

.definition-term {
  color: var(--ink);
  font-size: 12px;
  font-weight: 690;
}

.definition-description {
  color: #596068;
  font-size: 12px;
  line-height: 1.6;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #e9edef;
}

.login-card {
  width: min(100%, 940px);
  min-height: 540px;
  display: grid;
  grid-template-columns: 42% 58%;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d5dade;
  border-radius: 7px;
  box-shadow: 0 24px 70px rgba(24, 26, 30, 0.16);
}

.login-head {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  padding: 46px 42px;
  color: #fff;
  background: var(--rail);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.login-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: auto;
}

.login-brand img {
  width: 244px;
  max-width: 80%;
  height: auto;
  margin: -10px 0 0 -12px;
  border-radius: 8px;
}

.demo-badge {
  padding: 5px 7px;
  color: #ff9ca4;
  background: rgba(216, 35, 50, 0.12);
  border: 1px solid rgba(255, 156, 164, 0.22);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 780;
}

.login-head h1 {
  max-width: 290px;
  margin: 0;
  color: #fff;
  font-size: 32px;
  font-weight: 680;
  line-height: 1.2;
}

.login-head p {
  max-width: 290px;
  margin: 10px 0 0;
  color: #a3a9b0;
  font-size: 12px;
  line-height: 1.6;
}

.login-body {
  grid-column: 2;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 54px 62px 34px;
}

.login-body::before {
  margin-bottom: 28px;
  content: "АВТОРИЗАЦИЯ ОПЕРАТОРА";
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
}

.login-body .field + .field {
  margin-top: 17px;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 30px;
  padding: 4px 8px;
  color: #626970;
  background: transparent;
  border: 0;
  border-radius: 4px;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 10px;
  font-weight: 680;
}

.password-toggle:hover {
  background: #f0f2f3;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 22px;
}

.alert {
  margin-bottom: 16px;
  padding: 11px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 610;
  line-height: 1.5;
}

.alert.error {
  color: #a31d29;
  background: #fff4f5;
  border: 1px solid #efc4c8;
}

.alert.info {
  color: #126a46;
  background: #eef9f3;
  border: 1px solid #bfe3cf;
}

.login-foot {
  grid-column: 2;
  padding: 16px 62px 22px;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid #edf0f2;
  text-align: left;
  font-size: 10px;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1220px) {
  .shell {
    padding-right: 22px;
    padding-left: 244px;
  }

  .app-header {
    width: 222px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .brand-logo {
    width: 186px;
  }

  .dashboard {
    grid-template-columns: minmax(0, 1fr) 205px;
  }

  .traffic-panel {
    padding-right: 19px;
    padding-left: 19px;
  }

  .users-toolbar {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field.span-4 {
    grid-column: span 2;
  }
}

@media (max-width: 960px) {
  .shell {
    padding: 14px 16px 34px;
  }

  .app-header {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px 28px;
    padding: 18px 20px;
    border: 0;
    border-radius: 6px;
  }

  .brand {
    align-items: center;
    flex-direction: row;
    gap: 18px;
  }

  .brand-logo {
    width: 158px;
    margin: -2px 0;
  }

  .brand-copy p {
    display: none;
  }

  .header-actions {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    gap: 4px;
    margin: 0;
  }

  .header-actions .btn {
    width: auto;
    min-height: 38px;
    padding: 0 11px;
  }

  .header-actions .btn.active,
  .header-actions .btn[aria-current="page"] {
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .operator-badge {
    order: initial;
    min-height: 38px;
    margin: 0 0 0 4px;
    padding: 7px 10px;
  }

  .header-actions .btn-red {
    order: initial;
    margin: 0;
  }

  .page-heading {
    min-height: 108px;
    padding: 24px 2px 20px;
  }

  .toast {
    left: 50%;
  }

  .help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .status-bar {
    justify-content: flex-start;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .overview-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .overview-item {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .overview-item:last-child {
    border-right: 0;
  }

  .section-head {
    flex-direction: column;
  }

  .traffic-values {
    justify-content: flex-start;
  }

  .chart-box {
    height: 265px;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    width: 100%;
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  tbody td,
  .compact-table tbody td {
    height: auto;
    min-height: 0;
    padding: 9px 0;
    background: transparent;
    border: 0;
  }

  tbody tr:hover td {
    background: transparent;
  }

  tbody td::before {
    display: block;
    margin-bottom: 6px;
    content: attr(data-label);
    color: #8b929a;
    text-transform: uppercase;
    font-size: 9px;
    font-weight: 720;
  }

  tbody td.user-column {
    grid-column: span 2;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf0f2;
  }

  tbody td.user-column::before {
    display: none;
  }

  .user-name {
    max-width: none;
    white-space: normal;
  }

  .action-cell {
    width: auto;
    text-align: left;
  }

  .action-popover {
    right: auto;
    left: 0;
  }

  .empty-state,
  .empty-state td {
    display: block;
  }

  .empty-state td::before {
    display: none;
  }

  .modal-wide {
    display: block;
  }

  .download-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .definition-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 680px) {
  .app-header {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 17px;
  }

  .brand {
    justify-content: space-between;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-actions .btn {
    width: 100%;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.06);
  }

  .operator-badge {
    grid-column: 1 / -1;
    justify-content: center;
    margin: 4px 0 0;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .users-toolbar {
    padding: 17px;
  }

  .filter-row {
    padding-right: 17px;
    padding-left: 17px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2,
  .field.span-4 {
    grid-column: span 1;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .help-item {
    min-height: 0;
  }

  .login-page {
    place-items: start center;
    padding: 16px;
  }

  .login-card {
    min-height: 0;
    display: block;
    margin-top: 12px;
  }

  .login-head {
    min-height: 300px;
    padding: 30px 28px;
  }

  .login-brand {
    margin-bottom: 58px;
  }

  .login-head h1 {
    font-size: 28px;
  }

  .login-body {
    padding: 34px 28px 28px;
  }

  .login-body::before {
    margin-bottom: 22px;
  }

  .login-foot {
    padding: 15px 28px 22px;
  }
}

@media (max-width: 500px) {
  .shell {
    padding: 8px 8px 28px;
  }

  .app-header {
    padding: 16px;
  }

  .brand-logo {
    width: 200px;
  }

  .brand-copy h1,
  .product-name {
    font-size: 17px;
  }

  .page-heading {
    padding: 22px 4px 18px;
  }

  .page-heading-copy {
    min-width: 0;
  }

  .page-heading h1 {
    font-size: 25px;
  }

  .status-bar {
    width: 100%;
  }

  .status-chip {
    flex: 1 1 calc(50% - 7px);
    justify-content: flex-start;
    white-space: normal;
  }

  .dashboard,
  .page-stack {
    margin-top: 16px;
  }

  .traffic-panel,
  .page-panel {
    padding: 18px 16px;
  }

  .chart-box {
    height: 235px;
  }

  .overview-item {
    padding: 14px 12px;
  }

  .overview-label {
    min-height: 31px;
    font-size: 9px;
  }

  .overview-value {
    font-size: 24px;
  }

  .create-form,
  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .create-form .btn,
  .search-row .btn {
    width: 100%;
  }

  .filter-btn {
    flex: 1 1 calc(50% - 6px);
  }

  .result-count {
    width: 100%;
    margin: 4px 0 0;
  }

  tbody tr {
    grid-template-columns: 1fr;
    gap: 0;
  }

  tbody td.user-column {
    grid-column: span 1;
  }

  .speed-cell,
  .state-stack,
  .date-cell {
    min-width: 0;
  }

  .access-btn {
    width: 100%;
  }

  .action-popover {
    width: min(250px, calc(100vw - 48px));
  }

  .modal-backdrop {
    padding: 9px;
  }

  .modal {
    max-height: calc(100vh - 18px);
    padding: 17px;
  }

  .qr-stage {
    min-height: 250px;
    padding: 10px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions .btn,
  .download-grid .btn {
    flex: 1 1 auto;
  }

  .login-page {
    padding: 8px;
  }

  .login-card {
    margin-top: 0;
  }
}
