* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0a0e17;
  color: #e0e0e0;
  min-height: 100vh;
  overflow: hidden;
}

/* ===== LOGIN ===== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(ellipse at center, rgba(10,15,30,0.9), rgba(0,0,0,1));
}
.login-box {
  background: rgba(15, 18, 30, 0.95);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 48px 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #fff;
  margin-bottom: 4px;
}
.login-subtitle {
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 32px;
}
#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-form input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
#login-form input:focus {
  border-color: rgba(100,150,255,0.4);
}
.login-error {
  color: #ff5555;
  font-size: 12px;
  min-height: 16px;
}
.login-btn {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #2255aa, #3377cc);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.login-btn:hover {
  background: linear-gradient(135deg, #3366bb, #4488dd);
  transform: translateY(-1px);
}

/* ===== HEADER ===== */
#admin-header {
  display: flex;
  align-items: center;
  height: 56px;
  background: rgba(12, 15, 25, 0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 20px;
  gap: 24px;
  z-index: 100;
  position: relative;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-title { font-size: 18px; font-weight: 800; letter-spacing: 4px; color: #fff; }
.header-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(100,150,255,0.15);
  color: #88aaff;
  padding: 3px 8px;
  border-radius: 4px;
}
.header-tabs { display: flex; gap: 4px; margin-left: 32px; }
.tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.tab-btn:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.tab-btn.active { color: #fff; background: rgba(100,150,255,0.15); }
.logout-btn {
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
}
.logout-btn:hover { color: #ff6666; border-color: rgba(255,100,100,0.3); }

/* ===== TABS ===== */
.tab-content { display: none; height: calc(100vh - 56px); }
.tab-content.active { display: flex; }

/* ===== DASHBOARD ===== */
#tab-dashboard { padding: 24px; align-items: flex-start; justify-content: center; }
.dashboard-grid { display: flex; gap: 20px; width: 100%; max-width: 800px; }
.card {
  flex: 1;
  background: rgba(15, 18, 30, 0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* Status */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: background 0.3s;
}
.status-dot.online { background: #44ff66; box-shadow: 0 0 8px rgba(68,255,102,0.4); }
.status-dot.offline { background: #ff4444; box-shadow: 0 0 8px rgba(255,68,68,0.4); }
.status-dot.maintenance { background: #ffaa00; box-shadow: 0 0 8px rgba(255,170,0,0.4); }
.status-label {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px 12px;
}
.stat-label { display: block; font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { display: block; font-size: 16px; font-weight: 600; margin-top: 4px; }

/* Controls */
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctrl-btn {
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ctrl-start { background: rgba(68,255,102,0.12); color: #44ff66; border: 1px solid rgba(68,255,102,0.2); }
.ctrl-start:hover { background: rgba(68,255,102,0.2); }
.ctrl-stop { background: rgba(255,68,68,0.12); color: #ff4444; border: 1px solid rgba(255,68,68,0.2); }
.ctrl-stop:hover { background: rgba(255,68,68,0.2); }
.ctrl-restart { background: rgba(100,150,255,0.12); color: #88aaff; border: 1px solid rgba(100,150,255,0.2); }
.ctrl-restart:hover { background: rgba(100,150,255,0.2); }
.ctrl-maintenance { background: rgba(255,170,0,0.12); color: #ffaa00; border: 1px solid rgba(255,170,0,0.2); }
.ctrl-maintenance:hover { background: rgba(255,170,0,0.2); }
.ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ctrl-feedback {
  margin-top: 12px;
  font-size: 12px;
  min-height: 18px;
  text-align: center;
}

/* ===== MAP EDITOR ===== */
.editor-layout {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}
.editor-sidebar {
  width: 200px;
  background: rgba(12, 15, 25, 0.95);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}
.editor-sidebar.right {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.06);
}
.editor-sidebar h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
}
.elem-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.elem-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.elem-btn.active { background: rgba(100,150,255,0.15); color: #88aaff; }
.elem-btn span { font-size: 16px; }
.editor-sidebar hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 10px 0;
}
.editor-stats {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  line-height: 1.8;
}
.editor-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #080c14;
}
.editor-viewport canvas { display: block; }

/* Properties panel */
.prop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.prop-row label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  min-width: 50px;
}
.prop-row input, .prop-row select {
  width: 100px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  outline: none;
}
.prop-row span { font-size: 13px; color: #fff; }
.prop-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: rgba(100,150,255,0.15);
  color: #88aaff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.prop-btn:hover { background: rgba(100,150,255,0.25); }
.prop-btn-danger { background: rgba(255,68,68,0.15); color: #ff6666; }
.prop-btn-danger:hover { background: rgba(255,68,68,0.25); }

/* Editor bottom bar */
.editor-bottom {
  position: absolute;
  bottom: 0;
  left: 200px;
  right: 0;
  height: 48px;
  background: rgba(12, 15, 25, 0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  z-index: 10;
}
.editor-action-btn {
  padding: 6px 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.editor-action-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.editor-action-btn.accent {
  background: rgba(68,255,102,0.12);
  color: #44ff66;
  border-color: rgba(68,255,102,0.2);
}
.editor-action-btn.accent:hover { background: rgba(68,255,102,0.2); }
.editor-status { font-size: 12px; color: rgba(255,255,255,0.3); margin-left: auto; }

/* ===== TOOL EDITOR ===== */
.tool-editor-layout {
  display: flex;
  width: 100%;
  height: 100%;
}
.tool-sidebar {
  width: 280px;
  background: rgba(12, 15, 25, 0.95);
  border-left: 1px solid rgba(255,255,255,0.06);
  padding: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}
.tool-sidebar h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
}
.tool-sidebar h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  margin: 12px 0 6px;
}
.tool-sidebar hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 12px 0;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.slider-row label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  min-width: 16px;
}
.slider-row input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #88aaff;
  border-radius: 50%;
  cursor: pointer;
}
.slider-row span {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  min-width: 36px;
  text-align: right;
  font-family: monospace;
}
.tool-sidebar select {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
