:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-muted: #eef1e8;
  --line: #d8ddcf;
  --text: #222621;
  --muted: #667060;
  --accent: #c9a227;
  --accent-strong: #8b6b08;
  --danger: #b23a2f;
  --danger-strong: #7d261f;
  --success: #2f9e73;
  --success-strong: #16734f;
  --info: #2bb9aa;
  --warning: #f28c45;
  --shadow: 0 18px 45px rgba(34, 38, 33, 0.12);
  --map-title-bg: rgba(255, 255, 255, 0.9);
  --selection-bg: #fff8df;
  --selection-text: #222621;
  --selection-muted: #667060;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10100f;
  --surface: #1d1d1b;
  --surface-muted: #2b2b28;
  --line: #3c3b36;
  --text: #f6f1e8;
  --muted: #b9b0a1;
  --accent: #ffc77d;
  --accent-strong: #ff9b45;
  --danger: #ff8c7a;
  --danger-strong: #e95e50;
  --success: #86e0a8;
  --success-strong: #35b66f;
  --info: #7ee2cf;
  --warning: #ff9a5d;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --map-title-bg: rgba(29, 29, 27, 0.92);
  --selection-bg: #3b3024;
  --selection-text: #ffe3b6;
  --selection-muted: #d9c09d;
  --secondary: var(--info);
}

/* Critical Leaflet layout styles are kept locally so map tiles align even if CDN CSS is blocked. */
.leaflet-container {
  overflow: hidden;
  position: relative;
  outline-style: none;
  background: #ddd;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  max-width: none !important;
  max-height: none !important;
}

.leaflet-tile-container {
  pointer-events: none;
}

.leaflet-map-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-control-zoom a,
.leaflet-control-layers-toggle {
  display: block;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  line-height: 30px;
  min-width: 30px;
  text-align: center;
  text-decoration: none;
}

.leaflet-control-zoom,
.leaflet-control-layers {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.leaflet-control-zoom {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.leaflet-control-zoom a {
  box-sizing: border-box;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-family: Arial, sans-serif;
  font-size: 21px;
  font-weight: 500;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
}

.leaflet-control-layers {
  min-width: 150px;
  padding: 8px;
  color: var(--text);
}

.leaflet-control-layers-list {
  display: grid;
  gap: 5px;
}

.leaflet-control-layers-base label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
}

.leaflet-control-layers-base label:hover {
  background: var(--selection-bg);
  color: var(--selection-text);
}

.leaflet-control-layers-selector {
  accent-color: var(--accent);
  margin: 0;
}

.leaflet-control-layers-separator {
  display: none;
}

.leaflet-control-attribution {
  padding: 2px 6px;
  border-radius: 6px 0 0 0;
  background: var(--map-title-bg);
  color: var(--muted);
  font-size: 11px;
}

.leaflet-tooltip {
  position: absolute;
  padding: 4px 8px;
  border: 1px solid #c7c7c7;
  border-radius: 4px;
  background: #fff;
  color: #222;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.leaflet-interactive {
  pointer-events: auto;
}

.clickable-route-line,
.route-hit-line {
  cursor: pointer;
  pointer-events: stroke;
}

.draft-pin {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid #fff8df;
  border-radius: 50% 50% 50% 0;
  background: #ff5f55;
  box-shadow: 0 5px 14px rgba(34, 38, 33, 0.28);
  transform: rotate(-45deg);
}

.draft-pin::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 4.5px;
  top: 4.5px;
  border-radius: 999px;
  background: #181a17;
}

.map-pin-wrap {
  position: relative;
  width: 30px;
  height: 38px;
}

.map-pin-original {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow:
    0 0 14px color-mix(in srgb, var(--accent) 42%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.35);
  opacity: 0.96;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.map-pin-original .pin-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.map-pin-wrap.online .pin-center {
  background: #fff;
}

.map-pin-wrap.offline .pin-center {
  background: #fff;
}

.map-pin-wrap.online .map-pin-original {
  background: linear-gradient(145deg, var(--success), var(--success-strong));
  box-shadow:
    0 0 14px color-mix(in srgb, var(--success) 42%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.map-pin-wrap.offline .map-pin-original {
  background: linear-gradient(145deg, var(--danger), var(--danger-strong));
  box-shadow:
    0 0 14px color-mix(in srgb, var(--danger) 42%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.map-pin-selection-base {
  display: none;
}

.map-pin-wrap.selected .map-pin-original {
  border-color: #333533;
  transform: translateY(-2px) rotate(-45deg) scale(1.14);
  box-shadow:
    0 0 16px rgba(51, 53, 51, 0.62),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.map-pin-wrap.selected .pin-center {
  background: #333533;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.login-screen {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(rgba(10, 10, 9, 0.78), rgba(10, 10, 9, 0.88)),
    url("/static/login_background.jpg") center / cover no-repeat;
}

.login-window {
  position: relative;
  width: min(1040px, 100%);
  height: min(680px, calc(100vh - 56px));
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(420px, 1.08fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: rgba(21, 21, 20, 0.82);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.login-card {
  position: relative;
  width: min(390px, calc(100% - 64px));
  align-self: stretch;
  justify-self: center;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 44px 0 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.login-brand {
  position: absolute;
  top: 38px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand img {
  width: 132px;
  height: auto;
  display: block;
  filter: brightness(1.28);
}

.login-brand .brand {
  color: #f6f1e8;
  font-size: 17px;
}

.login-brand .subtitle {
  color: #b9b0a1;
  font-size: 11px;
}

.login-heading {
  margin-bottom: 10px;
}

.login-heading h1 {
  margin: 0;
  color: #f6f1e8;
  font-size: 30px;
  letter-spacing: 0;
}

.login-heading p {
  margin: 8px 0 0;
  color: #b9b0a1;
  font-size: 14px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #b9b0a1;
  font-size: 13px;
  font-weight: 650;
}

.login-card input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 50px;
  border: 1px solid #45443e;
  border-radius: 10px;
  outline: 0;
  background: rgba(10, 10, 9, 0.48);
  color: #f6f1e8;
  padding: 0 14px;
  font-size: 16px;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f6f1e8;
  caret-color: #f6f1e8;
  -webkit-box-shadow: 0 0 0 1000px #171715 inset;
  border-color: #ffc77d;
  font-size: 16px;
}

.login-card input:focus {
  border-color: #ffc77d;
  background: rgba(10, 10, 9, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 199, 125, 0.12);
}

.password-field {
  position: relative;
  width: 100%;
  min-width: 0;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b9b0a1;
  cursor: pointer;
  font-size: 15px;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
  background: rgba(255, 199, 125, 0.12);
  color: #ffc77d;
}

.login-button {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  border-radius: 10px;
}

.login-card .login-button[type="submit"] {
  border-color: #ffc77d;
  background: linear-gradient(145deg, #ffc77d, #ff9b45);
  color: #222621;
  box-shadow: 0 10px 24px rgba(255, 155, 69, 0.22);
}

.login-card .form-hint {
  min-height: 22px;
  padding: 0;
}

.login-visual {
  position: relative;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  margin: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(10, 10, 9, 0.08), rgba(10, 10, 9, 0.76)),
    url("/static/login_background.jpg") 67% center / cover no-repeat;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(126, 226, 207, 0.05), transparent 42%, rgba(255, 199, 125, 0.12));
  pointer-events: none;
}

.login-visual-copy {
  position: absolute;
  z-index: 1;
  left: 42px;
  right: 42px;
  bottom: 82px;
}

.login-visual-mark {
  width: 42px;
  height: 4px;
  display: block;
  margin-bottom: 18px;
  border-radius: 999px;
  background: #ffc77d;
  box-shadow: 0 0 20px rgba(255, 199, 125, 0.4);
}

.login-visual-copy strong {
  display: block;
  color: #f6f1e8;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
}

.login-visual-copy p {
  max-width: 360px;
  margin: 14px 0 0;
  color: #c7bfae;
  font-size: 14px;
  line-height: 1.5;
}

.login-visual > img {
  position: absolute;
  z-index: 1;
  right: 34px;
  bottom: 28px;
  width: 150px;
  height: auto;
  filter: brightness(1.45);
  opacity: 0.82;
}

.app-shell {
  --left-panel-width: 310px;
  --right-panel-width: 326px;
  position: relative;
  height: 100vh;
  display: block;
  overflow: hidden;
}

.topbar {
  position: absolute;
  z-index: 1400;
  top: 14px;
  left: 16px;
  right: 16px;
  min-height: 58px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 14px 10px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.brand {
  font-size: 22px;
  font-weight: 760;
}

.subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-alert-center {
  position: relative;
}

.device-alert-button {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--accent) 8%);
  color: var(--accent);
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.device-alert-icon {
  width: 21px;
  height: 21px;
  display: block;
}

.device-alert-button:hover,
.device-alert-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent-strong);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

.device-alert-button.has-alerts {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--danger);
  box-shadow: 0 0 18px color-mix(in srgb, var(--danger) 20%, transparent);
}

.device-alert-button strong {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  border: 2px solid var(--surface);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  line-height: 1;
}

.device-alert-panel {
  position: absolute;
  z-index: 1700;
  top: 48px;
  right: 0;
  width: min(390px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 100px));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

.device-alert-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.device-alert-panel-header strong,
.device-alert-panel-header span {
  display: block;
}

.device-alert-panel-header strong {
  font-size: 14px;
}

.device-alert-panel-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.device-center-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 6px;
}

.device-center-tabs button {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.device-center-tabs button.active {
  border-color: color-mix(in srgb, var(--info) 46%, var(--line));
  background: color-mix(in srgb, var(--info) 14%, var(--surface));
  color: var(--info);
}

.device-alert-list {
  max-height: min(440px, calc(100vh - 170px));
  overflow-y: auto;
  padding: 7px;
}

.device-alert-row {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: block;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 3px;
}

.device-alert-main {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 7px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.device-alert-main > span {
  min-width: 0;
}

.device-alert-row:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}

.device-alert-main > i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
}

.device-alert-row.online .device-alert-main > i {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent);
}

.device-alert-row.offline .device-alert-main > i {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.device-alert-row strong,
.device-alert-row b,
.device-alert-row small {
  display: block;
}

.device-alert-row strong {
  font-size: 12px;
}

.device-alert-row b {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-alert-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.device-alert-restore {
  min-height: 30px;
  margin: 0 7px 7px 26px;
  border: 1px solid color-mix(in srgb, var(--success) 62%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
  color: var(--success);
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
}

.device-alert-restore:hover {
  background: color-mix(in srgb, var(--success) 28%, var(--surface));
}

.device-alert-restore:disabled {
  cursor: wait;
  opacity: 0.65;
}

.device-alert-empty {
  color: var(--muted);
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
}

.device-summary-periods {
  width: fit-content;
  margin: 4px 4px 10px auto;
}

.device-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 2px 12px;
}

.device-summary-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  padding: 8px 6px;
}

.device-summary-grid span,
.device-summary-grid strong {
  display: block;
}

.device-summary-grid span {
  color: var(--muted);
  font-size: 9px;
}

.device-summary-grid strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
}

.device-summary-grid .online strong {
  color: var(--success);
}

.device-summary-grid .offline strong {
  color: var(--danger);
}

.device-problem-title {
  color: var(--muted);
  padding: 4px 8px 5px;
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

.device-availability-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.device-availability-row:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}

.device-availability-row > i {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
}

.device-availability-row.offline > i {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}

.device-availability-row.warning > i {
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 15%, transparent);
}

.device-availability-row strong,
.device-availability-row small {
  display: block;
}

.device-availability-row strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-availability-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.user-chip {
  min-height: 34px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 7px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.icon-button,
.settings-button,
.primary-button,
.ghost-button,
.danger-button {
  min-width: 42px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    filter 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.icon-button {
  font-size: 22px;
}

.primary-button {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #222;
  padding: 0 14px;
  font-weight: 760;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

.primary-button[type="submit"] {
  border-color: var(--success-strong);
  background: linear-gradient(145deg, var(--success), var(--success-strong));
  color: #102018;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--success) 18%, transparent);
}

.ghost-button {
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  color: var(--muted);
  padding: 0 14px;
}

.danger-button {
  margin-right: auto;
  border-color: color-mix(in srgb, var(--danger) 70%, var(--line));
  background: color-mix(in srgb, var(--danger) 20%, var(--surface));
  color: var(--danger);
  padding: 0 14px;
  font-weight: 760;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--danger) 12%, transparent);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.small-button:hover,
.report-button:hover,
.mini-action-button:hover {
  filter: brightness(1.06);
}

.primary-button:active,
.ghost-button:active,
.danger-button:active,
.small-button:active,
.report-button:active,
.mini-action-button:active {
  transform: translateY(1px);
}

.settings-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 25px;
  font-weight: 760;
  line-height: 1;
}

.settings-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.theme-switch {
  width: 48px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 3px;
  cursor: pointer;
}

.theme-switch span {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(34, 38, 33, 0.24);
  transition: transform 160ms ease, background 160ms ease;
}

.theme-switch[aria-pressed="true"] span {
  transform: translateX(20px);
  background: var(--secondary, #7ee2cf);
}

.workspace {
  position: relative;
  height: 100vh;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: hidden;
}

.sidebar,
.details {
  position: absolute;
  z-index: 1200;
  top: 84px;
  bottom: 16px;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.sidebar {
  left: 16px;
  width: var(--left-panel-width);
}

.details {
  right: 16px;
  width: var(--right-panel-width);
}

.workspace > .sidebar .panel,
.workspace > .details .panel {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.app-shell.left-panel-collapsed .sidebar {
  transform: translateX(calc(-100% - 26px));
  opacity: 0;
  pointer-events: none;
}

.app-shell.right-panel-collapsed .details {
  transform: translateX(calc(100% + 26px));
  opacity: 0;
  pointer-events: none;
}

.side-panel-toggle {
  position: absolute;
  z-index: 1300;
  top: 50%;
  width: 26px;
  height: 46px;
  margin-top: -23px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
  transition:
    left 240ms cubic-bezier(0.22, 1, 0.36, 1),
    right 240ms cubic-bezier(0.22, 1, 0.36, 1),
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.side-panel-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.side-panel-toggle-left {
  left: calc(22px + var(--left-panel-width));
}

.side-panel-toggle-right {
  right: calc(22px + var(--right-panel-width));
}

.app-shell.left-panel-collapsed .side-panel-toggle-left {
  left: 12px;
  transform: rotate(180deg);
}

.app-shell.right-panel-collapsed .side-panel-toggle-right {
  right: 12px;
  transform: rotate(180deg);
}

.stat,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat {
  min-height: 72px;
  padding: 12px;
}

.stat-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.stat-button:hover,
.stat-button.active {
  border-color: var(--accent);
  background: var(--selection-bg);
  color: var(--selection-text);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.search-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.search-panel > .panel-header,
.details-panel > .panel-header {
  border-bottom: 0;
}

.search-panel > .marker-panel-header {
  border-top: 0;
}

.panel-header {
  min-height: 54px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.small-button {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, var(--info) 24%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 84%, var(--info) 8%);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    filter 140ms ease,
    transform 140ms ease;
}

.active-filter {
  padding: 10px 14px;
  border-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.route-action-group {
  display: grid;
  gap: 7px;
}

.route-action-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.route-search-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  gap: 8px;
}

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

.route-edit-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.route-actions .small-button {
  width: 100%;
}

.route-edit-actions .small-button {
  width: 100%;
}

.route-summary {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.route-edit-status {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-muted));
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.route-point-marker {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #17211c;
  border-radius: 999px;
  background: #75e0c3;
  color: #17211c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  font-size: 10px;
  font-weight: 850;
}

.route-point-marker.selected {
  width: 24px;
  height: 24px;
  border-color: #fff3cf;
  background: #ff6b5f;
  color: #fff8e7;
}

.route-point-marker.continuing {
  width: 24px;
  height: 24px;
  border-color: #17211c;
  background: #ffc36e;
}

.route-point-marker.branch {
  background: #ffc36e;
}

.route-point-marker.branch.selected {
  background: #ff6b5f;
}

.small-button.active {
  border-color: var(--accent-strong);
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #211914;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 20px color-mix(in srgb, var(--accent) 18%, transparent);
}

.small-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.filter-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.object-switch,
.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

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

.object-tab,
.mode-tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.object-tab.active,
.mode-tab.active {
  border-color: var(--accent-strong);
  background: linear-gradient(145deg, var(--selection-bg), color-mix(in srgb, var(--accent) 26%, var(--surface-muted)));
  color: var(--selection-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 18px color-mix(in srgb, var(--accent) 14%, transparent);
}

.tool-pane {
  display: grid;
  gap: 10px;
}

.tool-pane[hidden] {
  display: none;
}

.compact-action {
  min-height: 38px;
  width: 100%;
}

.tool-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.filter-form label,
.advanced-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.filter-form input,
.filter-form select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
}

.filter-form input,
.filter-form select {
  height: 38px;
  padding: 0 10px;
}

.filter-form label.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  color: var(--text);
}

.filter-form label.toggle-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.advanced-filters {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  padding: 9px 10px;
}

.advanced-filters summary {
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.advanced-filters label {
  margin-top: 10px;
}

.compact-form {
  display: grid;
  gap: 10px;
}

.compact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.compact-form input,
.compact-form select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 10px;
}

.compact-form .primary-button {
  width: 100%;
}

.checkbox-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.member-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.member-row {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.member-row:hover,
.member-row:focus-visible {
  border-color: var(--accent);
  background: var(--selection-bg);
  color: var(--selection-text);
  outline: none;
}

.member-row strong,
.member-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row strong {
  font-size: 13px;
}

.member-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
}

.admin-list-row {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  color: var(--text);
  padding: 8px 10px;
}

.company-admin-row {
  width: 100%;
  display: block;
  text-align: left;
  cursor: pointer;
}

.company-admin-row:hover,
.company-admin-row.active {
  border-color: var(--accent);
  background: var(--selection-bg);
  color: var(--selection-text);
}

.company-admin-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.company-admin-row.active span,
.company-admin-row:hover span {
  color: var(--selection-muted);
}

.user-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.section-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  cursor: pointer;
}

.section-admin-row.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.admin-list-row > div:first-child {
  min-width: 0;
}

#adminSectionList .user-actions {
  flex-wrap: nowrap;
}

#adminSectionList .small-button {
  width: 78px;
  padding: 0 6px;
  text-align: center;
}

.user-admin-row.disabled {
  opacity: 0.62;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.danger-small {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-muted));
  color: var(--danger);
}

.section-detail {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 10px;
}

.section-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.section-detail-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.section-detail-actions .small-button {
  min-width: 72px;
}

.section-detail-head strong,
.section-detail-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-detail-head span,
.section-detail p {
  color: var(--muted);
  font-size: 12px;
}

.section-detail p {
  margin: 0;
  line-height: 1.35;
}

.section-marker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.section-marker-list button,
.section-marker-list span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
}

.section-marker-list span {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.admin-list-row strong,
.admin-list-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-row strong {
  font-size: 13px;
}

.admin-list-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.qr-preview-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.qr-preview-header {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.qr-preview-header span {
  color: var(--muted);
  font-size: 13px;
}

.qr-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.qr-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto) auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.qr-search-panel input,
.qr-search-panel select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 10px;
}

.qr-preview-card {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.qr-preview-card img,
.qr-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

.qr-image-placeholder {
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 800;
}

.qr-preview-card strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.qr-preview-card span {
  color: var(--muted);
  font-size: 12px;
}

.qr-marker-link {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  padding: 7px;
}

.qr-marker-link span,
.qr-marker-link small {
  display: block;
  overflow-wrap: anywhere;
}

.qr-marker-link span {
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.qr-marker-link small {
  color: var(--muted);
  font-size: 11px;
}

.admin-list-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 12px;
}

.admin-card-header {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.admin-card-header h3 {
  margin: 0;
  font-size: 15px;
}

.admin-card-header span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.permissions-card {
  grid-column: 1 / -1;
}

.catalog-card {
  grid-column: 1 / -1;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.catalog-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.permissions-card .compact-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.permission-checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.permission-checks label {
  min-height: 74px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  padding: 10px;
}

.permission-checks input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--accent);
}

.permission-checks strong,
.permission-checks small {
  display: block;
}

.permission-checks strong {
  color: var(--text);
  font-size: 13px;
}

.permission-checks small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.inline-create-form {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.empty-state.compact {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}

.marker-row:hover .marker-meta,
.marker-row.active .marker-meta {
  color: var(--selection-muted);
}

.search-row {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.search-row input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-muted);
}

.marker-list {
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 8px;
}

.marker-row {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.marker-row:hover,
.marker-row.active {
  border-color: var(--accent);
  background: var(--selection-bg);
  color: var(--selection-text);
}

.marker-row strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}

.marker-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 13px;
}

.marker-device-list-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}

.marker-device-list-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.marker-device-list-state.online i {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 15%, transparent);
}

.marker-device-list-state.offline i {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}

.marker-device-list-state.unchecked i {
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 15%, transparent);
}

.map-area {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  box-shadow: none;
}

.map-title {
  position: absolute;
  z-index: 1100;
  top: 84px;
  left: 50%;
  min-width: min(420px, calc(100% - 110px));
  max-width: calc(100% - 110px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--map-title-bg);
  box-shadow: var(--shadow);
  padding: 8px 14px;
  text-align: center;
  pointer-events: none;
}

.map-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.map-title span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.context-menu {
  position: absolute;
  z-index: 1200;
  min-width: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(34, 38, 33, 0.22);
}

.context-menu button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
}

.context-menu button:last-child {
  border-bottom: 0;
}

.context-menu button:hover {
  background: var(--selection-bg);
  color: var(--selection-text);
}

.context-menu .danger-text {
  color: var(--danger);
  font-weight: 760;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.workspace .leaflet-left {
  left: calc(var(--left-panel-width) + 24px);
  transition: left 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.left-panel-collapsed .workspace .leaflet-left {
  left: 0;
}

.workspace .leaflet-top {
  top: 78px;
}

.route-map-tools {
  right: calc(var(--right-panel-width) + 30px);
  transition: right 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.right-panel-collapsed .route-map-tools {
  right: 14px;
}

.details-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.details-panel #markerDetails {
  min-height: 0;
  overflow: auto;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.detail-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-title h3 {
  margin: 0;
  font-size: 20px;
}

.edit-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-button {
  border: 1px solid #ffb76a;
  border-radius: 8px;
  background: linear-gradient(145deg, #ff8f55, #ffc177);
  color: #211914;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 780;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 10px 24px rgba(255, 143, 85, 0.22);
}

.report-button:hover {
  filter: brightness(1.06);
}

.route-detail-actions .primary-button,
.route-detail-actions .danger-button {
  flex: 1 1 96px;
  margin-right: 0;
}

.route-card-section {
  display: grid;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.route-card-section-editor {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.route-card-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.route-draft-status {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tile);
  color: var(--text);
}

.route-draft-status strong {
  font-size: 13px;
}

.route-draft-status span {
  color: var(--muted);
  font-size: 12px;
}

.route-draft-status.dirty {
  border-color: rgba(255, 195, 110, 0.8);
  background: rgba(255, 195, 110, 0.14);
}

.route-draft-status.editing {
  border-color: rgba(117, 224, 195, 0.45);
}

.route-draft-status.selected {
  border-color: rgba(117, 224, 195, 0.75);
  background: rgba(117, 224, 195, 0.12);
}

.route-draft-status.continuing {
  border-color: rgba(255, 195, 110, 0.9);
  background: rgba(255, 195, 110, 0.18);
}

.route-marker-list,
.marker-route-list {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.route-marker-chip {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tile);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.route-marker-chip:hover {
  border-color: var(--accent);
}

.route-marker-chip strong {
  font-size: 13px;
}

.route-marker-chip span,
.empty-route-markers {
  color: var(--muted);
  font-size: 12px;
}

.route-line-edit-actions {
  padding-top: 2px;
}

.route-line-edit-actions .small-button {
  flex: 1 1 118px;
  min-height: 36px;
}

.route-map-editor {
  position: absolute;
  inset: 0;
  z-index: 1120;
  pointer-events: none;
}

.route-map-tools {
  position: absolute;
  right: calc(var(--right-panel-width) + 30px);
  top: 88px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  pointer-events: auto;
  transition: right 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.route-map-tool {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  font-size: 21px;
  line-height: 1;
}

.route-map-tool.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #222;
}

.route-map-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: min(560px, calc(100% - 132px));
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8f5e3;
  color: #276828;
  font-size: 12px;
  font-weight: 700;
}

.field-grid,
.tile-grid {
  display: grid;
  gap: 10px;
}

.tile-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: stretch;
}

.field {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.field strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.info-tile {
  grid-column: span 2;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-muted) 92%, var(--accent) 8%), var(--surface-muted));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.info-tile.wide,
.info-tile.full {
  grid-column: 1 / -1;
}

.info-tile.full {
  min-height: auto;
}

.info-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.info-tile strong {
  display: block;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 15px;
  line-height: 1.28;
}

.description-card,
.photo-card {
  padding: 14px;
}

.marker-device-card {
  gap: 12px;
  border-color: color-mix(in srgb, var(--info) 34%, var(--line));
}

.marker-device-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.marker-device-header > div:first-child {
  display: grid;
  gap: 5px;
}

.marker-device-header strong {
  font-size: 17px;
}

.device-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.device-state i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 15%, transparent);
}

.device-state.online {
  border-color: color-mix(in srgb, var(--success) 58%, var(--line));
  color: var(--success);
}

.device-state.online i {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent);
}

.device-state.offline {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
  color: var(--danger);
}

.device-state.offline i {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent);
}

.device-state.checking {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  color: var(--accent);
}

.device-state.checking i {
  background: var(--accent);
  animation: device-pulse 900ms ease-in-out infinite alternate;
}

.device-state.warning {
  border-color: color-mix(in srgb, var(--warning) 58%, var(--line));
  color: var(--warning);
}

.device-state.warning i {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 18%, transparent);
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
}

.device-meta strong {
  display: inline;
  color: var(--text);
  font-size: 12px;
}

.device-alert-countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 54%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  color: var(--warning);
  font-size: 12px;
  font-weight: 720;
}

.device-alert-countdown strong {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.device-alert-countdown.sent {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--danger);
}

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

.success-link-button,
.ssh-link-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.success-link-button {
  border-color: color-mix(in srgb, var(--success) 62%, var(--line));
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
  color: var(--success);
}

.ssh-link-button {
  border-color: color-mix(in srgb, var(--info) 56%, var(--line));
  background: color-mix(in srgb, var(--info) 15%, var(--surface));
  color: var(--info);
}

.device-availability-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
  padding: 10px;
}

.device-availability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.device-availability-header > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.device-period-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.device-period-switch button {
  min-width: 44px;
  height: 28px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 7px;
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}

.device-period-switch button:last-child {
  border-right: 0;
}

.device-period-switch button.active {
  background: color-mix(in srgb, var(--info) 18%, var(--surface));
  color: var(--info);
}

.device-availability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  transition: opacity 140ms ease;
}

.device-availability-grid.loading {
  opacity: 0.55;
}

.device-availability-grid > div {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 56%, transparent);
  padding: 8px;
}

.device-availability-grid span,
.device-availability-grid strong {
  display: block;
}

.device-availability-grid span {
  color: var(--muted);
  font-size: 10px;
}

.device-availability-grid strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.device-current-duration {
  color: var(--muted);
  font-size: 11px;
}

.device-availability-empty {
  color: var(--muted);
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
}

.device-history-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}

.device-history-toggle strong {
  color: var(--muted);
  font-size: 11px;
}

.device-history-toggle:hover,
.device-history-toggle.active {
  border-color: color-mix(in srgb, var(--info) 64%, var(--line));
  background: color-mix(in srgb, var(--info) 12%, var(--surface));
}

.device-history-list {
  display: grid;
  gap: 7px;
}

.device-history-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
  padding: 9px 10px;
}

.device-history-row i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.device-history-row.online i {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent);
}

.device-history-row.offline i {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.device-history-row strong,
.device-history-row span {
  display: block;
}

.device-history-row strong {
  color: var(--text);
  font-size: 12px;
}

.device-history-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.device-history-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
}

@keyframes device-pulse {
  from {
    opacity: 0.45;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 520px) {
  .marker-device-header {
    align-items: stretch;
    flex-direction: column;
  }

  .device-state {
    align-self: flex-start;
  }

  .device-actions {
    grid-template-columns: 1fr;
  }
}

.description-card span,
.photo-card span {
  margin-bottom: 8px;
}

.description-card p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.photo-card strong {
  color: var(--muted);
  font-size: 14px;
}

.photo-card img {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.event-list {
  display: grid;
  gap: 8px;
}

.collapsible-history {
  display: block;
}

.collapsible-history summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.collapsible-history summary::-webkit-details-marker {
  display: none;
}

.collapsible-history summary::after {
  content: "›";
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 150ms ease;
}

.collapsible-history[open] summary::after {
  transform: rotate(90deg);
}

.collapsible-history summary > strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.collapsible-history[open] summary {
  margin-bottom: 10px;
}

.history-scroll {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  padding: 9px 10px;
}

.event-row strong,
.event-row span {
  display: block;
}

.event-row strong {
  color: var(--text);
  font-size: 13px;
}

.event-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.event-row p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.report-row em {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.report-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-row-head b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.report-photo-button {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
}

.report-photo-button img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}

.report-photo-button span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 760;
  backdrop-filter: blur(8px);
}

.report-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.image-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: min(920px, calc(100vh - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.image-dialog::backdrop {
  background: rgba(16, 16, 15, 0.72);
}

.image-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(920px, calc(100vh - 28px));
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  background: #080807;
}

.error {
  color: var(--danger);
}

.settings-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(34, 38, 33, 0.28);
}

.settings-dialog::backdrop {
  background: rgba(34, 38, 33, 0.45);
}

.settings-shell {
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
}

.settings-dialog .admin-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.settings-dialog .form-hint {
  grid-column: 1 / -1;
  padding: 0 2px;
}

.activity-card {
  grid-column: 1 / -1;
}

.activity-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.activity-row {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  padding: 10px 12px;
}

.activity-row strong,
.activity-row span {
  display: block;
}

.activity-row strong {
  color: var(--text);
  font-size: 13px;
}

.activity-row span,
.activity-row p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.activity-row p {
  margin: 0;
}

.restore-button {
  justify-self: start;
  margin-top: 2px;
}

.notice-dialog {
  width: min(380px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(34, 38, 33, 0.28);
}

.notice-dialog::backdrop {
  background: rgba(34, 38, 33, 0.42);
}

.notice-body {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.notice-body h2 {
  margin: 0;
  font-size: 18px;
}

.notice-body p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.notice-body .primary-button {
  justify-self: end;
}

.notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.notice-actions .danger-button {
  margin-right: 0;
}

.marker-dialog {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(34, 38, 33, 0.28);
}

.marker-dialog::backdrop {
  background: rgba(34, 38, 33, 0.45);
}

.marker-form {
  display: grid;
  gap: 0;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  font-size: 19px;
}

.dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.mini-action-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #222;
  cursor: pointer;
  font-size: 22px;
  font-weight: 760;
  line-height: 1;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 16%, transparent);
}

.mini-action-button:hover {
  filter: brightness(1.05);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
}

.form-grid input,
.form-grid select {
  height: 42px;
  padding: 0 11px;
}

.form-grid input[type="file"] {
  height: auto;
  padding: 10px;
}

.form-grid input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #222;
  padding: 8px 10px;
  font-weight: 760;
  cursor: pointer;
}

.form-grid textarea {
  min-height: 96px;
  resize: vertical;
  padding: 10px 11px;
}

.input-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.full-width {
  grid-column: 1 / -1;
}

.form-hint {
  min-height: 38px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 13px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1120px) {
  .app-shell {
    --left-panel-width: 286px;
    --right-panel-width: 304px;
  }

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

@media (max-width: 760px) {
  .login-screen {
    padding: 14px;
  }

  .login-window {
    height: calc(100vh - 28px);
    min-height: 580px;
    grid-template-columns: 1fr;
  }

  .login-card {
    width: min(390px, calc(100% - 40px));
    min-height: 580px;
    padding-top: 106px;
  }

  .login-brand {
    top: 32px;
  }

  .login-visual {
    display: none;
  }

  .app-shell {
    --left-panel-width: calc(100vw - 58px);
    --right-panel-width: calc(100vw - 58px);
  }

  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    min-height: 54px;
    padding: 8px 10px 8px 12px;
  }

  .topbar-actions {
    width: auto;
    gap: 6px;
  }

  .device-alert-panel {
    position: fixed;
    top: 72px;
    right: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 82px);
  }

  .device-alert-list {
    max-height: calc(100vh - 150px);
  }

  .topbar .subtitle,
  .user-chip {
    display: none;
  }

  .topbar .brand {
    font-size: 17px;
  }

  .ghost-button {
    padding: 0 10px;
  }

  .sidebar,
  .details {
    top: 74px;
    bottom: 10px;
  }

  .sidebar {
    left: 10px;
  }

  .details {
    right: 10px;
  }

  .side-panel-toggle-left {
    left: calc(16px + var(--left-panel-width));
  }

  .side-panel-toggle-right {
    right: calc(16px + var(--right-panel-width));
  }

  .side-panel-toggle {
    width: 25px;
    height: 44px;
    margin-top: -22px;
  }

  .map-title {
    top: 76px;
    min-width: min(320px, calc(100% - 84px));
    max-width: calc(100% - 84px);
  }

  .workspace .leaflet-left {
    left: 0;
  }

  .workspace .leaflet-top {
    top: 66px;
  }

  .route-map-tools {
    top: 76px;
    right: 12px;
  }

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

  .settings-dialog .admin-panel,
  .permissions-card .compact-form,
  .permission-checks {
    grid-template-columns: 1fr;
  }

  .section-admin-row,
  .user-admin-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }

  #adminSectionList .user-actions {
    flex-wrap: wrap;
  }
}
