.app-header {
  height: 54px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
  position: relative;
  z-index: 100;
  user-select: none;
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}
.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 4px;
}
.quick-nav {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  gap: 2px;
}
.nav-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-btn:hover { color: #0f172a; background: rgba(255, 255, 255, 0.6); }
.nav-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.nav-btn-locate {
  color: #2563eb;
  border-left: 1px solid #cbd5e1;
  border-radius: 0 6px 6px 0;
  padding-left: 9px;
  margin-left: 2px;
}
.nav-btn-locate:hover { color: #1d4ed8; background: #ffffff; }
.header-actions { display: flex; align-items: center; }
.user-action-box { display: flex; align-items: center; gap: 8px; }
.btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-auth:hover { background: #f8fafc; border-color: #cbd5e1; color: #2563eb; }
.user-info-badge { display: flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 3px 10px; border-radius: var(--radius-full); }
.user-name { font-size: 12px; color: #0f172a; font-weight: 600; }
.user-role-badge { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); font-weight: 500; border: 1px solid transparent; }
.user-role-badge.role-admin { background: #fffbeb; color: #b45309; border-color: #fde68a; font-weight: 600; }
.user-role-badge.role-user { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.app-main { height: calc(100vh - 54px); display: flex; position: relative; overflow: hidden; }
.sidebar-panel {
  width: 380px;
  min-width: 380px;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, margin-left 0.25s ease;
}
.sidebar-panel.collapsed { margin-left: -380px; }
.sidebar-toggle-btn {
  position: absolute;
  right: -24px;
  top: 14px;
  width: 24px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  z-index: 30;
}
.sidebar-panel.collapsed .sidebar-toggle-btn svg { transform: rotate(180deg); }
.sidebar-tabs { display: flex; border-bottom: 1px solid var(--border-color); background: #f8fafc; }
.tab-btn { flex: 1; padding: 12px 0; font-weight: 500; color: var(--text-muted); text-align: center; border-bottom: 2px solid transparent; }
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: #ffffff; }
.sidebar-content { flex: 1; overflow-y: auto; position: relative; }
.tab-pane { display: none; padding: 16px; }
.tab-pane.active { display: block; }
.map-container { flex: 1; height: 100%; position: relative; background: #e5e7eb; }
#map { width: 100%; height: 100%; }

.map-hud-card {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 400;
  pointer-events: auto;
}
.hud-item { display: flex; flex-direction: column; align-items: center; padding: 0 12px; }
.hud-item:first-child { padding-left: 2px; }
.hud-item:last-child { padding-right: 2px; }
.hud-item + .hud-item { border-left: 1px solid rgba(226, 232, 240, 0.9); }
.hud-num { font-size: 17px; font-weight: 700; color: #0f172a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; line-height: 1.2; }
.hud-lbl { font-size: 11px; color: #64748b; margin-top: 3px; font-weight: 500; }

.floating-compare-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 450;
  transition: all 0.25s ease;
}
.float-compare-slots { display: flex; align-items: center; gap: 10px; }
.float-slot { width: 150px; padding: 6px 10px; background: #f8fafc; border: 1px dashed var(--border-color); border-radius: var(--radius-sm); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.float-slot.active { border-style: solid; border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 500; }
.slot-vs { font-weight: 700; color: #94a3b8; font-size: 12px; }
.float-compare-actions { display: flex; align-items: center; gap: 6px; }

.favorite-drawer {
  position: fixed;
  right: 0;
  top: 54px;
  bottom: 0;
  width: 400px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.favorite-drawer.open { transform: translateX(0); }
.drawer-header { padding: 14px 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.drawer-title { font-size: 15px; font-weight: 600; }
.drawer-compare-bar { padding: 10px 16px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); width: 90%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; animation: fadeIn 0.2s ease; }
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 860px; }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-tabs { display: flex; gap: 8px; }
.modal-tab-btn { padding: 6px 14px; font-size: 14px; font-weight: 500; color: var(--text-muted); border-radius: var(--radius-sm); }
.modal-tab-btn.active { color: var(--primary); background: var(--primary-light); }
.modal-body { padding: 18px; overflow-y: auto; }
