/* ===== 无人值守场站原型 - 公共样式 (B-end Enhanced) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ===== Primary Blue System ===== */
  --primary: #2563EB;
  --primary-light: #EFF6FF;
  --primary-lighter: #DBEAFE;
  --primary-dark: #1D4ED8;
  --primary-darker: #1E40AF;
  --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
  --primary-gradient-soft: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(37, 99, 235, 0.08) 100%);
  --accent: #2563EB;
  --accent-gradient: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);

  /* ===== Semantic Colors ===== */
  --success: #10B981;
  --success-light: #ECFDF5;
  --success-gradient: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --warning-gradient: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --danger-gradient: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
  --info: #0EA5E9;
  --info-light: #F0F9FF;
  --info-gradient: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);

  /* ===== Neutral Colors ===== */
  --muted: #94A3B8;
  --bg: #F1F5F9;
  --bg-secondary: #F8FAFC;
  --bg-gradient: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  --card: #FFFFFF;
  --card-hover: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.96);
  --border: #E2E8F0;
  --border-light: rgba(255, 255, 255, 0.5);
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* ===== Layout ===== */
  --sidebar: 170px;
  --sidebar-collapsed: 64px;
  --topbar: 64px;

  /* ===== Typography ===== */
  --font: "Inter", "SF Pro Display", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;

  /* ===== Border Radius ===== */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ===== Enhanced Shadow System ===== */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
  --shadow-glow-lg: 0 0 40px rgba(59, 130, 246, 0.3);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.02);
  --shadow-card-hover: 0 8px 16px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -4px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(59, 130, 246, 0.1);

  /* ===== Glass Effect ===== */
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);

  /* ===== Transitions ===== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: -0.01em;
  position: relative;
  overflow-x: hidden;
}

/* Background Image */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../背景.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

/* Glassmorphism Background Decorations - Enhanced */
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, rgba(147, 197, 253, 0.2) 50%, transparent 70%);
  bottom: -200px;
  left: -150px;
  animation: float 25s ease-in-out infinite reverse, pulse-glow 8s ease-in-out infinite;
}

body::before {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(99, 102, 241, 0.15) 50%, transparent 70%);
  top: 10%;
  right: 5%;
  animation: float 30s ease-in-out infinite;
}

/* Light Blue Decorative Orbs */
.blue-orb-1,
.blue-orb-2,
.blue-orb-3 {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.blue-orb-1 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.4) 0%, rgba(191, 219, 254, 0.2) 50%, transparent 70%);
  top: 20%; right: 15%; opacity: 0.12;
  animation: float-slow 22s ease-in-out infinite;
}

.blue-orb-2 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, rgba(147, 197, 253, 0.18) 50%, transparent 70%);
  bottom: 25%; right: 35%; opacity: 0.1;
  animation: float-slow 28s ease-in-out infinite reverse;
}

.blue-orb-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(191, 219, 254, 0.38) 0%, rgba(219, 234, 254, 0.18) 50%, transparent 70%);
  top: 45%; left: 30%; opacity: 0.11;
  animation: float-slow 32s ease-in-out infinite;
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(35px, -45px); }
}

/* Additional Background Decorative Elements */
.page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);
  pointer-events: none; z-index: 0;
}

/* Geometric Decorations */
.page::after {
  content: '';
  position: fixed;
  top: 20%; left: 10%;
  width: 2px; height: 100px;
  background: linear-gradient(180deg, transparent 0%, rgba(59, 130, 246, 0.2) 50%, transparent 100%);
  opacity: 0.3; pointer-events: none; z-index: 0;
  animation: line-float 20s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.2; }
}

@keyframes line-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(20px); }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Page load animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* ===== Layout Helpers ===== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* ===== Page Container ===== */
.page { padding: 24px 28px; min-height: 100vh; animation: fadeIn 0.4s ease; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }

/* ===== Card - Enhanced Professional Design ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.02) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover), 0 0 40px rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.card:hover::before { opacity: 1; }
.card:hover::after { opacity: 1; }

.card-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-cards > * { animation: fadeInUp 0.5s ease backwards; }
.stat-cards > *:nth-child(1) { animation-delay: 0.05s; }
.stat-cards > *:nth-child(2) { animation-delay: 0.1s; }
.stat-cards > *:nth-child(3) { animation-delay: 0.15s; }
.stat-cards > *:nth-child(4) { animation-delay: 0.2s; }

.stat-cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* ===== Table - Enhanced Premium Design ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  position: relative;
}

.table-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 13px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  table-layout: auto;
  position: relative;
}

table::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0.5;
}

thead { display: table-header-group; }

thead th {
  background: linear-gradient(180deg, #FAFBFC 0%, #F1F5F9 100%);
  color: var(--text-secondary);
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  position: relative;
  transition: all var(--transition-fast);
}

thead th:hover {
  background: linear-gradient(180deg, #EFF6FF 0%, #DBEAFE 100%);
  color: var(--primary);
}

thead th:not(:last-child) { border-right: 1px solid rgba(226, 232, 240, 0.6); }

tbody { display: table-row-group; }

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  vertical-align: middle;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  word-break: break-word;
  position: relative;
}

tbody td strong { color: var(--text); font-weight: 600; }

tbody tr { display: table-row; transition: all 0.2s ease; }

tbody tr:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
}

tbody tr:hover td { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }

/* Expandable row */
tbody tr.row-expand { display: none; background: #F8FAFC; }
tbody tr.row-expand.open { display: table-row; }
tbody tr.row-expand td { padding: 16px 20px; }

/* ===== Badge - Enhanced ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: all var(--transition-fast);
  text-transform: capitalize;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: var(--success-light); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-success::before { background: #10B981; }
.badge-warning { background: var(--warning-light); color: #D97706; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-warning::before { background: #F59E0B; }
.badge-danger { background: var(--danger-light); color: #DC2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-danger::before { background: #EF4444; }
.badge-info { background: var(--info-light); color: #0369A1; border: 1px solid rgba(14, 165, 233, 0.2); }
.badge-info::before { background: #0EA5E9; }
.badge-muted { background: #F1F5F9; color: #64748B; border: 1px solid rgba(148, 163, 184, 0.2); }
.badge-muted::before { background: #94A3B8; }
.badge-primary { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-primary::before { background: var(--primary); }

/* ===== Button - Enhanced Premium Design ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  transition: left 0.5s ease;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.15);
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

.btn:hover::before { opacity: 1; }
.btn:hover::after { left: 100%; }
.btn:active { transform: translateY(-1px); }

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary::before {
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.15) 100%);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 50%, #1E40AF 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
  color: #fff;
}

.btn-success { background: var(--success-gradient); color: #fff; border: none; box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4); }
.btn-success:hover { background: linear-gradient(135deg, #10B981 0%, #059669 100%); transform: translateY(-3px); box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5); color: #fff; }

.btn-danger { background: var(--danger-gradient); color: #fff; border: none; box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4); }
.btn-danger:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(239, 68, 68, 0.5); color: #fff; }

.btn-sm { padding: 7px 16px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-link {
  background: none; border: none; color: var(--primary);
  padding: 4px 10px; box-shadow: none; font-weight: 600;
  border-radius: var(--radius-sm); transition: all var(--transition-fast);
}

.btn-link:hover { color: var(--primary-dark); background: var(--primary-light); transform: none; box-shadow: none; }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text); letter-spacing: -0.01em;
}

.form-label.required::before,
.text-sm.required::before {
  content: '*'; color: #e53935; font-weight: 700; margin-right: 3px;
}

.form-control {
  width: 100%; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; font-family: var(--font); outline: none;
  transition: all var(--transition-base); background: #fff; color: var(--text);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,107,245,0.1);
  background: #fff;
}

.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 60px; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 16px 20px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

.filter-bar select, .filter-bar input {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  font-family: var(--font); background: #fff; color: var(--text);
  transition: all var(--transition-fast);
}

.filter-bar select:focus, .filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,107,245,0.1);
  outline: none;
}

/* ===== Tab ===== */
.tabs {
  display: flex; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; gap: 0; position: relative;
}

.tab {
  padding: 12px 24px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer;
  transition: all var(--transition-base);
  position: relative; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab:hover { color: var(--primary); background: var(--primary-gradient-soft); }

.tab.active {
  color: var(--primary); border-bottom-color: var(--primary);
  font-weight: 600; background: var(--primary-gradient-soft);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== Progress Bar ===== */
.progress { height: 6px; background: #F1F5F9; border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; background: var(--accent-gradient); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); position: relative; }
.progress-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); animation: shimmer 2s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-bar-success { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.progress-bar-warning { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.progress-bar-danger { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); }

/* ===== Side Panel ===== */
.panel-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 900; opacity: 0; pointer-events: none; transition: opacity var(--transition-slow); backdrop-filter: blur(4px); }
.panel-overlay.open { opacity: 1; pointer-events: auto; }
.side-panel { position: fixed; top: 0; right: -640px; bottom: 0; width: 640px; max-width: 90vw; background: #fff; z-index: 910; box-shadow: -20px 0 60px rgba(15, 23, 42, 0.15); transition: right var(--transition-slow); overflow-y: auto; display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.side-panel.open { right: 0; }
.side-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.side-panel-header h3 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.side-panel-body { padding: 24px; flex: 1; }
.side-panel-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }
.panel-close { background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; transition: all 0.2s ease; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.panel-close:hover { color: var(--danger); background: rgba(245, 34, 45, 0.1); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--transition-base); backdrop-filter: blur(8px); }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: #fff; border-radius: var(--radius-xl); width: 80vw; max-width: 1200px; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; transform: scale(0.95) translateY(10px); transition: transform var(--transition-base); box-shadow: var(--shadow-xl); border: 1px solid var(--border); }
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); background: #fff; }
.modal-header h3 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: #FAFBFC; }
.modal-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ===== Toast ===== */
#toast-container { position: fixed; top: 80px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .3s ease; min-width: 220px; backdrop-filter: blur(10px); display: flex; align-items: center; gap: 8px; }
.toast::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.8); flex-shrink: 0; }
.toast-success { background: linear-gradient(135deg, #10B981, #059669); }
.toast-error { background: linear-gradient(135deg, #EF4444, #DC2626); }
.toast-warning { background: linear-gradient(135deg, #F59E0B, #D97706); }
@keyframes toastIn { from { transform: translateX(100%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0) scale(1); opacity: 1; } to { transform: translateX(100%) scale(0.9); opacity: 0; } }

/* ===== Alert Blink / Pulse ===== */
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.alert-blink { animation: blink 1.2s ease infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(82,196,26,.5); } 70% { box-shadow: 0 0 0 8px rgba(82,196,26,0); } 100% { box-shadow: 0 0 0 0 rgba(82,196,26,0); } }
.pulse { animation: pulse 2s infinite; }

/* ===== Placeholder / Filter / Tree ===== */
.placeholder { background: linear-gradient(135deg, #F8FAFC, #F1F5F9); border: 2px dashed var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; min-height: 120px; }
.placeholder-chart { min-height: 200px; }
.filter-tags { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tag { padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--text-secondary); transition: all var(--transition-fast); }
.filter-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.filter-tag.active { background: var(--accent-gradient); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(91,107,245,0.3); }
.tree { font-size: 13px; }
.tree-node { padding: 4px 0; }
.tree-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.tree-toggle:hover { color: var(--accent); }
.tree-children { padding-left: 20px; display: none; }
.tree-children.open { display: block; }

/* ===== Info Popup ===== */
.info-popup { position: absolute; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 14px 16px; min-width: 240px; z-index: 100; font-size: 13px; }
.info-popup::before { content: ''; position: absolute; top: -6px; left: 20px; width: 12px; height: 12px; background: var(--card); border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg); }
.info-popup h4 { margin: 0 0 8px; font-size: 14px; color: var(--primary); }
.info-popup .info-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted var(--border); }
.info-popup .info-row:last-child { border-bottom: none; }

/* ===== Responsive ===== */
@media (max-width: 1200px) { .stat-cards { grid-template-columns: repeat(2,1fr); } .modal-split { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .stat-cards { grid-template-columns: 1fr; } .side-panel { width: 100vw; max-width: 100vw; } .modal { width: 95vw; } }

/* ===== Icon System ===== */
.icon-svg { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; }
.icon-svg svg { width: 100%; height: 100%; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }
.icon-primary { color: var(--primary); }
.icon-success { color: var(--success); }
.icon-warning { color: var(--warning); }
.icon-danger { color: var(--danger); }
.icon-muted { color: var(--muted); }
.icon-white { color: #fff; }
.card-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; transition: all var(--transition-base); }
.card:hover .card-icon { transform: scale(1.1); }
.card-icon-primary { background: var(--primary-gradient-soft); }
.card-icon-success { background: rgba(16,185,129,0.1); }
.card-icon-warning { background: rgba(245,158,11,0.1); }
.card-icon-danger { background: rgba(239,68,68,0.1); }

/* ===== Stats Cards Enhanced ===== */
.stat-card-enhanced { background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-card); transition: all var(--transition-base); position: relative; overflow: hidden; backdrop-filter: blur(10px); }
.stat-card-enhanced::before { content: ''; position: absolute; top: -20px; right: -20px; width: 100px; height: 100px; background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.06) 0%, transparent 70%); pointer-events: none; z-index: 0; }
.stat-card-enhanced::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.02) 100%); opacity: 0; transition: opacity var(--transition-base); pointer-events: none; }
.stat-card-enhanced:hover::before { opacity: 1; animation: shimmer-line 3s ease infinite; }
.stat-card-enhanced:hover::after { opacity: 1; }
.stat-card-enhanced:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-card-hover), 0 0 60px rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.25); }
@keyframes shimmer-line { 0% { opacity: 0; transform: translateX(-100%); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateX(100%); } }
.stat-card-icon { width: 56px; height: 56px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; position: relative; transition: transform var(--transition-base); }
.stat-card-icon::after { content: ''; position: absolute; inset: -6px; border-radius: 20px; background: inherit; opacity: 0.15; filter: blur(10px); z-index: -1; }
.stat-card-enhanced:hover .stat-card-icon { transform: scale(1.08); }
.stat-card-label { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.stat-card-value { font-size: 36px; font-weight: 800; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.1; letter-spacing: -0.04em; transition: transform var(--transition-base); }
.stat-card-enhanced:hover .stat-card-value { transform: scale(1.02); }
.stat-card-trend { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-top: 12px; }
.stat-card-trend.up { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card-trend.down { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Enhanced Menu Icons & Page Title */
.menu-icon-enhanced { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: rgba(91,107,245,0.08); margin-right: 12px; transition: all var(--transition-base); }
.menu-group-title:hover .menu-icon-enhanced { background: rgba(91,107,245,0.2); transform: scale(1.05); }
.menu-item.active .menu-icon-enhanced { background: rgba(91,107,245,0.25); }
.page-title-enhanced { font-size: 22px; font-weight: 800; color: var(--text); position: relative; padding-left: 16px; letter-spacing: -0.03em; }
.page-title-enhanced::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 70%; background: var(--accent-gradient); border-radius: 2px; }
.filter-tag-enhanced { padding: 7px 18px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--text-secondary); transition: all var(--transition-base); }
.filter-tag-enhanced:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(91,107,245,0.15); }
.filter-tag-enhanced.active { background: var(--accent-gradient); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(91,107,245,0.3); }

/* ===== Map Picker (prototype-specific) ===== */
.map-container { position: relative; background: #e8edf3; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.map-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--border); font-size: 12px; flex-wrap: wrap; }
.map-toolbar .map-chip { padding: 3px 10px; border-radius: 12px; font-size: 11px; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--text); transition: all .15s; }
.map-toolbar .map-chip:hover { border-color: var(--accent); color: var(--accent); }
.map-toolbar .map-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.map-svg { width: 100%; display: block; }
.map-svg .zone { fill: #d5dde8; stroke: #b0bec5; stroke-width: 1; rx: 6; }
.map-svg .zone-label { font-size: 11px; fill: #607080; font-weight: 600; pointer-events: none; }
.map-svg .road { stroke: #b0bec5; stroke-width: 3; stroke-dasharray: 6 3; fill: none; }
.map-svg .device-dot { cursor: pointer; transition: all .15s; }
.map-svg .device-dot:hover { filter: brightness(1.2); }
.map-svg .device-dot.selected { stroke: var(--primary); stroke-width: 3; filter: drop-shadow(0 0 4px rgba(36,86,166,.5)); }
.map-svg .device-label { font-size: 9px; fill: #37474f; pointer-events: none; font-weight: 600; }
.map-svg .device-dot.status-alarm { fill: var(--danger); }
.map-svg .device-dot.status-warning { fill: var(--warning); }
.map-svg .device-dot.status-normal { fill: var(--success); }
.map-svg .device-dot.status-offline { fill: var(--muted); }
.map-legend { position: absolute; bottom: 8px; right: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 10px; display: flex; gap: 10px; }
.map-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.map-legend .lg-alarm::before { background: var(--danger); }
.map-legend .lg-warn::before { background: var(--warning); }
.map-legend .lg-normal::before { background: var(--success); }
.map-legend .lg-offline::before { background: var(--muted); }

/* waypoint list */
.wp-list { max-height: 180px; overflow-y: auto; }
.wp-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; font-size: 12px; background: var(--card); }
.wp-item .wp-seq { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.wp-item .wp-info { flex: 1; }
.wp-item .wp-info .wp-name { font-weight: 600; }
.wp-item .wp-info .wp-meta { color: var(--muted); font-size: 11px; }
.wp-item .wp-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.wp-item .wp-remove:hover { background: #fff1f0; }
