html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
  --app-sidebar-width: 272px;
  --app-sidebar-border: rgba(148, 163, 184, 0.18);
  --app-text: #0f172a;
  --app-muted: #64748b;
}

body.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(13, 110, 253, 0.15), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  color: var(--app-text);
}

body.app-shell--public {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 26%),
    radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.14), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
}

.public-shell {
  min-height: 100vh;
  padding: 2rem;
  display: grid;
  place-items: center;
}

.welcome-hero {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
}

.welcome-hero__content,
.welcome-hero__panel {
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
}

.welcome-hero__content {
  padding: 2.3rem;
}

.welcome-hero__panel {
  padding: 1.4rem;
  display: grid;
  gap: 1rem;
}

.welcome-hero__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 0.9rem;
  font-weight: 700;
}

.welcome-hero__title {
  font-size: clamp(2rem, 1.5rem + 1.8vw, 3.4rem);
  line-height: 1.02;
  margin: 0 0 1rem;
}

.welcome-hero__text {
  color: var(--app-muted);
  font-size: 1.02rem;
  max-width: 40rem;
  margin: 0 0 1.5rem;
}

.welcome-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.access-denied-page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.access-denied-card {
  border-radius: 1.75rem;
  padding: clamp(1.5rem, 1.1rem + 1.2vw, 2.6rem);
  background:
    radial-gradient(circle at top right, rgba(239, 68, 68, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.12);
}

.access-denied-card__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.access-denied-card__title {
  margin: 1rem 0 0.9rem;
  font-size: clamp(2rem, 1.6rem + 1.3vw, 3rem);
  line-height: 1.05;
}

.access-denied-card__text {
  margin: 0;
  max-width: 44rem;
  color: var(--app-muted);
  font-size: 1rem;
}

.access-denied-card__panel {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.access-denied-card__row {
  display: grid;
  gap: 0.2rem;
}

.access-denied-card__label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  font-weight: 700;
}

.access-denied-card__value {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.access-denied-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.invite-password-panel {
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.invite-password-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invite-password-panel__value {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.welcome-feature {
  border-radius: 1.1rem;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.welcome-feature__title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.welcome-feature__text {
  margin: 0;
  color: var(--app-muted);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--app-sidebar-width);
  flex: 0 0 var(--app-sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
  color: #e2e8f0;
  border-right: 1px solid var(--app-sidebar-border);
  box-shadow: 20px 0 40px rgba(15, 23, 42, 0.18);
  position: sticky;
  top: 0;
  z-index: 1040;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-sidebar__brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.app-sidebar__brand-text {
  min-width: 0;
}

.app-sidebar__eyebrow,
.app-topbar__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.app-sidebar__title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.app-sidebar__toggle {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-sidebar__toggle-icon,
.app-sidebar__toggle-icon::before,
.app-sidebar__toggle-icon::after {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.app-sidebar__toggle-icon {
  position: relative;
}

.app-sidebar__toggle-icon::before {
  position: absolute;
  top: -0.35rem;
}

.app-sidebar__toggle-icon::after {
  position: absolute;
  top: 0.35rem;
}

.app-nav {
  gap: 0.4rem;
}

.app-nav .nav-link {
  color: #cbd5e1;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.app-nav__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.8rem;
  background: rgba(148, 163, 184, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.app-nav__label {
  white-space: nowrap;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus-visible {
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
  transform: translateX(2px);
}

.app-nav .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(14, 165, 233, 0.8));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.app-sidebar__footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.app-auth-nav {
  gap: 0.25rem;
}

.app-auth-nav .navbar-text,
.app-auth-nav .nav-link {
  color: #e2e8f0;
  font-size: 0.9rem;
}

.app-auth-nav .nav-link {
  padding-left: 0;
  padding-right: 0;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.4rem;
  padding: 0.55rem 1.25rem 0.4rem;
}

.app-topbar__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-topbar__title {
  margin: 0.1rem 0 0;
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.45rem);
  font-weight: 700;
  line-height: 1.1;
}

.app-topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app-topbar__mobile-toggle {
  padding: 0.3rem 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.app-topbar__mobile-toggle .app-sidebar__toggle-icon {
  color: currentColor;
}

.app-topbar__mobile-toggle-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-topbar__pill {
  min-height: 2.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.app-topbar__pill:hover,
.app-topbar__pill:focus-visible {
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.app-topbar__organization {
  min-height: 2.4rem;
  padding: 0.3rem 0.4rem 0.3rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.app-topbar__organization-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #334155;
  white-space: nowrap;
}

.app-topbar__organization-select {
  min-width: 13rem;
  max-width: min(22rem, 42vw);
  border: 0;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  padding: 0.45rem 2rem 0.45rem 0.8rem;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: none;
}

.app-topbar__organization-select:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

.app-topbar__organization-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}

.app-topbar__organization--static {
  padding-right: 0.9rem;
}

.app-content {
  flex: 1 1 auto;
  padding: 1.25rem 1.25rem 1.25rem;
  overflow: visible;
  min-height: 0;
}

.app-content--fluid {
  padding: 0;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

.app-page {
  display: grid;
  gap: 1.25rem;
}

.app-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.app-card .card-body {
  padding: 1.35rem;
}

.metric-card {
  height: 100%;
}

.metric-card__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  margin-bottom: 0.5rem;
}

.metric-card__value {
  font-size: clamp(1.35rem, 1rem + 1vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.metric-card__hint {
  margin: 0;
  color: var(--app-muted);
}

.map-page {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.map-page #detail {
  position: absolute;
  z-index: 500;
  padding: 1rem;
}

.map-page #map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.map-overlay-panel {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 460;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.map-overlay-panel__trigger {
  border: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}

.map-overlay-panel__content {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(70vh, 40rem);
  padding: 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  visibility: hidden;
  overflow: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.map-overlay-panel.is-open .map-overlay-panel__content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.map-overlay-panel__eyebrow {
  font-size: 0.72rem;
  color: var(--app-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-overlay-panel__title {
  font-size: 1.15rem;
  margin: 0.2rem 0 0.75rem;
}

.status-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  display: inline-block;
}

.status-dot--blue { background: #2563eb; }
.status-dot--yellow { background: #facc15; }
.status-dot--orange { background: #f97316; }
.status-dot--red { background: #ef4444; }

.settings-link-card {
  display: block;
  height: 100%;
  padding: 1.4rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  color: var(--app-text);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.settings-link-card:hover,
.settings-link-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
}

.settings-link-card__eyebrow {
  display: block;
  color: var(--app-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-link-card__title {
  margin: 0.35rem 0 0.7rem;
  font-size: 1.35rem;
}

.settings-link-card__text {
  margin: 0 0 1rem;
  color: var(--app-muted);
}

.settings-link-card__action {
  font-weight: 700;
  color: #2563eb;
}

.geofence-table .geofence-row {
  cursor: pointer;
}

.geofence-table .geofence-row.is-active {
  background: rgba(13, 110, 253, 0.08);
}

.geofence-row__button {
  color: var(--app-text);
}

.gate-table .gate-row {
  cursor: pointer;
}

.gate-table .gate-row.is-active {
  background: rgba(13, 110, 253, 0.08);
}

.gate-row__button {
  color: var(--app-text);
}

.notify-channel-table th {
  white-space: nowrap;
}

.notification-template-tools {
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.notification-template-variables {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.geofence-leaflet-map {
  height: 420px;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.session-field-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.session-field-summary__chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  font-size: 0.82rem;
  line-height: 1.2;
}

.line-endpoint-label__inner {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.line-direction-label__inner {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #991b1b;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.gate-editor-mode {
  min-height: 2.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--app-muted);
  font-size: 0.92rem;
}

.gate-direction-icon__arrow {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.gate-endpoint-icon__inner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.gate-endpoint-icon__inner--start {
  background: rgba(37, 99, 235, 0.94);
}

.gate-endpoint-icon__inner--end {
  background: rgba(22, 163, 74, 0.94);
}

.gate-row__button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.gate-row__color {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--gate-line-color, #dc2626);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
}

.gate-color-preset {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  position: relative;
  padding-left: 2rem;
}

.gate-color-preset::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: -0.375rem;
  border-radius: 999px;
  background: var(--gate-color, #dc2626);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.gate-color-preset.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.12);
}

.history-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  white-space: nowrap;
}

.history-table td {
  white-space: nowrap;
}

.history-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.history-link:hover,
.history-link:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
}

.history-detail-fields {
  display: grid;
  gap: 0.75rem;
}

.history-detail-field {
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.history-detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  min-height: calc(100vh - 3.4rem);
}

.history-detail-page__map-panel {
  min-height: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.history-detail-page__map-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  position: absolute;
  z-index: 500;
}

.history-detail-page__map {
  height: 100%;
  min-height: calc(100vh - 3.4rem);
}

.history-detail-page__content {
  min-width: 0;
  overflow: auto;
  padding: 1.25rem;
}

.history-detail-page__content .app-card {
  min-height: calc(100vh - 5.9rem);
}

.app-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 1030;
}

body.sidebar-open .app-backdrop {
  opacity: 1;
  visibility: visible;
}

body.app-shell--sidebar-collapsed .app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  width: min(86vw, var(--app-sidebar-width));
  flex-basis: min(86vw, var(--app-sidebar-width));
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

body.app-shell--sidebar-collapsed.sidebar-open .app-sidebar {
  transform: translateX(0);
}

@media (max-width: 991.98px) {
  body.app-shell {
    overflow: auto;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    width: min(86vw, 280px);
    flex-basis: min(86vw, 280px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-main {
    min-height: 100vh;
    overflow: visible;
  }

  .app-topbar {
    padding: 0.55rem 0.9rem 0.35rem;
  }

  .app-content {
      padding: 0.9rem 0.9rem 0.9rem;
  }

  .app-content--fluid {
    padding: 0;
  }

  .map-page {
    min-height: 0;
  }

  .map-overlay-panel {
    right: 0.5rem;
    top: 0.5rem;
  }

  .map-session-panel {
    top: 4.25rem;
    left: 0.5rem;
    width: min(18rem, calc(100vw - 1rem));
    max-height: min(58vh, 34rem);
  }

  .map-overlay-panel__content {
    width: min(18rem, calc(100vw - 1rem));
  }

  .history-detail-page {
    grid-template-columns: 1fr;
  }

  .history-detail-page__map-panel {
    min-height: 45vh;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  }

  .history-detail-page__map {
    min-height: 45vh;
  }

  .history-detail-page__content {
    padding: 0.9rem;
  }

  .public-shell {
    padding: 1rem;
  }

  .welcome-hero {
    grid-template-columns: 1fr;
  }

  .welcome-hero__content {
    padding: 1.5rem;
  }
}

.device-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  white-space: nowrap;
}

.device-table td {
  vertical-align: middle;
}

.device-session-fields {
  display: grid;
  gap: 1rem;
}

.device-session-field {
  padding: 0.85rem;
  border-radius: 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.device-meter-wrap {
  display: grid;
  gap: 0.3rem;
}

.device-meter__label {
  font-size: 0.82rem;
  color: var(--app-muted);
  white-space: nowrap;
}

.device-battery {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.device-battery__tip {
  width: 0.22rem;
  height: 0.6rem;
  border-radius: 0.1rem;
  background: rgba(100, 116, 139, 0.45);
}

.device-battery__body {
  min-width: 2.7rem;
  height: 1.2rem;
  padding: 0.14rem;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.14rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.92);
}

.device-battery__cell {
  border-radius: 0.2rem;
  background: rgba(148, 163, 184, 0.24);
}

.device-battery__cell.is-active {
  background: linear-gradient(180deg, #22c55e, #16a34a);
}

.device-battery.is-charging .device-battery__body {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(239, 246, 255, 0.96);
}

.device-battery__bolt {
  font-size: 0.95rem;
  line-height: 1;
  color: #2563eb;
}

.device-signal {
  height: 1.25rem;
  display: inline-flex;
  align-items: end;
  gap: 0.16rem;
}

.device-signal__bar {
  width: 0.3rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
}

.device-signal__bar:nth-child(1) { height: 0.35rem; }
.device-signal__bar:nth-child(2) { height: 0.5rem; }
.device-signal__bar:nth-child(3) { height: 0.7rem; }
.device-signal__bar:nth-child(4) { height: 0.9rem; }
.device-signal__bar:nth-child(5) { height: 1.1rem; }

.device-signal__bar.is-active {
  background: linear-gradient(180deg, #38bdf8, #2563eb);
}

.device-signal.is-offline .device-signal__bar {
  background: rgba(239, 68, 68, 0.22);
}
