:root {
  --bg: #eef2ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --ink: #2d2d2d;
  --muted: #474747;
  --line: rgba(48, 79, 255, 0.12);
  --brand: #304fff;
  --brand-soft: #e3e9ff;
  --accent: #6c7dff;
  --danger: #d93025;
  --success: #1f8f58;
  --warning: #bf7b00;
  --shadow: 0 24px 70px rgba(48, 79, 255, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  width: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: linear-gradient(135deg, #eef2ff 0%, #f8faff 48%, #e8edff 100%);
  color: var(--ink);
  width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
  min-width: 0;
}

.sidebar {
  padding: 14px 18px 20px;
  background: linear-gradient(180deg, rgba(48, 79, 255, 0.97), rgba(32, 58, 199, 0.98));
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.brand-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
  margin-bottom: 2px;
}

.brand-wrap h1,
.topbar h2,
.panel h3,
.login-card h2,
.login-hero h1 {
  margin: 0;
}

.brand-logo-wrap {
  width: 220px;
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0;
  background: transparent;
}

.brand-logo {
  width: 176px;
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  color: var(--muted);
}

.sidebar .eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
  align-content: start;
}

.nav-item {
  padding: 11px 14px;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.35;
  transition: 180ms ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.nav-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateX(2px);
}

.main-content {
  padding: var(--space-5);
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
  min-width: 0;
}

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

.header-icon-link {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--brand);
  position: relative;
}

.header-icon-link.active {
  background: #e8edff;
}

.header-icon-glyph {
  font-size: 17px;
  line-height: 1;
}

.header-icon-button {
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.header-avatar {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #304fff 0%, #5d73ff 100%);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.header-icon-button:hover,
.header-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(46, 62, 124, 0.14);
}

.subtle {
  color: var(--muted);
  font-size: 12px;
}

.header-notification-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  position: absolute;
  top: -5px;
  right: -5px;
  box-shadow: 0 0 0 3px #eef1ff;
}

.notice {
  background: #edf2ff;
  border: 1px solid #cddbff;
  color: #233fc4;
  padding: 11px 14px;
  border-radius: 16px;
  margin-bottom: var(--space-3);
  font-size: 14px;
}

.notice.error {
  background: #fff1ef;
  border-color: #ffd0c8;
  color: #8c2f24;
}

.stats-grid,
.dashboard-grid,
.quick-grid,
.detail-grid {
  display: grid;
  gap: var(--space-3);
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: var(--space-3);
}

.stat-card,
.panel,
.detail-card,
.quick-card,
.login-card,
.login-hero {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.stat-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.stat-card p,
.stat-card span {
  margin: 0;
  color: var(--muted);
}

.stat-card h3 {
  font-size: 30px;
  line-height: 1.05;
  margin: 8px 0 6px;
}

.dashboard-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel {
  padding: var(--space-4);
  border-radius: var(--radius-xl);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
}

.list-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filter-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.list-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

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

.pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  border-radius: 12px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.action-row,
.form-actions,
.inline-form,
.logout-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8edff;
  color: #2440c9;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-success {
  background: #dff5e9;
  color: var(--success);
}

.badge-warning {
  background: #fff0d6;
  color: var(--warning);
}

.primary-button,
.inline-button,
.danger-button,
.ghost-button {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.2;
  transition: 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), #6c7dff);
  color: #f5fbf9;
  font-weight: 700;
}

.primary-button.compact {
  padding: 10px 14px;
}

.inline-button {
  background: #e8edff;
  color: #2440c9;
}

.danger-button {
  background: #ffe6e2;
  color: var(--danger);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.primary-button:hover,
.inline-button:hover,
.danger-button:hover,
.ghost-button:hover,
.quick-card:hover,
.secondary-link:hover {
  transform: translateY(-1px);
}

.secondary-link {
  color: var(--brand);
  font-weight: 700;
}

.quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-card {
  border-radius: 20px;
  padding: var(--space-3);
  min-height: 108px;
  display: flex;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(227, 233, 255, 0.96)),
    var(--panel-strong);
}

.map-panel {
  overflow: hidden;
}

.active-guards-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.active-guards-map {
  min-height: 560px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.active-guards-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.guard-map-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 6px;
}

.guard-map-card h4,
.guard-map-card p,
.guard-map-card span,
.guard-map-card code {
  margin: 0;
}

.guard-map-card h4 {
  font-size: 16px;
}

.guard-map-card p,
.guard-map-card span {
  color: var(--muted);
  font-size: 13px;
}

.guard-map-card code {
  color: var(--brand);
  font-size: 12px;
  word-break: break-word;
}

.route-live-map {
  background: #eef2ff;
}

.route-map-card {
  border-left: 4px solid var(--brand);
}

.map-footnote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.route-map-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.route-map-tabs {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1px solid var(--line);
}

.route-map-tab {
  border: 0;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.route-map-tab.active {
  background: var(--brand);
  color: #ffffff;
}

.route-guard-photo-marker {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 10px 24px rgba(48, 79, 255, 0.32);
  background: var(--brand);
  color: #ffffff;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
}

.route-guard-photo-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.route-guard-photo-marker.has-photo {
  background: #ffffff;
  border-color: #ffffff;
}

.route-guard-photo-marker.has-photo .route-guard-initials {
  display: none;
}

.route-guard-photo-marker.no-photo .route-guard-initials,
.route-guard-initials {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-marker {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 22px rgba(48, 79, 255, 0.26);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.route-marker-guard {
  background: var(--brand);
}

.route-marker-house {
  background: #d93025;
}

.route-marker-available {
  background: #1f8f58;
}

.route-marker-demo {
  outline: 2px dashed rgba(45, 45, 45, 0.34);
  outline-offset: 3px;
}

.feed-list {
  display: grid;
  gap: 12px;
}

.feed-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.feed-item h4,
.feed-item p {
  margin: 0;
}

.feed-item p {
  margin-top: 6px;
  color: var(--muted);
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-card {
  border-radius: 20px;
  padding: var(--space-3);
}

.detail-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.card-form label,
.permissions-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.security-hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(48, 79, 255, 0.06);
}

.security-hint span {
  color: var(--muted);
}

.card-form input,
.card-form select,
.card-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.7);
  min-width: 0;
}

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

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.full-width {
  width: 100%;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.sidebar-version {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  text-align: left;
}

.empty-state {
  padding: var(--space-4);
  text-align: center;
  color: var(--muted);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.login-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-4);
  min-width: 0;
}

.login-credit {
  grid-column: 2;
  margin: -10px 0 0;
  text-align: right;
  color: rgba(45, 45, 45, 0.66);
  font-size: 13px;
  font-weight: 500;
}

.login-credit a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-card-logo {
  display: none;
  width: 164px;
  height: auto;
  object-fit: contain;
  margin: 0 0 18px;
}

.login-hero,
.login-card {
  border-radius: 30px;
  padding: 30px;
}

.login-hero {
  background: linear-gradient(180deg, rgba(48, 79, 255, 0.96), rgba(28, 50, 186, 0.98));
  color: #ffffff;
}

.login-hero .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.login-input-wrap {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(48, 79, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 28px rgba(48, 79, 255, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.login-input-wrap:focus-within {
  border-color: rgba(48, 79, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(48, 79, 255, 0.12), 0 16px 34px rgba(48, 79, 255, 0.12);
  transform: translateY(-1px);
}

.login-input-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.login-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.login-input-wrap input::placeholder {
  color: rgba(71, 71, 71, 0.58);
  font-weight: 500;
}

.login-form .primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 2px;
  justify-content: center;
  border-radius: 18px;
  font-size: 15px;
}

.hero-copy,
.hero-list {
  color: rgba(255, 255, 255, 0.78);
}

.hero-list {
  padding-left: 18px;
  margin-top: var(--space-4);
}

.hero-logo {
  width: 198px;
  height: auto;
  display: block;
  object-fit: contain;
  margin-bottom: 18px;
  background: transparent;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .brand-logo-wrap {
    width: 196px;
  }

  .dashboard-grid,
  .active-guards-layout {
    grid-template-columns: 1fr;
  }

  .active-guards-map,
  .active-guards-list {
    max-height: none;
  }

  .active-guards-map {
    min-height: 460px;
  }
}

@media (max-width: 980px) {
  .app-shell,
  .login-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 10px 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
  }

  .brand-wrap {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    margin: 0;
  }

  .brand-logo-wrap {
    width: 148px;
    height: 48px;
    place-items: center start;
  }

  .brand-logo {
    width: 126px;
  }

  .sidebar-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
    border-radius: 14px;
    padding: 9px 11px;
    font-size: 13px;
  }

  .nav-icon {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .nav-item:hover,
  .nav-item.active {
    transform: translateY(-1px);
  }

  .sidebar-footer {
    grid-column: 3;
    grid-row: 1;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .logout-form {
    flex: 0 0 auto;
  }

  .logout-form .ghost-button {
    width: auto;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .sidebar-version {
    display: none;
  }

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

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

  .filter-search,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .login-body {
    place-items: start center;
    min-height: 100svh;
  }

  .login-grid {
    width: min(620px, 100%);
    gap: 14px;
  }

  .login-credit {
    grid-column: 1;
    margin: 0;
    text-align: center;
  }

  .login-hero {
    padding: 24px;
  }

  .login-hero h1 {
    font-size: 30px;
    line-height: 1.18;
  }

  .hero-list {
    margin-bottom: 0;
  }
}

@media (max-width: 900px) {
  .table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .table-wrap tr {
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 30px rgba(48, 79, 255, 0.08);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(104px, 36%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(48, 79, 255, 0.08);
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .table-wrap td[colspan] {
    display: block;
    padding: 0;
  }

  .table-wrap td[colspan]::before {
    content: none;
  }
}

@media (max-width: 760px) {
  :root {
    --radius-xl: 22px;
    --radius-lg: 18px;
    --space-5: 18px;
  }

  .login-hero {
    display: none;
  }

  .login-card-logo {
    display: block;
  }

  .stats-grid,
  .quick-grid,
  .detail-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .stat-card,
  .detail-card,
  .quick-card {
    border-radius: var(--radius-lg);
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .list-controls {
    grid-template-columns: 1fr;
  }

  .list-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    justify-content: stretch;
  }

  .pagination .inline-button,
  .pagination-current,
  .filter-actions > * {
    flex: 1 1 auto;
    text-align: center;
  }

  .route-map-actions {
    justify-content: stretch;
  }

  .route-map-actions > *,
  .route-map-tabs {
    width: 100%;
  }

  .route-map-tab {
    flex: 1 1 0;
    padding-inline: 8px;
  }

  .panel-head .primary-button,
  .panel-head .inline-button,
  .panel-head .danger-button {
    width: 100%;
    text-align: center;
  }

  .active-guards-map {
    min-height: 360px;
    border-radius: 18px;
  }

  .feed-item {
    display: grid;
  }

  .table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap table {
    min-width: 0;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .table-wrap tr {
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 30px rgba(48, 79, 255, 0.08);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(104px, 36%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(48, 79, 255, 0.08);
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .table-wrap td[colspan] {
    display: block;
    padding: 0;
  }

  .table-wrap td[colspan]::before {
    content: none;
  }
}

@media (max-width: 640px) {
  .main-content,
  .sidebar,
  .login-hero,
  .login-card {
    padding: var(--space-4);
  }

  .topbar,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .main-content {
    padding: 14px;
  }

  .topbar h2 {
    font-size: 24px;
    line-height: 1.15;
  }

  .header-icon-link,
  .header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .stat-card h3 {
    font-size: 26px;
  }

  .login-body {
    align-items: start;
    padding: 14px;
  }

  .login-hero,
  .login-card {
    border-radius: 22px;
  }

  .login-card {
    padding: 22px;
  }

  .login-input-wrap {
    min-height: 52px;
    border-radius: 16px;
    padding-inline: 14px;
  }

}

@media (max-width: 460px) {
  .main-content,
  .sidebar,
  .login-hero,
  .login-card,
  .panel,
  .stat-card {
    padding: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 12px 10px;
  }

  .brand-logo-wrap {
    width: 136px;
  }

  .brand-logo {
    width: 116px;
  }

  .sidebar-footer {
    grid-column: 2;
  }

  .nav-item {
    gap: 8px;
    padding: 8px 10px;
  }

  .nav-label {
    max-width: 132px;
    white-space: normal;
  }

  .action-row,
  .form-actions,
  .inline-form {
    width: 100%;
  }

  .action-row .primary-button,
  .action-row .inline-button,
  .action-row .danger-button,
  .form-actions .primary-button,
  .form-actions .inline-button,
  .form-actions .danger-button,
  .inline-form .primary-button,
  .inline-form .inline-button,
  .inline-form .danger-button {
    width: 100%;
    text-align: center;
  }

  .table-wrap td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .checkbox-row {
    align-items: flex-start;
  }
}
