.admin-body { background: transparent; }
.login-overlay {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at top, rgba(91,140,255,0.22), transparent 28%), linear-gradient(180deg, #07101d 0%, #081120 100%);
}
.admin-login-panel { width: min(460px, 100%); padding: 34px; text-align: center; }
.login-logo {
  width: 78px; height: 78px; border-radius: 24px; display: grid; place-items: center; margin: 0 auto 18px;
  background: linear-gradient(135deg, rgba(91,140,255,0.22), rgba(45,212,191,0.16)); font-size: 34px;
}
.login-box h2 { font-size: 32px; margin: 10px 0 8px; }
.login-box > p { color: var(--muted); }
.login-form { margin-top: 22px; text-align: left; }
.btn-login { width: 100%; margin-top: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-top: 18px; }

.admin-shell { display: flex; min-height: 100vh; width: 100%; }
.admin-sidebar {
  width: 280px; background: rgba(7,16,29,0.88); border-right: 1px solid var(--line); backdrop-filter: blur(18px);
  padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar.collapsed { width: 88px; }
.sidebar-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sidebar-logo {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(91,140,255,0.22), rgba(45,212,191,0.12));
}
.sidebar-main-title { display: block; font-weight: 800; }
.sidebar-sub-title { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.sidebar-toggle, .topbar-menu-btn, .btn-logout-top { background: rgba(255,255,255,0.06); color: var(--text); width: 42px; height: 42px; border-radius: 12px; }
.sidebar-menu { list-style: none; display: grid; gap: 6px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; color: var(--muted); transition: .2s;
}
.menu-item:hover, .menu-item.active { background: rgba(91,140,255,0.12); color: var(--text); }
.menu-item i { width: 18px; text-align: center; }
.menu-separator { height: 1px; background: var(--line); margin: 8px 4px; }
.admin-sidebar.collapsed .sidebar-title, .admin-sidebar.collapsed .menu-item span { display: none; }
.admin-sidebar.collapsed .menu-item { justify-content: center; }

.admin-main { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.glass-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px;
  border-radius: 24px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-badge { padding: 10px 14px; border-radius: 999px; background: rgba(91,140,255,0.12); color: #dce7ff; font-weight: 700; }
.tab-content { padding: 0; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { padding: 22px; display: flex; gap: 16px; align-items: center; }
.stat-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 22px; }
.stat-icon.blue { background: rgba(91,140,255,0.16); color: #cfe0ff; }
.stat-icon.green { background: rgba(45,212,191,0.16); color: #a7fff0; }
.stat-icon.orange { background: rgba(251,191,36,0.16); color: #fde68a; }
.stat-icon.red { background: rgba(251,113,133,0.16); color: #fecdd3; }
.stat-value { font-size: 34px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 13px; }
.dashboard-section, .form-card, .qr-list-container, .route-list-panel, .route-edit-panel, .monitoring-map-panel, .monitoring-user-panel, .alert-log-section { padding: 22px; }
.section-header { margin-bottom: 18px; }
.section-header h3 { font-size: 28px; margin-bottom: 6px; }
.section-header p { color: var(--muted); }
.activity-table-wrap { overflow: auto; }
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th, .activity-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.activity-table th { color: #c8d7ef; font-size: 13px; }
.quick-actions, .qr-top-actions, .analysis-actions, .monitoring-controls, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-zone {
  border: 1px dashed rgba(148,163,184,0.28); border-radius: 22px; padding: 42px 20px; text-align: center; color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.upload-zone.drag-over, .upload-zone:hover { border-color: rgba(91,140,255,0.4); background: rgba(91,140,255,0.08); }
.upload-zone i { font-size: 42px; margin-bottom: 10px; }
.uploaded-preview { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(255,255,255,0.04); margin-bottom: 12px; }
.uploaded-preview img { width: 92px; height: 68px; object-fit: cover; border-radius: 12px; }
.map-editor-header, .panel-header, .steps-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.map-editor-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-btn { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.05); color: var(--muted); }
.tool-btn.active, .tool-btn:hover { background: rgba(91,140,255,0.18); color: var(--text); }
.tool-separator { width: 1px; height: 24px; background: var(--line); }
.map-canvas-container { position: relative; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
#map-canvas, #monitoring-canvas { width: 100%; height: auto; display: block; background: rgba(5, 12, 24, 0.6); }
.canvas-hint { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); color: var(--muted); background: rgba(8,17,32,0.8); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; }
.node-properties, .route-description-preview, .steps-editor { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 14px; }
.prop-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.prop-row label { width: 60px; color: var(--muted); flex-shrink: 0; }
.prop-actions { display: flex; gap: 8px; }
.qr-filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.route-editor-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
.route-list { display: grid; gap: 8px; }
.route-type-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.route-type-tab { padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,0.05); color: var(--muted); }
.route-type-tab.active { background: rgba(91,140,255,0.18); color: var(--text); }
.no-route-selected { min-height: 220px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.description-box { margin-top: 10px; background: rgba(0,0,0,0.18); border-radius: 14px; padding: 14px; min-height: 90px; color: #dce7f7; }
.fire-status-display { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: #b8ffe7; }
.fire-control-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.monitoring-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.monitoring-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.legend-dot.blue { background: #60a5fa; }
.legend-dot.orange { background: #f59e0b; }
.legend-dot.red { background: #fb7185; }
.user-count-badge { padding: 8px 12px; border-radius: 999px; background: rgba(91,140,255,0.18); }
.user-list { display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.user-list-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,0.03); }
.user-item-loc, .user-item-time { color: var(--muted); margin-top: 4px; }
.alert-log { min-height: 180px; background: rgba(0,0,0,0.26); border-radius: 18px; padding: 14px; color: #cfe0ff; font-family: monospace; }
@media (max-width: 1200px) {
  .dashboard-stats, .monitoring-layout, .route-editor-layout { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .dashboard-stats, .monitoring-layout, .route-editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-main { padding: 12px; }
  .glass-topbar { padding: 14px; flex-direction: column; align-items: stretch; }
  .topbar-right, .topbar-left { justify-content: space-between; }
}